diff --git a/packages/app/package.json b/packages/app/package.json index 2df1a08351..45ec112b8b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -8,7 +8,7 @@ "export": "next export", "check-types": "tsc --noEmit", "jest-preview": "jest-preview", - "test:jest": "jest --coverage --detectOpenHandles", + "test:jest": "NODE_OPTIONS=--max-old-space-size=2048 jest --coverage", "prepublishOnly": "pinst --disable", "postpublish": "pinst --enable", "storybook": "storybook dev -p 6006", @@ -88,7 +88,7 @@ "@testing-library/user-event": "14.4.3", "@typechain/ethers-v5": "^10.2.1", "@types/cors": "^2.8.13", - "@types/jest": "27.0.2", + "@types/jest": "^29.5.3", "@types/lodash": "4.14.195", "@types/node": "14.0.13", "@types/react": "18.2.16", @@ -102,8 +102,8 @@ "css-loader": "^6.8.1", "eslint-config-turbo": "1.10.11", "html-to-image": "1.11.11", - "jest": "28.1.0", - "jest-environment-jsdom": "28.1.0", + "jest": "^29.6.2", + "jest-environment-jsdom": "^29.6.2", "jest-preview": "^0.3.1", "jest-transformer-svg": "^2.0.1", "next-router-mock": "0.9.7", diff --git a/packages/app/src/__tests__/pages/crossMargin.test.tsx b/packages/app/src/__tests__/pages/crossMargin.test.tsx new file mode 100644 index 0000000000..337b973f15 --- /dev/null +++ b/packages/app/src/__tests__/pages/crossMargin.test.tsx @@ -0,0 +1,82 @@ +import { fireEvent, render } from '@testing-library/react' +import { ReactNode } from 'react' + +import { mockFuturesService } from 'state/__mocks__/sdk' + +import { mockResizeObserver } from '../../../testing/unit/mocks/app' +import { createState } from '../../../testing/unit/mocks/data/app' +import { mockUseWindowSize } from '../../../testing/unit/mocks/hooks' +import mockConnector from '../../../testing/unit/mocks/mockConnector' +import MockProviders from '../../../testing/unit/mocks/MockProviders' +import { mockReactQuery } from '../../../testing/unit/mocks/queries' +import Market from '../../pages/market' +import sdk from '../../state/sdk' + +jest.mock('../../state/sdk') + +jest.mock('../../queries/futures/useGetFuturesTrades', () => { + return jest.fn(() => ({ + data: [], + isLoading: false, + fetchNextPage: () => {}, + })) +}) + +jest.mock('../../components/Media', () => ({ + ...jest.requireActual('../../components/Media'), + DesktopOnlyView: ({ children }: { children: ReactNode }) =>
{children}
, + MobileOnlyView: ({ children }: { children: ReactNode }) =>
{children}
, +})) + +describe('Futures market page - cross margin', () => { + beforeAll(() => { + jest.setTimeout(60000) + mockUseWindowSize() + mockReactQuery() + mockResizeObserver() + mockConnector() + }) + + beforeEach(() => { + // Reset the SDK mock + // @ts-ignore + sdk.futures = mockFuturesService() + }) + + test('Displays the correct trade panel', async () => { + const { findByTestId } = render( + + + + ) + + await findByTestId('cross-margin-trade-panel') + }) + + test('Can create a new cross margin account', async () => { + sdk.perpsV3.getPerpsV3AccountIds = () => Promise.resolve([]) + + const { findByTestId, findByText } = render( + + + + ) + + const newAccountBtn = await findByTestId('create-cross-margin-account-button') + fireEvent.click(newAccountBtn) + + sdk.perpsV3.getPerpsV3AccountIds = () => Promise.resolve([100]) + + const submitButton = await findByText('Create Account') + fireEvent.click(submitButton) + + // Users account has been created but there is no available margin + await findByText('No available margin') + }) +}) diff --git a/packages/app/src/__tests__/pages/market.test.tsx b/packages/app/src/__tests__/pages/smartMargin.test.tsx similarity index 90% rename from packages/app/src/__tests__/pages/market.test.tsx rename to packages/app/src/__tests__/pages/smartMargin.test.tsx index 5306df7cfe..3ea217f358 100644 --- a/packages/app/src/__tests__/pages/market.test.tsx +++ b/packages/app/src/__tests__/pages/smartMargin.test.tsx @@ -1,10 +1,11 @@ -import { FuturesMarket, PositionSide } from '@kwenta/sdk/types' +import { PerpsMarketV2, PositionSide } from '@kwenta/sdk/types' import { wei } from '@synthetixio/wei' import { fireEvent, render, waitFor } from '@testing-library/react' import { ReactNode } from 'react' import { mockFuturesService } from 'state/__mocks__/sdk' import { fetchMarkets } from 'state/futures/actions' +import { selectTradePreview } from 'state/futures/smartMargin/selectors' import { mockResizeObserver } from '../../../testing/unit/mocks/app' import { PRELOADED_STATE } from '../../../testing/unit/mocks/data/app' @@ -19,7 +20,6 @@ import mockConnector from '../../../testing/unit/mocks/mockConnector' import MockProviders from '../../../testing/unit/mocks/MockProviders' import { mockReactQuery } from '../../../testing/unit/mocks/queries' import Market from '../../pages/market' -import { selectTradePreview } from '../../state/futures/selectors' import sdk from '../../state/sdk' import { setupStore } from '../../state/store' @@ -57,7 +57,7 @@ describe('Futures market page - smart margin', () => { test('Calculates correct fees from trade preview', async () => { const { findByTestId, findByText } = render( @@ -76,8 +76,8 @@ describe('Futures market page - smart margin', () => { test('Submits LONG order with correct desired fill price', async () => { const store = setupStore(preloadedStateWithSmartMarginAccount()) - const { findByTestId, findByText } = render( - + const { findByTestId, findByText, findAllByText } = render( + ) @@ -97,9 +97,9 @@ describe('Futures market page - smart margin', () => { const confirmButton = await findByTestId('trade-confirm-order-button') fireEvent.click(confirmButton) - // Preview generated fill price displayed in confirmation view - const fillPrice = await findByText('$1,847.76') - expect(fillPrice).toBeTruthy() + // Preview generated fill price displayed in confirmation view and trade panel + const fillPrice = await findAllByText('$1,847.76') + expect(fillPrice.length).toEqual(2) // Desired fill price is higher than fill price by 1% // (as a long order the price is worse to account for slippage in delayed order) @@ -110,8 +110,8 @@ describe('Futures market page - smart margin', () => { test('Submits SHORT order with correct desired fill price', async () => { const store = setupStore(preloadedStateWithSmartMarginAccount()) - const { findByTestId, findByText } = render( - + const { findByTestId, findByText, findAllByText } = render( + ) @@ -134,9 +134,9 @@ describe('Futures market page - smart margin', () => { const confirmButton = await findByTestId('trade-confirm-order-button') fireEvent.click(confirmButton) - // Preview generated fill price displayed in confirmation view - const fillPrice = await findByText('$1,847.76') - expect(fillPrice).toBeTruthy() + // Preview generated fill price displayed in confirmation view and trade panel + const fillPrice = await findAllByText('$1,847.76') + expect(fillPrice.length).toEqual(2) // Desired fill price is lower than fill price by 1% // (as a short order the price is worse to account for slippage in delayed order) @@ -148,13 +148,13 @@ describe('Futures market page - smart margin', () => { test('Displays error when trade exceeds max OI', async () => { // Update the mock to return some different data sdk.futures.getMarkets = () => - Promise.resolve([{ ...SDK_MARKETS[1], marketLimitUsd: wei(100000) } as FuturesMarket]) + Promise.resolve([{ ...SDK_MARKETS[1], marketLimitUsd: wei(100000) } as PerpsMarketV2]) const store = setupStore( preloadedStateWithSmartMarginAccount(mockSmartMarginAccount('1000000')) ) const { findByTestId, findByText } = render( - + ) @@ -171,10 +171,10 @@ describe('Futures market page - smart margin', () => { }) test('Trade panel is disabled when market is closed', async () => { - sdk.futures.getMarkets = () => Promise.resolve([...SDK_MARKETS] as FuturesMarket[]) + sdk.futures.getMarkets = () => Promise.resolve([...SDK_MARKETS] as PerpsMarketV2[]) const store = setupStore(preloadedStateWithSmartMarginAccount()) const { findByTestId, findByText } = render( - + ) @@ -192,7 +192,7 @@ describe('Futures market page - smart margin', () => { expect(submitButton).toBeEnabled() sdk.futures.getMarkets = () => - Promise.resolve([{ ...SDK_MARKETS[1], isSuspended: true } as FuturesMarket]) + Promise.resolve([{ ...SDK_MARKETS[1], isSuspended: true } as PerpsMarketV2]) waitFor(() => store.dispatch(fetchMarkets())) @@ -221,7 +221,7 @@ describe('Futures market page - stop loss validation', () => { test('Restricts stop loss for LONG trade at correct price depending on leverage', async () => { const store = setupStore(preloadedStateWithSmartMarginAccount()) const { findByTestId, findByText } = render( - + ) @@ -248,7 +248,7 @@ describe('Futures market page - stop loss validation', () => { fireEvent.change(stopLossInput, { target: { value: '1700' } }) // Min / Max SL is shown when invalid - const slMinMaxLabel = await findByText('Min: 1,701.82') + const slMinMaxLabel = await findByText('Min: 1,735.52') expect(slMinMaxLabel).toBeTruthy() expect(submitButton).toBeDisabled() @@ -260,12 +260,12 @@ describe('Futures market page - stop loss validation', () => { test('Restricts stop loss for SHORT trade at correct price depending on leverage', async () => { const store = setupStore(preloadedStateWithSmartMarginAccount()) const { findByTestId, findByText } = render( - + ) - sdk.futures.getCrossMarginTradePreview = () => + sdk.futures.getSmartMarginTradePreview = () => Promise.resolve({ ...MOCK_TRADE_PREVIEW, liqPrice: wei('2172.467580351348039045'), @@ -299,7 +299,7 @@ describe('Futures market page - stop loss validation', () => { // Min / Max SL is shown when invalid // Liqudation price is 2,172.46 and stop is limited to 2,172.29 - const slMinMaxLabel = await findByText('Max: 2,150.74') + const slMinMaxLabel = await findByText('Max: 2,107.29') expect(slMinMaxLabel).toBeTruthy() expect(submitButton).toBeDisabled() @@ -312,12 +312,12 @@ describe('Futures market page - stop loss validation', () => { test('Stop loss becomes disabled above a certain leverage', async () => { const store = setupStore(preloadedStateWithSmartMarginAccount()) const { findByTestId, findByText } = render( - + ) - sdk.futures.getCrossMarginTradePreview = () => + sdk.futures.getSmartMarginTradePreview = () => Promise.resolve({ ...MOCK_TRADE_PREVIEW, liqPrice: wei('1795'), @@ -352,12 +352,12 @@ describe('Futures market page - stop loss validation', () => { test('Displays stop-loss warning in confirmation view when within 5% of liquidation price', async () => { const store = setupStore(preloadedStateWithSmartMarginAccount()) const { findByTestId, findByText } = render( - + ) - sdk.futures.getCrossMarginTradePreview = () => + sdk.futures.getSmartMarginTradePreview = () => Promise.resolve({ ...MOCK_TRADE_PREVIEW, liqPrice: wei('2172.467580351348039045'), diff --git a/packages/app/src/components/Nav/FuturesIcon.tsx b/packages/app/src/components/Nav/FuturesIcon.tsx index 28725c691e..7568808f8b 100644 --- a/packages/app/src/components/Nav/FuturesIcon.tsx +++ b/packages/app/src/components/Nav/FuturesIcon.tsx @@ -1,4 +1,4 @@ -import { FuturesAccountType } from '@kwenta/sdk/utils' +import { FuturesMarginType } from '@kwenta/sdk/types' import CrossMarginIconDark from 'assets/svg/futures/cross-margin-icon-dark.svg' import CrossMarginIconLight from 'assets/svg/futures/cross-margin-icon-light.svg' @@ -8,7 +8,7 @@ import { useAppSelector } from 'state/hooks' import { selectCurrentTheme } from 'state/preferences/selectors' type IconProps = { - type: FuturesAccountType + type: FuturesMarginType } export default function FuturesIcon(props: IconProps) { @@ -17,7 +17,7 @@ export default function FuturesIcon(props: IconProps) { const CrossMarginIcon = currentTheme === 'dark' ? CrossMarginIconDark : CrossMarginIconLight const IsolatedMarginIcon = currentTheme === 'dark' ? IsolatedMarginIconDark : IsolatedMarginIconLight - return props.type === 'cross_margin' || props.type === 'smart_margin' ? ( + return props.type === FuturesMarginType.SMART_MARGIN ? ( ) : ( diff --git a/packages/app/src/components/Table/Table.tsx b/packages/app/src/components/Table/Table.tsx index a4ebdf34f7..af191e46ec 100644 --- a/packages/app/src/components/Table/Table.tsx +++ b/packages/app/src/components/Table/Table.tsx @@ -190,9 +190,9 @@ const Table = ({ noResultsMessage ) : ( - {table.getRowModel().rows.map((row, idx) => { + {table.getRowModel().rows.map((row, i) => { const localRef = - lastRef && idx === table.getState().pagination.pageSize - 1 ? lastRef : defaultRef + lastRef && i === table.getState().pagination.pageSize - 1 ? lastRef : defaultRef return ( = memo( return ( - {props.children ?? formatNumber(value, options)} + {props.children ?? formatNumber(value ?? 0, options)} {suffix} ) diff --git a/packages/app/src/constants/defaults.ts b/packages/app/src/constants/defaults.ts index 62c7e47883..af9ef65c54 100644 --- a/packages/app/src/constants/defaults.ts +++ b/packages/app/src/constants/defaults.ts @@ -1,3 +1,5 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' + import { Language } from 'translations/constants' // app defaults @@ -31,10 +33,10 @@ export const DEFAULT_LEADERBOARD_ROWS = 20 // for perps v2 export const DEFAULT_DELAYED_EXECUTION_BUFFER = 15 -export const DEFAULT_DELAYED_CANCEL_BUFFER = 15 +export const DEFAULT_DELAYED_CANCEL_BUFFER = 10 -export const CROSS_MARGIN_ENABLED = true +export const CROSS_MARGIN_ENABLED = process.env.NODE_ENV !== 'production' -export const DEFAULT_FUTURES_MARGIN_TYPE = 'cross_margin' +export const DEFAULT_FUTURES_MARGIN_TYPE = FuturesMarginType.SMART_MARGIN export const DEFAULT_LEVERAGE = '1' diff --git a/packages/app/src/constants/links.ts b/packages/app/src/constants/links.ts index d5e8c77996..5a254fadd9 100644 --- a/packages/app/src/constants/links.ts +++ b/packages/app/src/constants/links.ts @@ -53,7 +53,7 @@ export const EXTERNAL_LINKS = { Home: 'https://optimism.io/', }, Trade: { - PerpsV2: 'https://kwenta.eth.limo/market/?accountType=cross_margin&asset=sETH', + PerpsV2: 'https://kwenta.eth.limo/market/?accountType=smart_margin&asset=sETH', Spot: 'https://kwenta.eth.limo/exchange/', V1: 'https://v1.kwenta.eth.limo/dashboard', }, diff --git a/packages/app/src/constants/queryKeys.ts b/packages/app/src/constants/queryKeys.ts index 7d04daf240..d2fe7ac2e2 100644 --- a/packages/app/src/constants/queryKeys.ts +++ b/packages/app/src/constants/queryKeys.ts @@ -1,5 +1,5 @@ import { Period } from '@kwenta/sdk/constants' -import { NetworkId, FuturesAccountType, FuturesMarketAsset } from '@kwenta/sdk/types' +import { NetworkId, FuturesMarketAsset } from '@kwenta/sdk/types' import { CurrencyKey } from './currency' @@ -239,25 +239,6 @@ export const QUERY_KEYS = { TotalLiquidations: ['futures', 'totalLiquidations'], TotalTrades: (networkId: NetworkId) => ['futures', 'totalTrades', networkId], TotalVolume: ['futures', 'totalVolume'], - PotentialTrade: ( - networkId: NetworkId, - market: string | null, - tradeSize: string, - walletAddress: string, - selectedAccountType: FuturesAccountType, - marginDelta: string, - leverageSide: string - ) => [ - 'futures', - 'potentialTrade', - tradeSize, - networkId, - market, - walletAddress, - selectedAccountType, - marginDelta, - leverageSide, - ], MarketLimit: (networkId: NetworkId, market: string | null) => [ 'futures', 'marketLimit', diff --git a/packages/app/src/constants/routes.ts b/packages/app/src/constants/routes.ts index 1696439923..5858d3e27b 100644 --- a/packages/app/src/constants/routes.ts +++ b/packages/app/src/constants/routes.ts @@ -1,4 +1,6 @@ -import { FuturesAccountType, FuturesMarketAsset } from '@kwenta/sdk/types' +import { FuturesMarketAsset } from '@kwenta/sdk/types' + +import { AppFuturesMarginType } from 'state/futures/common/types' import { EXTERNAL_LINKS } from './links' @@ -32,22 +34,23 @@ export const ROUTES = { Into: (currencyKey: string) => `/exchange/?quote=${currencyKey}`, }, Markets: { - Home: (accountType: FuturesAccountType) => formatUrl('/market', { accountType, asset: 'sETH' }), - MarketPair: (asset: FuturesMarketAsset | string, accountType: FuturesAccountType) => + Home: (accountType: AppFuturesMarginType) => + formatUrl('/market', { accountType, asset: 'sETH' }), + MarketPair: (asset: FuturesMarketAsset | string, accountType: AppFuturesMarginType) => formatUrl('/market', { asset, accountType }), - Position: (asset: FuturesMarketAsset, accountType: FuturesAccountType) => + Position: (asset: FuturesMarketAsset, accountType: AppFuturesMarginType) => formatUrl('/market', { asset, accountType, tab: 'position', }), - Orders: (asset: FuturesMarketAsset, accountType: FuturesAccountType) => + Orders: (asset: FuturesMarketAsset, accountType: AppFuturesMarginType) => formatUrl('/market', { asset, accountType, tab: 'orders' }), - ConditionalOrders: (asset: FuturesMarketAsset, accountType: FuturesAccountType) => + ConditionalOrders: (asset: FuturesMarketAsset, accountType: AppFuturesMarginType) => formatUrl('/market', { asset, accountType, tab: 'conditional_orders' }), - Trades: (asset: FuturesMarketAsset, accountType: FuturesAccountType) => + Trades: (asset: FuturesMarketAsset, accountType: AppFuturesMarginType) => formatUrl('/market', { asset, accountType, tab: 'trades' }), - Transfers: (asset: FuturesMarketAsset, accountType: FuturesAccountType) => + Transfers: (asset: FuturesMarketAsset, accountType: AppFuturesMarginType) => formatUrl('/market', { asset, accountType, tab: 'transfers' }), }, Stats: { @@ -75,7 +78,10 @@ export const SUB_MENUS = { ], } -export const setLastVisited = (baseCurrencyPair: string, accountType: FuturesAccountType): void => { +export const setLastVisited = ( + baseCurrencyPair: string, + accountType: AppFuturesMarginType +): void => { localStorage.setItem('lastVisited', ROUTES.Markets.MarketPair(baseCurrencyPair, accountType)) } diff --git a/packages/app/src/hooks/useAverageEntryPrice.ts b/packages/app/src/hooks/useAverageEntryPrice.ts index 7741825418..bd6666a99c 100644 --- a/packages/app/src/hooks/useAverageEntryPrice.ts +++ b/packages/app/src/hooks/useAverageEntryPrice.ts @@ -1,7 +1,7 @@ import { FuturesPositionHistory, PositionSide } from '@kwenta/sdk/types' import { useMemo } from 'react' -import { selectTradePreview } from 'state/futures/selectors' +import { selectTradePreview } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' // Used to calculate the new average entry price of a modified position diff --git a/packages/app/src/hooks/usePerpsContracts.ts b/packages/app/src/hooks/usePerpsContracts.ts index 46229ae23d..6ef437ae49 100644 --- a/packages/app/src/hooks/usePerpsContracts.ts +++ b/packages/app/src/hooks/usePerpsContracts.ts @@ -2,20 +2,20 @@ import { PerpsV2Market, PerpsV2Market__factory } from '@kwenta/sdk/types' import { useMemo } from 'react' import Connector from 'containers/Connector' -import { selectMarketInfo } from 'state/futures/selectors' +import { selectV2MarketInfo } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' export default function usePerpsContracts(): { perpsMarketContract: PerpsV2Market | null } { const { signer } = Connector.useContainer() - const marketInfo = useAppSelector(selectMarketInfo) + const marketInfo = useAppSelector(selectV2MarketInfo) const perpsMarketContract = useMemo(() => { - if (!signer || !marketInfo?.market) return null + if (!signer || !marketInfo?.marketAddress) return null - return PerpsV2Market__factory.connect(marketInfo.market, signer) - }, [signer, marketInfo?.market]) + return PerpsV2Market__factory.connect(marketInfo.marketAddress, signer) + }, [signer, marketInfo?.marketAddress]) return { perpsMarketContract } } diff --git a/packages/app/src/hooks/useStatsData.ts b/packages/app/src/hooks/useStatsData.ts index e5545f9928..d4b2ed7e6f 100644 --- a/packages/app/src/hooks/useStatsData.ts +++ b/packages/app/src/hooks/useStatsData.ts @@ -2,7 +2,10 @@ import { useMemo } from 'react' import { UseQueryResult } from 'react-query' import useGetFile from 'queries/files/useGetFile' -import { selectOptimismMarkPrices, selectOptimismMarkets } from 'state/futures/selectors' +import { + selectOptimismMarkPrices, + selectOptimismMarkets, +} from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import { selectMinTimestamp } from 'state/stats/selectors' diff --git a/packages/app/src/pages/market.tsx b/packages/app/src/pages/market.tsx index 899cce6da4..2d85d6b10d 100644 --- a/packages/app/src/pages/market.tsx +++ b/packages/app/src/pages/market.tsx @@ -1,44 +1,49 @@ -import { FuturesMarketAsset } from '@kwenta/sdk/types' +import { FuturesMarginType, FuturesMarketAsset } from '@kwenta/sdk/types' import { MarketKeyByAsset } from '@kwenta/sdk/utils' import { useRouter } from 'next/router' -import { useEffect, FC, useState, ReactNode } from 'react' +import { useEffect, FC, ReactNode, useMemo } from 'react' import styled from 'styled-components' import Loader from 'components/Loader' import { DesktopOnlyView, MobileOrTabletView } from 'components/Media' +import { CROSS_MARGIN_ENABLED } from 'constants/defaults' import Connector from 'containers/Connector' import useIsL2 from 'hooks/useIsL2' import useWindowSize from 'hooks/useWindowSize' +import CloseCrossMarginPositionModal from 'sections/futures/ClosePositionModal/CloseCrossMarginPositionModal' import ClosePositionModal from 'sections/futures/ClosePositionModal/ClosePositionModal' -import CrossMarginOnboard from 'sections/futures/CrossMarginOnboard' +import CreatePerpsV3AccountModal from 'sections/futures/CreatePerpsV3AccountModal' import EditPositionMarginModal from 'sections/futures/EditPositionModal/EditPositionMarginModal' import EditPositionSizeModal from 'sections/futures/EditPositionModal/EditPositionSizeModal' import EditStopLossAndTakeProfitModal from 'sections/futures/EditPositionModal/EditStopLossAndTakeProfitModal' import MarketInfo from 'sections/futures/MarketInfo' import MarketHead from 'sections/futures/MarketInfo/MarketHead' import MobileTrade from 'sections/futures/MobileTrade/MobileTrade' +import SmartMarginOnboard from 'sections/futures/SmartMarginOnboard' import { TRADE_PANEL_WIDTH_LG, TRADE_PANEL_WIDTH_MD } from 'sections/futures/styles' +import DepositWithdrawCrossMarginModal from 'sections/futures/Trade/DepositWithdrawCrossMargin' import FuturesUnsupportedNetwork from 'sections/futures/Trade/FuturesUnsupported' -import SwitchToSmartMargin from 'sections/futures/Trade/SwitchToSmartMargin' -import TradeIsolatedMargin from 'sections/futures/Trade/TradePanel' -import TransferIsolatedMarginModal from 'sections/futures/Trade/TransferIsolatedMarginModal' +import TradePanelCrossMargin from 'sections/futures/Trade/TradePanelCrossMargin' +import TradePanelSmartMargin from 'sections/futures/Trade/TradePanelSmartMargin' import TransferSmartMarginModal from 'sections/futures/Trade/TransferSmartMarginModal' -import DelayedOrderConfirmationModal from 'sections/futures/TradeConfirmation/DelayedOrderConfirmationModal' +import DelayedOrderConfirmationModal from 'sections/futures/TradeConfirmation/CrossMarginOrderConfirmation' import TradeConfirmationModalCrossMargin from 'sections/futures/TradeConfirmation/TradeConfirmationModalCrossMargin' import AppLayout from 'sections/shared/Layout/AppLayout' import { setOpenModal } from 'state/app/reducer' import { selectShowModal, selectShowPositionModal } from 'state/app/selectors' import { clearTradeInputs } from 'state/futures/actions' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' +import { AppFuturesMarginType } from 'state/futures/common/types' +import { selectCrossMarginSupportedNetwork } from 'state/futures/crossMargin/selectors' +import { selectShowCrossMarginOnboard } from 'state/futures/crossMargin/selectors' import { usePollMarketFuturesData } from 'state/futures/hooks' -import { setFuturesAccountType, setMarketAsset } from 'state/futures/reducer' +import { setFuturesAccountType } from 'state/futures/reducer' +import { setMarketAsset } from 'state/futures/smartMargin/reducer' import { - selectActiveIsolatedPositionsCount, - selectCMAccountQueryStatus, - selectCrossMarginAccount, - selectFuturesType, - selectMarketAsset, - selectShowCrossMarginOnboard, -} from 'state/futures/selectors' + selectShowSmartMarginOnboard, + selectSmartMarginAccount, + selectSmartMarginAccountQueryStatus, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import { FetchStatus } from 'state/types' import { PageContent } from 'styles/common' @@ -56,14 +61,24 @@ const Market: MarketComponent = () => { const routerMarketAsset = router.query.asset as FuturesMarketAsset const setCurrentMarket = useAppSelector(selectMarketAsset) - const showOnboard = useAppSelector(selectShowCrossMarginOnboard) + const showOnboard = useAppSelector(selectShowSmartMarginOnboard) + const showCrossMarginOnboard = useAppSelector(selectShowCrossMarginOnboard) const openModal = useAppSelector(selectShowModal) const showPositionModal = useAppSelector(selectShowPositionModal) const accountType = useAppSelector(selectFuturesType) const selectedMarketAsset = useAppSelector(selectMarketAsset) + const crossMarginSupportedNetwork = useAppSelector(selectCrossMarginSupportedNetwork) - const routerAccountType = - router.query.accountType === 'cross_margin' ? 'cross_margin' : 'isolated_margin' + const routerAccountType = useMemo(() => { + if ( + router.query.accountType === 'cross_margin' && + crossMarginSupportedNetwork && + CROSS_MARGIN_ENABLED + ) { + return router.query.accountType as AppFuturesMarginType + } + return FuturesMarginType.SMART_MARGIN + }, [router.query.accountType, crossMarginSupportedNetwork]) useEffect(() => { if (router.isReady && accountType !== routerAccountType) { @@ -92,7 +107,8 @@ const Market: MarketComponent = () => { return ( <> - + + {lessThanWidth('lg') ? ( @@ -115,19 +131,22 @@ const Market: MarketComponent = () => { - {showPositionModal?.type === 'futures_close_position' && } + {showPositionModal?.type === 'smart_margin_close_position' && } + {showPositionModal?.type === 'cross_margin_close_position' && ( + + )} {showPositionModal?.type === 'futures_edit_stop_loss_take_profit' && ( )} {showPositionModal?.type === 'futures_edit_position_size' && } {showPositionModal?.type === 'futures_edit_position_margin' && } - {openModal === 'futures_isolated_transfer' && ( - dispatch(setOpenModal(null))} /> )} - {openModal === 'futures_cross_withdraw' && ( + {openModal === 'futures_deposit_withdraw_smart_margin' && ( dispatch(setOpenModal(null))} @@ -135,7 +154,7 @@ const Market: MarketComponent = () => { )} {openModal === 'futures_confirm_smart_margin_trade' && } - {openModal === 'futures_confirm_isolated_margin_trade' && } + {openModal === 'futures_confirm_cross_margin_trade' && } ) } @@ -145,31 +164,24 @@ function TradePanelDesktop() { const isL2 = useIsL2() const { walletAddress } = Connector.useContainer() const accountType = useAppSelector(selectFuturesType) - const queryStatus = useAppSelector(selectCMAccountQueryStatus) + const queryStatus = useAppSelector(selectSmartMarginAccountQueryStatus) + const smartMarginAccount = useAppSelector(selectSmartMarginAccount) const openModal = useAppSelector(selectShowModal) - const crossMarginAccount = useAppSelector(selectCrossMarginAccount) - const isolatedPositionsCount = useAppSelector(selectActiveIsolatedPositionsCount) - const [open, setOpen] = useState(false) - - useEffect( - () => setOpen(accountType === 'isolated_margin' && isolatedPositionsCount === 0), - [accountType, isolatedPositionsCount] - ) if ( walletAddress && !isL2 && openModal !== 'futures_smart_margin_socket' && - openModal !== 'futures_cross_withdraw' + openModal !== 'futures_deposit_withdraw_smart_margin' ) { return } if ( !router.isReady || - (accountType === 'cross_margin' && + (accountType === FuturesMarginType.SMART_MARGIN && walletAddress && - !crossMarginAccount && + !smartMarginAccount && queryStatus.status === FetchStatus.Idle) ) { return ( @@ -179,7 +191,11 @@ function TradePanelDesktop() { ) } - return open ? setOpen(false)} /> : + return accountType === FuturesMarginType.CROSS_MARGIN ? ( + + ) : ( + + ) } Market.getLayout = (page) => {page} diff --git a/packages/app/src/queries/futures/types.ts b/packages/app/src/queries/futures/types.ts index 7cfbb4f778..752ae6993e 100644 --- a/packages/app/src/queries/futures/types.ts +++ b/packages/app/src/queries/futures/types.ts @@ -1,14 +1,5 @@ import Wei from '@synthetixio/wei' -export type FuturesStat = { - account: string - pnlWithFeesPaid: Wei - liquidations: Wei - totalTrades: Wei - totalVolume: Wei - pnl?: Wei -} - export type AccountStat = { rank: number account: string @@ -32,8 +23,3 @@ export type FuturesCumulativeStats = { totalLiquidations: string averageTradeSize: string } - -export enum FuturesAccountTypes { - ISOLATED_MARGIN = 'isolated_margin', - CROSS_MARGIN = 'cross_margin', -} diff --git a/packages/app/src/queries/synths/type.ts b/packages/app/src/queries/synths/type.ts deleted file mode 100644 index ccc53d3625..0000000000 --- a/packages/app/src/queries/synths/type.ts +++ /dev/null @@ -1,5 +0,0 @@ -import Wei from '@synthetixio/wei' - -export type SynthsVolumes = { - [asset: string]: Wei -} diff --git a/packages/app/src/queries/synths/useGetWalletTrades.ts b/packages/app/src/queries/synths/useGetWalletTrades.ts deleted file mode 100644 index d6b24f2181..0000000000 --- a/packages/app/src/queries/synths/useGetWalletTrades.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { NetworkId } from '@kwenta/sdk/types' -import { getMainEndpoint } from '@kwenta/sdk/utils' -import request, { gql } from 'graphql-request' -import { useQuery, UseQueryOptions } from 'react-query' - -import QUERY_KEYS from 'constants/queryKeys' -import Connector from 'containers/Connector' -import logError from 'utils/logError' - -import { SynthsVolumes } from './type' - -const useGetWalletTrades = ( - walletAddress: string, - options?: UseQueryOptions -) => { - const { network } = Connector.useContainer() - const synthsEndpoint = getMainEndpoint(network?.id as NetworkId) - - return useQuery( - QUERY_KEYS.Trades.WalletTrades(walletAddress, network?.id as NetworkId), - async () => { - try { - const response = await request( - synthsEndpoint, - gql` - query WalletTrades($walletAddress: String!) { - synthExchanges( - where: { account: $walletAddress } - first: 1000 - orderBy: "timestamp" - orderDirection: "desc" - ) { - id - fromAmount - fromAmountInUSD - fromSynth { - name - symbol - id - } - toSynth { - name - symbol - id - } - toAmount - toAmountInUSD - feesInUSD - toAddress - timestamp - gasPrice - } - } - `, - { walletAddress: walletAddress.toLowerCase() } - ) - - return response - } catch (e) { - logError(e) - return null - } - }, - { enabled: !!walletAddress, ...options } - ) -} - -export default useGetWalletTrades diff --git a/packages/app/src/sections/dashboard/FuturesHistoryTable.tsx b/packages/app/src/sections/dashboard/FuturesHistoryTable.tsx new file mode 100644 index 0000000000..5397678b11 --- /dev/null +++ b/packages/app/src/sections/dashboard/FuturesHistoryTable.tsx @@ -0,0 +1,414 @@ +import { FuturesMarketAsset, FuturesTrade } from '@kwenta/sdk/types' +import { + MarketKeyByAsset, + getDisplayAsset, + formatCryptoCurrency, + formatDollars, + formatShortDateWithoutYear, + getMarketName, +} from '@kwenta/sdk/utils' +import { wei } from '@synthetixio/wei' +import * as _ from 'lodash/fp' +import Link from 'next/link' +import { FC, useMemo, ReactElement, useState } from 'react' +import { useTranslation } from 'react-i18next' +import styled from 'styled-components' + +import Currency from 'components/Currency' +import { DesktopOnlyView, MobileOrTabletView } from 'components/Media' +import FuturesIcon from 'components/Nav/FuturesIcon' +import Table, { TableNoResults } from 'components/Table' +import { Body } from 'components/Text' +import { ETH_UNIT } from 'constants/network' +import { NO_VALUE } from 'constants/placeholder' +import ROUTES from 'constants/routes' +import useIsL2 from 'hooks/useIsL2' +import useNetworkSwitcher from 'hooks/useNetworkSwitcher' +import useSelectedPriceCurrency from 'hooks/useSelectedPriceCurrency' +import TradeDrawer from 'sections/futures/MobileTrade/drawers/TradeDrawer' +import PositionType from 'sections/futures/PositionType' +import { TradeStatus } from 'sections/futures/types' +import { selectFuturesType } from 'state/futures/common/selectors' +import { selectAllUsersTrades, selectQueryStatuses } from 'state/futures/selectors' +import { useAppSelector } from 'state/hooks' +import { FetchStatus } from 'state/types' + +import TimeDisplay from '../futures/Trades/TimeDisplay' + +const conditionalRender = (prop: T, children: ReactElement) => + _.isNil(prop) ? {NO_VALUE} : children + +const FuturesHistoryTable: FC = () => { + const [selectedTrade, setSelectedTrade] = useState() + const { t } = useTranslation() + const isL2 = useIsL2() + const { selectPriceCurrencyRate, selectedPriceCurrency } = useSelectedPriceCurrency() + const { switchToL2 } = useNetworkSwitcher() + + const accountType = useAppSelector(selectFuturesType) + const trades = useAppSelector(selectAllUsersTrades) + const { trades: tradesQueryStatus } = useAppSelector(selectQueryStatuses) + + const mappedHistoricalTrades = useMemo( + () => + isL2 + ? trades + .map((trade) => { + const pnl = trade.pnl.div(ETH_UNIT) + const feesPaid = trade.feesPaid.div(ETH_UNIT) + const netPnl = pnl.sub(feesPaid) + return { + ...trade, + pnl, + feesPaid, + netPnl, + displayAsset: getDisplayAsset(trade.asset), + market: getMarketName(trade.asset), + price: trade.price.div(ETH_UNIT), + size: trade.size.div(ETH_UNIT).abs(), + timestamp: trade.timestamp * 1000, + date: formatShortDateWithoutYear(new Date(trade.timestamp * 1000)), + id: trade.txnHash, + status: trade.positionClosed ? TradeStatus.CLOSED : TradeStatus.OPEN, + } + }) + .sort((a, b) => b.timestamp - a.timestamp) + : [], + [isL2, trades] + ) + + return ( + <> + + + + {t('common.l2-cta')} +
{t('homepage.l2.cta-buttons.switch-l2')}
+ + ) : ( + + {t('dashboard.history.futures-history-table.no-result')} + +
{t('common.perp-cta')}
+ +
+ ) + } + highlightRowsOnHover + columns={[ + { + header: () =>
{t('dashboard.history.futures-history-table.date-time')}
, + accessorKey: 'dateTime', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.timestamp, + + + + ) + }, + size: 100, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.market')}
, + accessorKey: 'market', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.asset, + <> + {cellProps.row.original.asset && ( + + + {cellProps.getValue()} + + + )} + + ) + }, + size: 120, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.side')}
, + accessorKey: 'side', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.side, + + ) + }, + size: 70, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.size')}
, + accessorKey: 'size', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.size, + <>{formatCryptoCurrency(cellProps.getValue(), { suggestDecimals: true })} + ) + }, + size: 100, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.price')}
, + accessorKey: 'price', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.price, + <>{formatDollars(cellProps.getValue(), { suggestDecimals: true })} + ) + }, + size: 120, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.pnl')}
, + accessorKey: 'netPnl', + cell: (cellProps) => { + return conditionalRender( + cellProps.getValue(), + cellProps.getValue().eq(wei(0)) ? ( + -- + ) : ( + + {formatDollars(cellProps.getValue(), { maxDecimals: 2 })} + + ) + ) + }, + size: 120, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.fees')}
, + accessorKey: 'fees', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.feesPaid, + + ) + }, + size: 120, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.type')}
, + accessorKey: 'orderType', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.orderType, + {cellProps.row.original.orderType} + ) + }, + size: 80, + }, + ]} + /> +
+
+ + + { + setSelectedTrade(row.original) + }} + isLoading={tradesQueryStatus.status === FetchStatus.Loading} + noResultsMessage={ + !isL2 ? ( + + {t('common.l2-cta')} +
{t('homepage.l2.cta-buttons.switch-l2')}
+
+ ) : ( + + {t('dashboard.history.futures-history-table.no-result')} + +
{t('common.perp-cta')}
+ +
+ ) + } + columns={[ + { + header: () =>
{t('dashboard.history.futures-history-table.asset')}
, + accessorKey: 'displayAsset', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.asset, + <> + {cellProps.row.original.asset && ( + + + + {cellProps.getValue()} + + + {cellProps.row.original.date} + + )} + + ) + }, + size: 60, + }, + { + header: () => ( +
+
{t('dashboard.history.futures-history-table.side')}
+
{t('dashboard.history.futures-history-table.type')}
+
+ ), + accessorKey: 'side', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.side, +
+ +
{cellProps.row.original.orderType}
+
+ ) + }, + size: 60, + }, + { + header: () => ( +
+
{t('dashboard.history.futures-history-table.size')}
+
{t('dashboard.history.futures-history-table.price')}
+
+ ), + accessorKey: 'size', + cell: (cellProps) => { + return conditionalRender( + cellProps.row.original.price, +
+
+ {formatCryptoCurrency(cellProps.getValue(), { suggestDecimals: true })} +
+
{formatDollars(cellProps.row.original.price ?? 0)}
+
+ ) + }, + size: 60, + }, + { + header: () =>
{t('dashboard.history.futures-history-table.pnl')}
, + accessorKey: 'netPnl', + cell: (cellProps) => { + const value = cellProps.getValue() + + return conditionalRender( + value, + value.eq(wei(0)) ? ( + -- + ) : ( + + {formatDollars(value, { maxDecimals: 2 })} + + ) + ) + }, + size: 60, + }, + ]} + /> +
+ setSelectedTrade(undefined)} /> +
+ + ) +} + +const StyledTimeDisplay = styled.div` + div { + margin-left: 2px; + } +` + +const StyledCurrencyIcon = styled(Currency.Icon)` + width: 30px; + height: 30px; +` + +const MobileStyledCurrencyIcon = styled(Currency.Icon)` + grid-row: 1 / span 2; + width: 20px; + height: 20px; +` + +const TableContainer = styled.div` + margin-top: 16px; + margin-bottom: 40px; + .paused { + color: ${(props) => props.theme.colors.common.secondaryGray}; + } +` + +const StyledTable = styled(Table)` + margin-bottom: 20px; +` as typeof Table + +const MobileStyledTable = styled(Table)` + margin-bottom: 20px; + border-radius: initial; + border-top: none; + border-left: none; + border-right: none; +` as typeof Table + +const StyledText = styled.div` + color: ${(props) => props.theme.colors.selectedTheme.button.text.primary}; +` + +const SynthContainer = styled.div` + display: flex; + align-items: center; + column-gap: 5px; + margin-left: -4px; +` + +const MobileSynthContainer = styled.div` + display: grid; + align-items: center; + grid-template-columns: repeat(2, auto); + grid-template-rows: repeat(2, auto); + column-gap: 5px; + margin-left: -4px; +` + +const MobileMarketContainer = styled.div` + display: flex; + flex-direction: row; + align-items: center; + gap: 5px; +` + +const PNL = styled.div<{ negative?: boolean; normal?: boolean }>` + color: ${(props) => + props.normal + ? props.theme.colors.selectedTheme.button.text + : props.negative + ? props.theme.colors.selectedTheme.red + : props.theme.colors.selectedTheme.green}; +` + +export default FuturesHistoryTable diff --git a/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx b/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx index 00d13b64ad..e38010e569 100644 --- a/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx +++ b/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx @@ -1,4 +1,4 @@ -import { FuturesMarketAsset } from '@kwenta/sdk/types' +import { FuturesMarket, FuturesMarketAsset } from '@kwenta/sdk/types' import { AssetDisplayByAsset, MarketKeyByAsset, @@ -20,12 +20,8 @@ import { DesktopOnlyView, MobileOrTabletView } from 'components/Media' import Spacer from 'components/Spacer' import Table, { TableHeader } from 'components/Table' import ROUTES from 'constants/routes' -import { - selectFuturesType, - selectMarkets, - selectMarketVolumes, - selectMarkPrices, -} from 'state/futures/selectors' +import { selectFuturesType } from 'state/futures/common/selectors' +import { selectMarkets, selectMarketVolumes, selectMarkPrices } from 'state/futures/selectors' import { useAppSelector } from 'state/hooks' import { selectPreviousDayPrices, selectOffchainPricesInfo } from 'state/prices/selectors' import { getSynthDescription } from 'utils/futures' @@ -50,8 +46,8 @@ const FuturesMarketsTable: React.FC = ({ search }) => let data = useMemo(() => { const lowerSearch = search?.toLowerCase() - const markets = lowerSearch - ? futuresMarkets.filter( + const markets: FuturesMarket[] = lowerSearch + ? (futuresMarkets as FuturesMarket[]).filter( (m) => m.asset.toLowerCase().includes(lowerSearch) || AssetDisplayByAsset[m.asset]?.toLocaleLowerCase().includes(lowerSearch) diff --git a/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx b/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx index 2849d3d2dc..b94ff3971c 100644 --- a/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx +++ b/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx @@ -1,4 +1,4 @@ -import { FuturesAccountType } from '@kwenta/sdk/utils' +import { FuturesMarginType } from '@kwenta/sdk/types' import Link from 'next/link' import { useRouter } from 'next/router' import { FC, useMemo } from 'react' @@ -17,19 +17,16 @@ import ROUTES from 'constants/routes' import useIsL2 from 'hooks/useIsL2' import useNetworkSwitcher from 'hooks/useNetworkSwitcher' import PositionType from 'sections/futures/PositionType' -import { - selectCrossMarginPositions, - selectIsolatedMarginPositions, - selectMarkets, - selectPositionHistory, -} from 'state/futures/selectors' +import { AppFuturesMarginType } from 'state/futures/common/types' +import { selectCrossMarginPositions } from 'state/futures/crossMargin/selectors' +import { selectSmartMarginPositions } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import { getSynthDescription } from 'utils/futures' import MobilePositionRow from './MobilePositionRow' type FuturesPositionTableProps = { - accountType: FuturesAccountType + accountType: AppFuturesMarginType showCurrentMarket?: boolean showEmptyTable?: boolean } @@ -45,32 +42,27 @@ const FuturesPositionsTable: FC = ({ const isL2 = useIsL2() - const isolatedPositions = useAppSelector(selectIsolatedMarginPositions) const crossMarginPositions = useAppSelector(selectCrossMarginPositions) - const positionHistory = useAppSelector(selectPositionHistory) - const futuresMarkets = useAppSelector(selectMarkets) + const smartMarginPositions = useAppSelector(selectSmartMarginPositions) let data = useMemo(() => { - const positions = accountType === 'cross_margin' ? crossMarginPositions : isolatedPositions + const positions = + accountType === FuturesMarginType.SMART_MARGIN ? smartMarginPositions : crossMarginPositions return positions .map((position) => { - const market = futuresMarkets.find((market) => market.asset === position.asset) - const description = getSynthDescription(position.asset, t) - const thisPositionHistory = positionHistory.find((ph) => { - return ph.isOpen && ph.asset === position.asset - }) + const description = getSynthDescription(position.market.asset, t) return { - market: market!, - position: position.position!, + market: position.market, + position: position, description, - avgEntryPrice: thisPositionHistory?.avgEntryPrice, + avgEntryPrice: position?.avgEntryPrice, stopLoss: position.stopLoss?.targetPrice, takeProfit: position.takeProfit?.targetPrice, } }) .filter(({ position, market }) => !!position && !!market) - }, [accountType, isolatedPositions, crossMarginPositions, futuresMarkets, t, positionHistory]) + }, [accountType, crossMarginPositions, smartMarginPositions, t]) return ( <> @@ -78,7 +70,7 @@ const FuturesPositionsTable: FC = ({
router.push(ROUTES.Markets.MarketPair(row.original.market.asset, accountType)) } @@ -93,7 +85,7 @@ const FuturesPositionsTable: FC = ({ {!showCurrentMarket ? ( t('dashboard.overview.futures-positions-table.no-result') ) : ( - +
{t('common.perp-cta')}
)} @@ -278,7 +270,7 @@ const FuturesPositionsTable: FC = ({
{data.length === 0 ? ( - +
{t('common.perp-cta')}
diff --git a/packages/app/src/sections/dashboard/FuturesPositionsTable/MobilePositionRow.tsx b/packages/app/src/sections/dashboard/FuturesPositionsTable/MobilePositionRow.tsx index 164a320ca2..ec2a31d151 100644 --- a/packages/app/src/sections/dashboard/FuturesPositionsTable/MobilePositionRow.tsx +++ b/packages/app/src/sections/dashboard/FuturesPositionsTable/MobilePositionRow.tsx @@ -1,8 +1,9 @@ -import { FuturesFilledPosition, FuturesMarket, PositionSide } from '@kwenta/sdk/types' +import { FuturesMarket, PositionSide } from '@kwenta/sdk/types' import { getMarketName, MarketKeyByAsset, formatNumber } from '@kwenta/sdk/utils' import Wei, { wei } from '@synthetixio/wei' import { memo, FC } from 'react' import styled, { css } from 'styled-components' +import { FuturesPositionTablePosition } from 'types/futures' import { border } from 'components/Button' import ChangePercent from 'components/ChangePercent' @@ -15,7 +16,7 @@ import { isDecimalFour } from 'utils/futures' type MobilePositionRowProps = { row: { market?: FuturesMarket - position: FuturesFilledPosition | null + position: FuturesPositionTablePosition | null avgEntryPrice?: Wei } onClick(): void diff --git a/packages/app/src/sections/dashboard/MobileDashboard/OpenPositions.tsx b/packages/app/src/sections/dashboard/MobileDashboard/OpenPositions.tsx index d17d605125..ea3dc107e4 100644 --- a/packages/app/src/sections/dashboard/MobileDashboard/OpenPositions.tsx +++ b/packages/app/src/sections/dashboard/MobileDashboard/OpenPositions.tsx @@ -1,3 +1,4 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' import { formatDollars } from '@kwenta/sdk/utils' import Wei from '@synthetixio/wei' import { useMemo, useState } from 'react' @@ -7,10 +8,10 @@ import { ExchangeTokens } from 'types/synths' import TabButton from 'components/Button/TabButton' import { TabPanel } from 'components/Tab' -import { FuturesAccountTypes } from 'queries/futures/types' import { SectionHeader, SectionTitle } from 'sections/futures/mobile' import { selectBalances } from 'state/balances/selectors' -import { selectFuturesPortfolio, selectActiveSmartPositionsCount } from 'state/futures/selectors' +import { selectFuturesPortfolio } from 'state/futures/selectors' +import { selectActiveSmartPositionsCount } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import FuturesPositionsTable from '../FuturesPositionsTable' @@ -41,7 +42,7 @@ const OpenPositions: React.FC = ({ exchangeTokens, exchangeT label: t('dashboard.overview.positions-tabs.smart-margin'), badge: smartPositionsCount, active: activePositionsTab === PositionsTab.SMART_MARGIN, - detail: formatDollars(portfolio.crossMarginFutures), + detail: formatDollars(portfolio.smartMargin), disabled: false, onClick: () => setActivePositionsTab(PositionsTab.SMART_MARGIN), }, @@ -58,7 +59,7 @@ const OpenPositions: React.FC = ({ exchangeTokens, exchangeT t, activePositionsTab, smartPositionsCount, - portfolio.crossMarginFutures, + portfolio.smartMargin, balances.totalUSDBalance, exchangeTokenBalances, setActivePositionsTab, @@ -80,7 +81,7 @@ const OpenPositions: React.FC = ({ exchangeTokens, exchangeT
- + diff --git a/packages/app/src/sections/dashboard/Overview.tsx b/packages/app/src/sections/dashboard/Overview.tsx index 461a3dcf70..30cc72c3b5 100644 --- a/packages/app/src/sections/dashboard/Overview.tsx +++ b/packages/app/src/sections/dashboard/Overview.tsx @@ -1,5 +1,6 @@ import { ETH_ADDRESS, ETH_COINGECKO_ADDRESS, ZERO_WEI } from '@kwenta/sdk/constants' import { SynthSymbol } from '@kwenta/sdk/data' +import { FuturesMarginType } from '@kwenta/sdk/types' import { formatDollars, toWei } from '@kwenta/sdk/utils' import Wei from '@synthetixio/wei' import { FC, useEffect, useMemo, useState } from 'react' @@ -14,15 +15,11 @@ import { TabPanel } from 'components/Tab' import Search from 'components/Table/Search' import * as Text from 'components/Text' import Connector from 'containers/Connector' -import { FuturesAccountTypes } from 'queries/futures/types' import { selectBalances } from 'state/balances/selectors' import { fetchTokenList } from 'state/exchange/actions' import { setFuturesAccountType } from 'state/futures/reducer' -import { - selectActiveSmartPositionsCount, - selectFuturesPortfolio, - selectFuturesType, -} from 'state/futures/selectors' +import { selectFuturesPortfolio } from 'state/futures/selectors' +import { selectActiveSmartPositionsCount } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector, useFetchAction } from 'state/hooks' import sdk from 'state/sdk' import { selectSynthsMap } from 'state/wallet/selectors' @@ -36,7 +33,6 @@ import SynthBalancesTable from './SynthBalancesTable' export enum PositionsTab { SMART_MARGIN = 'smart margin', - ISOLATED_MARGIN = 'isolated margin', SPOT = 'spot', } @@ -46,21 +42,14 @@ const Overview: FC = () => { const { t } = useTranslation() const dispatch = useAppDispatch() - const accountType = useAppSelector(selectFuturesType) const balances = useAppSelector(selectBalances) const portfolio = useAppSelector(selectFuturesPortfolio) const smartPositionsCount = useAppSelector(selectActiveSmartPositionsCount) const [activePositionsTab, setActivePositionsTab] = useState( - accountType === 'isolated_margin' ? PositionsTab.ISOLATED_MARGIN : PositionsTab.SMART_MARGIN + PositionsTab.SMART_MARGIN ) - useEffect(() => { - accountType === 'isolated_margin' - ? setActivePositionsTab(PositionsTab.ISOLATED_MARGIN) - : setActivePositionsTab(PositionsTab.SMART_MARGIN) - }, [accountType, setActivePositionsTab]) - const { network } = Connector.useContainer() const synthsMap = useAppSelector(selectSynthsMap) @@ -137,13 +126,13 @@ const Overview: FC = () => { name: PositionsTab.SMART_MARGIN, label: t('dashboard.overview.positions-tabs.smart-margin'), badge: smartPositionsCount, - titleIcon: , + titleIcon: , active: activePositionsTab === PositionsTab.SMART_MARGIN, - detail: formatDollars(portfolio.crossMarginFutures), + detail: formatDollars(portfolio.smartMargin), disabled: false, onClick: () => { setActivePositionsTab(PositionsTab.SMART_MARGIN) - dispatch(setFuturesAccountType(FuturesAccountTypes.CROSS_MARGIN)) + dispatch(setFuturesAccountType(FuturesMarginType.SMART_MARGIN)) }, }, { @@ -162,7 +151,7 @@ const Overview: FC = () => { exchangeTokens, balances.totalUSDBalance, activePositionsTab, - portfolio.crossMarginFutures, + portfolio.smartMargin, setActivePositionsTab, ]) @@ -177,7 +166,7 @@ const Overview: FC = () => { ))} - + diff --git a/packages/app/src/sections/dashboard/PortfolioChart.tsx b/packages/app/src/sections/dashboard/PortfolioChart.tsx index 43990b471f..63165fd582 100644 --- a/packages/app/src/sections/dashboard/PortfolioChart.tsx +++ b/packages/app/src/sections/dashboard/PortfolioChart.tsx @@ -16,14 +16,14 @@ import { MobileHiddenView, MobileOnlyView } from 'components/Media' import { Body, NumericValue, Heading } from 'components/Text' import { DEFAULT_FUTURES_MARGIN_TYPE } from 'constants/defaults' import ROUTES from 'constants/routes' +import { selectFuturesType } from 'state/futures/common/selectors' import { - selectBuyingPower, selectFuturesPortfolio, - selectFuturesType, selectPortfolioChartData, selectSelectedPortfolioTimeframe, selectTotalUnrealizedPnl, } from 'state/futures/selectors' +import { selectBuyingPower } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import { Timeframe } from './Timeframe' @@ -53,12 +53,11 @@ const PriceChart: FC = ({ setHoverValue, setHoverTitle }) => { const theme = useTheme() const portfolioTimeframe = useAppSelector(selectSelectedPortfolioTimeframe) const accountType = useAppSelector(selectFuturesType) - const { isolated_margin: isolatedPortfolioData, cross_margin: smartPortfolioData } = - useAppSelector(selectPortfolioChartData) + const portfolioChartData = useAppSelector(selectPortfolioChartData) const portfolioData = useMemo( - () => (accountType === 'isolated_margin' ? isolatedPortfolioData : smartPortfolioData), - [accountType, isolatedPortfolioData, smartPortfolioData] + () => portfolioChartData[accountType], + [portfolioChartData, accountType] ) const lineColor = useMemo(() => { @@ -66,7 +65,7 @@ const PriceChart: FC = ({ setHoverValue, setHoverTitle }) => { portfolioData.length > 2 ? portfolioData[portfolioData.length - 1].total - portfolioData[0].total < 0 : false - return isNegative ? theme.colors.selectedTheme.red : theme.colors.selectedTheme.green + return theme.colors.selectedTheme[isNegative ? 'red' : 'green'] }, [portfolioData, theme]) return ( @@ -112,8 +111,8 @@ const PriceChart: FC = ({ setHoverValue, setHoverTitle }) => { align="left" formatter={(value) => value === 'total' - ? accountType === 'isolated_margin' - ? 'Isolated Margin' + ? accountType === 'cross_margin' + ? 'Cross Margin' : 'Smart Margin' : value } @@ -132,10 +131,10 @@ const PriceChart: FC = ({ setHoverValue, setHoverTitle }) => { const PortfolioChart: FC = () => { const { t } = useTranslation() - const { isolatedMarginFutures: isolatedTotal, crossMarginFutures: smartTotal } = + const { crossMargin: crossTotal, smartMargin: smartTotal } = useAppSelector(selectFuturesPortfolio) const accountType = useAppSelector(selectFuturesType) - const { isolated_margin: isolatedPortfolioData, cross_margin: smartPortfolioData } = + const { cross_margin: crossPortfolioData, smart_margin: smartPortfolioData } = useAppSelector(selectPortfolioChartData) const buyingPower = useAppSelector(selectBuyingPower) @@ -145,13 +144,13 @@ const PortfolioChart: FC = () => { const [hoverTitle, setHoverTitle] = useState(null) const total = useMemo( - () => (accountType === 'isolated_margin' ? isolatedTotal : smartTotal), - [accountType, isolatedTotal, smartTotal] + () => (accountType === 'cross_margin' ? crossTotal : smartTotal), + [accountType, crossTotal, smartTotal] ) const portfolioData = useMemo(() => { - return accountType === 'isolated_margin' ? isolatedPortfolioData : smartPortfolioData - }, [accountType, isolatedPortfolioData, smartPortfolioData]) + return accountType === 'cross_margin' ? crossPortfolioData : smartPortfolioData + }, [accountType, crossPortfolioData, smartPortfolioData]) const changeValue = useMemo(() => { if (portfolioData.length < 2) { diff --git a/packages/app/src/sections/dashboard/Stake/RewardsTab.tsx b/packages/app/src/sections/dashboard/Stake/RewardsTab.tsx index beed1fe709..3bb71237e3 100644 --- a/packages/app/src/sections/dashboard/Stake/RewardsTab.tsx +++ b/packages/app/src/sections/dashboard/Stake/RewardsTab.tsx @@ -18,7 +18,7 @@ import { STAKING_DISABLED } from 'constants/ui' import useIsL2 from 'hooks/useIsL2' import { TradingRewardProps } from 'queries/staking/utils' import { StakingCard } from 'sections/dashboard/Stake/card' -import { selectFuturesFees, selectFuturesFeesForAccount } from 'state/futures/selectors' +import { selectFuturesFees, selectFuturesFeesForAccount } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import { claimMultipleAllRewards } from 'state/staking/actions' import { setSelectedEpoch } from 'state/staking/reducer' diff --git a/packages/app/src/sections/futures/ClosePositionModal/CloseCrossMarginPositionModal.tsx b/packages/app/src/sections/futures/ClosePositionModal/CloseCrossMarginPositionModal.tsx new file mode 100644 index 0000000000..d428aa2395 --- /dev/null +++ b/packages/app/src/sections/futures/ClosePositionModal/CloseCrossMarginPositionModal.tsx @@ -0,0 +1,221 @@ +import { ZERO_WEI } from '@kwenta/sdk/constants' +import { PositionSide, PotentialTradeStatus } from '@kwenta/sdk/types' +import { + floorNumber, + formatDollars, + formatNumber, + formatPercent, + stripZeros, +} from '@kwenta/sdk/utils' +import { wei } from '@synthetixio/wei' +import React, { useCallback, useMemo } from 'react' +import { useTranslation } from 'react-i18next' +import styled from 'styled-components' + +import BaseModal from 'components/BaseModal' +import Button from 'components/Button' +import ErrorView from 'components/ErrorView' +import { InfoBoxContainer, InfoBoxRow } from 'components/InfoBox' +import { FlexDivRowCentered } from 'components/layout/flex' +import PreviewArrow from 'components/PreviewArrow' +import SelectorButtons from 'components/SelectorButtons' +import Spacer from 'components/Spacer' +import { Body } from 'components/Text' +import { previewErrorI18n } from 'queries/futures/constants' +import { setShowPositionModal } from 'state/app/reducer' +import { selectTransaction } from 'state/app/selectors' +import { submitCrossMarginReducePositionOrder } from 'state/futures/crossMargin/actions' +import { + selectCloseCMPositionOrderInputs, + selectCloseCMPositionPreview, +} from 'state/futures/crossMargin/selectors' +import { selectSubmittingFuturesTx } from 'state/futures/selectors' +import { + editClosePositionPrice, + editClosePositionSizeDelta, +} from 'state/futures/smartMargin/actions' +import { + selectEditPositionModalInfo, + selectIsFetchingTradePreview, + selectTradePreviewError, +} from 'state/futures/smartMargin/selectors' +import { useAppDispatch, useAppSelector } from 'state/hooks' + +import ClosePositionFeeInfo from '../FeeInfoBox/ClosePositionFeeInfo' + +import ClosePositionSizeInput from './ClosePositionSizeInput' + +const CLOSE_PERCENT_OPTIONS = ['25%', '50%', '75%', '100%'] + +// TODO: Share some logic between close modals + +export default function CloseCrossMarginPositionModal() { + const { t } = useTranslation() + const dispatch = useAppDispatch() + + const transactionState = useAppSelector(selectTransaction) + const isSubmitting = useAppSelector(selectSubmittingFuturesTx) + const isFetchingPreview = useAppSelector(selectIsFetchingTradePreview) + const previewTrade = useAppSelector(selectCloseCMPositionPreview) + const previewError = useAppSelector(selectTradePreviewError) + const { nativeSizeDelta } = useAppSelector(selectCloseCMPositionOrderInputs) + const { market, position } = useAppSelector(selectEditPositionModalInfo) + + const submitCloseOrder = useCallback(() => { + dispatch(submitCrossMarginReducePositionOrder()) + }, [dispatch]) + + const isLoading = useMemo( + () => isSubmitting || isFetchingPreview, + [isSubmitting, isFetchingPreview] + ) + + const maxNativeValue = useMemo(() => { + return position?.size ?? ZERO_WEI + }, [position?.size]) + + const sizeWei = useMemo( + () => (!nativeSizeDelta || isNaN(Number(nativeSizeDelta)) ? wei(0) : wei(nativeSizeDelta)), + [nativeSizeDelta] + ) + + const invalidSize = useMemo(() => { + return sizeWei.abs().gt(maxNativeValue.abs()) + }, [sizeWei, maxNativeValue]) + + const orderError = useMemo(() => { + if (previewError) return t(previewErrorI18n(previewError)) + if (previewTrade?.showStatus) return previewTrade?.statusMessage + return null + }, [previewTrade?.showStatus, previewTrade?.statusMessage, previewError, t]) + + const submitDisabled = useMemo(() => { + return false + return ( + sizeWei.eq(0) || + invalidSize || + isLoading || + orderError || + previewTrade?.status !== PotentialTradeStatus.OK + ) + }, [sizeWei, invalidSize, isLoading, orderError, previewTrade?.status]) + + const onClose = () => { + if (market) { + dispatch(editClosePositionSizeDelta(market.marketKey, '')) + dispatch(editClosePositionPrice(market.marketKey, '')) + } + dispatch(setShowPositionModal(null)) + } + + const onSelectPercent = useCallback( + (index: number) => { + if (!position?.size || !market?.marketKey) return + const option = CLOSE_PERCENT_OPTIONS[index] + const percent = Math.abs(Number(option.replace('%', ''))) / 100 + const size = + percent === 1 ? position.size.abs() : floorNumber(position.size.abs().mul(percent)) + + const sizeDelta = position?.side === PositionSide.LONG ? wei(size).neg() : wei(size) + const decimals = sizeDelta.abs().eq(position.size.abs()) ? undefined : 4 + + dispatch( + editClosePositionSizeDelta(market.marketKey, stripZeros(sizeDelta.toString(decimals))) + ) + }, + [dispatch, position?.size, position?.side, market?.marketKey] + ) + + return ( + + + + + + + + + + + {previewTrade.leverage.toString(2)}x + ) + } + title={t('futures.market.trade.edit-position.leverage-change')} + textValue={position?.leverage ? position.leverage?.toString(2) + 'x' : '-'} + /> + + {previewTrade?.sizeDelta + ? formatNumber(previewTrade.sizeDelta.abs(), { suggestDecimals: true }) + : '-'} + + ) + } + title={t('futures.market.trade.edit-position.position-size')} + textValue={formatNumber(position?.size || 0, { suggestDecimals: true })} + /> + + + + + + + + + {(orderError || transactionState?.error) && ( + + )} + + + + ) +} + +export const StyledBaseModal = styled(BaseModal)` + [data-reach-dialog-content] { + width: 400px; + } +` + +export const InfoContainer = styled(FlexDivRowCentered)` + margin: 16px 0; +` + +export const BalanceText = styled(Body)` + color: ${(props) => props.theme.colors.selectedTheme.gray}; + span { + color: ${(props) => props.theme.colors.selectedTheme.button.text.primary}; + } +` diff --git a/packages/app/src/sections/futures/ClosePositionModal/ClosePositionModal.tsx b/packages/app/src/sections/futures/ClosePositionModal/ClosePositionModal.tsx index 949da35bdf..0157d17740 100644 --- a/packages/app/src/sections/futures/ClosePositionModal/ClosePositionModal.tsx +++ b/packages/app/src/sections/futures/ClosePositionModal/ClosePositionModal.tsx @@ -1,5 +1,5 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' -import { PositionSide, PotentialTradeStatus } from '@kwenta/sdk/types' +import { FuturesMarginType, PositionSide, PotentialTradeStatus } from '@kwenta/sdk/types' import { floorNumber, formatDollars, @@ -24,23 +24,23 @@ import { Body } from 'components/Text' import { previewErrorI18n } from 'queries/futures/constants' import { setShowPositionModal } from 'state/app/reducer' import { selectTransaction } from 'state/app/selectors' +import { selectFuturesType } from 'state/futures/common/selectors' +import { submitCrossMarginReducePositionOrder } from 'state/futures/crossMargin/actions' +import { selectSubmittingFuturesTx } from 'state/futures/selectors' import { editClosePositionPrice, editClosePositionSizeDelta, - submitIsolatedMarginReducePositionOrder, submitSmartMarginReducePositionOrder, -} from 'state/futures/actions' -import { setClosePositionOrderType } from 'state/futures/reducer' +} from 'state/futures/smartMargin/actions' +import { setClosePositionOrderType } from 'state/futures/smartMargin/reducer' import { - selectClosePositionOrderInputs, + selectCloseSMPositionOrderInputs, selectClosePositionPreview, selectEditPositionModalInfo, - selectFuturesType, selectIsFetchingTradePreview, selectKeeperDepositExceedsBal, - selectSubmittingFuturesTx, selectTradePreviewError, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import AcceptWarningView from '../../../components/AcceptWarningView' @@ -63,16 +63,16 @@ export default function ClosePositionModal() { const previewError = useAppSelector(selectTradePreviewError) const accountType = useAppSelector(selectFuturesType) const ethBalanceExceeded = useAppSelector(selectKeeperDepositExceedsBal) - const { nativeSizeDelta, orderType, price } = useAppSelector(selectClosePositionOrderInputs) + const { nativeSizeDelta, orderType, price } = useAppSelector(selectCloseSMPositionOrderInputs) const { market, position } = useAppSelector(selectEditPositionModalInfo) const [overridePriceProtection, setOverridePriceProtection] = useState(false) const submitCloseOrder = useCallback(() => { - if (accountType === 'cross_margin') { + if (accountType === FuturesMarginType.SMART_MARGIN) { dispatch(submitSmartMarginReducePositionOrder(overridePriceProtection)) } else { - dispatch(submitIsolatedMarginReducePositionOrder()) + dispatch(submitCrossMarginReducePositionOrder()) } }, [dispatch, accountType, overridePriceProtection]) @@ -82,8 +82,8 @@ export default function ClosePositionModal() { ) const maxNativeValue = useMemo(() => { - return position?.position?.size ?? ZERO_WEI - }, [position?.position?.size]) + return position?.size ?? ZERO_WEI + }, [position?.size]) const sizeWei = useMemo( () => (!nativeSizeDelta || isNaN(Number(nativeSizeDelta)) ? wei(0) : wei(nativeSizeDelta)), @@ -149,28 +149,26 @@ export default function ClosePositionModal() { const onSelectPercent = useCallback( (index: number) => { - if (!position?.position?.size || !market?.marketKey) return + if (!position?.size || !market?.marketKey) return const option = CLOSE_PERCENT_OPTIONS[index] const percent = Math.abs(Number(option.replace('%', ''))) / 100 const size = - percent === 1 - ? position.position.size.abs() - : floorNumber(position.position.size.abs().mul(percent)) + percent === 1 ? position.size.abs() : floorNumber(position.size.abs().mul(percent)) - const sizeDelta = position?.position.side === PositionSide.LONG ? wei(size).neg() : wei(size) - const decimals = sizeDelta.abs().eq(position.position.size.abs()) ? undefined : 4 + const sizeDelta = position.side === PositionSide.LONG ? wei(size).neg() : wei(size) + const decimals = sizeDelta.abs().eq(position.size.abs()) ? undefined : 4 dispatch( editClosePositionSizeDelta(market.marketKey, stripZeros(sizeDelta.toString(decimals))) ) }, - [dispatch, position?.position?.size, position?.position?.side, market?.marketKey] + [dispatch, position?.size, position?.side, market?.marketKey] ) return ( - {accountType === 'cross_margin' && ( + {accountType === FuturesMarginType.SMART_MARGIN && ( <> @@ -201,7 +199,7 @@ export default function ClosePositionModal() { ) } title={t('futures.market.trade.edit-position.leverage-change')} - textValue={position?.position ? position?.position?.leverage.toString(2) + 'x' : '-'} + textValue={position?.leverage ? position.leverage.toString(2) + 'x' : '-'} /> , v: string) => { diff --git a/packages/app/src/sections/futures/ClosePositionModal/ClosePositionSizeInput.tsx b/packages/app/src/sections/futures/ClosePositionModal/ClosePositionSizeInput.tsx index 07b4039c41..127bfa5289 100644 --- a/packages/app/src/sections/futures/ClosePositionModal/ClosePositionSizeInput.tsx +++ b/packages/app/src/sections/futures/ClosePositionModal/ClosePositionSizeInput.tsx @@ -9,11 +9,11 @@ import NumericInput from 'components/Input/NumericInput' import { FlexDivRow } from 'components/layout/flex' import Spacer from 'components/Spacer' import { selectShowPositionModal } from 'state/app/selectors' -import { editClosePositionSizeDelta } from 'state/futures/actions' +import { editClosePositionSizeDelta } from 'state/futures/smartMargin/actions' import { - selectClosePositionOrderInputs, + selectCloseSMPositionOrderInputs, selectEditPositionModalInfo, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' type OrderSizingProps = { @@ -24,7 +24,7 @@ type OrderSizingProps = { const ClosePositionSizeInput: React.FC = memo(({ isMobile, maxNativeValue }) => { const dispatch = useAppDispatch() - const { nativeSizeDelta } = useAppSelector(selectClosePositionOrderInputs) + const { nativeSizeDelta } = useAppSelector(selectCloseSMPositionOrderInputs) const { position } = useAppSelector(selectEditPositionModalInfo) const modal = useAppSelector(selectShowPositionModal) @@ -34,12 +34,12 @@ const ClosePositionSizeInput: React.FC = memo(({ isMobile, max dispatch( editClosePositionSizeDelta( modal.marketKey, - position?.position?.side === PositionSide.LONG ? '-' + value : value + position?.side === PositionSide.LONG ? '-' + value : value ) ) } }, - [dispatch, modal, position?.position?.side] + [dispatch, modal, position?.side] ) const onChangeValue = useCallback( diff --git a/packages/app/src/sections/futures/CreatePerpsV3AccountModal.tsx b/packages/app/src/sections/futures/CreatePerpsV3AccountModal.tsx new file mode 100644 index 0000000000..48ea2edf2a --- /dev/null +++ b/packages/app/src/sections/futures/CreatePerpsV3AccountModal.tsx @@ -0,0 +1,72 @@ +import { useCallback } from 'react' +import { useTranslation } from 'react-i18next' +import styled from 'styled-components' + +import BaseModal from 'components/BaseModal' +import Button from 'components/Button' +import ErrorView from 'components/ErrorView' +import Loader from 'components/Loader' +import { setOpenModal } from 'state/app/reducer' +import { createPerpsV3Account } from 'state/futures/crossMargin/actions' +import { selectCrossMarginSupportedNetwork } from 'state/futures/crossMargin/selectors' +import { selectSubmittingFuturesTx } from 'state/futures/selectors' +import { useAppDispatch, useAppSelector } from 'state/hooks' + +type Props = { + isOpen: boolean +} + +export default function CreatePerpsV3AccountModal({ isOpen }: Props) { + const { t } = useTranslation() + const dispatch = useAppDispatch() + const crossMarginAvailable = useAppSelector(selectCrossMarginSupportedNetwork) + const txProcessing = useAppSelector(selectSubmittingFuturesTx) + + const onClose = () => dispatch(setOpenModal(null)) + + const createAccount = useCallback(async () => { + dispatch(createPerpsV3Account()) + }, [dispatch]) + + const renderContent = () => { + if (!crossMarginAvailable) { + return + } + + return ( + <> + {t('futures.modals.onboard.step1-intro')} + + {txProcessing ? : 'Create Account'} + + + ) + } + + return ( + + {renderContent()} + + ) +} + +const StyledBaseModal = styled(BaseModal)` + color: ${(props) => props.theme.colors.selectedTheme.gray}; + [data-reach-dialog-content] { + width: 400px; + } +` + +const StyledButton = styled(Button)` + margin-top: 24px; + height: 50px; + width: 100%; +` + +const Intro = styled.div` + margin-bottom: 30px; +` diff --git a/packages/app/src/sections/futures/CrossMarginOnboard/index.tsx b/packages/app/src/sections/futures/CrossMarginOnboard/index.tsx deleted file mode 100644 index 46a425742e..0000000000 --- a/packages/app/src/sections/futures/CrossMarginOnboard/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export { default } from './CrossMarginOnboard' diff --git a/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginInput.tsx b/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginInput.tsx index 2d9f4f51f1..f58b3fb0a5 100644 --- a/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginInput.tsx +++ b/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginInput.tsx @@ -10,8 +10,8 @@ import { getStep } from 'components/Slider/Slider' import StyledSlider from 'components/Slider/StyledSlider' import Spacer from 'components/Spacer' import { selectShowPositionModal } from 'state/app/selectors' -import { editCrossMarginPositionMargin } from 'state/futures/actions' -import { selectEditPositionInputs } from 'state/futures/selectors' +import { editSmartMarginPositionMargin } from 'state/futures/smartMargin/actions' +import { selectSmartMarginEditPosInputs } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' type OrderSizingProps = { @@ -24,14 +24,14 @@ const EditPositionMarginInput: React.FC = memo( ({ isMobile, type, maxUsdInput }) => { const dispatch = useAppDispatch() - const { marginDelta } = useAppSelector(selectEditPositionInputs) + const { marginDelta } = useAppSelector(selectSmartMarginEditPosInputs) const positionModal = useAppSelector(selectShowPositionModal) const onChangeMargin = useCallback( (value: string) => { if (positionModal?.marketKey) { dispatch( - editCrossMarginPositionMargin( + editSmartMarginPositionMargin( positionModal.marketKey, type === 'deposit' || !value ? value : '-' + value ) diff --git a/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginModal.tsx b/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginModal.tsx index b2eb01f53d..5480d59aeb 100644 --- a/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginModal.tsx +++ b/packages/app/src/sections/futures/EditPositionModal/EditPositionMarginModal.tsx @@ -17,21 +17,21 @@ import Spacer from 'components/Spacer' import { Body } from 'components/Text' import { setShowPositionModal } from 'state/app/reducer' import { selectShowPositionModal, selectTransaction } from 'state/app/selectors' +import { clearTradeInputs } from 'state/futures/actions' +import { selectSubmittingFuturesTx } from 'state/futures/selectors' import { - approveCrossMargin, - clearTradeInputs, - editCrossMarginPositionMargin, - submitCrossMarginAdjustMargin, -} from 'state/futures/actions' + approveSmartMargin, + editSmartMarginPositionMargin, + submitSmartMarginAdjustMargin, +} from 'state/futures/smartMargin/actions' import { selectEditMarginAllowanceValid, - selectEditPositionInputs, selectEditPositionModalInfo, selectEditPositionPreview, selectIdleMargin, selectIsFetchingTradePreview, - selectSubmittingFuturesTx, -} from 'state/futures/selectors' + selectSmartMarginEditPosInputs, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import EditPositionMarginInput from './EditPositionMarginInput' @@ -44,7 +44,7 @@ export default function EditPositionMarginModal() { const isSubmitting = useAppSelector(selectSubmittingFuturesTx) const isFetchingPreview = useAppSelector(selectIsFetchingTradePreview) const preview = useAppSelector(selectEditPositionPreview) - const { marginDelta } = useAppSelector(selectEditPositionInputs) + const { marginDelta } = useAppSelector(selectSmartMarginEditPosInputs) const idleMargin = useAppSelector(selectIdleMargin) const modal = useAppSelector(selectShowPositionModal) const { market, position } = useAppSelector(selectEditPositionModalInfo) @@ -62,18 +62,18 @@ export default function EditPositionMarginModal() { ) const maxWithdraw = useMemo(() => { - const maxSize = position?.remainingMargin.mul(market?.appMaxLeverage ?? 1) - const currentSize = position?.position?.notionalValue + const maxSize = position?.remainingMargin?.mul(market?.appMaxLeverage ?? 1) + const currentSize = position?.notionalValue const max = maxSize?.sub(currentSize).div(market?.appMaxLeverage ?? 1) ?? wei(0) - const resultingMarginMax = position?.remainingMargin.sub(max) ?? wei(0) - const remainingMarginMax = position?.remainingMargin.sub(MIN_MARGIN_AMOUNT) ?? wei(0) + const resultingMarginMax = position?.remainingMargin?.sub(max) ?? wei(0) + const remainingMarginMax = position?.remainingMargin?.sub(MIN_MARGIN_AMOUNT) ?? wei(0) return max.lt(0) || remainingMarginMax.lt(0) ? ZERO_WEI : resultingMarginMax.gte(MIN_MARGIN_AMOUNT) ? max : remainingMarginMax - }, [position?.remainingMargin, position?.position?.notionalValue, market?.appMaxLeverage]) + }, [position?.remainingMargin, position?.notionalValue, market?.appMaxLeverage]) const maxUsdInputAmount = useMemo( () => (transferType === 0 ? idleMargin : maxWithdraw), @@ -88,8 +88,8 @@ export default function EditPositionMarginModal() { const invalid = useMemo(() => marginWei.gt(maxUsdInputAmount), [marginWei, maxUsdInputAmount]) const maxLeverageExceeded = useMemo( - () => transferType === 1 && position?.position?.leverage.gt(market?.appMaxLeverage ?? 1), - [transferType, position?.position?.leverage, market?.appMaxLeverage] + () => transferType === 1 && position?.leverage?.gt(market?.appMaxLeverage ?? 1), + [transferType, position?.leverage, market?.appMaxLeverage] ) const previewError = useMemo(() => { @@ -112,18 +112,18 @@ export default function EditPositionMarginModal() { } const submitMarginChange = useCallback(() => { - dispatch(submitCrossMarginAdjustMargin()) + dispatch(submitSmartMarginAdjustMargin()) }, [dispatch]) const onClose = () => { if (modal?.marketKey) { - dispatch(editCrossMarginPositionMargin(modal.marketKey, '')) + dispatch(editSmartMarginPositionMargin(modal.marketKey, '')) } dispatch(setShowPositionModal(null)) } const handleApproveSmartMargin = useCallback(async () => { - dispatch(approveCrossMargin()) + dispatch(approveSmartMargin()) }, [dispatch]) const depositButtonText = allowanceValid @@ -164,7 +164,7 @@ export default function EditPositionMarginModal() { ) } title={t('futures.market.trade.edit-position.leverage-change')} - textValue={position?.position?.leverage.toString(2) + 'x'} + textValue={position?.leverage?.toString(2) + 'x'} /> diff --git a/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeInput.tsx b/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeInput.tsx index d42cb1d446..294c75982c 100644 --- a/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeInput.tsx +++ b/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeInput.tsx @@ -13,8 +13,11 @@ import { getStep } from 'components/Slider/Slider' import StyledSlider from 'components/Slider/StyledSlider' import Spacer from 'components/Spacer' import { selectShowPositionModal } from 'state/app/selectors' -import { editCrossMarginPositionSize } from 'state/futures/actions' -import { selectEditPositionInputs, selectEditPositionModalInfo } from 'state/futures/selectors' +import { editCrossMarginPositionSize } from 'state/futures/smartMargin/actions' +import { + selectEditPositionModalInfo, + selectSmartMarginEditPosInputs, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' type OrderSizingProps = { @@ -28,7 +31,7 @@ const EditPositionSizeInput: React.FC = memo( ({ isMobile, type, maxNativeValue, minNativeValue }) => { const dispatch = useAppDispatch() - const { nativeSizeDelta } = useAppSelector(selectEditPositionInputs) + const { nativeSizeDelta } = useAppSelector(selectSmartMarginEditPosInputs) const { position } = useAppSelector(selectEditPositionModalInfo) const modal = useAppSelector(selectShowPositionModal) @@ -36,7 +39,7 @@ const EditPositionSizeInput: React.FC = memo( const onSizeChange = useCallback( (value: string) => { if (modal) { - const side = position?.position?.side + const side = position?.side const sizeDelta = (side === PositionSide.LONG && type === 'decrease') || (side === PositionSide.SHORT && type === 'increase') @@ -45,7 +48,7 @@ const EditPositionSizeInput: React.FC = memo( dispatch(editCrossMarginPositionSize(modal.marketKey, sizeDelta)) } }, - [dispatch, type, modal, position?.position?.side] + [dispatch, type, modal, position?.side] ) const handleSetMax = useCallback(() => { diff --git a/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeModal.tsx b/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeModal.tsx index b4d7e204f2..9ac2d37b05 100644 --- a/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeModal.tsx +++ b/packages/app/src/sections/futures/EditPositionModal/EditPositionSizeModal.tsx @@ -17,18 +17,18 @@ import Spacer from 'components/Spacer' import { Body } from 'components/Text' import { setShowPositionModal } from 'state/app/reducer' import { selectTransaction } from 'state/app/selectors' +import { clearTradeInputs } from 'state/futures/actions' +import { selectSubmittingFuturesTx } from 'state/futures/selectors' import { - clearTradeInputs, editCrossMarginPositionSize, - submitCrossMarginAdjustPositionSize, -} from 'state/futures/actions' + submitSmartMarginAdjustPositionSize, +} from 'state/futures/smartMargin/actions' import { - selectEditPositionInputs, selectEditPositionModalInfo, selectEditPositionPreview, selectIsFetchingTradePreview, - selectSubmittingFuturesTx, -} from 'state/futures/selectors' + selectSmartMarginEditPosInputs, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import EditPositionFeeInfo from '../FeeInfoBox/EditPositionFeeInfo' @@ -43,7 +43,7 @@ export default function EditPositionSizeModal() { const isSubmitting = useAppSelector(selectSubmittingFuturesTx) const isFetchingPreview = useAppSelector(selectIsFetchingTradePreview) const preview = useAppSelector(selectEditPositionPreview) - const { nativeSizeDelta } = useAppSelector(selectEditPositionInputs) + const { nativeSizeDelta } = useAppSelector(selectSmartMarginEditPosInputs) const { market, position, marketPrice } = useAppSelector(selectEditPositionModalInfo) const [overridePriceProtection, setOverridePriceProtection] = useState(false) @@ -62,7 +62,7 @@ export default function EditPositionSizeModal() { } const submitMarginChange = useCallback(() => { - dispatch(submitCrossMarginAdjustPositionSize(overridePriceProtection)) + dispatch(submitSmartMarginAdjustPositionSize(overridePriceProtection)) }, [dispatch, overridePriceProtection]) const isLoading = useMemo( @@ -77,33 +77,33 @@ export default function EditPositionSizeModal() { const resultingLeverage = useMemo(() => { if (!preview || !position) return - return position.remainingMargin.gt(0) + return position.remainingMargin?.gt(0) ? preview.size.mul(marketPrice).div(position.remainingMargin).abs() : wei(0) }, [preview, position, marketPrice]) const maxNativeIncreaseValue = useMemo(() => { if (!marketPrice || marketPrice.eq(0)) return ZERO_WEI - const totalMax = position?.remainingMargin.mul(maxLeverage) ?? ZERO_WEI - let max = totalMax.sub(position?.position?.notionalValue ?? 0) + const totalMax = position?.remainingMargin?.mul(maxLeverage) ?? ZERO_WEI + let max = totalMax.sub(position?.notionalValue ?? 0) max = max.gt(0) ? max : ZERO_WEI return max.div(marketPrice) - }, [marketPrice, position?.remainingMargin, position?.position?.notionalValue, maxLeverage]) + }, [marketPrice, position?.remainingMargin, position?.notionalValue, maxLeverage]) const maxNativeValue = useMemo(() => { - return editType === 0 ? maxNativeIncreaseValue : position?.position?.size ?? ZERO_WEI - }, [editType, maxNativeIncreaseValue, position?.position?.size]) + return editType === 0 ? maxNativeIncreaseValue : position?.size ?? ZERO_WEI + }, [editType, maxNativeIncreaseValue, position?.size]) const minNativeValue = useMemo(() => { if (editType === 0) return ZERO_WEI // If a user is over max leverage they can only // decrease to a value below max leverage - if (position?.position && position?.position?.leverage.gt(maxLeverage)) { - const safeSize = position.remainingMargin.mul(maxLeverage).div(marketPrice) - return position.position.size.sub(safeSize) + if (position && position?.leverage?.gt(maxLeverage)) { + const safeSize = position.remainingMargin?.mul(maxLeverage).div(marketPrice) + return position.size.sub(safeSize) } return ZERO_WEI - }, [maxLeverage, position?.position, editType, marketPrice, position?.remainingMargin]) + }, [maxLeverage, position, editType, marketPrice]) const maxNativeValueWithBuffer = useMemo(() => { if (editType === 1) return maxNativeValue @@ -117,10 +117,10 @@ export default function EditPositionSizeModal() { const maxLeverageExceeded = useMemo(() => { return ( - (editType === 0 && position?.position?.leverage.gt(maxLeverage)) || + (editType === 0 && position?.leverage?.gt(maxLeverage)) || (editType === 1 && resultingLeverage?.gt(maxLeverage)) ) - }, [editType, position?.position?.leverage, maxLeverage, resultingLeverage]) + }, [editType, position?.leverage, maxLeverage, resultingLeverage]) const invalid = useMemo( () => sizeWei.abs().gt(maxNativeValueWithBuffer), @@ -191,7 +191,7 @@ export default function EditPositionSizeModal() { ) } title={t('futures.market.trade.edit-position.leverage-change')} - textValue={position?.position ? position?.position?.leverage.toString(2) + 'x' : '-'} + textValue={position?.leverage ? position.leverage.toString(2) + 'x' : '-'} /> diff --git a/packages/app/src/sections/futures/EditPositionModal/EditStopLossAndTakeProfitModal.tsx b/packages/app/src/sections/futures/EditPositionModal/EditStopLossAndTakeProfitModal.tsx index dea6102569..f888f64165 100644 --- a/packages/app/src/sections/futures/EditPositionModal/EditStopLossAndTakeProfitModal.tsx +++ b/packages/app/src/sections/futures/EditPositionModal/EditStopLossAndTakeProfitModal.tsx @@ -16,24 +16,23 @@ import Spacer from 'components/Spacer' import { Body } from 'components/Text' import { setShowPositionModal } from 'state/app/reducer' import { selectAckedOrdersWarning, selectTransaction } from 'state/app/selectors' +import { clearTradeInputs } from 'state/futures/actions' +import { selectModalSLValidity, selectSubmittingFuturesTx } from 'state/futures/selectors' import { calculateKeeperDeposit, - clearTradeInputs, updateStopLossAndTakeProfit, -} from 'state/futures/actions' -import { setSLTPModalStopLoss, setSLTPModalTakeProfit } from 'state/futures/reducer' +} from 'state/futures/smartMargin/actions' +import { setSLTPModalStopLoss, setSLTPModalTakeProfit } from 'state/futures/smartMargin/reducer' import { selectAllSLTPOrders, selectEditPositionModalInfo, selectKeeperDepositExceedsBal, - selectModalSLValidity, selectSlTpModalInputs, selectSmartMarginKeeperDeposit, - selectSubmittingFuturesTx, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' -import { KeeperDepositRow } from '../FeeInfoBox/FeesRow' +import { KeeperDepositRow } from '../FeeInfoBox/FeeRows' import PositionType from '../PositionType' import OrderAcknowledgement from '../Trade/OrderAcknowledgement' @@ -75,8 +74,8 @@ export default function EditStopLossAndTakeProfitModal() { const hasOrders = useMemo(() => stopLoss || takeProfit, [stopLoss, takeProfit]) const leverageWei = useMemo(() => { - return position?.position?.leverage.gt(0) ? wei(position.position.leverage) : wei(1) - }, [position?.position?.leverage]) + return position?.leverage?.gt(0) ? wei(position.leverage) : wei(1) + }, [position?.leverage]) const hasChangeOrders = useMemo(() => { const tpOrderPrice = takeProfit?.targetPrice @@ -87,12 +86,12 @@ export default function EditStopLossAndTakeProfitModal() { }, [hasOrders, stopLoss?.targetPrice, stopLossPrice, takeProfit?.targetPrice, takeProfitPrice]) const tpInvalid = useMemo(() => { - if (position?.position?.side === 'long') { + if (position?.side === 'long') { return !!takeProfitPrice && wei(takeProfitPrice || 0).lt(marketPrice) } else { return !!takeProfitPrice && wei(takeProfitPrice || 0).gt(marketPrice) } - }, [takeProfitPrice, marketPrice, position?.position?.side]) + }, [takeProfitPrice, marketPrice, position?.side]) const ethBalWarningMessage = ethBalanceExceeded ? t('futures.market.trade.confirmation.modal.eth-bal-warning') @@ -156,14 +155,14 @@ export default function EditStopLossAndTakeProfitModal() { const percent = Math.abs(Number(option.replace('%', ''))) / 100 const relativePercent = wei(percent).div(leverageWei) const stopLoss = - position?.position?.side === 'short' + position?.side === 'short' ? marketPrice.add(marketPrice.mul(relativePercent)) : marketPrice.sub(marketPrice.mul(relativePercent)) const dp = suggestedDecimals(stopLoss) dispatch(setSLTPModalStopLoss(stopLoss.toString(dp))) } }, - [marketPrice, dispatch, position?.position?.side, leverageWei, slValidity.disabled] + [marketPrice, dispatch, position?.side, leverageWei, slValidity.disabled] ) const onSelectTakeProfit = useCallback( @@ -175,14 +174,14 @@ export default function EditStopLossAndTakeProfitModal() { const percent = Math.abs(Number(option.replace('%', ''))) / 100 const relativePercent = wei(percent).div(leverageWei) const takeProfit = - position?.position?.side === 'short' + position?.side === 'short' ? marketPrice.sub(marketPrice.mul(relativePercent)) : marketPrice.add(marketPrice.mul(relativePercent)) const dp = suggestedDecimals(takeProfit) dispatch(setSLTPModalTakeProfit(takeProfit.toString(dp))) } }, - [marketPrice, dispatch, position?.position?.side, leverageWei] + [marketPrice, dispatch, position?.side, leverageWei] ) const onChangeStopLoss = useCallback( @@ -216,8 +215,7 @@ export default function EditStopLossAndTakeProfitModal() { nodeValue={ {market?.marketName} - {' '} - + } /> @@ -232,8 +230,8 @@ export default function EditStopLossAndTakeProfitModal() { invalid={tpInvalid} currentPrice={marketPrice} value={takeProfitPrice} - positionSide={position?.position?.side || PositionSide.LONG} - leverage={position?.position?.leverage || wei(1)} + positionSide={position?.side || PositionSide.LONG} + leverage={position?.leverage || wei(1)} onChange={onChangeTakeProfit} /> @@ -249,8 +247,8 @@ export default function EditStopLossAndTakeProfitModal() { type={'stop-loss'} disabled={!!slValidity.disabled} disabledReason={slValidity.disabled ? 'Leverage Too High' : undefined} - positionSide={position?.position?.side || PositionSide.LONG} - leverage={position?.position?.leverage || wei(1)} + positionSide={position?.side || PositionSide.LONG} + leverage={position?.leverage || wei(1)} invalid={slValidity.invalid} currentPrice={marketPrice} minMaxPrice={slValidity.minMaxStopPrice} diff --git a/packages/app/src/sections/futures/FeeInfoBox/ClosePositionFeeInfo.tsx b/packages/app/src/sections/futures/FeeInfoBox/ClosePositionFeeInfo.tsx index bc02b42dfa..5303020987 100644 --- a/packages/app/src/sections/futures/FeeInfoBox/ClosePositionFeeInfo.tsx +++ b/packages/app/src/sections/futures/FeeInfoBox/ClosePositionFeeInfo.tsx @@ -2,20 +2,20 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' import { memo } from 'react' import { - selectClosePositionOrderInputs, + selectCloseSMPositionOrderInputs, selectClosePositionPreview, - selectSmartMarginKeeperDeposit, selectEditPositionModalInfo, -} from 'state/futures/selectors' + selectSmartMarginKeeperDeposit, +} from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' -import FeesRow from './FeesRow' +import FeesRow from './FeeRows' const ClosePositionFeeInfo = memo(() => { const tradePreview = useAppSelector(selectClosePositionPreview) const { market } = useAppSelector(selectEditPositionModalInfo) const keeperEthDeposit = useAppSelector(selectSmartMarginKeeperDeposit) - const { orderType } = useAppSelector(selectClosePositionOrderInputs) + const { orderType } = useAppSelector(selectCloseSMPositionOrderInputs) return ( { + const tradePreview = useAppSelector(selectCrossMarginTradePreview) + const marketInfo = useAppSelector(selectV3MarketInfo) + + return ( + + ) +}) + +export default CrossMarginTradeFees diff --git a/packages/app/src/sections/futures/FeeInfoBox/EditPositionFeeInfo.tsx b/packages/app/src/sections/futures/FeeInfoBox/EditPositionFeeInfo.tsx index 447a417591..e924dbc08b 100644 --- a/packages/app/src/sections/futures/FeeInfoBox/EditPositionFeeInfo.tsx +++ b/packages/app/src/sections/futures/FeeInfoBox/EditPositionFeeInfo.tsx @@ -2,20 +2,20 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' import { memo } from 'react' import { - selectSmartMarginKeeperDeposit, selectEditPositionModalInfo, selectEditPositionPreview, - selectOrderType, -} from 'state/futures/selectors' + selectSmartMarginKeeperDeposit, + selectSmartMarginOrderType, +} from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' -import FeesRow from './FeesRow' +import FeesRow from './FeeRows' const EditPositionFeeInfo = memo(() => { const tradePreview = useAppSelector(selectEditPositionPreview) const { market } = useAppSelector(selectEditPositionModalInfo) const keeperEthDeposit = useAppSelector(selectSmartMarginKeeperDeposit) - const orderType = useAppSelector(selectOrderType) + const orderType = useAppSelector(selectSmartMarginOrderType) return ( { const [expanded, toggleExpanded] = useReducer((s) => !s, false) @@ -118,7 +118,7 @@ const FeesRow = memo( > - {(orderType === 'limit' || orderType === 'stop_market') && ( + {(orderType === 'limit' || orderType === 'stop_market') && smartMarginKeeperDeposit && ( )} @@ -126,7 +126,7 @@ const FeesRow = memo( } ) -export default FeesRow +export default FeeRows const StyledHelpIcon = styled(HelpIcon)` margin-left: 4px; diff --git a/packages/app/src/sections/futures/FeeInfoBox/TradeTotalFeesRow.tsx b/packages/app/src/sections/futures/FeeInfoBox/SmartMarginTradeFees.tsx similarity index 78% rename from packages/app/src/sections/futures/FeeInfoBox/TradeTotalFeesRow.tsx rename to packages/app/src/sections/futures/FeeInfoBox/SmartMarginTradeFees.tsx index ac06567bdd..57753cdd15 100644 --- a/packages/app/src/sections/futures/FeeInfoBox/TradeTotalFeesRow.tsx +++ b/packages/app/src/sections/futures/FeeInfoBox/SmartMarginTradeFees.tsx @@ -1,24 +1,24 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' import { memo } from 'react' +import { selectMarketInfo } from 'state/futures/selectors' import { - selectSmartMarginKeeperDeposit, - selectMarketInfo, selectOrderType, + selectSmartMarginKeeperDeposit, selectTradePreview, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' -import FeesRow from './FeesRow' +import FeeRows from './FeeRows' -const TradeTotalFeesRow = memo(() => { +const SmartMarginTradeFees = memo(() => { const tradePreview = useAppSelector(selectTradePreview) const marketInfo = useAppSelector(selectMarketInfo) const keeperEthDeposit = useAppSelector(selectSmartMarginKeeperDeposit) const orderType = useAppSelector(selectOrderType) return ( - { ) }) -export default TradeTotalFeesRow +export default SmartMarginTradeFees diff --git a/packages/app/src/sections/futures/FundingChart.tsx b/packages/app/src/sections/futures/FundingChart.tsx index 7450532b98..5a5541ea04 100644 --- a/packages/app/src/sections/futures/FundingChart.tsx +++ b/packages/app/src/sections/futures/FundingChart.tsx @@ -13,7 +13,8 @@ import styled, { css } from 'styled-components' import { useTheme } from 'styled-components' import { fetchFundingRatesHistory } from 'state/futures/actions' -import { selectHistoricalFundingRatePeriod, selectMarketAsset } from 'state/futures/selectors' +import { selectMarketAsset } from 'state/futures/common/selectors' +import { selectHistoricalFundingRatePeriod } from 'state/futures/selectors' import { useAppSelector, usePollAction } from 'state/hooks' import FundingChartTooltip, { formatFundingRate } from './FundingChartTooltip' @@ -29,7 +30,9 @@ const FundingChart: FC = ({ display }) => { const theme = useTheme() const marketAsset = useAppSelector(selectMarketAsset) const period = useAppSelector(selectHistoricalFundingRatePeriod) - const historicalFundingRates = useAppSelector(({ futures }) => futures.historicalFundingRates) + const historicalFundingRates = useAppSelector( + ({ smartMargin }) => smartMargin.historicalFundingRates + ) usePollAction( 'fetchFundingRatesHistory', diff --git a/packages/app/src/sections/futures/LeverageInput.tsx b/packages/app/src/sections/futures/LeverageInput.tsx index d9d8b675ed..ed989e3207 100644 --- a/packages/app/src/sections/futures/LeverageInput.tsx +++ b/packages/app/src/sections/futures/LeverageInput.tsx @@ -1,4 +1,5 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' +import { FuturesMarginType } from '@kwenta/sdk/types' import { floorNumber, truncateNumbers } from '@kwenta/sdk/utils' import { wei } from '@synthetixio/wei' import { Dispatch, FC, memo, SetStateAction, useCallback, useMemo, useState } from 'react' @@ -13,16 +14,15 @@ import NumericInput from 'components/Input/NumericInput' import { FlexDivCol, FlexDivRow } from 'components/layout/flex' import { DEFAULT_FIAT_DECIMALS } from 'constants/defaults' import { editTradeSizeInput } from 'state/futures/actions' -import { setLeverageInput } from 'state/futures/reducer' +import { selectFuturesType, selectMarketIndexPrice } from 'state/futures/common/selectors' import { selectLeverageInput, - selectMarketIndexPrice, selectMaxLeverage, selectPosition, - selectFuturesType, - selectCrossMarginMarginDelta, selectTradeSizeInputsDisabled, } from 'state/futures/selectors' +import { setSmartMarginLeverageInput } from 'state/futures/smartMargin/reducer' +import { selectSmartMarginMarginDelta } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import LeverageSlider from './LeverageSlider' @@ -47,12 +47,14 @@ const LeverageInput: FC = memo(() => { const marketPrice = useAppSelector(selectMarketIndexPrice) const leverageInput = useAppSelector(selectLeverageInput) const futuresType = useAppSelector(selectFuturesType) - const crossMarginMarginDelta = useAppSelector(selectCrossMarginMarginDelta) + const smartMarginMarginDelta = useAppSelector(selectSmartMarginMarginDelta) const isDisabled = useAppSelector(selectTradeSizeInputsDisabled) const availableMargin = useMemo(() => { - return futuresType === 'isolated_margin' ? position?.remainingMargin : crossMarginMarginDelta - }, [position?.remainingMargin, crossMarginMarginDelta, futuresType]) + return futuresType === FuturesMarginType.CROSS_MARGIN + ? position?.remainingMargin + : smartMarginMarginDelta + }, [position?.remainingMargin, smartMarginMarginDelta, futuresType]) const leverageButtons = useMemo( () => (maxLeverage.eq(50) ? ['2', '5', '25', '50'] : ['2', '5', '10', '25']), @@ -68,7 +70,7 @@ const LeverageInput: FC = memo(() => { : wei(Number(newLeverage)).mul(remainingMargin).div(marketPrice).toString() const floored = floorNumber(Number(newTradeSize), 4) dispatch(editTradeSizeInput(String(floored), 'native')) - dispatch(setLeverageInput(newLeverage)) + dispatch(setSmartMarginLeverageInput(newLeverage)) }, [marketPrice, dispatch, availableMargin] ) diff --git a/packages/app/src/sections/futures/MarginInput.tsx b/packages/app/src/sections/futures/MarginInput.tsx index 56815c1b9e..770465c57c 100644 --- a/packages/app/src/sections/futures/MarginInput.tsx +++ b/packages/app/src/sections/futures/MarginInput.tsx @@ -9,13 +9,9 @@ import NumericInput from 'components/Input/NumericInput' import { FlexDivRow } from 'components/layout/flex' import SelectorButtons from 'components/SelectorButtons' import { Body } from 'components/Text' -import { editCrossMarginTradeMarginDelta } from 'state/futures/actions' -import { - selectSelectedInputDenomination, - selectMarginDeltaInputValue, - selectIdleMargin, - selectPosition, -} from 'state/futures/selectors' +import { selectSelectedInputDenomination, selectPosition } from 'state/futures/selectors' +import { editSmartMarginTradeMarginDelta } from 'state/futures/smartMargin/actions' +import { selectIdleMargin, selectMarginDeltaInputValue } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' const PERCENT_OPTIONS = ['10%', '25%', '50%', '100%'] @@ -34,14 +30,14 @@ const MarginInput: React.FC = memo(({ isMobile }) => { const position = useAppSelector(selectPosition) const onChangeValue = (_: ChangeEvent, v: string) => { - dispatch(editCrossMarginTradeMarginDelta(v)) + dispatch(editSmartMarginTradeMarginDelta(v)) } const onSelectPercent = (index: number) => { const percent = PERCENT_OPTIONS[index].replace('%', '') const margin = idleMargin.div(100).mul(percent) - dispatch(editCrossMarginTradeMarginDelta(floorNumber(margin).toString())) + dispatch(editSmartMarginTradeMarginDelta(floorNumber(margin).toString())) } const belowMinMargin = useMemo( diff --git a/packages/app/src/sections/futures/MarketDetails/MarketDetails.tsx b/packages/app/src/sections/futures/MarketDetails/MarketDetails.tsx index 43c3c39b23..2a9430d379 100644 --- a/packages/app/src/sections/futures/MarketDetails/MarketDetails.tsx +++ b/packages/app/src/sections/futures/MarketDetails/MarketDetails.tsx @@ -10,10 +10,9 @@ import { FlexDivCol, FlexDivRow, FlexDivRowCentered } from 'components/layout/fl import { Body } from 'components/Text' import { NO_VALUE } from 'constants/placeholder' import useWindowSize from 'hooks/useWindowSize' +import { selectMarketAsset, selectMarketPriceInfo } from 'state/futures/common/selectors' import { - selectMarketAsset, selectMarketInfo, - selectMarketPriceInfo, selectSelectedInputHours, selectSkewAdjustedPriceInfo, } from 'state/futures/selectors' diff --git a/packages/app/src/sections/futures/MarketInfo/MarketHead.tsx b/packages/app/src/sections/futures/MarketInfo/MarketHead.tsx index 41389d71eb..701fe91056 100644 --- a/packages/app/src/sections/futures/MarketInfo/MarketHead.tsx +++ b/packages/app/src/sections/futures/MarketInfo/MarketHead.tsx @@ -3,7 +3,8 @@ import Head from 'next/head' import { FC } from 'react' import { useTranslation } from 'react-i18next' -import { selectMarketAsset, selectSkewAdjustedPrice } from 'state/futures/selectors' +import { selectMarketAsset } from 'state/futures/common/selectors' +import { selectSkewAdjustedPrice } from 'state/futures/selectors' import { useAppSelector } from 'state/hooks' const MarketHead: FC = () => { diff --git a/packages/app/src/sections/futures/MarketInfoBox.tsx b/packages/app/src/sections/futures/MarketInfoBox.tsx index 7219773884..96683cac1a 100644 --- a/packages/app/src/sections/futures/MarketInfoBox.tsx +++ b/packages/app/src/sections/futures/MarketInfoBox.tsx @@ -1,21 +1,20 @@ -import { formatDollars, formatPercent } from '@kwenta/sdk/utils' +import { formatDollars } from '@kwenta/sdk/utils' import React, { memo } from 'react' import styled from 'styled-components' import { InfoBoxContainer, InfoBoxRow } from 'components/InfoBox' import PreviewArrow from 'components/PreviewArrow' +import { selectCrossMarginAvailableMargin } from 'state/futures/crossMargin/selectors' +import { selectMarketSuspended } from 'state/futures/selectors' import { - selectAvailableMargin, selectBuyingPower, - selectMarginUsage, - selectMarketSuspended, selectPreviewMarginChange, selectTradePreview, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' const AvailableMarginRow = memo(() => { - const availableMargin = useAppSelector(selectAvailableMargin) + const availableMargin = useAppSelector(selectCrossMarginAvailableMargin) const potentialTrade = useAppSelector(selectTradePreview) const previewTradeData = useAppSelector(selectPreviewMarginChange) const marketSuspended = useAppSelector(selectMarketSuspended) @@ -56,32 +55,11 @@ const BuyingPowerRow = memo(() => { ) }) -const MarginUsageRow = memo(() => { - const previewTradeData = useAppSelector(selectPreviewMarginChange) - const potentialTrade = useAppSelector(selectTradePreview) - const marginUsage = useAppSelector(selectMarginUsage) - const marketSuspended = useAppSelector(selectMarketSuspended) - - return ( - - {formatPercent(previewTradeData?.marginUsage)} - - } - disabled={marketSuspended} - /> - ) -}) - const MarketInfoBox: React.FC = memo(() => { return ( - ) }) diff --git a/packages/app/src/sections/futures/MobileTrade/MobileTrade.tsx b/packages/app/src/sections/futures/MobileTrade/MobileTrade.tsx index ac95a82c1b..ed2c9bc8de 100644 --- a/packages/app/src/sections/futures/MobileTrade/MobileTrade.tsx +++ b/packages/app/src/sections/futures/MobileTrade/MobileTrade.tsx @@ -12,7 +12,7 @@ import MarketDetails from '../MarketDetails/MarketDetails' import FuturesUnsupportedNetwork from '../Trade/FuturesUnsupported' import MarketsDropdown from '../Trade/MarketsDropdown' import { MARKET_SELECTOR_HEIGHT_MOBILE } from '../Trade/MarketsDropdownSelector' -import TradeBalance from '../Trade/TradeBalance' +import TradeBalance from '../Trade/TradeBalanceSmartMargin' import TradePanelDrawer from './drawers/TradePanelDrawer' import OverviewTabs from './OverviewTabs' diff --git a/packages/app/src/sections/futures/MobileTrade/OverviewTabs/AccountTab.tsx b/packages/app/src/sections/futures/MobileTrade/OverviewTabs/AccountTab.tsx index 284231a195..fcdf8f3bbf 100644 --- a/packages/app/src/sections/futures/MobileTrade/OverviewTabs/AccountTab.tsx +++ b/packages/app/src/sections/futures/MobileTrade/OverviewTabs/AccountTab.tsx @@ -1,10 +1,11 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' import React from 'react' import MarketInfoBox from 'sections/futures/MarketInfoBox' import { Pane, SectionHeader, SectionTitle } from 'sections/futures/mobile' import MarketActions from 'sections/futures/Trade/MarketActions' -import MarginInfoBox from 'sections/futures/TradeCrossMargin/CrossMarginInfoBox' -import { selectFuturesType } from 'state/futures/selectors' +import MarginInfoBox from 'sections/futures/TradeSmartMargin/SmartMarginInfoBox' +import { selectFuturesType } from 'state/futures/common/selectors' import { useAppSelector } from 'state/hooks' const AccountTab: React.FC = () => { @@ -15,7 +16,7 @@ const AccountTab: React.FC = () => { Account - {accountType === 'isolated_margin' ? ( + {accountType === FuturesMarginType.CROSS_MARGIN ? ( <> diff --git a/packages/app/src/sections/futures/MobileTrade/PositionDetails.tsx b/packages/app/src/sections/futures/MobileTrade/PositionDetails.tsx index 56796039f5..08488a2afb 100644 --- a/packages/app/src/sections/futures/MobileTrade/PositionDetails.tsx +++ b/packages/app/src/sections/futures/MobileTrade/PositionDetails.tsx @@ -3,14 +3,15 @@ import styled from 'styled-components' import FuturesPositionsTable from 'sections/dashboard/FuturesPositionsTable' import { SectionHeader, SectionSeparator, SectionTitle } from 'sections/futures/mobile' -import { selectFuturesType, selectPosition } from 'state/futures/selectors' +import { selectFuturesType } from 'state/futures/common/selectors' +import { selectPosition } from 'state/futures/selectors' import { useAppSelector } from 'state/hooks' const PositionDetails = () => { const position = useAppSelector(selectPosition) const accountType = useAppSelector(selectFuturesType) - return position?.position ? ( + return position ? ( <> diff --git a/packages/app/src/sections/futures/MobileTrade/UserTabs/ConditionalOrdersTab.tsx b/packages/app/src/sections/futures/MobileTrade/UserTabs/ConditionalOrdersTab.tsx index b933a92e0a..f12970b861 100644 --- a/packages/app/src/sections/futures/MobileTrade/UserTabs/ConditionalOrdersTab.tsx +++ b/packages/app/src/sections/futures/MobileTrade/UserTabs/ConditionalOrdersTab.tsx @@ -13,12 +13,12 @@ import { Body } from 'components/Text' import { NO_VALUE } from 'constants/placeholder' import PositionType from 'sections/futures/PositionType' import ConditionalOrdersWarning from 'sections/futures/UserInfo/ConditionalOrdersWarning' -import { cancelConditionalOrder } from 'state/futures/actions' +import { selectMarketAsset } from 'state/futures/common/selectors' +import { cancelConditionalOrder } from 'state/futures/smartMargin/actions' import { selectAllConditionalOrders, selectCancellingConditionalOrder, - selectMarketAsset, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' const ConditionalOrdersTab: React.FC = () => { diff --git a/packages/app/src/sections/futures/MobileTrade/UserTabs/OrdersTab.tsx b/packages/app/src/sections/futures/MobileTrade/UserTabs/OrdersTab.tsx index 29276ba79e..1b1b6b26d1 100644 --- a/packages/app/src/sections/futures/MobileTrade/UserTabs/OrdersTab.tsx +++ b/packages/app/src/sections/futures/MobileTrade/UserTabs/OrdersTab.tsx @@ -1,6 +1,6 @@ -import { FuturesMarketKey, PositionSide } from '@kwenta/sdk/types' +import { FuturesMarginType, FuturesMarketKey, PositionSide } from '@kwenta/sdk/types' import { getDisplayAsset, formatCurrency, suggestedDecimals } from '@kwenta/sdk/utils' -import { useState, useMemo, useCallback } from 'react' +import { useState, useMemo } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -14,13 +14,13 @@ import useInterval from 'hooks/useInterval' import useIsL2 from 'hooks/useIsL2' import useNetworkSwitcher from 'hooks/useNetworkSwitcher' import PositionType from 'sections/futures/PositionType' -import { cancelDelayedOrder, executeDelayedOrder } from 'state/futures/actions' -import { - selectOpenDelayedOrders, - selectMarketAsset, - selectMarkets, - selectIsExecutingOrder, -} from 'state/futures/selectors' +import { cancelDelayedOrder } from 'state/futures/actions' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' +import { cancelAsyncOrder, executeAsyncOrder } from 'state/futures/crossMargin/actions' +import { selectAsyncCrossMarginOrders } from 'state/futures/crossMargin/selectors' +import { selectIsExecutingOrder, selectIsCancellingOrder } from 'state/futures/selectors' +import { executeDelayedOrder } from 'state/futures/smartMargin/actions' +import { selectSmartMarginDelayedOrders } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' type CountdownTimers = Record< @@ -35,35 +35,27 @@ const OrdersTab: React.FC = () => { const isL2 = useIsL2() const marketAsset = useAppSelector(selectMarketAsset) - const openDelayedOrders = useAppSelector(selectOpenDelayedOrders) - const futuresMarkets = useAppSelector(selectMarkets) + const smartMarginOrders = useAppSelector(selectSmartMarginDelayedOrders) + const crossMarginOrders = useAppSelector(selectAsyncCrossMarginOrders) const isExecuting = useAppSelector(selectIsExecutingOrder) + const futuresType = useAppSelector(selectFuturesType) + const isCancelling = useAppSelector(selectIsCancellingOrder) - const [countdownTimers, setCountdownTimers] = useState() - - const handleCancel = useCallback( - (marketAddress: string, isOffchain: boolean) => () => { - dispatch(cancelDelayedOrder({ marketAddress, isOffchain })) - }, - [dispatch] + const orders = useMemo( + () => (futuresType === FuturesMarginType.CROSS_MARGIN ? crossMarginOrders : smartMarginOrders), + [futuresType, crossMarginOrders, smartMarginOrders] ) - const handleExecute = useCallback( - (marketKey: FuturesMarketKey, marketAddress: string, isOffchain: boolean) => () => { - dispatch(executeDelayedOrder({ marketKey, marketAddress, isOffchain })) - }, - [dispatch] - ) + const [countdownTimers, setCountdownTimers] = useState() const rowsData = useMemo(() => { - const ordersWithCancel = openDelayedOrders + const ordersWithCancel = orders .map((o) => { - const market = futuresMarkets.find((m) => m.market === o.marketAddress) - const timer = countdownTimers ? countdownTimers[o.marketKey] : null + const timer = countdownTimers ? countdownTimers[o.market.marketKey] : null const order = { ...o, - sizeTxt: formatCurrency(o.asset, o.size.abs(), { - currencyKey: getDisplayAsset(o.asset) ?? '', + sizeTxt: formatCurrency(o.market.asset, o.size.abs(), { + currencyKey: getDisplayAsset(o.market.asset) ?? '', minDecimals: suggestedDecimals(o.size), }), timeToExecution: timer?.timeToExecution, @@ -71,52 +63,66 @@ const OrdersTab: React.FC = () => { show: !!timer, isStale: timer && - market?.settings && + o.market.settings && timer.timeToExecution === 0 && - timer.timePastExecution > - DEFAULT_DELAYED_CANCEL_BUFFER + - (o.isOffchain - ? market.settings.offchainDelayedOrderMaxAge - : market.settings.maxDelayTimeDelta), + timer.timePastExecution > DEFAULT_DELAYED_CANCEL_BUFFER + o.settlementWindowDuration, isFailed: timer && - market?.settings && + o.market.settings && timer.timeToExecution === 0 && - timer.timePastExecution > - DEFAULT_DELAYED_EXECUTION_BUFFER + - (o.isOffchain - ? market.settings.offchainDelayedOrderMinAge - : market.settings.minDelayTimeDelta), + timer.timePastExecution > DEFAULT_DELAYED_EXECUTION_BUFFER, isExecutable: timer && - market?.settings && timer.timeToExecution === 0 && - timer.timePastExecution <= - (o.isOffchain - ? market.settings.offchainDelayedOrderMaxAge - : market.settings.maxDelayTimeDelta), - totalDeposit: o.commitDeposit.add(o.keeperDeposit), + timer.timePastExecution <= o.settlementWindowDuration, + totalDeposit: o.settlementFee, + onCancel: () => { + if (o.market.version === 2) { + dispatch(cancelDelayedOrder(o.market.marketAddress)) + } else { + dispatch(cancelAsyncOrder(o.market.marketId)) + } + }, + onExecute: () => { + if (o.market.version === 2) { + dispatch( + executeDelayedOrder({ + marketKey: o.market.marketKey, + marketAddress: o.market.marketAddress, + }) + ) + } else { + dispatch( + executeAsyncOrder({ + marketKey: o.market.marketKey, + marketId: o.market.marketId, + }) + ) + } + }, } return order }) .sort((a, b) => { - return b.asset === marketAsset && a.asset !== marketAsset + return b.market.asset === marketAsset && a.market.asset !== marketAsset ? 1 - : b.asset === marketAsset && a.asset === marketAsset + : b.market.asset === marketAsset && a.market.asset === marketAsset ? 0 : -1 }) return ordersWithCancel - }, [openDelayedOrders, futuresMarkets, marketAsset, countdownTimers]) + }, [marketAsset, countdownTimers, orders, dispatch]) + + // TODO: Combine this with the one in OpenDelayedOrdersTable useInterval( () => { const newCountdownTimers = rowsData.reduce((acc, order) => { - const timeToExecution = Math.floor((order.executableAtTimestamp - Date.now()) / 1000) - const timePastExecution = Math.floor((Date.now() - order.executableAtTimestamp) / 1000) + const timeToExecution = Math.floor(order.executableStartTime - Date.now() / 1000) + const timePastExecution = Math.floor(Date.now() / 1000 - order.executableStartTime) // Only updated delayed orders - acc[order.marketKey] = { + acc[order.market.marketKey] = { timeToExecution: Math.max(timeToExecution, 0), timePastExecution: Math.max(timePastExecution, 0), } @@ -127,7 +133,6 @@ const OrdersTab: React.FC = () => { 1000, [rowsData] ) - return ( {!isL2 ? ( @@ -144,9 +149,9 @@ const OrdersTab: React.FC = () => {
- {order.market} + {order.market.marketName} - {order.orderType} + Market
@@ -154,8 +159,14 @@ const OrdersTab: React.FC = () => { {order.show && order.isStale && ( { + if (order.market.version === 2) { + dispatch(cancelDelayedOrder(order.market.marketAddress)) + } else { + dispatch(cancelAsyncOrder(order.market.marketId)) + } + }} + disabled={isCancelling} color="red" > Cancel @@ -166,11 +177,23 @@ const OrdersTab: React.FC = () => { { + if (order.market.version === 2) { + dispatch( + executeDelayedOrder({ + marketKey: order.market.marketKey, + marketAddress: order.market.marketAddress, + }) + ) + } else { + dispatch( + executeAsyncOrder({ + marketKey: order.market.marketKey, + marketId: order.market.marketId, + }) + ) + } + }} disabled={isExecuting} > Execute diff --git a/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx b/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx index f3e610cbea..ee6e556909 100644 --- a/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx +++ b/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx @@ -1,9 +1,9 @@ -import { ZERO_WEI } from '@kwenta/sdk/constants' -import { FuturesMarketKey, PositionSide } from '@kwenta/sdk/types' +import { FuturesMarginType, FuturesMarketKey, PositionSide } from '@kwenta/sdk/types' import Router from 'next/router' import { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' +import { FuturesPositionTablePosition } from 'types/futures' import Currency from 'components/Currency' import { FlexDiv, FlexDivRow, FlexDivRowCentered } from 'components/layout/flex' @@ -19,16 +19,9 @@ import PositionType from 'sections/futures/PositionType' import ShareModal from 'sections/futures/ShareModal' import EditPositionButton from 'sections/futures/UserInfo/EditPositionButton' import { setShowPositionModal } from 'state/app/reducer' -import { - selectCrossMarginPositions, - selectFuturesType, - selectIsolatedMarginPositions, - selectMarketAsset, - selectMarkets, - selectMarkPrices, - selectPositionHistory, -} from 'state/futures/selectors' -import { SharePositionParams } from 'state/futures/types' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' +import { selectCrossMarginPositions } from 'state/futures/crossMargin/selectors' +import { selectSmartMarginPositions } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import media from 'styles/media' @@ -39,57 +32,36 @@ const PositionsTab = () => { const isL2 = useIsL2() - const isolatedPositions = useAppSelector(selectIsolatedMarginPositions) const crossMarginPositions = useAppSelector(selectCrossMarginPositions) - const positionHistory = useAppSelector(selectPositionHistory) + const smartMarginPositions = useAppSelector(selectSmartMarginPositions) const currentMarket = useAppSelector(selectMarketAsset) - const futuresMarkets = useAppSelector(selectMarkets) - const markPrices = useAppSelector(selectMarkPrices) const accountType = useAppSelector(selectFuturesType) const [showShareModal, setShowShareModal] = useState(false) - const [sharePosition, setSharePosition] = useState(null) + const [sharePosition, setSharePosition] = useState(null) let data = useMemo(() => { - const positions = accountType === 'cross_margin' ? crossMarginPositions : isolatedPositions + const positions = + accountType === FuturesMarginType.SMART_MARGIN ? smartMarginPositions : crossMarginPositions return positions .map((position) => { - const market = futuresMarkets.find((market) => market.asset === position.asset) - const thisPositionHistory = positionHistory.find((ph) => { - return ph.isOpen && ph.asset === position.asset - }) - const markPrice = markPrices[market?.marketKey!] ?? ZERO_WEI return { - market: market!, + market: position.market, remainingMargin: position.remainingMargin, - position: position.position!, - avgEntryPrice: thisPositionHistory?.avgEntryPrice, + position: position, + avgEntryPrice: position.history?.avgEntryPrice, stopLoss: position.stopLoss?.targetPrice, takeProfit: position.takeProfit?.targetPrice, - share: { - asset: position.asset, - position: position.position!, - positionHistory: thisPositionHistory!, - marketPrice: markPrice, - }, } }) .filter(({ position, market }) => !!position && !!market) .sort((a) => (a.market.asset === currentMarket ? -1 : 1)) - }, [ - accountType, - crossMarginPositions, - isolatedPositions, - futuresMarkets, - positionHistory, - markPrices, - currentMarket, - ]) + }, [accountType, smartMarginPositions, crossMarginPositions, currentMarket]) const handleOpenPositionCloseModal = useCallback( (marketKey: FuturesMarketKey) => () => { dispatch( setShowPositionModal({ - type: 'futures_close_position', + type: 'smart_margin_close_position', marketKey, }) ) @@ -97,7 +69,7 @@ const PositionsTab = () => { [dispatch] ) - const handleOpenShareModal = useCallback((share: SharePositionParams) => { + const handleOpenShareModal = useCallback((share: FuturesPositionTablePosition) => { setSharePosition(share) setShowShareModal((s) => !s) }, []) @@ -127,7 +99,9 @@ const PositionsTab = () => {
{row.market.marketName} - {accountType === 'isolated_margin' ? 'Isolated Margin' : 'Smart Margin'} + {accountType === FuturesMarginType.CROSS_MARGIN + ? 'Cross Margin' + : 'Smart Margin'}
@@ -135,7 +109,7 @@ const PositionsTab = () => { Close - handleOpenShareModal(row.share)}> + handleOpenShareModal(row.position)}> Share @@ -146,7 +120,7 @@ const PositionsTab = () => {
- {accountType === 'cross_margin' && ( + {accountType === FuturesMarginType.SMART_MARGIN && ( <> { Market Margin - {accountType === 'cross_margin' && ( + {accountType === FuturesMarginType.SMART_MARGIN && ( <> { ) : ( )} - {accountType === 'cross_margin' && ( + {accountType === FuturesMarginType.SMART_MARGIN && ( <> { const [selectedTrade, setSelectedTrade] = React.useState() - useFetchAction(fetchAllTradesForAccount, { + useFetchAction(fetchAllV2TradesForAccount, { dependencies: [walletAddress, accountType, marketAsset], disabled: !walletAddress, }) diff --git a/packages/app/src/sections/futures/MobileTrade/UserTabs/TransfersTab.tsx b/packages/app/src/sections/futures/MobileTrade/UserTabs/TransfersTab.tsx index 085771c8b4..37a3032c0d 100644 --- a/packages/app/src/sections/futures/MobileTrade/UserTabs/TransfersTab.tsx +++ b/packages/app/src/sections/futures/MobileTrade/UserTabs/TransfersTab.tsx @@ -1,3 +1,4 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' import { formatDollars } from '@kwenta/sdk/utils' import React, { useMemo } from 'react' import { useTranslation } from 'react-i18next' @@ -8,12 +9,9 @@ import Table, { TableHeader, TableNoResults } from 'components/Table' import { Body } from 'components/Text' import useIsL2 from 'hooks/useIsL2' import useNetworkSwitcher from 'hooks/useNetworkSwitcher' -import { - selectFuturesType, - selectIdleMarginTransfers, - selectMarketMarginTransfers, - selectQueryStatuses, -} from 'state/futures/selectors' +import { selectFuturesType } from 'state/futures/common/selectors' +import { selectMarketMarginTransfers, selectQueryStatuses } from 'state/futures/selectors' +import { selectIdleMarginTransfers } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import { FetchStatus } from 'state/types' import { timePresentation } from 'utils/formatters/date' @@ -36,8 +34,11 @@ const TransfersTab: React.FC = () => { [marketMarginTransfers, idleMarginTransfers, marginTransfersStatus] ) + // TODO: Move to selector const marginTransfers = useMemo(() => { - return accountType === 'isolated_margin' ? marketMarginTransfers : idleMarginTransfers + return accountType === FuturesMarginType.CROSS_MARGIN + ? marketMarginTransfers + : idleMarginTransfers }, [accountType, idleMarginTransfers, marketMarginTransfers]) return ( diff --git a/packages/app/src/sections/futures/MobileTrade/UserTabs/UserTabs.tsx b/packages/app/src/sections/futures/MobileTrade/UserTabs/UserTabs.tsx index b67a03dc10..3a7650b715 100644 --- a/packages/app/src/sections/futures/MobileTrade/UserTabs/UserTabs.tsx +++ b/packages/app/src/sections/futures/MobileTrade/UserTabs/UserTabs.tsx @@ -2,11 +2,11 @@ import React, { useMemo } from 'react' import styled from 'styled-components' import TabButton from 'components/Button/TabButton' +import { selectPendingOrdersCount } from 'state/futures/selectors' import { selectActiveSmartPositionsCount, selectAllConditionalOrders, - selectOpenDelayedOrders, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import ConditionalOrdersTab from './ConditionalOrdersTab' @@ -16,7 +16,7 @@ import TradesTab from './TradesTab' const UserTabs: React.FC = () => { const [activeTab, setActiveTab] = React.useState(0) - const openOrders = useAppSelector(selectOpenDelayedOrders) + const pendingOrdersCount = useAppSelector(selectPendingOrdersCount) const conditionalOrders = useAppSelector(selectAllConditionalOrders) const smartPositionsCount = useAppSelector(selectActiveSmartPositionsCount) @@ -30,7 +30,7 @@ const UserTabs: React.FC = () => { { title: 'Pending', component: , - badge: openOrders.length, + badge: pendingOrdersCount, }, { title: 'Orders', @@ -42,7 +42,7 @@ const UserTabs: React.FC = () => { component: , }, ] - }, [conditionalOrders.length, openOrders.length, smartPositionsCount]) + }, [conditionalOrders.length, pendingOrdersCount, smartPositionsCount]) return ( diff --git a/packages/app/src/sections/futures/MobileTrade/drawers/ConditionalOrderDrawer.tsx b/packages/app/src/sections/futures/MobileTrade/drawers/ConditionalOrderDrawer.tsx deleted file mode 100644 index fb31808bc6..0000000000 --- a/packages/app/src/sections/futures/MobileTrade/drawers/ConditionalOrderDrawer.tsx +++ /dev/null @@ -1,109 +0,0 @@ -import { ConditionalOrder, PositionSide } from '@kwenta/sdk/types' -import { getDisplayAsset, formatCurrency } from '@kwenta/sdk/utils' -import React, { useCallback } from 'react' -import { useTranslation } from 'react-i18next' -import styled, { css } from 'styled-components' - -import Button from 'components/Button' -import { cancelConditionalOrder } from 'state/futures/actions' -import { useAppDispatch } from 'state/hooks' - -import BaseDrawer from './BaseDrawer' - -type OrderDrawerProps = { - open: boolean - order: ConditionalOrder - closeDrawer(): void -} - -export default function ConditionalOrderDrawer({ open, order, closeDrawer }: OrderDrawerProps) { - const { t } = useTranslation() - const dispatch = useAppDispatch() - - const onCancel = useCallback( - (order: ConditionalOrder) => { - dispatch(cancelConditionalOrder(order.id)) - }, - [dispatch] - ) - - const items = React.useMemo(() => { - if (!order || !order.side || !order.asset) return [] - - return [ - { - label: t('futures.market.user.open-orders.table.market'), - value: getDisplayAsset(order.asset), - }, - { - label: t('futures.market.user.open-orders.table.side'), - value: {order.side}, - }, - { - label: t('futures.market.user.open-orders.table.size'), - value: formatCurrency(order.asset, order.size.abs(), { - currencyKey: getDisplayAsset(order.asset) ?? '', - minDecimals: order.size.abs().lt(0.01) ? 4 : 2, - }), - }, - { - label: t('futures.market.user.open-orders.table.price'), - value: order.targetPriceTxt, - }, - { - label: t('futures.market.user.open-orders.table.type'), - value: order.orderTypeDisplay, - }, - ] - }, [t, order]) - - return ( - onCancel(order)}>Cancel} - /> - ) -} - -const StyledPositionSide = styled.div<{ side: PositionSide }>` - text-transform: uppercase; - font-weight: bold; - ${(props) => - props.side === PositionSide.LONG && - css` - color: ${props.theme.colors.common.primaryGreen}; - `} - - ${(props) => - props.side === PositionSide.SHORT && - css` - color: ${props.theme.colors.common.primaryRed}; - `} -` - -const CancelOrderButton = styled(Button)` - font-size: 16px; - height: 41px; - text-align: center; - white-space: normal; - background: rgba(239, 104, 104, 0.04); - border: 1px solid #ef6868; - box-shadow: none; - transition: all 0s ease-in-out; - flex: 1; - - &:hover { - background: ${(props) => props.theme.colors.common.primaryRed}; - color: ${(props) => props.theme.colors.white}; - transform: scale(0.98); - } - - &:disabled { - border: ${(props) => props.theme.colors.selectedTheme.border}; - background: transparent; - color: ${(props) => props.theme.colors.selectedTheme.button.disabled.text}; - transform: none; - } -` diff --git a/packages/app/src/sections/futures/MobileTrade/drawers/OrderDrawer.tsx b/packages/app/src/sections/futures/MobileTrade/drawers/OrderDrawer.tsx deleted file mode 100644 index e5335e6d0b..0000000000 --- a/packages/app/src/sections/futures/MobileTrade/drawers/OrderDrawer.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import { PositionSide } from '@kwenta/sdk/types' -import { getDisplayAsset, formatCurrency } from '@kwenta/sdk/utils' -import React, { useCallback } from 'react' -import { useTranslation } from 'react-i18next' -import styled, { css } from 'styled-components' - -import Button from 'components/Button' -import { cancelDelayedOrder, executeDelayedOrder } from 'state/futures/actions' -import { DelayedOrderWithDetails } from 'state/futures/types' -import { useAppDispatch } from 'state/hooks' - -import BaseDrawer from './BaseDrawer' - -type OrderDrawerProps = { - open: boolean - order: DelayedOrderWithDetails - closeDrawer(): void -} - -const OrderDrawer: React.FC = ({ open, order, closeDrawer }) => { - const { t } = useTranslation() - const dispatch = useAppDispatch() - - const onCancel = useCallback( - (order: DelayedOrderWithDetails) => { - dispatch( - cancelDelayedOrder({ - marketAddress: order.marketAddress, - isOffchain: order.isOffchain, - }) - ) - }, - [dispatch] - ) - - const onExecute = useCallback( - (order: DelayedOrderWithDetails) => { - dispatch( - executeDelayedOrder({ - marketKey: order.marketKey, - marketAddress: order.marketAddress, - isOffchain: order.isOffchain, - }) - ) - }, - [dispatch] - ) - - const items = React.useMemo(() => { - if (!order || !order.side || !order.asset) return [] - - return [ - { - label: t('futures.market.user.open-orders.table.market'), - value: getDisplayAsset(order.asset), - }, - { - label: t('futures.market.user.open-orders.table.side'), - value: {order.side}, - }, - { - label: t('futures.market.user.open-orders.table.size'), - value: formatCurrency(order.asset, order.size.abs(), { - currencyKey: getDisplayAsset(order.asset) ?? '', - minDecimals: order.size.abs().lt(0.01) ? 4 : 2, - }), - }, - { - label: t('futures.market.user.open-orders.table.type'), - value: order.orderType, - }, - ] - }, [t, order]) - - return ( - - {order?.isExecutable && ( - onExecute(order)}>Execute - )} - onCancel(order)}>Cancel - - } - /> - ) -} - -const StyledPositionSide = styled.div<{ side: PositionSide }>` - text-transform: uppercase; - font-weight: bold; - ${(props) => - props.side === PositionSide.LONG && - css` - color: ${props.theme.colors.common.primaryGreen}; - `} - - ${(props) => - props.side === PositionSide.SHORT && - css` - color: ${props.theme.colors.common.primaryRed}; - `} -` - -const ExecuteButton = styled(Button)` - margin-right: 10px; - height: 41px; - flex: 1; -` - -const CancelOrderButton = styled(Button)` - font-size: 16px; - height: 41px; - text-align: center; - white-space: normal; - background: rgba(239, 104, 104, 0.04); - border: 1px solid #ef6868; - box-shadow: none; - transition: all 0s ease-in-out; - flex: 1; - - &:hover { - background: ${(props) => props.theme.colors.common.primaryRed}; - color: ${(props) => props.theme.colors.white}; - transform: scale(0.98); - } - - &:disabled { - border: ${(props) => props.theme.colors.selectedTheme.border}; - background: transparent; - color: ${(props) => props.theme.colors.selectedTheme.button.disabled.text}; - transform: none; - } -` - -export default OrderDrawer diff --git a/packages/app/src/sections/futures/MobileTrade/drawers/TradePanelDrawer.tsx b/packages/app/src/sections/futures/MobileTrade/drawers/TradePanelDrawer.tsx index 52786251c2..e51da291d7 100644 --- a/packages/app/src/sections/futures/MobileTrade/drawers/TradePanelDrawer.tsx +++ b/packages/app/src/sections/futures/MobileTrade/drawers/TradePanelDrawer.tsx @@ -1,21 +1,30 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' import { FC } from 'react' import styled from 'styled-components' import FullScreenModal from 'components/FullScreenModal' import { zIndex } from 'constants/ui' -import TradeIsolatedMargin from 'sections/futures/Trade/TradePanel' +import TradePanelCrossMargin from 'sections/futures/Trade/TradePanelCrossMargin' +import TradePanelSmartMargin from 'sections/futures/Trade/TradePanelSmartMargin' +import { selectFuturesType } from 'state/futures/common/selectors' +import { useAppSelector } from 'state/hooks' type TradePanelDrawerProps = { open: boolean closeDrawer(): void } const TradePanelDrawer: FC = ({ open, closeDrawer }) => { + const type = useAppSelector(selectFuturesType) return ( - + {type === FuturesMarginType.CROSS_MARGIN ? ( + + ) : ( + + )} diff --git a/packages/app/src/sections/futures/OrderSizing/DenominationToggle.tsx b/packages/app/src/sections/futures/OrderSizing/DenominationToggle.tsx index 5791576702..f1f4fe03a9 100644 --- a/packages/app/src/sections/futures/OrderSizing/DenominationToggle.tsx +++ b/packages/app/src/sections/futures/OrderSizing/DenominationToggle.tsx @@ -3,8 +3,9 @@ import { memo, useCallback } from 'react' import SwitchAssetArrows from 'assets/svg/futures/switch-arrows.svg' import InputButton from 'components/Input/InputButton' +import { selectMarketAsset } from 'state/futures/common/selectors' import { setSelectedInputDenomination } from 'state/futures/reducer' -import { selectMarketAsset, selectSelectedInputDenomination } from 'state/futures/selectors' +import { selectSelectedInputDenomination } from 'state/futures/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' export const DenominationToggle = memo(() => { diff --git a/packages/app/src/sections/futures/OrderSizing/OrderSizeSlider.tsx b/packages/app/src/sections/futures/OrderSizing/OrderSizeSlider.tsx index 443ff73130..0b10fb285f 100644 --- a/packages/app/src/sections/futures/OrderSizing/OrderSizeSlider.tsx +++ b/packages/app/src/sections/futures/OrderSizing/OrderSizeSlider.tsx @@ -6,28 +6,30 @@ import styled from 'styled-components' import ErrorView from 'components/ErrorView' import { FlexDivRow } from 'components/layout/flex' import StyledSlider from 'components/Slider/StyledSlider' -import { editCrossMarginTradeSize } from 'state/futures/actions' import { - selectAboveMaxLeverage, - selectCrossMarginMarginDelta, selectLeverageSide, selectMaxLeverage, selectMaxUsdSizeInput, selectPosition, - selectTradeSizeInputs, } from 'state/futures/selectors' +import { editSmartMarginTradeSize } from 'state/futures/smartMargin/actions' +import { + selectAboveMaxLeverage, + selectSmartMarginMarginDelta, + selectSmartMarginTradeInputs, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' export default function OrderSizeSlider() { const { t } = useTranslation() const dispatch = useAppDispatch() - const { susdSizeString } = useAppSelector(selectTradeSizeInputs) + const { susdSizeString } = useAppSelector(selectSmartMarginTradeInputs) const aboveMaxLeverage = useAppSelector(selectAboveMaxLeverage) const maxLeverage = useAppSelector(selectMaxLeverage) const leverageSide = useAppSelector(selectLeverageSide) const position = useAppSelector(selectPosition) const maxUsdInputAmount = useAppSelector(selectMaxUsdSizeInput) - const marginDelta = useAppSelector(selectCrossMarginMarginDelta) + const marginDelta = useAppSelector(selectSmartMarginMarginDelta) const [percent, setPercent] = useState(0) const [usdValue, setUsdValue] = useState(susdSizeString) @@ -40,7 +42,7 @@ export default function OrderSizeSlider() { const usdValue = Number(usdAmount).toFixed(0) setUsdValue(usdValue) if (commit) { - dispatch(editCrossMarginTradeSize(usdValue, 'usd')) + dispatch(editSmartMarginTradeSize(usdValue, 'usd')) } }, [maxUsdInputAmount, dispatch] @@ -59,7 +61,7 @@ export default function OrderSizeSlider() { // eslint-disable-next-line }, [susdSizeString]) - if (aboveMaxLeverage && position?.position?.side === leverageSide) { + if (aboveMaxLeverage && position?.side === leverageSide) { return ( = memo(({ isMobile }) => { const position = useAppSelector(selectPosition) const marketAssetRate = useAppSelector(selectMarketIndexPrice) - const orderPrice = useAppSelector(selectCrossMarginOrderPrice) + const orderPrice = useAppSelector(selectTradePrice) const assetInputType = useAppSelector(selectSelectedInputDenomination) const maxUsdInputAmount = useAppSelector(selectMaxUsdSizeInput) const tradeSide = useAppSelector(selectLeverageSide) @@ -47,19 +47,19 @@ const OrderSizing: React.FC = memo(({ isMobile }) => { [orderPrice, marketAssetRate] ) - const increasingPosition = !position?.position?.side || position?.position?.side === tradeSide + const increasingPosition = !position?.side || position?.side === tradeSide const availableOiUsd = useMemo(() => { return increasingPosition ? availableOi[tradeSide].usd - : availableOi[tradeSide].usd.add(position?.position?.notionalValue || 0) - }, [tradeSide, availableOi, increasingPosition, position?.position?.notionalValue]) + : availableOi[tradeSide].usd.add(position?.notionalValue || 0) + }, [tradeSide, availableOi, increasingPosition, position?.notionalValue]) const availableOiNative = useMemo(() => { return increasingPosition ? availableOi[tradeSide].native - : availableOi[tradeSide].native.add(position?.position?.size || 0) - }, [tradeSide, availableOi, increasingPosition, position?.position?.size]) + : availableOi[tradeSide].native.add(position?.size || 0) + }, [tradeSide, availableOi, increasingPosition, position?.size]) const maxNativeValue = useMemo(() => { const max = !isZero(tradePrice) ? maxUsdInputAmount.div(tradePrice) : ZERO_WEI diff --git a/packages/app/src/sections/futures/PositionChart.tsx b/packages/app/src/sections/futures/PositionChart.tsx index 88142af25a..3e030aa91e 100644 --- a/packages/app/src/sections/futures/PositionChart.tsx +++ b/packages/app/src/sections/futures/PositionChart.tsx @@ -4,14 +4,13 @@ import styled, { css } from 'styled-components' import { FlexDiv } from 'components/layout/flex' import TVChart from 'components/TVChart' +import { selectMarketIndexPrice } from 'state/futures/common/selectors' +import { selectPosition, selectSelectedMarketPositionHistory } from 'state/futures/selectors' import { selectConditionalOrdersForMarket, - selectMarketIndexPrice, - selectPosition, selectPositionPreviewData, - selectSelectedMarketPositionHistory, selectTradePreview, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' type PositionChartProps = { @@ -32,16 +31,16 @@ export default function PositionChart({ display = true }: PositionChartProps) { const modifiedAverage = positionPreview?.avgEntryPrice ?? ZERO_WEI const activePosition = useMemo(() => { - if (!position?.position) { + if (!position) { return null } return { // As there's often a delay in subgraph sync we use the contract last // price until we get average price to keep it snappy on opening a position - price: subgraphPosition?.avgEntryPrice ?? position.position.lastPrice, - size: position.position.size, - liqPrice: position.position?.liquidationPrice, + price: subgraphPosition?.avgEntryPrice ?? position.lastPrice, + size: position.size, + liqPrice: position.liquidationPrice, } }, [subgraphPosition, position]) diff --git a/packages/app/src/sections/futures/ProfitCalculator/ProfitCalculator.tsx b/packages/app/src/sections/futures/ProfitCalculator/ProfitCalculator.tsx index 3cf6cd572a..2cc4ed73e0 100644 --- a/packages/app/src/sections/futures/ProfitCalculator/ProfitCalculator.tsx +++ b/packages/app/src/sections/futures/ProfitCalculator/ProfitCalculator.tsx @@ -7,7 +7,7 @@ import styled from 'styled-components' import BaseModal from 'components/BaseModal' import PositionButtons from 'sections/futures/PositionButtons' -import { selectMarketAsset, selectMarketIndexPrice } from 'state/futures/selectors' +import { selectMarketAsset, selectMarketIndexPrice } from 'state/futures/common/selectors' import { useAppSelector } from 'state/hooks' import LabelWithInput from './LabelWithInput' diff --git a/packages/app/src/sections/futures/ShareModal/AmountContainer.tsx b/packages/app/src/sections/futures/ShareModal/AmountContainer.tsx index 5754d54f6c..4eb5680e05 100644 --- a/packages/app/src/sections/futures/ShareModal/AmountContainer.tsx +++ b/packages/app/src/sections/futures/ShareModal/AmountContainer.tsx @@ -3,16 +3,20 @@ import { PositionSide } from '@kwenta/sdk/types' import { MarketKeyByAsset, formatNumber, getMarketName } from '@kwenta/sdk/utils' import { FC, useMemo } from 'react' import styled from 'styled-components' +import { FuturesPositionTablePosition } from 'types/futures' import CurrencyIcon from 'components/Currency/CurrencyIcon' -import { selectMarketAsset } from 'state/futures/selectors' -import { SharePositionParams } from 'state/futures/types' +import { selectMarketAsset } from 'state/futures/common/selectors' import { useAppSelector } from 'state/hooks' import media from 'styles/media' -const AmountContainer: FC = ({ asset, position }) => { +type Props = { + position?: FuturesPositionTablePosition +} + +const AmountContainer: FC = ({ position }) => { const defaultAsset = useAppSelector(selectMarketAsset) - const marketAsset = asset ?? defaultAsset + const marketAsset = position?.market.asset ?? defaultAsset const marketName = getMarketName(marketAsset) const positionDetails = position ?? null const leverage = formatNumber(positionDetails?.leverage ?? ZERO_WEI) + 'x' diff --git a/packages/app/src/sections/futures/ShareModal/PositionMetadata.tsx b/packages/app/src/sections/futures/ShareModal/PositionMetadata.tsx index 04cde8bb46..41af4bc324 100644 --- a/packages/app/src/sections/futures/ShareModal/PositionMetadata.tsx +++ b/packages/app/src/sections/futures/ShareModal/PositionMetadata.tsx @@ -4,8 +4,8 @@ import { format } from 'date-fns' import { useLayoutEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' +import { FuturesPositionTablePosition } from 'types/futures' -import { SharePositionParams } from 'state/futures/types' import media from 'styles/media' import getLocale from 'utils/formatters/getLocale' @@ -80,12 +80,12 @@ function getFontFamily(props: any) { } } -const PositionMetadata: React.FC = ({ positionHistory, marketPrice }) => { +const PositionMetadata: React.FC<{ position: FuturesPositionTablePosition }> = ({ position }) => { const { t } = useTranslation() const [currentTimestamp, setCurrentTimestamp] = useState(0) - const avgEntryPrice = positionHistory?.avgEntryPrice.toNumber().toString() ?? '' - const openTimestamp = positionHistory?.openTimestamp ?? 0 + const avgEntryPrice = position?.history?.avgEntryPrice.toNumber().toString() ?? '' + const openTimestamp = position?.history?.openTimestamp ?? 0 useLayoutEffect(() => { const now = new Date().getTime() @@ -128,7 +128,7 @@ const PositionMetadata: React.FC = ({ positionHistory, mark {t('futures.modals.share.position-metadata.current-price')} - {formatNumber(marketPrice ?? ZERO_WEI)} + {formatNumber(position?.lastPrice ?? ZERO_WEI)} diff --git a/packages/app/src/sections/futures/ShareModal/ShareModal.tsx b/packages/app/src/sections/futures/ShareModal/ShareModal.tsx index bd46050c70..f9908f1686 100644 --- a/packages/app/src/sections/futures/ShareModal/ShareModal.tsx +++ b/packages/app/src/sections/futures/ShareModal/ShareModal.tsx @@ -1,12 +1,12 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' +import { FuturesPositionTablePosition } from 'types/futures' import MobilePNLGraphicPNG from 'assets/png/mobile-pnl-graphic.png' import PNLGraphicPNG from 'assets/png/pnl-graphic.png' import BaseModal from 'components/BaseModal' import { DesktopOnlyView, MobileOrTabletView } from 'components/Media' -import { SharePositionParams } from 'state/futures/types' import media from 'styles/media' import AmountContainer from './AmountContainer' @@ -14,7 +14,7 @@ import PositionMetadata from './PositionMetadata' import ShareModalButton from './ShareModalButton' type ShareModalProps = { - sharePosition: SharePositionParams + sharePosition: FuturesPositionTablePosition setShowShareModal: React.Dispatch> } @@ -38,11 +38,8 @@ const ShareModal: FC = ({ sharePosition, setShowShareModal }) = - - + + diff --git a/packages/app/src/sections/futures/ShareModal/ShareModalButton.tsx b/packages/app/src/sections/futures/ShareModal/ShareModalButton.tsx index 61d5f203dd..4ca1c10584 100644 --- a/packages/app/src/sections/futures/ShareModal/ShareModalButton.tsx +++ b/packages/app/src/sections/futures/ShareModal/ShareModalButton.tsx @@ -5,11 +5,11 @@ import { toPng } from 'html-to-image' import { FC } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' +import { FuturesPositionTablePosition } from 'types/futures' import TwitterIcon from 'assets/svg/social/twitter.svg' import Button from 'components/Button' import { DesktopOnlyView, MobileOrTabletView } from 'components/Media' -import { SharePositionParams } from 'state/futures/types' function getTwitterText( side: PositionSide, @@ -37,7 +37,7 @@ function downloadPng(dataUrl: string) { } type ShareModalButtonProps = { - position: SharePositionParams + position: FuturesPositionTablePosition } const ShareModalButton: FC = ({ position }) => { @@ -53,17 +53,16 @@ const ShareModalButton: FC = ({ position }) => { } const handleTweet = () => { - const positionDetails = position.position ?? null - const side = positionDetails?.side === 'long' ? PositionSide.LONG : PositionSide.SHORT - const marketName = getMarketName(position.asset!) - const leverage = formatNumber(positionDetails?.leverage ?? ZERO_WEI) + 'x' - const pnlPct = `+${positionDetails?.pnlPct.mul(100).toNumber().toFixed(2)}%` - - const avgEntryPrice = position.positionHistory?.avgEntryPrice - ? formatNumber(position.positionHistory?.avgEntryPrice) + const side = position?.side === 'long' ? PositionSide.LONG : PositionSide.SHORT + const marketName = getMarketName(position.market.asset!) + const leverage = formatNumber(position?.leverage ?? ZERO_WEI) + 'x' + const pnlPct = `+${position?.pnlPct.mul(100).toNumber().toFixed(2)}%` + + const avgEntryPrice = position.history?.avgEntryPrice + ? formatNumber(position.history?.avgEntryPrice) : '' const dollarEntry = formatDollars(avgEntryPrice ?? ZERO_WEI, { suggestDecimals: true }) - const dollarCurrent = formatNumber(position.marketPrice ?? ZERO_WEI) + const dollarCurrent = formatNumber(position.lastPrice ?? ZERO_WEI) const text = getTwitterText(side, marketName, leverage, pnlPct, dollarEntry, dollarCurrent) window.open(`https://twitter.com/intent/tweet?text=${text}`, '_blank') } diff --git a/packages/app/src/sections/futures/CrossMarginOnboard/CrossMarginFAQ.tsx b/packages/app/src/sections/futures/SmartMarginOnboard/SmartMarginFAQ.tsx similarity index 100% rename from packages/app/src/sections/futures/CrossMarginOnboard/CrossMarginFAQ.tsx rename to packages/app/src/sections/futures/SmartMarginOnboard/SmartMarginFAQ.tsx diff --git a/packages/app/src/sections/futures/CrossMarginOnboard/CrossMarginOnboard.tsx b/packages/app/src/sections/futures/SmartMarginOnboard/SmartMarginOnboard.tsx similarity index 79% rename from packages/app/src/sections/futures/CrossMarginOnboard/CrossMarginOnboard.tsx rename to packages/app/src/sections/futures/SmartMarginOnboard/SmartMarginOnboard.tsx index fcb0063244..1c95f3d0dd 100644 --- a/packages/app/src/sections/futures/CrossMarginOnboard/CrossMarginOnboard.tsx +++ b/packages/app/src/sections/futures/SmartMarginOnboard/SmartMarginOnboard.tsx @@ -9,30 +9,30 @@ import ErrorView from 'components/ErrorView' import Loader from 'components/Loader' import ProgressSteps from 'components/ProgressSteps' import { setOpenModal } from 'state/app/reducer' -import { approveCrossMargin, createCrossMarginAccount } from 'state/futures/actions' +import { selectSubmittingFuturesTx } from 'state/futures/selectors' +import { approveSmartMargin, createSmartMarginAccount } from 'state/futures/smartMargin/actions' import { - selectCMAccountQueryStatus, + selectSmartMarginAccount, + selectSmartMarginAccountQueryStatus, selectSmartMarginDepositApproved, - selectCrossMarginAccount, - selectFuturesSupportedNetwork, - selectSubmittingFuturesTx, + selectSmartMarginSupportedNetwork, selectTradePreview, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import { FetchStatus } from 'state/types' -import CrossMarginFAQ from './CrossMarginFAQ' +import SmartMarginFAQ from './SmartMarginFAQ' type Props = { isOpen: boolean } -export default function CrossMarginOnboard({ isOpen }: Props) { +export default function SmartMarginOnboard({ isOpen }: Props) { const { t } = useTranslation() const dispatch = useAppDispatch() - const crossMarginAvailable = useAppSelector(selectFuturesSupportedNetwork) - const crossMarginAccount = useAppSelector(selectCrossMarginAccount) - const queryStatus = useAppSelector(selectCMAccountQueryStatus) + const smartMarginAvailable = useAppSelector(selectSmartMarginSupportedNetwork) + const smartMarginAccount = useAppSelector(selectSmartMarginAccount) + const queryStatus = useAppSelector(selectSmartMarginAccountQueryStatus) const depositApproved = useAppSelector(selectSmartMarginDepositApproved) const txProcessing = useAppSelector(selectSubmittingFuturesTx) const preview = useAppSelector(selectTradePreview) @@ -48,11 +48,11 @@ export default function CrossMarginOnboard({ isOpen }: Props) { } const createAccount = useCallback(async () => { - dispatch(createCrossMarginAccount()) + dispatch(createSmartMarginAccount()) }, [dispatch]) const onClickApprove = useCallback(async () => { - dispatch(approveCrossMargin()) + dispatch(approveSmartMargin()) }, [dispatch]) const renderProgress = (step: number, complete?: boolean) => { @@ -64,10 +64,10 @@ export default function CrossMarginOnboard({ isOpen }: Props) { } const renderContent = () => { - if (!crossMarginAvailable) { + if (!smartMarginAvailable) { return } - if (!crossMarginAccount && queryStatus.status === FetchStatus.Loading) { + if (!smartMarginAccount && queryStatus.status === FetchStatus.Loading) { return ( @@ -90,13 +90,13 @@ export default function CrossMarginOnboard({ isOpen }: Props) { ) } - if (crossMarginAccount && !depositApproved) { + if (smartMarginAccount && !depositApproved) { return ( <> {t('futures.modals.onboard.step2-intro')}
FAQ: - +
{renderProgress(2)} @@ -138,10 +138,10 @@ export default function CrossMarginOnboard({ isOpen }: Props) { return ( <> - {t('futures.modals.onboard.step1-intro')} + {t('futures.modals.onboard.cm-intro')}
FAQ: - +
{renderProgress(1)} @@ -152,7 +152,11 @@ export default function CrossMarginOnboard({ isOpen }: Props) { } return ( - + {renderContent()} ) diff --git a/packages/app/src/sections/futures/SmartMarginOnboard/index.tsx b/packages/app/src/sections/futures/SmartMarginOnboard/index.tsx new file mode 100644 index 0000000000..7d287535ec --- /dev/null +++ b/packages/app/src/sections/futures/SmartMarginOnboard/index.tsx @@ -0,0 +1 @@ +export { default } from './SmartMarginOnboard' diff --git a/packages/app/src/sections/futures/Trade/CrossMarginTradePanelPreview.tsx b/packages/app/src/sections/futures/Trade/CrossMarginTradePanelPreview.tsx new file mode 100644 index 0000000000..7b59390074 --- /dev/null +++ b/packages/app/src/sections/futures/Trade/CrossMarginTradePanelPreview.tsx @@ -0,0 +1,27 @@ +import React, { memo } from 'react' +import styled from 'styled-components' + +import { selectCrossMarginTradePreview } from 'state/futures/crossMargin/selectors' +import { useAppSelector } from 'state/hooks' + +import CrossMarginTradeFees from '../FeeInfoBox/CrossMarginTradeFees' + +import { PriceImpactRow, FillPriceRow } from './PreviewRows' + +export const CrossMarginTradePanelPreview = memo(() => { + const preview = useAppSelector(selectCrossMarginTradePreview) + + return ( + + + + + + ) +}) + +const FeeInfoBoxContainer = styled.div` + margin-bottom: 16px; +` + +export default CrossMarginTradePanelPreview diff --git a/packages/app/src/sections/futures/Trade/TransferIsolatedMarginModal.tsx b/packages/app/src/sections/futures/Trade/DepositWithdrawCrossMargin.tsx similarity index 78% rename from packages/app/src/sections/futures/Trade/TransferIsolatedMarginModal.tsx rename to packages/app/src/sections/futures/Trade/DepositWithdrawCrossMargin.tsx index 960c577dfd..a76e970e55 100644 --- a/packages/app/src/sections/futures/Trade/TransferIsolatedMarginModal.tsx +++ b/packages/app/src/sections/futures/Trade/DepositWithdrawCrossMargin.tsx @@ -16,13 +16,20 @@ import NumericInput from 'components/Input/NumericInput' import { FlexDivRowCentered } from 'components/layout/flex' import SegmentedControl from 'components/SegmentedControl' import Spacer from 'components/Spacer' -import { selectSusdBalance } from 'state/balances/selectors' -import { depositIsolatedMargin, withdrawIsolatedMargin } from 'state/futures/actions' +import { selectSNXUSDBalance } from 'state/balances/selectors' import { - selectAvailableMargin, + approveCrossMarginDeposit, + depositCrossMarginMargin, + withdrawCrossMargin, +} from 'state/futures/crossMargin/actions' +import { + selectCrossMarginAvailableMargin, + selectDepositAllowances, +} from 'state/futures/crossMargin/selectors' +import { + selectIsApprovingCrossDeposit, selectIsolatedTransferError, selectIsSubmittingIsolatedTransfer, - selectPosition, } from 'state/futures/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' @@ -39,38 +46,45 @@ const SocketBridge = dynamic(() => import('../../../components/SocketBridge'), { const PLACEHOLDER = '$0.00' -const TransferIsolatedMarginModal: React.FC = ({ onDismiss, defaultTab }) => { +const DepositWithdrawCrossMarginModal: React.FC = ({ onDismiss, defaultTab }) => { const { t } = useTranslation() const dispatch = useAppDispatch() - const position = useAppSelector(selectPosition) const submitting = useAppSelector(selectIsSubmittingIsolatedTransfer) + const approving = useAppSelector(selectIsApprovingCrossDeposit) const txError = useAppSelector(selectIsolatedTransferError) - const susdBalance = useAppSelector(selectSusdBalance) - const availableMargin = useAppSelector(selectAvailableMargin) + const usdBalance = useAppSelector(selectSNXUSDBalance) + const availableMargin = useAppSelector(selectCrossMarginAvailableMargin) + const allowances = useAppSelector(selectDepositAllowances) const minDeposit = useMemo(() => { - const accessibleMargin = position?.accessibleMargin ?? ZERO_WEI - const min = MIN_MARGIN_AMOUNT.sub(accessibleMargin) - return min.lt(ZERO_WEI) ? ZERO_WEI : min - }, [position?.accessibleMargin]) + // TODO: Calculate min deposit based on accessible margin + return MIN_MARGIN_AMOUNT + }, []) const [openSocket, setOpenSocket] = useState(false) const [amount, setAmount] = useState('') const [transferType, setTransferType] = useState(defaultTab === 'deposit' ? 0 : 1) - const susdBal = transferType === 0 ? susdBalance : availableMargin + const susdBal = transferType === 0 ? usdBalance : availableMargin const balanceStatus: BalanceStatus = useMemo( () => - availableMargin.gt(ZERO_WEI) || susdBalance.gt(minDeposit) + availableMargin.gt(ZERO_WEI) || usdBalance.gt(minDeposit) ? 'high_balance' - : susdBalance.eq(ZERO_WEI) + : usdBalance.eq(ZERO_WEI) ? 'no_balance' : 'low_balance', - [availableMargin, minDeposit, susdBalance] + [availableMargin, minDeposit, usdBalance] ) + const requiresApproval = useMemo(() => { + if (transferType === 0) { + return !allowances.SNXUSD?.gt(amount || 0) + } + return false + }, [allowances, amount, transferType]) + useEffect(() => { switch (balanceStatus) { case 'no_balance': @@ -83,7 +97,7 @@ const TransferIsolatedMarginModal: React.FC = ({ onDismiss, defaultTab }) }, [balanceStatus]) const isDisabled = useMemo(() => { - if (!amount || submitting) { + if (!amount || submitting || approving) { return true } const amtWei = wei(amount) @@ -91,7 +105,7 @@ const TransferIsolatedMarginModal: React.FC = ({ onDismiss, defaultTab }) return true } return false - }, [amount, susdBal, minDeposit, transferType, submitting]) + }, [amount, susdBal, minDeposit, transferType, submitting, approving]) const computedWithdrawAmount = useMemo( () => (availableMargin.eq(wei(amount || 0)) ? availableMargin : wei(amount || 0)), @@ -113,12 +127,16 @@ const TransferIsolatedMarginModal: React.FC = ({ onDismiss, defaultTab }) setAmount('') } - const onDeposit = () => { - dispatch(depositIsolatedMargin(wei(amount))) + const onDepositOrApprove = () => { + if (!allowances.SNXUSD?.gt(amount)) { + dispatch(approveCrossMarginDeposit()) + } else { + dispatch(depositCrossMarginMargin(wei(amount))) + } } const onWithdraw = () => { - dispatch(withdrawIsolatedMargin(computedWithdrawAmount)) + dispatch(withdrawCrossMargin(computedWithdrawAmount)) } return ( @@ -177,12 +195,15 @@ const TransferIsolatedMarginModal: React.FC = ({ onDismiss, defaultTab }) {txError && ( @@ -262,4 +283,4 @@ const StyledCardHeader = styled(CardHeader)<{ noBorder: boolean }>` cursor: pointer; ` -export default TransferIsolatedMarginModal +export default DepositWithdrawCrossMarginModal diff --git a/packages/app/src/sections/futures/Trade/ManagePosition.tsx b/packages/app/src/sections/futures/Trade/ManagePosition.tsx index 1868301fb3..ddabbb0154 100644 --- a/packages/app/src/sections/futures/Trade/ManagePosition.tsx +++ b/packages/app/src/sections/futures/Trade/ManagePosition.tsx @@ -1,4 +1,5 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' +import { FuturesMarginType } from '@kwenta/sdk/types' import { isZero } from '@kwenta/sdk/utils' import { wei } from '@synthetixio/wei' import React, { useCallback, useMemo } from 'react' @@ -10,29 +11,33 @@ import { ERROR_MESSAGES } from 'components/ErrorNotifier' import Error from 'components/ErrorView' import { previewErrorI18n } from 'queries/futures/constants' import { setOpenModal } from 'state/app/reducer' -import { setTradePanelDrawerOpen } from 'state/futures/reducer' import { - selectMarketInfo, - selectIsMarketCapReached, + selectFuturesType, selectMarketIndexPrice, - selectPlaceOrderTranslationKey, + selectMarketPriceInfo, +} from 'state/futures/common/selectors' +import { setTradePanelDrawerOpen } from 'state/futures/reducer' +import { selectMaxLeverage, - selectTradePreviewError, - selectTradePreview, - selectTradePreviewStatus, - selectTradeSizeInputs, - selectIsolatedMarginLeverage, - selectCrossMarginOrderPrice, - selectOrderType, - selectFuturesType, selectLeverageSide, selectPendingDelayedOrder, selectMaxUsdSizeInput, - selectCrossMarginAccount, - selectPosition, - selectMarketPriceInfo, selectTradePanelSLValidity, } from 'state/futures/selectors' +import { + selectIsMarketCapReached, + selectOrderType, + selectPlaceOrderTranslationKey, + selectSmartMarginPosition, + selectSmartMarginAccount, + selectSmartMarginLeverage, + selectSmartMarginOrderPrice, + selectSmartMarginTradeInputs, + selectTradePreview, + selectTradePreviewError, + selectTradePreviewStatus, + selectV2MarketInfo, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import { FetchStatus } from 'state/types' import { orderPriceInvalidLabel } from 'utils/futures' @@ -41,25 +46,25 @@ const ManagePosition: React.FC = () => { const { t } = useTranslation() const dispatch = useAppDispatch() - const { susdSize } = useAppSelector(selectTradeSizeInputs) + const { susdSize } = useAppSelector(selectSmartMarginTradeInputs) const maxLeverageValue = useAppSelector(selectMaxLeverage) const selectedAccountType = useAppSelector(selectFuturesType) const previewTrade = useAppSelector(selectTradePreview) const previewError = useAppSelector(selectTradePreviewError) - const leverage = useAppSelector(selectIsolatedMarginLeverage) + const leverage = useAppSelector(selectSmartMarginLeverage) const orderType = useAppSelector(selectOrderType) const openOrder = useAppSelector(selectPendingDelayedOrder) const leverageSide = useAppSelector(selectLeverageSide) const maxUsdInputAmount = useAppSelector(selectMaxUsdSizeInput) const isMarketCapReached = useAppSelector(selectIsMarketCapReached) const placeOrderTranslationKey = useAppSelector(selectPlaceOrderTranslationKey) - const orderPrice = useAppSelector(selectCrossMarginOrderPrice) + const orderPrice = useAppSelector(selectSmartMarginOrderPrice) const marketAssetRate = useAppSelector(selectMarketIndexPrice) - const marketInfo = useAppSelector(selectMarketInfo) + const marketInfo = useAppSelector(selectV2MarketInfo) const indexPrice = useAppSelector(selectMarketPriceInfo) const previewStatus = useAppSelector(selectTradePreviewStatus) - const smartMarginAccount = useAppSelector(selectCrossMarginAccount) - const position = useAppSelector(selectPosition) + const smartMarginAccount = useAppSelector(selectSmartMarginAccount) + const position = useAppSelector(selectSmartMarginPosition) const stopLossInvlid = useAppSelector(selectTradePanelSLValidity) const orderError = useMemo(() => { @@ -69,19 +74,19 @@ const ManagePosition: React.FC = () => { return null }, [previewTrade?.statusMessage, previewError, t]) - const increasingPosition = !position?.position?.side || position?.position?.side === leverageSide + const increasingPosition = !position?.side || position?.side === leverageSide const onSubmit = useCallback(() => { dispatch(setTradePanelDrawerOpen(false)) - if (selectedAccountType === 'cross_margin' && !smartMarginAccount) { + if (selectedAccountType === FuturesMarginType.SMART_MARGIN && !smartMarginAccount) { dispatch(setOpenModal('futures_smart_margin_onboard')) return } dispatch( setOpenModal( - selectedAccountType === 'cross_margin' + selectedAccountType === FuturesMarginType.SMART_MARGIN ? 'futures_confirm_smart_margin_trade' - : 'futures_confirm_isolated_margin_trade' + : 'futures_confirm_cross_margin_trade' ) ) }, [selectedAccountType, smartMarginAccount, dispatch]) @@ -155,7 +160,7 @@ const ManagePosition: React.FC = () => { message: ERROR_MESSAGES.ORDER_PENDING, } } - if (selectedAccountType === 'cross_margin') { + if (selectedAccountType === FuturesMarginType.SMART_MARGIN) { if (previewTrade?.status !== 0 || previewStatus.status === FetchStatus.Loading) return { message: 'awaiting_preview' } if (orderType !== 'market' && isZero(orderPrice)) return { message: 'trade price required' } diff --git a/packages/app/src/sections/futures/Trade/MarketActions.tsx b/packages/app/src/sections/futures/Trade/MarketActions.tsx index 7533bd5303..20731a5527 100644 --- a/packages/app/src/sections/futures/Trade/MarketActions.tsx +++ b/packages/app/src/sections/futures/Trade/MarketActions.tsx @@ -11,7 +11,7 @@ import { selectShowModal } from 'state/app/selectors' import { selectMarketInfo, selectPosition } from 'state/futures/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' -import TransferIsolatedMarginModal from './TransferIsolatedMarginModal' +import DepositWithdrawCrossMarginModal from './DepositWithdrawCrossMargin' const MarketActions: React.FC = () => { const { t } = useTranslation() @@ -29,7 +29,7 @@ const MarketActions: React.FC = () => { dispatch(setOpenModal('futures_isolated_transfer'))} + onClick={() => dispatch(setOpenModal('futures_deposit_withdraw_cross_margin'))} noOutline > {t('futures.market.trade.button.deposit')} @@ -42,21 +42,21 @@ const MarketActions: React.FC = () => { !isL2 || !walletAddress } - onClick={() => dispatch(setOpenModal('futures_isolated_transfer'))} + onClick={() => dispatch(setOpenModal('futures_deposit_withdraw_cross_margin'))} noOutline > {t('futures.market.trade.button.withdraw')} - {openModal === 'futures_isolated_transfer' && ( - dispatch(setOpenModal(null))} /> )} - {openModal === 'futures_isolated_transfer' && ( - dispatch(setOpenModal(null))} /> diff --git a/packages/app/src/sections/futures/Trade/MarketsDropdown.tsx b/packages/app/src/sections/futures/Trade/MarketsDropdown.tsx index 84689432ef..aa39c37c86 100644 --- a/packages/app/src/sections/futures/Trade/MarketsDropdown.tsx +++ b/packages/app/src/sections/futures/Trade/MarketsDropdown.tsx @@ -1,5 +1,5 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' -import { FuturesMarketAsset } from '@kwenta/sdk/types' +import { FuturesMarket, FuturesMarketAsset } from '@kwenta/sdk/types' import { getDisplayAsset, AssetDisplayByAsset, @@ -31,11 +31,10 @@ import { zIndex } from 'constants/ui' import useClickOutside from 'hooks/useClickOutside' import useLocalStorage from 'hooks/useLocalStorage' import { selectShowBanner } from 'state/app/selectors' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' import { - selectMarketAsset, selectMarkets, selectMarketsQueryStatus, - selectFuturesType, selectMarketInfo, selectMarkPriceInfos, } from 'state/futures/selectors' @@ -117,7 +116,7 @@ const MarketsDropdown: React.FC = ({ mobile }) => { const options = useMemo(() => { const lowerSearch = search?.toLowerCase() const markets = lowerSearch - ? futuresMarkets.filter( + ? (futuresMarkets as FuturesMarket[]).filter( (m) => m.asset.toLowerCase().includes(lowerSearch) || AssetDisplayByAsset[m.asset]?.toLocaleLowerCase().includes(lowerSearch) diff --git a/packages/app/src/sections/futures/Trade/OrderTypeSelector.tsx b/packages/app/src/sections/futures/Trade/OrderTypeSelector.tsx index 628ba220e9..9c262cb27b 100644 --- a/packages/app/src/sections/futures/Trade/OrderTypeSelector.tsx +++ b/packages/app/src/sections/futures/Trade/OrderTypeSelector.tsx @@ -3,7 +3,7 @@ import { SmartMarginOrderType } from '@kwenta/sdk/types' import { OrderNameByType } from '@kwenta/sdk/utils' import SegmentedControl from 'components/SegmentedControl' -import { editTradeOrderPrice } from 'state/futures/actions' +import { editTradeOrderPrice } from 'state/futures/smartMargin/actions' import { useAppDispatch } from 'state/hooks' type Props = { diff --git a/packages/app/src/sections/futures/Trade/PreviewRows.tsx b/packages/app/src/sections/futures/Trade/PreviewRows.tsx new file mode 100644 index 0000000000..33bcb016fd --- /dev/null +++ b/packages/app/src/sections/futures/Trade/PreviewRows.tsx @@ -0,0 +1,34 @@ +import { formatDollars, formatPercent } from '@kwenta/sdk/utils' +import Wei from '@synthetixio/wei' +import { memo } from 'react' + +import { InfoBoxRow } from 'components/InfoBox' +import { NO_VALUE } from 'constants/placeholder' + +export const LiquidationRow = memo(({ liqPrice }: { liqPrice?: Wei | undefined }) => { + return ( + + ) +}) + +export const PriceImpactRow = memo(({ priceImpact }: { priceImpact: Wei | undefined }) => { + return ( + + ) +}) + +export const FillPriceRow = memo(({ fillPrice }: { fillPrice: Wei | undefined }) => { + return ( + + ) +}) diff --git a/packages/app/src/sections/futures/Trade/SLTPInputs.tsx b/packages/app/src/sections/futures/Trade/SLTPInputs.tsx index c61d63b188..121771e511 100644 --- a/packages/app/src/sections/futures/Trade/SLTPInputs.tsx +++ b/packages/app/src/sections/futures/Trade/SLTPInputs.tsx @@ -12,14 +12,17 @@ import { StyledCaretDownIcon } from 'components/Select' import SelectorButtons from 'components/SelectorButtons' import Spacer from 'components/Spacer' import { selectAckedOrdersWarning } from 'state/app/selectors' -import { setCrossMarginTradeStopLoss, setCrossMarginTradeTakeProfit } from 'state/futures/reducer' +import { selectMarketIndexPrice } from 'state/futures/common/selectors' import { selectLeverageInput, selectLeverageSide, - selectMarketIndexPrice, - selectSlTpTradeInputs, selectTradePanelSLValidity, } from 'state/futures/selectors' +import { + setSmartMarginTradeStopLoss, + setSmartMarginTradeTakeProfit, +} from 'state/futures/smartMargin/reducer' +import { selectSlTpTradeInputs } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import OrderAcknowledgement from './OrderAcknowledgement' @@ -64,7 +67,7 @@ export default function SLTPInputs() { ? currentPrice.add(currentPrice.mul(relativePercent)) : currentPrice.sub(currentPrice.mul(relativePercent)) const dp = suggestedDecimals(stopLoss) - dispatch(setCrossMarginTradeStopLoss(stopLoss.toString(dp))) + dispatch(setSmartMarginTradeStopLoss(stopLoss.toString(dp))) }, [currentPrice, dispatch, leverageSide, leverageWei, slValidity.disabled] ) @@ -79,21 +82,21 @@ export default function SLTPInputs() { ? currentPrice.sub(currentPrice.mul(relativePercent)) : currentPrice.add(currentPrice.mul(relativePercent)) const dp = suggestedDecimals(takeProfit) - dispatch(setCrossMarginTradeTakeProfit(takeProfit.toString(dp))) + dispatch(setSmartMarginTradeTakeProfit(takeProfit.toString(dp))) }, [currentPrice, dispatch, leverageSide, leverageWei] ) const onChangeStopLoss = useCallback( (_: ChangeEvent, v: string) => { - dispatch(setCrossMarginTradeStopLoss(v)) + dispatch(setSmartMarginTradeStopLoss(v)) }, [dispatch] ) const onChangeTakeProfit = useCallback( (_: ChangeEvent, v: string) => { - dispatch(setCrossMarginTradeTakeProfit(v)) + dispatch(setSmartMarginTradeTakeProfit(v)) }, [dispatch] ) diff --git a/packages/app/src/sections/futures/Trade/SmartMarginOnboardModal.tsx b/packages/app/src/sections/futures/Trade/SmartMarginOnboardModal.tsx index ae12dc9580..01b12f3d8f 100644 --- a/packages/app/src/sections/futures/Trade/SmartMarginOnboardModal.tsx +++ b/packages/app/src/sections/futures/Trade/SmartMarginOnboardModal.tsx @@ -7,7 +7,7 @@ import styled from 'styled-components' import BaseModal from 'components/BaseModal' import { FlexDivRowCentered } from 'components/layout/flex' import Spacer from 'components/Spacer' -import { selectSusdBalance } from 'state/balances/selectors' +import { selectSNXUSDBalance } from 'state/balances/selectors' import { useAppSelector } from 'state/hooks' type Props = { @@ -21,7 +21,7 @@ const SocketBridge = dynamic(() => import('../../../components/SocketBridge'), { const SmartMarginOnboardModal: React.FC = memo(({ onDismiss }) => { const { t } = useTranslation() - const susdBalance = useAppSelector(selectSusdBalance) + const susdBalance = useAppSelector(selectSNXUSDBalance) return ( { + const potentialTradeDetails = useAppSelector(selectTradePreview) -export const TradePanelFeeInfo = memo(() => { return ( - - - + + + + ) @@ -82,40 +85,6 @@ const TradingRewardRow = memo(() => { ) }) -const LiquidationRow = memo(() => { - const potentialTradeDetails = useAppSelector(selectTradePreview) - - return ( - - ) -}) - -const PriceImpactRow = memo(() => { - const potentialTradeDetails = useAppSelector(selectTradePreview) - - return ( - - ) -}) - const FeeInfoBoxContainer = styled.div` margin-bottom: 16px; ` @@ -138,4 +107,4 @@ const CompactBox = styled.div<{ $isEligible: boolean }>` `} ` -export default TradePanelFeeInfo +export default SmartMarginTradePanelPreview diff --git a/packages/app/src/sections/futures/Trade/SubmitCrossMarginTrade.tsx b/packages/app/src/sections/futures/Trade/SubmitCrossMarginTrade.tsx new file mode 100644 index 0000000000..98adcdaffb --- /dev/null +++ b/packages/app/src/sections/futures/Trade/SubmitCrossMarginTrade.tsx @@ -0,0 +1,215 @@ +import { ZERO_WEI } from '@kwenta/sdk/constants' +import { isZero } from '@kwenta/sdk/utils' +import { wei } from '@synthetixio/wei' +import React, { useCallback, useMemo } from 'react' +import { useTranslation } from 'react-i18next' +import styled from 'styled-components' + +import Button from 'components/Button' +import { ERROR_MESSAGES } from 'components/ErrorNotifier' +import Error from 'components/ErrorView' +import { previewErrorI18n } from 'queries/futures/constants' +import { setOpenModal } from 'state/app/reducer' +import { selectMarketIndexPrice, selectMarketPriceInfo } from 'state/futures/common/selectors' +import { + selectCrossMarginAccount, + selectCrossMarginPosition, + selectCrossMarginTradeInputs, + selectV3MarketInfo, +} from 'state/futures/crossMargin/selectors' +import { setTradePanelDrawerOpen } from 'state/futures/reducer' +import { + selectMaxLeverage, + selectLeverageSide, + selectPendingDelayedOrder, + selectMaxUsdSizeInput, +} from 'state/futures/selectors' +import { + selectIsMarketCapReached, + selectOrderType, + selectPlaceOrderTranslationKey, + selectSmartMarginLeverage, + selectSmartMarginOrderPrice, + selectTradePreview, + selectTradePreviewError, + selectTradePreviewStatus, +} from 'state/futures/smartMargin/selectors' +import { useAppDispatch, useAppSelector } from 'state/hooks' +import { FetchStatus } from 'state/types' +import { orderPriceInvalidLabel } from 'utils/futures' + +const SubmitCrossMarginTradeButton: React.FC = () => { + const { t } = useTranslation() + const dispatch = useAppDispatch() + + const { susdSize } = useAppSelector(selectCrossMarginTradeInputs) + const maxLeverageValue = useAppSelector(selectMaxLeverage) + const previewTrade = useAppSelector(selectTradePreview) + const previewError = useAppSelector(selectTradePreviewError) + const leverage = useAppSelector(selectSmartMarginLeverage) + const orderType = useAppSelector(selectOrderType) + const openOrder = useAppSelector(selectPendingDelayedOrder) + const leverageSide = useAppSelector(selectLeverageSide) + const maxUsdInputAmount = useAppSelector(selectMaxUsdSizeInput) + const isMarketCapReached = useAppSelector(selectIsMarketCapReached) + const placeOrderTranslationKey = useAppSelector(selectPlaceOrderTranslationKey) + const orderPrice = useAppSelector(selectSmartMarginOrderPrice) + const marketAssetRate = useAppSelector(selectMarketIndexPrice) + const marketInfo = useAppSelector(selectV3MarketInfo) + const indexPrice = useAppSelector(selectMarketPriceInfo) + const previewStatus = useAppSelector(selectTradePreviewStatus) + const crossMarginAccount = useAppSelector(selectCrossMarginAccount) + const position = useAppSelector(selectCrossMarginPosition) + + const orderError = useMemo(() => { + if (previewError) return t(previewErrorI18n(previewError)) + if (previewTrade?.statusMessage && previewTrade.statusMessage !== 'Success') + return previewTrade?.statusMessage + return null + }, [previewTrade?.statusMessage, previewError, t]) + + const increasingPosition = !position?.side || position?.side === leverageSide + + const onSubmit = useCallback(() => { + dispatch(setTradePanelDrawerOpen(false)) + if (!crossMarginAccount) { + dispatch(setOpenModal('futures_cross_margin_onboard')) + return + } + dispatch(setOpenModal('futures_confirm_cross_margin_trade')) + }, [crossMarginAccount, dispatch]) + + // TODO: Clean up errors and warnings and share logic with smart margin + + const placeOrderDisabledReason = useMemo<{ + message: string + show?: 'warn' | 'error' + } | null>(() => { + if (orderError) { + return { message: orderError, show: 'error' } + } + const maxLeverage = marketInfo?.appMaxLeverage ?? wei(1) + + const indexPriceWei = indexPrice?.price ?? ZERO_WEI + const canLiquidate = + (previewTrade?.size.gt(0) && indexPriceWei.lt(previewTrade?.liqPrice)) || + (previewTrade?.size.lt(0) && indexPriceWei.gt(previewTrade?.liqPrice)) + if (canLiquidate) { + return { + show: 'warn', + message: `Position can be liquidated`, + } + } + + if (leverage.gt(maxLeverageValue)) + return { + show: 'warn', + message: `Max leverage ${maxLeverage.toString(0)}x exceeded`, + } + if (marketInfo?.isSuspended) + return { + show: 'warn', + message: `Market suspended`, + } + if (isMarketCapReached && increasingPosition) + return { + show: 'warn', + message: `Open interest limit exceeded`, + } + + const invalidReason = orderPriceInvalidLabel( + orderPrice, + leverageSide, + marketAssetRate, + orderType + ) + + if ((orderType === 'limit' || orderType === 'stop_market') && !!invalidReason) + return { + show: 'warn', + message: invalidReason, + } + if (susdSize.gt(maxUsdInputAmount)) + return { + show: 'warn', + message: 'Max trade size exceeded', + } + if (placeOrderTranslationKey === 'futures.market.trade.button.deposit-margin-minimum') + return { + show: 'warn', + message: 'Min $50 margin required', + } + + if (isZero(susdSize)) { + return { message: 'Trade size required' } + } + if (orderType === 'market' && !!openOrder && !openOrder.isStale) { + return { + show: 'warn', + message: ERROR_MESSAGES.ORDER_PENDING, + } + } + + return null + }, [ + susdSize, + orderType, + openOrder, + orderError, + orderPrice, + leverageSide, + marketAssetRate, + marketInfo?.isSuspended, + placeOrderTranslationKey, + maxUsdInputAmount, + isMarketCapReached, + increasingPosition, + maxLeverageValue, + leverage, + indexPrice, + previewTrade, + marketInfo?.appMaxLeverage, + ]) + + return ( + <> +
+ + + {t(placeOrderTranslationKey)} + + +
+ + {placeOrderDisabledReason?.show ? ( + + ) : null} + + ) +} + +const ManagePositionContainer = styled.div` + display: flex; + grid-gap: 15px; + margin-bottom: 16px; +` + +const PlaceOrderButton = styled(Button)` + font-size: 16px; + height: 55px; + text-align: center; + white-space: normal; +` + +export default SubmitCrossMarginTradeButton diff --git a/packages/app/src/sections/futures/Trade/SwitchToSmartMargin.tsx b/packages/app/src/sections/futures/Trade/SwitchToSmartMargin.tsx deleted file mode 100644 index bcd7346ae3..0000000000 --- a/packages/app/src/sections/futures/Trade/SwitchToSmartMargin.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { useRouter } from 'next/router' -import { useCallback } from 'react' -import { useTranslation } from 'react-i18next' -import styled from 'styled-components' - -import AlertIcon from 'assets/svg/app/alert.svg' -import Button from 'components/Button' -import { FlexDivColCentered } from 'components/layout/flex' -import { BANNER_LINK_URL } from 'constants/announcement' -import ROUTES from 'constants/routes' -import { selectMarketAsset } from 'state/futures/selectors' -import { useAppSelector } from 'state/hooks' - -type Props = { - onDismiss: () => void -} - -const SwitchToSmartMargin: React.FC = ({ onDismiss }) => { - const { t } = useTranslation() - const router = useRouter() - const currentMarket = useAppSelector(selectMarketAsset) - - const switchToSM = useCallback(() => { - router.push(ROUTES.Markets.MarketPair(currentMarket, 'cross_margin')) - }, [currentMarket, router]) - - return ( - - - <AlertIcon /> - - - {t('futures.cta-buttons.copy')} - - {t('futures.cta-buttons.learn-more')} - - - - - {t('futures.cta-buttons.dismiss')} - - - ) -} - -const StyledLink = styled.a` - text-decoration: underline; - color: ${(props) => props.theme.colors.selectedTheme.newTheme.text.secondary}; - font-size: 15px; - cursor: pointer; -` - -const UnsupportedMessage = styled.div` - margin-top: 26.25px; - font-size: 15px; - color: ${(props) => props.theme.colors.selectedTheme.newTheme.text.primary}; - margin-bottom: 45px; - line-height: 18px; -` - -const ButtonContainer = styled(FlexDivColCentered)` - width: 100%; - justify-content: center; - row-gap: 17.5px; -` - -const Title = styled.div` - font-family: ${(props) => props.theme.fonts.monoBold}; - font-size: 23px; - color: ${(props) => props.theme.colors.selectedTheme.button.text.primary}; -` - -const MessageContainer = styled.div` - margin-top: 51.25px; - padding: 0 40px; - text-align: center; -` - -export default SwitchToSmartMargin diff --git a/packages/app/src/sections/futures/Trade/TradeBalanceCrossMargin.tsx b/packages/app/src/sections/futures/Trade/TradeBalanceCrossMargin.tsx new file mode 100644 index 0000000000..c6454fed43 --- /dev/null +++ b/packages/app/src/sections/futures/Trade/TradeBalanceCrossMargin.tsx @@ -0,0 +1,175 @@ +import { MIN_MARGIN_AMOUNT } from '@kwenta/sdk/constants' +import { FuturesMarginType } from '@kwenta/sdk/types' +import { formatDollars } from '@kwenta/sdk/utils' +import { memo, useMemo, useState } from 'react' +import { useTranslation } from 'react-i18next' +import styled from 'styled-components' + +import Button from 'components/Button' +import { FlexDivCol, FlexDivRow, FlexDivRowCentered } from 'components/layout/flex' +import { StyledCaretDownIcon } from 'components/Select' +import { Body, NumericValue } from 'components/Text' +import useWindowSize from 'hooks/useWindowSize' +import { setOpenModal } from 'state/app/reducer' +import { selectSNXUSDBalance } from 'state/balances/selectors' +import { selectFuturesType } from 'state/futures/common/selectors' +import { + selectCrossMarginAccount, + selectCrossMarginAvailableMargin, + selectWithdrawableCrossMargin, +} from 'state/futures/crossMargin/selectors' +import { useAppDispatch, useAppSelector } from 'state/hooks' + +import PencilButton from '../../../components/Button/PencilButton' + +type TradeBalanceProps = { + isMobile?: boolean +} + +const TradeBalanceCrossMargin: React.FC = memo(({ isMobile = false }) => { + const { t } = useTranslation() + const dispatch = useAppDispatch() + const { deviceType } = useWindowSize() + + const accountType = useAppSelector(selectFuturesType) + const availableCrossMargin = useAppSelector(selectCrossMarginAvailableMargin) + const withdrawable = useAppSelector(selectWithdrawableCrossMargin) + const crossMarginAccount = useAppSelector(selectCrossMarginAccount) + const walletBal = useAppSelector(selectSNXUSDBalance) + + const [expanded, setExpanded] = useState(false) + + const isDepositRequired = useMemo(() => { + return availableCrossMargin.lt(MIN_MARGIN_AMOUNT) + }, [availableCrossMargin]) + + const onClickContainer = () => { + if (accountType === FuturesMarginType.CROSS_MARGIN) return + setExpanded(!expanded) + } + + const content = useMemo(() => { + if (!crossMarginAccount) { + return ( + + ) + } + if (isDepositRequired) { + return ( + + + + + {t('futures.market.trade.trade-balance.no-available-margin')} + + + + + {t('futures.market.trade.trade-balance.min-margin')} + + + + + ) + } + + if (isMobile) { + return ( + + + + {t('futures.market.trade.trade-balance.available-margin')}: + + + {formatDollars(availableCrossMargin)} + + + + ) + } + + return ( + + + + {t('futures.market.trade.trade-balance.available-margin')} + + + {formatDollars(availableCrossMargin)} + + + + ) + }, [ + t, + crossMarginAccount, + isDepositRequired, + availableCrossMargin, + isMobile, + expanded, + walletBal, + dispatch, + ]) + + return ( + + + {content} + + {withdrawable.gt(0) && ( + + { + e.stopPropagation() + dispatch(setOpenModal('futures_deposit_withdraw_cross_margin')) + }} + /> + + )} + + + ) +}) + +const DepositContainer = styled(FlexDivRowCentered)` + width: 100%; +` + +const Container = styled.div<{ mobile?: boolean }>` + width: 100%; + padding: 13px 15px; + border-bottom: ${(props) => (props.mobile ? props.theme.colors.selectedTheme.border : 0)}; +` + +const BalanceContainer = styled(FlexDivRowCentered)<{ clickable: boolean }>` + cursor: ${(props) => (props.clickable ? 'pointer' : 'default')}; + width: 100%; +` + +export default TradeBalanceCrossMargin diff --git a/packages/app/src/sections/futures/Trade/TradeBalance.tsx b/packages/app/src/sections/futures/Trade/TradeBalanceSmartMargin.tsx similarity index 78% rename from packages/app/src/sections/futures/Trade/TradeBalance.tsx rename to packages/app/src/sections/futures/Trade/TradeBalanceSmartMargin.tsx index f73fab4b6e..29c1ef9b6b 100644 --- a/packages/app/src/sections/futures/Trade/TradeBalance.tsx +++ b/packages/app/src/sections/futures/Trade/TradeBalanceSmartMargin.tsx @@ -15,16 +15,11 @@ import useWindowSize from 'hooks/useWindowSize' import { setOpenModal } from 'state/app/reducer' import { selectShowModal } from 'state/app/selectors' import { ModalType } from 'state/app/types' -import { - selectAvailableMargin, - selectFuturesType, - selectIdleMargin, - selectLockedMarginInMarkets, -} from 'state/futures/selectors' +import { selectIdleMargin, selectLockedMarginInMarkets } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import PencilButton from '../../../components/Button/PencilButton' -import CrossMarginInfoBox from '../TradeCrossMargin/CrossMarginInfoBox' +import SmartMarginInfoBox from '../TradeSmartMargin/SmartMarginInfoBox' import SmartMarginOnboardModal from './SmartMarginOnboardModal' @@ -63,10 +58,8 @@ const TradeBalance = memo(() => { const dispatch = useAppDispatch() const { deviceType } = useWindowSize() - const accountType = useAppSelector(selectFuturesType) - const availableCrossMargin = useAppSelector(selectIdleMargin) + const accountMargin = useAppSelector(selectIdleMargin) const lockedMargin = useAppSelector(selectLockedMarginInMarkets) - const availableIsolatedMargin = useAppSelector(selectAvailableMargin) const openModal = useAppSelector(selectShowModal) const [expanded, setExpanded] = useState(false) @@ -77,31 +70,28 @@ const TradeBalance = memo(() => { return { isMobile, size } }, [deviceType]) - const isCrossMarginAccount = useMemo(() => accountType === 'cross_margin', [accountType]) - const isDepositRequired = useMemo(() => { - return isCrossMarginAccount && availableCrossMargin.lt(MIN_MARGIN_AMOUNT) && lockedMargin.eq(0) - }, [availableCrossMargin, isCrossMarginAccount, lockedMargin]) + return accountMargin.lt(MIN_MARGIN_AMOUNT) && lockedMargin.eq(0) + }, [accountMargin, lockedMargin]) const onClickContainer = useCallback(() => { - if (!isCrossMarginAccount) return setExpanded(!expanded) - }, [expanded, isCrossMarginAccount]) + }, [expanded]) return ( - + {isDepositRequired ? ( - {availableCrossMargin.lt(0.01) ? ( + {accountMargin.lt(0.01) ? ( t('futures.market.trade.trade-balance.no-available-margin') ) : ( )} @@ -111,7 +101,7 @@ const TradeBalance = memo(() => { {t('futures.market.trade.trade-balance.min-margin')} - {availableCrossMargin.lt(0.01) ? ( + {accountMargin.lt(0.01) ? ( ) : ( @@ -137,12 +127,10 @@ const TradeBalance = memo(() => { {t('futures.market.trade.trade-balance.available-margin')}: - {isCrossMarginAccount - ? formatDollars(availableCrossMargin) - : formatDollars(availableIsolatedMargin)} + {formatDollars(accountMargin)}
- {isCrossMarginAccount && lockedMargin.gt(0) && ( + {lockedMargin.gt(0) && ( {t('futures.market.trade.trade-balance.locked-margin')}: @@ -162,9 +150,7 @@ const TradeBalance = memo(() => { )} @@ -176,12 +162,10 @@ const TradeBalance = memo(() => { {t('futures.market.trade.trade-balance.available-margin')} - {isCrossMarginAccount - ? formatDollars(availableCrossMargin) - : formatDollars(availableIsolatedMargin)} + {formatDollars(accountMargin)} - {isCrossMarginAccount && lockedMargin.gt(0) && ( + {lockedMargin.gt(0) && ( @@ -201,9 +185,7 @@ const TradeBalance = memo(() => { )} @@ -213,9 +195,7 @@ const TradeBalance = memo(() => { )} - {expanded && isCrossMarginAccount && ( - {} - )} + {expanded && {}} {openModal === 'futures_smart_margin_socket' && ( { diff --git a/packages/app/src/sections/futures/Trade/TradePanelCrossMargin.tsx b/packages/app/src/sections/futures/Trade/TradePanelCrossMargin.tsx new file mode 100644 index 0000000000..3b55e839bd --- /dev/null +++ b/packages/app/src/sections/futures/Trade/TradePanelCrossMargin.tsx @@ -0,0 +1,95 @@ +import { PositionSide } from '@kwenta/sdk/types' +import { FC, memo, useCallback } from 'react' +import styled, { css } from 'styled-components' + +import Error from 'components/ErrorView' +import { changeCrossMarginLeverageSide } from 'state/futures/crossMargin/actions' +import { selectLeverageSide } from 'state/futures/selectors' +import { useAppDispatch, useAppSelector } from 'state/hooks' +import { selectPricesConnectionError } from 'state/prices/selectors' + +import LeverageInput from '../LeverageInput' +import OrderSizing from '../OrderSizing' +import PositionButtons from '../PositionButtons' + +import CloseOnlyPrompt from './CloseOnlyPrompt' +import CrossMarginTradePanelPreview from './CrossMarginTradePanelPreview' +import MarketsDropdown from './MarketsDropdown' +import SubmitCrossMarginTradeButton from './SubmitCrossMarginTrade' +import TradeBalanceCrossMargin from './TradeBalanceCrossMargin' + +type Props = { + mobile?: boolean + closeDrawer?: () => void +} + +const TradePanelCrossMargin: FC = memo(({ mobile, closeDrawer }) => { + const dispatch = useAppDispatch() + + const leverageSide = useAppSelector(selectLeverageSide) + const pricesConnectionError = useAppSelector(selectPricesConnectionError) + + const handleChangeSide = useCallback( + (side: PositionSide) => { + dispatch(changeCrossMarginLeverageSide(side)) + }, + [dispatch] + ) + + return ( + + {!mobile && ( + <> + + + + )} + + {process.env.NEXT_PUBLIC_CLOSE_ONLY === 'true' ? ( + + ) : ( + <> + + + + { + // TODO: Share across trade panels + pricesConnectionError && ( + + ) + } + + + + + + + + )} + + ) +}) + +const TradePanelContainer = styled.div<{ $mobile?: boolean }>` + overflow-y: scroll; + height: 100%; + scrollbar-width: none; + border-right: ${(props) => props.theme.colors.selectedTheme.border}; +` + +const MainPanelContent = styled.div<{ $mobile?: boolean }>` + padding: 0 15px; + + ${(props) => + props.$mobile && + css` + padding: 65px 15px 0; + `} +` + +export default TradePanelCrossMargin diff --git a/packages/app/src/sections/futures/Trade/TradePanelPriceInput.tsx b/packages/app/src/sections/futures/Trade/TradePanelPriceInput.tsx index 96a4f18645..d1a9e625e7 100644 --- a/packages/app/src/sections/futures/Trade/TradePanelPriceInput.tsx +++ b/packages/app/src/sections/futures/Trade/TradePanelPriceInput.tsx @@ -1,12 +1,9 @@ import { ChangeEvent, useCallback } from 'react' -import { editTradeOrderPrice } from 'state/futures/actions' -import { - selectCrossMarginOrderPrice, - selectLeverageSide, - selectMarketIndexPrice, - selectOrderType, -} from 'state/futures/selectors' +import { selectMarketIndexPrice } from 'state/futures/common/selectors' +import { selectLeverageSide } from 'state/futures/selectors' +import { editTradeOrderPrice } from 'state/futures/smartMargin/actions' +import { selectOrderType, selectSmartMarginOrderPrice } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import OrderPriceInput from '../OrderPriceInput' @@ -16,7 +13,7 @@ export default function TradePanelPriceInput() { const marketPrice = useAppSelector(selectMarketIndexPrice) const leverageSide = useAppSelector(selectLeverageSide) - const orderPrice = useAppSelector(selectCrossMarginOrderPrice) + const orderPrice = useAppSelector(selectSmartMarginOrderPrice) const orderType = useAppSelector(selectOrderType) const handleOnChange = useCallback( diff --git a/packages/app/src/sections/futures/Trade/TradePanel.tsx b/packages/app/src/sections/futures/Trade/TradePanelSmartMargin.tsx similarity index 79% rename from packages/app/src/sections/futures/Trade/TradePanel.tsx rename to packages/app/src/sections/futures/Trade/TradePanelSmartMargin.tsx index cee5f65ac2..97a2c4370a 100644 --- a/packages/app/src/sections/futures/Trade/TradePanel.tsx +++ b/packages/app/src/sections/futures/Trade/TradePanelSmartMargin.tsx @@ -5,13 +5,13 @@ import styled, { css } from 'styled-components' import Error from 'components/ErrorView' import Spacer from 'components/Spacer' import { selectAckedOrdersWarning } from 'state/app/selectors' -import { changeLeverageSide } from 'state/futures/actions' -import { setOrderType } from 'state/futures/reducer' -import { selectFuturesType, selectLeverageSide, selectOrderType } from 'state/futures/selectors' +import { selectLeverageSide } from 'state/futures/selectors' +import { changeLeverageSide } from 'state/futures/smartMargin/actions' +import { setOrderType } from 'state/futures/smartMargin/reducer' +import { selectOrderType } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import { selectPricesConnectionError } from 'state/prices/selectors' -import TradePanelFeeInfo from '../FeeInfoBox/TradePanelFeeInfo' import LeverageInput from '../LeverageInput' import MarginInput from '../MarginInput' import OrderSizing from '../OrderSizing' @@ -23,7 +23,8 @@ import MarketsDropdown from './MarketsDropdown' import OrderAcknowledgement from './OrderAcknowledgement' import OrderTypeSelector from './OrderTypeSelector' import SLTPInputs from './SLTPInputs' -import TradeBalance from './TradeBalance' +import SmartMarginTradePanelPreview from './SmartMarginTradePanelPreview' +import TradeBalance from './TradeBalanceSmartMargin' import OrderPriceInput from './TradePanelPriceInput' type Props = { @@ -31,11 +32,10 @@ type Props = { closeDrawer?: () => void } -const TradePanel: FC = memo(({ mobile, closeDrawer }) => { +const TradePanelSmartMargin: FC = memo(({ mobile, closeDrawer }) => { const dispatch = useAppDispatch() const leverageSide = useAppSelector(selectLeverageSide) - const accountType = useAppSelector(selectFuturesType) const orderType = useAppSelector(selectOrderType) const pricesConnectionError = useAppSelector(selectPricesConnectionError) const hideOrderWarning = useAppSelector(selectAckedOrdersWarning) @@ -82,10 +82,7 @@ const TradePanel: FC = memo(({ mobile, closeDrawer }) => { {pricesConnectionError && ( )} - - {accountType === 'cross_margin' && ( - - )} + {showOrderWarning ? ( <> @@ -97,24 +94,19 @@ const TradePanel: FC = memo(({ mobile, closeDrawer }) => { ) : ( <> - {accountType === 'cross_margin' && } - - {orderType !== 'market' && accountType === 'cross_margin' && ( + + {orderType !== 'market' && ( <> )} - + - - - {accountType === 'cross_margin' && } - + - - + )} @@ -141,4 +133,4 @@ const MainPanelContent = styled.div<{ $mobile?: boolean }>` `} ` -export default TradePanel +export default TradePanelSmartMargin diff --git a/packages/app/src/sections/futures/Trade/TransferSmartMarginModal.tsx b/packages/app/src/sections/futures/Trade/TransferSmartMarginModal.tsx index 2a1dcd4a53..f766079f53 100644 --- a/packages/app/src/sections/futures/Trade/TransferSmartMarginModal.tsx +++ b/packages/app/src/sections/futures/Trade/TransferSmartMarginModal.tsx @@ -16,8 +16,9 @@ import SegmentedControl from 'components/SegmentedControl' import Spacer from 'components/Spacer' import { selectTransaction } from 'state/app/selectors' import { selectSusdBalance } from 'state/balances/selectors' -import { withdrawCrossMargin } from 'state/futures/actions' -import { selectIsSubmittingCrossTransfer, selectWithdrawableMargin } from 'state/futures/selectors' +import { selectIsSubmittingCrossTransfer } from 'state/futures/selectors' +import { withdrawSmartMargin } from 'state/futures/smartMargin/actions' +import { selectWithdrawableSmartMargin } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' type Props = { @@ -36,7 +37,7 @@ const TransferSmartMarginModal: React.FC = ({ onDismiss, defaultTab }) => const dispatch = useAppDispatch() const submitting = useAppSelector(selectIsSubmittingCrossTransfer) - const totalWithdrawable = useAppSelector(selectWithdrawableMargin) + const totalWithdrawable = useAppSelector(selectWithdrawableSmartMargin) const transactionState = useAppSelector(selectTransaction) const susdBalance = useAppSelector(selectSusdBalance) @@ -64,7 +65,7 @@ const TransferSmartMarginModal: React.FC = ({ onDismiss, defaultTab }) => } const onWithdraw = () => { - dispatch(withdrawCrossMargin(wei(amount))) + dispatch(withdrawSmartMargin(wei(amount))) } return ( diff --git a/packages/app/src/sections/futures/Trade/index.ts b/packages/app/src/sections/futures/Trade/index.ts index 6f79921cb7..97eaa84a0e 100644 --- a/packages/app/src/sections/futures/Trade/index.ts +++ b/packages/app/src/sections/futures/Trade/index.ts @@ -1 +1 @@ -export { default } from './TradePanel' +export { default } from './TradePanelSmartMargin' diff --git a/packages/app/src/sections/futures/TradeConfirmation/DelayedOrderConfirmationModal.tsx b/packages/app/src/sections/futures/TradeConfirmation/CrossMarginOrderConfirmation.tsx similarity index 78% rename from packages/app/src/sections/futures/TradeConfirmation/DelayedOrderConfirmationModal.tsx rename to packages/app/src/sections/futures/TradeConfirmation/CrossMarginOrderConfirmation.tsx index 7258d395d5..7bf67b4e8a 100644 --- a/packages/app/src/sections/futures/TradeConfirmation/DelayedOrderConfirmationModal.tsx +++ b/packages/app/src/sections/futures/TradeConfirmation/CrossMarginOrderConfirmation.tsx @@ -21,18 +21,19 @@ import { DesktopOnlyView, MobileOrTabletView } from 'components/Media' import Spacer from 'components/Spacer' import Tooltip from 'components/Tooltip/Tooltip' import { setOpenModal } from 'state/app/reducer' -import { modifyIsolatedPosition } from 'state/futures/actions' +import { selectMarketAsset } from 'state/futures/common/selectors' +import { submitCrossMarginOrder } from 'state/futures/crossMargin/actions' +import { + selectCrossMarginTradeInputs, + selectCrossMarginTradePreview, + selectV3MarketInfo, +} from 'state/futures/crossMargin/selectors' import { - selectIsModifyingIsolatedPosition, selectLeverageSide, - selectMarketAsset, - selectMarketInfo, selectModifyPositionError, selectNextPriceDisclaimer, - selectOrderType, selectPosition, - selectTradePreview, - selectTradeSizeInputs, + selectSubmittingFuturesTx, } from 'state/futures/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import { getKnownError } from 'utils/formatters/error' @@ -42,26 +43,23 @@ import BaseDrawer from '../MobileTrade/drawers/BaseDrawer' import TradeConfirmationRow from './TradeConfirmationRow' import TradeConfirmationSummary from './TradeConfirmationSummary' -const DelayedOrderConfirmationModal: FC = () => { +const CrossMarginOrderConfirmationModal: FC = () => { const { t } = useTranslation() const isDisclaimerDisplayed = useAppSelector(selectNextPriceDisclaimer) const dispatch = useAppDispatch() - const { nativeSizeDelta } = useAppSelector(selectTradeSizeInputs) + const { nativeSizeDelta } = useAppSelector(selectCrossMarginTradeInputs) const txError = useAppSelector(selectModifyPositionError) const leverageSide = useAppSelector(selectLeverageSide) const position = useAppSelector(selectPosition) - const marketInfo = useAppSelector(selectMarketInfo) + const marketInfo = useAppSelector(selectV3MarketInfo) const marketAsset = useAppSelector(selectMarketAsset) - const submitting = useAppSelector(selectIsModifyingIsolatedPosition) - const potentialTradeDetails = useAppSelector(selectTradePreview) - const orderType = useAppSelector(selectOrderType) + const submitting = useAppSelector(selectSubmittingFuturesTx) + const preview = useAppSelector(selectCrossMarginTradePreview) + const settlementStrategy = marketInfo?.settlementStrategies[0] const positionSize = useMemo(() => { - const positionDetails = position?.position - return positionDetails - ? positionDetails.size.mul(positionDetails.side === PositionSide.LONG ? 1 : -1) - : ZERO_WEI + return position ? position.size.mul(position.side === PositionSide.LONG ? 1 : -1) : ZERO_WEI }, [position]) const orderDetails = useMemo(() => { @@ -73,48 +71,45 @@ const DelayedOrderConfirmationModal: FC = () => { }, [orderDetails]) const totalDeposit = useMemo(() => { - return (potentialTradeDetails?.fee ?? ZERO_WEI).add(marketInfo?.keeperDeposit ?? ZERO_WEI) - }, [potentialTradeDetails?.fee, marketInfo?.keeperDeposit]) + return (preview?.fee ?? ZERO_WEI).add(preview?.settlementFee ?? ZERO_WEI) + }, [preview?.fee, preview?.settlementFee]) const dataRows = useMemo( () => [ { label: t('futures.market.user.position.modal.estimated-fill'), tooltipContent: t('futures.market.trade.delayed-order.description'), - value: formatDollars(potentialTradeDetails?.price ?? ZERO_WEI, { + value: formatDollars(preview?.fillPrice ?? ZERO_WEI, { suggestDecimals: true, }), }, { label: t('futures.market.user.position.modal.estimated-price-impact'), - value: `${formatPercent(potentialTradeDetails?.priceImpact ?? ZERO_WEI)}`, - color: potentialTradeDetails?.priceImpact.abs().gt(0.45) // TODO: Make this configurable + value: `${formatPercent(preview?.priceImpact ?? ZERO_WEI)}`, + color: preview?.priceImpact?.abs().gt(0.45) // TODO: Make this configurable ? 'red' : '', }, - { - label: t('futures.market.user.position.modal.liquidation-price'), - value: formatDollars(potentialTradeDetails?.liqPrice ?? ZERO_WEI, { - suggestDecimals: true, - }), - }, { label: t('futures.market.user.position.modal.time-delay'), - value: `${formatNumber(marketInfo?.settings.offchainDelayedOrderMinAge ?? ZERO_WEI, { - maxDecimals: 0, - })} sec`, + value: `${formatNumber( + settlementStrategy?.settlementDelay ? settlementStrategy.settlementDelay : ZERO_WEI, + { + maxDecimals: 0, + } + )} sec`, }, { label: t('futures.market.user.position.modal.fee-estimated'), tooltipContent: t('futures.market.trade.fees.tooltip'), - value: formatDollars(potentialTradeDetails?.fee ?? ZERO_WEI, { + value: formatDollars(preview?.fee ?? ZERO_WEI, { minDecimals: 2, }), }, { label: t('futures.market.user.position.modal.keeper-deposit'), tooltipContent: t('futures.market.trade.fees.keeper-tooltip'), - value: formatDollars(marketInfo?.keeperDeposit ?? ZERO_WEI, { + value: formatDollars(preview?.settlementFee ?? ZERO_WEI, { minDecimals: 2, }), }, @@ -124,13 +119,7 @@ const DelayedOrderConfirmationModal: FC = () => { value: formatDollars(totalDeposit), }, ], - [ - t, - potentialTradeDetails, - totalDeposit, - marketInfo?.keeperDeposit, - marketInfo?.settings.offchainDelayedOrderMinAge, - ] + [t, preview, totalDeposit, settlementStrategy?.settlementDelay] ) const mobileRows = useMemo(() => { @@ -151,18 +140,18 @@ const DelayedOrderConfirmationModal: FC = () => { }, { label: t('futures.market.user.position.modal.order-type'), - value: OrderNameByType[orderType], + value: OrderNameByType['market'], }, ...dataRows, ] - }, [dataRows, marketAsset, leverageSide, orderType, orderDetails.nativeSizeDelta, t]) + }, [t, dataRows, marketAsset, leverageSide, orderDetails.nativeSizeDelta]) const onDismiss = useCallback(() => { dispatch(setOpenModal(null)) }, [dispatch]) const handleConfirmOrder = () => { - dispatch(modifyIsolatedPosition()) + dispatch(submitCrossMarginOrder()) } return ( @@ -182,8 +171,8 @@ const DelayedOrderConfirmationModal: FC = () => { marketAsset={marketAsset} nativeSizeDelta={orderDetails.nativeSizeDelta} leverageSide={leverageSide} - orderType={orderType} - leverage={potentialTradeDetails?.leverage ?? ZERO_WEI} + orderType={'market'} + leverage={preview?.leverage ?? ZERO_WEI} /> {dataRows.map((row, i) => ( @@ -314,4 +303,4 @@ const StyledHelpIcon = styled(HelpIcon)` margin-bottom: -1px; ` -export default DelayedOrderConfirmationModal +export default CrossMarginOrderConfirmationModal diff --git a/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModal.tsx b/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModal.tsx index 78218474c5..bd0902904e 100644 --- a/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModal.tsx +++ b/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModal.tsx @@ -21,20 +21,22 @@ import { ButtonLoader } from 'components/Loader' import Spacer from 'components/Spacer' import Tooltip from 'components/Tooltip/Tooltip' import { NO_VALUE } from 'constants/placeholder' -import { refetchTradePreview, submitCrossMarginOrder } from 'state/futures/actions' +import { selectMarketAsset } from 'state/futures/common/selectors' import { selectLeverageSide, - selectMarketAsset, - selectCrossMarginOrderPrice, - selectOrderType, selectPosition, - selectTradePreview, selectLeverageInput, - selectSlTpTradeInputs, - selectKeeperDepositExceedsBal, - selectNewTradeHasSlTp, selectTradePanelSLValidity, } from 'state/futures/selectors' +import { refetchTradePreview, submitSmartMarginOrder } from 'state/futures/smartMargin/actions' +import { + selectKeeperDepositExceedsBal, + selectNewTradeHasSlTp, + selectOrderType, + selectSlTpTradeInputs, + selectSmartMarginOrderPrice, + selectTradePreview, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector, usePollAction } from 'state/hooks' import AcceptWarningView from '../../../components/AcceptWarningView' @@ -69,7 +71,7 @@ export default function TradeConfirmationModal({ const marketAsset = useAppSelector(selectMarketAsset) const potentialTradeDetails = useAppSelector(selectTradePreview) const orderType = useAppSelector(selectOrderType) - const orderPrice = useAppSelector(selectCrossMarginOrderPrice) + const orderPrice = useAppSelector(selectSmartMarginOrderPrice) const position = useAppSelector(selectPosition) const leverageSide = useAppSelector(selectLeverageSide) const leverageInput = useAppSelector(selectLeverageInput) @@ -83,7 +85,7 @@ export default function TradeConfirmationModal({ usePollAction('refresh_preview', refetchTradePreview, { intervalTime: 6000 }) - const onConfirmOrder = useCallback(() => dispatch(submitCrossMarginOrder(true)), [dispatch]) + const onConfirmOrder = useCallback(() => dispatch(submitSmartMarginOrder(true)), [dispatch]) const totalFee = useMemo( () => potentialTradeDetails?.fee.add(executionFee) ?? executionFee, @@ -92,10 +94,10 @@ export default function TradeConfirmationModal({ const positionSide = useMemo(() => { if (potentialTradeDetails?.size.eq(ZERO_WEI)) { - return position?.position?.side === PositionSide.LONG ? PositionSide.SHORT : PositionSide.LONG + return position?.side === PositionSide.LONG ? PositionSide.SHORT : PositionSide.LONG } return potentialTradeDetails?.size.gte(ZERO_WEI) ? PositionSide.LONG : PositionSide.SHORT - }, [potentialTradeDetails?.size, position?.position?.side]) + }, [potentialTradeDetails?.size, position?.side]) const positionDetails = useMemo(() => { return potentialTradeDetails diff --git a/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModalCrossMargin.tsx b/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModalCrossMargin.tsx index e9288faf26..2f86f6f028 100644 --- a/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModalCrossMargin.tsx +++ b/packages/app/src/sections/futures/TradeConfirmation/TradeConfirmationModalCrossMargin.tsx @@ -2,15 +2,14 @@ import { ZERO_WEI } from '@kwenta/sdk/constants' import { useCallback } from 'react' import { setOpenModal } from 'state/app/reducer' -import { approveCrossMargin } from 'state/futures/actions' +import { selectMarketInfo, selectSubmittingFuturesTx } from 'state/futures/selectors' +import { approveSmartMargin } from 'state/futures/smartMargin/actions' import { - selectSmartMarginKeeperDeposit, selectIsConditionalOrder, - selectMarketInfo, selectNewTradeHasSlTp, selectSmartMarginAllowanceValid, - selectSubmittingFuturesTx, -} from 'state/futures/selectors' + selectSmartMarginKeeperDeposit, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import TradeConfirmationModal from './TradeConfirmationModal' @@ -32,7 +31,7 @@ export default function TradeConfirmationModalCrossMargin() { }, [dispatch]) const handleApproveSmartMargin = useCallback(async () => { - dispatch(approveCrossMargin()) + dispatch(approveSmartMargin()) }, [dispatch]) return ( diff --git a/packages/app/src/sections/futures/TradeCrossMargin/ManageKeeperBalanceModal.tsx b/packages/app/src/sections/futures/TradeSmartMargin/ManageKeeperBalanceModal.tsx similarity index 93% rename from packages/app/src/sections/futures/TradeCrossMargin/ManageKeeperBalanceModal.tsx rename to packages/app/src/sections/futures/TradeSmartMargin/ManageKeeperBalanceModal.tsx index 10d89827db..0afbfa6c98 100644 --- a/packages/app/src/sections/futures/TradeCrossMargin/ManageKeeperBalanceModal.tsx +++ b/packages/app/src/sections/futures/TradeSmartMargin/ManageKeeperBalanceModal.tsx @@ -14,12 +14,12 @@ import SegmentedControl from 'components/SegmentedControl' import Spacer from 'components/Spacer' import Connector from 'containers/Connector' import { setOpenModal } from 'state/app/reducer' -import { withdrawAccountKeeperBalance } from 'state/futures/actions' +import { selectSubmittingFuturesTx } from 'state/futures/selectors' +import { withdrawAccountKeeperBalance } from 'state/futures/smartMargin/actions' import { - selectCrossMarginBalanceInfo, selectConditionalOrdersForMarket, - selectSubmittingFuturesTx, -} from 'state/futures/selectors' + selectSmartMarginBalanceInfo, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import logError from 'utils/logError' @@ -28,7 +28,7 @@ import { BalanceContainer, BalanceText, MaxButton, -} from '../Trade/TransferIsolatedMarginModal' +} from '../Trade/DepositWithdrawCrossMargin' type TransferType = 'deposit' | 'withdraw' @@ -43,7 +43,7 @@ export default function ManageKeeperBalanceModal({ defaultType }: Props) { const dispatch = useAppDispatch() const { provider, walletAddress } = Connector.useContainer() - const { keeperEthBal } = useAppSelector(selectCrossMarginBalanceInfo) + const { keeperEthBal } = useAppSelector(selectSmartMarginBalanceInfo) const openOrders = useAppSelector(selectConditionalOrdersForMarket) const isSubmitting = useAppSelector(selectSubmittingFuturesTx) diff --git a/packages/app/src/sections/futures/TradeCrossMargin/CrossMarginInfoBox.tsx b/packages/app/src/sections/futures/TradeSmartMargin/SmartMarginInfoBox.tsx similarity index 78% rename from packages/app/src/sections/futures/TradeCrossMargin/CrossMarginInfoBox.tsx rename to packages/app/src/sections/futures/TradeSmartMargin/SmartMarginInfoBox.tsx index fe4d3eafb1..372359967b 100644 --- a/packages/app/src/sections/futures/TradeCrossMargin/CrossMarginInfoBox.tsx +++ b/packages/app/src/sections/futures/TradeSmartMargin/SmartMarginInfoBox.tsx @@ -4,25 +4,25 @@ import React, { memo } from 'react' import { InfoBoxRow } from 'components/InfoBox' import { setOpenModal } from 'state/app/reducer' import { selectShowModal } from 'state/app/selectors' -import { selectSusdBalance } from 'state/balances/selectors' +import { selectSNXUSDBalance } from 'state/balances/selectors' import { - selectCrossMarginBalanceInfo, selectAvailableMarginInMarkets, -} from 'state/futures/selectors' + selectSmartMarginBalanceInfo, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import PencilButton from '../../../components/Button/PencilButton' import ManageKeeperBalanceModal from './ManageKeeperBalanceModal' -function MarginInfoBox() { +function SmartMarginInfoBox() { const dispatch = useAppDispatch() - const { keeperEthBal } = useAppSelector(selectCrossMarginBalanceInfo) + const { keeperEthBal } = useAppSelector(selectSmartMarginBalanceInfo) const openModal = useAppSelector(selectShowModal) - const { freeMargin } = useAppSelector(selectCrossMarginBalanceInfo) + const { freeMargin } = useAppSelector(selectSmartMarginBalanceInfo) const idleMarginInMarkets = useAppSelector(selectAvailableMarginInMarkets) - const walletBal = useAppSelector(selectSusdBalance) + const walletBal = useAppSelector(selectSNXUSDBalance) return ( <> @@ -55,4 +55,4 @@ function MarginInfoBox() { ) } -export default memo(MarginInfoBox) +export default memo(SmartMarginInfoBox) diff --git a/packages/app/src/sections/futures/TradeCrossMargin/WithdrawSmartMargin.tsx b/packages/app/src/sections/futures/TradeSmartMargin/WithdrawSmartMargin.tsx similarity index 91% rename from packages/app/src/sections/futures/TradeCrossMargin/WithdrawSmartMargin.tsx rename to packages/app/src/sections/futures/TradeSmartMargin/WithdrawSmartMargin.tsx index 99d2eb7a22..0e35641039 100644 --- a/packages/app/src/sections/futures/TradeCrossMargin/WithdrawSmartMargin.tsx +++ b/packages/app/src/sections/futures/TradeSmartMargin/WithdrawSmartMargin.tsx @@ -11,8 +11,9 @@ import NumericInput from 'components/Input/NumericInput' import { FlexDivRowCentered } from 'components/layout/flex' import Loader from 'components/Loader' import { selectTransaction } from 'state/app/selectors' -import { withdrawCrossMargin } from 'state/futures/actions' -import { selectIsSubmittingCrossTransfer, selectWithdrawableMargin } from 'state/futures/selectors' +import { selectIsSubmittingCrossTransfer } from 'state/futures/selectors' +import { withdrawSmartMargin } from 'state/futures/smartMargin/actions' +import { selectWithdrawableSmartMargin } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' type Props = { @@ -27,7 +28,7 @@ export default function WithdrawSmartMargin({ onDismiss }: Props) { const transactionState = useAppSelector(selectTransaction) const isSubmitting = useAppSelector(selectIsSubmittingCrossTransfer) - const totalWithdrawable = useAppSelector(selectWithdrawableMargin) + const totalWithdrawable = useAppSelector(selectWithdrawableSmartMargin) const [amount, setAmount] = useState('') @@ -38,7 +39,7 @@ export default function WithdrawSmartMargin({ onDismiss }: Props) { }, [amount, totalWithdrawable, t]) const withdrawMargin = useCallback(async () => { - dispatch(withdrawCrossMargin(wei(amount))) + dispatch(withdrawSmartMargin(wei(amount))) }, [amount, dispatch]) const handleSetMax = React.useCallback(() => { diff --git a/packages/app/src/sections/futures/TraderHistory.tsx b/packages/app/src/sections/futures/TraderHistory.tsx index 0a0cd04b68..6b5a02fcb4 100644 --- a/packages/app/src/sections/futures/TraderHistory.tsx +++ b/packages/app/src/sections/futures/TraderHistory.tsx @@ -42,10 +42,10 @@ const TraderHistory: FC = memo( .map((stat, i) => { const totalDeposit = stat.initialMargin.add(stat.totalDeposits) const thisPosition = stat.isOpen - ? positions.find((p) => p.marketKey === stat.marketKey) + ? positions.find((p) => p.market.marketKey === stat.marketKey) : null - const funding = stat.netFunding.add(thisPosition?.position?.accruedFunding ?? ZERO_WEI) + const funding = stat.netFunding.add(thisPosition?.accruedFunding ?? ZERO_WEI) const pnlWithFeesPaid = stat.pnl.sub(stat.feesPaid).add(funding) return { diff --git a/packages/app/src/sections/futures/Trades/Trades.tsx b/packages/app/src/sections/futures/Trades/Trades.tsx index 480df99ab8..fc9a8d290a 100644 --- a/packages/app/src/sections/futures/Trades/Trades.tsx +++ b/packages/app/src/sections/futures/Trades/Trades.tsx @@ -14,12 +14,9 @@ import { blockExplorer } from 'containers/Connector/Connector' import useIsL2 from 'hooks/useIsL2' import useNetworkSwitcher from 'hooks/useNetworkSwitcher' import useWindowSize from 'hooks/useWindowSize' -import { - selectAllTradesForAccountType, - selectFuturesType, - selectMarketAsset, - selectQueryStatuses, -} from 'state/futures/selectors' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' +import { selectAllTradesForAccountType } from 'state/futures/selectors' +import { selectSmartMarginQueryStatuses } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import { FetchStatus } from 'state/types' @@ -40,7 +37,7 @@ const Trades: FC = memo(({ rounded = false, noBottom = true }) => { const marketAsset = useAppSelector(selectMarketAsset) const accountType = useAppSelector(selectFuturesType) const history = useAppSelector(selectAllTradesForAccountType) - const { trades } = useAppSelector(selectQueryStatuses) + const { trades } = useAppSelector(selectSmartMarginQueryStatuses) const isLoading = !history.length && trades.status === FetchStatus.Loading const isLoaded = trades.status === FetchStatus.Success diff --git a/packages/app/src/sections/futures/TradingHistory/SkewInfo.tsx b/packages/app/src/sections/futures/TradingHistory/SkewInfo.tsx index 62e0e10ffd..75a08cbc55 100644 --- a/packages/app/src/sections/futures/TradingHistory/SkewInfo.tsx +++ b/packages/app/src/sections/futures/TradingHistory/SkewInfo.tsx @@ -6,7 +6,8 @@ import styled from 'styled-components' import { Body } from 'components/Text' import Tooltip from 'components/Tooltip/Tooltip' -import { selectMarketAsset, selectMarketInfo } from 'state/futures/selectors' +import { selectMarketAsset } from 'state/futures/common/selectors' +import { selectMarketInfo } from 'state/futures/selectors' import { useAppSelector } from 'state/hooks' import OpenInterestBar from './OpenInterestBar' diff --git a/packages/app/src/sections/futures/Transfers.tsx b/packages/app/src/sections/futures/Transfers.tsx index a75e0d3ed8..78eca3a969 100644 --- a/packages/app/src/sections/futures/Transfers.tsx +++ b/packages/app/src/sections/futures/Transfers.tsx @@ -1,3 +1,4 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' import { formatDollars, truncateAddress } from '@kwenta/sdk/utils' import { FC, useMemo } from 'react' import { useTranslation } from 'react-i18next' @@ -9,12 +10,9 @@ import { Body } from 'components/Text' import { blockExplorer } from 'containers/Connector/Connector' import useIsL2 from 'hooks/useIsL2' import useNetworkSwitcher from 'hooks/useNetworkSwitcher' -import { - selectFuturesType, - selectIdleMarginTransfers, - selectMarketMarginTransfers, - selectQueryStatuses, -} from 'state/futures/selectors' +import { selectFuturesType } from 'state/futures/common/selectors' +import { selectMarketMarginTransfers, selectQueryStatuses } from 'state/futures/selectors' +import { selectIdleMarginTransfers } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' import { FetchStatus } from 'state/types' import { ExternalLink } from 'styles/common' @@ -39,7 +37,9 @@ const Transfers: FC = () => { ) const marginTransfers = useMemo(() => { - return accountType === 'isolated_margin' ? marketMarginTransfers : idleMarginTransfers + return accountType === FuturesMarginType.CROSS_MARGIN + ? marketMarginTransfers + : idleMarginTransfers }, [accountType, marketMarginTransfers, idleMarginTransfers]) return ( diff --git a/packages/app/src/sections/futures/UserInfo/ConditionalOrdersTable.tsx b/packages/app/src/sections/futures/UserInfo/ConditionalOrdersTable.tsx index 434d15bde6..ca30a75814 100644 --- a/packages/app/src/sections/futures/UserInfo/ConditionalOrdersTable.tsx +++ b/packages/app/src/sections/futures/UserInfo/ConditionalOrdersTable.tsx @@ -14,12 +14,12 @@ import { CustomFontLabel } from 'components/Text/CustomFontLabel' import { NO_VALUE } from 'constants/placeholder' import useIsL2 from 'hooks/useIsL2' import useNetworkSwitcher from 'hooks/useNetworkSwitcher' -import { cancelConditionalOrder } from 'state/futures/actions' +import { selectMarketAsset } from 'state/futures/common/selectors' +import { cancelConditionalOrder } from 'state/futures/smartMargin/actions' import { - selectCancellingConditionalOrder, - selectMarketAsset, selectAllConditionalOrders, -} from 'state/futures/selectors' + selectCancellingConditionalOrder, +} from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import PositionType from '../PositionType' diff --git a/packages/app/src/sections/futures/UserInfo/OpenDelayedOrdersTable.tsx b/packages/app/src/sections/futures/UserInfo/OpenDelayedOrdersTable.tsx index 8022c4e46c..82f253b9fd 100644 --- a/packages/app/src/sections/futures/UserInfo/OpenDelayedOrdersTable.tsx +++ b/packages/app/src/sections/futures/UserInfo/OpenDelayedOrdersTable.tsx @@ -1,6 +1,6 @@ -import { FuturesMarketKey } from '@kwenta/sdk/types' +import { FuturesMarginType, FuturesMarketKey } from '@kwenta/sdk/types' import { getDisplayAsset, formatCurrency, suggestedDecimals } from '@kwenta/sdk/utils' -import { useState, useMemo } from 'react' +import { useState, useMemo, memo } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -13,14 +13,13 @@ import { DEFAULT_DELAYED_CANCEL_BUFFER, DEFAULT_DELAYED_EXECUTION_BUFFER } from import useInterval from 'hooks/useInterval' import useIsL2 from 'hooks/useIsL2' import useNetworkSwitcher from 'hooks/useNetworkSwitcher' -import { cancelDelayedOrder, executeDelayedOrder } from 'state/futures/actions' -import { - selectIsCancellingOrder, - selectIsExecutingOrder, - selectOpenDelayedOrders, - selectMarketAsset, - selectMarkets, -} from 'state/futures/selectors' +import { cancelDelayedOrder } from 'state/futures/actions' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' +import { cancelAsyncOrder, executeAsyncOrder } from 'state/futures/crossMargin/actions' +import { selectAsyncCrossMarginOrders } from 'state/futures/crossMargin/selectors' +import { selectIsCancellingOrder, selectIsExecutingOrder } from 'state/futures/selectors' +import { executeDelayedOrder } from 'state/futures/smartMargin/actions' +import { selectSmartMarginDelayedOrders } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import PositionType from '../PositionType' @@ -35,29 +34,36 @@ type CountdownTimers = Record< } > -const OpenDelayedOrdersTable: React.FC = () => { +const OpenDelayedOrdersTable: React.FC = memo(() => { const { t } = useTranslation() const dispatch = useAppDispatch() const { switchToL2 } = useNetworkSwitcher() const isL2 = useIsL2() const marketAsset = useAppSelector(selectMarketAsset) - const openDelayedOrders = useAppSelector(selectOpenDelayedOrders) - const futuresMarkets = useAppSelector(selectMarkets) + const smartMarginOrders = useAppSelector(selectSmartMarginDelayedOrders) const isCancelling = useAppSelector(selectIsCancellingOrder) const isExecuting = useAppSelector(selectIsExecutingOrder) + const crossMarginOrders = useAppSelector(selectAsyncCrossMarginOrders) + const futuresType = useAppSelector(selectFuturesType) + + const orders = useMemo( + () => (futuresType === FuturesMarginType.CROSS_MARGIN ? crossMarginOrders : smartMarginOrders), + [futuresType, crossMarginOrders, smartMarginOrders] + ) const [countdownTimers, setCountdownTimers] = useState() + // TODO: Share logic between mobile and desktop + const rowsData = useMemo(() => { - const ordersWithCancel = openDelayedOrders + const ordersWithCancel = orders .map((o) => { - const market = futuresMarkets.find((m) => m.market === o.marketAddress) - const timer = countdownTimers ? countdownTimers[o.marketKey] : null + const timer = countdownTimers ? countdownTimers[o.market.marketKey] : null const order = { ...o, - sizeTxt: formatCurrency(o.asset, o.size.abs(), { - currencyKey: getDisplayAsset(o.asset) ?? '', + sizeTxt: formatCurrency(o.market.asset, o.size.abs(), { + currencyKey: getDisplayAsset(o.market.asset) ?? '', minDecimals: suggestedDecimals(o.size), }), timeToExecution: timer?.timeToExecution, @@ -65,69 +71,64 @@ const OpenDelayedOrdersTable: React.FC = () => { show: !!timer, isStale: timer && - market?.settings && + o.market.settings && timer.timeToExecution === 0 && - timer.timePastExecution > - DEFAULT_DELAYED_CANCEL_BUFFER + - (o.isOffchain - ? market.settings.offchainDelayedOrderMaxAge - : market.settings.maxDelayTimeDelta), + timer.timePastExecution > DEFAULT_DELAYED_CANCEL_BUFFER + o.settlementWindowDuration, isFailed: timer && - market?.settings && + o.market.settings && timer.timeToExecution === 0 && - timer.timePastExecution > - DEFAULT_DELAYED_EXECUTION_BUFFER + - (o.isOffchain - ? market.settings.offchainDelayedOrderMinAge - : market.settings.minDelayTimeDelta), + timer.timePastExecution > DEFAULT_DELAYED_EXECUTION_BUFFER, isExecutable: timer && - market?.settings && timer.timeToExecution === 0 && - timer.timePastExecution <= - (o.isOffchain - ? market.settings.offchainDelayedOrderMaxAge - : market.settings.maxDelayTimeDelta), - totalDeposit: o.commitDeposit.add(o.keeperDeposit), + timer.timePastExecution <= o.settlementWindowDuration, + totalDeposit: o.settlementFee, onCancel: () => { - dispatch( - cancelDelayedOrder({ - marketAddress: o.marketAddress, - isOffchain: o.isOffchain, - }) - ) + if (o.market.version === 2) { + dispatch(cancelDelayedOrder(o.market.marketAddress)) + } else { + dispatch(cancelAsyncOrder(o.market.marketId)) + } }, onExecute: () => { - dispatch( - executeDelayedOrder({ - marketKey: o.marketKey, - marketAddress: o.marketAddress, - isOffchain: o.isOffchain, - }) - ) + if (o.market.version === 2) { + dispatch( + executeDelayedOrder({ + marketKey: o.market.marketKey, + marketAddress: o.market.marketAddress, + }) + ) + } else { + dispatch( + executeAsyncOrder({ + marketKey: o.market.marketKey, + marketId: o.market.marketId, + }) + ) + } }, } return order }) .sort((a, b) => { - return b.asset === marketAsset && a.asset !== marketAsset + return b.market.asset === marketAsset && a.market.asset !== marketAsset ? 1 - : b.asset === marketAsset && a.asset === marketAsset + : b.market.asset === marketAsset && a.market.asset === marketAsset ? 0 : -1 }) return ordersWithCancel - }, [openDelayedOrders, futuresMarkets, marketAsset, countdownTimers, dispatch]) + }, [orders, marketAsset, countdownTimers, dispatch]) useInterval( () => { const newCountdownTimers = rowsData.reduce((acc, order) => { - const timeToExecution = Math.floor((order.executableAtTimestamp - Date.now()) / 1000) - const timePastExecution = Math.floor((Date.now() - order.executableAtTimestamp) / 1000) + const timeToExecution = Math.floor(order.executableStartTime - Date.now() / 1000) + const timePastExecution = Math.floor(Date.now() / 1000 - order.executableStartTime) // Only updated delayed orders - acc[order.marketKey] = { + acc[order.market.marketKey] = { timeToExecution: Math.max(timeToExecution, 0), timePastExecution: Math.max(timePastExecution, 0), } @@ -166,9 +167,9 @@ const OpenDelayedOrdersTable: React.FC = () => { cell: (cellProps) => { return ( @@ -275,7 +276,7 @@ const OpenDelayedOrdersTable: React.FC = () => { ]} /> ) -} +}) const ExpiredBadge = styled(Badge)` background: ${(props) => props.theme.colors.selectedTheme.red}; diff --git a/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx b/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx index 86f0ffcdfd..8e0f784eb1 100644 --- a/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx +++ b/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx @@ -1,9 +1,10 @@ -import { ZERO_WEI } from '@kwenta/sdk/constants' +import { FuturesMarginType } from '@kwenta/sdk/types' import { getDisplayAsset, formatPercent } from '@kwenta/sdk/utils' import { useRouter } from 'next/router' -import { FC, useCallback, useMemo, useState } from 'react' +import { FC, memo, useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' +import { FuturesPositionTablePosition } from 'types/futures' import UploadIcon from 'assets/svg/futures/upload-icon.svg' import Currency from 'components/Currency' @@ -19,16 +20,9 @@ import useNetworkSwitcher from 'hooks/useNetworkSwitcher' import useWindowSize from 'hooks/useWindowSize' import PositionType from 'sections/futures/PositionType' import { setShowPositionModal } from 'state/app/reducer' -import { - selectCrossMarginPositions, - selectFuturesType, - selectIsolatedMarginPositions, - selectMarketAsset, - selectMarkets, - selectMarkPrices, - selectPositionHistory, -} from 'state/futures/selectors' -import { SharePositionParams } from 'state/futures/types' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' +import { selectCrossMarginPositions } from 'state/futures/crossMargin/selectors' +import { selectSmartMarginPositions } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' import { FOOTER_HEIGHT } from 'styles/common' import media from 'styles/media' @@ -39,12 +33,11 @@ import ShareModal from '../ShareModal' import EditPositionButton from './EditPositionButton' import TableMarketDetails from './TableMarketDetails' -type FuturesPositionTableProps = { - showCurrentMarket?: boolean - showEmptyTable?: boolean +type Props = { + positions: FuturesPositionTablePosition[] } -const PositionsTable: FC = () => { +const PositionsTable: FC = memo(({ positions }: Props) => { const { t } = useTranslation() const router = useRouter() const dispatch = useAppDispatch() @@ -53,53 +46,16 @@ const PositionsTable: FC = () => { const isL2 = useIsL2() - const isolatedPositions = useAppSelector(selectIsolatedMarginPositions) - const crossMarginPositions = useAppSelector(selectCrossMarginPositions) - const positionHistory = useAppSelector(selectPositionHistory) const currentMarket = useAppSelector(selectMarketAsset) - const futuresMarkets = useAppSelector(selectMarkets) - const markPrices = useAppSelector(selectMarkPrices) const accountType = useAppSelector(selectFuturesType) const [showShareModal, setShowShareModal] = useState(false) - const [sharePosition, setSharePosition] = useState(null) + const [sharePosition, setSharePosition] = useState(null) let data = useMemo(() => { - const positions = accountType === 'cross_margin' ? crossMarginPositions : isolatedPositions - return positions - .map((position) => { - const market = futuresMarkets.find((market) => market.asset === position.asset) - const thisPositionHistory = positionHistory.find((ph) => { - return ph.isOpen && ph.asset === position.asset - }) - const markPrice = markPrices[market?.marketKey!] ?? ZERO_WEI - return { - market: market!, - remainingMargin: position.remainingMargin, - position: position.position!, - avgEntryPrice: thisPositionHistory?.avgEntryPrice, - stopLoss: position.stopLoss?.targetPrice, - takeProfit: position.takeProfit?.targetPrice, - share: { - asset: position.asset, - position: position.position!, - positionHistory: thisPositionHistory!, - marketPrice: markPrice, - }, - } - }) - .filter(({ position, market }) => !!position && !!market) - .sort((a) => (a.market.asset === currentMarket ? -1 : 1)) - }, [ - accountType, - crossMarginPositions, - isolatedPositions, - futuresMarkets, - positionHistory, - markPrices, - currentMarket, - ]) + return positions.sort((a) => (a.market.asset === currentMarket ? -1 : 1)) + }, [positions, currentMarket]) - const handleOpenShareModal = useCallback((share: SharePositionParams) => { + const handleOpenShareModal = useCallback((share: FuturesPositionTablePosition) => { setSharePosition(share) setShowShareModal((s) => !s) }, []) @@ -160,7 +116,7 @@ const PositionsTable: FC = () => { - + @@ -168,8 +124,8 @@ const PositionsTable: FC = () => {
- - {accountType === 'cross_margin' && ( + + {accountType === FuturesMarginType.SMART_MARGIN && ( = () => { )} @@ -198,7 +154,7 @@ const PositionsTable: FC = () => { @@ -207,52 +163,50 @@ const PositionsTable: FC = () => { - {accountType === 'cross_margin' && ( + {accountType === FuturesMarginType.SMART_MARGIN && ( )} - + - - - {formatPercent(row.position.pnlPct)} + + + {formatPercent(row.pnlPct)} - + - {accountType === 'cross_margin' && ( + {accountType === FuturesMarginType.SMART_MARGIN && ( - {row.takeProfit === undefined ? ( + {!row.takeProfit ? ( {NO_VALUE} ) : (
- +
)} - {accountType === 'cross_margin' && ( - - )} +
- {row.stopLoss === undefined ? ( + {!row.stopLoss ? ( {NO_VALUE} ) : (
- +
)}
@@ -265,7 +219,10 @@ const PositionsTable: FC = () => { onClick={() => dispatch( setShowPositionModal({ - type: 'futures_close_position', + type: + row.market.version === 3 + ? 'cross_margin_close_position' + : 'smart_margin_close_position', marketKey: row.market.marketKey, }) ) @@ -276,7 +233,7 @@ const PositionsTable: FC = () => { Close - handleOpenShareModal(row.share)} size="small"> + handleOpenShareModal(row)} size="small"> @@ -291,7 +248,30 @@ const PositionsTable: FC = () => { )} ) -} +}) + +export const CrossMarginPostitionsTable = memo(() => { + const crossMarginPositions = useAppSelector(selectCrossMarginPositions) + + return +}) + +export const SmartMarginPostitionsTable = memo(() => { + const smartMarginPositions = useAppSelector(selectSmartMarginPositions) + + return +}) + +const SelectedPositionsTable = memo(() => { + const type = useAppSelector(selectFuturesType) + return type === FuturesMarginType.CROSS_MARGIN ? ( + + ) : ( + + ) +}) + +export default SelectedPositionsTable const TableContainer = styled.div` overflow: auto; @@ -350,5 +330,3 @@ const ColWithButton = styled.div` display: block; `} ` - -export default PositionsTable diff --git a/packages/app/src/sections/futures/UserInfo/UserInfo.tsx b/packages/app/src/sections/futures/UserInfo/UserInfo.tsx index 98eb1b9290..5ba867fdfb 100644 --- a/packages/app/src/sections/futures/UserInfo/UserInfo.tsx +++ b/packages/app/src/sections/futures/UserInfo/UserInfo.tsx @@ -1,9 +1,9 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' import { useRouter } from 'next/router' import React, { useMemo, useState, useCallback, useEffect, memo } from 'react' import styled from 'styled-components' import CalculatorIcon from 'assets/svg/futures/calculator-icon.svg' -import TransfersIcon from 'assets/svg/futures/deposit-withdraw-arrows.svg' import OpenPositionsIcon from 'assets/svg/futures/icon-open-positions.svg' import OrderHistoryIcon from 'assets/svg/futures/icon-order-history.svg' import PositionIcon from 'assets/svg/futures/icon-position.svg' @@ -12,22 +12,19 @@ import Spacer from 'components/Spacer' import { TabPanel } from 'components/Tab' import ROUTES from 'constants/routes' import useWindowSize from 'hooks/useWindowSize' -import { fetchAllTradesForAccount } from 'state/futures/actions' +import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' +import { selectActiveCrossMarginPositionsCount } from 'state/futures/crossMargin/selectors' +import { selectPosition, selectPendingOrdersCount } from 'state/futures/selectors' +import { fetchAllV2TradesForAccount } from 'state/futures/smartMargin/actions' import { selectActiveSmartPositionsCount, - selectActiveIsolatedPositionsCount, - selectFuturesType, - selectMarketAsset, - selectOpenDelayedOrders, - selectPosition, selectAllConditionalOrders, -} from 'state/futures/selectors' +} from 'state/futures/smartMargin/selectors' import { useAppSelector, useFetchAction, useAppDispatch } from 'state/hooks' import { selectWallet } from 'state/wallet/selectors' import ProfitCalculator from '../ProfitCalculator' import Trades from '../Trades' -import Transfers from '../Transfers' import ConditionalOrdersTable from './ConditionalOrdersTable' import OpenDelayedOrdersTable from './OpenDelayedOrdersTable' @@ -39,7 +36,6 @@ enum FuturesTab { CONDITIONAL_ORDERS = 'conditional_orders', TRADES = 'trades', CALCULATOR = 'calculator', - TRANSFERS = 'transfers', SHARE = 'share', } @@ -53,15 +49,15 @@ const UserInfo: React.FC = memo(() => { const marketAsset = useAppSelector(selectMarketAsset) const position = useAppSelector(selectPosition) const smartPositionsCount = useAppSelector(selectActiveSmartPositionsCount) - const isolatedPositionsCount = useAppSelector(selectActiveIsolatedPositionsCount) + const crossPositionsCount = useAppSelector(selectActiveCrossMarginPositionsCount) const walletAddress = useAppSelector(selectWallet) - const openOrders = useAppSelector(selectOpenDelayedOrders) + const pendingOrdersCount = useAppSelector(selectPendingOrdersCount) const conditionalOrders = useAppSelector(selectAllConditionalOrders) const accountType = useAppSelector(selectFuturesType) - useFetchAction(fetchAllTradesForAccount, { - dependencies: [walletAddress, accountType, position?.position?.size.toString()], + useFetchAction(fetchAllV2TradesForAccount, { + dependencies: [walletAddress, accountType, position?.size.toString()], disabled: !walletAddress, }) @@ -84,20 +80,23 @@ const UserInfo: React.FC = memo(() => { }, []) const refetchTrades = useCallback(() => { - dispatch(fetchAllTradesForAccount()) + dispatch(fetchAllV2TradesForAccount()) }, [dispatch]) useEffect(() => { refetchTrades() // eslint-disable-next-line react-hooks/exhaustive-deps - }, [position?.marketKey]) + }, [position?.market.marketKey]) const TABS = useMemo( () => [ { name: FuturesTab.POSITION, label: 'Positions', - badge: accountType === 'isolated_margin' ? isolatedPositionsCount : smartPositionsCount, + badge: + accountType === FuturesMarginType.CROSS_MARGIN + ? crossPositionsCount + : smartPositionsCount, active: activeTab === FuturesTab.POSITION, icon: , onClick: () => @@ -108,7 +107,7 @@ const UserInfo: React.FC = memo(() => { { name: FuturesTab.ORDERS, label: 'Pending', - badge: openOrders?.length, + badge: pendingOrdersCount, active: activeTab === FuturesTab.ORDERS, icon: , onClick: () => @@ -120,7 +119,7 @@ const UserInfo: React.FC = memo(() => { name: FuturesTab.CONDITIONAL_ORDERS, label: 'Orders', badge: conditionalOrders.length, - disabled: accountType === 'isolated_margin', + disabled: accountType === FuturesMarginType.CROSS_MARGIN, active: activeTab === FuturesTab.CONDITIONAL_ORDERS, icon: , onClick: () => @@ -139,26 +138,14 @@ const UserInfo: React.FC = memo(() => { scroll: false, }), }, - { - name: FuturesTab.TRANSFERS, - label: 'Transfers', - badge: undefined, - disabled: accountType === 'cross_margin', // leave this until we determine a disbaled state - active: activeTab === FuturesTab.TRANSFERS, - icon: , - onClick: () => - router.push(ROUTES.Markets.Transfers(marketAsset, accountType), undefined, { - scroll: false, - }), - }, ], [ activeTab, router, marketAsset, - openOrders?.length, + pendingOrdersCount, accountType, - isolatedPositionsCount, + crossPositionsCount, smartPositionsCount, conditionalOrders.length, ] @@ -209,9 +196,6 @@ const UserInfo: React.FC = memo(() => { - - - {openProfitCalcModal && } diff --git a/packages/app/src/sections/shared/Layout/AppLayout/Header/MobileUserMenu/MobileUserMenu.tsx b/packages/app/src/sections/shared/Layout/AppLayout/Header/MobileUserMenu/MobileUserMenu.tsx index e9cdc94640..db476189b2 100644 --- a/packages/app/src/sections/shared/Layout/AppLayout/Header/MobileUserMenu/MobileUserMenu.tsx +++ b/packages/app/src/sections/shared/Layout/AppLayout/Header/MobileUserMenu/MobileUserMenu.tsx @@ -12,7 +12,8 @@ import { DEFAULT_FUTURES_MARGIN_TYPE } from 'constants/defaults' import ROUTES from 'constants/routes' import { zIndex } from 'constants/ui' import { MOBILE_FOOTER_HEIGHT } from 'constants/ui' -import { setLeverageSide, setTradePanelDrawerOpen } from 'state/futures/reducer' +import { setTradePanelDrawerOpen } from 'state/futures/reducer' +import { setLeverageSide } from 'state/futures/smartMargin/reducer' import { useAppDispatch } from 'state/hooks' import { FixedFooterMixin } from 'styles/common' diff --git a/packages/app/src/sections/shared/Layout/AppLayout/Header/Nav.tsx b/packages/app/src/sections/shared/Layout/AppLayout/Header/Nav.tsx index e2d2eea177..7099f6e9c4 100644 --- a/packages/app/src/sections/shared/Layout/AppLayout/Header/Nav.tsx +++ b/packages/app/src/sections/shared/Layout/AppLayout/Header/Nav.tsx @@ -12,7 +12,7 @@ import LabelContainer from 'components/Nav/DropDownLabel' import Select from 'components/Select' import { DropdownIndicator, IndicatorSeparator } from 'components/Select' import Tooltip from 'components/Tooltip/Tooltip' -import { selectMarketAsset } from 'state/futures/selectors' +import { selectMarketAsset } from 'state/futures/common/selectors' import { useAppSelector } from 'state/hooks' import { linkCSS } from 'styles/common' import media from 'styles/media' @@ -37,7 +37,7 @@ const Nav: FC = memo(() => { const getLink = useCallback( (link: string) => { return link.indexOf('/market') === 0 - ? `/market/?accountType=cross_margin&asset=${marketAsset}` + ? `/market/?accountType=smart_margin&asset=${marketAsset}` : link }, [marketAsset] diff --git a/packages/app/src/sections/shared/Layout/AppLayout/Header/constants.tsx b/packages/app/src/sections/shared/Layout/AppLayout/Header/constants.tsx index 6516fbbd9a..75ef9e3e5f 100644 --- a/packages/app/src/sections/shared/Layout/AppLayout/Header/constants.tsx +++ b/packages/app/src/sections/shared/Layout/AppLayout/Header/constants.tsx @@ -1,3 +1,4 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' import { FunctionComponent } from 'react' import { COMPETITION_ENABLED } from 'constants/competition' @@ -29,7 +30,7 @@ export type MenuLinks = MenuLink[] export const HOMEPAGE_MENU_LINKS: MenuLinks = [ { i18nLabel: 'homepage.nav.markets', - link: ROUTES.Markets.Home('cross_margin'), + link: ROUTES.Markets.Home(FuturesMarginType.SMART_MARGIN), }, { i18nLabel: 'homepage.nav.stats', @@ -72,7 +73,7 @@ export const getMenuLinks = (isMobile: boolean): MenuLinks => [ }, { i18nLabel: 'header.nav.markets', - link: ROUTES.Markets.Home('cross_margin'), + link: ROUTES.Markets.Home(FuturesMarginType.SMART_MARGIN), }, { i18nLabel: 'header.nav.exchange', diff --git a/packages/app/src/state/__mocks__/sdk.ts b/packages/app/src/state/__mocks__/sdk.ts index 934a186acc..a7e8b495aa 100644 --- a/packages/app/src/state/__mocks__/sdk.ts +++ b/packages/app/src/state/__mocks__/sdk.ts @@ -1,5 +1,6 @@ import { wei } from '@synthetixio/wei' +import { mockTxResponse } from '../../../testing/unit/mocks/data/app' import { MOCK_TRADE_PREVIEW, SDK_MARKETS } from '../../../testing/unit/mocks/data/futures' export const mockSetProvider = () => Promise.resolve('10') @@ -7,9 +8,9 @@ export const mockSetSigner = () => Promise.resolve() export const mockSubmitCrossMarginOrder = jest.fn(() => ({ test: 'THE TX' })) export const mockFuturesService = () => ({ - getCrossMarginAccounts: () => ['0x7bCe4eF9d95129011528E502357C7772'], + getSmartMarginAccounts: () => ['0x7bCe4eF9d95129011528E502357C7772'], getPreviousDayPrices: () => [], - getCrossMarginTradePreview: () => { + getSmartMarginTradePreview: () => { return { ...MOCK_TRADE_PREVIEW } }, getFuturesPositions: () => [], @@ -18,8 +19,33 @@ export const mockFuturesService = () => ({ getConditionalOrders: () => [], getIsolatedMarginTransfers: () => [], getDelayedOrders: () => [], - getCrossMarginTransfers: () => [], - getCrossMarginBalanceInfo: () => ({ + getSmartMarginTransfers: () => [], + getSmartMarginBalanceInfo: () => ({ + freeMargin: wei('1000'), + keeperEthBal: wei('0.1'), + walletEthBal: wei('1'), + allowance: wei('1000'), + }), + getMarkets: () => { + return [...SDK_MARKETS] + }, + submitCrossMarginOrder: mockSubmitCrossMarginOrder, +}) + +export const mockPerpsService = () => ({ + getSmartMarginAccounts: () => ['0x7bCe4eF9d95129011528E502357C7772'], + getPreviousDayPrices: () => [], + getSmartMarginTradePreview: () => { + return { ...MOCK_TRADE_PREVIEW } + }, + getFuturesPositions: () => [], + getTradesForMarkets: () => [], + getAllTrades: () => [], + getConditionalOrders: () => [], + getIsolatedMarginTransfers: () => [], + getDelayedOrders: () => [], + getSmartMarginTransfers: () => [], + getSmartMarginBalanceInfo: () => ({ freeMargin: wei('1000'), keeperEthBal: wei('0.1'), walletEthBal: wei('1'), @@ -50,6 +76,13 @@ const mockSdk = { }), }, system: {}, + perpsV3: { + getMarkets: () => [], + getPerpsV3AccountIds: () => [100], + getAvailableMargin: () => wei(1000), + getPendingAsyncOrders: () => [], + createAccount: () => mockTxResponse('0x123'), + }, setProvider: mockSetProvider, setSigner: mockSetSigner, } diff --git a/packages/app/src/state/app/helpers.ts b/packages/app/src/state/app/helpers.ts index 6f156ee971..695da6ae89 100644 --- a/packages/app/src/state/app/helpers.ts +++ b/packages/app/src/state/app/helpers.ts @@ -1,5 +1,9 @@ -import { GasPrice } from '@kwenta/sdk/types' -import { BigNumber } from 'ethers' +import { GasPrice, TransactionStatus } from '@kwenta/sdk/types' +import { BigNumber, ethers } from 'ethers' + +import { AppDispatch } from 'state/store' + +import { updateTransactionHash, updateTransactionStatus } from './reducer' export const serializeGasPrice = (gasPrice: GasPrice): GasPrice => ({ baseFeePerGas: gasPrice.baseFeePerGas?.toString() ?? '0', @@ -14,3 +18,12 @@ export const unserializeGasPrice = (gasPrice: GasPrice): GasPrice => ({ maxFeePerGas: BigNumber.from(gasPrice.maxFeePerGas), gasPrice: BigNumber.from(gasPrice.gasPrice), }) + +export const monitorAndAwaitTransaction = async ( + dispatch: AppDispatch, + tx: ethers.providers.TransactionResponse +) => { + dispatch(updateTransactionHash(tx.hash)) + await tx.wait() + dispatch(updateTransactionStatus(TransactionStatus.Confirmed)) +} diff --git a/packages/app/src/state/app/types.ts b/packages/app/src/state/app/types.ts index 48409e1ced..836f7e4413 100644 --- a/packages/app/src/state/app/types.ts +++ b/packages/app/src/state/app/types.ts @@ -1,20 +1,21 @@ import { TransactionStatus, FuturesMarketKey, KwentaStatus, GasPrice } from '@kwenta/sdk/types' -import { FuturesTransactionType } from 'state/futures/types' +import { FuturesTransactionType } from 'state/futures/common/types' export type ModalType = - | 'futures_close_position_confirm' - | 'futures_cross_withdraw' - | 'futures_isolated_transfer' + | 'futures_deposit_withdraw_smart_margin' + | 'futures_deposit_withdraw_cross_margin' | 'futures_confirm_smart_margin_trade' - | 'futures_confirm_isolated_margin_trade' + | 'futures_confirm_cross_margin_trade' | 'futures_withdraw_keeper_balance' | 'futures_smart_margin_onboard' + | 'futures_cross_margin_onboard' | 'futures_smart_margin_socket' | null export type FuturesPositionModalType = - | 'futures_close_position' + | 'smart_margin_close_position' + | 'cross_margin_close_position' | 'futures_edit_position_margin' | 'futures_edit_position_size' | 'futures_edit_stop_loss_take_profit' diff --git a/packages/app/src/state/balances/actions.ts b/packages/app/src/state/balances/actions.ts index 4315368e75..bbde04cbf7 100644 --- a/packages/app/src/state/balances/actions.ts +++ b/packages/app/src/state/balances/actions.ts @@ -1,7 +1,9 @@ +import { SynthV3BalancesAndAllowances } from '@kwenta/sdk/types' import { createAsyncThunk } from '@reduxjs/toolkit' +import { notifyError } from 'components/ErrorNotifier' import type { ThunkConfig } from 'state/store' -import { serializeBalances } from 'utils/balances' +import { serializeBalances, serializeV3Balances } from 'utils/balances' import { ZERO_BALANCES } from './reducer' import { BalancesActionReturn } from './types' @@ -19,3 +21,19 @@ export const fetchBalances = createAsyncThunk, void return serializeBalances(balancesMap, totalUSDBalance, tokenBalances, susdWalletBalance) } ) + +export const fetchV3BalancesAndAllowances = createAsyncThunk< + Partial> | undefined, + string[], + ThunkConfig +>('balances/fetchV3BalancesAndAllowances', async (spenders, { getState, extra: { sdk } }) => { + const { wallet } = getState() + try { + if (!wallet.walletAddress) return + const res = await sdk.synths.getSynthV3BalancesAndAllowances(wallet.walletAddress, spenders) + return serializeV3Balances(res) + } catch (e) { + notifyError('Error fetching v3 balances', e) + throw e + } +}) diff --git a/packages/app/src/state/balances/reducer.ts b/packages/app/src/state/balances/reducer.ts index 754e70f2ce..bd49c3c57a 100644 --- a/packages/app/src/state/balances/reducer.ts +++ b/packages/app/src/state/balances/reducer.ts @@ -1,8 +1,9 @@ +import { SynthV3Asset } from '@kwenta/sdk/types' import { createSlice } from '@reduxjs/toolkit' import { FetchStatus } from 'state/types' -import { fetchBalances } from './actions' +import { fetchBalances, fetchV3BalancesAndAllowances } from './actions' import { BalancesState } from './types' export const ZERO_BALANCES = { @@ -11,6 +12,7 @@ export const ZERO_BALANCES = { totalUSDBalance: '0', susdWalletBalance: '0', tokenBalances: {}, + synthV3Balances: {}, } export const BALANCES_INITIAL_STATE: BalancesState = { @@ -46,6 +48,23 @@ const balancesSlice = createSlice({ builder.addCase(fetchBalances.rejected, (state) => { state.status = FetchStatus.Error }) + + builder.addCase(fetchV3BalancesAndAllowances.fulfilled, (state, action) => { + if (action.payload) { + Object.keys(action.payload).forEach((asset) => { + const assetKey = asset as SynthV3Asset + if (state.synthV3Balances[assetKey]) { + state.synthV3Balances[assetKey].balance = action.payload![assetKey]!.balance + state.synthV3Balances[assetKey].allowances = action.payload![assetKey]!.allowances + } else { + state.synthV3Balances[assetKey] = { + balance: action.payload![assetKey]!.balance, + allowances: action.payload![assetKey]!.allowances, + } + } + }) + } + }) }, }) diff --git a/packages/app/src/state/balances/selectors.ts b/packages/app/src/state/balances/selectors.ts index 8de2b53df7..48ecbe482c 100644 --- a/packages/app/src/state/balances/selectors.ts +++ b/packages/app/src/state/balances/selectors.ts @@ -1,9 +1,10 @@ import { toWei } from '@kwenta/sdk/utils' import { createSelector } from '@reduxjs/toolkit' +import { wei } from '@synthetixio/wei' import type { RootState } from 'state/store' import { FetchStatus } from 'state/types' -import { unserializeBalances } from 'utils/balances' +import { unserializeBalances, unserializeV3Balances } from 'utils/balances' export const selectBalancesFetchStatus = (state: RootState) => state.balances.status @@ -33,3 +34,13 @@ export const selectBalances = createSelector( ) } ) + +export const selectSynthV3Balances = createSelector( + (state: RootState) => state.balances.synthV3Balances, + (synthV3Balances) => unserializeV3Balances(synthV3Balances) +) + +export const selectSNXUSDBalance = createSelector( + selectSynthV3Balances, + (synthV3Balances) => synthV3Balances.SNXUSD?.balance ?? wei('0') +) diff --git a/packages/app/src/state/balances/types.ts b/packages/app/src/state/balances/types.ts index 886152d500..75da28a0f7 100644 --- a/packages/app/src/state/balances/types.ts +++ b/packages/app/src/state/balances/types.ts @@ -1,8 +1,10 @@ -import { SynthBalance, TokenBalances } from '@kwenta/sdk/types' +import { SynthBalance, SynthV3BalancesAndAllowances, TokenBalances } from '@kwenta/sdk/types' import Wei from '@synthetixio/wei' import { FetchStatus } from 'state/types' +// TODO: Separate balances by network and wallet + export type BalancesState = { status: FetchStatus error: string | undefined @@ -11,6 +13,7 @@ export type BalancesState = { totalUSDBalance?: string susdWalletBalance?: string tokenBalances: TokenBalances + synthV3Balances: Partial> } export type BalancesActionReturn = { diff --git a/packages/app/src/state/constants.ts b/packages/app/src/state/constants.ts index 4e5b7e38cc..264164e0cc 100644 --- a/packages/app/src/state/constants.ts +++ b/packages/app/src/state/constants.ts @@ -19,7 +19,7 @@ export const ZERO_STATE_ISOLATED_ACCOUNT = { positionHistory: [], } -export const ZERO_STATE_CM_ACCOUNT = { +export const ZERO_STATE_ACCOUNT = { position: undefined, balanceInfo: { freeMargin: '0', @@ -35,6 +35,13 @@ export const ZERO_STATE_CM_ACCOUNT = { positionHistory: [], } +export const ZERO_STATE_CM_ACCOUNT = { + ...ZERO_STATE_ACCOUNT, + balances: {}, + availableMargin: '0', + asyncOrders: [], +} + export const DEFAULT_QUERY_STATUS = { status: FetchStatus.Idle, error: null, @@ -54,3 +61,5 @@ export const DEFAULT_MAP_BY_NETWORK = { 420: {}, 10: {}, } + +export const EST_KEEPER_GAS_FEE = 0.002 diff --git a/packages/app/src/state/exchange/actions.ts b/packages/app/src/state/exchange/actions.ts index b5f17430ea..cab66ee483 100644 --- a/packages/app/src/state/exchange/actions.ts +++ b/packages/app/src/state/exchange/actions.ts @@ -33,10 +33,7 @@ export const fetchTransactionFee = createAsyncThunk< const insufficientBalance = selectInsufficientBalance(state) if (!isApproved || insufficientBalance) { - return { - transactionFee: '0', - feeCost: '0', - } + return { transactionFee: '0', feeCost: '0' } } if (baseCurrencyKey && quoteCurrencyKey) { @@ -144,7 +141,7 @@ export const resetCurrencyKeys = createAsyncThunk( if (walletAddress) { if (quoteCurrencyKey && baseCurrencyKey) { - txProvider = sdk.exchange.getTxProvider(baseCurrencyKey, quoteCurrencyKey) + txProvider = sdk.exchange.getTxProvider(quoteCurrencyKey, baseCurrencyKey) // TODO: We should not have to do this. // But we need the coingecko prices to generate the rates. @@ -154,8 +151,8 @@ export const resetCurrencyKeys = createAsyncThunk( ) ;[baseFeeRate, rate, exchangeFeeRate, quotePriceRate, basePriceRate] = await Promise.all([ - sdk.exchange.getBaseFeeRate(baseCurrencyKey, quoteCurrencyKey), - sdk.exchange.getRate(baseCurrencyKey, quoteCurrencyKey), + sdk.exchange.getBaseFeeRate(quoteCurrencyKey, baseCurrencyKey), + sdk.exchange.getRate(quoteCurrencyKey, baseCurrencyKey), sdk.exchange.getExchangeFeeRate(quoteCurrencyKey, baseCurrencyKey), sdk.exchange.getPriceRate(quoteCurrencyKey, txProvider, coinGeckoPrices), sdk.exchange.getPriceRate(baseCurrencyKey, txProvider, coinGeckoPrices), diff --git a/packages/app/src/state/futures/__tests__/actions.test.ts b/packages/app/src/state/futures/__tests__/actions.test.ts new file mode 100644 index 0000000000..a6c96af896 --- /dev/null +++ b/packages/app/src/state/futures/__tests__/actions.test.ts @@ -0,0 +1,109 @@ +import { FuturesMarketKey } from '@kwenta/sdk/types' +import { wei } from '@synthetixio/wei' + +import { setupStore } from 'state/store' + +import { + mockConditionalOrders, + mockSmartMarginAccount, + preloadedStateWithSmartMarginAccount, +} from '../../../../testing/unit/mocks/data/futures' +import sdk from '../../sdk' +import { PreviewAction } from '../common/types' +import { + calculateSmartMarginFees, + fetchMarketsV2, + fetchSmartMarginOpenOrders, +} from '../smartMargin/actions' + +jest.mock('../../sdk') + +describe('Futures actions - keeper deposits', () => { + test('calculates correct ETH deposit when users has no existing balance', async () => { + const mockAccount = mockSmartMarginAccount('1000', '0') + const store = setupStore(preloadedStateWithSmartMarginAccount(mockAccount)) + await store.dispatch(fetchMarketsV2()) + + const orderParams = { + market: { + key: FuturesMarketKey.sETHPERP, + address: '0x123', + }, + orderPrice: wei(2000), + sizeDelta: wei(10), + marginDelta: wei(1000), + action: 'trade' as PreviewAction, + } + store.dispatch(calculateSmartMarginFees(orderParams)) + expect(Number(store.getState().smartMargin.fees.keeperEthDeposit)).toEqual(0.01) + }) + + test('calculates correct ETH deposit for single order', async () => { + sdk.futures.getConditionalOrders = () => Promise.resolve(mockConditionalOrders()) + + const mockAccount = mockSmartMarginAccount('1000', '0.004') + const store = setupStore(preloadedStateWithSmartMarginAccount(mockAccount)) + await store.dispatch(fetchMarketsV2()) + await store.dispatch(fetchSmartMarginOpenOrders()) + + const orderParams = { + market: { + key: FuturesMarketKey.sETHPERP, + address: '0x123', + }, + orderPrice: wei(2000), + sizeDelta: wei(10), + marginDelta: wei(1000), + action: 'trade' as PreviewAction, + } + store.dispatch(calculateSmartMarginFees(orderParams)) + + // There are seven orders but we only need to cover 5 because a combined SL / TP would count as one. + expect(Number(store.getState().smartMargin.fees.keeperEthDeposit)).toEqual(0.006) + }) + + test('calculates correct ETH deposit for new conditional order and SL / TP', async () => { + sdk.futures.getConditionalOrders = () => Promise.resolve(mockConditionalOrders()) + + const mockAccount = mockSmartMarginAccount('1000', '0.01') + const store = setupStore(preloadedStateWithSmartMarginAccount(mockAccount)) + await store.dispatch(fetchMarketsV2()) + await store.dispatch(fetchSmartMarginOpenOrders()) + + const orderParams = { + market: { + key: FuturesMarketKey.sETHPERP, + address: '0x123', + }, + orderPrice: wei(2000), + sizeDelta: wei(10), + marginDelta: wei(1000), + isConditional: true, + hasStopOrTakeProfit: true, + action: 'trade' as PreviewAction, + } + store.dispatch(calculateSmartMarginFees(orderParams)) + + // There are seven orders but we only need to cover 5 because a combined SL / TP would count as one. + expect(Number(store.getState().smartMargin.fees.keeperEthDeposit)).toEqual(0.004) + }) + + test('requires no deposit when balance is enough', async () => { + const mockAccount = mockSmartMarginAccount('1000', '0.01') + const store = setupStore(preloadedStateWithSmartMarginAccount(mockAccount)) + await store.dispatch(fetchMarketsV2()) + + const orderParams = { + market: { + key: FuturesMarketKey.sETHPERP, + address: '0x123', + }, + orderPrice: wei(2000), + sizeDelta: wei(10), + marginDelta: wei(1000), + action: 'trade' as PreviewAction, + } + store.dispatch(calculateSmartMarginFees(orderParams)) + expect(Number(store.getState().smartMargin.fees.keeperEthDeposit)).toEqual(0) + }) +}) diff --git a/packages/app/src/state/futures/actions.ts b/packages/app/src/state/futures/actions.ts index ade3f4755f..1ea6ea4708 100644 --- a/packages/app/src/state/futures/actions.ts +++ b/packages/app/src/state/futures/actions.ts @@ -1,1023 +1,111 @@ -import KwentaSDK from '@kwenta/sdk' +import { PERIOD_IN_SECONDS, Period } from '@kwenta/sdk/constants' import { - DEFAULT_PRICE_IMPACT_DELTA_PERCENT, - ORDER_KEEPER_ETH_DEPOSIT, - PERIOD_IN_SECONDS, - Period, - SL_TP_MAX_SIZE, - ZERO_ADDRESS, - ZERO_WEI, -} from '@kwenta/sdk/constants' -import { - DelayedOrder, - FuturesAccountType, - FuturesMarket, - ConditionalOrder, - FuturesPosition, FuturesPositionHistory, - FuturesPotentialTradeDetails, - FuturesTrade, - FuturesVolumes, - MarginTransfer, - PositionSide, - PotentialTradeStatus, - SmartMarginOrderInputs, - ConditionalOrderTypeEnum, - SLTPOrderInputs, - FuturesMarketKey, - ContractOrderType, FuturesMarketAsset, NetworkId, TransactionStatus, + FuturesMarginType, } from '@kwenta/sdk/types' -import { - calculateDesiredFillPrice, - getTradeStatusMessage, - serializePotentialTrade, - marketOverrides, - floorNumber, - stripZeros, - getTransactionPrice, -} from '@kwenta/sdk/utils' import { createAsyncThunk } from '@reduxjs/toolkit' -import Wei, { wei } from '@synthetixio/wei' -import { BigNumber, ethers } from 'ethers' -import { debounce } from 'lodash' import { notifyError } from 'components/ErrorNotifier' -import { unserializeGasPrice } from 'state/app/helpers' -import { - handleTransactionError, - setOpenModal, - setShowPositionModal, - setTransaction, - updateTransactionHash, - updateTransactionStatus, -} from 'state/app/reducer' -import { fetchBalances } from 'state/balances/actions' +import { monitorAndAwaitTransaction } from 'state/app/helpers' +import { handleTransactionError, setTransaction } from 'state/app/reducer' import { ZERO_CM_FEES, ZERO_STATE_TRADE_INPUTS } from 'state/constants' -import { serializeWeiObject } from 'state/helpers' -import { selectLatestEthPrice } from 'state/prices/selectors' -import { AppDispatch, AppThunk, RootState } from 'state/store' -import { ThunkConfig } from 'state/types' -import { selectNetwork, selectWallet } from 'state/wallet/selectors' -import { computeDelayedOrderFee } from 'utils/costCalculations' import { - formatDelayedOrders, - orderPriceInvalidLabel, - serializeCmBalanceInfo, - serializeDelayedOrders, - serializeConditionalOrders, - serializeFuturesVolumes, - serializeMarkets, - serializePositionHistory, - serializeTrades, -} from 'utils/futures' -import logError from 'utils/logError' -import { refetchWithComparator } from 'utils/queries' + editCrossMarginTradeSize, + fetchV3Markets, + fetchPositionHistoryV3, +} from 'state/futures/crossMargin/actions' +import { AppThunk } from 'state/store' +import { ThunkConfig } from 'state/types' +import { selectNetwork } from 'state/wallet/selectors' +import { serializePositionHistory } from 'utils/futures' +import { selectFuturesType } from './common/selectors' +import { selectFuturesAccount } from './selectors' import { - handlePreviewError, - setCrossMarginAccount, - setCrossMarginFees, - setCrossMarginLeverageForAsset, - setCrossMarginMarginDelta, - setCrossMarginOrderCancelling, - setCrossMarginOrderPrice, - setCrossMarginOrderPriceInvalidLabel, - setCrossMarginTradeInputs, - setCrossMarginTradePreview, - setIsolatedMarginFee, - setLeverageInput, - setIsolatedMarginTradeInputs, - setIsolatedTradePreview, - setLeverageSide, - setTransactionEstimate, - setCrossMarginEditPositionInputs, - setIsolatedMarginEditPositionInputs, - incrementIsolatedPreviewCount, - incrementCrossPreviewCount, - setClosePositionSizeDelta, - setClosePositionPrice, - clearAllTradePreviews, - setKeeperDeposit, -} from './reducer' + editSmartMarginTradeSize, + fetchDailyVolumesV2, + fetchMarginTransfersV2, + fetchMarketsV2, + fetchPositionHistoryV2, + fetchSmartMarginOpenOrders, +} from './smartMargin/actions' import { - selectCrossMarginAccount, - selectCrossMarginMarginDelta, - selectCrossMarginOrderPrice, - selectCrossMarginTradeInputs, - selectFuturesAccount, - selectFuturesSupportedNetwork, - selectFuturesType, - selectIsConditionalOrder, - selectIsolatedMarginTradeInputs, - selectKeeperEthBalance, - selectLeverageSide, - selectMarketAsset, - selectMarketInfo, - selectMarketKey, - selectMarkets, - selectOrderType, - selectOrderFeeCap, - selectPosition, - selectTradeSizeInputs, - selectIdleMargin, - selectSlTpTradeInputs, - selectCrossMarginEditPosInputs, - selectCrossPreviewCount, - selectTradePreview, - selectClosePositionOrderInputs, - selectFuturesPositions, - selectEditPositionModalInfo, - selectOpenDelayedOrders, - selectSlTpModalInputs, - selectSmartMarginKeeperDeposit, - selectSkewAdjustedPrice, - selectEditPositionPreview, - selectClosePositionPreview, - selectMarketIndexPrice, -} from './selectors' + setSmartMarginLeverageInput, + setSmartMarginFees, + setSmartMarginMarginDelta, + clearSmartMarginTradePreviews, + setSmartMarginTradeInputs, + setSmartMarginEditPositionInputs, +} from './smartMargin/reducer' import { - AccountContext, - CancelDelayedOrderInputs, - CrossMarginBalanceInfo, - DebouncedPreviewParams, - DelayedOrderWithDetails, - ExecuteDelayedOrderInputs, - FuturesTransactionType, - PreviewAction, - TradePreviewParams, -} from './types' - -export const fetchMarkets = createAsyncThunk< - { markets: FuturesMarket[]; networkId: NetworkId } | undefined, - void, - ThunkConfig ->('futures/fetchMarkets', async (_, { getState, extra: { sdk } }) => { - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const networkId = selectNetwork(getState()) - - if (!supportedNetwork) return - try { - const markets = await sdk.futures.getMarkets() - // apply overrides - const overrideMarkets = markets.map((m) => { - return marketOverrides[m.marketKey] - ? { - ...m, - ...marketOverrides[m.marketKey], - } - : m - }) - - const serializedMarkets = serializeMarkets(overrideMarkets) - return { markets: serializedMarkets, networkId } - } catch (err) { - logError(err) - notifyError('Failed to fetch markets', err) - throw err - } -}) - -export const fetchCrossMarginBalanceInfo = createAsyncThunk< - { balanceInfo: CrossMarginBalanceInfo; account: string; network: NetworkId } | undefined, - void, - ThunkConfig ->( - 'futures/fetchCrossMarginBalanceInfo', - async (_, { getState, extra: { sdk }, rejectWithValue }) => { - const account = selectCrossMarginAccount(getState()) - const network = selectNetwork(getState()) - const wallet = selectWallet(getState()) - const crossMarginSupported = selectFuturesSupportedNetwork(getState()) - if (!account || !wallet || !crossMarginSupported) return - try { - const balanceInfo = await sdk.futures.getCrossMarginBalanceInfo(wallet, account) - return { balanceInfo: serializeCmBalanceInfo(balanceInfo), account, network } - } catch (err) { - logError(err) - notifyError('Failed to fetch cross-margin balance info', err) - rejectWithValue(err.message) - return undefined + selectSmartMarginAccount, + selectSmartMarginSupportedNetwork, +} from './smartMargin/selectors' + +export const fetchMarkets = createAsyncThunk( + 'futures/fetchMarkets', + async (_, { dispatch, getState }) => { + if (getState().futures.selectedType === FuturesMarginType.SMART_MARGIN) { + dispatch(fetchMarketsV2()) + } else { + dispatch(fetchV3Markets()) } } ) -export const fetchCrossMarginPositions = createAsyncThunk< - { positions: FuturesPosition[]; account: string; network: NetworkId } | undefined, - void, - ThunkConfig ->('futures/fetchCrossMarginPositions', async (_, { getState, extra: { sdk } }) => { - const account = selectCrossMarginAccount(getState()) - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - const markets = selectMarkets(getState()) - - if (!account || !supportedNetwork) return - try { - const positions = await sdk.futures.getFuturesPositions( - account, - markets.map((m) => ({ asset: m.asset, marketKey: m.marketKey, address: m.market })) - ) - const serializedPositions = positions.map( - (p) => serializeWeiObject(p) as FuturesPosition - ) - return { positions: serializedPositions, account, network } - } catch (err) { - logError(err) - notifyError('Failed to fetch smart-margin positions', err) - throw err - } -}) - -export const fetchIsolatedMarginPositions = createAsyncThunk< - { positions: FuturesPosition[]; wallet: string; network: NetworkId } | undefined, - void, - ThunkConfig ->('futures/fetchIsolatedMarginPositions', async (_, { getState, extra: { sdk } }) => { - const { wallet } = getState() - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - const markets = selectMarkets(getState()) - - if (!wallet.walletAddress || !supportedNetwork) return - try { - const positions = await sdk.futures.getFuturesPositions( - wallet.walletAddress, - markets.map((m) => ({ asset: m.asset, marketKey: m.marketKey, address: m.market })) - ) - return { - positions: positions.map((p) => serializeWeiObject(p) as FuturesPosition), - wallet: wallet.walletAddress, - network: network, - } - } catch (err) { - logError(err) - notifyError('Failed to fetch isolated margin positions', err) - throw err - } -}) - -export const refetchPosition = createAsyncThunk< - { - position: FuturesPosition - wallet: string - futuresType: FuturesAccountType - networkId: NetworkId - } | null, - FuturesAccountType, - ThunkConfig ->('futures/refetchPosition', async (type, { getState, extra: { sdk } }) => { - const account = selectFuturesAccount(getState()) - if (!account) throw new Error('No wallet connected') - const marketInfo = selectMarketInfo(getState()) - const networkId = selectNetwork(getState()) - const position = selectPosition(getState()) - if (!marketInfo || !position) throw new Error('Market or position not found') - - const result = await refetchWithComparator( - () => - sdk.futures.getFuturesPositions(account!, [ - { asset: marketInfo.asset, marketKey: marketInfo.marketKey, address: marketInfo.market }, - ]), - position?.remainingMargin?.toString(), - (existing, next) => { - return existing === next[0]?.remainingMargin.toString() - } - ) - - if (result.data[0]) { - const serialized = serializeWeiObject( - result.data[0] as FuturesPosition - ) as FuturesPosition - return { position: serialized, wallet: account, futuresType: type, networkId } - } - return null -}) - -export const fetchCrossMarginAccount = createAsyncThunk< - { account: string; wallet: string; network: NetworkId } | undefined, - void, - ThunkConfig ->('futures/fetchCrossMarginAccount', async (_, { getState, extra: { sdk }, rejectWithValue }) => { - const wallet = selectWallet(getState()) - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - if (!wallet || !supportedNetwork) return undefined - const accounts = getState().futures.crossMargin.accounts - - // Already have an accoutn fetched and persisted for this address - if (accounts[network]?.[wallet]?.account) return - - try { - const accounts = await sdk.futures.getCrossMarginAccounts(wallet) - const account = accounts[0] - if (account) return { account, wallet, network } - return undefined - } catch (err) { - notifyError('Failed to fetch smart margin account', err) - rejectWithValue(err.message) - } -}) - -export const fetchDailyVolumes = createAsyncThunk, void, ThunkConfig>( +export const fetchDailyVolumes = createAsyncThunk( 'futures/fetchDailyVolumes', - async (_, { extra: { sdk } }) => { - const volumes = await sdk.futures.getDailyVolumes() - return serializeFuturesVolumes(volumes) - } -) - -export const fetchMarginTransfers = createAsyncThunk< - | { - marginTransfers: MarginTransfer[] - idleTransfers: MarginTransfer[] - context: AccountContext - } - | undefined, - void, - ThunkConfig ->('futures/fetchMarginTransfers', async (_, { getState, extra: { sdk } }) => { - const { wallet, futures } = getState() - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - const cmAccount = selectCrossMarginAccount(getState()) - if (!wallet.walletAddress || !supportedNetwork) return - try { - const transfers = - futures.selectedType === 'cross_margin' - ? await sdk.futures.getIsolatedMarginTransfers(cmAccount) - : await sdk.futures.getIsolatedMarginTransfers() - - const idleTransfers = - futures.selectedType === 'cross_margin' - ? await sdk.futures.getCrossMarginTransfers(cmAccount) - : [] - - return { - marginTransfers: transfers, - idleTransfers: idleTransfers, - context: { - wallet: wallet.walletAddress, - network: network, - type: futures.selectedType, - cmAccount, - }, - } - } catch (err) { - logError(err) - notifyError('Failed to fetch margin transfers', err) - throw err - } -}) - -export const fetchCombinedMarginTransfers = createAsyncThunk< - | { - isolatedMarginTransfers: MarginTransfer[] - smartMarginTransfers: MarginTransfer[] - idleTransfers: MarginTransfer[] - context: AccountContext - } - | undefined, - void, - ThunkConfig ->('futures/fetchCombinedMarginTransfers', async (_, { getState, extra: { sdk } }) => { - const { wallet, futures } = getState() - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - const cmAccount = selectCrossMarginAccount(getState()) - if (!wallet.walletAddress || !supportedNetwork) return - try { - const isolatedMarginTransfers = await sdk.futures.getIsolatedMarginTransfers() - const smartMarginTransfers = cmAccount - ? await sdk.futures.getIsolatedMarginTransfers(cmAccount) - : [] - const idleTransfers = cmAccount ? await sdk.futures.getCrossMarginTransfers(cmAccount) : [] - - return { - isolatedMarginTransfers, - smartMarginTransfers, - idleTransfers, - context: { - wallet: wallet.walletAddress, - network: network, - type: futures.selectedType, - cmAccount, - }, - } - } catch (err) { - logError(err) - notifyError('Failed to fetch combined margin transfers', err) - throw err - } -}) - -export const fetchCrossMarginAccountData = createAsyncThunk( - 'futures/fetchCrossMarginAccountData', - async (_, { dispatch }) => { - dispatch(fetchCrossMarginPositions()) - dispatch(fetchCrossMarginBalanceInfo()) - } -) - -export const fetchIsolatedMarginAccountData = createAsyncThunk( - 'futures/fetchIsolatedMarginAccountData', async (_, { dispatch }) => { - dispatch(fetchIsolatedMarginPositions()) + // TODO: Fetch v3 daily volumes + dispatch(fetchDailyVolumesV2()) } ) -export const fetchSharedFuturesData = createAsyncThunk( - 'futures/fetchSharedFuturesData', +export const fetchMarginTransfers = createAsyncThunk( + 'futures/fetchMarginTransfers', async (_, { dispatch }) => { - await dispatch(fetchMarkets()) - dispatch(fetchDailyVolumes()) - } -) - -export const fetchIsolatedOpenOrders = createAsyncThunk< - { orders: DelayedOrderWithDetails[]; wallet: string; networkId: NetworkId } | undefined, - void, - ThunkConfig ->('futures/fetchIsolatedOpenOrders', async (_, { dispatch, getState, extra: { sdk } }) => { - const wallet = selectWallet(getState()) - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - const markets = selectMarkets(getState()) - const existingOrders = selectOpenDelayedOrders(getState()) - if (!wallet || !supportedNetwork || !markets.length) return - - const marketAddresses = markets.map((market) => market.market) - - const orders: DelayedOrder[] = await sdk.futures.getDelayedOrders(wallet, marketAddresses) - const nonzeroOrders = formatDelayedOrders(orders, markets) - const orderDropped = existingOrders.length > nonzeroOrders.length - if (orderDropped) { - dispatch(fetchIsolatedMarginPositions()) - } - - return { - networkId: network, - orders: serializeDelayedOrders(nonzeroOrders), - wallet: wallet, - } -}) - -export const fetchCrossMarginOpenOrders = createAsyncThunk< - | { - conditionalOrders: ConditionalOrder[] - delayedOrders: DelayedOrderWithDetails[] - account: string - network: NetworkId - } - | undefined, - void, - ThunkConfig ->('futures/fetchCrossMarginOpenOrders', async (_, { dispatch, getState, extra: { sdk } }) => { - const account = selectCrossMarginAccount(getState()) - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - const markets = selectMarkets(getState()) - const existingOrders = selectOpenDelayedOrders(getState()) - - const marketAddresses = markets.map((market) => market.market) - - if (!account || !supportedNetwork) return - try { - const orders = await sdk.futures.getConditionalOrders(account) - const delayedOrders = await sdk.futures.getDelayedOrders(account, marketAddresses) - const nonzeroOrders = formatDelayedOrders(delayedOrders, markets) - - const orderDropped = existingOrders.length > nonzeroOrders.length - if (orderDropped) { - dispatch(fetchCrossMarginPositions()) - } - - return { - account, - network, - delayedOrders: serializeDelayedOrders(nonzeroOrders), - conditionalOrders: serializeConditionalOrders(orders), - } - } catch (err) { - notifyError('Failed to fetch open orders', err) - logError(err) - throw err - } -}) - -export const fetchIsolatedMarginTradePreview = createAsyncThunk< - { preview: FuturesPotentialTradeDetails | null; type: PreviewAction }, - DebouncedPreviewParams, - ThunkConfig ->( - 'futures/fetchIsolatedMarginTradePreview', - async (params, { dispatch, getState, extra: { sdk } }) => { - const account = selectFuturesAccount(getState()) - const markets = selectMarkets(getState()) - - const market = markets.find((m) => m.marketKey === params.market.key) - - try { - const orderTypeNum = ContractOrderType.DELAYED_OFFCHAIN - if (!market) throw new Error('No market data provided for preview') - if (!account) throw new Error('No account to generate preview') - if (!params.orderPrice) throw new Error('No price provided for preview') - const leverageSide = selectLeverageSide(getState()) - - const preview = await sdk.futures.getIsolatedTradePreview( - params.market.address, - params.market.key, - orderTypeNum, - { - sizeDelta: params.sizeDelta, - price: params.orderPrice, - leverageSide, - } - ) - - const serializedPreview = serializePotentialTrade({ - ...preview, - marketKey: params.market.key, - }) - return { preview: serializedPreview, type: params.action } - } catch (err) { - logError(err) - notifyError('Failed to generate trade preview', err) - dispatch(handlePreviewError({ error: err.message, previewType: params.action })) - throw err - } - } -) - -export const fetchCrossMarginTradePreview = createAsyncThunk< - { preview: FuturesPotentialTradeDetails | null; type: PreviewAction }, - DebouncedPreviewParams, - ThunkConfig ->( - 'futures/fetchCrossMarginTradePreview', - async (params, { dispatch, getState, extra: { sdk } }) => { - const account = selectFuturesAccount(getState()) - const freeMargin = selectIdleMargin(getState()) - const positions = selectFuturesPositions(getState()) - const position = positions.find((p) => p.marketKey === params.market.key) - - const marketMargin = position?.remainingMargin ?? wei(0) - - if ( - // Require both size and margin for a trade - (params.action === 'trade' && (params.sizeDelta.eq(0) || params.marginDelta.eq(0))) || - // Require one or the other when editing a position - (params.sizeDelta.eq(0) && params.marginDelta.eq(0)) - ) { - return { preview: null, type: params.action } - } - - // If this is a trade with no existsing position size then we need to subtract - // remaining idle market margin to get an accurate preview - const marginDelta = - (!position?.position || position?.position?.size.abs().eq(0)) && - marketMargin.gt(0) && - params.action === 'trade' - ? params.marginDelta.sub(marketMargin) - : params.marginDelta - - try { - const leverageSide = selectLeverageSide(getState()) - const preview = await sdk.futures.getCrossMarginTradePreview( - account || ZERO_ADDRESS, - params.market.key, - params.market.address, - { ...params, leverageSide, marginDelta } - ) - - // Check the preview hasn't been cleared before query resolves - const count = selectCrossPreviewCount(getState()) - if (count !== params.debounceCount) { - const existing = selectTradePreview(getState()) - const returnPreview = existing ? serializePotentialTrade(existing) : null - return { preview: returnPreview, type: params.action } - } - - if (params.marginDelta.gt(freeMargin) && preview.status === 0) { - // Show insufficient margin message - preview.status = PotentialTradeStatus.INSUFFICIENT_FREE_MARGIN - preview.statusMessage = getTradeStatusMessage(PotentialTradeStatus.INSUFFICIENT_FREE_MARGIN) - preview.showStatus = true - } - - const serializedPreview = serializePotentialTrade({ - ...preview, - marketKey: params.market.key, - }) - return { preview: serializedPreview, type: params.action } - } catch (err) { - logError(err) - notifyError('Failed to generate trade preview', err) - dispatch( - handlePreviewError({ - error: err.message, - previewType: params.action, - }) - ) - return { preview: null, type: params.action } - } + // TODO: Conditionally fetch cross / smart + dispatch(fetchMarginTransfersV2()) } ) export const clearTradeInputs = createAsyncThunk( 'futures/clearTradeInputs', async (_, { dispatch }) => { - dispatch(setCrossMarginMarginDelta('')) - dispatch(setCrossMarginFees(ZERO_CM_FEES)) - dispatch(setIsolatedMarginFee('0')) - dispatch(setLeverageInput('')) - dispatch(clearAllTradePreviews()) - dispatch(setCrossMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) - dispatch(setIsolatedMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) - dispatch(setCrossMarginEditPositionInputs({ nativeSizeDelta: '', marginDelta: '' })) - dispatch(setIsolatedMarginEditPositionInputs({ nativeSizeDelta: '', marginDelta: '' })) - } -) - -export const editCrossMarginTradeMarginDelta = - (marginDelta: string): AppThunk => - (dispatch, getState) => { - const orderPrice = selectMarketIndexPrice(getState()) - const marketInfo = selectMarketInfo(getState()) - const { susdSize, nativeSizeDelta } = selectCrossMarginTradeInputs(getState()) - - if (!marketInfo) throw new Error('No market selected') - - if (!marginDelta || Number(marginDelta) === 0) { - dispatch(setCrossMarginMarginDelta(marginDelta)) - dispatch(setCrossMarginTradePreview({ preview: null, type: 'trade' })) - return - } - - const marginDelatWei = wei(marginDelta) - const leverage = wei(susdSize).div(marginDelatWei.abs()) - - dispatch(setCrossMarginMarginDelta(marginDelta)) - if (!leverage.eq(0)) { - dispatch(setLeverageInput(leverage.toString(2))) - } - - dispatch( - stageCrossMarginTradePreview({ - market: { key: marketInfo.marketKey, address: marketInfo.market }, - orderPrice, - marginDelta: wei(marginDelta || 0), - sizeDelta: nativeSizeDelta, - action: 'trade', - }) - ) - } - -export const editCrossMarginTradeSize = - (size: string, currencyType: 'usd' | 'native'): AppThunk => - (dispatch, getState) => { - const indexPrice = selectMarketIndexPrice(getState()) - const marginDelta = selectCrossMarginMarginDelta(getState()) - const orderPrice = selectCrossMarginOrderPrice(getState()) - const isConditionalOrder = selectIsConditionalOrder(getState()) - const tradeSide = selectLeverageSide(getState()) - const marketInfo = selectMarketInfo(getState()) - const price = isConditionalOrder && Number(orderPrice) > 0 ? wei(orderPrice) : indexPrice - - if (!marketInfo) throw new Error('No market selected') - - if (size === '' || price.eq(0)) { - dispatch(setCrossMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) - dispatch(setCrossMarginTradePreview({ preview: null, type: 'trade' })) - dispatch(setLeverageInput('')) - return - } - - const nativeSize = - currencyType === 'native' ? size : String(floorNumber(wei(size).div(price), 4)) - const usdSize = currencyType === 'native' ? String(floorNumber(price.mul(size), 4)) : size - const leverage = marginDelta?.gt(0) ? wei(usdSize).div(marginDelta.abs()) : '0' - const sizeDeltaWei = - tradeSide === PositionSide.LONG ? wei(nativeSize || 0) : wei(nativeSize || 0).neg() - dispatch( - setCrossMarginTradeInputs({ - susdSize: usdSize, - nativeSize: nativeSize, - }) - ) - dispatch(setLeverageInput(leverage.toString(2))) - dispatch( - stageCrossMarginTradePreview({ - market: { - key: marketInfo.marketKey, - address: marketInfo.market, - }, - orderPrice: price, - marginDelta: wei(marginDelta), - sizeDelta: sizeDeltaWei, - action: 'trade', - }) - ) - } - -export const editCrossMarginPositionSize = - (marketKey: FuturesMarketKey, nativeSizeDelta: string): AppThunk => - (dispatch, getState) => { - const { marketPrice } = selectEditPositionModalInfo(getState()) - dispatch( - setCrossMarginEditPositionInputs({ - marginDelta: '', - nativeSizeDelta: nativeSizeDelta, - }) - ) - try { - const market = getMarketDetailsByKey(getState, marketKey) - dispatch( - stageCrossMarginTradePreview({ - orderPrice: marketPrice, - market, - marginDelta: ZERO_WEI, - sizeDelta: wei(nativeSizeDelta || 0), - action: 'edit', - }) - ) - } catch (err) { - dispatch(handlePreviewError({ error: err.message, previewType: 'edit' })) - } - } - -export const editClosePositionSizeDelta = - (marketKey: FuturesMarketKey, nativeSizeDelta: string): AppThunk => - (dispatch, getState) => { - dispatch(setClosePositionSizeDelta(nativeSizeDelta)) - - if (nativeSizeDelta === '' || !nativeSizeDelta) { - dispatch(setIsolatedTradePreview({ preview: null, type: 'close' })) - dispatch(setCrossMarginTradePreview({ preview: null, type: 'close' })) - return - } - const { price } = selectClosePositionOrderInputs(getState()) - const { marketPrice } = selectEditPositionModalInfo(getState()) - const accountType = selectFuturesType(getState()) - - try { - const market = getMarketDetailsByKey(getState, marketKey) - const smartMarginPrice = isNaN(Number(price)) || !price ? marketPrice : wei(price) - const odrderPrice = accountType === 'isolated_margin' ? marketPrice : smartMarginPrice - const previewParams: TradePreviewParams = { - market, - sizeDelta: wei(nativeSizeDelta), - orderPrice: odrderPrice, - marginDelta: ZERO_WEI, - action: 'close', - } - if (accountType === 'isolated_margin') { - dispatch(stageIsolatedMarginTradePreview(previewParams)) - } else { - dispatch(stageCrossMarginTradePreview(previewParams)) - } - } catch (err) { - dispatch(handlePreviewError({ error: err.message, previewType: 'close' })) - } - } - -export const editClosePositionPrice = - (marketKey: FuturesMarketKey, price: string): AppThunk => - (dispatch, getState) => { - const { nativeSizeDelta, orderType } = selectClosePositionOrderInputs(getState()) - const marketPrice = selectMarketIndexPrice(getState()) - const { position } = selectEditPositionModalInfo(getState()) - const closeTradeSide = - position?.position?.side === PositionSide.SHORT ? PositionSide.LONG : PositionSide.SHORT - const invalidLabel = orderPriceInvalidLabel( - price || '0', - closeTradeSide, - marketPrice, - orderType - ) - - dispatch(setClosePositionPrice({ value: price, invalidLabel })) - - try { - const marketInfo = getMarketDetailsByKey(getState, marketKey) - dispatch( - stageCrossMarginTradePreview({ - market: marketInfo, - orderPrice: isNaN(Number(price)) || !price ? marketPrice : wei(price), - marginDelta: ZERO_WEI, - sizeDelta: wei(nativeSizeDelta || 0), - action: 'edit', - }) - ) - } catch (err) { - dispatch(handlePreviewError({ error: err.message, previewType: 'close' })) - } - } - -export const editCrossMarginPositionMargin = - (marketKey: FuturesMarketKey, marginDelta: string): AppThunk => - (dispatch, getState) => { - const { marketPrice } = selectEditPositionModalInfo(getState()) - dispatch( - setCrossMarginEditPositionInputs({ - marginDelta: marginDelta, - nativeSizeDelta: '', - }) - ) - try { - const market = getMarketDetailsByKey(getState, marketKey) - - dispatch( - stageCrossMarginTradePreview({ - market, - orderPrice: marketPrice, - marginDelta: wei(marginDelta || 0), - sizeDelta: ZERO_WEI, - action: 'edit', - }) - ) - } catch (err) { - dispatch(handlePreviewError({ error: err.message, previewType: 'edit' })) - } - } - -export const refetchTradePreview = (): AppThunk => (dispatch, getState) => { - const orderPrice = selectCrossMarginOrderPrice(getState()) - const indexPrice = selectMarketIndexPrice(getState()) - const marketInfo = selectMarketInfo(getState()) - const marginDelta = selectCrossMarginMarginDelta(getState()) - const isConditionalOrder = selectIsConditionalOrder(getState()) - const price = isConditionalOrder && Number(orderPrice) > 0 ? wei(orderPrice) : indexPrice - const { nativeSizeDelta } = selectCrossMarginTradeInputs(getState()) - - if (!marketInfo) throw new Error('No market selected') - - dispatch( - stageCrossMarginTradePreview({ - market: { key: marketInfo.marketKey, address: marketInfo.market }, - orderPrice: price, - marginDelta, - sizeDelta: nativeSizeDelta, - action: 'trade', - }) - ) -} - -const stageCrossMarginTradePreview = createAsyncThunk( - 'futures/stageCrossMarginTradePreview', - async (inputs, { dispatch, getState }) => { - dispatch(calculateCrossMarginFees(inputs)) - dispatch(incrementCrossPreviewCount()) - const debounceCount = selectCrossPreviewCount(getState()) - debouncedPrepareCrossMarginTradePreview(dispatch, { ...inputs, debounceCount }) - } -) - -const stageIsolatedMarginTradePreview = createAsyncThunk( - 'futures/stageIsolatedMarginTradePreview', - async (inputs, { dispatch, getState }) => { - dispatch(incrementCrossPreviewCount()) - const debounceCount = selectCrossPreviewCount(getState()) - debouncedPrepareIsolatedMarginTradePreview(dispatch, { ...inputs, debounceCount }) + // TODO: Separate to cross / smart + dispatch(setSmartMarginMarginDelta('')) + dispatch(setSmartMarginFees(ZERO_CM_FEES)) + dispatch(setSmartMarginLeverageInput('')) + dispatch(clearSmartMarginTradePreviews()) + dispatch(setSmartMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) + dispatch(setSmartMarginEditPositionInputs({ nativeSizeDelta: '', marginDelta: '' })) } ) -export const editIsolatedMarginSize = - (size: string, currencyType: 'usd' | 'native'): AppThunk => - (dispatch, getState) => { - const marketPrice = selectMarketIndexPrice(getState()) - const position = selectPosition(getState()) - const marketKey = selectMarketKey(getState()) - const tradeSide = selectLeverageSide(getState()) - - if ( - size === '' || - marketPrice.eq(0) || - !position?.remainingMargin || - position?.remainingMargin.eq(0) - ) { - dispatch(setIsolatedMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) - dispatch(setIsolatedTradePreview({ preview: null, type: 'edit' })) - dispatch(setLeverageInput('')) - return - } - - const market = getMarketDetailsByKey(getState, marketKey) - - const nativeSize = currencyType === 'native' ? size : wei(size).div(marketPrice).toString() - const usdSize = currencyType === 'native' ? stripZeros(marketPrice.mul(size).toString()) : size - const leverage = - Number(usdSize) > 0 && position?.remainingMargin.gt(0) - ? wei(usdSize).div(position?.remainingMargin).toString(2) - : '' - const nativeSizeDelta = - tradeSide === PositionSide.LONG ? wei(nativeSize) : wei(nativeSize).neg() - - dispatch(setLeverageInput(leverage)) - dispatch( - setIsolatedMarginTradeInputs({ - susdSize: usdSize, - nativeSize: nativeSize, - }) - ) - dispatch(calculateIsolatedMarginFees()) - dispatch(incrementIsolatedPreviewCount()) - dispatch( - stageIsolatedMarginTradePreview({ - market, - sizeDelta: nativeSizeDelta, - orderPrice: marketPrice, - marginDelta: ZERO_WEI, - action: 'trade', - }) - ) - } - export const editTradeSizeInput = (size: string, currencyType: 'usd' | 'native'): AppThunk => (dispatch, getState) => { const type = selectFuturesType(getState()) - if (type === 'cross_margin') { + if (type === FuturesMarginType.CROSS_MARGIN) { dispatch(editCrossMarginTradeSize(size, currencyType)) } else { - dispatch(editIsolatedMarginSize(size, currencyType)) + dispatch(editSmartMarginTradeSize(size, currencyType)) } } -export const changeLeverageSide = - (side: PositionSide): AppThunk => - (dispatch, getState) => { - const { nativeSizeString } = selectTradeSizeInputs(getState()) - dispatch(setLeverageSide(side)) - dispatch(editTradeSizeInput(nativeSizeString, 'native')) - } - -export const setCrossMarginLeverage = - (leverage: string): AppThunk => - (dispatch, getState) => { - const marketKey = selectMarketKey(getState()) - dispatch(setCrossMarginLeverageForAsset({ marketKey: marketKey, leverage: leverage })) +export const fetchFuturesPositionHistory = createAsyncThunk( + 'futures/fetchFuturesPositionHistory', + async (_, { getState, dispatch }) => { + const accountType = selectFuturesAccount(getState()) + accountType === FuturesMarginType.CROSS_MARGIN + ? dispatch(fetchPositionHistoryV3()) + : dispatch(fetchPositionHistoryV2()) } - -export const debouncedPrepareCrossMarginTradePreview = debounce( - (dispatch, inputs: DebouncedPreviewParams) => { - dispatch(fetchCrossMarginTradePreview(inputs)) - }, - 500 ) -export const debouncedPrepareIsolatedMarginTradePreview = debounce( - (dispatch, inputs: DebouncedPreviewParams) => { - dispatch(fetchIsolatedMarginTradePreview(inputs)) - }, - 500 -) - -export const editTradeOrderPrice = - (price: string): AppThunk => - (dispatch, getState) => { - const rate = selectSkewAdjustedPrice(getState()) - const orderType = selectOrderType(getState()) - const side = selectLeverageSide(getState()) - const inputs = selectCrossMarginTradeInputs(getState()) - dispatch(setCrossMarginOrderPrice(price)) - const invalidLabel = orderPriceInvalidLabel(price, side, rate, orderType) - dispatch(setCrossMarginOrderPriceInvalidLabel(invalidLabel)) - if (!invalidLabel && price && inputs.susdSize) { - // Recalc the trade - dispatch(editCrossMarginTradeSize(inputs.susdSizeString, 'usd')) - } - } - -export const fetchFuturesPositionHistory = createAsyncThunk< - | { - accountType: FuturesAccountType - history: FuturesPositionHistory[] - account: string - wallet: string - networkId: NetworkId - } - | undefined, - void, - ThunkConfig ->('futures/fetchFuturesPositionHistory', async (_, { getState, extra: { sdk } }) => { - try { - const account = selectFuturesAccount(getState()) - const accountType = selectFuturesType(getState()) - const networkId = selectNetwork(getState()) - const wallet = selectWallet(getState()) - const futuresSupported = selectFuturesSupportedNetwork(getState()) - if (!wallet || !account || !futuresSupported) return - const history = await sdk.futures.getPositionHistory(account) - return { accountType, account, wallet, networkId, history: serializePositionHistory(history) } - } catch (err) { - notifyError('Failed to fetch position history', err) - throw err - } -}) - export const fetchPositionHistoryForTrader = createAsyncThunk< { history: FuturesPositionHistory[]; address: string; networkId: NetworkId } | undefined, string, @@ -1025,9 +113,9 @@ export const fetchPositionHistoryForTrader = createAsyncThunk< >('futures/fetchPositionHistoryForTrader', async (traderAddress, { getState, extra: { sdk } }) => { try { const networkId = selectNetwork(getState()) - const futuresSupported = selectFuturesSupportedNetwork(getState()) + const futuresSupported = selectSmartMarginSupportedNetwork(getState()) if (!futuresSupported) return - const history = await sdk.futures.getCompletePositionHistory(traderAddress) + const history = await sdk.futures.getPositionHistory(traderAddress, 'eoa') return { history: serializePositionHistory(history), networkId, address: traderAddress } } catch (err) { notifyError('Failed to fetch history for trader ' + traderAddress, err) @@ -1035,901 +123,36 @@ export const fetchPositionHistoryForTrader = createAsyncThunk< } }) -export const fetchTradesForSelectedMarket = createAsyncThunk< - | { - trades: FuturesTrade[] - account: string - wallet: string - networkId: NetworkId - accountType: FuturesAccountType - } - | undefined, - void, - ThunkConfig ->('futures/fetchTradesForSelectedMarket', async (_, { getState, extra: { sdk } }) => { - try { - const wallet = selectWallet(getState()) - const networkId = selectNetwork(getState()) - const marketAsset = selectMarketAsset(getState()) - const accountType = selectFuturesType(getState()) - const account = selectFuturesAccount(getState()) - const futuresSupported = selectFuturesSupportedNetwork(getState()) +// Contract Mutations - if (!futuresSupported || !wallet || !account) return - const trades = await sdk.futures.getTradesForMarket(marketAsset, wallet, accountType) - return { trades: serializeTrades(trades), networkId, account, accountType, wallet } - } catch (err) { - notifyError('Failed to fetch futures trades for selected market', err) - throw err +export const cancelDelayedOrder = createAsyncThunk( + 'futures/cancelDelayedOrder', + async (marketAddress, { getState, dispatch, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + if (!account) throw new Error('No wallet connected') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'cancel_delayed_isolated', + hash: null, + }) + ) + const tx = await sdk.futures.cancelDelayedOrder(marketAddress, account, true) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchSmartMarginOpenOrders()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } } -}) +) + +// Utils -export const fetchAllTradesForAccount = createAsyncThunk< - | { - trades: FuturesTrade[] - account: string - wallet: string - networkId: NetworkId - accountType: FuturesAccountType - } - | undefined, - void, - ThunkConfig ->('futures/fetchAllTradesForAccount', async (_, { getState, extra: { sdk } }) => { - try { - const wallet = selectWallet(getState()) - const networkId = selectNetwork(getState()) - const accountType = selectFuturesType(getState()) - const account = selectFuturesAccount(getState()) - const futuresSupported = selectFuturesSupportedNetwork(getState()) - if (!futuresSupported || !wallet || !account) return - const trades = await sdk.futures.getAllTrades(wallet, accountType, 200) - return { trades: serializeTrades(trades), networkId, account, accountType, wallet } - } catch (err) { - notifyError('Failed to fetch futures trades', err) - throw err - } -}) - -export const fetchFuturesFees = createAsyncThunk< - { - totalFuturesFeePaid: string - }, - { - start: number - end: number - }, - ThunkConfig ->('futures/fetchFuturesFees', async ({ start, end }, { extra: { sdk } }) => { - try { - const totalFuturesFeePaid = await sdk.kwentaToken.getFuturesFee(start, end) - return { totalFuturesFeePaid: totalFuturesFeePaid.toString() } - } catch (err) { - notifyError('Failed to fetch futures fees', err) - throw err - } -}) - -export const fetchFuturesFeesForAccount = createAsyncThunk< - { - futuresFeePaid: string - }, - { - start: number - end: number - }, - ThunkConfig ->('futures/fetchFuturesFeesForAccount', async ({ start, end }, { getState, extra: { sdk } }) => { - try { - const wallet = selectWallet(getState()) - const futuresFeePaid = await sdk.kwentaToken.getFuturesFeeForAccount(wallet!, start, end) - return { futuresFeePaid: futuresFeePaid.toString() } - } catch (err) { - notifyError('Failed to fetch futures fees for the account', err) - throw err - } -}) - -export const calculateCrossMarginFees = - (params: TradePreviewParams): AppThunk => - (dispatch, getState) => { - const markets = selectMarkets(getState()) - const market = markets.find((m) => m.marketKey === params.market.key) - if (!market) throw new Error('Missing market info to compute fee') - const keeperBalance = selectKeeperEthBalance(getState()) - const { delayedOrderFee } = computeDelayedOrderFee( - market, - params.sizeDelta.mul(params.orderPrice?.abs()) - ) - - const requiredDeposit = keeperBalance.lt(ORDER_KEEPER_ETH_DEPOSIT) - ? ORDER_KEEPER_ETH_DEPOSIT.sub(keeperBalance) - : wei(0) - - const fees = { - delayedOrderFee: delayedOrderFee.toString(), - keeperEthDeposit: requiredDeposit.toString(), - } - dispatch(setCrossMarginFees(fees)) - } - -export const calculateKeeperDeposit = (): AppThunk => (dispatch, getState) => { - const keeperBalance = selectKeeperEthBalance(getState()) - const requiredDeposit = keeperBalance.lt(ORDER_KEEPER_ETH_DEPOSIT) - ? ORDER_KEEPER_ETH_DEPOSIT.sub(keeperBalance) - : wei(0) - - dispatch(setKeeperDeposit(requiredDeposit.toString())) -} - -export const calculateIsolatedMarginFees = (): AppThunk => (dispatch, getState) => { - const market = selectMarketInfo(getState()) - const { susdSizeDelta } = selectIsolatedMarginTradeInputs(getState()) - const { delayedOrderFee } = computeDelayedOrderFee(market, susdSizeDelta) - dispatch(setIsolatedMarginFee(delayedOrderFee.toString())) -} - -// Contract Mutations - -export const createCrossMarginAccount = createAsyncThunk< - { account: string; wallet: string; network: NetworkId } | undefined, - void, - ThunkConfig ->( - 'futures/createCrossMarginAccount', - async (_, { getState, dispatch, extra: { sdk }, rejectWithValue }) => { - const wallet = selectWallet(getState()) - const supportedNetwork = selectFuturesSupportedNetwork(getState()) - const network = selectNetwork(getState()) - if (!wallet || !supportedNetwork) return undefined - const accounts = getState().futures.crossMargin.accounts - - // Already have an accoutn fetched and persisted for this address - if (accounts[network]?.[wallet]?.account) { - notifyError('There is already an account associated with this wallet') - rejectWithValue('Account already created') - } - - try { - const accounts = await sdk.futures.getCrossMarginAccounts() - // Check for existing account on the contract as only one account per user - if (accounts[0]) { - dispatch(setCrossMarginAccount({ account: accounts[0], wallet: wallet, network })) - return - } - - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'create_cross_margin_account', - hash: null, - }) - ) - const tx = await sdk.futures.createCrossMarginAccount() - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(fetchCrossMarginAccount()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - } - } -) - -export const depositCrossMargin = createAsyncThunk( - 'futures/depositCrossMargin', - async (amount, { getState, dispatch, extra: { sdk } }) => { - const account = selectCrossMarginAccount(getState()) - if (!account) { - notifyError('No smart margin account') - return - } - await submitCMTransferTransaction(dispatch, sdk, 'deposit_cross_margin', account, amount) - } -) - -export const withdrawCrossMargin = createAsyncThunk( - 'futures/withdrawCrossMargin', - async (amount, { getState, dispatch, extra: { sdk } }) => { - const account = selectCrossMarginAccount(getState()) - if (!account) { - notifyError('No smart margin account') - return - } - await submitCMTransferTransaction(dispatch, sdk, 'withdraw_cross_margin', account, amount) - } -) - -export const approveCrossMargin = createAsyncThunk( - 'futures/approveCrossMargin', - async (_, { getState, dispatch, extra: { sdk } }) => { - const account = selectCrossMarginAccount(getState()) - if (!account) throw new Error('No smart margin account') - try { - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'approve_cross_margin', - hash: null, - }) - ) - const tx = await sdk.futures.approveCrossMarginDeposit(account) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(fetchCrossMarginBalanceInfo()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const depositIsolatedMargin = createAsyncThunk( - 'futures/depositIsolatedMargin', - async (amount, { getState, dispatch, extra: { sdk } }) => { - const marketInfo = selectMarketInfo(getState()) - if (!marketInfo) throw new Error('Market info not found') - try { - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'deposit_isolated', - hash: null, - }) - ) - const tx = await sdk.futures.depositIsolatedMargin(marketInfo.market, amount) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setOpenModal(null)) - dispatch(refetchPosition('isolated_margin')) - dispatch(fetchBalances()) - dispatch(fetchMarginTransfers()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const withdrawIsolatedMargin = createAsyncThunk( - 'futures/withdrawIsolatedMargin', - async (amount, { getState, dispatch, extra: { sdk } }) => { - const marketInfo = selectMarketInfo(getState()) - if (!marketInfo) throw new Error('Market info not found') - try { - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'withdraw_isolated', - hash: null, - }) - ) - const tx = await sdk.futures.withdrawIsolatedMargin(marketInfo.market, amount) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(refetchPosition('isolated_margin')) - dispatch(setOpenModal(null)) - dispatch(fetchBalances()) - dispatch(fetchMarginTransfers()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const modifyIsolatedPosition = createAsyncThunk( - 'futures/modifyIsolatedPosition', - async (_, { getState, dispatch, extra: { sdk } }) => { - const account = selectFuturesAccount(getState()) - const marketInfo = selectMarketInfo(getState()) - const preview = selectTradePreview(getState()) - const desiredFillPrice = preview?.desiredFillPrice ?? wei(0) - const { nativeSizeDelta } = selectTradeSizeInputs(getState()) - try { - if (!marketInfo) throw new Error('Market info not found') - if (!account) throw new Error('Account not connected') - - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'modify_isolated', - hash: null, - }) - ) - const tx = await sdk.futures.submitIsolatedMarginOrder( - marketInfo.market, - wei(nativeSizeDelta), - desiredFillPrice - ) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(fetchIsolatedOpenOrders()) - dispatch(setOpenModal(null)) - dispatch(clearTradeInputs()) - dispatch(fetchBalances()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const cancelDelayedOrder = createAsyncThunk( - 'futures/cancelDelayedOrder', - async ({ marketAddress, isOffchain }, { getState, dispatch, extra: { sdk } }) => { - const account = selectFuturesAccount(getState()) - if (!account) throw new Error('No wallet connected') - try { - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'cancel_delayed_isolated', - hash: null, - }) - ) - const tx = await sdk.futures.cancelDelayedOrder(marketAddress, account, isOffchain) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(fetchIsolatedOpenOrders()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const executeDelayedOrder = createAsyncThunk( - 'futures/executeDelayedOrder', - async ({ marketKey, marketAddress, isOffchain }, { getState, dispatch, extra: { sdk } }) => { - const account = selectFuturesAccount(getState()) - if (!account) throw new Error('No wallet connected') - try { - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'execute_delayed_isolated', - hash: null, - }) - ) - const tx = isOffchain - ? await sdk.futures.executeDelayedOffchainOrder(marketKey, marketAddress, account) - : await sdk.futures.executeDelayedOrder(marketAddress, account) - dispatch(updateTransactionHash(tx.hash)) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(fetchIsolatedOpenOrders()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const submitCrossMarginOrder = createAsyncThunk( - 'futures/submitCrossMarginOrder', - async (overridePriceProtection, { getState, dispatch, extra: { sdk } }) => { - const marketInfo = selectMarketInfo(getState()) - const account = selectCrossMarginAccount(getState()) - const tradeInputs = selectCrossMarginTradeInputs(getState()) - const marginDelta = selectCrossMarginMarginDelta(getState()) - const feeCap = selectOrderFeeCap(getState()) - const orderType = selectOrderType(getState()) - const orderPrice = selectCrossMarginOrderPrice(getState()) - const preview = selectTradePreview(getState()) - const keeperEthDeposit = selectSmartMarginKeeperDeposit(getState()) - const wallet = selectWallet(getState()) - const position = selectPosition(getState()) - const openDelayedOrders = selectOpenDelayedOrders(getState()) - const { stopLossPrice, takeProfitPrice } = selectSlTpTradeInputs(getState()) - - try { - if (!marketInfo) throw new Error('Market info not found') - if (!account) throw new Error('No smart margin account found') - if (!wallet) throw new Error('No wallet connected') - if (!preview) throw new Error('Missing trade preview') - if (!overridePriceProtection && preview.exceedsPriceProtection) { - throw new Error('Price impact exceeds price protection') - } - - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'submit_cross_order', - hash: null, - }) - ) - - const orderInputs: SmartMarginOrderInputs = { - sizeDelta: tradeInputs.nativeSizeDelta, - marginDelta: marginDelta, - desiredFillPrice: preview.desiredFillPrice, - } - - // To separate Stop Loss and Take Profit from other limit / stop orders - // we set the size to max big num value. - - const maxSizeDelta = tradeInputs.nativeSizeDelta.gt(0) ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE - - if (Number(stopLossPrice) > 0) { - const desiredSLFillPrice = calculateDesiredFillPrice( - maxSizeDelta, - wei(stopLossPrice || 0), - wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.STOP_LOSS) - ) - orderInputs.stopLoss = { - price: wei(stopLossPrice), - desiredFillPrice: desiredSLFillPrice, - sizeDelta: tradeInputs.nativeSizeDelta.gt(0) ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE, - } - } - - if (Number(takeProfitPrice) > 0) { - const desiredTPFillPrice = calculateDesiredFillPrice( - maxSizeDelta, - wei(takeProfitPrice || 0), - wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.TAKE_PROFIT) - ) - orderInputs.takeProfit = { - price: wei(takeProfitPrice), - desiredFillPrice: desiredTPFillPrice, - sizeDelta: tradeInputs.nativeSizeDelta.gt(0) ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE, - } - } - - if (orderType !== 'market') { - orderInputs['conditionalOrderInputs'] = { - orderType: - orderType === 'limit' ? ConditionalOrderTypeEnum.LIMIT : ConditionalOrderTypeEnum.STOP, - feeCap, - price: wei(orderPrice || '0'), - reduceOnly: false, - } - } - - if (orderType !== 'market' || Number(takeProfitPrice) > 0 || Number(stopLossPrice) > 0) { - orderInputs.keeperEthDeposit = keeperEthDeposit - } - - let existingSize = position?.position?.size ?? wei(0) - existingSize = - position?.position?.side === PositionSide.SHORT ? existingSize.neg() : existingSize - const isClosing = existingSize.add(tradeInputs.nativeSizeDelta).eq(0) - - const staleOrder = openDelayedOrders.find( - (o) => o.isStale && o.marketKey === marketInfo.marketKey - ) - - const tx = await sdk.futures.submitCrossMarginOrder( - { address: marketInfo.market, key: marketInfo.marketKey }, - wallet, - account, - orderInputs, - { cancelPendingReduceOrders: isClosing, cancelExpiredDelayedOrders: !!staleOrder } - ) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(fetchCrossMarginOpenOrders()) - dispatch(setOpenModal(null)) - dispatch(fetchBalances()) - dispatch(clearTradeInputs()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const submitCrossMarginAdjustMargin = createAsyncThunk( - 'futures/submitCrossMarginAdjustMargin', - async (_, { getState, dispatch, extra: { sdk } }) => { - const { market } = selectEditPositionModalInfo(getState()) - const account = selectCrossMarginAccount(getState()) - const { marginDelta } = selectCrossMarginEditPosInputs(getState()) - - try { - if (!market) throw new Error('Market info not found') - if (!account) throw new Error('No smart margin account found') - if (!marginDelta || marginDelta === '') throw new Error('No margin amount set') - - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'submit_cross_order', - hash: null, - }) - ) - - const tx = await sdk.futures.modifySmartMarginMarketMargin( - account, - market.market, - wei(marginDelta) - ) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setOpenModal(null)) - dispatch(refetchPosition('cross_margin')) - dispatch(fetchBalances()) - dispatch(clearTradeInputs()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const submitCrossMarginAdjustPositionSize = createAsyncThunk( - 'futures/submitCrossMarginAdjustPositionSize', - async (overridePriceProtection, { getState, dispatch, extra: { sdk } }) => { - const { market, position } = selectEditPositionModalInfo(getState()) - const account = selectCrossMarginAccount(getState()) - const preview = selectEditPositionPreview(getState()) - const { nativeSizeDelta } = selectCrossMarginEditPosInputs(getState()) - - try { - if (!market) throw new Error('Market info not found') - if (!account) throw new Error('No smart margin account found') - if (!nativeSizeDelta || nativeSizeDelta === '') throw new Error('No margin amount set') - if (!preview) throw new Error('Missing trade preview') - if (!overridePriceProtection && preview.exceedsPriceProtection) { - throw new Error('Price impact exceeds price protection') - } - - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'submit_cross_order', - hash: null, - }) - ) - - let existingSize = position?.position?.size ?? wei(0) - existingSize = - position?.position?.side === PositionSide.SHORT ? existingSize.neg() : existingSize - const isClosing = existingSize.add(nativeSizeDelta).eq(0) - - const tx = await sdk.futures.modifySmartMarginPositionSize( - account, - { - key: market.marketKey, - address: market.market, - }, - wei(nativeSizeDelta), - preview.desiredFillPrice, - isClosing - ) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setShowPositionModal(null)) - dispatch(fetchBalances()) - dispatch(clearTradeInputs()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const submitSmartMarginReducePositionOrder = createAsyncThunk( - 'futures/submitSmartMarginReducePositionOrder', - async (overridePriceProtection, { getState, dispatch, extra: { sdk } }) => { - const { market, position } = selectEditPositionModalInfo(getState()) - const account = selectCrossMarginAccount(getState()) - const { nativeSizeDelta, orderType, price } = selectClosePositionOrderInputs(getState()) - const keeperEthDeposit = selectSmartMarginKeeperDeposit(getState()) - const feeCap = selectOrderFeeCap(getState()) - const wallet = selectWallet(getState()) - const preview = selectClosePositionPreview(getState()) - - try { - if (!market) throw new Error('Market info not found') - if (!wallet) throw new Error('No wallet connected') - if (!account) throw new Error('No smart margin account found') - if (!nativeSizeDelta || nativeSizeDelta === '') throw new Error('No margin amount set') - if (!preview) throw new Error('Missing trade preview') - if (!overridePriceProtection && preview.exceedsPriceProtection) { - throw new Error('Price impact exceeds price protection') - } - - const isClosing = wei(nativeSizeDelta) - .abs() - .eq(position?.position?.size.abs() || 0) - - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'submit_cross_order', - hash: null, - }) - ) - - const orderInputs: SmartMarginOrderInputs = { - sizeDelta: wei(nativeSizeDelta), - marginDelta: wei(0), - desiredFillPrice: preview.desiredFillPrice, - } - - if (orderType !== 'market') { - orderInputs['conditionalOrderInputs'] = { - orderType: - orderType === 'limit' ? ConditionalOrderTypeEnum.LIMIT : ConditionalOrderTypeEnum.STOP, - feeCap, - price: wei(price?.value || '0'), - reduceOnly: true, - } - orderInputs.keeperEthDeposit = keeperEthDeposit - } - - const tx = - isClosing && orderType === 'market' - ? await sdk.futures.closeCrossMarginPosition( - { address: market.market, key: market.marketKey }, - account, - preview.desiredFillPrice - ) - : await sdk.futures.submitCrossMarginOrder( - { address: market.market, key: market.marketKey }, - wallet, - account, - orderInputs, - { cancelPendingReduceOrders: isClosing } - ) - - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setOpenModal(null)) - dispatch(setShowPositionModal(null)) - dispatch(fetchBalances()) - dispatch(clearTradeInputs()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const submitIsolatedMarginReducePositionOrder = createAsyncThunk( - 'futures/submitIsolatedMarginReducePositionOrder', - async (_, { getState, dispatch, extra: { sdk } }) => { - const { market } = selectEditPositionModalInfo(getState()) - const closePreview = selectClosePositionPreview(getState()) - const { nativeSizeDelta } = selectClosePositionOrderInputs(getState()) - const wallet = selectWallet(getState()) - - try { - if (!market) throw new Error('Market info not found') - if (!wallet) throw new Error('No wallet connected') - if (!closePreview) throw new Error('Failed to generate trade preview') - if (!nativeSizeDelta || nativeSizeDelta === '') throw new Error('No size amount set') - - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'modify_isolated', - hash: null, - }) - ) - - const tx = await sdk.futures.submitIsolatedMarginOrder( - market.market, - wei(nativeSizeDelta), - closePreview.desiredFillPrice - ) - - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setShowPositionModal(null)) - dispatch(fetchBalances()) - dispatch(clearTradeInputs()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const cancelConditionalOrder = createAsyncThunk( - 'futures/cancelConditionalOrder', - async (contractOrderId, { getState, dispatch, extra: { sdk } }) => { - const crossMarginAccount = selectCrossMarginAccount(getState()) - try { - if (!crossMarginAccount) throw new Error('No smart margin account') - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'cancel_cross_margin_order', - hash: null, - }) - ) - - // Handle contract id or subgraph id - - dispatch(setCrossMarginOrderCancelling(contractOrderId)) - const tx = await sdk.futures.cancelConditionalOrder(crossMarginAccount, contractOrderId) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setCrossMarginOrderCancelling(undefined)) - dispatch(setOpenModal(null)) - dispatch(fetchCrossMarginOpenOrders()) - } catch (err) { - dispatch(setCrossMarginOrderCancelling(undefined)) - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const withdrawAccountKeeperBalance = createAsyncThunk( - 'futures/withdrawAccountKeeperBalance', - async (amount, { getState, dispatch, extra: { sdk } }) => { - const crossMarginAccount = selectCrossMarginAccount(getState()) - try { - if (!crossMarginAccount) throw new Error('No smart margin account') - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'withdraw_keeper_balance', - hash: null, - }) - ) - - const tx = await sdk.futures.withdrawAccountKeeperBalance(crossMarginAccount, amount) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setOpenModal(null)) - dispatch(fetchCrossMarginBalanceInfo()) - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -// Utils - -export const estimateGasInteralAction = async ( - gasLimitEstimate: () => Promise, - type: FuturesTransactionType, - config: { - getState: () => RootState - dispatch: AppDispatch - } -) => { - const { app } = config.getState() - const ethPrice = selectLatestEthPrice(config.getState()) - - try { - const limit = await gasLimitEstimate() - const estimate = getTransactionPrice(unserializeGasPrice(app.gasPrice), limit, ethPrice, wei(0)) - - config.dispatch( - setTransactionEstimate({ - type: type, - limit: limit.toString(), - cost: estimate?.toString() ?? '0', - }) - ) - } catch (err) { - config.dispatch( - setTransactionEstimate({ - type: type, - limit: '0', - cost: '0', - error: err.message, - }) - ) - throw err - } -} - -const submitCMTransferTransaction = async ( - dispatch: AppDispatch, - sdk: KwentaSDK, - type: 'withdraw_cross_margin' | 'deposit_cross_margin', - account: string, - amount: Wei -) => { - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: type, - hash: null, - }) - ) - - try { - const tx = - type === 'deposit_cross_margin' - ? await sdk.futures.depositCrossMarginAccount(account, amount) - : await sdk.futures.withdrawCrossMarginAccount(account, amount) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(fetchCrossMarginBalanceInfo()) - dispatch(setOpenModal(null)) - dispatch(refetchPosition('cross_margin')) - dispatch(fetchBalances()) - dispatch(fetchMarginTransfers()) - return tx - } catch (err) { - logError(err) - dispatch(handleTransactionError(err.message)) - throw err - } -} - -export const updateStopLossAndTakeProfit = createAsyncThunk( - 'futures/updateStopLossAndTakeProfit', - async (_, { getState, dispatch, extra: { sdk } }) => { - const { market, position } = selectEditPositionModalInfo(getState()) - const account = selectCrossMarginAccount(getState()) - const wallet = selectWallet(getState()) - const { stopLossPrice, takeProfitPrice } = selectSlTpModalInputs(getState()) - const keeperDeposit = selectSmartMarginKeeperDeposit(getState()) - - try { - if (!market) throw new Error('Market info not found') - if (!account) throw new Error('No smart margin account found') - if (!wallet) throw new Error('No wallet connected') - - const maxSizeDelta = - position?.position?.side === PositionSide.LONG ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE - - const desiredSLFillPrice = calculateDesiredFillPrice( - maxSizeDelta, - wei(stopLossPrice || 0), - wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.STOP_LOSS) - ) - - const desiredTPFillPrice = calculateDesiredFillPrice( - maxSizeDelta, - wei(takeProfitPrice || 0), - wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.TAKE_PROFIT) - ) - - const params: SLTPOrderInputs = { - keeperEthDeposit: keeperDeposit, - } - - // To separate Stop Loss and Take Profit from other limit / stop orders - // we set the size to max big num value. - - if (Number(stopLossPrice) > 0) { - params.stopLoss = { - price: wei(stopLossPrice), - desiredFillPrice: desiredSLFillPrice, - sizeDelta: maxSizeDelta, - } - } else if (!stopLossPrice) { - params.stopLoss = { - price: wei(0), - desiredFillPrice: wei(0), - sizeDelta: wei(0), - isCancelled: true, - } - } - - if (Number(takeProfitPrice) > 0) { - params.takeProfit = { - price: wei(takeProfitPrice), - desiredFillPrice: desiredTPFillPrice, - sizeDelta: maxSizeDelta, - } - } else if (!takeProfitPrice) { - params.takeProfit = { - price: wei(0), - desiredFillPrice: wei(0), - sizeDelta: wei(0), - isCancelled: true, - } - } - - if (params.stopLoss || params.takeProfit) { - dispatch( - setTransaction({ - status: TransactionStatus.AwaitingExecution, - type: 'submit_cross_order', - hash: null, - }) - ) - - const tx = await sdk.futures.updateStopLossAndTakeProfit(market.marketKey, account, params) - await monitorAndAwaitTransaction(dispatch, tx) - dispatch(setShowPositionModal(null)) - } - } catch (err) { - dispatch(handleTransactionError(err.message)) - throw err - } - } -) - -export const fetchFundingRatesHistory = createAsyncThunk< - { marketAsset: FuturesMarketAsset; rates: any }, - { marketAsset: FuturesMarketAsset; period: Period }, +export const fetchFundingRatesHistory = createAsyncThunk< + { marketAsset: FuturesMarketAsset; rates: any }, + { marketAsset: FuturesMarketAsset; period: Period }, ThunkConfig >('futures/fetchFundingRatesHistory', async ({ marketAsset, period }, { extra: { sdk } }) => { const rates = await sdk.futures.getMarketFundingRatesHistory( @@ -1938,24 +161,3 @@ export const fetchFundingRatesHistory = createAsyncThunk< ) return { marketAsset, rates } }) - -const monitorAndAwaitTransaction = async ( - dispatch: AppDispatch, - tx: ethers.providers.TransactionResponse -) => { - dispatch(updateTransactionHash(tx.hash)) - await tx.wait() - dispatch(updateTransactionStatus(TransactionStatus.Confirmed)) -} - -const getMarketDetailsByKey = (getState: () => RootState, key: FuturesMarketKey) => { - const markets = selectMarkets(getState()) - const market = markets.find((m) => { - return m.marketKey === key - }) - if (!market) throw new Error(`No market info found for ${key}`) - return { - address: market.market, - key: market.marketKey, - } -} diff --git a/packages/app/src/state/futures/common/selectors.ts b/packages/app/src/state/futures/common/selectors.ts new file mode 100644 index 0000000000..48bc7c932e --- /dev/null +++ b/packages/app/src/state/futures/common/selectors.ts @@ -0,0 +1,38 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' +import { createSelector } from '@reduxjs/toolkit' +import { wei } from '@synthetixio/wei' + +import { selectOffchainPricesInfo, selectPrices } from 'state/prices/selectors' +import { RootState } from 'state/store' + +export const selectFuturesType = (state: RootState) => state.futures.selectedType + +export const selectFuturesState = createSelector( + selectFuturesType, + (state: RootState) => state, + (type, state) => (type === FuturesMarginType.CROSS_MARGIN ? state.crossMargin : state.smartMargin) +) + +export const selectMarketAsset = createSelector( + selectFuturesState, + (state) => state.selectedMarketAsset +) + +export const selectMarketIndexPrice = createSelector( + selectMarketAsset, + selectPrices, + (marketAsset, prices) => { + const price = prices[marketAsset] + // Note this assumes the order type is always delayed off chain + return price?.offChain ?? price?.onChain ?? wei(0) + } +) + +export const selectMarketPriceInfo = createSelector( + selectMarketAsset, + selectOffchainPricesInfo, + (asset, pricesInfo) => { + if (!asset || !pricesInfo[asset]) return + return pricesInfo[asset] + } +) diff --git a/packages/app/src/state/futures/common/types.ts b/packages/app/src/state/futures/common/types.ts new file mode 100644 index 0000000000..7890f338a7 --- /dev/null +++ b/packages/app/src/state/futures/common/types.ts @@ -0,0 +1,132 @@ +import { + FuturesMarginType, + FuturesMarketAsset, + FuturesMarketKey, + FuturesOrderTypeDisplay, + FuturesTrade, + MarginTransfer, + NetworkId, + PositionSide, +} from '@kwenta/sdk/types' +import Wei from '@synthetixio/wei' + +import { QueryStatus } from 'state/types' + +type excludedOptions = typeof FuturesMarginType.ISOLATED_MARGIN_LEGACY +export type AppFuturesMarginType = Exclude + +export type FuturesAccountData = { + trades?: FuturesTrade[] + marginTransfers?: MarginTransfer[] +} + +export type DelayedOrderWithDetails = { + account: string + marketAddress: string + market: string + asset: FuturesMarketAsset + marketKey: FuturesMarketKey + size: T + commitDeposit: T + keeperDeposit: T + submittedAtTimestamp: number + executableAtTimestamp: number + isOffchain: boolean + desiredFillPrice: T + targetRoundId: T | null + orderType: FuturesOrderTypeDisplay + side: PositionSide + isStale?: boolean + isExecutable?: boolean + isCancelling?: boolean +} + +export type HistoricalFundingRates = Partial< + Record +> + +export type FuturesQueryStatuses = { + markets: QueryStatus + dailyVolumes: QueryStatus + positions: QueryStatus + positionHistory: QueryStatus + openOrders: QueryStatus + tradePreview: QueryStatus + account: QueryStatus + trades: QueryStatus + marginTransfers: QueryStatus + historicalFundingRates: QueryStatus + futuresFees: QueryStatus + futuresFeesForAccount: QueryStatus +} + +export type SmartMarginQueryStatuses = FuturesQueryStatuses & { + smartMarginBalanceInfo: QueryStatus +} + +export type TradeSizeInputs = { + nativeSize: T + susdSize: T +} + +export type EditPositionInputs = { + nativeSizeDelta: T + marginDelta: T +} + +export type PreviewAction = 'edit' | 'trade' | 'close' + +export type TradePreviewParams = { + orderPrice: Wei + sizeDelta: Wei + action: PreviewAction +} + +export type CrossMarginTradePreviewParams = TradePreviewParams & { + market: { + key: FuturesMarketKey + id: number + } +} + +export type SmartMarginTradePreviewParams = TradePreviewParams & { + market: { + key: FuturesMarketKey + address: string + } + marginDelta: Wei + isConditional?: boolean + hasStopOrTakeProfit?: boolean +} + +export type DebouncedSMPreviewParams = SmartMarginTradePreviewParams & { + debounceCount: number +} + +export type DebouncedCMPreviewParams = CrossMarginTradePreviewParams & { + debounceCount: number +} + +export type AccountContext = { + type: AppFuturesMarginType + network: NetworkId + wallet: string + cmAccount?: string +} + +export type FuturesTransactionType = + | 'deposit_smart_margin' + | 'withdraw_smart_margin' + | 'approve_cross_margin' + | 'deposit_isolated' + | 'withdraw_isolated' + | 'modify_isolated' + | 'close_isolated' + | 'close_cross_margin' + | 'cancel_delayed_isolated' + | 'execute_delayed_isolated' + | 'close_cross_margin' + | 'submit_cross_order' + | 'cancel_cross_margin_order' + | 'withdraw_keeper_balance' + | 'create_cross_margin_account' diff --git a/packages/app/src/state/futures/crossMargin/actions.ts b/packages/app/src/state/futures/crossMargin/actions.ts new file mode 100644 index 0000000000..cff3e04cae --- /dev/null +++ b/packages/app/src/state/futures/crossMargin/actions.ts @@ -0,0 +1,638 @@ +import { V3_SYNTH_MARKET_IDS } from '@kwenta/sdk/constants' +import { + PerpsV2Position, + FuturesPositionHistory, + NetworkId, + PerpsMarketV3, + PerpsV3AsyncOrder, + PerpsV3Position, + PositionSide, + PotentialTradeStatus, + SynthV3Asset, + TransactionStatus, +} from '@kwenta/sdk/types' +import { calculateDesiredFillPrice, floorNumber, getDefaultPriceImpact } from '@kwenta/sdk/utils' +import { createAsyncThunk } from '@reduxjs/toolkit' +import Wei, { wei } from '@synthetixio/wei' +import { debounce } from 'lodash' + +import { notifyError } from 'components/ErrorNotifier' +import { monitorAndAwaitTransaction } from 'state/app/helpers' +import { + handleTransactionError, + setOpenModal, + setTransaction, + updateTransactionHash, +} from 'state/app/reducer' +import { fetchV3BalancesAndAllowances } from 'state/balances/actions' +import { ZERO_STATE_TRADE_INPUTS } from 'state/constants' +import { selectLeverageSide } from 'state/futures/selectors' +import { AppThunk } from 'state/store' +import { ThunkConfig } from 'state/types' +import { selectNetwork, selectWallet } from 'state/wallet/selectors' +import { + serializePositionHistory, + serializeV3AsyncOrder, + serializeV3Market, + serializeV3Positions, +} from 'utils/futures' +import logError from 'utils/logError' + +import { selectMarketIndexPrice } from '../common/selectors' +import { + AppFuturesMarginType, + CrossMarginTradePreviewParams, + DebouncedCMPreviewParams, +} from '../common/types' +import { ExecuteAsyncOrderInputs } from '../types' + +import { + incrementPreviewCrossMarginCount, + setCrossMarginLeverageInput, + setCrossMarginLeverageSide, + setCrossMarginTradeInputs, + setCrossMarginTradePreview, + setPerpsV3Account, + setPerpsV3MarketProxyAddress, +} from './reducer' +import { + selectAccountContext, + selectCrossMarginAccount, + selectCrossMarginAvailableMargin, + selectCrossMarginSupportedNetwork, + selectCrossMarginTradeInputs, + selectCrossMarginTradePreview, + selectAsyncCrossMarginOrders, + selectV3MarketInfo, + selectV3Markets, + selectCloseCMPositionModalInfo, +} from './selectors' +import { CrossMarginTradePreview } from './types' + +export const fetchCrossMarginMarketData = createAsyncThunk( + 'futures/fetchCrossMarginMarketData', + async (_, { dispatch }) => { + await dispatch(fetchV3Markets()) + // TODO: fetch v3 volume data + } +) + +export const fetchV3Markets = createAsyncThunk< + { markets: PerpsMarketV3[]; networkId: NetworkId } | undefined, + void, + ThunkConfig +>('futures/fetchV3Markets', async (_, { getState, extra: { sdk } }) => { + const supportedNetwork = selectCrossMarginSupportedNetwork(getState()) + const networkId = selectNetwork(getState()) + if (!supportedNetwork) return + try { + const v3Markets = await sdk.perpsV3.getMarkets() + + return { markets: v3Markets.map(serializeV3Market), networkId } + } catch (err) { + logError(err) + notifyError('Failed to fetch markets', err) + throw err + } +}) + +export const fetchPerpsV3Account = createAsyncThunk< + { account: number; wallet: string; network: NetworkId } | undefined, + void, + ThunkConfig +>('futures/fetchPerpsV3Account', async (_, { getState, extra: { sdk }, rejectWithValue }) => { + const wallet = selectWallet(getState()) + const supportedNetwork = selectCrossMarginSupportedNetwork(getState()) + const network = selectNetwork(getState()) + + if (!wallet || !supportedNetwork) return undefined + + const accounts = getState().crossMargin.accounts + + // Already have an account fetched and persisted for this address + if (accounts[network]?.[wallet]?.account) return + + try { + // TODO: Support multiple accounts + const accountIds = await sdk.perpsV3.getPerpsV3AccountIds(wallet) + const defaultAccount = accountIds[0] + if (defaultAccount) { + return { account: defaultAccount, wallet, network } + } + return undefined + } catch (err) { + notifyError('Failed to fetch cross margin account', err) + rejectWithValue(err.message) + } +}) + +export const fetchPerpsV3Balances = createAsyncThunk( + 'balances/fetchPerpsV3Balances', + async (_, { dispatch, extra: { sdk } }) => { + const spender = sdk.context.contracts.perpsV3MarketProxy?.address + if (spender) { + dispatch(fetchV3BalancesAndAllowances([spender])) + dispatch(setPerpsV3MarketProxyAddress(spender)) + } + } +) + +export const fetchCrossMarginPositions = createAsyncThunk< + { positions: PerpsV3Position[]; account: number; network: NetworkId } | undefined, + void, + ThunkConfig +>('futures/fetchCrossMarginPositions', async (_, { extra: { sdk }, getState }) => { + const supportedNetwork = selectCrossMarginSupportedNetwork(getState()) + const { network, accountId } = selectAccountContext(getState()) + const markets = selectV3Markets(getState()) + + if (!supportedNetwork || !accountId) return + try { + const positions = await sdk.perpsV3.getPositions( + accountId, + markets.map((m) => m.marketId) + ) + + return { positions: serializeV3Positions(positions), account: accountId, network } + } catch (err) { + logError(err) + notifyError('Failed to fetch isolated margin positions', err) + throw err + } +}) + +export const fetchPositionHistoryV3 = createAsyncThunk< + | { + history: FuturesPositionHistory[] + account: number + wallet: string + networkId: NetworkId + } + | undefined, + void, + ThunkConfig +>('futures/fetchPositionHistoryV3', async (_, { getState, extra: { sdk: _sdk } }) => { + try { + const { wallet, network, accountId } = selectAccountContext(getState()) + + const futuresSupported = selectCrossMarginSupportedNetwork(getState()) + if (!wallet || !accountId || !futuresSupported) return + // TODO: V3 position history + // const history = await sdk.futures.getPositionHistory(accountId) + return { + account: accountId, + wallet, + networkId: network, + history: serializePositionHistory([]), + } + } catch (err) { + notifyError('Failed to fetch perps v3 position history', err) + throw err + } +}) + +export const refetchPosition = createAsyncThunk< + { + position: PerpsV2Position + wallet: string + futuresType: AppFuturesMarginType + networkId: NetworkId + } | null, + void, + ThunkConfig +>('futures/refetchPosition', async () => { + // TODO: Refetch positions + return null +}) + +export const fetchCrossMarginOpenOrders = createAsyncThunk< + { orders: PerpsV3AsyncOrder[]; wallet: string; networkId: NetworkId } | undefined, + void, + ThunkConfig +>('futures/fetchCrossMarginOpenOrders', async (_, { dispatch, getState, extra: { sdk } }) => { + const { accountId, network, wallet } = selectAccountContext(getState()) + const supportedNetwork = selectCrossMarginSupportedNetwork(getState()) + const markets = selectV3Markets(getState()) + const existingOrders = selectAsyncCrossMarginOrders(getState()) + if (!accountId || !supportedNetwork || !markets.length || !wallet) return + try { + const marketIds = markets.map((market) => market.marketId) + const orders = await sdk.perpsV3.getPendingAsyncOrders(accountId, marketIds) + const orderDropped = existingOrders.length > orders.length + if (orderDropped) { + dispatch(fetchCrossMarginPositions()) + } + + return { + networkId: network, + orders: orders.map(serializeV3AsyncOrder), + wallet: wallet, + } + } catch (err) { + notifyError('Failed to fetch open orders', err) + throw err + } +}) + +export const fetchCrossMarginTradePreview = createAsyncThunk< + { preview: CrossMarginTradePreview; type: 'trade' }, + DebouncedCMPreviewParams, + ThunkConfig +>('futures/fetchCrossMarginTradePreview', async (params, { getState, extra: { sdk } }) => { + // TODO: Fetch cross margin trade preview + const marketPrice = params.orderPrice + const marketInfo = selectV3MarketInfo(getState()) + const availableMargin = selectCrossMarginAvailableMargin(getState()) + try { + if (!marketInfo) throw new Error('No market selected') + if (!marketInfo.settlementStrategies[0]) throw new Error('No settlement strategy found') + const preview = await sdk.perpsV3.getTradePreview( + marketInfo.marketId, + params.sizeDelta, + marketInfo.settlementStrategies[0] + ) + const priceImpact = preview.fillPrice.sub(marketPrice).div(marketPrice).abs() + + const notional = preview.fillPrice.mul(params.sizeDelta).abs() + + const populatedPreview = { + settlementFee: preview.settlementFee.toString(), + marketId: marketInfo.marketId, + fee: preview.fee.toString(), + fillPrice: preview.fillPrice.toString(), + priceImpact: priceImpact.toString(), + sizeDelta: params.sizeDelta.toString(), + leverage: notional.gt(0) ? availableMargin.div(notional).toString() : '0', + notionalValue: notional.toString(), + side: params.sizeDelta.gt(0) ? PositionSide.LONG : PositionSide.SHORT, + status: PotentialTradeStatus.OK, + } + return { preview: populatedPreview, type: 'trade' } + } catch (err) { + notifyError(err.message, err) + throw err + } +}) + +export const debouncedPrepareCrossMarginTradePreview = debounce( + (dispatch, inputs: DebouncedCMPreviewParams) => { + dispatch(fetchCrossMarginTradePreview(inputs)) + }, + 500 +) + +export const fetchMarginTransfersV3 = createAsyncThunk( + 'futures/fetchMarginTransfers', + async () => { + // TODO: Fetch perps v3 balance transfers + } +) + +export const fetchAvailableMargin = createAsyncThunk< + { wallet: string; network: NetworkId; availableMargin: string } | undefined, + void, + ThunkConfig +>('futures/fetchAvailableMargin', async (_, { getState, extra: { sdk } }) => { + const supportedNetwork = selectCrossMarginSupportedNetwork(getState()) + const { wallet, network, accountId } = selectAccountContext(getState()) + + if (!supportedNetwork || !wallet || !accountId) return + try { + const availableMargin = await sdk.perpsV3.getAvailableMargin(accountId) + return { wallet, network, availableMargin: availableMargin.toString() } + } catch (err) { + logError(err) + notifyError('Failed to fetch available margin', err) + throw err + } +}) + +export const fetchCrossMarginAccountData = createAsyncThunk( + 'futures/fetchCrossMarginAccountData', + async (_, { dispatch }) => { + dispatch(fetchCrossMarginPositions()) + dispatch(fetchPerpsV3Balances()) + dispatch(fetchAvailableMargin()) + } +) + +export const clearTradeInputs = createAsyncThunk( + 'futures/clearTradeInputs', + async () => { + // TODO: Clear trade inputs for cross margin + } +) + +export const editCrossMarginTradeSize = + (size: string, currencyType: 'usd' | 'native'): AppThunk => + (dispatch, getState) => { + const indexPrice = selectMarketIndexPrice(getState()) + const tradeSide = selectLeverageSide(getState()) + const marketInfo = selectV3MarketInfo(getState()) + const availableMargin = selectCrossMarginAvailableMargin(getState()) + + if (!marketInfo) throw new Error('No market selected') + + if (size === '' || indexPrice.eq(0)) { + dispatch(setCrossMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) + dispatch(setCrossMarginTradePreview({ preview: null, type: 'trade' })) + dispatch(setCrossMarginLeverageInput('')) + return + } + + const nativeSize = + currencyType === 'native' ? size : String(floorNumber(wei(size).div(indexPrice), 4)) + const usdSize = currencyType === 'native' ? String(floorNumber(indexPrice.mul(size), 4)) : size + const leverage = availableMargin?.gt(0) ? wei(usdSize).div(availableMargin.abs()) : '0' + const sizeDeltaWei = + tradeSide === PositionSide.LONG ? wei(nativeSize || 0) : wei(nativeSize || 0).neg() + + dispatch( + setCrossMarginTradeInputs({ + susdSize: usdSize, + nativeSize: nativeSize, + }) + ) + dispatch(setCrossMarginLeverageInput(leverage.toString(2))) + dispatch( + stageCrossMarginTradePreview({ + market: { + key: marketInfo.marketKey, + id: marketInfo.marketId, + }, + orderPrice: indexPrice, + sizeDelta: sizeDeltaWei, + action: 'trade', + }) + ) + } + +const stageCrossMarginTradePreview = createAsyncThunk< + void, + CrossMarginTradePreviewParams, + ThunkConfig +>('futures/stageCrossMarginTradePreview', async (inputs, { dispatch, getState }) => { + dispatch(incrementPreviewCrossMarginCount()) + const debounceCount = getState().crossMargin.previewDebounceCount + debouncedPrepareCrossMarginTradePreview(dispatch, { ...inputs, debounceCount }) +}) + +export const changeCrossMarginLeverageSide = + (side: PositionSide): AppThunk => + (dispatch, getState) => { + const { nativeSizeString } = selectCrossMarginTradeInputs(getState()) + dispatch(setCrossMarginLeverageSide(side)) + dispatch(editCrossMarginTradeSize(nativeSizeString, 'native')) + } + +// Contract Mutations + +export const createPerpsV3Account = createAsyncThunk< + { account: string; wallet: string; network: NetworkId } | undefined, + void, + ThunkConfig +>( + 'futures/createPerpsV3Account', + async (_, { getState, dispatch, extra: { sdk }, rejectWithValue }) => { + const wallet = selectWallet(getState()) + const supportedNetwork = selectCrossMarginSupportedNetwork(getState()) + const network = selectNetwork(getState()) + if (!wallet || !supportedNetwork) return undefined + const accounts = getState().crossMargin.accounts + + // Already have an account fetched and persisted for this address + if (accounts[network]?.[wallet]?.account) { + notifyError('There is already an account associated with this wallet') + rejectWithValue('Account already created') + } + + try { + const accountIds = await sdk.perpsV3.getPerpsV3AccountIds(wallet) + + if (accountIds.length > 0) { + // Already have an account, no need to create one + dispatch(setPerpsV3Account({ account: accountIds[0], wallet: wallet, network })) + return + } + + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'create_cross_margin_account', + hash: null, + }) + ) + const tx = await sdk.perpsV3.createAccount() + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchPerpsV3Account()) + dispatch(setOpenModal(null)) + } catch (err) { + dispatch(handleTransactionError(err.message)) + } + } +) + +export const approveCrossMarginDeposit = createAsyncThunk( + 'futures/approveCrossMarginDeposit', + async (_, { getState, dispatch, extra: { sdk } }) => { + const marketInfo = selectV3MarketInfo(getState()) + if (!marketInfo) throw new Error('Market info not found') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'approve_cross_margin', + hash: null, + }) + ) + const tx = await sdk.perpsV3.approveDeposit(SynthV3Asset.SNXUSD) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchPerpsV3Balances()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const depositCrossMarginMargin = createAsyncThunk( + 'futures/depositCrossMarginMargin', + async (amount, { getState, dispatch, extra: { sdk } }) => { + const accountId = selectCrossMarginAccount(getState()) + if (!accountId) throw new Error('Account id not found') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'deposit_isolated', + hash: null, + }) + ) + const tx = await sdk.perpsV3.depositToAccount(accountId, V3_SYNTH_MARKET_IDS.SNXUSD, amount) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(setOpenModal(null)) + dispatch(refetchPosition()) + dispatch(fetchPerpsV3Balances()) + dispatch(fetchMarginTransfersV3()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const withdrawCrossMargin = createAsyncThunk( + 'futures/withdrawCrossMargin', + async (amount, { getState, dispatch, extra: { sdk } }) => { + const accountId = selectCrossMarginAccount(getState()) + if (!accountId) throw new Error('Account id not found') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'withdraw_isolated', + hash: null, + }) + ) + const tx = await sdk.perpsV3.withdrawFromAccount( + accountId, + V3_SYNTH_MARKET_IDS.SNXUSD, + amount + ) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(refetchPosition()) + dispatch(setOpenModal(null)) + dispatch(fetchPerpsV3Balances()) + dispatch(fetchMarginTransfersV3()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const submitCrossMarginOrder = createAsyncThunk( + 'futures/submitCrossMarginOrder', + async (_, { dispatch, getState, extra: { sdk } }) => { + const { nativeSizeDelta } = selectCrossMarginTradeInputs(getState()) + const market = selectV3MarketInfo(getState()) + const accountId = selectCrossMarginAccount(getState()) + const preview = selectCrossMarginTradePreview(getState()) + + if (!market || !accountId || !preview) throw new Error('Invalid order submission') + + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'submit_cross_order', + hash: null, + }) + ) + const tx = await sdk.perpsV3.submitOrder( + market.marketId, + accountId, + wei(nativeSizeDelta || 0), + preview.desiredFillPrice, + market.settlementStrategies[0].strategyId + ) + await monitorAndAwaitTransaction(dispatch, tx) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + // TODO: Handle perps v3 order submission + } +) + +export const submitCrossMarginReducePositionOrder = createAsyncThunk( + 'futures/submitCrossMarginReducePositionOrder', + async (_, { getState, dispatch, extra: { sdk } }) => { + const { market, position, marketPrice } = selectCloseCMPositionModalInfo(getState()) + const accountId = selectCrossMarginAccount(getState()) + // TODO: Support partial close + + try { + if (!position) throw new Error('Missing position data') + if (!accountId) throw new Error('Account not found') + + const sizeDelta = position.side === PositionSide.LONG ? position.size.neg() : position.size + const priceImpact = getDefaultPriceImpact('market') + const desiredFillPrice = calculateDesiredFillPrice( + sizeDelta, + // TODO: Use fill price from preview + marketPrice, + priceImpact + ) + + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'cancel_delayed_isolated', + hash: null, + }) + ) + + const tx = await sdk.perpsV3.submitOrder( + market.marketId, + accountId, + sizeDelta, + desiredFillPrice, + market.settlementStrategies[0].strategyId + ) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchCrossMarginOpenOrders()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + // TODO: hookup submit v3 order + } +) + +export const cancelAsyncOrder = createAsyncThunk( + 'futures/cancelAsyncOrder', + async (marketId, { getState, dispatch, extra: { sdk } }) => { + const account = selectCrossMarginAccount(getState()) + if (!account) throw new Error('No wallet connected') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'cancel_delayed_isolated', + hash: null, + }) + ) + const tx = await sdk.perpsV3.cancelAsyncOrder(marketId, account) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchCrossMarginOpenOrders()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const executeAsyncOrder = createAsyncThunk( + 'futures/executeAsyncOrder', + async ({ marketKey, marketId }, { getState, dispatch, extra: { sdk } }) => { + const account = selectCrossMarginAccount(getState()) + if (!account) throw new Error('No wallet connected') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'execute_delayed_isolated', + hash: null, + }) + ) + const tx = await sdk.perpsV3.executeAsyncOrder(marketKey, marketId, Number(account)) + dispatch(updateTransactionHash(tx.hash)) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchCrossMarginOpenOrders()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) diff --git a/packages/app/src/state/futures/crossMargin/reducer.ts b/packages/app/src/state/futures/crossMargin/reducer.ts new file mode 100644 index 0000000000..866fb30b78 --- /dev/null +++ b/packages/app/src/state/futures/crossMargin/reducer.ts @@ -0,0 +1,406 @@ +import { Period } from '@kwenta/sdk/constants' +import { NetworkId, FuturesMarketAsset, PositionSide } from '@kwenta/sdk/types' +import { createSlice, PayloadAction } from '@reduxjs/toolkit' + +import { ORDER_PREVIEW_ERRORS } from 'queries/futures/constants' +import { + DEFAULT_MAP_BY_NETWORK, + DEFAULT_QUERY_STATUS, + LOADING_STATUS, + SUCCESS_STATUS, + ZERO_STATE_CM_ACCOUNT, + ZERO_STATE_TRADE_INPUTS, +} from 'state/constants' +import { FetchStatus } from 'state/types' + +import { fetchFundingRatesHistory } from '../actions' +import { PreviewAction, TradeSizeInputs } from '../common/types' + +import { + fetchCrossMarginOpenOrders, + fetchCrossMarginPositions, + fetchPositionHistoryV3, + fetchV3Markets, + fetchPerpsV3Account, + fetchAvailableMargin, +} from './actions' +import { fetchCrossMarginTradePreview } from './actions' +import { + EditPositionInputs, + InputCurrencyDenomination, + CrossMarginAccountData, + CrossMarginState, + CrossMarginTradePreview, +} from './types' + +export const COSS_MARGIN_INITIAL_STATE: CrossMarginState = { + confirmationModalOpen: false, + markets: { + 420: [], + 10: [], + }, + dailyMarketVolumes: {}, + accounts: DEFAULT_MAP_BY_NETWORK, + selectedMarketAsset: FuturesMarketAsset.sETH, + leverageSide: PositionSide.LONG, + orderType: 'market', + previews: { + trade: null, + close: null, + edit: null, + }, + closePositionOrderInputs: { + nativeSizeDelta: '', + }, + previewDebounceCount: 0, + perpsV3MarketProxyAddress: undefined, + tradeInputs: ZERO_STATE_TRADE_INPUTS, + editPositionInputs: { + nativeSizeDelta: '', + marginDelta: '', + }, + tradeFee: '0', + leverageInput: '0', + fundingRates: [], + selectedInputDenomination: 'usd', + selectedInputHours: 1, + selectedChart: 'price', + preferences: { + showHistory: true, + }, + dashboard: { + selectedPortfolioTimeframe: Period.ONE_WEEK, + }, + queryStatuses: { + markets: DEFAULT_QUERY_STATUS, + dailyVolumes: DEFAULT_QUERY_STATUS, + positions: DEFAULT_QUERY_STATUS, + account: DEFAULT_QUERY_STATUS, + openOrders: DEFAULT_QUERY_STATUS, + tradePreview: DEFAULT_QUERY_STATUS, + positionHistory: DEFAULT_QUERY_STATUS, + trades: DEFAULT_QUERY_STATUS, + marginTransfers: DEFAULT_QUERY_STATUS, + historicalFundingRates: DEFAULT_QUERY_STATUS, + futuresFees: DEFAULT_QUERY_STATUS, + futuresFeesForAccount: DEFAULT_QUERY_STATUS, + availableMargin: DEFAULT_QUERY_STATUS, + }, + historicalFundingRates: {}, +} + +const crossMarginSlice = createSlice({ + name: 'crossMargin', + initialState: COSS_MARGIN_INITIAL_STATE, + reducers: { + setMarketAsset: (state, action) => { + state.selectedMarketAsset = action.payload + state.tradeInputs = ZERO_STATE_TRADE_INPUTS + }, + setClosePositionSizeDelta: (state, action: PayloadAction) => { + state.closePositionOrderInputs.nativeSizeDelta = action.payload + }, + setCrossMarginLeverageSide: (state, action) => { + state.leverageSide = action.payload + }, + setCrossMarginTradeInputs: (state, action: PayloadAction>) => { + state.tradeInputs = action.payload + }, + setEditPositionInputs: (state, action: PayloadAction>) => { + state.editPositionInputs = action.payload + }, + setSelectedInputDenomination: (state, action: PayloadAction) => { + state.selectedInputDenomination = action.payload + }, + setSelectedInputFundingRateHour: (state, action: PayloadAction) => { + state.selectedInputHours = action.payload + }, + setTradeFee: (state, action: PayloadAction) => { + state.tradeFee = action.payload + }, + setCrossMarginLeverageInput: (state, action: PayloadAction) => { + state.leverageInput = action.payload + }, + setPerpsV3MarketProxyAddress: (state, action: PayloadAction) => { + state.perpsV3MarketProxyAddress = action.payload + }, + handlePreviewError: ( + futuresState, + { + payload, + }: PayloadAction<{ + error: string + previewType: PreviewAction + }> + ) => { + const message = Object.values(ORDER_PREVIEW_ERRORS).includes(payload.error) + ? payload.error + : 'Failed to get trade preview' + futuresState.queryStatuses.tradePreview = { + status: FetchStatus.Error, + error: message, + } + futuresState.previews[payload.previewType] = null + }, + + setPerpsV3Account: ( + state, + action: PayloadAction<{ wallet: string; account: number; network: NetworkId }> + ) => { + const { account, wallet, network } = action.payload + if (!state.accounts[network]?.[wallet]?.account) { + state.accounts[network] = { + ...state.accounts[network], + [wallet]: { + account: account, + ...ZERO_STATE_CM_ACCOUNT, + }, + } + } + }, + setCrossMarginTradePreview: ( + state, + { + payload, + }: PayloadAction<{ + preview: CrossMarginTradePreview | null + type: PreviewAction + }> + ) => { + state.previews[payload.type] = payload.preview + }, + clearAllTradePreviews: (state) => { + state.previews = { + edit: null, + trade: null, + close: null, + } + state.queryStatuses.tradePreview = DEFAULT_QUERY_STATUS + }, + incrementPreviewCrossMarginCount: (state) => { + state.previewDebounceCount = state.previewDebounceCount + 1 + }, + setSelectedPortfolioTimeframe: (state, action: PayloadAction) => { + state.dashboard.selectedPortfolioTimeframe = action.payload + }, + setShowTradeHistory: (state, action: PayloadAction) => { + state.preferences.showHistory = action.payload + }, + setSelectedChart: (state, action: PayloadAction<'price' | 'funding'>) => { + state.selectedChart = action.payload + }, + }, + extraReducers: (builder) => { + // Markets + builder.addCase(fetchV3Markets.pending, (futuresState) => { + futuresState.queryStatuses.markets = LOADING_STATUS + }) + builder.addCase(fetchV3Markets.fulfilled, (futuresState, { payload }) => { + futuresState.queryStatuses.markets = SUCCESS_STATUS + if (payload) { + futuresState.markets[payload.networkId] = payload.markets + } + }) + builder.addCase(fetchV3Markets.rejected, (futuresState) => { + futuresState.queryStatuses.markets = { + status: FetchStatus.Error, + error: 'Failed to fetch markets', + } + }) + + // Cross margin positions + builder.addCase(fetchCrossMarginPositions.pending, (futuresState) => { + futuresState.queryStatuses.positions = LOADING_STATUS + }) + builder.addCase(fetchCrossMarginPositions.fulfilled, (futuresState, action) => { + futuresState.queryStatuses.positions = SUCCESS_STATUS + if (!action.payload) return + const { account, positions, network } = action.payload + const wallet = findWalletForAccount(futuresState, account, network) + if (wallet) { + updateCrossMarginAccount(futuresState, network, wallet, { positions }) + } + }) + builder.addCase(fetchCrossMarginPositions.rejected, (futuresState) => { + futuresState.queryStatuses.positions = { + status: FetchStatus.Error, + error: 'Failed to fetch positions', + } + }) + + // TODO: Refetch cross margin position + // Refetch selected position + // builder.addCase(refetchPosition.fulfilled, (futuresState, { payload }) => { + // if (payload) { + // const { position, wallet, networkId } = payload + // const account = futuresState.accounts[networkId]?.[wallet] + + // const existingPositions = account?.positions ?? [] + // const index = existingPositions.findIndex((p) => p.marketKey === position.marketKey) + // existingPositions[index] = position + // futuresState.accounts[networkId][wallet] = { + // ...account, + // positions: existingPositions, + // } + // } + // }) + + // Fetch Isolated Open Orders + builder.addCase(fetchCrossMarginOpenOrders.pending, (futuresState) => { + futuresState.queryStatuses.openOrders = LOADING_STATUS + }) + builder.addCase(fetchCrossMarginOpenOrders.fulfilled, (futuresState, { payload }) => { + futuresState.queryStatuses.openOrders = SUCCESS_STATUS + if (payload) { + const { orders: asyncOrders, wallet, networkId } = payload + updateCrossMarginAccount(futuresState, networkId, wallet, { + asyncOrders, + }) + } + }) + builder.addCase(fetchCrossMarginOpenOrders.rejected, (futuresState) => { + futuresState.queryStatuses.openOrders = { + status: FetchStatus.Error, + error: 'Failed to fetch open orders for isolated margin', + } + }) + + // Fetch cross margin trade preview + builder.addCase(fetchCrossMarginTradePreview.pending, (futuresState) => { + futuresState.queryStatuses.tradePreview = LOADING_STATUS + }) + builder.addCase(fetchCrossMarginTradePreview.fulfilled, (futuresState, { payload }) => { + futuresState.previews[payload.type] = payload.preview + futuresState.queryStatuses.tradePreview = SUCCESS_STATUS + }) + builder.addCase(fetchCrossMarginTradePreview.rejected, (futuresState) => { + futuresState.queryStatuses.openOrders = { + status: FetchStatus.Error, + error: 'Failed to generate trade preview', + } + }) + + // Fetch cross margin account + builder.addCase(fetchPerpsV3Account.pending, (futuresState) => { + futuresState.queryStatuses.account = LOADING_STATUS + }) + builder.addCase(fetchPerpsV3Account.fulfilled, (futuresState, action) => { + if (action.payload) { + const { network, account, wallet } = action.payload + futuresState.accounts[network] = { + ...futuresState.accounts[network], + [wallet]: { + account: account, + ...ZERO_STATE_CM_ACCOUNT, + }, + } + } + futuresState.queryStatuses.account = SUCCESS_STATUS + }) + builder.addCase(fetchPerpsV3Account.rejected, (futuresState) => { + futuresState.queryStatuses.account = { + status: FetchStatus.Error, + error: 'Failed to fetch account', + } + }) + + builder.addCase(fetchAvailableMargin.pending, (futuresState) => { + futuresState.queryStatuses.availableMargin = LOADING_STATUS + }) + builder.addCase(fetchAvailableMargin.fulfilled, (futuresState, { payload }) => { + if (payload) { + const { wallet, availableMargin, network } = payload + updateCrossMarginAccount(futuresState, network, wallet, { + availableMargin, + }) + } + futuresState.queryStatuses.availableMargin = SUCCESS_STATUS + }) + builder.addCase(fetchAvailableMargin.rejected, (futuresState) => { + futuresState.queryStatuses.availableMargin = { + status: FetchStatus.Error, + error: 'Failed to fetch available margin', + } + }) + + // Fetch position history + builder.addCase(fetchPositionHistoryV3.pending, (futuresState) => { + futuresState.queryStatuses.positionHistory = LOADING_STATUS + }) + builder.addCase(fetchPositionHistoryV3.fulfilled, (futuresState, { payload }) => { + futuresState.queryStatuses.positionHistory = SUCCESS_STATUS + if (payload) { + const { history: positionHistory, networkId, wallet } = payload + updateCrossMarginAccount(futuresState, networkId, wallet, { + positionHistory, + }) + } + }) + builder.addCase(fetchPositionHistoryV3.rejected, (futuresState) => { + futuresState.queryStatuses.positionHistory = { + error: 'Failed to fetch position history', + status: FetchStatus.Error, + } + }) + + // Fetch funding rates + builder.addCase(fetchFundingRatesHistory.rejected, (futuresState) => { + futuresState.queryStatuses.historicalFundingRates = { + error: 'Failed to fetch funding rates', + status: FetchStatus.Error, + } + }) + builder.addCase(fetchFundingRatesHistory.fulfilled, (futuresState, { payload }) => { + futuresState.historicalFundingRates[payload.marketAsset] = payload.rates + }) + }, +}) + +export default crossMarginSlice.reducer + +export const { + handlePreviewError, + setMarketAsset, + setClosePositionSizeDelta, + setCrossMarginLeverageSide, + setCrossMarginLeverageInput, + clearAllTradePreviews, + setSelectedInputDenomination, + setSelectedInputFundingRateHour, + setSelectedPortfolioTimeframe, + setShowTradeHistory, + setSelectedChart, + setPerpsV3Account, + setPerpsV3MarketProxyAddress, + setCrossMarginTradeInputs, + setCrossMarginTradePreview, + incrementPreviewCrossMarginCount, +} = crossMarginSlice.actions + +const findWalletForAccount = ( + perpsV3State: CrossMarginState, + account: number, + network: NetworkId +) => { + const entry = Object.entries(perpsV3State.accounts[network]).find(([_, value]) => { + return value.account === account + }) + return entry ? entry[0] : undefined +} + +const updateCrossMarginAccount = ( + futuresState: CrossMarginState, + network: NetworkId, + wallet: string, + newAccountData: Partial +) => { + const updatedAccount = { + ...ZERO_STATE_CM_ACCOUNT, + ...futuresState.accounts[network]?.[wallet], + ...newAccountData, + } + futuresState.accounts[network] = { + ...futuresState.accounts[network], + [wallet]: updatedAccount, + } +} diff --git a/packages/app/src/state/futures/crossMargin/selectors.ts b/packages/app/src/state/futures/crossMargin/selectors.ts new file mode 100644 index 0000000000..8bb9fe2fc8 --- /dev/null +++ b/packages/app/src/state/futures/crossMargin/selectors.ts @@ -0,0 +1,417 @@ +import { ZERO_WEI } from '@kwenta/sdk/constants' +import { PositionSide, SynthV3Asset } from '@kwenta/sdk/types' +import { + MarketKeyByAsset, + calculateDesiredFillPrice, + getDefaultPriceImpact, +} from '@kwenta/sdk/utils' +import { createSelector } from '@reduxjs/toolkit' +import Wei, { wei } from '@synthetixio/wei' +import { FuturesPositionTablePosition } from 'types/futures' + +import { DEFAULT_DELAYED_CANCEL_BUFFER } from 'constants/defaults' +import { selectSynthV3Balances } from 'state/balances/selectors' +import { selectOffchainPricesInfo, selectPrices } from 'state/prices/selectors' +import { RootState } from 'state/store' +import { selectNetwork, selectWallet } from 'state/wallet/selectors' +import { + unserializePositionHistory, + unserializeTradeInputs, + unserializeTrades, + unserializeV3AsyncOrder, + unserializeV3Market, + unserializeV3Positions, +} from 'utils/futures' + +import { unserializeCrossMarginTradePreview } from '../../../utils/futures' +import { selectMarketIndexPrice, selectMarketPriceInfo } from '../common/selectors' +import { MarkPriceInfos } from '../types' + +import { AsyncOrderWithDetails, MarkPrices } from './types' + +export const selectV3MarketKey = createSelector( + (state: RootState) => state.crossMargin.selectedMarketAsset, + (marketAsset) => MarketKeyByAsset[marketAsset] +) + +export const selectV3Markets = createSelector( + selectNetwork, + (state: RootState) => state.crossMargin, + (network, crossMargin) => { + const markets = crossMargin.markets[network] ? crossMargin.markets[network] : [] + return markets.map(unserializeV3Market) + } +) + +export const selectV3MarketInfo = createSelector( + selectV3Markets, + selectV3MarketKey, + (markets, selectedMarket) => { + return markets.find((market) => market.marketKey === selectedMarket) + } +) + +export const selectV3MarketId = createSelector( + selectV3MarketInfo, + (marketInfo) => marketInfo?.marketId +) + +export const selectCrossMarginSupportedNetwork = (state: RootState) => + // TODO: Add support for mainnet + state.wallet.networkId === 420 + +export const selectCrossMarginAccount = createSelector( + selectWallet, + selectNetwork, + (state: RootState) => state.crossMargin, + (wallet, network, crossMargin) => { + return wallet ? crossMargin.accounts[network]?.[wallet]?.account : undefined + } +) + +export const selectAccountContext = createSelector( + selectWallet, + selectNetwork, + selectCrossMarginAccount, + (wallet, network, accountId) => { + return { wallet, network, accountId } + } +) + +export const selectCrossMarginAccountData = createSelector( + selectWallet, + selectNetwork, + selectCrossMarginSupportedNetwork, + (state: RootState) => state.crossMargin, + (wallet, network, supportedNetwork, crossMargin) => { + return wallet && supportedNetwork ? crossMargin.accounts[network][wallet] : null + } +) + +export const selectCrossMarginAvailableMargin = createSelector( + selectCrossMarginAccountData, + (account) => { + return wei(account?.availableMargin || 0) + } +) + +export const selectV3ProxyAddress = createSelector( + (state: RootState) => state.crossMargin, + (crossMargin) => crossMargin.perpsV3MarketProxyAddress +) + +export const selectDepositAllowances = createSelector( + selectV3ProxyAddress, + selectSynthV3Balances, + (proxyAddress, balancesAndAllowances) => { + if (!proxyAddress) return {} + return Object.keys(balancesAndAllowances).reduce>>( + (acc, asset) => { + const key = asset as SynthV3Asset + acc[key] = balancesAndAllowances[key]!.allowances[proxyAddress] + return acc + }, + {} + ) + } +) + +export const selectCrossMarginPositionHistory = createSelector( + selectCrossMarginAccountData, + (accountData) => { + return unserializePositionHistory(accountData?.positionHistory ?? []) + } +) + +export const selectCrossMarginLeverageSide = (state: RootState) => state.crossMargin.leverageSide + +export const selectCrossMarginTradeInputs = createSelector( + selectCrossMarginLeverageSide, + (state: RootState) => state.crossMargin.tradeInputs, + (side, tradeInputs) => { + const inputs = unserializeTradeInputs(tradeInputs) + const deltas = { + susdSizeDelta: side === PositionSide.LONG ? inputs.susdSize : inputs.susdSize.neg(), + nativeSizeDelta: side === PositionSide.LONG ? inputs.nativeSize : inputs.nativeSize.neg(), + } + return { + ...inputs, + ...deltas, + susdSizeString: tradeInputs.susdSize, + nativeSizeString: tradeInputs.nativeSize, + } + } +) + +export const selectAllCrossMarginTrades = createSelector( + selectCrossMarginAccountData, + selectV3Markets, + (isolatedAccountData, markets) => { + const trades = unserializeTrades(isolatedAccountData?.trades ?? []) + return trades.map((t) => { + const market = markets.find((m) => m.asset === t.asset) + return { + ...t, + market: market, + } + }) + } +) + +export const selectCrossMarginMarginTransfers = createSelector( + selectWallet, + selectNetwork, + (state: RootState) => state.crossMargin, + (wallet, network, futures) => { + if (!wallet) return [] + const account = futures.accounts[network]?.[wallet] + return account?.marginTransfers ?? [] + } +) + +export const selectMarkPricesV3 = createSelector( + selectV3Markets, + selectPrices, + (markets, prices) => { + const markPrices: MarkPrices = {} + return markets.reduce((acc, market) => { + const price = prices[market.asset]?.offChain ?? wei(0) + return { + ...acc, + [market.marketKey]: wei(price).mul( + wei(market.marketSkew).div(market.settings.skewScale).add(1) + ), + } + }, markPrices) + } +) + +export const selectMarkPriceInfosV3 = createSelector( + selectV3Markets, + selectOffchainPricesInfo, + (markets, prices) => { + const markPrices: MarkPriceInfos = {} + return markets.reduce((acc, market) => { + const price = prices[market.asset]?.price ?? wei(0) + return { + ...acc, + [market.marketKey]: { + price: wei(price).mul(wei(market.marketSkew).div(market.settings.skewScale).add(1)), + change: prices[market.asset]?.change ?? null, + }, + } + }, markPrices) + } +) + +export const selectCrossMarginPositions = createSelector( + selectCrossMarginAccountData, + selectV3Markets, + selectMarkPricesV3, + (account, markets, markPrices) => { + const positions = unserializeV3Positions(account?.positions ?? []) + return positions.reduce((acc, position) => { + const market = markets.find((market) => market.marketId === position.marketId) + + if (market) { + const markPrice = markPrices[market?.marketKey!] ?? wei(0) + + acc.push({ + ...position, + market: market, + notionalValue: position.size.mul(markPrice), + lastPrice: markPrice, + initialMargin: wei(0), + leverage: wei(0), + marginRatio: wei(0), + avgEntryPrice: wei(0), + + // TODO: Liquidation state + canLiquidatePosition: false, + liquidationPrice: wei(0), + }) + } + return acc + }, []) + } +) + +export const selectCrossMarginPosition = createSelector( + selectCrossMarginPositions, + selectV3MarketInfo, + (positions, market) => { + const position = positions.find((p) => p.market.marketKey === market?.marketKey) + return position + } +) + +export const selectAsyncCrossMarginOrders = createSelector( + selectV3Markets, + selectCrossMarginAccountData, + (markets, account) => { + return (account?.asyncOrders.map(unserializeV3AsyncOrder) ?? []).reduce< + AsyncOrderWithDetails[] + >((acc, o) => { + const market = markets.find((m) => m.marketId === o.marketId) + + const strategy = market?.settlementStrategies.find( + (s) => s.strategyId === o.settlementStrategyId + ) + if (account && market && strategy) { + const startTime = Number(o.settlementTime) + const expirationTime = startTime + Number(strategy.settlementWindowDuration) + const timePastExecution = Math.floor((Date.now() - startTime) / 1000) + const executable = timePastExecution <= expirationTime + const isStale = + timePastExecution > + DEFAULT_DELAYED_CANCEL_BUFFER + strategy.settlementWindowDuration.toNumber() + + const order = { + market, + account: Number(account.account), + size: o.sizeDelta, + executableStartTime: startTime, + expirationTime: expirationTime, + marginDelta: wei(0), + desiredFillPrice: wei(o.acceptablePrice), + settlementWindowDuration: strategy.settlementWindowDuration.toNumber(), + side: o.side, + isStale: isStale, + isExecutable: executable, + settlementFee: strategy.settlementReward, + } + acc.push(order) + } + return acc + }, []) + } +) + +export const selectShowCrossMarginOnboard = (state: RootState) => + state.app.showModal === 'futures_cross_margin_onboard' + +export const selectWithdrawableCrossMargin = createSelector( + selectCrossMarginAvailableMargin, + (available) => { + // TODO: Calculate withdrawable based on maintenance margin + return available + } +) + +export const selectCrossMarginTradePreview = createSelector( + selectCrossMarginTradeInputs, + (state: RootState) => state.crossMargin.previews.trade, + ({ nativeSizeDelta }, preview) => { + const priceImpact = getDefaultPriceImpact('market') + const desiredFillPrice = calculateDesiredFillPrice( + nativeSizeDelta, + wei(preview?.fillPrice || 0), + priceImpact + ) + + const unserialized = preview ? unserializeCrossMarginTradePreview(preview) : undefined + return { + ...unserialized, + desiredFillPrice, + } + } +) + +// TODO: Correct max leverage calc for V3 +export const selectCrossMarginMaxLeverage = createSelector(selectV3MarketInfo, (market) => { + let adjustedMaxLeverage = market?.appMaxLeverage ?? wei(1) + return adjustedMaxLeverage +}) + +export const selectEditCMPositionModalMarketId = (state: RootState) => + state.app.showPositionModal?.marketKey + +export const selectCloseCMPositionModalInfo = createSelector( + selectEditCMPositionModalMarketId, + selectCrossMarginPositions, + selectV3Markets, + selectPrices, + (marketKey, crossPositions, markets, prices) => { + const position = crossPositions.find( + (p) => p.market.version === 3 && p.market.marketKey === marketKey + ) + const market = markets.find((m) => m.marketKey === marketKey) + if (!market) return { position: null, market: null, marketPrice: wei(0) } + const price = prices[market.asset] + // Note this assumes the order type is always delayed off chain + return { position, market, marketPrice: price.offChain || wei(0) } + } +) + +export const selectCloseCMPositionOrderInputs = createSelector( + (state: RootState) => state.crossMargin, + (crossMargin) => { + return crossMargin.closePositionOrderInputs + } +) + +export const selectCloseCMPositionPreview = createSelector( + selectCloseCMPositionModalInfo, + (state: RootState) => state.crossMargin, + ({ position, marketPrice }, crossMargin) => { + const preview = crossMargin.previews.close + const unserialized = preview ? unserializeCrossMarginTradePreview(preview) : null + if (unserialized) { + const priceImpact = getDefaultPriceImpact('market') + const desiredFillPrice = calculateDesiredFillPrice( + position?.side === PositionSide.LONG ? wei(-1) : wei(1), + marketPrice, + priceImpact + ) + + return { + ...unserialized, + price: marketPrice, + desiredFillPrice, + leverage: wei(0), + } + } + return null + } +) + +export const selectPendingAsyncOrdersCount = createSelector( + selectAsyncCrossMarginOrders, + (orders) => { + return orders.length + } +) + +export const selectActiveCrossMarginPositionsCount = createSelector( + selectCrossMarginPositions, + (positions) => { + return positions.filter((p) => !!p).length + } +) + +export const selectV3SkewAdjustedPrice = createSelector( + selectMarketIndexPrice, + selectV3MarketInfo, + (price, marketInfo) => { + if (!marketInfo?.marketSkew || !marketInfo?.settings.skewScale) return price + return price + ? wei(price).mul(wei(marketInfo.marketSkew).div(marketInfo.settings.skewScale).add(1)) + : ZERO_WEI + } +) + +export const selectV3SkewAdjustedPriceInfo = createSelector( + selectMarketPriceInfo, + selectV3MarketInfo, + (priceInfo, marketInfo) => { + if (!marketInfo?.marketSkew || !marketInfo?.settings.skewScale) return priceInfo + return priceInfo + ? { + price: wei(priceInfo.price).mul( + wei(marketInfo.marketSkew).div(marketInfo.settings.skewScale).add(1) + ), + change: priceInfo?.change, + } + : undefined + } +) diff --git a/packages/app/src/state/futures/crossMargin/types.ts b/packages/app/src/state/futures/crossMargin/types.ts new file mode 100644 index 0000000000..6b07b4fc7c --- /dev/null +++ b/packages/app/src/state/futures/crossMargin/types.ts @@ -0,0 +1,172 @@ +import { Period } from '@kwenta/sdk/constants' +import { + TransactionStatus, + FuturesPositionHistory, + FuturesVolumes, + PositionSide, + FuturesMarketKey, + FuturesMarketAsset, + PotentialTradeStatus, + PerpsV3AsyncOrder, + PerpsMarketV3, + PerpsMarketV2, + PerpsV3Position, +} from '@kwenta/sdk/types' +import Wei from '@synthetixio/wei' + +import { PricesInfo } from 'state/prices/types' +import { QueryStatus } from 'state/types' + +import { FuturesAccountData, FuturesQueryStatuses, TradeSizeInputs } from '../common/types' + +export type EditPositionInputs = { + nativeSizeDelta: T + marginDelta: T +} + +export type ClosePositionInputs = { + nativeSizeDelta: T +} + +export type MarkPrices = Partial> + +export type MarkPriceInfos = Partial>> + +export type FundingRate = { + asset: FuturesMarketKey + fundingTitle: string + fundingRate: T | null +} + +export type PerpsV3Portfolio = { + account: string + timestamp: number + assets: { + [asset: string]: number + } + total: number +} + +export type PortfolioValues = { + timestamp: number + total: number +} + +export type CrossMarginTransactionType = + | 'deposit_perps_v3' + | 'withdraw_perps_v3' + | 'approve_perps_v3' + | 'modify_perps_v3' + | 'close_perps_v3' + | 'cancel_delayed_perps_v3' + | 'execute_delayed_perps_v3' + | 'create_account_perps_v3' + +export type CrossMarginTransaction = { + type: CrossMarginTransactionType + status: TransactionStatus + error?: string + hash: string | null +} + +type FuturesNetwork = number + +export type InputCurrencyDenomination = 'usd' | 'native' + +export type FundingRatePeriods = { + [key: number]: string +} + +export type CrossMarginQueryStatuses = FuturesQueryStatuses & { + availableMargin: QueryStatus +} + +export type CrossMarginAccountData = FuturesAccountData & { + account: number + asyncOrders: PerpsV3AsyncOrder[] + balances: { [asset: string]: { balance: string; allowance: string } } + availableMargin: string + position?: PerpsV3Position + positions?: PerpsV3Position[] + positionHistory: FuturesPositionHistory[] +} + +export type CrossMarginTradePreview = { + marketId: number + sizeDelta: T + fillPrice: T + fee: T + leverage: T + notionalValue: T + settlementFee: T + side: PositionSide + status: PotentialTradeStatus + showStatus?: boolean + statusMessage?: string + priceImpact: T +} + +export type CrossMarginState = { + markets: Record[]> + tradeInputs: TradeSizeInputs + editPositionInputs: EditPositionInputs + orderType: 'market' + previews: { + trade: CrossMarginTradePreview | null + close: CrossMarginTradePreview | null + edit: CrossMarginTradePreview | null + } + confirmationModalOpen: boolean + closePositionOrderInputs: ClosePositionInputs + previewDebounceCount: number + leverageSide: PositionSide + selectedMarketAsset: FuturesMarketAsset + leverageInput: string + tradeFee: string + perpsV3MarketProxyAddress: string | undefined + accounts: Record< + FuturesNetwork, + { + [wallet: string]: CrossMarginAccountData + } + > + fundingRates: FundingRate[] + queryStatuses: CrossMarginQueryStatuses + dailyMarketVolumes: FuturesVolumes + selectedInputDenomination: InputCurrencyDenomination + selectedInputHours: number + selectedChart: 'price' | 'funding' + preferences: { + showHistory?: boolean + } + dashboard: { + selectedPortfolioTimeframe: Period + } + historicalFundingRates: Partial< + Record + > +} + +export type CrossPerpsPortfolio = { + account: string + timestamp: number + assets: { + [asset: string]: number + } + total: number +} + +export type AsyncOrderWithDetails = { + account: number + size: Wei + executableStartTime: number + expirationTime: number + settlementFee: Wei + marginDelta: Wei + desiredFillPrice: Wei + side: PositionSide + isStale: boolean + isExecutable: boolean + settlementWindowDuration: number + market: PerpsMarketV3 | PerpsMarketV2 +} diff --git a/packages/app/src/state/futures/hooks.ts b/packages/app/src/state/futures/hooks.ts index 3a916127fb..4ae761971e 100644 --- a/packages/app/src/state/futures/hooks.ts +++ b/packages/app/src/state/futures/hooks.ts @@ -1,28 +1,37 @@ +import { FuturesMarginType } from '@kwenta/sdk/types' + +import { + fetchCrossMarginAccountData, + fetchCrossMarginMarketData, + fetchCrossMarginOpenOrders, + fetchCrossMarginPositions, + fetchPerpsV3Account, +} from 'state/futures/crossMargin/actions' +import { + selectCrossMarginAccount, + selectCrossMarginSupportedNetwork, +} from 'state/futures/crossMargin/selectors' import { useAppSelector, useFetchAction, usePollAction } from 'state/hooks' import { fetchStakeMigrateData } from 'state/staking/actions' import { selectSelectedEpoch, selectStakingSupportedNetwork } from 'state/staking/selectors' import { selectNetwork, selectWallet } from 'state/wallet/selectors' +import { fetchFuturesPositionHistory, fetchMarginTransfers } from './actions' +import { selectFuturesType } from './common/selectors' +import { selectMarkets } from './selectors' import { - fetchCrossMarginAccount, - fetchCrossMarginAccountData, - fetchFuturesPositionHistory, - fetchIsolatedMarginAccountData, - fetchCrossMarginOpenOrders, - fetchSharedFuturesData, - fetchIsolatedOpenOrders, - fetchMarginTransfers, - fetchAllTradesForAccount, - fetchCombinedMarginTransfers, + fetchAllV2TradesForAccount, fetchFuturesFees, fetchFuturesFeesForAccount, -} from './actions' + fetchSmartMarginAccount, + fetchSmartMarginAccountData, + fetchSmartMarginMarketData, + fetchSmartMarginOpenOrders, +} from './smartMargin/actions' import { - selectCrossMarginAccount, - selectFuturesSupportedNetwork, - selectFuturesType, - selectMarkets, -} from './selectors' + selectSmartMarginAccount, + selectSmartMarginSupportedNetwork, +} from './smartMargin/selectors' // TODO: Optimise polling and queries @@ -30,51 +39,83 @@ export const usePollMarketFuturesData = () => { const networkId = useAppSelector(selectNetwork) const markets = useAppSelector(selectMarkets) const wallet = useAppSelector(selectWallet) - const crossMarginAddress = useAppSelector(selectCrossMarginAccount) + const smartMarginAddress = useAppSelector(selectSmartMarginAccount) + const crossMarginAccount = useAppSelector(selectCrossMarginAccount) + const selectedAccountType = useAppSelector(selectFuturesType) - const networkSupportsCrossMargin = useAppSelector(selectFuturesSupportedNetwork) - const networkSupportsFutures = useAppSelector(selectFuturesSupportedNetwork) + const networkSupportsSmartMargin = useAppSelector(selectSmartMarginSupportedNetwork) + const networkSupportsCrossMargin = useAppSelector(selectCrossMarginSupportedNetwork) - useFetchAction(fetchCrossMarginAccount, { - dependencies: [networkId, wallet], - disabled: !wallet || !networkSupportsCrossMargin || selectedAccountType === 'isolated_margin', + useFetchAction(fetchSmartMarginAccount, { + dependencies: [networkId, wallet, selectedAccountType], + disabled: + !wallet || + !networkSupportsSmartMargin || + selectedAccountType !== FuturesMarginType.SMART_MARGIN, + }) + + useFetchAction(fetchPerpsV3Account, { + dependencies: [networkId, wallet, selectedAccountType], + disabled: + !wallet || + !networkSupportsCrossMargin || + selectedAccountType !== FuturesMarginType.CROSS_MARGIN, }) useFetchAction(fetchMarginTransfers, { dependencies: [networkId, wallet, selectedAccountType] }) - usePollAction('fetchSharedFuturesData', fetchSharedFuturesData, { + + usePollAction('fetchSmartMarginMarketData', fetchSmartMarginMarketData, { dependencies: [networkId], intervalTime: 60000, - disabled: !networkSupportsFutures, + disabled: !networkSupportsSmartMargin || selectedAccountType !== FuturesMarginType.SMART_MARGIN, }) - usePollAction('fetchIsolatedMarginAccountData', fetchIsolatedMarginAccountData, { + + usePollAction('fetchCrossMarginMarketData', fetchCrossMarginMarketData, { + dependencies: [networkId], + intervalTime: 60000, + disabled: !networkSupportsCrossMargin || selectedAccountType !== FuturesMarginType.CROSS_MARGIN, + }) + + usePollAction('fetchCrossMarginPositions', fetchCrossMarginPositions, { intervalTime: 30000, dependencies: [wallet, markets.length], - disabled: !wallet || !markets.length || selectedAccountType === 'cross_margin', + disabled: !wallet || !markets.length || selectedAccountType !== FuturesMarginType.CROSS_MARGIN, + }) + usePollAction('fetchSmartMarginAccountData', fetchSmartMarginAccountData, { + intervalTime: 30000, + dependencies: [markets.length, smartMarginAddress], + disabled: + !markets.length || + !smartMarginAddress || + selectedAccountType !== FuturesMarginType.SMART_MARGIN, }) usePollAction('fetchCrossMarginAccountData', fetchCrossMarginAccountData, { intervalTime: 30000, - dependencies: [markets.length, crossMarginAddress], - disabled: !markets.length || !crossMarginAddress || selectedAccountType === 'isolated_margin', + dependencies: [markets.length, crossMarginAccount], + disabled: + !markets.length || + !crossMarginAccount || + selectedAccountType !== FuturesMarginType.CROSS_MARGIN, }) usePollAction('fetchFuturesPositionHistory', fetchFuturesPositionHistory, { intervalTime: 15000, - dependencies: [wallet, crossMarginAddress], + dependencies: [wallet, smartMarginAddress], disabled: !wallet, }) - usePollAction('fetchIsolatedOpenOrders', fetchIsolatedOpenOrders, { + usePollAction('fetchCrossMarginOpenOrders', fetchCrossMarginOpenOrders, { dependencies: [networkId, wallet, markets.length, selectedAccountType], intervalTime: 10000, - disabled: !wallet || selectedAccountType === 'cross_margin', + disabled: !wallet || selectedAccountType !== FuturesMarginType.CROSS_MARGIN, }) - usePollAction('fetchCrossMarginOpenOrders', fetchCrossMarginOpenOrders, { - dependencies: [networkId, wallet, markets.length, crossMarginAddress], + usePollAction('fetchSmartMarginOpenOrders', fetchSmartMarginOpenOrders, { + dependencies: [networkId, wallet, markets.length, smartMarginAddress], intervalTime: 10000, - disabled: !wallet || selectedAccountType === 'isolated_margin', + disabled: !wallet || selectedAccountType !== FuturesMarginType.SMART_MARGIN, }) - usePollAction('fetchAllTradesForAccount', fetchAllTradesForAccount, { - dependencies: [networkId, wallet, crossMarginAddress, selectedAccountType], + usePollAction('fetchAllV2TradesForAccount', fetchAllV2TradesForAccount, { + dependencies: [networkId, wallet, smartMarginAddress, selectedAccountType], intervalTime: 30000, disabled: !wallet, }) @@ -84,36 +125,49 @@ export const usePollDashboardFuturesData = () => { const networkId = useAppSelector(selectNetwork) const markets = useAppSelector(selectMarkets) const wallet = useAppSelector(selectWallet) - const crossMarginAddress = useAppSelector(selectCrossMarginAccount) - const networkSupportsCrossMargin = useAppSelector(selectFuturesSupportedNetwork) + const crossMarginAddress = useAppSelector(selectSmartMarginAccount) + const networkSupportsCrossMargin = useAppSelector(selectSmartMarginSupportedNetwork) + const networkSupportsSmartMargin = useAppSelector(selectSmartMarginSupportedNetwork) const selectedAccountType = useAppSelector(selectFuturesType) - useFetchAction(fetchCombinedMarginTransfers, { + useFetchAction(fetchMarginTransfers, { dependencies: [networkId, wallet], disabled: !wallet, }) - useFetchAction(fetchCrossMarginAccount, { + useFetchAction(fetchSmartMarginAccount, { dependencies: [networkId, wallet], - disabled: !wallet || !networkSupportsCrossMargin || selectedAccountType === 'isolated_margin', + disabled: + !wallet || + !networkSupportsCrossMargin || + selectedAccountType === FuturesMarginType.CROSS_MARGIN, }) - usePollAction('fetchSharedFuturesData', fetchSharedFuturesData, { + usePollAction('fetchSmartMarginMarketData', fetchSmartMarginMarketData, { dependencies: [networkId], intervalTime: 60000, + disabled: !networkSupportsSmartMargin, }) - usePollAction('fetchIsolatedMarginAccountData', fetchIsolatedMarginAccountData, { + usePollAction('fetchCrossMarginMarketData', fetchCrossMarginMarketData, { + dependencies: [networkId], + intervalTime: 60000, + disabled: !networkSupportsCrossMargin, + }) + + usePollAction('fetchSmartMarginAccountData', fetchSmartMarginAccountData, { intervalTime: 30000, dependencies: [wallet, markets.length, networkId], disabled: !markets.length || !wallet, }) - usePollAction('fetchCrossMarginAccountData', fetchCrossMarginAccountData, { - intervalTime: 30000, - dependencies: [wallet, markets.length, networkId, crossMarginAddress], - disabled: !markets.length || !crossMarginAddress, - }) - usePollAction('fetchAllTradesForAccount', fetchAllTradesForAccount, { + + // TODO: Fetch + // usePollAction('fetchCrossMarginAccountData', fetchCrossM, { + // intervalTime: 30000, + // dependencies: [wallet, markets.length, networkId, crossMarginAddress], + // disabled: !markets.length || !crossMarginAddress, + // }) + usePollAction('fetchAllV2TradesForAccount', fetchAllV2TradesForAccount, { dependencies: [networkId, wallet, selectedAccountType, crossMarginAddress], intervalTime: 30000, disabled: !wallet, diff --git a/packages/app/src/state/futures/reducer.ts b/packages/app/src/state/futures/reducer.ts index 12c3f1d472..c9b5401e2d 100644 --- a/packages/app/src/state/futures/reducer.ts +++ b/packages/app/src/state/futures/reducer.ts @@ -1,79 +1,22 @@ import { Period } from '@kwenta/sdk/constants' -import { - NetworkId, - SmartMarginOrderType, - FuturesAccountType, - FuturesMarketAsset, - FuturesMarketKey, - FuturesPotentialTradeDetails, - PositionSide, - FuturesTrade, - FuturesOrderType, -} from '@kwenta/sdk/types' -import { MarketKeyByAsset } from '@kwenta/sdk/utils' import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { DEFAULT_FUTURES_MARGIN_TYPE } from 'constants/defaults' -import { ORDER_PREVIEW_ERRORS } from 'queries/futures/constants' import { DEFAULT_MAP_BY_NETWORK, DEFAULT_QUERY_STATUS, LOADING_STATUS, SUCCESS_STATUS, - ZERO_CM_FEES, - ZERO_STATE_CM_ACCOUNT, - ZERO_STATE_ISOLATED_ACCOUNT, - ZERO_STATE_TRADE_INPUTS, } from 'state/constants' -import { accountType } from 'state/helpers' import { FetchStatus } from 'state/types' -import { - fetchCrossMarginBalanceInfo, - fetchCrossMarginPositions, - fetchIsolatedMarginPositions, - fetchMarkets, - fetchDailyVolumes, - refetchPosition, - fetchCrossMarginOpenOrders, - fetchIsolatedMarginTradePreview, - fetchCrossMarginTradePreview, - fetchCrossMarginAccount, - fetchFuturesPositionHistory, - fetchPositionHistoryForTrader, - fetchTradesForSelectedMarket, - fetchAllTradesForAccount, - fetchIsolatedOpenOrders, - fetchMarginTransfers, - fetchCombinedMarginTransfers, - fetchFundingRatesHistory, - fetchFuturesFees, - fetchFuturesFeesForAccount, -} from './actions' -import { - CrossMarginAccountData, - CrossMarginState, - CrossMarginTradeFees, - EditPositionInputs, - InputCurrencyDenomination, - IsolatedAccountData, - TradeSizeInputs, - FuturesState, - TransactionEstimationPayload, - TransactionEstimations, - PreviewAction, -} from './types' +import { fetchPositionHistoryForTrader } from './actions' +import { AppFuturesMarginType } from './common/types' +import { InputCurrencyDenomination, FuturesState } from './types' export const FUTURES_INITIAL_STATE: FuturesState = { selectedType: DEFAULT_FUTURES_MARGIN_TYPE, confirmationModalOpen: false, - markets: { - 420: [], - 10: [], - }, - dailyMarketVolumes: {}, - errors: {}, - fundingRates: [], selectedInputDenomination: 'usd', selectedInputHours: 1, selectedChart: 'price', @@ -87,298 +30,32 @@ export const FUTURES_INITIAL_STATE: FuturesState = { selectedTrader: undefined, selectedTraderPositionHistory: DEFAULT_MAP_BY_NETWORK, }, + tradePanelDrawerOpen: false, + historicalFundingRatePeriod: Period.TWO_WEEKS, queryStatuses: { - markets: DEFAULT_QUERY_STATUS, - crossMarginBalanceInfo: DEFAULT_QUERY_STATUS, - dailyVolumes: DEFAULT_QUERY_STATUS, - crossMarginPositions: DEFAULT_QUERY_STATUS, - crossMarginPositionHistory: DEFAULT_QUERY_STATUS, - isolatedPositions: DEFAULT_QUERY_STATUS, - isolatedPositionHistory: DEFAULT_QUERY_STATUS, - openOrders: DEFAULT_QUERY_STATUS, - isolatedTradePreview: DEFAULT_QUERY_STATUS, - crossMarginTradePreview: DEFAULT_QUERY_STATUS, - crossMarginAccount: DEFAULT_QUERY_STATUS, - positionHistory: DEFAULT_QUERY_STATUS, selectedTraderPositionHistory: DEFAULT_QUERY_STATUS, - trades: DEFAULT_QUERY_STATUS, - marginTransfers: DEFAULT_QUERY_STATUS, - historicalFundingRates: DEFAULT_QUERY_STATUS, - futuresFees: DEFAULT_QUERY_STATUS, - futuresFeesForAccount: DEFAULT_QUERY_STATUS, - }, - transactionEstimations: {} as TransactionEstimations, - crossMargin: { - accounts: DEFAULT_MAP_BY_NETWORK, - selectedMarketAsset: FuturesMarketAsset.sETH, - selectedMarketKey: FuturesMarketKey.sETHPERP, - leverageSide: PositionSide.LONG, - orderType: 'market', - orderFeeCap: '0', - leverageInput: '0', - selectedLeverageByAsset: {}, - showCrossMarginOnboard: false, - tradeInputs: ZERO_STATE_TRADE_INPUTS, - sltpModalInputs: { - stopLossPrice: '', - takeProfitPrice: '', - }, - editPositionInputs: { - nativeSizeDelta: '', - marginDelta: '', - }, - closePositionOrderInputs: { - orderType: 'market', - nativeSizeDelta: '', - price: { - value: '', - invalidLabel: undefined, - }, - }, - fees: ZERO_CM_FEES, - previews: { - trade: null, - close: null, - edit: null, - }, - previewDebounceCount: 0, - marginDelta: '0', - cancellingOrder: undefined, - depositApproved: false, - orderPrice: { - price: undefined, - invalidLabel: undefined, - }, - }, - isolatedMargin: { - accounts: DEFAULT_MAP_BY_NETWORK, - selectedMarketAsset: FuturesMarketAsset.sETH, - selectedMarketKey: FuturesMarketKey.sETHPERP, - leverageSide: PositionSide.LONG, - orderType: 'market', - previews: { - trade: null, - close: null, - edit: null, - }, - closePositionOrderInputs: { - orderType: 'market', - nativeSizeDelta: '', - }, - previewDebounceCount: 0, - tradeInputs: ZERO_STATE_TRADE_INPUTS, - editPositionInputs: { - nativeSizeDelta: '', - marginDelta: '', - }, - tradeFee: '0', - leverageInput: '0', }, - tradePanelDrawerOpen: false, - historicalFundingRatePeriod: Period.TWO_WEEKS, - historicalFundingRates: {}, - futuresFees: '0', - futuresFeesForAccount: '0', } const futuresSlice = createSlice({ name: 'futures', initialState: FUTURES_INITIAL_STATE, reducers: { - setMarketAsset: (state, action) => { - state[accountType(state.selectedType)].selectedMarketAsset = action.payload - state[accountType(state.selectedType)].selectedMarketKey = - MarketKeyByAsset[action.payload as FuturesMarketAsset] - state[accountType(state.selectedType)].tradeInputs = ZERO_STATE_TRADE_INPUTS - state[accountType(state.selectedType)].selectedMarketAsset = action.payload - }, - setOrderType: (state, action: PayloadAction) => { - state[accountType(state.selectedType)].orderType = action.payload - }, - setClosePositionOrderType: (state, action: PayloadAction) => { - state.crossMargin.closePositionOrderInputs.orderType = action.payload - }, - setClosePositionSizeDelta: (state, action: PayloadAction) => { - if (state.selectedType === 'cross_margin') { - state.crossMargin.closePositionOrderInputs.nativeSizeDelta = action.payload - } else { - state.isolatedMargin.closePositionOrderInputs.nativeSizeDelta = action.payload - } - }, - setClosePositionPrice: ( - state, - action: PayloadAction<{ value: string; invalidLabel: string | null | undefined }> - ) => { - state.crossMargin.closePositionOrderInputs.price = action.payload - }, - setOrderFeeCap: (state, action) => { - state.crossMargin.orderFeeCap = action.payload - }, - setLeverageSide: (state, action) => { - state[accountType(state.selectedType)].leverageSide = action.payload - }, - setCrossMarginLeverageForAsset: ( - state, - action: PayloadAction<{ marketKey: FuturesMarketKey; leverage: string }> - ) => { - state.crossMargin.selectedLeverageByAsset[action.payload.marketKey] = action.payload.leverage - }, - setCrossMarginMarginDelta: (state, action: PayloadAction) => { - state.crossMargin.marginDelta = action.payload - }, - setCrossMarginTradeStopLoss: (state, action: PayloadAction) => { - state.crossMargin.tradeInputs.stopLossPrice = action.payload - }, - setCrossMarginTradeTakeProfit: (state, action: PayloadAction) => { - state.crossMargin.tradeInputs.takeProfitPrice = action.payload - }, - setSLTPModalStopLoss: (state, action: PayloadAction) => { - state.crossMargin.sltpModalInputs.stopLossPrice = action.payload - }, - setSLTPModalTakeProfit: (state, action: PayloadAction) => { - state.crossMargin.sltpModalInputs.takeProfitPrice = action.payload - }, - setFuturesAccountType: (state, action) => { + setFuturesAccountType: (state, action: PayloadAction) => { state.selectedType = action.payload }, - setCrossMarginTradeInputs: (state, action: PayloadAction>) => { - state.crossMargin.tradeInputs = action.payload - }, - setCrossMarginEditPositionInputs: ( - state, - action: PayloadAction> - ) => { - state.crossMargin.editPositionInputs = action.payload - }, - setCrossMarginOrderPrice: (state, action: PayloadAction) => { - state.crossMargin.orderPrice.price = action.payload - }, - setCrossMarginOrderPriceInvalidLabel: ( - state, - action: PayloadAction - ) => { - state.crossMargin.orderPrice.invalidLabel = action.payload - }, - setIsolatedMarginTradeInputs: (state, action: PayloadAction>) => { - state.isolatedMargin.tradeInputs = action.payload - }, - setIsolatedMarginEditPositionInputs: ( - state, - action: PayloadAction> - ) => { - state.isolatedMargin.editPositionInputs = action.payload - }, setSelectedInputDenomination: (state, action: PayloadAction) => { state.selectedInputDenomination = action.payload }, setSelectedInputFundingRateHour: (state, action: PayloadAction) => { state.selectedInputHours = action.payload }, - setIsolatedMarginFee: (state, action: PayloadAction) => { - state.isolatedMargin.tradeFee = action.payload - }, - setLeverageInput: (state, action: PayloadAction) => { - state[accountType(state.selectedType)].leverageInput = action.payload - }, - setCrossMarginFees: (state, action: PayloadAction>) => { - state.crossMargin.fees = action.payload - }, - setKeeperDeposit: (state, action: PayloadAction) => { - state.crossMargin.fees.keeperEthDeposit = action.payload - }, - handlePreviewError: ( - futuresState, - { - payload, - }: PayloadAction<{ - error: string - previewType: PreviewAction - }> - ) => { - const selectedAccountType = futuresState.selectedType - const message = Object.values(ORDER_PREVIEW_ERRORS).includes(payload.error) - ? payload.error - : 'Failed to get trade preview' - futuresState.queryStatuses.crossMarginTradePreview = { - status: FetchStatus.Error, - error: message, - } - futuresState[accountType(selectedAccountType)].previews[payload.previewType] = null - }, - - setCrossMarginAccount: ( - state, - action: PayloadAction<{ wallet: string; account: string; network: NetworkId }> - ) => { - const { account, wallet, network } = action.payload - if (!state.crossMargin.accounts[network]?.[wallet]?.account) { - state.crossMargin.accounts[network] = { - ...state.crossMargin.accounts[network], - [wallet]: { - account: account, - ...ZERO_STATE_CM_ACCOUNT, - }, - } - } - }, - setTransactionEstimate: (state, action: PayloadAction) => { - state.transactionEstimations[action.payload.type] = { - limit: action.payload.limit, - cost: action.payload.cost, - error: action.payload.error, - } - }, - setIsolatedTradePreview: ( - state, - { - payload, - }: PayloadAction<{ - preview: FuturesPotentialTradeDetails | null - type: PreviewAction - }> - ) => { - state.isolatedMargin.previews[payload.type] = payload.preview - }, - clearAllTradePreviews: (state) => { - state.isolatedMargin.previews = { - edit: null, - trade: null, - close: null, - } - state.crossMargin.previews = { - edit: null, - trade: null, - close: null, - } - state.queryStatuses.isolatedTradePreview = DEFAULT_QUERY_STATUS - state.queryStatuses.crossMarginTradePreview = DEFAULT_QUERY_STATUS - }, - setCrossMarginTradePreview: ( - state, - { - payload, - }: PayloadAction<{ - preview: FuturesPotentialTradeDetails | null - type: PreviewAction - }> - ) => { - state.crossMargin.previews[payload.type] = payload.preview - }, - setCrossMarginOrderCancelling: (state, { payload }: PayloadAction) => { - state.crossMargin.cancellingOrder = payload - }, setSelectedTrader: ( state, - action: PayloadAction<{ trader: string; traderEns?: string | null } | undefined> + action: PayloadAction<{ trader: string; traderEns: string | undefined | null } | undefined> ) => { state.leaderboard.selectedTrader = action.payload }, - incrementIsolatedPreviewCount: (state) => { - state.isolatedMargin.previewDebounceCount = state.isolatedMargin.previewDebounceCount + 1 - }, - incrementCrossPreviewCount: (state) => { - state.crossMargin.previewDebounceCount = state.crossMargin.previewDebounceCount + 1 - }, setSelectedPortfolioTimeframe: (state, action: PayloadAction) => { state.dashboard.selectedPortfolioTimeframe = action.payload }, @@ -395,295 +72,8 @@ const futuresSlice = createSlice({ state.historicalFundingRatePeriod = action.payload }, }, - extraReducers: (builder) => { - // Markets - builder.addCase(fetchMarkets.pending, (futuresState) => { - futuresState.queryStatuses.markets = LOADING_STATUS - }) - builder.addCase(fetchMarkets.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.markets = SUCCESS_STATUS - if (payload) { - futuresState.markets[payload.networkId] = payload.markets - } - }) - builder.addCase(fetchMarkets.rejected, (futuresState) => { - futuresState.queryStatuses.markets = { - status: FetchStatus.Error, - error: 'Failed to fetch markets', - } - }) - - // Cross margin overview - builder.addCase(fetchCrossMarginBalanceInfo.pending, (futuresState) => { - futuresState.queryStatuses.crossMarginBalanceInfo = LOADING_STATUS - }) - builder.addCase(fetchCrossMarginBalanceInfo.fulfilled, (futuresState, action) => { - futuresState.queryStatuses.crossMarginBalanceInfo = SUCCESS_STATUS - if (action.payload) { - const { account, network, balanceInfo } = action.payload - const wallet = findWalletForAccount(futuresState.crossMargin, account, network) - if (wallet) { - updateFuturesAccount(futuresState, 'cross_margin', network, wallet, { balanceInfo }) - } - } - }) - builder.addCase(fetchCrossMarginBalanceInfo.rejected, (futuresState) => { - futuresState.queryStatuses.crossMarginBalanceInfo = { - status: FetchStatus.Error, - error: 'Failed to fetch balance info', - } - }) - - // Daily volumes - builder.addCase(fetchDailyVolumes.pending, (futuresState) => { - futuresState.queryStatuses.dailyVolumes = LOADING_STATUS - }) - builder.addCase(fetchDailyVolumes.fulfilled, (futuresState, action) => { - futuresState.queryStatuses.dailyVolumes = SUCCESS_STATUS - futuresState.dailyMarketVolumes = action.payload - }) - builder.addCase(fetchDailyVolumes.rejected, (futuresState) => { - futuresState.queryStatuses.dailyVolumes = { - status: FetchStatus.Error, - error: 'Failed to fetch volume data', - } - }) - - // margin transfers - builder.addCase(fetchMarginTransfers.pending, (futuresState) => { - futuresState.queryStatuses.marginTransfers = LOADING_STATUS - }) - builder.addCase(fetchMarginTransfers.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.marginTransfers = SUCCESS_STATUS - if (payload) { - const { context, marginTransfers, idleTransfers } = payload - const newAccountData = - context.type === 'isolated_margin' - ? { marginTransfers } - : { - marginTransfers, - idleTransfers, - } - updateFuturesAccount( - futuresState, - context.type, - context.network, - context.wallet, - newAccountData - ) - } - }) - builder.addCase(fetchMarginTransfers.rejected, (futuresState) => { - futuresState.queryStatuses.marginTransfers = { - status: FetchStatus.Error, - error: 'Failed to fetch margin transfers', - } - }) - - // combined margin transfers - builder.addCase(fetchCombinedMarginTransfers.pending, (futuresState) => { - futuresState.queryStatuses.marginTransfers = LOADING_STATUS - }) - builder.addCase(fetchCombinedMarginTransfers.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.marginTransfers = SUCCESS_STATUS - if (payload) { - const { context, isolatedMarginTransfers, smartMarginTransfers, idleTransfers } = payload - const newIsolatedAccountData = { marginTransfers: isolatedMarginTransfers } - const newSmartAccountData = { - marginTransfers: smartMarginTransfers, - idleTransfers, - } - - updateFuturesAccount( - futuresState, - 'isolated_margin', - context.network, - context.wallet, - newIsolatedAccountData - ) - - updateFuturesAccount( - futuresState, - 'smart_margin', - context.network, - context.wallet, - newSmartAccountData - ) - } - }) - builder.addCase(fetchCombinedMarginTransfers.rejected, (futuresState) => { - futuresState.queryStatuses.marginTransfers = { - status: FetchStatus.Error, - error: 'Failed to fetch combined margin transfers', - } - }) - - // Cross margin positions - builder.addCase(fetchCrossMarginPositions.pending, (futuresState) => { - futuresState.queryStatuses.crossMarginPositions = LOADING_STATUS - }) - builder.addCase(fetchCrossMarginPositions.fulfilled, (futuresState, action) => { - futuresState.queryStatuses.crossMarginPositions = SUCCESS_STATUS - if (!action.payload) return - const { account, positions, network } = action.payload - const wallet = findWalletForAccount(futuresState.crossMargin, account, network) - if (wallet) { - updateFuturesAccount(futuresState, 'cross_margin', network, wallet, { positions }) - } - }) - builder.addCase(fetchCrossMarginPositions.rejected, (futuresState) => { - futuresState.queryStatuses.crossMarginPositions = { - status: FetchStatus.Error, - error: 'Failed to fetch positions', - } - }) - - // Isolated margin positions - builder.addCase(fetchIsolatedMarginPositions.pending, (futuresState) => { - futuresState.queryStatuses.isolatedPositions = LOADING_STATUS - }) - builder.addCase(fetchIsolatedMarginPositions.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.isolatedPositions = SUCCESS_STATUS - if (payload) { - const { positions, wallet, network } = payload - updateFuturesAccount(futuresState, 'isolated_margin', network, wallet, { positions }) - } - }) - builder.addCase(fetchIsolatedMarginPositions.rejected, (futuresState) => { - futuresState.queryStatuses.isolatedPositions = { - status: FetchStatus.Error, - error: 'Failed to fetch positions', - } - }) - - // Refetch selected position - builder.addCase(refetchPosition.fulfilled, (futuresState, { payload }) => { - if (payload) { - const { position, wallet, networkId } = payload - const account = futuresState.isolatedMargin.accounts[networkId]?.[wallet] - - const existingPositions = account?.positions ?? [] - const index = existingPositions.findIndex((p) => p.marketKey === position.marketKey) - existingPositions[index] = position - futuresState.isolatedMargin.accounts[networkId][wallet] = { - ...account, - positions: existingPositions, - } - } - }) - - // Fetch Cross Margin Open Orders - builder.addCase(fetchCrossMarginOpenOrders.pending, (futuresState) => { - futuresState.queryStatuses.openOrders = LOADING_STATUS - }) - builder.addCase(fetchCrossMarginOpenOrders.fulfilled, (futuresState, action) => { - futuresState.queryStatuses.openOrders = SUCCESS_STATUS - if (!action.payload) return - const { network, account, delayedOrders, conditionalOrders } = action.payload - const wallet = findWalletForAccount(futuresState.crossMargin, account, network) - if (wallet) { - updateFuturesAccount(futuresState, 'cross_margin', network, wallet, { - conditionalOrders, - delayedOrders, - }) - } - }) - builder.addCase(fetchCrossMarginOpenOrders.rejected, (futuresState) => { - futuresState.queryStatuses.openOrders = { - status: FetchStatus.Error, - error: 'Failed to fetch open orders for cross margin account', - } - }) - - // Fetch Isolated Open Orders - builder.addCase(fetchIsolatedOpenOrders.pending, (futuresState) => { - futuresState.queryStatuses.openOrders = LOADING_STATUS - }) - builder.addCase(fetchIsolatedOpenOrders.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.openOrders = SUCCESS_STATUS - if (payload) { - const { orders: delayedOrders, wallet, networkId } = payload - updateFuturesAccount(futuresState, 'isolated_margin', networkId, wallet, { - delayedOrders, - }) - } - }) - builder.addCase(fetchIsolatedOpenOrders.rejected, (futuresState) => { - futuresState.queryStatuses.openOrders = { - status: FetchStatus.Error, - error: 'Failed to fetch open orders for isolated margin', - } - }) - - // Fetch Isolated Margin Trade Preview - builder.addCase(fetchIsolatedMarginTradePreview.pending, (futuresState) => { - futuresState.queryStatuses.isolatedTradePreview = LOADING_STATUS - }) - builder.addCase(fetchIsolatedMarginTradePreview.fulfilled, (futuresState, { payload }) => { - futuresState.isolatedMargin.previews[payload.type] = payload.preview - futuresState.queryStatuses.isolatedTradePreview = SUCCESS_STATUS - }) - builder.addCase(fetchIsolatedMarginTradePreview.rejected, (futuresState) => { - futuresState.queryStatuses.isolatedTradePreview = { - status: FetchStatus.Error, - error: 'Failed to fetch trade preview', - } - futuresState.isolatedMargin.previews.trade = null - }) - - // Fetch Cross Margin Trade Preview - builder.addCase(fetchCrossMarginTradePreview.pending, (futuresState) => { - futuresState.queryStatuses.crossMarginTradePreview = LOADING_STATUS - }) - builder.addCase(fetchCrossMarginTradePreview.fulfilled, (futuresState, { payload }) => { - futuresState.crossMargin.previews[payload.type] = payload.preview - futuresState.queryStatuses.crossMarginTradePreview = SUCCESS_STATUS - }) - - // Fetch cross margin account - builder.addCase(fetchCrossMarginAccount.pending, (futuresState) => { - futuresState.queryStatuses.crossMarginAccount = LOADING_STATUS - }) - builder.addCase(fetchCrossMarginAccount.fulfilled, (futuresState, action) => { - if (action.payload) { - const { network, account, wallet } = action.payload - futuresState.crossMargin.accounts[network] = { - ...futuresState.crossMargin.accounts[network], - [wallet]: { - account: account, - ...ZERO_STATE_CM_ACCOUNT, - }, - } - } - futuresState.queryStatuses.crossMarginAccount = SUCCESS_STATUS - }) - builder.addCase(fetchCrossMarginAccount.rejected, (futuresState) => { - futuresState.queryStatuses.crossMarginAccount = { - status: FetchStatus.Error, - error: 'Failed to fetch cross margin account', - } - }) - - // Fetch position history - builder.addCase(fetchFuturesPositionHistory.pending, (futuresState) => { - futuresState.queryStatuses.positionHistory = LOADING_STATUS - }) - builder.addCase(fetchFuturesPositionHistory.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.positionHistory = SUCCESS_STATUS - if (payload) { - const { accountType: type, history: positionHistory, networkId, wallet } = payload - updateFuturesAccount(futuresState, type, networkId, wallet, { - positionHistory, - }) - } - }) - builder.addCase(fetchFuturesPositionHistory.rejected, (futuresState) => { - futuresState.queryStatuses.positionHistory = { - error: 'Failed to fetch position history', - status: FetchStatus.Error, - } - }) + extraReducers(builder) { // Fetch position history for trader builder.addCase(fetchPositionHistoryForTrader.pending, (futuresState) => { futuresState.queryStatuses.selectedTraderPositionHistory = LOADING_STATUS @@ -702,186 +92,19 @@ const futuresSlice = createSlice({ status: FetchStatus.Error, } }) - - // Fetch trades for market - builder.addCase(fetchTradesForSelectedMarket.pending, (futuresState) => { - futuresState.queryStatuses.trades = LOADING_STATUS - }) - builder.addCase(fetchTradesForSelectedMarket.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.trades = SUCCESS_STATUS - if (payload) { - const { accountType: type, trades, networkId, wallet } = payload - mergeTradesForAccount(futuresState, type, networkId, wallet, trades) - } - }) - builder.addCase(fetchTradesForSelectedMarket.rejected, (futuresState) => { - futuresState.queryStatuses.trades = { - error: 'Failed to fetch trades', - status: FetchStatus.Error, - } - }) - - // TODO: Combine all with market trades rather than overwrite as the filter is done on selector - - // Fetch all trades for account - builder.addCase(fetchAllTradesForAccount.pending, (futuresState) => { - futuresState.queryStatuses.trades = LOADING_STATUS - }) - builder.addCase(fetchAllTradesForAccount.fulfilled, (futuresState, { payload }) => { - futuresState.queryStatuses.trades = SUCCESS_STATUS - if (payload) { - const { accountType: type, trades, networkId, wallet } = payload - mergeTradesForAccount(futuresState, type, networkId, wallet, trades) - } - }) - builder.addCase(fetchAllTradesForAccount.rejected, (futuresState) => { - futuresState.queryStatuses.trades = { - error: 'Failed to fetch trades', - status: FetchStatus.Error, - } - }) - - // Fetch funding rates - builder.addCase(fetchFundingRatesHistory.rejected, (futuresState) => { - futuresState.queryStatuses.historicalFundingRates = { - error: 'Failed to fetch funding rates', - status: FetchStatus.Error, - } - }) - builder.addCase(fetchFundingRatesHistory.fulfilled, (futuresState, { payload }) => { - futuresState.historicalFundingRates[payload.marketAsset] = payload.rates - }) - - // Trading Fees by given epoch - builder.addCase(fetchFuturesFees.pending, (futuresState) => { - futuresState.queryStatuses.futuresFees = LOADING_STATUS - }) - builder.addCase(fetchFuturesFees.fulfilled, (futuresState, action) => { - futuresState.queryStatuses.futuresFees = SUCCESS_STATUS - futuresState.futuresFees = action.payload.totalFuturesFeePaid - }) - builder.addCase(fetchFuturesFees.rejected, (futuresState) => { - futuresState.queryStatuses.futuresFees = { - status: FetchStatus.Error, - error: 'Failed to fetch fee data', - } - }) - - // Trading Fees by given epoch and trader - builder.addCase(fetchFuturesFeesForAccount.pending, (futuresState) => { - futuresState.queryStatuses.futuresFeesForAccount = LOADING_STATUS - }) - builder.addCase(fetchFuturesFeesForAccount.fulfilled, (futuresState, action) => { - futuresState.queryStatuses.futuresFeesForAccount = SUCCESS_STATUS - futuresState.futuresFeesForAccount = action.payload.futuresFeePaid - }) - builder.addCase(fetchFuturesFeesForAccount.rejected, (futuresState) => { - futuresState.queryStatuses.futuresFeesForAccount = { - status: FetchStatus.Error, - error: 'Failed to fetch fee data for the account', - } - }) }, }) export default futuresSlice.reducer export const { - handlePreviewError, - setMarketAsset, - setOrderType, - setClosePositionOrderType, - setClosePositionSizeDelta, - setClosePositionPrice, - setOrderFeeCap, - setLeverageSide, setFuturesAccountType, - setCrossMarginTradeInputs, - setCrossMarginAccount, - setCrossMarginMarginDelta, - setCrossMarginTradeStopLoss, - setCrossMarginTradeTakeProfit, - setCrossMarginOrderPrice, - setCrossMarginOrderPriceInvalidLabel, - setTransactionEstimate, - setLeverageInput, - setCrossMarginFees, - setKeeperDeposit, - setIsolatedMarginTradeInputs, - setIsolatedTradePreview, - clearAllTradePreviews, - setIsolatedMarginFee, - setCrossMarginTradePreview, - setCrossMarginLeverageForAsset, - setCrossMarginOrderCancelling, setSelectedTrader, setSelectedInputDenomination, setSelectedInputFundingRateHour, - setCrossMarginEditPositionInputs, - setIsolatedMarginEditPositionInputs, - incrementIsolatedPreviewCount, - incrementCrossPreviewCount, setSelectedPortfolioTimeframe, - setSLTPModalStopLoss, - setSLTPModalTakeProfit, setTradePanelDrawerOpen, toggleShowTradeHistory, setSelectedChart, setHistoricalFundingRatePeriod, } = futuresSlice.actions - -const findWalletForAccount = ( - crossMarginState: CrossMarginState, - account: string, - network: NetworkId -) => { - const entry = Object.entries(crossMarginState.accounts[network]).find(([_, value]) => { - return value.account === account - }) - return entry ? entry[0] : undefined -} - -const mergeTradesForAccount = ( - futuresState: FuturesState, - type: FuturesAccountType, - network: NetworkId, - wallet: string, - trades: FuturesTrade[] -) => { - const existingTrades = futuresState[accountType(type)].accounts[network]?.[wallet]?.trades ?? [] - trades.forEach((t) => { - if (!existingTrades.find((et) => et.txnHash === t.txnHash)) { - existingTrades.push(t) - } - }) - existingTrades.sort((a, b) => b.timestamp - a.timestamp) - updateFuturesAccount(futuresState, type, network, wallet, { - trades: trades, - }) -} - -const updateFuturesAccount = ( - futuresState: FuturesState, - type: FuturesAccountType, - network: NetworkId, - wallet: string, - newAccountData: Partial -) => { - const updatedAccount = - type === 'isolated_margin' - ? { - ...ZERO_STATE_ISOLATED_ACCOUNT, - ...futuresState.isolatedMargin.accounts[network]?.[wallet], - ...newAccountData, - } - : { - ...ZERO_STATE_CM_ACCOUNT, - ...futuresState.crossMargin.accounts[network]?.[wallet], - ...newAccountData, - } - - futuresState[accountType(type)].accounts[network] = { - ...futuresState[accountType(type)].accounts[network], - [wallet]: updatedAccount, - } -} diff --git a/packages/app/src/state/futures/selectors.ts b/packages/app/src/state/futures/selectors.ts index b003e93674..0334eddae7 100644 --- a/packages/app/src/state/futures/selectors.ts +++ b/packages/app/src/state/futures/selectors.ts @@ -1,338 +1,209 @@ -import { SL_TP_MAX_SIZE, ZERO_WEI, PERIOD_IN_SECONDS, Period } from '@kwenta/sdk/constants' +import { ZERO_WEI, PERIOD_IN_SECONDS, Period } from '@kwenta/sdk/constants' import { TransactionStatus, - ConditionalOrderTypeEnum, - FuturesPosition, PositionSide, + FuturesMarginType, + FuturesMarket, } from '@kwenta/sdk/types' -import { - truncateTimestamp, - calculateDesiredFillPrice, - getDefaultPriceImpact, - unserializePotentialTrade, - MarketKeyByAsset, - MarketAssetByKey, - stripZeros, -} from '@kwenta/sdk/utils' +import { truncateTimestamp } from '@kwenta/sdk/utils' import { createSelector } from '@reduxjs/toolkit' -import Wei, { wei } from '@synthetixio/wei' +import { wei } from '@synthetixio/wei' -import { DEFAULT_DELAYED_CANCEL_BUFFER, DEFAULT_LEVERAGE } from 'constants/defaults' -import { FuturesAccountTypes } from 'queries/futures/types' -import { selectSusdBalance } from 'state/balances/selectors' -import { accountType, deserializeWeiObject } from 'state/helpers' import { - selectOffchainPricesInfo, - selectOnChainPricesInfo, - selectPrices, -} from 'state/prices/selectors' + selectAllCrossMarginTrades, + selectCrossMarginAccountData, + selectCrossMarginAvailableMargin, + selectCrossMarginMarginTransfers, + selectCrossMarginMaxLeverage, + selectCrossMarginPosition, + selectCrossMarginPositionHistory, + selectCrossMarginPositions, + selectCrossMarginTradeInputs, + selectMarkPriceInfosV3, + selectMarkPricesV3, + selectPendingAsyncOrdersCount, + selectV3MarketInfo, + selectV3MarketKey, + selectV3Markets, + selectV3SkewAdjustedPrice, + selectV3SkewAdjustedPriceInfo, +} from 'state/futures/crossMargin/selectors' +import { selectPrices } from 'state/prices/selectors' import { RootState } from 'state/store' -import { FetchStatus } from 'state/types' import { selectNetwork, selectWallet } from 'state/wallet/selectors' -import { computeDelayedOrderFee, sameSide } from 'utils/costCalculations' import { getKnownError } from 'utils/formatters/error' import { - unserializeCmBalanceInfo, unserializeFuturesVolumes, - unserializeGasEstimate, - unserializeTradeInputs, - unserializeMarkets, - unserializeDelayedOrders, - updatePositionUpnl, unserializePositionHistory, unserializeTrades, - unserializeConditionalOrders, stopLossValidity, } from 'utils/futures' import { - FuturesAction, - MarkPrices, - futuresPositionKeys, - MarkPriceInfos, - PortfolioValues, - SmartPerpsPortfolio, - IsolatedPerpsPortfolio, -} from './types' - -export const selectFuturesType = (state: RootState) => state.futures.selectedType - -export const selectCrossMarginAccount = createSelector( - selectWallet, - selectNetwork, - (state: RootState) => state.futures.crossMargin, - (wallet, network, crossMargin) => { - return wallet ? crossMargin.accounts[network]?.[wallet]?.account : undefined - } -) - -export const selectQueryStatuses = (state: RootState) => state.futures.queryStatuses - -export const selectMarketsQueryStatus = (state: RootState) => state.futures.queryStatuses.markets - -export const selectCMAccountQueryStatus = (state: RootState) => - state.futures.queryStatuses.crossMarginAccount - -export const selectLeverageInput = createSelector( - (state: RootState) => state.futures, + selectFuturesState, selectFuturesType, - (futures, type) => futures[accountType(type)].leverageInput + selectMarketAsset, + selectMarketIndexPrice, +} from './common/selectors' +import { CrossPerpsPortfolio } from './crossMargin/types' +import { + selectIdleMarginTransfers, + selectMarginDeltaInputValue, + selectSmartMarginDelayedOrders, + selectV2Markets, + selectSmartMarginAccount, + selectSmartMarginAccountData, + selectSmartMarginBalanceInfo, + selectTradePreview, + selectV2MarketKey, + selectSmartMarginTradeInputs, + selectSmartMarginOrderPrice, + selectSmartMarginMaxLeverage, + selectSlTpTradeInputs, + selectSlTpModalInputs, + selectEditPositionModalInfo, + selectMarkPricesV2, + selectMarkPriceInfosV2, + selectSmartMarginPositions, + selectAllSmartMarginTrades, + selectV2MarketInfo, + selectSmartMarginPosition, + selectV2SkewAdjustedPrice, + selectV2SkewAdjustedPriceInfo, +} from './smartMargin/selectors' +import { SmartPerpsPortfolio } from './smartMargin/types' +import { FuturesAction, PortfolioValues } from './types' + +export const selectQueryStatuses = createSelector( + selectFuturesState, + (state: RootState) => state.futures.queryStatuses, + (selectedFuturesState, globalFuturesState) => ({ + ...selectedFuturesState.queryStatuses, + ...globalFuturesState, + }) ) -export const selectCrossMarginMarginDelta = createSelector( - (state: RootState) => state.futures, - (futures) => wei(futures.crossMargin.marginDelta || 0) +export const selectMarketsQueryStatus = createSelector( + selectQueryStatuses, + (statuses) => statuses.markets ) -export const selectMarginDeltaInputValue = (state: RootState) => - state.futures.crossMargin.marginDelta - -export const selectFuturesSupportedNetwork = (state: RootState) => - state.wallet.networkId === 10 || state.wallet.networkId === 420 - -export const selectShowCrossMarginOnboard = (state: RootState) => - state.app.showModal === 'futures_smart_margin_onboard' - -export const selectEditPositionModalMarket = (state: RootState) => - state.app.showPositionModal?.marketKey +export const selectLeverageInput = createSelector( + selectFuturesState, + (state) => state.leverageInput +) export const selectSelectedTrader = (state: RootState) => state.futures.leaderboard.selectedTrader export const selectShowHistory = (state: RootState) => !!state.futures.preferences.showHistory -export const selectCrossMarginAccountData = createSelector( - selectWallet, - selectNetwork, - selectFuturesSupportedNetwork, - (state: RootState) => state.futures.crossMargin, - (wallet, network, supportedNetwork, crossMargin) => { - return wallet && supportedNetwork ? crossMargin.accounts[network][wallet] : null - } -) - -export const selectIsolatedAccountData = createSelector( - selectWallet, - selectNetwork, - selectFuturesSupportedNetwork, - (state: RootState) => state.futures.isolatedMargin, - (wallet, network, supportedNetwork, isolatedMargin) => { - return wallet && supportedNetwork ? isolatedMargin.accounts[network][wallet] : null - } -) - export const selectAccountData = createSelector( selectFuturesType, + selectSmartMarginAccountData, selectCrossMarginAccountData, - selectIsolatedAccountData, - (type, crossAccountData, isolatedAccountData) => - type === 'cross_margin' ? crossAccountData : isolatedAccountData -) - -export const selectCMBalance = createSelector(selectCrossMarginAccountData, (account) => - wei(account?.balanceInfo.freeMargin || 0) -) - -export const selectMarketKey = createSelector( - (state: RootState) => state.futures[accountType(state.futures.selectedType)].selectedMarketAsset, - (marketAsset) => MarketKeyByAsset[marketAsset] -) - -export const selectMarketAsset = createSelector( - (state: RootState) => state.futures, - selectFuturesType, - (futures, marginType) => futures[accountType(marginType)].selectedMarketAsset + (type, smartAccountData, crossAccountData) => + type === FuturesMarginType.SMART_MARGIN ? smartAccountData : crossAccountData ) export const selectMarkets = createSelector( - selectNetwork, - (state: RootState) => state.futures, - (network, futures) => - futures.markets[network] ? unserializeMarkets(futures.markets[network]) : [] -) - -export const selectOptimismMarkets = createSelector( - (state: RootState) => state.futures, - (futures) => (futures.markets[10] ? unserializeMarkets(futures.markets[10]) : []) + selectFuturesType, + selectV2Markets, + selectV3Markets, + (futuresType, v2Markets, v3Markets) => { + return futuresType === FuturesMarginType.CROSS_MARGIN ? v3Markets : v2Markets + } ) export const selectMarketVolumes = createSelector( - (state: RootState) => state.futures.dailyMarketVolumes, + (state: RootState) => state.smartMargin.dailyMarketVolumes, (dailyMarketVolumes) => unserializeFuturesVolumes(dailyMarketVolumes) ) -export const selectMarketKeys = createSelector(selectMarkets, (markets) => - markets.map(({ asset }) => MarketKeyByAsset[asset]) -) - -export const selectMarketAssets = createSelector(selectMarkets, (markets) => - markets.map(({ asset }) => asset) +export const selectMarketKey = createSelector( + selectFuturesType, + selectV2MarketKey, + selectV3MarketKey, + (type, v2Key, v3Key) => (type === FuturesMarginType.CROSS_MARGIN ? v3Key : v2Key) ) export const selectMarketInfo = createSelector( - selectMarkets, - selectMarketKey, - (markets, selectedMarket) => { - return markets.find((market) => market.marketKey === selectedMarket) - } -) - -export const selectOrderType = createSelector( - (state: RootState) => state.futures, - (futures) => futures[accountType(futures.selectedType)].orderType -) - -export const selectCrossMarginOrderType = (state: RootState) => state.futures.crossMargin.orderType - -export const selectClosePositionOrderInputs = createSelector( selectFuturesType, - (state: RootState) => state.futures, - (type, futures) => { - if (type === 'cross_margin') return futures.crossMargin.closePositionOrderInputs - return { - ...futures.isolatedMargin.closePositionOrderInputs, - price: undefined, - } - } + selectV2MarketInfo, + selectV3MarketInfo, + (type, v2Key, v3Key) => (type === FuturesMarginType.CROSS_MARGIN ? v3Key : v2Key) ) -export const selectMarketIndexPrice = createSelector( +export const selectMarketPrices = createSelector( selectMarketAsset, selectPrices, (marketAsset, prices) => { - const price = prices[marketAsset] - // Note this assumes the order type is always delayed off chain - return price?.offChain ?? price?.onChain ?? wei(0) - } -) - -export const selectMarketPriceInfo = createSelector( - selectMarketInfo, - selectOffchainPricesInfo, - (marketInfo, pricesInfo) => { - if (!marketInfo || !pricesInfo[marketInfo.asset]) return - return pricesInfo[marketInfo.asset] - } -) - -export const selectSkewAdjustedPrice = createSelector( - selectMarketIndexPrice, - selectMarketInfo, - (price, marketInfo) => { - if (!marketInfo?.marketSkew || !marketInfo?.settings.skewScale) return price - return price - ? wei(price).mul(wei(marketInfo.marketSkew).div(marketInfo.settings.skewScale).add(1)) - : ZERO_WEI + return prices[marketAsset] ?? {} } ) -export const selectSkewAdjustedPriceInfo = createSelector( - selectMarketPriceInfo, - selectMarketInfo, - (priceInfo, marketInfo) => { - if (!marketInfo?.marketSkew || !marketInfo?.settings.skewScale) return priceInfo - return priceInfo - ? { - price: wei(priceInfo.price).mul( - wei(marketInfo.marketSkew).div(marketInfo.settings.skewScale).add(1) - ), - change: priceInfo?.change, - } - : undefined +export const selectMarkPrices = createSelector( + selectMarkPricesV2, + selectMarkPricesV3, + selectFuturesType, + (v2, v3, type) => { + return type === FuturesMarginType.CROSS_MARGIN ? v3 : v2 } ) -export const selectMarketPrices = createSelector( - selectMarketAsset, - selectPrices, - (marketAsset, prices) => { - return prices[marketAsset] ?? {} +export const selectMarkPriceInfos = createSelector( + selectMarkPriceInfosV2, + selectMarkPriceInfosV3, + selectFuturesType, + (v2, v3, type) => { + return type === FuturesMarginType.CROSS_MARGIN ? v3 : v2 } ) -export const selectMarkPrices = createSelector(selectMarkets, selectPrices, (markets, prices) => { - const markPrices: MarkPrices = {} - return markets.reduce((acc, market) => { - const price = prices[market.asset]?.offChain ?? wei(0) - return { - ...acc, - [market.marketKey]: wei(price).mul( - wei(market.marketSkew).div(market.settings.skewScale).add(1) - ), - } - }, markPrices) -}) - -export const selectOptimismMarkPrices = createSelector( - selectOptimismMarkets, - selectPrices, - (optimismMarkets, prices) => { - const markPrices: MarkPrices = {} - return optimismMarkets.reduce((acc, market) => { - const price = prices[market.asset]?.offChain ?? wei(0) - return { - ...acc, - [market.marketKey]: wei(price).mul( - wei(market.marketSkew).div(market.settings.skewScale).add(1) - ), - } - }, markPrices) +export const selectFuturesAccount = createSelector( + selectFuturesType, + selectWallet, + selectSmartMarginAccount, + (selectedType, wallet, smartMarginAccount) => { + return selectedType === FuturesMarginType.SMART_MARGIN ? smartMarginAccount : wallet } ) -export const selectMarkPriceInfos = createSelector( - selectMarkets, - selectOffchainPricesInfo, - (markets, prices) => { - const markPrices: MarkPriceInfos = {} - return markets.reduce((acc, market) => { - const price = prices[market.asset]?.price ?? wei(0) - return { - ...acc, - [market.marketKey]: { - price: wei(price).mul(wei(market.marketSkew).div(market.settings.skewScale).add(1)), - change: prices[market.asset]?.change ?? null, - }, - } - }, markPrices) +export const selectPosition = createSelector( + selectSmartMarginPosition, + selectCrossMarginPosition, + selectFuturesType, + (v2, v3, type) => { + return type === FuturesMarginType.CROSS_MARGIN ? v3 : v2 } ) -export const selectFuturesAccount = createSelector( +export const selectSkewAdjustedPrice = createSelector( + selectV2SkewAdjustedPrice, + selectV3SkewAdjustedPrice, selectFuturesType, - selectWallet, - selectCrossMarginAccount, - (selectedType, wallet, crossMarginAccount) => { - return selectedType === 'cross_margin' ? crossMarginAccount : wallet + (v2, v3, type) => { + return type === FuturesMarginType.CROSS_MARGIN ? v3 : v2 } ) -export const selectAllConditionalOrders = createSelector( +export const selectSkewAdjustedPriceInfo = createSelector( + selectV2SkewAdjustedPriceInfo, + selectV3SkewAdjustedPriceInfo, selectFuturesType, - selectCrossMarginAccountData, - selectOnChainPricesInfo, - (selectedType, account, prices) => { - if (!account || selectedType === 'isolated_margin') return [] - - const orders = unserializeConditionalOrders(account.conditionalOrders) - return orders.map((o) => { - const price = prices[MarketAssetByKey[o.marketKey]] - return { - ...o, - currentPrice: price, - } - }) + (v2, v3, type) => { + return type === FuturesMarginType.CROSS_MARGIN ? v3 : v2 } ) export const selectPositionHistory = createSelector( selectFuturesType, - selectCrossMarginAccountData, - selectIsolatedAccountData, - (type, crossAccountData, isolatedAccountData) => { - if (type === 'isolated_margin') { - return unserializePositionHistory(isolatedAccountData?.positionHistory ?? []) + selectSmartMarginAccountData, + selectCrossMarginPositionHistory, + (type, smartAccountData, crossPositionHistory) => { + if (type === FuturesMarginType.CROSS_MARGIN) { + return crossPositionHistory } else { - return unserializePositionHistory(crossAccountData?.positionHistory ?? []) + return unserializePositionHistory(smartAccountData?.positionHistory ?? []) } } ) @@ -357,6 +228,15 @@ export const selectPositionHistoryForSelectedTrader = createSelector( } ) +export const selectFuturesPositions = createSelector( + selectSmartMarginPositions, + selectCrossMarginPositions, + (state: RootState) => state.futures.selectedType, + (smartPositions, crossPositions, selectedType) => { + return selectedType === FuturesMarginType.CROSS_MARGIN ? crossPositions : smartPositions + } +) + export const selectUsersPositionHistory = createSelector( selectNetwork, selectWallet, @@ -368,79 +248,9 @@ export const selectUsersPositionHistory = createSelector( } ) -export const selectCrossMarginPositions = createSelector( - selectCrossMarginAccountData, - selectAllConditionalOrders, - selectMarkPrices, - selectPositionHistory, - (account, orders, prices, positionHistory) => { - const positions = - account?.positions?.map((p) => updatePositionUpnl(p, prices, positionHistory)) ?? [] - return ( - positions.map( - // TODO: Maybe change to explicit serializing functions to avoid casting - (pos) => { - const stopLoss = orders.find((o) => { - return ( - o.marketKey === pos.marketKey && - o.size.abs().eq(SL_TP_MAX_SIZE) && - o.reduceOnly && - o.orderType === ConditionalOrderTypeEnum.STOP - ) - }) - const takeProfit = orders.find( - (o) => - o.marketKey === pos.marketKey && - o.size.abs().eq(SL_TP_MAX_SIZE) && - o.reduceOnly && - o.orderType === ConditionalOrderTypeEnum.LIMIT - ) - return { - ...pos, - stopLoss, - takeProfit, - } - } - ) ?? [] - ) - } -) - -export const selectIsolatedMarginPositions = createSelector( - selectMarkPrices, - selectIsolatedAccountData, - selectPositionHistory, - (prices, account, positionHistory) => { - return account?.positions?.map((p) => updatePositionUpnl(p, prices, positionHistory)) ?? [] - } -) - -export const selectFuturesPositions = createSelector( - selectCrossMarginPositions, - selectIsolatedMarginPositions, - (state: RootState) => state.futures.selectedType, - (crossMarginPositions, isolatedMarginPositions, selectedType) => { - return selectedType === 'cross_margin' ? crossMarginPositions : isolatedMarginPositions - } -) - -export const selectActiveIsolatedPositionsCount = createSelector( - selectIsolatedMarginPositions, - (positions) => { - return positions.filter((p) => !!p.position).length - } -) - -export const selectActiveSmartPositionsCount = createSelector( - selectCrossMarginPositions, - (positions) => { - return positions.filter((p) => !!p.position).length - } -) - export const selectTotalUnrealizedPnl = createSelector(selectFuturesPositions, (positions) => { return positions.reduce((acc, p) => { - return acc.add(p.position?.pnl ?? ZERO_WEI) + return acc.add(p?.pnl ?? ZERO_WEI) }, ZERO_WEI) }) @@ -471,8 +281,8 @@ export const selectIsSubmittingCrossTransfer = createSelector( (state: RootState) => state.app, (submitting, app) => { return ( - (app.transaction?.type === 'deposit_cross_margin' || - app.transaction?.type === 'withdraw_cross_margin') && + (app.transaction?.type === 'deposit_smart_margin' || + app.transaction?.type === 'withdraw_smart_margin') && submitting ) } @@ -509,14 +319,6 @@ export const selectIsolatedTransferError = createSelector( } ) -export const selectIsModifyingIsolatedPosition = createSelector( - selectSubmittingFuturesTx, - (state: RootState) => state.app, - (submitting, app) => { - return app.transaction?.type === 'modify_isolated' && submitting - } -) - export const selectIsCancellingOrder = createSelector( selectSubmittingFuturesTx, (state: RootState) => state.app, @@ -533,233 +335,14 @@ export const selectIsExecutingOrder = createSelector( } ) -export const selectIsMarketCapReached = createSelector( - (state: RootState) => state.futures[accountType(state.futures.selectedType)].leverageSide, - selectMarketInfo, - selectMarketIndexPrice, - (leverageSide, marketInfo, marketAssetRate) => { - const maxMarketValueUSD = marketInfo?.marketLimitUsd ?? wei(0) - const marketSize = marketInfo?.marketSize ?? wei(0) - const marketSkew = marketInfo?.marketSkew ?? wei(0) - - return leverageSide === PositionSide.LONG - ? marketSize.add(marketSkew).div('2').abs().mul(marketAssetRate).gte(maxMarketValueUSD) - : marketSize.sub(marketSkew).div('2').abs().mul(marketAssetRate).gte(maxMarketValueUSD) - } -) - -export const selectPosition = createSelector( - selectFuturesPositions, - selectMarketInfo, - (positions, market) => { - const position = positions.find((p) => p.marketKey === market?.marketKey) - return position - ? (deserializeWeiObject(position, futuresPositionKeys) as FuturesPosition) - : undefined - } -) - -export const selectOrderFeeCap = (state: RootState) => - wei(state.futures.crossMargin.orderFeeCap || '0') - -export const selectLeverageSide = createSelector( - (state: RootState) => state.futures, - (futures) => futures[accountType(futures.selectedType)].leverageSide -) +export const selectLeverageSide = createSelector(selectFuturesState, (state) => state.leverageSide) export const selectMaxLeverage = createSelector( - selectPosition, - selectMarketInfo, - selectLeverageSide, + selectCrossMarginMaxLeverage, + selectSmartMarginMaxLeverage, selectFuturesType, - (position, market, leverageSide, futuresType) => { - const positionLeverage = position?.position?.leverage ?? wei(0) - const positionSide = position?.position?.side - let adjustedMaxLeverage = market?.appMaxLeverage ?? wei(1) - - if (!positionLeverage || positionLeverage.eq(wei(0))) return adjustedMaxLeverage - if (futuresType === 'cross_margin') return adjustedMaxLeverage - if (positionSide === leverageSide) { - return adjustedMaxLeverage?.sub(positionLeverage).gte(0) - ? adjustedMaxLeverage.sub(positionLeverage) - : wei(0) - } else { - return positionLeverage.add(adjustedMaxLeverage).gte(0) - ? positionLeverage.add(adjustedMaxLeverage) - : wei(0) - } - } -) - -export const selectAboveMaxLeverage = createSelector( - selectMaxLeverage, - selectPosition, - (maxLeverage, position) => { - return position?.position?.leverage && maxLeverage.lt(position.position.leverage) - } -) - -export const selectCrossMarginBalanceInfo = createSelector( - selectCrossMarginAccountData, - (account) => { - return account - ? unserializeCmBalanceInfo(account.balanceInfo) - : { - freeMargin: wei(0), - keeperEthBal: wei(0), - allowance: wei(0), - } - } -) - -export const selectSmartMarginDepositApproved = createSelector( - selectCrossMarginAccountData, - (account) => { - if (!account) return false - return wei(account.balanceInfo.allowance || 0).gt(0) - } -) - -export const selectAvailableMargin = createSelector( - selectMarketInfo, - selectPosition, - (marketInfo, position) => { - if (!marketInfo || !position) return ZERO_WEI - if (!position?.position) return position.remainingMargin - - let inaccessible = - position.position.notionalValue.div(marketInfo.appMaxLeverage).abs() ?? ZERO_WEI - - // If the user has a position open, we'll enforce a min initial margin requirement. - if (inaccessible.gt(0) && inaccessible.lt(marketInfo.minInitialMargin)) { - inaccessible = marketInfo.minInitialMargin - } - - // check if available margin will be less than 0 - return position.remainingMargin.sub(inaccessible).gt(0) - ? position.remainingMargin.sub(inaccessible).abs() - : ZERO_WEI - } -) - -export const selectRemainingMarketMargin = createSelector(selectPosition, (position) => { - if (!position) return ZERO_WEI - return position.remainingMargin -}) - -export const selectMarginInMarkets = (isSuspended: boolean = false) => - createSelector(selectCrossMarginPositions, selectMarkets, (positions, markets) => { - const idleInMarkets = positions - .filter((p) => { - const market = markets.find((m) => m.marketKey === p.marketKey) - return market && market.isSuspended === isSuspended - }) - .filter((p) => !p.position?.size.abs().gt(0) && p.remainingMargin.gt(0)) - .reduce((acc, p) => acc.add(p.remainingMargin), wei(0)) - return idleInMarkets - }) - -export const selectAvailableMarginInMarkets = selectMarginInMarkets() - -export const selectLockedMarginInMarkets = selectMarginInMarkets(true) - -export const selectIdleMargin = createSelector( - selectAvailableMarginInMarkets, - selectCrossMarginBalanceInfo, - selectSusdBalance, - (idleInMarkets, { freeMargin }, balance) => { - return balance.add(idleInMarkets).add(freeMargin) - } -) - -export const selectSmartMarginAllowanceValid = createSelector( - selectCrossMarginAccountData, - selectCrossMarginBalanceInfo, - selectAvailableMarginInMarkets, - selectCrossMarginMarginDelta, - (account, { freeMargin }, idleInMarkets, marginDelta) => { - const totalIdleMargin = freeMargin.add(idleInMarkets) - if (!account) return false - const marginDeposit = marginDelta.sub(totalIdleMargin) - return ( - totalIdleMargin.gte(marginDelta) || wei(account.balanceInfo.allowance || 0).gte(marginDeposit) - ) - } -) - -export const selectWithdrawableMargin = createSelector( - selectAvailableMarginInMarkets, - selectCrossMarginBalanceInfo, - (idleInMarkets, { freeMargin }) => { - return idleInMarkets.add(freeMargin) - } -) - -export const selectCrossMarginTradeInputs = createSelector( - selectLeverageSide, - (state: RootState) => state.futures.crossMargin.tradeInputs, - (side, tradeInputs) => { - const inputs = unserializeTradeInputs(tradeInputs) - const deltas = { - susdSizeDelta: side === PositionSide.LONG ? inputs.susdSize : inputs.susdSize.neg(), - nativeSizeDelta: side === PositionSide.LONG ? inputs.nativeSize : inputs.nativeSize.neg(), - } - return { - ...inputs, - ...deltas, - susdSizeString: tradeInputs.susdSize, - nativeSizeString: tradeInputs.nativeSize, - } - } -) - -export const selectIsolatedMarginTradeInputs = createSelector( - selectLeverageSide, - (state: RootState) => state.futures.isolatedMargin.tradeInputs, - (side, tradeInputs) => { - const inputs = unserializeTradeInputs(tradeInputs) - const deltas = { - susdSizeDelta: side === PositionSide.LONG ? inputs.susdSize : inputs.susdSize.neg(), - nativeSizeDelta: side === PositionSide.LONG ? inputs.nativeSize : inputs.nativeSize.neg(), - } - return { - ...inputs, - ...deltas, - susdSizeString: tradeInputs.susdSize, - nativeSizeString: tradeInputs.nativeSize, - } - } -) - -export const selectCrossMarginEditPosInputs = (state: RootState) => - state.futures.crossMargin.editPositionInputs -export const selectIsolatedMarginEditPosInputs = (state: RootState) => - state.futures.crossMargin.editPositionInputs - -export const selectEditPositionInputs = createSelector( - selectFuturesType, - selectCrossMarginEditPosInputs, - selectIsolatedMarginEditPosInputs, - (type, crossMarginInputs, isolatedInputs) => { - return type === 'cross_margin' ? crossMarginInputs : isolatedInputs - } -) - -export const selectEditMarginAllowanceValid = createSelector( - selectCrossMarginAccountData, - selectCrossMarginBalanceInfo, - selectAvailableMarginInMarkets, - selectEditPositionInputs, - (account, { freeMargin }, idleInMarkets, { marginDelta }) => { - const totalIdleMargin = freeMargin.add(idleInMarkets) - if (!account) return false - if (isNaN(Number(marginDelta))) return false - const marginDelatWei = wei(marginDelta || 0) - const marginDeposit = marginDelatWei.sub(totalIdleMargin) - return ( - totalIdleMargin.gte(marginDelatWei) || - wei(account.balanceInfo.allowance || 0).gte(marginDeposit) - ) + (cmMax, smMax, type) => { + return type === FuturesMarginType.CROSS_MARGIN ? cmMax : smMax } ) @@ -768,256 +351,37 @@ export const selectSelectedInputDenomination = (state: RootState) => export const selectSelectedInputHours = (state: RootState) => state.futures.selectedInputHours -export const selectCrossMarginSelectedLeverage = createSelector( - selectMarketKey, - (state: RootState) => state.futures.crossMargin.selectedLeverageByAsset, - (key, selectedLeverageByAsset) => wei(selectedLeverageByAsset[key] || DEFAULT_LEVERAGE) -) - -export const selectIsolatedMarginFee = (state: RootState) => - wei(state.futures.isolatedMargin.tradeFee) - -export const selectKeeperEthBalance = createSelector(selectCrossMarginAccountData, (account) => - wei(account?.balanceInfo.keeperEthBal || 0) -) - -export const selectWalletEthBalance = createSelector(selectCrossMarginAccountData, (account) => - wei(account?.balanceInfo.walletEthBal || 0) -) - -export const selectSmartMarginKeeperDeposit = createSelector( - (state: RootState) => state.futures.crossMargin.fees, - (fees) => { - return wei(fees.keeperEthDeposit) - } -) - -export const selectKeeperDepositExceedsBal = createSelector( - selectSmartMarginKeeperDeposit, - selectWalletEthBalance, - (keeperEthDeposit, walletEthBalance) => { - return keeperEthDeposit.gt(walletEthBalance) +export const selectTradeSizeInputs = createSelector( + selectFuturesType, + selectCrossMarginTradeInputs, + selectSmartMarginTradeInputs, + (type, crossInputs, smartInputs) => { + return type === FuturesMarginType.CROSS_MARGIN ? crossInputs : smartInputs } ) -export const selectTradeSizeInputs = createSelector( +export const selectTradePrice = createSelector( selectFuturesType, - selectCrossMarginTradeInputs, - selectIsolatedMarginTradeInputs, - (type, crossMarginInputs, isolatedInputs) => { - return type === 'cross_margin' ? crossMarginInputs : isolatedInputs + selectSmartMarginOrderPrice, + selectMarketIndexPrice, + (type, orderPrice, indexPrice) => { + return type === FuturesMarginType.CROSS_MARGIN ? indexPrice : wei(orderPrice || 0) } ) export const selectTradeSizeInputsDisabled = createSelector( selectMarginDeltaInputValue, selectFuturesType, - selectPosition, - (marginDeltaInput, selectedAccountType, position) => { + selectCrossMarginAvailableMargin, + (marginDeltaInput, selectedAccountType, availableMargin) => { const remaining = - selectedAccountType === 'isolated_margin' - ? position?.remainingMargin || ZERO_WEI + selectedAccountType === FuturesMarginType.CROSS_MARGIN + ? availableMargin || ZERO_WEI : wei(marginDeltaInput || 0) return remaining.lte(0) } ) -export const selectEditPositionModalInfo = createSelector( - selectFuturesType, - selectEditPositionModalMarket, - selectCrossMarginPositions, - selectIsolatedMarginPositions, - selectMarkets, - selectPrices, - (type, modalMarketKey, smartPositions, isolatedPositions, markets, prices) => { - const contextPositions = type === 'isolated_margin' ? isolatedPositions : smartPositions - const position = contextPositions.find((p) => p.marketKey === modalMarketKey) - const market = markets.find((m) => m.marketKey === modalMarketKey) - if (!market) return { position: null, market: null, marketPrice: wei(0) } - const price = prices[market.asset] - // Note this assumes the order type is always delayed off chain - return { position, market, marketPrice: price.offChain || wei(0) } - } -) - -export const selectConditionalOrdersForMarket = createSelector( - selectMarketAsset, - selectCrossMarginAccountData, - selectFuturesType, - (asset, account, futuresType) => { - if (futuresType !== 'cross_margin') return [] - return account - ? unserializeConditionalOrders(account.conditionalOrders).filter((o) => o.asset === asset) - : [] - } -) - -export const selectStopLossOrder = createSelector( - selectConditionalOrdersForMarket, - selectMarketKey, - (selectOpenConditionalOrders, marketKey) => { - return selectOpenConditionalOrders.find( - (o) => - o.marketKey === marketKey && o.orderType === ConditionalOrderTypeEnum.STOP && o.reduceOnly - ) - } -) - -export const selectTakeProfitOrder = createSelector( - selectConditionalOrdersForMarket, - selectMarketKey, - (selectOpenConditionalOrders, marketKey) => { - return selectOpenConditionalOrders.find( - (o) => - o.marketKey === marketKey && o.orderType === ConditionalOrderTypeEnum.LIMIT && o.reduceOnly - ) - } -) - -export const selectAllSLTPOrders = createSelector(selectAllConditionalOrders, (orders) => { - return orders.filter((o) => o.reduceOnly && o.size.abs().eq(SL_TP_MAX_SIZE)) -}) - -export const selectSLTPModalExistingPrices = createSelector( - selectAllSLTPOrders, - selectEditPositionModalInfo, - (orders, { market }) => { - const sl = orders.find( - (o) => o.marketKey === market?.marketKey && o.orderType === ConditionalOrderTypeEnum.STOP - ) - const tp = orders.find( - (o) => o.marketKey === market?.marketKey && o.orderType === ConditionalOrderTypeEnum.LIMIT - ) - - return { - takeProfitPrice: tp?.targetPrice ? stripZeros(tp.targetPrice.toString()) : '', - stopLossPrice: sl?.targetPrice ? stripZeros(sl.targetPrice.toString()) : '', - } - } -) - -export const selectSlTpTradeInputs = createSelector( - (state: RootState) => state.futures.crossMargin.tradeInputs, - (tradeInputs) => ({ - stopLossPrice: tradeInputs.stopLossPrice || '', - takeProfitPrice: tradeInputs.takeProfitPrice || '', - }) -) - -export const selectNewTradeHasSlTp = createSelector( - (state: RootState) => state.futures.crossMargin.tradeInputs, - (tradeInputs) => Number(tradeInputs.stopLossPrice) > 0 || Number(tradeInputs.takeProfitPrice) > 0 -) - -export const selectSlTpModalInputs = createSelector( - (state: RootState) => state.futures.crossMargin.sltpModalInputs, - (inputs) => ({ - stopLossPrice: inputs.stopLossPrice ?? '', - takeProfitPrice: inputs.takeProfitPrice ?? '', - }) -) - -export const selectCrossMarginOrderPrice = (state: RootState) => - state.futures.crossMargin.orderPrice.price ?? '' - -export const selectTradePreview = createSelector( - selectFuturesType, - selectTradeSizeInputs, - selectCrossMarginOrderPrice, - selectOrderType, - (state: RootState) => state.futures, - (type, { nativeSizeDelta }, orderPrice, orderType, futures) => { - const preview = futures[accountType(type)].previews.trade - const unserialized = preview ? unserializePotentialTrade(preview) : null - if (unserialized) { - const priceImpact = getDefaultPriceImpact(orderType) - const conditionalOrderPrice = wei(orderPrice || 0) - const price = - orderType !== 'market' && conditionalOrderPrice.gt(0) - ? conditionalOrderPrice - : unserialized.price - const desiredFillPrice = calculateDesiredFillPrice(nativeSizeDelta, price, priceImpact) - - return { - ...unserialized, - desiredFillPrice, - leverage: unserialized.margin.gt(0) - ? unserialized.notionalValue.div(unserialized.margin).abs() - : wei(0), - } - } - return null - } -) - -export const selectEditPositionPreview = createSelector( - selectFuturesType, - selectEditPositionInputs, - (state: RootState) => state.futures, - (type, { nativeSizeDelta }, futures) => { - if (isNaN(Number(nativeSizeDelta))) return null - const preview = futures[accountType(type)].previews.edit - const unserialized = preview ? unserializePotentialTrade(preview) : null - if (unserialized) { - const priceImpact = getDefaultPriceImpact('market') - const desiredFillPrice = calculateDesiredFillPrice( - wei(nativeSizeDelta || 0), - unserialized.price, - priceImpact - ) - - return { - ...unserialized, - desiredFillPrice, - leverage: unserialized.margin.gt(0) - ? unserialized.notionalValue.div(unserialized.margin).abs() - : wei(0), - } - } - return null - } -) - -export const selectClosePositionPreview = createSelector( - selectFuturesType, - selectEditPositionModalInfo, - selectClosePositionOrderInputs, - (state: RootState) => state.futures, - (type, { position }, { price, orderType }, futures) => { - const preview = futures[accountType(type)].previews.close - const unserialized = preview ? unserializePotentialTrade(preview) : null - if (unserialized) { - const priceImpact = getDefaultPriceImpact(orderType) - let orderPrice = - (orderType === 'market' ? unserialized.price : wei(price?.value || 0)) ?? wei(0) - const desiredFillPrice = calculateDesiredFillPrice( - position?.position?.side === PositionSide.LONG ? wei(-1) : wei(1), - orderPrice, - priceImpact - ) - - return { - ...unserialized, - desiredFillPrice, - leverage: unserialized.margin.gt(0) - ? unserialized.notionalValue.div(unserialized.margin).abs() - : wei(0), - } - } - return null - } -) - -export const selectIsolatedMarginLeverage = createSelector( - selectPosition, - selectIsolatedMarginTradeInputs, - (position, { susdSize }) => { - const remainingMargin = position?.remainingMargin - if (!remainingMargin || remainingMargin.eq(0) || !susdSize) return wei(0) - return susdSize.div(remainingMargin) - } -) - export const selectNextPriceDisclaimer = createSelector( selectMaxLeverage, selectLeverageInput, @@ -1026,150 +390,51 @@ export const selectNextPriceDisclaimer = createSelector( } ) -export const selectPlaceOrderTranslationKey = createSelector( - selectPosition, - selectCrossMarginMarginDelta, - selectCrossMarginBalanceInfo, - selectFuturesType, - (state: RootState) => state.futures[accountType(state.futures.selectedType)].orderType, - selectIsMarketCapReached, - (position, marginDelta, { freeMargin }, selectedType, orderType) => { - let remainingMargin - if (selectedType === 'isolated_margin') { - remainingMargin = position?.remainingMargin || ZERO_WEI - } else { - remainingMargin = marginDelta - } - - if (selectedType === 'isolated_margin') - return remainingMargin.add(freeMargin).lt('50') - ? 'futures.market.trade.button.deposit-margin-minimum' - : 'futures.market.trade.button.place-delayed-order' - if (orderType === 'limit') return 'futures.market.trade.button.place-limit-order' - if (orderType === 'stop_market') return 'futures.market.trade.button.place-stop-order' - if (!!position?.position) return 'futures.market.trade.button.modify-position' - return 'futures.market.trade.button.open-position' - } -) - export const selectFuturesPortfolio = createSelector( + selectSmartMarginPositions, selectCrossMarginPositions, - selectIsolatedMarginPositions, - selectCrossMarginBalanceInfo, - (crossPositions, isolatedPositions, { freeMargin }) => { - const isolatedValue = - isolatedPositions.reduce((sum, { remainingMargin }) => sum.add(remainingMargin), wei(0)) ?? - wei(0) + selectSmartMarginBalanceInfo, + (smartPositions, crossPositions, { freeMargin }) => { + // TODO: Update this for cross margin const crossValue = - crossPositions.reduce((sum, { remainingMargin }) => sum.add(remainingMargin), wei(0)) ?? + crossPositions.reduce((sum, { remainingMargin }) => sum.add(remainingMargin ?? 0), wei(0)) ?? + wei(0) + const smartValue = + smartPositions.reduce((sum, { remainingMargin }) => sum.add(remainingMargin), wei(0)) ?? wei(0) - const totalValue = isolatedValue.add(crossValue).add(freeMargin) + const totalValue = smartValue.add(crossValue).add(freeMargin) return { total: totalValue, - crossMarginFutures: crossValue.add(freeMargin), - isolatedMarginFutures: isolatedValue, + smartMargin: smartValue.add(freeMargin), + crossMargin: crossValue, } } ) -export const selectMarketMarginTransfers = createSelector( - selectWallet, - selectNetwork, - selectFuturesType, - selectMarketAsset, - (state: RootState) => state.futures, - (wallet, network, type, asset, futures) => { - if (!wallet) return [] - const account = futures[accountType(type)].accounts[network]?.[wallet] - const marginTransfers = account?.marginTransfers ?? [] - return accountType(type) === 'isolatedMargin' - ? marginTransfers.filter((o) => o.asset === asset) - : marginTransfers - } -) - -export const selectMarginTransfers = createSelector( - selectWallet, - selectNetwork, - selectFuturesType, - (state: RootState) => state.futures, - (wallet, network, type, futures) => { - if (!wallet) return [] - const account = futures[accountType(type)].accounts[network]?.[wallet] - return account?.marginTransfers ?? [] - } -) - -export const selectIsolatedMarginTransfers = createSelector( - selectWallet, - selectNetwork, - (state: RootState) => state.futures, - (wallet, network, futures) => { - if (!wallet) return [] - const account = futures.isolatedMargin.accounts[network]?.[wallet] - return account?.marginTransfers ?? [] - } -) - export const selectSmartMarginTransfers = createSelector( - selectWallet, - selectNetwork, - (state: RootState) => state.futures, - (wallet, network, futures) => { - if (!wallet) return [] - const account = futures.crossMargin.accounts[network]?.[wallet] + selectSmartMarginAccountData, + (account) => { return account?.marginTransfers ?? [] } ) -export const selectIdleMarginTransfers = createSelector( - selectWallet, - selectNetwork, - (state: RootState) => state.futures, - (wallet, network, futures) => { - if (!wallet) return [] - const account = futures.crossMargin.accounts[network]?.[wallet] - return account?.idleTransfers ?? [] - } -) - -export const selectOpenDelayedOrders = createSelector( - selectAccountData, - selectMarkets, - (account, markets) => { - const orders = unserializeDelayedOrders(account?.delayedOrders ?? []) - - return orders.map((o) => { - const timePastExecution = Math.floor((Date.now() - o.executableAtTimestamp) / 1000) - const market = markets.find((m) => m.marketKey === o.marketKey) - return { - ...o, - isStale: - timePastExecution > - DEFAULT_DELAYED_CANCEL_BUFFER + (market?.settings.offchainDelayedOrderMaxAge ?? 0), - } - }) - } -) - -export const selectTradePreviewError = createSelector( +export const selectMarginTransfers = createSelector( selectFuturesType, + selectCrossMarginMarginTransfers, + selectSmartMarginTransfers, (state: RootState) => state.futures, - (type, futures) => { - return type === 'cross_margin' - ? futures.queryStatuses.crossMarginTradePreview.error - : futures.queryStatuses.isolatedTradePreview.error + (type, smTransfers, cmTransfers) => { + return type === FuturesMarginType.CROSS_MARGIN ? cmTransfers : smTransfers } ) -export const selectIsFetchingTradePreview = createSelector( - selectFuturesType, +export const selectMarketMarginTransfers = createSelector( + selectMarginTransfers, + selectMarketAsset, (state: RootState) => state.futures, - (type, futures) => { - return type === 'cross_margin' - ? futures.queryStatuses.crossMarginTradePreview.status === FetchStatus.Loading - : futures.queryStatuses.isolatedTradePreview.status === FetchStatus.Loading + (transfers, asset) => { + return transfers.filter((o) => o.asset === asset) } ) @@ -1182,78 +447,16 @@ export const selectModifyPositionError = createSelector( } ) -export const selectTradePreviewStatus = createSelector( - selectFuturesType, - (state: RootState) => state.futures, - (type, futures) => { - return type === 'cross_margin' - ? futures.queryStatuses.crossMarginTradePreview - : futures.queryStatuses.isolatedTradePreview - } -) - -export const selectPositionStatus = createSelector( - selectFuturesType, - (state: RootState) => state.futures, - (type, futures) => { - return type === 'cross_margin' - ? futures.queryStatuses.crossMarginPositions - : futures.queryStatuses.isolatedPositions - } -) - export const selectPendingDelayedOrder = createSelector( - selectOpenDelayedOrders, + selectSmartMarginDelayedOrders, selectMarketKey, (delayedOrders, marketKey) => { - return delayedOrders.find((o) => o.marketKey === marketKey) - } -) - -export const selectIsConditionalOrder = createSelector( - (state: RootState) => state.futures.crossMargin.orderType, - (type) => type === 'limit' || type === 'stop_market' -) - -export const selectModifyIsolatedGasEstimate = createSelector( - (state: RootState) => state.futures.transactionEstimations, - (transactionEstimations) => { - const estimate = transactionEstimations['modify_isolated'] - if (estimate) return unserializeGasEstimate(estimate) - return null - } -) - -export const selectDelayedOrderFee = createSelector( - selectMarketInfo, - selectTradeSizeInputs, - selectSkewAdjustedPrice, - (market, { nativeSizeDelta }, price) => { - if ( - !market?.marketSkew || - !market?.feeRates.takerFeeOffchainDelayedOrder || - !market?.feeRates.makerFeeOffchainDelayedOrder || - !nativeSizeDelta - ) { - return { commitDeposit: undefined, delayedOrderFee: undefined } - } - - const notionalDiff = nativeSizeDelta.mul(price) - - const makerFee = market.feeRates.makerFeeOffchainDelayedOrder - const takerFee = market.feeRates.takerFeeOffchainDelayedOrder - - const staticRate = sameSide(notionalDiff, market.marketSkew) ? takerFee : makerFee - - return { - commitDeposit: notionalDiff.mul(staticRate).abs(), - delayedOrderFee: notionalDiff.mul(staticRate).abs(), - } + return delayedOrders.find((o) => o.market.marketKey === marketKey) } ) export const selectOpenInterest = createSelector(selectMarkets, (futuresMarkets) => - futuresMarkets.reduce( + (futuresMarkets as FuturesMarket[]).reduce( (total, { openInterest }) => total.add(openInterest.shortUSD).add(openInterest.longUSD), wei(0) ) @@ -1263,73 +466,43 @@ export const selectUsersTradesForMarket = createSelector( selectFuturesType, selectFuturesAccount, selectMarketAsset, + selectSmartMarginAccountData, selectCrossMarginAccountData, - selectIsolatedAccountData, - (type, account, asset, crossAccountData, isolatedAccountData) => { + (type, account, asset, smartAccountData, crossAccountData) => { let trades - if (type === 'cross_margin') { - trades = unserializeTrades(crossAccountData?.trades ?? []) + if (type === FuturesMarginType.SMART_MARGIN) { + trades = unserializeTrades(smartAccountData?.trades ?? []) } else if (account) { - trades = unserializeTrades(isolatedAccountData?.trades ?? []) + trades = unserializeTrades(crossAccountData?.trades ?? []) } return trades?.filter((t) => t.asset === asset) ?? [] } ) export const selectAllUsersTrades = createSelector( - selectIsolatedAccountData, selectCrossMarginAccountData, - (isolatedAccountData, crossAccountData) => { - const allTrades = [...(isolatedAccountData?.trades ?? []), ...(crossAccountData?.trades ?? [])] + selectSmartMarginAccountData, + (crossAccountData, smartAccountData) => { + const allTrades = [...(crossAccountData?.trades ?? []), ...(smartAccountData?.trades ?? [])] return unserializeTrades(allTrades) } ) -export const selectAllIsolatedTrades = createSelector( - selectIsolatedAccountData, - selectMarkets, - (isolatedAccountData, markets) => { - const trades = unserializeTrades(isolatedAccountData?.trades ?? []) - return trades.map((t) => { - const market = markets.find((m) => m.asset === t.asset) - return { - ...t, - market: market, - } - }) - } -) - -export const selectAllSmartMarginTrades = createSelector( - selectCrossMarginAccountData, - selectMarkets, - (smartMarginAccountData, markets) => { - const trades = unserializeTrades(smartMarginAccountData?.trades ?? []) - return trades.map((t) => { - const market = markets.find((m) => m.asset === t.asset) - return { - ...t, - market: market, - } - }) - } -) - export const selectAllTradesForAccountType = createSelector( - selectAllIsolatedTrades, + selectAllCrossMarginTrades, selectAllSmartMarginTrades, selectFuturesType, - (isolatedTrades, smartMarginTrades, accountType) => { - return accountType === 'isolated_margin' ? isolatedTrades : smartMarginTrades + (crossMarginTrades, smartMarginTrades, accountType) => { + return accountType === FuturesMarginType.CROSS_MARGIN ? crossMarginTrades : smartMarginTrades } ) export const selectSelectedPortfolioTimeframe = (state: RootState) => state.futures.dashboard.selectedPortfolioTimeframe -export const selectIsolatedPortfolioValues = createSelector( - selectAllIsolatedTrades, - selectIsolatedMarginTransfers, +export const selectCrossMarginPortfolioValues = createSelector( + selectAllCrossMarginTrades, + selectCrossMarginMarginTransfers, selectFuturesPortfolio, (trades, transfers, portfolioTotal) => { const tradeActions = trades.map(({ account, timestamp, asset, margin }) => ({ @@ -1385,12 +558,12 @@ export const selectIsolatedPortfolioValues = createSelector( return [...acc.slice(0, acc.length - (replacePrevious ? 1 : 0)), newAction] } - }, [] as IsolatedPerpsPortfolio[]) + }, [] as CrossPerpsPortfolio[]) return [ ...accountHistory.map(({ timestamp, total }) => ({ timestamp: timestamp * 1000, total })), { timestamp: Date.now(), - total: portfolioTotal.isolatedMarginFutures.toNumber(), + total: portfolioTotal.crossMargin.toNumber(), }, ] } @@ -1433,7 +606,7 @@ export const selectSmartMarginPortfolioValues = createSelector( const accountHistory = actions.reduce((acc, action) => { if (acc.length === 0) { const newTotal = action.size !== 0 ? action.size : action.margin - const isIdle = action.size !== 0 && !action.asset ? true : false + const isIdle = action.size !== 0 && !action.asset const lastAction = isIdle ? { account: action.account, @@ -1486,17 +659,17 @@ export const selectSmartMarginPortfolioValues = createSelector( ...accountHistory.map(({ timestamp, total }) => ({ timestamp: timestamp * 1000, total })), { timestamp: Date.now(), - total: portfolioTotal.crossMarginFutures.toNumber(), + total: portfolioTotal.smartMargin.toNumber(), }, ] } ) export const selectPortfolioChartData = createSelector( - selectIsolatedPortfolioValues, + selectCrossMarginPortfolioValues, selectSmartMarginPortfolioValues, selectSelectedPortfolioTimeframe, - (isolatedPortfolioValues, smartPortfolioValues, timeframe) => { + (crossPortfolioValues, smartPortfolioValues, timeframe) => { // get the timeframe for interpolation const interpolationGap = timeframe === Period.ONE_YEAR @@ -1544,46 +717,23 @@ export const selectPortfolioChartData = createSelector( return portfolioData } - const isolatedPortfolioData = createPortfolioData(isolatedPortfolioValues) + const crossPortfolioData = createPortfolioData(crossPortfolioValues) const smartPortfolioData = createPortfolioData(smartPortfolioValues) return { - [FuturesAccountTypes.ISOLATED_MARGIN]: isolatedPortfolioData, - [FuturesAccountTypes.CROSS_MARGIN]: smartPortfolioData, + [FuturesMarginType.CROSS_MARGIN]: crossPortfolioData, + [FuturesMarginType.SMART_MARGIN]: smartPortfolioData, } } ) -export const selectCancellingConditionalOrder = (state: RootState) => - state.futures.crossMargin.cancellingOrder - -export const selectHasRemainingMargin = createSelector( - selectPosition, - selectFuturesType, - selectCrossMarginBalanceInfo, - (position, futuresType, balanceInfo) => { - const posMargin = position?.remainingMargin ?? ZERO_WEI - return futuresType === 'cross_margin' - ? balanceInfo.freeMargin.add(posMargin).gt(0) - : posMargin.gt(0) - } -) - -export const selectOrderFee = createSelector( - selectMarketInfo, - selectTradeSizeInputs, - (marketInfo, { susdSizeDelta }) => { - return computeDelayedOrderFee(marketInfo, susdSizeDelta) - } -) - export const selectMaxUsdSizeInput = createSelector( selectFuturesType, - selectPosition, + selectCrossMarginAvailableMargin, selectMaxLeverage, selectMarginDeltaInputValue, - (futuresType, position, maxLeverage, marginDelta) => { + (futuresType, availableMargin, maxLeverage, marginDelta) => { const margin = - futuresType === 'cross_margin' ? marginDelta || 0 : position?.remainingMargin ?? wei(0) + futuresType === FuturesMarginType.SMART_MARGIN ? marginDelta || 0 : availableMargin return maxLeverage.mul(margin) } ) @@ -1613,30 +763,6 @@ export const selectAvailableOi = createSelector(selectMarketInfo, (marketInfo) = } }) -export const selectPreviewAvailableMargin = createSelector( - selectMarketInfo, - selectTradePreview, - selectDelayedOrderFee, - (marketInfo, tradePreview, delayedOrderFee) => { - if (!marketInfo || !tradePreview) return ZERO_WEI - - let inaccessible = tradePreview.notionalValue.div(marketInfo.appMaxLeverage).abs() ?? ZERO_WEI - const totalDeposit = !!delayedOrderFee.commitDeposit - ? delayedOrderFee.commitDeposit.add(marketInfo.keeperDeposit) - : ZERO_WEI - - // If the user has a position open, we'll enforce a min initial margin requirement. - if (inaccessible.gt(0) && inaccessible.lt(marketInfo.minInitialMargin)) { - inaccessible = marketInfo.minInitialMargin - } - - // check if available margin will be less than 0 - return tradePreview.margin.sub(inaccessible).sub(totalDeposit).gt(0) - ? tradePreview.margin.sub(inaccessible).sub(totalDeposit).abs() - : ZERO_WEI - } -) - export const selectAverageEntryPrice = createSelector( selectTradePreview, selectSelectedMarketPositionHistory, @@ -1661,110 +787,11 @@ export const selectAverageEntryPrice = createSelector( } ) -type PositionPreviewData = { - fillPrice: Wei - sizeIsNotZero: boolean - positionSide: string - positionSize: Wei - leverage: Wei - liquidationPrice: Wei - avgEntryPrice: Wei - notionalValue: Wei - showStatus: boolean -} - -export const selectPositionPreviewData = createSelector( - selectTradePreview, - selectPosition, - selectAverageEntryPrice, - (tradePreview, position, modifiedAverage) => { - if (!position?.position || tradePreview === null) { - return null - } - - return { - fillPrice: tradePreview.price, - sizeIsNotZero: tradePreview.size && !tradePreview.size?.eq(0), - positionSide: tradePreview.size?.gt(0) ? PositionSide.LONG : PositionSide.SHORT, - positionSize: tradePreview.size?.abs(), - notionalValue: tradePreview.notionalValue, - leverage: tradePreview.margin.gt(0) - ? tradePreview.notionalValue.div(tradePreview.margin).abs() - : ZERO_WEI, - liquidationPrice: tradePreview.liqPrice, - avgEntryPrice: modifiedAverage || ZERO_WEI, - showStatus: tradePreview.showStatus, - } as PositionPreviewData - } -) - -export const selectPreviewMarginChange = createSelector( - selectTradePreview, - selectPreviewAvailableMargin, - selectMarketInfo, - (tradePreview, previewAvailableMargin, marketInfo) => { - const potentialMarginUsage = tradePreview?.margin.gt(0) - ? tradePreview!.margin.sub(previewAvailableMargin).div(tradePreview!.margin).abs() ?? ZERO_WEI - : ZERO_WEI - - const maxPositionSize = - !!tradePreview && !!marketInfo - ? tradePreview.margin - .mul(marketInfo.appMaxLeverage) - .mul(tradePreview.side === PositionSide.LONG ? 1 : -1) - : null - - const potentialBuyingPower = !!maxPositionSize - ? maxPositionSize.sub(tradePreview?.notionalValue).abs() - : ZERO_WEI - - return { - showPreview: !!tradePreview && tradePreview.sizeDelta.abs().gt(0), - totalMargin: tradePreview?.margin || ZERO_WEI, - availableMargin: previewAvailableMargin.gt(0) ? previewAvailableMargin : ZERO_WEI, - buyingPower: potentialBuyingPower.gt(0) ? potentialBuyingPower : ZERO_WEI, - marginUsage: potentialMarginUsage.gt(1) ? wei(1) : potentialMarginUsage, - } - } -) - -export const selectCrossPreviewCount = (state: RootState) => - state.futures.crossMargin.previewDebounceCount - -export const selectIsolatedPreviewCount = (state: RootState) => - state.futures.isolatedMargin.previewDebounceCount - -export const selectBuyingPower = createSelector( - selectPosition, - selectMaxLeverage, - (position, maxLeverage) => { - const totalMargin = position?.remainingMargin ?? ZERO_WEI - return totalMargin.gt(ZERO_WEI) ? totalMargin.mul(maxLeverage ?? ZERO_WEI) : ZERO_WEI - } -) - -export const selectMarginUsage = createSelector( - selectAvailableMargin, - selectPosition, - (availableMargin, position) => { - const totalMargin = position?.remainingMargin ?? ZERO_WEI - return availableMargin.gt(ZERO_WEI) - ? totalMargin.sub(availableMargin).div(totalMargin) - : totalMargin.gt(ZERO_WEI) - ? wei(1) - : ZERO_WEI - } -) - export const selectMarketSuspended = createSelector( selectMarketInfo, (marketInfo) => marketInfo?.isSuspended ) -export const selectFuturesFees = (state: RootState) => state.futures.futuresFees - -export const selectFuturesFeesForAccount = (state: RootState) => state.futures.futuresFeesForAccount - export const selectHistoricalFundingRatePeriod = (state: RootState) => state.futures.historicalFundingRatePeriod @@ -1784,9 +811,17 @@ export const selectModalSLValidity = createSelector( ({ stopLossPrice }, { position, marketPrice }) => { return stopLossValidity( stopLossPrice, - position?.position?.liquidationPrice, - position?.position?.side || PositionSide.LONG, + position?.liquidationPrice, + position?.side || PositionSide.LONG, marketPrice ) } ) + +export const selectPendingOrdersCount = createSelector( + selectPendingAsyncOrdersCount, + selectSmartMarginDelayedOrders, + selectFuturesType, + (asyncCount, delayedOrders, type) => + type === FuturesMarginType.CROSS_MARGIN ? asyncCount : delayedOrders.length +) diff --git a/packages/app/src/state/futures/smartMargin/actions.ts b/packages/app/src/state/futures/smartMargin/actions.ts new file mode 100644 index 0000000000..74cb12b7d4 --- /dev/null +++ b/packages/app/src/state/futures/smartMargin/actions.ts @@ -0,0 +1,1473 @@ +import KwentaSDK from '@kwenta/sdk' +import { + DEFAULT_PRICE_IMPACT_DELTA_PERCENT, + MIN_ACCOUNT_KEEPER_BAL, + SL_TP_MAX_SIZE, + ZERO_ADDRESS, + ZERO_WEI, +} from '@kwenta/sdk/constants' +import { + PerpsMarketV2, + ConditionalOrder, + PerpsV2Position, + FuturesPositionHistory, + FuturesPotentialTradeDetails, + FuturesTrade, + FuturesVolumes, + MarginTransfer, + PositionSide, + PotentialTradeStatus, + SmartMarginOrderInputs, + ConditionalOrderTypeEnum, + SLTPOrderInputs, + FuturesMarketKey, + FuturesMarketAsset, + NetworkId, + TransactionStatus, + FuturesMarginType, +} from '@kwenta/sdk/types' +import { + calculateDesiredFillPrice, + getTradeStatusMessage, + serializePotentialTrade, + marketOverrides, + floorNumber, +} from '@kwenta/sdk/utils' +import { createAsyncThunk } from '@reduxjs/toolkit' +import Wei, { wei } from '@synthetixio/wei' +import { debounce } from 'lodash' + +import { notifyError } from 'components/ErrorNotifier' +import { monitorAndAwaitTransaction } from 'state/app/helpers' +import { + handleTransactionError, + setOpenModal, + setShowPositionModal, + setTransaction, + updateTransactionHash, +} from 'state/app/reducer' +import { fetchBalances } from 'state/balances/actions' +import { EST_KEEPER_GAS_FEE, ZERO_CM_FEES, ZERO_STATE_TRADE_INPUTS } from 'state/constants' +import { serializeWeiObject } from 'state/helpers' +import { AppDispatch, AppThunk, RootState } from 'state/store' +import { ThunkConfig } from 'state/types' +import { selectNetwork, selectWallet } from 'state/wallet/selectors' +import { computeDelayedOrderFee } from 'utils/costCalculations' +import { + formatDelayedOrders, + orderPriceInvalidLabel, + serializeCmBalanceInfo, + serializeDelayedOrders, + serializeConditionalOrders, + serializeFuturesVolumes, + serializeV2Markets, + serializePositionHistory, + serializeTrades, +} from 'utils/futures' +import logError from 'utils/logError' +import { refetchWithComparator } from 'utils/queries' + +import { selectMarketIndexPrice } from '../common/selectors' +import { + AccountContext, + DebouncedSMPreviewParams, + DelayedOrderWithDetails, + PreviewAction, + SmartMarginTradePreviewParams, +} from '../common/types' +import { ExecuteDelayedOrderInputs } from '../types' + +import { + handlePreviewError, + setSmartMarginAccount, + setSmartMarginFees, + setSmartMarginMarginDelta, + setSmartMarginOrderCancelling, + setSmartMarginOrderPrice, + setSmartMarginOrderPriceInvalidLabel, + setSmartMarginTradeInputs, + setSmartMarginTradePreview, + setSmartMarginLeverageInput, + setLeverageSide, + setSmartMarginEditPositionInputs, + incrementSmartMarginPreviewCount, + setClosePositionSizeDelta, + setClosePositionPrice, + clearSmartMarginTradePreviews, + setKeeperDeposit, +} from './reducer' +import { + selectSmartMarginAccount, + selectSmartMarginMarginDelta, + selectSmartMarginOrderPrice, + selectSmartMarginSupportedNetwork, + selectIsConditionalOrder, + selectKeeperEthBalance, + selectSmartMarginLeverageSide, + selectV2MarketAsset, + selectV2Markets, + selectOrderType, + selectOrderFeeCap, + selectSmartMarginPosition, + selectSmartMarginTradeInputs, + selectIdleMargin, + selectSlTpTradeInputs, + selectSmartMarginEditPosInputs, + selectSmartMarginPreviewCount, + selectTradePreview, + selectCloseSMPositionOrderInputs, + selectSmartMarginPositions, + selectEditPositionModalInfo, + selectSlTpModalInputs, + selectSmartMarginKeeperDeposit, + selectEditPositionPreview, + selectClosePositionPreview, + selectV2MarketInfo, + selectSmartMarginDelayedOrders, + selectV2SkewAdjustedPrice, + selectRequiredEthForPendingOrders, +} from './selectors' +import { SmartMarginBalanceInfo } from './types' + +export const fetchMarketsV2 = createAsyncThunk< + { markets: PerpsMarketV2[]; networkId: NetworkId } | undefined, + void, + ThunkConfig +>('futures/fetchMarkets', async (_, { getState, extra: { sdk } }) => { + const supportedNetwork = selectSmartMarginSupportedNetwork(getState()) + const networkId = selectNetwork(getState()) + + if (!supportedNetwork) return + try { + const markets = await sdk.futures.getMarkets() + // apply overrides + const overrideMarkets = markets.map((m) => { + return marketOverrides[m.marketKey] + ? { + ...m, + ...marketOverrides[m.marketKey], + } + : m + }) + + const serializedMarkets = serializeV2Markets(overrideMarkets) + return { markets: serializedMarkets, networkId } + } catch (err) { + logError(err) + notifyError('Failed to fetch markets', err) + throw err + } +}) + +export const fetchSmartMarginBalanceInfo = createAsyncThunk< + { balanceInfo: SmartMarginBalanceInfo; account: string; network: NetworkId } | undefined, + void, + ThunkConfig +>( + 'futures/fetchSmartMarginBalanceInfo', + async (_, { getState, extra: { sdk }, rejectWithValue }) => { + const account = selectSmartMarginAccount(getState()) + const network = selectNetwork(getState()) + const wallet = selectWallet(getState()) + const crossMarginSupported = selectSmartMarginSupportedNetwork(getState()) + if (!account || !wallet || !crossMarginSupported) return + try { + const balanceInfo = await sdk.futures.getSmartMarginBalanceInfo(wallet, account) + return { balanceInfo: serializeCmBalanceInfo(balanceInfo), account, network } + } catch (err) { + logError(err) + notifyError('Failed to fetch cross-margin balance info', err) + rejectWithValue(err.message) + return undefined + } + } +) + +export const fetchSmartMarginPositions = createAsyncThunk< + { positions: PerpsV2Position[]; account: string; network: NetworkId } | undefined, + void, + ThunkConfig +>('futures/fetchSmartMarginPositions', async (_, { getState, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + const supportedNetwork = selectSmartMarginSupportedNetwork(getState()) + const network = selectNetwork(getState()) + const markets = selectV2Markets(getState()) + + if (!account || !supportedNetwork) return + try { + const positions = await sdk.futures.getFuturesPositions( + account, + markets.map((m) => ({ asset: m.asset, marketKey: m.marketKey, address: m.marketAddress })) + ) + const serializedPositions = positions.map( + (p) => serializeWeiObject(p) as PerpsV2Position + ) + return { positions: serializedPositions, account, network } + } catch (err) { + logError(err) + notifyError('Failed to fetch smart-margin positions', err) + throw err + } +}) + +export const refetchSmartMarginPosition = createAsyncThunk< + { + position: PerpsV2Position + wallet: string + networkId: NetworkId + } | null, + void, + ThunkConfig +>('futures/refetchSmartMarginPosition', async (type, { getState, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + if (!account) throw new Error('No wallet connected') + const marketInfo = selectV2MarketInfo(getState()) + const networkId = selectNetwork(getState()) + const position = selectSmartMarginPosition(getState()) + if (!marketInfo || !position) throw new Error('Market or position not found') + + const result = await refetchWithComparator( + () => + sdk.futures.getFuturesPositions(account!, [ + { + asset: marketInfo.asset, + marketKey: marketInfo.marketKey, + address: marketInfo.marketAddress, + }, + ]), + position?.remainingMargin?.toString(), + (existing, next) => { + return existing === next[0]?.remainingMargin.toString() + } + ) + + if (result.data[0]) { + const serialized = serializeWeiObject( + result.data[0] as PerpsV2Position + ) as PerpsV2Position + return { position: serialized, wallet: account, futuresType: type, networkId } + } + return null +}) + +export const fetchSmartMarginAccount = createAsyncThunk< + { account: string; wallet: string; network: NetworkId } | undefined, + void, + ThunkConfig +>('futures/fetchSmartMarginAccount', async (_, { getState, extra: { sdk }, rejectWithValue }) => { + const wallet = selectWallet(getState()) + const supportedNetwork = selectSmartMarginSupportedNetwork(getState()) + const network = selectNetwork(getState()) + if (!wallet || !supportedNetwork) return undefined + const accounts = getState().smartMargin.accounts + + // Already have an accoutn fetched and persisted for this address + if (accounts[network]?.[wallet]?.account) return + + try { + const accounts = await sdk.futures.getSmartMarginAccounts(wallet) + const account = accounts[0] + if (account) return { account, wallet, network } + return undefined + } catch (err) { + notifyError('Failed to fetch smart margin account', err) + rejectWithValue(err.message) + } +}) + +export const fetchDailyVolumesV2 = createAsyncThunk, void, ThunkConfig>( + 'futures/fetchDailyVolumesV2', + async (_, { extra: { sdk } }) => { + const volumes = await sdk.futures.getDailyVolumes() + return serializeFuturesVolumes(volumes) + } +) + +export const fetchSmartMarginAccountData = createAsyncThunk( + 'futures/fetchSmartMarginAccountData', + async (_, { dispatch }) => { + dispatch(fetchSmartMarginPositions()) + dispatch(fetchSmartMarginBalanceInfo()) + } +) + +export const fetchSmartMarginMarketData = createAsyncThunk( + 'futures/fetchSmartMarginMarketData', + async (_, { dispatch }) => { + await dispatch(fetchMarketsV2()) + dispatch(fetchDailyVolumesV2()) + } +) + +export const fetchSmartMarginOpenOrders = createAsyncThunk< + | { + conditionalOrders: ConditionalOrder[] + delayedOrders: DelayedOrderWithDetails[] + account: string + network: NetworkId + } + | undefined, + void, + ThunkConfig +>('futures/fetchSmartMarginOpenOrders', async (_, { dispatch, getState, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + const supportedNetwork = selectSmartMarginSupportedNetwork(getState()) + const network = selectNetwork(getState()) + const markets = selectV2Markets(getState()) + const existingOrders = selectSmartMarginDelayedOrders(getState()) + + const marketAddresses = markets.map((market) => market.marketAddress) + + if (!account || !supportedNetwork) return + try { + const orders = await sdk.futures.getConditionalOrders(account) + const delayedOrders = await sdk.futures.getDelayedOrders(account, marketAddresses) + const nonzeroOrders = formatDelayedOrders(delayedOrders, markets) + + const orderDropped = existingOrders.length > nonzeroOrders.length + if (orderDropped) { + dispatch(fetchSmartMarginPositions()) + } + + return { + account, + network, + delayedOrders: serializeDelayedOrders(nonzeroOrders), + conditionalOrders: serializeConditionalOrders(orders), + } + } catch (err) { + notifyError('Failed to fetch open orders', err) + logError(err) + throw err + } +}) + +export const fetchSmartMarginTradePreview = createAsyncThunk< + { preview: FuturesPotentialTradeDetails | null; type: PreviewAction }, + DebouncedSMPreviewParams, + ThunkConfig +>( + 'futures/fetchSmartMarginTradePreview', + async (params, { dispatch, getState, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + const freeMargin = selectIdleMargin(getState()) + const positions = selectSmartMarginPositions(getState()) + const position = positions.find((p) => p.market.marketKey === params.market.key) + + const marketMargin = position?.remainingMargin ?? wei(0) + if ( + // Require both size and margin for a trade + (params.action === 'trade' && (params.sizeDelta.eq(0) || params.marginDelta.eq(0))) || + // Require one or the other when editing a position + (params.sizeDelta.eq(0) && params.marginDelta.eq(0)) + ) { + return { preview: null, type: params.action } + } + + // If this is a trade with no existsing position size then we need to subtract + // remaining idle market margin to get an accurate preview + const marginDelta = + (!position || position.size.abs().eq(0)) && marketMargin.gt(0) && params.action === 'trade' + ? params.marginDelta.sub(marketMargin) + : params.marginDelta + + try { + const leverageSide = selectSmartMarginLeverageSide(getState()) + const preview = await sdk.futures.getSmartMarginTradePreview( + account || ZERO_ADDRESS, + params.market.key, + params.market.address, + { ...params, leverageSide, marginDelta } + ) + + // Check the preview hasn't been cleared before query resolves + const count = selectSmartMarginPreviewCount(getState()) + + if (count !== params.debounceCount) { + const existing = selectTradePreview(getState()) + const returnPreview = existing ? serializePotentialTrade(existing) : null + return { preview: returnPreview, type: params.action } + } + + if (params.marginDelta.gt(freeMargin) && preview.status === 0) { + // Show insufficient margin message + preview.status = PotentialTradeStatus.INSUFFICIENT_FREE_MARGIN + preview.statusMessage = getTradeStatusMessage(PotentialTradeStatus.INSUFFICIENT_FREE_MARGIN) + preview.showStatus = true + } + + const serializedPreview = serializePotentialTrade({ + ...preview, + marketKey: params.market.key, + }) + return { preview: serializedPreview, type: params.action } + } catch (err) { + logError(err) + notifyError('Failed to generate trade preview', err) + dispatch( + handlePreviewError({ + error: err.message, + previewType: params.action, + }) + ) + return { preview: null, type: params.action } + } + } +) + +export const clearTradeInputs = createAsyncThunk( + 'futures/clearTradeInputs', + async (_, { dispatch }) => { + dispatch(setSmartMarginMarginDelta('')) + dispatch(setSmartMarginFees(ZERO_CM_FEES)) + dispatch(setSmartMarginLeverageInput('')) + dispatch(clearSmartMarginTradePreviews()) + dispatch(setSmartMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) + dispatch(setSmartMarginEditPositionInputs({ nativeSizeDelta: '', marginDelta: '' })) + } +) + +export const editSmartMarginTradeMarginDelta = + (marginDelta: string): AppThunk => + (dispatch, getState) => { + const orderPrice = selectMarketIndexPrice(getState()) + const marketInfo = selectV2MarketInfo(getState()) + const isConditional = selectIsConditionalOrder(getState()) + const { stopLossPriceWei, takeProfitPriceWei } = selectSlTpTradeInputs(getState()) + + const { susdSize, nativeSizeDelta } = selectSmartMarginTradeInputs(getState()) + + if (!marketInfo) throw new Error('No market selected') + + if (!marginDelta || Number(marginDelta) === 0) { + dispatch(setSmartMarginMarginDelta(marginDelta)) + dispatch(setSmartMarginTradePreview({ preview: null, type: 'trade' })) + return + } + + const marginDelatWei = wei(marginDelta) + const leverage = wei(susdSize).div(marginDelatWei.abs()) + + dispatch(setSmartMarginMarginDelta(marginDelta)) + if (!leverage.eq(0)) { + dispatch(setSmartMarginLeverageInput(leverage.toString(2))) + } + + dispatch( + stageSmartMarginTradePreview({ + market: { key: marketInfo.marketKey, address: marketInfo.marketAddress }, + orderPrice, + marginDelta: wei(marginDelta || 0), + sizeDelta: nativeSizeDelta, + action: 'trade', + isConditional, + hasStopOrTakeProfit: !!stopLossPriceWei || !!takeProfitPriceWei, + }) + ) + } + +export const editSmartMarginTradeSize = + (size: string, currencyType: 'usd' | 'native'): AppThunk => + (dispatch, getState) => { + const indexPrice = selectMarketIndexPrice(getState()) + const marginDelta = selectSmartMarginMarginDelta(getState()) + const orderPrice = selectSmartMarginOrderPrice(getState()) + const isConditional = selectIsConditionalOrder(getState()) + const tradeSide = selectSmartMarginLeverageSide(getState()) + const marketInfo = selectV2MarketInfo(getState()) + const price = isConditional && Number(orderPrice) > 0 ? wei(orderPrice) : indexPrice + const { stopLossPriceWei, takeProfitPriceWei } = selectSlTpTradeInputs(getState()) + + if (!marketInfo) throw new Error('No market selected') + + if (size === '' || price.eq(0)) { + dispatch(setSmartMarginTradeInputs(ZERO_STATE_TRADE_INPUTS)) + dispatch(setSmartMarginTradePreview({ preview: null, type: 'trade' })) + dispatch(setSmartMarginLeverageInput('')) + return + } + + const nativeSize = + currencyType === 'native' ? size : String(floorNumber(wei(size).div(price), 4)) + const usdSize = currencyType === 'native' ? String(floorNumber(price.mul(size), 4)) : size + const leverage = marginDelta?.gt(0) ? wei(usdSize).div(marginDelta.abs()) : '0' + const sizeDeltaWei = + tradeSide === PositionSide.LONG ? wei(nativeSize || 0) : wei(nativeSize || 0).neg() + dispatch( + setSmartMarginTradeInputs({ + susdSize: usdSize, + nativeSize: nativeSize, + }) + ) + dispatch(setSmartMarginLeverageInput(leverage.toString(2))) + dispatch( + stageSmartMarginTradePreview({ + market: { + key: marketInfo.marketKey, + address: marketInfo.marketAddress, + }, + orderPrice: price, + marginDelta: wei(marginDelta), + sizeDelta: sizeDeltaWei, + action: 'trade', + isConditional, + hasStopOrTakeProfit: !!stopLossPriceWei || !!takeProfitPriceWei, + }) + ) + } + +export const editCrossMarginPositionSize = + (marketKey: FuturesMarketKey, nativeSizeDelta: string): AppThunk => + (dispatch, getState) => { + const { marketPrice } = selectEditPositionModalInfo(getState()) + dispatch( + setSmartMarginEditPositionInputs({ + marginDelta: '', + nativeSizeDelta: nativeSizeDelta, + }) + ) + try { + const market = getMarketDetailsByKey(getState, marketKey) + dispatch( + stageSmartMarginTradePreview({ + orderPrice: marketPrice, + market, + marginDelta: ZERO_WEI, + sizeDelta: wei(nativeSizeDelta || 0), + action: 'edit', + }) + ) + } catch (err) { + dispatch(handlePreviewError({ error: err.message, previewType: 'edit' })) + } + } + +export const editClosePositionSizeDelta = + (marketKey: FuturesMarketKey, nativeSizeDelta: string): AppThunk => + (dispatch, getState) => { + dispatch(setClosePositionSizeDelta(nativeSizeDelta)) + + if (nativeSizeDelta === '' || !nativeSizeDelta) { + dispatch(setSmartMarginTradePreview({ preview: null, type: 'close' })) + return + } + const { price, orderType } = selectCloseSMPositionOrderInputs(getState()) + const { marketPrice } = selectEditPositionModalInfo(getState()) + + try { + const market = getMarketDetailsByKey(getState, marketKey) + const smartMarginPrice = isNaN(Number(price)) || !price ? marketPrice : wei(price) + const odrderPrice = smartMarginPrice + const previewParams: SmartMarginTradePreviewParams = { + market, + sizeDelta: wei(nativeSizeDelta), + orderPrice: odrderPrice, + marginDelta: ZERO_WEI, + action: 'close', + isConditional: orderType !== 'market', + } + dispatch(stageSmartMarginTradePreview(previewParams)) + } catch (err) { + dispatch(handlePreviewError({ error: err.message, previewType: 'close' })) + } + } + +export const editClosePositionPrice = + (marketKey: FuturesMarketKey, price: string): AppThunk => + (dispatch, getState) => { + const { nativeSizeDelta, orderType } = selectCloseSMPositionOrderInputs(getState()) + const marketPrice = selectMarketIndexPrice(getState()) + const { position } = selectEditPositionModalInfo(getState()) + const closeTradeSide = + position?.side === PositionSide.SHORT ? PositionSide.LONG : PositionSide.SHORT + const invalidLabel = orderPriceInvalidLabel( + price || '0', + closeTradeSide, + marketPrice, + orderType + ) + + dispatch(setClosePositionPrice({ value: price, invalidLabel })) + + try { + const marketInfo = getMarketDetailsByKey(getState, marketKey) + dispatch( + stageSmartMarginTradePreview({ + market: marketInfo, + orderPrice: isNaN(Number(price)) || !price ? marketPrice : wei(price), + marginDelta: ZERO_WEI, + sizeDelta: wei(nativeSizeDelta || 0), + action: 'edit', + isConditional: orderType !== 'market', + }) + ) + } catch (err) { + dispatch(handlePreviewError({ error: err.message, previewType: 'close' })) + } + } + +export const editSmartMarginPositionMargin = + (marketKey: FuturesMarketKey, marginDelta: string): AppThunk => + (dispatch, getState) => { + const { marketPrice } = selectEditPositionModalInfo(getState()) + dispatch( + setSmartMarginEditPositionInputs({ + marginDelta: marginDelta, + nativeSizeDelta: '', + }) + ) + try { + const market = getMarketDetailsByKey(getState, marketKey) + + dispatch( + stageSmartMarginTradePreview({ + market, + orderPrice: marketPrice, + marginDelta: wei(marginDelta || 0), + sizeDelta: ZERO_WEI, + action: 'edit', + }) + ) + } catch (err) { + dispatch(handlePreviewError({ error: err.message, previewType: 'edit' })) + } + } + +export const refetchTradePreview = (): AppThunk => (dispatch, getState) => { + const orderPrice = selectSmartMarginOrderPrice(getState()) + const indexPrice = selectMarketIndexPrice(getState()) + const marketInfo = selectV2MarketInfo(getState()) + const marginDelta = selectSmartMarginMarginDelta(getState()) + const isConditionalOrder = selectIsConditionalOrder(getState()) + const price = isConditionalOrder && Number(orderPrice) > 0 ? wei(orderPrice) : indexPrice + const { nativeSizeDelta } = selectSmartMarginTradeInputs(getState()) + const isConditional = selectIsConditionalOrder(getState()) + const { stopLossPriceWei, takeProfitPriceWei } = selectSlTpTradeInputs(getState()) + + if (!marketInfo) throw new Error('No market selected') + + dispatch( + stageSmartMarginTradePreview({ + market: { key: marketInfo.marketKey, address: marketInfo.marketAddress }, + orderPrice: price, + marginDelta, + sizeDelta: nativeSizeDelta, + action: 'trade', + isConditional, + hasStopOrTakeProfit: !!stopLossPriceWei || !!takeProfitPriceWei, + }) + ) +} + +const stageSmartMarginTradePreview = createAsyncThunk< + void, + SmartMarginTradePreviewParams, + ThunkConfig +>('futures/stageSmartMarginTradePreview', async (inputs, { dispatch, getState }) => { + dispatch(calculateSmartMarginFees(inputs)) + dispatch(incrementSmartMarginPreviewCount()) + const debounceCount = selectSmartMarginPreviewCount(getState()) + debouncedPrepareSmartMarginTradePreview(dispatch, { ...inputs, debounceCount }) +}) + +export const changeLeverageSide = + (side: PositionSide): AppThunk => + (dispatch, getState) => { + const { nativeSizeString } = selectSmartMarginTradeInputs(getState()) + dispatch(setLeverageSide(side)) + dispatch(editSmartMarginTradeSize(nativeSizeString, 'native')) + } + +export const debouncedPrepareSmartMarginTradePreview = debounce( + (dispatch, inputs: DebouncedSMPreviewParams) => { + dispatch(fetchSmartMarginTradePreview(inputs)) + }, + 500 +) + +export const editTradeOrderPrice = + (price: string): AppThunk => + (dispatch, getState) => { + const rate = selectV2SkewAdjustedPrice(getState()) + const orderType = selectOrderType(getState()) + const side = selectSmartMarginLeverageSide(getState()) + const inputs = selectSmartMarginTradeInputs(getState()) + dispatch(setSmartMarginOrderPrice(price)) + const invalidLabel = orderPriceInvalidLabel(price, side, rate, orderType) + dispatch(setSmartMarginOrderPriceInvalidLabel(invalidLabel)) + if (!invalidLabel && price && inputs.susdSize) { + // Recalc the trade + dispatch(editSmartMarginTradeSize(inputs.susdSizeString, 'usd')) + } + } + +export const fetchPositionHistoryV2 = createAsyncThunk< + | { + history: FuturesPositionHistory[] + wallet: string + networkId: NetworkId + } + | undefined, + void, + ThunkConfig +>('futures/fetchPositionHistoryV2', async (_, { getState, extra: { sdk } }) => { + try { + const account = selectSmartMarginAccount(getState()) + const networkId = selectNetwork(getState()) + const wallet = selectWallet(getState()) + const supported = selectSmartMarginSupportedNetwork(getState()) + if (!wallet || !account || !supported) return + const history = await sdk.futures.getPositionHistory(account) + return { account, wallet, networkId, history: serializePositionHistory(history) } + } catch (err) { + notifyError('Failed to fetch position history', err) + throw err + } +}) + +export const fetchTradesForSelectedMarket = createAsyncThunk< + | { + trades: FuturesTrade[] + account: string + wallet: string + networkId: NetworkId + } + | undefined, + void, + ThunkConfig +>('futures/fetchTradesForSelectedMarket', async (_, { getState, extra: { sdk } }) => { + try { + const wallet = selectWallet(getState()) + const networkId = selectNetwork(getState()) + const marketAsset = selectV2MarketAsset(getState()) + const account = selectSmartMarginAccount(getState()) + const futuresSupported = selectSmartMarginSupportedNetwork(getState()) + + if (!futuresSupported || !wallet || !account) return + const trades = await sdk.futures.getTradesForMarket( + marketAsset, + wallet, + FuturesMarginType.SMART_MARGIN + ) + return { trades: serializeTrades(trades), networkId, account, wallet } + } catch (err) { + notifyError('Failed to fetch futures trades for selected market', err) + throw err + } +}) + +export const fetchAllV2TradesForAccount = createAsyncThunk< + | { + trades: FuturesTrade[] + account: string + wallet: string + networkId: NetworkId + } + | undefined, + void, + ThunkConfig +>('futures/fetchAllV2TradesForAccount', async (_, { getState, extra: { sdk } }) => { + try { + const wallet = selectWallet(getState()) + const networkId = selectNetwork(getState()) + const account = selectSmartMarginAccount(getState()) + const futuresSupported = selectSmartMarginSupportedNetwork(getState()) + if (!futuresSupported || !wallet || !account) return + const trades = await sdk.futures.getAllTrades(wallet, FuturesMarginType.SMART_MARGIN, 200) + return { trades: serializeTrades(trades), networkId, account, wallet } + } catch (err) { + notifyError('Failed to fetch futures trades', err) + throw err + } +}) + +export const calculateSmartMarginFees = + (params: SmartMarginTradePreviewParams): AppThunk => + (dispatch, getState) => { + const markets = selectV2Markets(getState()) + const market = markets.find((m) => m.marketKey === params.market.key) + if (!market) throw new Error('Missing market info to compute fee') + const keeperBalance = selectKeeperEthBalance(getState()) + const reservedEth = selectRequiredEthForPendingOrders(getState()) + const { delayedOrderFee } = computeDelayedOrderFee( + market, + params.sizeDelta.mul(params.orderPrice?.abs()) + ) + + let newOrders = params.isConditional ? 1 : 0 + newOrders += params.hasStopOrTakeProfit ? 1 : 0 + + const extraGas = newOrders * EST_KEEPER_GAS_FEE + + // Calculate required ETH based on pending orders + const requiredEth = wei(Math.max(reservedEth + extraGas, MIN_ACCOUNT_KEEPER_BAL.toNumber())) + const requiredDeposit = keeperBalance.lt(requiredEth) ? requiredEth.sub(keeperBalance) : wei(0) + + const fees = { + delayedOrderFee: delayedOrderFee.toString(), + keeperEthDeposit: requiredDeposit.toString(), + } + dispatch(setSmartMarginFees(fees)) + } + +export const calculateKeeperDeposit = (): AppThunk => (dispatch, getState) => { + const keeperBalance = selectKeeperEthBalance(getState()) + const requiredDeposit = keeperBalance.lt(MIN_ACCOUNT_KEEPER_BAL) + ? MIN_ACCOUNT_KEEPER_BAL.sub(keeperBalance) + : wei(0) + + dispatch(setKeeperDeposit(requiredDeposit.toString())) +} + +export const fetchMarginTransfersV2 = createAsyncThunk< + | { + marginTransfers: MarginTransfer[] + idleTransfers: MarginTransfer[] + context: AccountContext + } + | undefined, + void, + ThunkConfig +>('futures/fetchMarginTransfersV2', async (_, { getState, extra: { sdk } }) => { + const { wallet, futures } = getState() + const supportedNetwork = selectSmartMarginSupportedNetwork(getState()) + const network = selectNetwork(getState()) + const cmAccount = selectSmartMarginAccount(getState()) + if (!wallet.walletAddress || !supportedNetwork) return + try { + const transfers = await sdk.futures.getIsolatedMarginTransfers(cmAccount) + const idleTransfers = await sdk.futures.getSmartMarginTransfers(cmAccount) + + return { + marginTransfers: transfers, + idleTransfers: idleTransfers, + context: { + wallet: wallet.walletAddress, + network: network, + type: futures.selectedType, + cmAccount, + }, + } + } catch (err) { + logError(err) + notifyError('Failed to fetch margin transfers', err) + throw err + } +}) + +export const fetchFuturesFees = createAsyncThunk< + { + totalFuturesFeePaid: string + }, + { + start: number + end: number + }, + ThunkConfig +>('futures/fetchFuturesFees', async ({ start, end }, { extra: { sdk } }) => { + try { + const totalFuturesFeePaid = await sdk.kwentaToken.getFuturesFee(start, end) + return { totalFuturesFeePaid: totalFuturesFeePaid.toString() } + } catch (err) { + notifyError('Failed to fetch futures fees', err) + throw err + } +}) + +export const fetchFuturesFeesForAccount = createAsyncThunk< + { + futuresFeePaid: string + }, + { + start: number + end: number + }, + ThunkConfig +>('futures/fetchFuturesFeesForAccount', async ({ start, end }, { getState, extra: { sdk } }) => { + try { + const wallet = selectWallet(getState()) + const futuresFeePaid = await sdk.kwentaToken.getFuturesFeeForAccount(wallet!, start, end) + return { futuresFeePaid: futuresFeePaid.toString() } + } catch (err) { + notifyError('Failed to fetch futures fees for the account', err) + throw err + } +}) + +// Contract Mutations + +export const createSmartMarginAccount = createAsyncThunk< + { account: string; wallet: string; network: NetworkId } | undefined, + void, + ThunkConfig +>( + 'futures/createSmartMarginAccount', + async (_, { getState, dispatch, extra: { sdk }, rejectWithValue }) => { + const wallet = selectWallet(getState()) + const supportedNetwork = selectSmartMarginSupportedNetwork(getState()) + const network = selectNetwork(getState()) + if (!wallet || !supportedNetwork) return undefined + const accounts = getState().smartMargin.accounts + + // Already have an accoutn fetched and persisted for this address + if (accounts[network]?.[wallet]?.account) { + notifyError('There is already an account associated with this wallet') + rejectWithValue('Account already created') + } + + try { + const accounts = await sdk.futures.getSmartMarginAccounts() + // Check for existing account on the contract as only one account per user + if (accounts[0]) { + dispatch(setSmartMarginAccount({ account: accounts[0], wallet: wallet, network })) + return + } + + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'create_cross_margin_account', + hash: null, + }) + ) + const tx = await sdk.futures.createSmartMarginAccount() + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchSmartMarginAccount()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + } + } +) + +export const withdrawSmartMargin = createAsyncThunk( + 'futures/withdrawSmartMargin', + async (amount, { getState, dispatch, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + if (!account) { + notifyError('No smart margin account') + return + } + await submitSMTransferTransaction(dispatch, sdk, 'withdraw_smart_margin', account, amount) + } +) + +export const approveSmartMargin = createAsyncThunk( + 'futures/approveSmartMargin', + async (_, { getState, dispatch, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + if (!account) throw new Error('No smart margin account') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'approve_cross_margin', + hash: null, + }) + ) + const tx = await sdk.futures.approveSmartMarginDeposit(account) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchSmartMarginBalanceInfo()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const submitSmartMarginOrder = createAsyncThunk( + 'futures/submitSmartMarginOrder', + async (overridePriceProtection, { getState, dispatch, extra: { sdk } }) => { + const marketInfo = selectV2MarketInfo(getState()) + const account = selectSmartMarginAccount(getState()) + const tradeInputs = selectSmartMarginTradeInputs(getState()) + const marginDelta = selectSmartMarginMarginDelta(getState()) + const feeCap = selectOrderFeeCap(getState()) + const orderType = selectOrderType(getState()) + const orderPrice = selectSmartMarginOrderPrice(getState()) + const preview = selectTradePreview(getState()) + const keeperEthDeposit = selectSmartMarginKeeperDeposit(getState()) + const wallet = selectWallet(getState()) + const position = selectSmartMarginPosition(getState()) + const openDelayedOrders = selectSmartMarginDelayedOrders(getState()) + const { stopLossPrice, takeProfitPrice } = selectSlTpTradeInputs(getState()) + + try { + if (!marketInfo) throw new Error('Market info not found') + if (!account) throw new Error('No smart margin account found') + if (!wallet) throw new Error('No wallet connected') + if (!preview) throw new Error('Missing trade preview') + if (!overridePriceProtection && preview.exceedsPriceProtection) { + throw new Error('Price impact exceeds price protection') + } + + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'submit_cross_order', + hash: null, + }) + ) + + const orderInputs: SmartMarginOrderInputs = { + sizeDelta: tradeInputs.nativeSizeDelta, + marginDelta: marginDelta, + desiredFillPrice: preview.desiredFillPrice, + } + + // To separate Stop Loss and Take Profit from other limit / stop orders + // we set the size to max big num value. + + const maxSizeDelta = tradeInputs.nativeSizeDelta.gt(0) ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE + + if (Number(stopLossPrice) > 0) { + const desiredSLFillPrice = calculateDesiredFillPrice( + maxSizeDelta, + wei(stopLossPrice || 0), + wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.STOP_LOSS) + ) + orderInputs.stopLoss = { + price: wei(stopLossPrice), + desiredFillPrice: desiredSLFillPrice, + sizeDelta: tradeInputs.nativeSizeDelta.gt(0) ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE, + } + } + + if (Number(takeProfitPrice) > 0) { + const desiredTPFillPrice = calculateDesiredFillPrice( + maxSizeDelta, + wei(takeProfitPrice || 0), + wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.TAKE_PROFIT) + ) + orderInputs.takeProfit = { + price: wei(takeProfitPrice), + desiredFillPrice: desiredTPFillPrice, + sizeDelta: tradeInputs.nativeSizeDelta.gt(0) ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE, + } + } + + if (orderType !== 'market') { + orderInputs['conditionalOrderInputs'] = { + orderType: + orderType === 'limit' ? ConditionalOrderTypeEnum.LIMIT : ConditionalOrderTypeEnum.STOP, + feeCap, + price: wei(orderPrice || '0'), + reduceOnly: false, + } + } + + if (orderType !== 'market' || Number(takeProfitPrice) > 0 || Number(stopLossPrice) > 0) { + orderInputs.keeperEthDeposit = keeperEthDeposit + } + + let existingSize = position?.size ?? wei(0) + existingSize = position?.side === PositionSide.SHORT ? existingSize.neg() : existingSize + const isClosing = existingSize.add(tradeInputs.nativeSizeDelta).eq(0) + + const staleOrder = openDelayedOrders.find( + (o) => o.isStale && o.market.marketKey === marketInfo.marketKey + ) + + const tx = await sdk.futures.submitSmartMarginOrder( + { address: marketInfo.marketAddress, key: marketInfo.marketKey }, + wallet, + account, + orderInputs, + { cancelPendingReduceOrders: isClosing, cancelExpiredDelayedOrders: !!staleOrder } + ) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchSmartMarginOpenOrders()) + dispatch(setOpenModal(null)) + dispatch(fetchBalances()) + dispatch(clearTradeInputs()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const submitSmartMarginAdjustMargin = createAsyncThunk( + 'futures/submitSmartMarginAdjustMargin', + async (_, { getState, dispatch, extra: { sdk } }) => { + const { market } = selectEditPositionModalInfo(getState()) + const account = selectSmartMarginAccount(getState()) + const { marginDelta } = selectSmartMarginEditPosInputs(getState()) + + try { + if (!market) throw new Error('Market info not found') + if (!account) throw new Error('No smart margin account found') + if (!marginDelta || marginDelta === '') throw new Error('No margin amount set') + + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'submit_cross_order', + hash: null, + }) + ) + + const tx = await sdk.futures.modifySmartMarginMarketMargin( + account, + market.marketAddress, + wei(marginDelta) + ) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(setOpenModal(null)) + dispatch(refetchSmartMarginPosition()) + dispatch(fetchBalances()) + dispatch(clearTradeInputs()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const submitSmartMarginAdjustPositionSize = createAsyncThunk( + 'futures/submitSmartMarginAdjustPositionSize', + async (overridePriceProtection, { getState, dispatch, extra: { sdk } }) => { + const { market, position } = selectEditPositionModalInfo(getState()) + const account = selectSmartMarginAccount(getState()) + const preview = selectEditPositionPreview(getState()) + const { nativeSizeDelta } = selectSmartMarginEditPosInputs(getState()) + + try { + if (!market) throw new Error('Market info not found') + if (!account) throw new Error('No smart margin account found') + if (!nativeSizeDelta || nativeSizeDelta === '') throw new Error('No margin amount set') + if (!preview) throw new Error('Missing trade preview') + if (!overridePriceProtection && preview.exceedsPriceProtection) { + throw new Error('Price impact exceeds price protection') + } + + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'submit_cross_order', + hash: null, + }) + ) + + let existingSize = position?.size ?? wei(0) + existingSize = position?.side === PositionSide.SHORT ? existingSize.neg() : existingSize + const isClosing = existingSize.add(nativeSizeDelta).eq(0) + + const tx = await sdk.futures.modifySmartMarginPositionSize( + account, + { + key: market.marketKey, + address: market.marketAddress, + }, + wei(nativeSizeDelta), + preview.desiredFillPrice, + isClosing + ) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(setShowPositionModal(null)) + dispatch(fetchBalances()) + dispatch(clearTradeInputs()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const submitSmartMarginReducePositionOrder = createAsyncThunk( + 'futures/submitSmartMarginReducePositionOrder', + async (overridePriceProtection, { getState, dispatch, extra: { sdk } }) => { + const { market, position } = selectEditPositionModalInfo(getState()) + const account = selectSmartMarginAccount(getState()) + const { nativeSizeDelta, orderType, price } = selectCloseSMPositionOrderInputs(getState()) + const keeperEthDeposit = selectSmartMarginKeeperDeposit(getState()) + const feeCap = selectOrderFeeCap(getState()) + const wallet = selectWallet(getState()) + const preview = selectClosePositionPreview(getState()) + + try { + if (!market) throw new Error('Market info not found') + if (!wallet) throw new Error('No wallet connected') + if (!account) throw new Error('No smart margin account found') + if (!nativeSizeDelta || nativeSizeDelta === '') throw new Error('No margin amount set') + if (!preview) throw new Error('Missing trade preview') + if (!overridePriceProtection && preview.exceedsPriceProtection) { + throw new Error('Price impact exceeds price protection') + } + + const isClosing = wei(nativeSizeDelta) + .abs() + .eq(position?.size.abs() || 0) + + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'submit_cross_order', + hash: null, + }) + ) + + const orderInputs: SmartMarginOrderInputs = { + sizeDelta: wei(nativeSizeDelta), + marginDelta: wei(0), + desiredFillPrice: preview.desiredFillPrice, + } + + if (orderType !== 'market') { + orderInputs['conditionalOrderInputs'] = { + orderType: + orderType === 'limit' ? ConditionalOrderTypeEnum.LIMIT : ConditionalOrderTypeEnum.STOP, + feeCap, + price: wei(price?.value || '0'), + reduceOnly: true, + } + orderInputs.keeperEthDeposit = keeperEthDeposit + } + + const tx = + isClosing && orderType === 'market' + ? await sdk.futures.closeSmartMarginPosition( + { address: market.marketAddress, key: market.marketKey }, + account, + preview.desiredFillPrice + ) + : await sdk.futures.submitSmartMarginOrder( + { address: market.marketAddress, key: market.marketKey }, + wallet, + account, + orderInputs, + { cancelPendingReduceOrders: isClosing } + ) + + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(setOpenModal(null)) + dispatch(setShowPositionModal(null)) + dispatch(fetchBalances()) + dispatch(clearTradeInputs()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const cancelConditionalOrder = createAsyncThunk( + 'futures/cancelConditionalOrder', + async (contractOrderId, { getState, dispatch, extra: { sdk } }) => { + const crossMarginAccount = selectSmartMarginAccount(getState()) + try { + if (!crossMarginAccount) throw new Error('No smart margin account') + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'cancel_cross_margin_order', + hash: null, + }) + ) + + // Handle contract id or subgraph id + + dispatch(setSmartMarginOrderCancelling(contractOrderId)) + const tx = await sdk.futures.cancelConditionalOrder(crossMarginAccount, contractOrderId) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(setSmartMarginOrderCancelling(undefined)) + dispatch(setOpenModal(null)) + dispatch(fetchSmartMarginOpenOrders()) + } catch (err) { + dispatch(setSmartMarginOrderCancelling(undefined)) + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const withdrawAccountKeeperBalance = createAsyncThunk( + 'futures/withdrawAccountKeeperBalance', + async (amount, { getState, dispatch, extra: { sdk } }) => { + const crossMarginAccount = selectSmartMarginAccount(getState()) + try { + if (!crossMarginAccount) throw new Error('No smart margin account') + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'withdraw_keeper_balance', + hash: null, + }) + ) + + const tx = await sdk.futures.withdrawAccountKeeperBalance(crossMarginAccount, amount) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(setOpenModal(null)) + dispatch(fetchSmartMarginBalanceInfo()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const executeDelayedOrder = createAsyncThunk( + 'futures/executeDelayedOrder', + async ({ marketKey, marketAddress }, { getState, dispatch, extra: { sdk } }) => { + const account = selectSmartMarginAccount(getState()) + if (!account) throw new Error('No wallet connected') + try { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'execute_delayed_isolated', + hash: null, + }) + ) + const tx = await sdk.futures.executeDelayedOffchainOrder(marketKey, marketAddress, account) + dispatch(updateTransactionHash(tx.hash)) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchSmartMarginOpenOrders()) + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +// Utils + +const submitSMTransferTransaction = async ( + dispatch: AppDispatch, + sdk: KwentaSDK, + type: 'withdraw_smart_margin' | 'deposit_smart_margin', + account: string, + amount: Wei +) => { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: type, + hash: null, + }) + ) + + try { + const tx = + type === 'deposit_smart_margin' + ? await sdk.futures.depositSmartMarginAccount(account, amount) + : await sdk.futures.withdrawSmartMarginAccount(account, amount) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(fetchSmartMarginBalanceInfo()) + dispatch(setOpenModal(null)) + dispatch(refetchSmartMarginPosition()) + dispatch(fetchBalances()) + dispatch(fetchMarginTransfersV2()) + return tx + } catch (err) { + logError(err) + dispatch(handleTransactionError(err.message)) + throw err + } +} + +export const updateStopLossAndTakeProfit = createAsyncThunk( + 'futures/updateStopLossAndTakeProfit', + async (_, { getState, dispatch, extra: { sdk } }) => { + const { market, position } = selectEditPositionModalInfo(getState()) + const account = selectSmartMarginAccount(getState()) + const wallet = selectWallet(getState()) + const { stopLossPrice, takeProfitPrice } = selectSlTpModalInputs(getState()) + const keeperDeposit = selectSmartMarginKeeperDeposit(getState()) + + try { + if (!market) throw new Error('Market info not found') + if (!account) throw new Error('No smart margin account found') + if (!wallet) throw new Error('No wallet connected') + + const maxSizeDelta = + position?.side === PositionSide.LONG ? SL_TP_MAX_SIZE.neg() : SL_TP_MAX_SIZE + + const desiredSLFillPrice = calculateDesiredFillPrice( + maxSizeDelta, + wei(stopLossPrice || 0), + wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.STOP_LOSS) + ) + + const desiredTPFillPrice = calculateDesiredFillPrice( + maxSizeDelta, + wei(takeProfitPrice || 0), + wei(DEFAULT_PRICE_IMPACT_DELTA_PERCENT.TAKE_PROFIT) + ) + + const params: SLTPOrderInputs = { + keeperEthDeposit: keeperDeposit, + } + + // To separate Stop Loss and Take Profit from other limit / stop orders + // we set the size to max big num value. + + if (Number(stopLossPrice) > 0) { + params.stopLoss = { + price: wei(stopLossPrice), + desiredFillPrice: desiredSLFillPrice, + sizeDelta: maxSizeDelta, + } + } else if (!stopLossPrice) { + params.stopLoss = { + price: wei(0), + desiredFillPrice: wei(0), + sizeDelta: wei(0), + isCancelled: true, + } + } + + if (Number(takeProfitPrice) > 0) { + params.takeProfit = { + price: wei(takeProfitPrice), + desiredFillPrice: desiredTPFillPrice, + sizeDelta: maxSizeDelta, + } + } else if (!takeProfitPrice) { + params.takeProfit = { + price: wei(0), + desiredFillPrice: wei(0), + sizeDelta: wei(0), + isCancelled: true, + } + } + + if (params.stopLoss || params.takeProfit) { + dispatch( + setTransaction({ + status: TransactionStatus.AwaitingExecution, + type: 'submit_cross_order', + hash: null, + }) + ) + + const tx = await sdk.futures.updateStopLossAndTakeProfit(market.marketKey, account, params) + await monitorAndAwaitTransaction(dispatch, tx) + dispatch(setShowPositionModal(null)) + } + } catch (err) { + dispatch(handleTransactionError(err.message)) + throw err + } + } +) + +export const fetchFundingRatesHistory = createAsyncThunk< + { marketAsset: FuturesMarketAsset; rates: any }, + FuturesMarketAsset, + ThunkConfig +>('futures/fetchFundingRatesHistory', async (marketAsset, { extra: { sdk } }) => { + const rates = await sdk.futures.getMarketFundingRatesHistory(marketAsset) + return { marketAsset, rates } +}) + +const getMarketDetailsByKey = (getState: () => RootState, key: FuturesMarketKey) => { + const markets = selectV2Markets(getState()) + const market = markets.find((m) => { + return m.marketKey === key + }) + if (!market) throw new Error(`No market info found for ${key}`) + return { + address: market.marketAddress, + key: market.marketKey, + } +} diff --git a/packages/app/src/state/futures/smartMargin/reducer.ts b/packages/app/src/state/futures/smartMargin/reducer.ts new file mode 100644 index 0000000000..e4fafb772b --- /dev/null +++ b/packages/app/src/state/futures/smartMargin/reducer.ts @@ -0,0 +1,597 @@ +import { + NetworkId, + SmartMarginOrderType, + FuturesMarketAsset, + FuturesPotentialTradeDetails, + PositionSide, + FuturesTrade, + FuturesOrderType, +} from '@kwenta/sdk/types' +import { createSlice, PayloadAction } from '@reduxjs/toolkit' + +import { ORDER_PREVIEW_ERRORS } from 'queries/futures/constants' +import { + DEFAULT_MAP_BY_NETWORK, + DEFAULT_QUERY_STATUS, + LOADING_STATUS, + SUCCESS_STATUS, + ZERO_CM_FEES, + ZERO_STATE_ACCOUNT, + ZERO_STATE_TRADE_INPUTS, +} from 'state/constants' +import { FetchStatus } from 'state/types' + +import { PreviewAction } from '../common/types' + +import { + fetchSmartMarginBalanceInfo, + fetchSmartMarginPositions, + fetchMarketsV2, + fetchDailyVolumesV2, + refetchSmartMarginPosition, + fetchSmartMarginOpenOrders, + fetchSmartMarginTradePreview, + fetchSmartMarginAccount, + fetchPositionHistoryV2, + fetchTradesForSelectedMarket, + fetchAllV2TradesForAccount, + fetchMarginTransfersV2, + fetchFundingRatesHistory, + fetchFuturesFees, + fetchFuturesFeesForAccount, +} from './actions' +import { + SmartMarginAccountData, + SmartMarginState, + EditPositionInputs, + SmartMarginTradeFees, + SmartMarginTradeInputs, +} from './types' + +export const SMART_MARGIN_INITIAL_STATE: SmartMarginState = { + markets: { + 420: [], + 10: [], + }, + dailyMarketVolumes: {}, + fundingRates: [], + queryStatuses: { + markets: DEFAULT_QUERY_STATUS, + smartMarginBalanceInfo: DEFAULT_QUERY_STATUS, + dailyVolumes: DEFAULT_QUERY_STATUS, + positions: DEFAULT_QUERY_STATUS, + positionHistory: DEFAULT_QUERY_STATUS, + openOrders: DEFAULT_QUERY_STATUS, + tradePreview: DEFAULT_QUERY_STATUS, + account: DEFAULT_QUERY_STATUS, + trades: DEFAULT_QUERY_STATUS, + marginTransfers: DEFAULT_QUERY_STATUS, + historicalFundingRates: DEFAULT_QUERY_STATUS, + futuresFees: DEFAULT_QUERY_STATUS, + futuresFeesForAccount: DEFAULT_QUERY_STATUS, + }, + accounts: DEFAULT_MAP_BY_NETWORK, + selectedMarketAsset: FuturesMarketAsset.sETH, + leverageSide: PositionSide.LONG, + orderType: 'market', + orderFeeCap: '0', + leverageInput: '0', + selectedLeverageByAsset: {}, + showSmartMarginOnboard: false, + tradeInputs: ZERO_STATE_TRADE_INPUTS, + sltpModalInputs: { + stopLossPrice: '', + takeProfitPrice: '', + }, + editPositionInputs: { + nativeSizeDelta: '', + marginDelta: '', + }, + fees: ZERO_CM_FEES, + previews: { + trade: null, + close: null, + edit: null, + }, + previewDebounceCount: 0, + marginDelta: '0', + cancellingOrder: undefined, + depositApproved: false, + orderPrice: { + price: undefined, + invalidLabel: undefined, + }, + historicalFundingRates: {}, + closePositionOrderInputs: { + orderType: 'market', + nativeSizeDelta: '', + price: { + value: '', + invalidLabel: undefined, + }, + }, + futuresFees: '0', + futuresFeesForAccount: '0', +} + +const smartMarginSlice = createSlice({ + name: 'smartMargin', + initialState: SMART_MARGIN_INITIAL_STATE, + reducers: { + setMarketAsset: (smartMargin, action) => { + smartMargin.selectedMarketAsset = action.payload + smartMargin.tradeInputs = ZERO_STATE_TRADE_INPUTS + }, + setOrderType: (smartMargin, action: PayloadAction) => { + smartMargin.orderType = action.payload + }, + setClosePositionOrderType: (smartMargin, action: PayloadAction) => { + smartMargin.closePositionOrderInputs.orderType = action.payload + }, + setClosePositionSizeDelta: (smartMargin, action: PayloadAction) => { + smartMargin.closePositionOrderInputs.nativeSizeDelta = action.payload + }, + setClosePositionPrice: ( + smartMargin, + action: PayloadAction<{ value: string; invalidLabel: string | null | undefined }> + ) => { + smartMargin.closePositionOrderInputs.price = action.payload + }, + setOrderFeeCap: (smartMargin, action) => { + smartMargin.orderFeeCap = action.payload + }, + setLeverageSide: (smartMargin, action) => { + smartMargin.leverageSide = action.payload + }, + setSmartMarginMarginDelta: (smartMargin, action: PayloadAction) => { + smartMargin.marginDelta = action.payload + }, + setSmartMarginTradeStopLoss: (smartMargin, action: PayloadAction) => { + smartMargin.tradeInputs.stopLossPrice = action.payload + }, + setSmartMarginTradeTakeProfit: (smartMargin, action: PayloadAction) => { + smartMargin.tradeInputs.takeProfitPrice = action.payload + }, + setSLTPModalStopLoss: (smartMargin, action: PayloadAction) => { + smartMargin.sltpModalInputs.stopLossPrice = action.payload + }, + setSLTPModalTakeProfit: (smartMargin, action: PayloadAction) => { + smartMargin.sltpModalInputs.takeProfitPrice = action.payload + }, + setSmartMarginTradeInputs: ( + smartMargin, + action: PayloadAction> + ) => { + smartMargin.tradeInputs = action.payload + }, + setSmartMarginEditPositionInputs: ( + smartMargin, + action: PayloadAction> + ) => { + smartMargin.editPositionInputs = action.payload + }, + setSmartMarginOrderPrice: (smartMargin, action: PayloadAction) => { + smartMargin.orderPrice.price = action.payload + }, + setSmartMarginOrderPriceInvalidLabel: ( + smartMargin, + action: PayloadAction + ) => { + smartMargin.orderPrice.invalidLabel = action.payload + }, + setSmartMarginLeverageInput: (smartMargin, action: PayloadAction) => { + smartMargin.leverageInput = action.payload + }, + setSmartMarginFees: (smartMargin, action: PayloadAction>) => { + smartMargin.fees = action.payload + }, + setKeeperDeposit: (smartMargin, action: PayloadAction) => { + smartMargin.fees.keeperEthDeposit = action.payload + }, + handlePreviewError: ( + smartMargin, + { + payload, + }: PayloadAction<{ + error: string + previewType: PreviewAction + }> + ) => { + const message = Object.values(ORDER_PREVIEW_ERRORS).includes(payload.error) + ? payload.error + : 'Failed to get trade preview' + smartMargin.queryStatuses.tradePreview = { + status: FetchStatus.Error, + error: message, + } + smartMargin.previews[payload.previewType] = null + }, + + setSmartMarginAccount: ( + smartMargin, + action: PayloadAction<{ wallet: string; account: string; network: NetworkId }> + ) => { + const { account, wallet, network } = action.payload + if (!smartMargin.accounts[network]?.[wallet]?.account) { + smartMargin.accounts[network] = { + ...smartMargin.accounts[network], + [wallet]: { + account: account, + ...ZERO_STATE_ACCOUNT, + }, + } + } + }, + clearSmartMarginTradePreviews: (smartMargin) => { + smartMargin.previews = { + edit: null, + trade: null, + close: null, + } + smartMargin.queryStatuses.tradePreview = DEFAULT_QUERY_STATUS + }, + setSmartMarginTradePreview: ( + smartMargin, + { + payload, + }: PayloadAction<{ + preview: FuturesPotentialTradeDetails | null + type: PreviewAction + }> + ) => { + smartMargin.previews[payload.type] = payload.preview + }, + setSmartMarginOrderCancelling: ( + smartMargin, + { payload }: PayloadAction + ) => { + smartMargin.cancellingOrder = payload + }, + incrementSmartMarginPreviewCount: (smartMargin) => { + smartMargin.previewDebounceCount = smartMargin.previewDebounceCount + 1 + }, + }, + extraReducers: (builder) => { + // Markets + builder.addCase(fetchMarketsV2.pending, (smartMargin) => { + smartMargin.queryStatuses.markets = LOADING_STATUS + }) + builder.addCase(fetchMarketsV2.fulfilled, (smartMargin, { payload }) => { + smartMargin.queryStatuses.markets = SUCCESS_STATUS + if (payload) { + smartMargin.markets[payload.networkId] = payload.markets + } + }) + builder.addCase(fetchMarketsV2.rejected, (smartMargin) => { + smartMargin.queryStatuses.markets = { + status: FetchStatus.Error, + error: 'Failed to fetch markets', + } + }) + + // Smart margin overview + builder.addCase(fetchSmartMarginBalanceInfo.pending, (smartMargin) => { + smartMargin.queryStatuses.smartMarginBalanceInfo = LOADING_STATUS + }) + builder.addCase(fetchSmartMarginBalanceInfo.fulfilled, (smartMargin, action) => { + smartMargin.queryStatuses.smartMarginBalanceInfo = SUCCESS_STATUS + if (action.payload) { + const { account, network, balanceInfo } = action.payload + const wallet = findWalletForAccount(smartMargin, account, network) + if (wallet) { + updateSmartMarginAccount(smartMargin, network, wallet, { balanceInfo }) + } + } + }) + builder.addCase(fetchSmartMarginBalanceInfo.rejected, (futuresState) => { + futuresState.queryStatuses.smartMarginBalanceInfo = { + status: FetchStatus.Error, + error: 'Failed to fetch balance info', + } + }) + + // Daily volumes + builder.addCase(fetchDailyVolumesV2.pending, (smartMargin) => { + smartMargin.queryStatuses.dailyVolumes = LOADING_STATUS + }) + builder.addCase(fetchDailyVolumesV2.fulfilled, (smartMargin, action) => { + smartMargin.queryStatuses.dailyVolumes = SUCCESS_STATUS + smartMargin.dailyMarketVolumes = action.payload + }) + builder.addCase(fetchDailyVolumesV2.rejected, (smartMargin) => { + smartMargin.queryStatuses.dailyVolumes = { + status: FetchStatus.Error, + error: 'Failed to fetch volume data', + } + }) + + // margin transfers + builder.addCase(fetchMarginTransfersV2.pending, (smartMargin) => { + smartMargin.queryStatuses.marginTransfers = LOADING_STATUS + }) + builder.addCase(fetchMarginTransfersV2.fulfilled, (smartMargin, { payload }) => { + smartMargin.queryStatuses.marginTransfers = SUCCESS_STATUS + if (payload) { + const { context, marginTransfers, idleTransfers } = payload + const newAccountData = { + marginTransfers, + idleTransfers, + } + updateSmartMarginAccount(smartMargin, context.network, context.wallet, newAccountData) + } + }) + builder.addCase(fetchMarginTransfersV2.rejected, (smartMargin) => { + smartMargin.queryStatuses.marginTransfers = { + status: FetchStatus.Error, + error: 'Failed to fetch margin transfers', + } + }) + + // Cross margin positions + builder.addCase(fetchSmartMarginPositions.pending, (futuresState) => { + futuresState.queryStatuses.positions = LOADING_STATUS + }) + builder.addCase(fetchSmartMarginPositions.fulfilled, (smartMargin, action) => { + smartMargin.queryStatuses.positions = SUCCESS_STATUS + if (!action.payload) return + const { account, positions, network } = action.payload + const wallet = findWalletForAccount(smartMargin, account, network) + if (wallet) { + updateSmartMarginAccount(smartMargin, network, wallet, { positions }) + } + }) + builder.addCase(fetchSmartMarginPositions.rejected, (smartMargin) => { + smartMargin.queryStatuses.positions = { + status: FetchStatus.Error, + error: 'Failed to fetch positions', + } + }) + + // Refetch selected position + builder.addCase(refetchSmartMarginPosition.fulfilled, (smartMargin, { payload }) => { + if (payload) { + const { position, wallet, networkId } = payload + const account = smartMargin.accounts[networkId]?.[wallet] + + const existingPositions = account?.positions ?? [] + const index = existingPositions.findIndex((p) => p.marketKey === position.marketKey) + existingPositions[index] = position + smartMargin.accounts[networkId][wallet] = { + ...account, + positions: existingPositions, + } + } + }) + + // Fetch Cross Margin Open Orders + builder.addCase(fetchSmartMarginOpenOrders.pending, (futuresState) => { + futuresState.queryStatuses.openOrders = LOADING_STATUS + }) + builder.addCase(fetchSmartMarginOpenOrders.fulfilled, (smartMargin, action) => { + smartMargin.queryStatuses.openOrders = SUCCESS_STATUS + if (!action.payload) return + const { network, account, delayedOrders, conditionalOrders } = action.payload + const wallet = findWalletForAccount(smartMargin, account, network) + if (wallet) { + updateSmartMarginAccount(smartMargin, network, wallet, { + conditionalOrders, + delayedOrders, + }) + } + }) + builder.addCase(fetchSmartMarginOpenOrders.rejected, (futuresState) => { + futuresState.queryStatuses.openOrders = { + status: FetchStatus.Error, + error: 'Failed to fetch open orders for cross margin account', + } + }) + + // Fetch Smart Margin Trade Preview + builder.addCase(fetchSmartMarginTradePreview.pending, (futuresState) => { + futuresState.queryStatuses.tradePreview = LOADING_STATUS + }) + builder.addCase(fetchSmartMarginTradePreview.fulfilled, (smartMargin, { payload }) => { + smartMargin.previews[payload.type] = payload.preview + smartMargin.queryStatuses.tradePreview = SUCCESS_STATUS + }) + + // Fetch smart margin account + builder.addCase(fetchSmartMarginAccount.pending, (futuresState) => { + futuresState.queryStatuses.account = LOADING_STATUS + }) + builder.addCase(fetchSmartMarginAccount.fulfilled, (smartMargin, action) => { + if (action.payload) { + const { network, account, wallet } = action.payload + smartMargin.accounts[network] = { + ...smartMargin.accounts[network], + [wallet]: { + account: account, + ...ZERO_STATE_ACCOUNT, + }, + } + } + smartMargin.queryStatuses.account = SUCCESS_STATUS + }) + builder.addCase(fetchSmartMarginAccount.rejected, (futuresState) => { + futuresState.queryStatuses.account = { + status: FetchStatus.Error, + error: 'Failed to fetch cross margin account', + } + }) + + // Fetch position history + builder.addCase(fetchPositionHistoryV2.pending, (futuresState) => { + futuresState.queryStatuses.positionHistory = LOADING_STATUS + }) + builder.addCase(fetchPositionHistoryV2.fulfilled, (futuresState, { payload }) => { + futuresState.queryStatuses.positionHistory = SUCCESS_STATUS + if (payload) { + const { history: positionHistory, networkId, wallet } = payload + updateSmartMarginAccount(futuresState, networkId, wallet, { + positionHistory, + }) + } + }) + builder.addCase(fetchPositionHistoryV2.rejected, (futuresState) => { + futuresState.queryStatuses.positionHistory = { + error: 'Failed to fetch position history', + status: FetchStatus.Error, + } + }) + + // Fetch trades for market + builder.addCase(fetchTradesForSelectedMarket.pending, (futuresState) => { + futuresState.queryStatuses.trades = LOADING_STATUS + }) + builder.addCase(fetchTradesForSelectedMarket.fulfilled, (futuresState, { payload }) => { + futuresState.queryStatuses.trades = SUCCESS_STATUS + if (payload) { + const { trades, networkId, wallet } = payload + mergeTradesForAccount(futuresState, networkId, wallet, trades) + } + }) + builder.addCase(fetchTradesForSelectedMarket.rejected, (futuresState) => { + futuresState.queryStatuses.trades = { + error: 'Failed to fetch trades', + status: FetchStatus.Error, + } + }) + + // TODO: Combine all with market trades rather than overwrite as the filter is done on selector + + // Fetch all trades for account + builder.addCase(fetchAllV2TradesForAccount.pending, (futuresState) => { + futuresState.queryStatuses.trades = LOADING_STATUS + }) + builder.addCase(fetchAllV2TradesForAccount.fulfilled, (futuresState, { payload }) => { + futuresState.queryStatuses.trades = SUCCESS_STATUS + if (payload) { + const { trades, networkId, wallet } = payload + mergeTradesForAccount(futuresState, networkId, wallet, trades) + } + }) + builder.addCase(fetchAllV2TradesForAccount.rejected, (futuresState) => { + futuresState.queryStatuses.trades = { + error: 'Failed to fetch trades', + status: FetchStatus.Error, + } + }) + + // Fetch funding rates + builder.addCase(fetchFundingRatesHistory.rejected, (futuresState) => { + futuresState.queryStatuses.historicalFundingRates = { + error: 'Failed to fetch funding rates', + status: FetchStatus.Error, + } + }) + builder.addCase(fetchFundingRatesHistory.fulfilled, (futuresState, { payload }) => { + futuresState.historicalFundingRates[payload.marketAsset] = payload.rates + }) + + builder.addCase(fetchFuturesFees.pending, (futuresState) => { + futuresState.queryStatuses.futuresFees = LOADING_STATUS + }) + builder.addCase(fetchFuturesFees.fulfilled, (futuresState, action) => { + futuresState.queryStatuses.futuresFees = SUCCESS_STATUS + futuresState.futuresFees = action.payload.totalFuturesFeePaid + }) + builder.addCase(fetchFuturesFees.rejected, (futuresState) => { + futuresState.queryStatuses.futuresFees = { + status: FetchStatus.Error, + error: 'Failed to fetch fee data', + } + }) + + // Trading Fees by given epoch and trader + builder.addCase(fetchFuturesFeesForAccount.pending, (futuresState) => { + futuresState.queryStatuses.futuresFeesForAccount = LOADING_STATUS + }) + builder.addCase(fetchFuturesFeesForAccount.fulfilled, (futuresState, action) => { + futuresState.queryStatuses.futuresFeesForAccount = SUCCESS_STATUS + futuresState.futuresFeesForAccount = action.payload.futuresFeePaid + }) + builder.addCase(fetchFuturesFeesForAccount.rejected, (futuresState) => { + futuresState.queryStatuses.futuresFeesForAccount = { + status: FetchStatus.Error, + error: 'Failed to fetch fee data for the account', + } + }) + }, +}) + +export default smartMarginSlice.reducer + +export const { + handlePreviewError, + setMarketAsset, + setOrderType, + setClosePositionOrderType, + setClosePositionSizeDelta, + setClosePositionPrice, + setOrderFeeCap, + setLeverageSide, + setSmartMarginTradeInputs, + setSmartMarginAccount, + setSmartMarginMarginDelta, + setSmartMarginTradeStopLoss, + setSmartMarginTradeTakeProfit, + setSmartMarginOrderPrice, + setSmartMarginOrderPriceInvalidLabel, + setSmartMarginLeverageInput, + setSmartMarginFees, + setKeeperDeposit, + clearSmartMarginTradePreviews, + setSmartMarginTradePreview, + setSmartMarginOrderCancelling, + setSmartMarginEditPositionInputs, + incrementSmartMarginPreviewCount, + setSLTPModalStopLoss, + setSLTPModalTakeProfit, +} = smartMarginSlice.actions + +const findWalletForAccount = ( + crossMarginState: SmartMarginState, + account: string, + network: NetworkId +) => { + const entry = Object.entries(crossMarginState.accounts[network]).find(([_, value]) => { + return value.account === account + }) + return entry ? entry[0] : undefined +} + +const mergeTradesForAccount = ( + smartMarginState: SmartMarginState, + network: NetworkId, + wallet: string, + trades: FuturesTrade[] +) => { + const existingTrades = smartMarginState.accounts[network]?.[wallet]?.trades ?? [] + trades.forEach((t) => { + if (!existingTrades.find((et) => et.txnHash === t.txnHash)) { + existingTrades.push(t) + } + }) + existingTrades.sort((a, b) => b.timestamp - a.timestamp) + updateSmartMarginAccount(smartMarginState, network, wallet, { + trades: trades, + }) +} + +export const updateSmartMarginAccount = ( + smartMarginState: SmartMarginState, + network: NetworkId, + wallet: string, + newAccountData: Partial +) => { + const updatedAccount = { + ...ZERO_STATE_ACCOUNT, + ...smartMarginState.accounts[network]?.[wallet], + ...newAccountData, + } + + smartMarginState.accounts[network] = { + ...smartMarginState.accounts[network], + [wallet]: updatedAccount, + } +} diff --git a/packages/app/src/state/futures/smartMargin/selectors.ts b/packages/app/src/state/futures/smartMargin/selectors.ts new file mode 100644 index 0000000000..3cf9c7c1af --- /dev/null +++ b/packages/app/src/state/futures/smartMargin/selectors.ts @@ -0,0 +1,1171 @@ +import { SL_TP_MAX_SIZE, ZERO_WEI } from '@kwenta/sdk/constants' +import { + TransactionStatus, + ConditionalOrderTypeEnum, + PositionSide, + FuturesMarketKey, +} from '@kwenta/sdk/types' +import { + calculateDesiredFillPrice, + getDefaultPriceImpact, + unserializePotentialTrade, + MarketKeyByAsset, + MarketAssetByKey, + stripZeros, +} from '@kwenta/sdk/utils' +import { createSelector } from '@reduxjs/toolkit' +import Wei, { wei } from '@synthetixio/wei' +import { FuturesPositionTablePosition } from 'types/futures' + +import { DEFAULT_DELAYED_CANCEL_BUFFER } from 'constants/defaults' +import { selectSusdBalance } from 'state/balances/selectors' +import { EST_KEEPER_GAS_FEE } from 'state/constants' +import { + selectOffchainPricesInfo, + selectOnChainPricesInfo, + selectPrices, +} from 'state/prices/selectors' +import { RootState } from 'state/store' +import { FetchStatus } from 'state/types' +import { selectNetwork, selectWallet } from 'state/wallet/selectors' +import { computeDelayedOrderFee, sameSide } from 'utils/costCalculations' +import { getKnownError } from 'utils/formatters/error' +import { + unserializeCmBalanceInfo, + unserializeFuturesVolumes, + unserializeTradeInputs, + unserializeV2Markets, + unserializeDelayedOrders, + updatePositionUpnl, + unserializePositionHistory, + unserializeTrades, + unserializeConditionalOrders, +} from 'utils/futures' + +import { selectMarketIndexPrice, selectMarketPriceInfo } from '../common/selectors' +import { AsyncOrderWithDetails } from '../crossMargin/types' + +import { MarkPrices, MarkPriceInfos } from './types' + +export const selectV2MarketKey = createSelector( + (state: RootState) => state.smartMargin.selectedMarketAsset, + (marketAsset) => MarketKeyByAsset[marketAsset] +) + +export const selectSmartMarginAccount = createSelector( + selectWallet, + selectNetwork, + (state: RootState) => state.smartMargin, + (wallet, network, smartMargin) => { + return wallet ? smartMargin.accounts[network]?.[wallet]?.account : undefined + } +) + +export const selectSmartMarginQueryStatuses = (state: RootState) => state.smartMargin.queryStatuses + +export const selectMarketsQueryStatus = (state: RootState) => + state.smartMargin.queryStatuses.markets + +export const selectSmartMarginAccountQueryStatus = (state: RootState) => + state.smartMargin.queryStatuses.account + +export const selectLeverageInput = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => smartMargin.leverageInput +) + +export const selectSmartMarginMarginDelta = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => wei(smartMargin.marginDelta || 0) +) + +export const selectMarginDeltaInputValue = (state: RootState) => state.smartMargin.marginDelta + +export const selectSmartMarginSupportedNetwork = (state: RootState) => + state.wallet.networkId === 10 || state.wallet.networkId === 420 + +export const selectShowSmartMarginOnboard = (state: RootState) => + state.app.showModal === 'futures_smart_margin_onboard' + +export const selectEditPositionModalMarket = (state: RootState) => + state.app.showPositionModal?.marketKey + +export const selectSmartMarginAccountData = createSelector( + selectWallet, + selectNetwork, + selectSmartMarginSupportedNetwork, + (state: RootState) => state.smartMargin, + (wallet, network, supportedNetwork, smartMargin) => { + return wallet && supportedNetwork ? smartMargin.accounts[network][wallet] : null + } +) + +export const selectCMBalance = createSelector(selectSmartMarginAccountData, (account) => + wei(account?.balanceInfo.freeMargin || 0) +) + +export const selectV2MarketAsset = (state: RootState) => state.smartMargin.selectedMarketAsset + +export const selectV2Markets = createSelector( + selectNetwork, + (state: RootState) => state.smartMargin, + (network, smartMargin) => { + return smartMargin.markets[network] ? unserializeV2Markets(smartMargin.markets[network]) : [] + } +) + +export const selectOptimismMarkets = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => unserializeV2Markets(smartMargin.markets[10] ?? []) +) + +export const selectOptimismMarkPrices = createSelector( + selectOptimismMarkets, + selectPrices, + (optimismMarkets, prices) => { + const markPrices: MarkPrices = {} + return optimismMarkets.reduce((acc, market) => { + const price = prices[market.asset]?.offChain ?? wei(0) + return { + ...acc, + [market.marketKey]: wei(price).mul( + wei(market.marketSkew).div(market.settings.skewScale).add(1) + ), + } + }, markPrices) + } +) + +export const selectPerpsV2MarketVolumes = createSelector( + (state: RootState) => state.smartMargin.dailyMarketVolumes, + (dailyMarketVolumes) => unserializeFuturesVolumes(dailyMarketVolumes) +) + +export const selectV2MarketInfo = createSelector( + selectV2Markets, + selectV2MarketKey, + (markets, selectedMarket) => { + return markets.find((market) => market.marketKey === selectedMarket) + } +) + +export const selectOrderType = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => smartMargin.orderType +) + +export const selectSmartMarginOrderType = (state: RootState) => state.smartMargin.orderType + +export const selectCloseSMPositionOrderInputs = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => { + return smartMargin.closePositionOrderInputs + } +) + +export const selectV2SkewAdjustedPrice = createSelector( + selectMarketIndexPrice, + selectV2MarketInfo, + (price, marketInfo) => { + if (!marketInfo?.marketSkew || !marketInfo?.settings.skewScale) return price + return price + ? wei(price).mul(wei(marketInfo.marketSkew).div(marketInfo.settings.skewScale).add(1)) + : ZERO_WEI + } +) + +export const selectV2SkewAdjustedPriceInfo = createSelector( + selectMarketPriceInfo, + selectV2MarketInfo, + (priceInfo, marketInfo) => { + if (!marketInfo?.marketSkew || !marketInfo?.settings.skewScale) return priceInfo + return priceInfo + ? { + price: wei(priceInfo.price).mul( + wei(marketInfo.marketSkew).div(marketInfo.settings.skewScale).add(1) + ), + change: priceInfo?.change, + } + : undefined + } +) + +export const selectMarketPrices = createSelector( + selectV2MarketAsset, + selectPrices, + (marketAsset, prices) => { + return prices[marketAsset] ?? {} + } +) + +export const selectMarkPricesV2 = createSelector( + selectV2Markets, + selectPrices, + (markets, prices) => { + const markPrices: MarkPrices = {} + return markets.reduce((acc, market) => { + const price = prices[market.asset]?.offChain ?? wei(0) + return { + ...acc, + [market.marketKey]: wei(price).mul( + wei(market.marketSkew).div(market.settings.skewScale).add(1) + ), + } + }, markPrices) + } +) + +export const selectMarkPriceInfosV2 = createSelector( + selectV2Markets, + selectOffchainPricesInfo, + (markets, prices) => { + const markPrices: MarkPriceInfos = {} + return markets.reduce((acc, market) => { + const price = prices[market.asset]?.price ?? wei(0) + return { + ...acc, + [market.marketKey]: { + price: wei(price).mul(wei(market.marketSkew).div(market.settings.skewScale).add(1)), + change: prices[market.asset]?.change ?? null, + }, + } + }, markPrices) + } +) + +export const selectAllConditionalOrders = createSelector( + selectSmartMarginAccountData, + selectOnChainPricesInfo, + (account, prices) => { + if (!account) return [] + + const orders = unserializeConditionalOrders(account.conditionalOrders) + return orders.map((o) => { + const price = prices[MarketAssetByKey[o.marketKey]] + return { + ...o, + currentPrice: price, + } + }) + } +) + +type OrdersReducerType = { increase: number; reduce: number; sltp: boolean } + +export const selectRequiredEthForPendingOrders = createSelector( + selectAllConditionalOrders, + (orders) => { + const filtered = orders.reduce((acc, o) => { + const market = acc[o.marketKey] ?? { sltp: false, increase: 0, reduce: 0 } + if (o.isSlTp) { + market.sltp = true + } else if (o.orderType === ConditionalOrderTypeEnum.STOP) { + market.reduce += 1 + } else { + market.increase += 1 + } + acc[o.marketKey] = market + return acc + }, {} as Partial>) + + return Object.values(filtered).reduce((acc, m) => { + acc = + acc + + m.increase * EST_KEEPER_GAS_FEE + + m.reduce * EST_KEEPER_GAS_FEE + + (m.sltp ? EST_KEEPER_GAS_FEE : 0) + return acc + }, 0) + } +) + +export const selectSmartMarginPositionHistory = createSelector( + selectSmartMarginAccountData, + (accountData) => { + return unserializePositionHistory(accountData?.positionHistory ?? []) + } +) + +export const selectSelectedMarketPositionHistory = createSelector( + selectV2MarketAsset, + selectSmartMarginPositionHistory, + (marketAsset, positionHistory) => { + return positionHistory.find(({ asset, isOpen }) => isOpen && asset === marketAsset) + } +) + +export const selectSmartMarginPositions = createSelector( + selectSmartMarginAccountData, + selectAllConditionalOrders, + selectMarkPricesV2, + selectV2Markets, + selectSmartMarginPositionHistory, + (account, orders, prices, markets, positionHistory) => { + return ( + account?.positions?.reduce((acc, p) => { + const pos = updatePositionUpnl(p, prices, positionHistory) + const market = markets.find((m) => m.marketKey === pos.marketKey) + const history = positionHistory.find((ph) => { + return ph.isOpen && ph.asset === pos.asset + }) + if (market && pos.position) { + const stopLoss = orders.find((o) => { + return ( + o.marketKey === market.marketKey && + o.size.abs().eq(SL_TP_MAX_SIZE) && + o.reduceOnly && + o.orderType === ConditionalOrderTypeEnum.STOP + ) + }) + const takeProfit = orders.find( + (o) => + o.marketKey === market.marketKey && + o.size.abs().eq(SL_TP_MAX_SIZE) && + o.reduceOnly && + o.orderType === ConditionalOrderTypeEnum.LIMIT + ) + + const position: FuturesPositionTablePosition = { + ...pos.position, + remainingMargin: pos.remainingMargin, + stopLoss: stopLoss, + takeProfit: takeProfit, + avgEntryPrice: history?.avgEntryPrice ?? ZERO_WEI, + market, + } + acc.push(position) + } + return acc + }, []) ?? [] + ) + } +) + +export const selectActiveSmartMarginPositionsCount = createSelector( + selectSmartMarginPositions, + (positions) => { + return positions.length + } +) + +export const selectActiveSmartPositionsCount = createSelector( + selectSmartMarginPositions, + (positions) => { + return positions.length + } +) + +export const selectTotalUnrealizedPnl = createSelector(selectSmartMarginPositions, (positions) => { + return positions.reduce((acc, p) => { + return acc.add(p.pnl ?? ZERO_WEI) + }, ZERO_WEI) +}) + +export const selectSubmittingFuturesTx = createSelector( + (state: RootState) => state.app, + (app) => { + return ( + app.transaction?.status === TransactionStatus.AwaitingExecution || + app.transaction?.status === TransactionStatus.Executed + ) + } +) + +export const selectIsClosingPosition = createSelector( + selectSubmittingFuturesTx, + (state: RootState) => state.app, + (submitting, app) => { + return ( + (app.transaction?.type === 'close_isolated' || + app.transaction?.type === 'close_cross_margin') && + submitting + ) + } +) + +export const selectIsSubmittingSmartMarginTransfer = createSelector( + selectSubmittingFuturesTx, + (state: RootState) => state.app, + (submitting, app) => { + return ( + (app.transaction?.type === 'deposit_smart_margin' || + app.transaction?.type === 'withdraw_smart_margin') && + submitting + ) + } +) + +export const selectIsApprovingSmartMarginDeposit = createSelector( + selectSubmittingFuturesTx, + (state: RootState) => state.app, + (submitting, app) => { + return app.transaction?.type === 'approve_cross_margin' && submitting + } +) + +export const selectIsSubmittingIsolatedTransfer = createSelector( + selectSubmittingFuturesTx, + (state: RootState) => state.app, + (submitting, app) => { + return ( + (app.transaction?.type === 'deposit_isolated' || + app.transaction?.type === 'withdraw_isolated') && + submitting + ) + } +) + +export const selectIsolatedTransferError = createSelector( + (state: RootState) => state.app, + (app) => { + return (app.transaction?.type === 'deposit_isolated' || + app.transaction?.type === 'withdraw_isolated') && + app.transaction?.status === TransactionStatus.Failed + ? app.transaction?.error ?? 'Transaction failed' + : null + } +) + +export const selectIsCancellingOrder = createSelector( + selectSubmittingFuturesTx, + (state: RootState) => state.app, + (submitting, app) => { + return app.transaction?.type === 'cancel_delayed_isolated' && submitting + } +) + +export const selectIsExecutingOrder = createSelector( + selectSubmittingFuturesTx, + (state: RootState) => state.app, + (submitting, app) => { + return app.transaction?.type === 'execute_delayed_isolated' && submitting + } +) + +export const selectIsMarketCapReached = createSelector( + (state: RootState) => state.smartMargin.leverageSide, + selectV2MarketInfo, + selectMarketIndexPrice, + (leverageSide, marketInfo, marketAssetRate) => { + const maxMarketValueUSD = marketInfo?.marketLimitUsd ?? wei(0) + const marketSize = marketInfo?.marketSize ?? wei(0) + const marketSkew = marketInfo?.marketSkew ?? wei(0) + + return leverageSide === PositionSide.LONG + ? marketSize.add(marketSkew).div('2').abs().mul(marketAssetRate).gte(maxMarketValueUSD) + : marketSize.sub(marketSkew).div('2').abs().mul(marketAssetRate).gte(maxMarketValueUSD) + } +) + +export const selectSmartMarginPosition = createSelector( + selectSmartMarginPositions, + selectV2MarketInfo, + (positions, market) => { + const position = positions.find((p) => p.market.marketKey === market?.marketKey) + return position + } +) + +export const selectOrderFeeCap = (state: RootState) => wei(state.smartMargin.orderFeeCap || '0') + +export const selectSmartMarginLeverageSide = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => smartMargin.leverageSide +) + +export const selectSmartMarginMaxLeverage = createSelector(selectV2MarketInfo, (market) => { + let adjustedMaxLeverage = market?.appMaxLeverage ?? wei(1) + return adjustedMaxLeverage +}) + +export const selectAboveMaxLeverage = createSelector( + selectSmartMarginMaxLeverage, + selectSmartMarginPosition, + (maxLeverage, position) => { + return position?.leverage && maxLeverage.lt(position.leverage) + } +) + +export const selectSmartMarginBalanceInfo = createSelector( + selectSmartMarginAccountData, + (account) => { + return account + ? unserializeCmBalanceInfo(account.balanceInfo) + : { + freeMargin: wei(0), + keeperEthBal: wei(0), + allowance: wei(0), + } + } +) + +export const selectSmartMarginDepositApproved = createSelector( + selectSmartMarginAccountData, + (account) => { + if (!account) return false + return wei(account.balanceInfo.allowance || 0).gt(0) + } +) + +export const selectMarginInMarkets = (isSuspended: boolean = false) => + createSelector(selectSmartMarginPositions, (positions) => { + const idleInMarkets = positions + .filter((p) => { + return p.market && p.market.isSuspended === isSuspended + }) + .filter((p) => !p?.size.abs().gt(0) && p.remainingMargin?.gt(0)) + .reduce((acc, p) => acc.add(p.remainingMargin), wei(0)) + return idleInMarkets + }) + +export const selectAvailableMarginInMarkets = selectMarginInMarkets() + +export const selectLockedMarginInMarkets = selectMarginInMarkets(true) + +export const selectIdleMargin = createSelector( + selectAvailableMarginInMarkets, + selectSmartMarginBalanceInfo, + selectSusdBalance, + (idleInMarkets, { freeMargin }, balance) => { + return balance.add(idleInMarkets).add(freeMargin) + } +) + +export const selectSmartMarginAllowanceValid = createSelector( + selectSmartMarginAccountData, + selectSmartMarginBalanceInfo, + selectAvailableMarginInMarkets, + selectSmartMarginMarginDelta, + (account, { freeMargin }, idleInMarkets, marginDelta) => { + const totalIdleMargin = freeMargin.add(idleInMarkets) + if (!account) return false + const marginDeposit = marginDelta.sub(totalIdleMargin) + return ( + totalIdleMargin.gte(marginDelta) || wei(account.balanceInfo.allowance || 0).gte(marginDeposit) + ) + } +) + +export const selectWithdrawableSmartMargin = createSelector( + selectAvailableMarginInMarkets, + selectSmartMarginBalanceInfo, + (idleInMarkets, { freeMargin }) => { + return idleInMarkets.add(freeMargin) + } +) + +export const selectSmartMarginTradeInputs = createSelector( + selectSmartMarginLeverageSide, + (state: RootState) => state.smartMargin.tradeInputs, + (side, tradeInputs) => { + const inputs = unserializeTradeInputs(tradeInputs) + const deltas = { + susdSizeDelta: side === PositionSide.LONG ? inputs.susdSize : inputs.susdSize.neg(), + nativeSizeDelta: side === PositionSide.LONG ? inputs.nativeSize : inputs.nativeSize.neg(), + } + return { + ...inputs, + ...deltas, + susdSizeString: tradeInputs.susdSize, + nativeSizeString: tradeInputs.nativeSize, + } + } +) + +export const selectSmartMarginEditPosInputs = (state: RootState) => + state.smartMargin.editPositionInputs + +export const selectEditMarginAllowanceValid = createSelector( + selectSmartMarginAccountData, + selectSmartMarginBalanceInfo, + selectAvailableMarginInMarkets, + selectSmartMarginEditPosInputs, + (account, { freeMargin }, idleInMarkets, { marginDelta }) => { + const totalIdleMargin = freeMargin.add(idleInMarkets) + if (!account) return false + if (isNaN(Number(marginDelta))) return false + const marginDelatWei = wei(marginDelta || 0) + const marginDeposit = marginDelatWei.sub(totalIdleMargin) + return ( + totalIdleMargin.gte(marginDelatWei) || + wei(account.balanceInfo.allowance || 0).gte(marginDeposit) + ) + } +) + +export const selectKeeperEthBalance = createSelector(selectSmartMarginAccountData, (account) => + wei(account?.balanceInfo.keeperEthBal || 0) +) + +export const selectWalletEthBalance = createSelector(selectSmartMarginAccountData, (account) => + wei(account?.balanceInfo.walletEthBal || 0) +) + +export const selectSmartMarginKeeperDeposit = createSelector( + (state: RootState) => state.smartMargin.fees, + (fees) => { + return wei(fees.keeperEthDeposit) + } +) + +export const selectKeeperDepositExceedsBal = createSelector( + selectSmartMarginKeeperDeposit, + selectWalletEthBalance, + (keeperEthDeposit, walletEthBalance) => { + return keeperEthDeposit.gt(walletEthBalance) + } +) + +export const selectEditPositionModalInfo = createSelector( + selectEditPositionModalMarket, + selectSmartMarginPositions, + selectV2Markets, + selectPrices, + (modalMarketKey, smartPositions, markets, prices) => { + const position = smartPositions.find((p) => p.market.marketKey === modalMarketKey) + if (!position || position.market.version === 3) + return { position: null, market: null, marketPrice: wei(0) } + const price = prices[position.market.asset] + // Note this assumes the order type is always delayed off chain + return { position, market: position.market, marketPrice: price.offChain || wei(0) } + } +) + +export const selectConditionalOrdersForMarket = createSelector( + selectV2MarketAsset, + selectSmartMarginAccountData, + (asset, account) => { + return account + ? unserializeConditionalOrders(account.conditionalOrders).filter((o) => o.asset === asset) + : [] + } +) + +export const selectStopLossOrder = createSelector( + selectConditionalOrdersForMarket, + selectV2MarketKey, + (selectOpenConditionalOrders, marketKey) => { + return selectOpenConditionalOrders.find( + (o) => + o.marketKey === marketKey && o.orderType === ConditionalOrderTypeEnum.STOP && o.reduceOnly + ) + } +) + +export const selectTakeProfitOrder = createSelector( + selectConditionalOrdersForMarket, + selectV2MarketKey, + (selectOpenConditionalOrders, marketKey) => { + return selectOpenConditionalOrders.find( + (o) => + o.marketKey === marketKey && o.orderType === ConditionalOrderTypeEnum.LIMIT && o.reduceOnly + ) + } +) + +export const selectAllSLTPOrders = createSelector(selectAllConditionalOrders, (orders) => { + return orders.filter((o) => o.reduceOnly && o.size.abs().eq(SL_TP_MAX_SIZE)) +}) + +export const selectSLTPModalExistingPrices = createSelector( + selectAllSLTPOrders, + selectEditPositionModalInfo, + (orders, { market }) => { + const sl = orders.find( + (o) => o.marketKey === market?.marketKey && o.orderType === ConditionalOrderTypeEnum.STOP + ) + const tp = orders.find( + (o) => o.marketKey === market?.marketKey && o.orderType === ConditionalOrderTypeEnum.LIMIT + ) + + return { + takeProfitPrice: tp?.targetPrice ? stripZeros(tp.targetPrice.toString()) : '', + stopLossPrice: sl?.targetPrice ? stripZeros(sl.targetPrice.toString()) : '', + } + } +) + +export const selectSlTpTradeInputs = createSelector( + (state: RootState) => state.smartMargin.tradeInputs, + ({ stopLossPrice, takeProfitPrice }) => ({ + stopLossPrice: stopLossPrice || '', + takeProfitPrice: takeProfitPrice || '', + stopLossPriceWei: stopLossPrice && stopLossPrice !== '' ? wei(stopLossPrice) : undefined, + takeProfitPriceWei: + takeProfitPrice && takeProfitPrice !== '' ? wei(takeProfitPrice) : undefined, + }) +) + +export const selectNewTradeHasSlTp = createSelector( + (state: RootState) => state.smartMargin.tradeInputs, + (tradeInputs) => Number(tradeInputs.stopLossPrice) > 0 || Number(tradeInputs.takeProfitPrice) > 0 +) + +export const selectSlTpModalInputs = createSelector( + (state: RootState) => state.smartMargin.sltpModalInputs, + (inputs) => ({ + stopLossPrice: inputs.stopLossPrice ?? '', + takeProfitPrice: inputs.takeProfitPrice ?? '', + }) +) + +export const selectSmartMarginOrderPrice = (state: RootState) => + state.smartMargin.orderPrice.price ?? '' + +export const selectTradePreview = createSelector( + selectSmartMarginTradeInputs, + selectSmartMarginOrderPrice, + selectOrderType, + (state: RootState) => state.smartMargin, + ({ nativeSizeDelta }, orderPrice, orderType, smartMargin) => { + const preview = smartMargin.previews.trade + const unserialized = preview ? unserializePotentialTrade(preview) : null + if (unserialized) { + const priceImpact = getDefaultPriceImpact(orderType) + const conditionalOrderPrice = wei(orderPrice || 0) + const price = + orderType !== 'market' && conditionalOrderPrice.gt(0) + ? conditionalOrderPrice + : unserialized.price + const desiredFillPrice = calculateDesiredFillPrice(nativeSizeDelta, price, priceImpact) + + return { + ...unserialized, + desiredFillPrice, + leverage: unserialized.margin.gt(0) + ? unserialized.notionalValue.div(unserialized.margin).abs() + : wei(0), + } + } + return null + } +) + +export const selectEditPositionPreview = createSelector( + selectSmartMarginEditPosInputs, + (state: RootState) => state.smartMargin, + ({ nativeSizeDelta }, smartMargin) => { + if (isNaN(Number(nativeSizeDelta))) return null + const preview = smartMargin.previews.edit + const unserialized = preview ? unserializePotentialTrade(preview) : null + if (unserialized) { + const priceImpact = getDefaultPriceImpact('market') + const desiredFillPrice = calculateDesiredFillPrice( + wei(nativeSizeDelta || 0), + unserialized.price, + priceImpact + ) + + return { + ...unserialized, + desiredFillPrice, + leverage: unserialized.margin.gt(0) + ? unserialized.notionalValue.div(unserialized.margin).abs() + : wei(0), + } + } + return null + } +) + +export const selectClosePositionPreview = createSelector( + selectEditPositionModalInfo, + selectCloseSMPositionOrderInputs, + (state: RootState) => state.smartMargin, + ({ position }, { price, orderType }, smartMargin) => { + const preview = smartMargin.previews.close + const unserialized = preview ? unserializePotentialTrade(preview) : null + if (unserialized) { + const priceImpact = getDefaultPriceImpact(orderType) + let orderPrice = + (orderType === 'market' ? unserialized.price : wei(price?.value || 0)) ?? wei(0) + const desiredFillPrice = calculateDesiredFillPrice( + position?.side === PositionSide.LONG ? wei(-1) : wei(1), + orderPrice, + priceImpact + ) + + return { + ...unserialized, + desiredFillPrice, + leverage: unserialized.margin.gt(0) + ? unserialized.notionalValue.div(unserialized.margin).abs() + : wei(0), + } + } + return null + } +) + +export const selectSmartMarginLeverage = createSelector( + selectSmartMarginPosition, + selectSmartMarginTradeInputs, + (position, { susdSize }) => { + const remainingMargin = position?.remainingMargin + if (!remainingMargin || remainingMargin.eq(0) || !susdSize) return wei(0) + return susdSize.div(remainingMargin) + } +) + +export const selectSmartMarginTransfers = createSelector( + selectSmartMarginAccountData, + (account) => { + return account?.marginTransfers ?? [] + } +) + +export const selectIdleMarginTransfers = createSelector( + selectWallet, + selectNetwork, + (state: RootState) => state.smartMargin, + (wallet, network, smartMargin) => { + if (!wallet) return [] + const account = smartMargin.accounts[network]?.[wallet] + return account?.idleTransfers ?? [] + } +) + +export const selectTradePreviewError = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => { + return smartMargin.queryStatuses.tradePreview.error + } +) + +export const selectIsFetchingTradePreview = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => { + return smartMargin.queryStatuses.tradePreview.status === FetchStatus.Loading + } +) + +export const selectModifyPositionError = createSelector( + (state: RootState) => state.app, + (app) => { + return app.transaction?.type === 'modify_isolated' && app.transaction?.error + ? getKnownError(app.transaction.error) + : null + } +) + +export const selectTradePreviewStatus = createSelector( + (state: RootState) => state.smartMargin, + (smartMargin) => { + return smartMargin.queryStatuses.tradePreview + } +) + +export const selectSmartMarginDelayedOrders = createSelector( + selectSmartMarginAccountData, + selectV2Markets, + (account, markets) => { + if (!account) return [] + const orders = unserializeDelayedOrders(account?.delayedOrders ?? []) + + return orders.reduce((acc, o) => { + const market = markets.find((m) => m.marketKey === o.marketKey) + + if (market) { + const timePastExecution = Math.floor(Date.now() - o.executableAtTimestamp) + const expirationTime = o.executableAtTimestamp + market.settings.offchainDelayedOrderMaxAge + const executable = timePastExecution <= market.settings.offchainDelayedOrderMaxAge + + const order = { + market, + account: Number(account.account), + size: o.size, + executableStartTime: o.executableAtTimestamp / 1000, + expirationTime: expirationTime, + marginDelta: wei(0), + desiredFillPrice: wei(o.desiredFillPrice), + side: o.side, + settlementWindowDuration: market.settings.offchainDelayedOrderMaxAge, + settlementFee: o.keeperDeposit, + isExecutable: executable, + isStale: + timePastExecution > + DEFAULT_DELAYED_CANCEL_BUFFER + (market?.settings.offchainDelayedOrderMaxAge ?? 0), + } + acc.push(order) + } + return acc + }, []) + } +) + +export const selectPendingDelayedOrder = createSelector( + selectSmartMarginDelayedOrders, + selectV2MarketKey, + (delayedOrders, marketKey) => { + return delayedOrders.find((o) => o.market.marketKey === marketKey) + } +) + +export const selectIsConditionalOrder = createSelector( + (state: RootState) => state.smartMargin.orderType, + (type) => type === 'limit' || type === 'stop_market' +) + +export const selectDelayedOrderFee = createSelector( + selectV2MarketInfo, + selectSmartMarginTradeInputs, + selectV2SkewAdjustedPrice, + (market, { nativeSizeDelta }, price) => { + if ( + !market?.marketSkew || + !market?.feeRates.takerFeeOffchainDelayedOrder || + !market?.feeRates.makerFeeOffchainDelayedOrder || + !nativeSizeDelta + ) { + return { commitDeposit: undefined, delayedOrderFee: undefined } + } + + const notionalDiff = nativeSizeDelta.mul(price) + + const makerFee = market.feeRates.makerFeeOffchainDelayedOrder + const takerFee = market.feeRates.takerFeeOffchainDelayedOrder + + const staticRate = sameSide(notionalDiff, market.marketSkew) ? takerFee : makerFee + + return { + commitDeposit: notionalDiff.mul(staticRate).abs(), + delayedOrderFee: notionalDiff.mul(staticRate).abs(), + } + } +) + +export const selectOpenInterest = createSelector(selectV2Markets, (futuresMarkets) => + futuresMarkets.reduce( + (total, { openInterest }) => total.add(openInterest.shortUSD).add(openInterest.longUSD), + wei(0) + ) +) + +export const selectUsersTradesForMarket = createSelector( + selectV2MarketAsset, + selectSmartMarginAccountData, + (asset, smartAccountData) => { + const trades = unserializeTrades(smartAccountData?.trades ?? []) + return trades?.filter((t) => t.asset === asset) ?? [] + } +) + +export const selectAllSmartMarginTrades = createSelector( + selectSmartMarginAccountData, + selectV2Markets, + (smartMarginAccountData, markets) => { + const trades = unserializeTrades(smartMarginAccountData?.trades ?? []) + return trades.map((t) => { + const market = markets.find((m) => m.asset === t.asset) + return { + ...t, + market: market, + } + }) + } +) + +export const selectSelectedPortfolioTimeframe = (state: RootState) => + state.futures.dashboard.selectedPortfolioTimeframe + +export const selectCancellingConditionalOrder = (state: RootState) => + state.smartMargin.cancellingOrder + +export const selectOrderFee = createSelector( + selectV2MarketInfo, + selectSmartMarginTradeInputs, + (marketInfo, { susdSizeDelta }) => { + return computeDelayedOrderFee(marketInfo, susdSizeDelta) + } +) + +export const selectMaxUsdSizeInput = createSelector( + selectSmartMarginMaxLeverage, + selectMarginDeltaInputValue, + (maxLeverage, marginDelta) => { + return maxLeverage.mul(marginDelta || 0) + } +) + +export const selectAvailableOi = createSelector(selectV2MarketInfo, (marketInfo) => { + const availableOiUsdShort = + marketInfo?.marketLimitUsd.sub(marketInfo.openInterest.shortUSD) ?? wei(0) + + const availableOiUsdLong = + marketInfo?.marketLimitUsd.sub(marketInfo.openInterest.longUSD) ?? wei(0) + + const availableOiNativeShort = + marketInfo?.marketLimitNative.sub(marketInfo.openInterest.short) ?? wei(0) + + const availableOiNativeLong = + marketInfo?.marketLimitNative.sub(marketInfo.openInterest.long) ?? wei(0) + + return { + short: { + usd: availableOiUsdShort, + native: availableOiNativeShort, + }, + long: { + usd: availableOiUsdLong, + native: availableOiNativeLong, + }, + } +}) + +export const selectPreviewAvailableMargin = createSelector( + selectV2MarketInfo, + selectTradePreview, + selectDelayedOrderFee, + (marketInfo, tradePreview, delayedOrderFee) => { + if (!marketInfo || !tradePreview) return ZERO_WEI + + let inaccessible = tradePreview.notionalValue.div(marketInfo.appMaxLeverage).abs() ?? ZERO_WEI + const totalDeposit = !!delayedOrderFee.commitDeposit + ? delayedOrderFee.commitDeposit.add(marketInfo.keeperDeposit) + : ZERO_WEI + + // If the user has a position open, we'll enforce a min initial margin requirement. + if (inaccessible.gt(0) && inaccessible.lt(marketInfo.minInitialMargin)) { + inaccessible = marketInfo.minInitialMargin + } + + // check if available margin will be less than 0 + return tradePreview.margin.sub(inaccessible).sub(totalDeposit).gt(0) + ? tradePreview.margin.sub(inaccessible).sub(totalDeposit).abs() + : ZERO_WEI + } +) + +export const selectAverageEntryPrice = createSelector( + selectTradePreview, + selectSelectedMarketPositionHistory, + (tradePreview, positionHistory) => { + if (positionHistory && tradePreview) { + const { avgEntryPrice, side, size } = positionHistory + const currentSize = side === PositionSide.SHORT ? size.neg() : size + + // If the trade switched sides (long -> short or short -> long), use oracle price + if (currentSize.mul(tradePreview.size).lt(0)) return tradePreview.price + + // If the trade reduced position size on the same side, average entry remains the same + if (tradePreview.size.abs().lt(size)) return avgEntryPrice + + // If the trade increased position size on the same side, calculate new average + const existingValue = avgEntryPrice.mul(size) + const newValue = tradePreview.price.mul(tradePreview.sizeDelta.abs()) + const totalValue = existingValue.add(newValue) + return tradePreview.size.abs().gt(0) ? totalValue.div(tradePreview.size.abs()) : wei(0) + } + return null + } +) + +type PositionPreviewData = { + fillPrice: Wei + sizeIsNotZero: boolean + positionSide: string + positionSize: Wei + leverage: Wei + liquidationPrice: Wei + avgEntryPrice: Wei + notionalValue: Wei + showStatus: boolean +} + +export const selectPositionPreviewData = createSelector( + selectTradePreview, + selectSmartMarginPosition, + selectAverageEntryPrice, + (tradePreview, position, modifiedAverage) => { + if (!position || tradePreview === null) { + return null + } + + return { + fillPrice: tradePreview.price, + sizeIsNotZero: tradePreview.size && !tradePreview.size?.eq(0), + positionSide: tradePreview.size?.gt(0) ? PositionSide.LONG : PositionSide.SHORT, + positionSize: tradePreview.size?.abs(), + notionalValue: tradePreview.notionalValue, + leverage: tradePreview.margin.gt(0) + ? tradePreview.notionalValue.div(tradePreview.margin).abs() + : ZERO_WEI, + liquidationPrice: tradePreview.liqPrice, + avgEntryPrice: modifiedAverage || ZERO_WEI, + showStatus: tradePreview.showStatus, + } as PositionPreviewData + } +) + +export const selectPreviewMarginChange = createSelector( + selectTradePreview, + selectPreviewAvailableMargin, + selectV2MarketInfo, + (tradePreview, previewAvailableMargin, marketInfo) => { + const potentialMarginUsage = tradePreview?.margin.gt(0) + ? tradePreview!.margin.sub(previewAvailableMargin).div(tradePreview!.margin).abs() ?? ZERO_WEI + : ZERO_WEI + + const maxPositionSize = + !!tradePreview && !!marketInfo + ? tradePreview.margin + .mul(marketInfo.appMaxLeverage) + .mul(tradePreview.side === PositionSide.LONG ? 1 : -1) + : null + + const potentialBuyingPower = !!maxPositionSize + ? maxPositionSize.sub(tradePreview?.notionalValue).abs() + : ZERO_WEI + + return { + showPreview: !!tradePreview && tradePreview.sizeDelta.abs().gt(0), + totalMargin: tradePreview?.margin || ZERO_WEI, + availableMargin: previewAvailableMargin.gt(0) ? previewAvailableMargin : ZERO_WEI, + buyingPower: potentialBuyingPower.gt(0) ? potentialBuyingPower : ZERO_WEI, + marginUsage: potentialMarginUsage.gt(1) ? wei(1) : potentialMarginUsage, + } + } +) + +export const selectSmartMarginPreviewCount = (state: RootState) => + state.smartMargin.previewDebounceCount + +export const selectBuyingPower = createSelector( + selectSmartMarginPositions, + selectSmartMarginMaxLeverage, + (positions, maxLeverage) => { + const totalMargin = positions.reduce((acc, p) => { + acc.add(p.remainingMargin ?? ZERO_WEI) + return acc + }, wei(0)) + return totalMargin.gt(ZERO_WEI) ? totalMargin.mul(maxLeverage ?? ZERO_WEI) : ZERO_WEI + } +) + +export const selectMarketSuspended = createSelector( + selectV2MarketInfo, + (marketInfo) => marketInfo?.isSuspended +) + +export const selectFuturesFees = (state: RootState) => state.smartMargin.futuresFees + +export const selectFuturesFeesForAccount = (state: RootState) => + state.smartMargin.futuresFeesForAccount + +export const selectPlaceOrderTranslationKey = createSelector( + selectSmartMarginPosition, + selectSmartMarginMarginDelta, + selectSmartMarginBalanceInfo, + (state: RootState) => state.smartMargin.orderType, + selectIsMarketCapReached, + (position, marginDelta, { freeMargin }, orderType) => { + let remainingMargin = marginDelta + if (remainingMargin.add(freeMargin).lt('50')) { + return 'futures.market.trade.button.deposit-margin-minimum' + } + if (orderType === 'limit') return 'futures.market.trade.button.place-limit-order' + if (orderType === 'stop_market') return 'futures.market.trade.button.place-stop-order' + if (!!position) return 'futures.market.trade.button.modify-position' + return 'futures.market.trade.button.open-position' + } +) diff --git a/packages/app/src/state/futures/smartMargin/types.ts b/packages/app/src/state/futures/smartMargin/types.ts new file mode 100644 index 0000000000..fbd4d0da75 --- /dev/null +++ b/packages/app/src/state/futures/smartMargin/types.ts @@ -0,0 +1,155 @@ +import { + TransactionStatus, + SmartMarginOrderType, + FuturesPositionHistory, + FuturesPotentialTradeDetails, + PositionSide, + ConditionalOrder as SmartMarginOrder, + FuturesMarketKey, + FuturesMarketAsset, + MarginTransfer, + FuturesVolumes, + PerpsMarketV2, + PerpsV2Position, +} from '@kwenta/sdk/types' +import Wei from '@synthetixio/wei' + +import { PricesInfo } from 'state/prices/types' + +import { + DelayedOrderWithDetails, + FuturesAccountData, + FuturesTransactionType, + HistoricalFundingRates, + SmartMarginQueryStatuses, + TradeSizeInputs, +} from '../common/types' + +export type SLTPInputs = { + stopLossPrice?: T + takeProfitPrice?: T +} + +export type SmartMarginTradeInputs = TradeSizeInputs & { + stopLossPrice?: T + takeProfitPrice?: T +} + +export type EditPositionInputs = { + nativeSizeDelta: T + marginDelta: T +} + +export type ClosePositionInputs = { + nativeSizeDelta: T + price?: { + value?: string | undefined | null + invalidLabel: string | undefined | null + } + orderType: SmartMarginOrderType +} + +export type MarkPrices = Partial> + +export type MarkPriceInfos = Partial>> + +export type FundingRate = { + asset: FuturesMarketKey + fundingTitle: string + fundingRate: T | null +} + +export type SmartPerpsPortfolio = { + account: string + timestamp: number + assets: { + [asset: string]: number + } + idle: number + total: number +} + +export type PortfolioValues = { + timestamp: number + total: number +} + +export type FuturesTransaction = { + type: FuturesTransactionType + status: TransactionStatus + error?: string + hash: string | null +} + +export type SmartMarginBalanceInfo = { + freeMargin: T + keeperEthBal: T + allowance: T + walletEthBal: T +} + +export type SmartMarginTradeFees = { + delayedOrderFee: T + keeperEthDeposit: T +} + +type FuturesNetwork = number + +export type InputCurrencyDenomination = 'usd' | 'native' + +export type FundingRatePeriods = { + [key: number]: string +} + +export type SmartMarginAccountData = FuturesAccountData & { + account: string + idleTransfers: MarginTransfer[] + balanceInfo: SmartMarginBalanceInfo + conditionalOrders: SmartMarginOrder[] + delayedOrders: DelayedOrderWithDetails[] + position?: PerpsV2Position + positions?: PerpsV2Position[] + positionHistory?: FuturesPositionHistory[] +} + +export type SmartMarginState = { + markets: Record[]> + selectedMarketAsset: FuturesMarketAsset + dailyMarketVolumes: FuturesVolumes + fundingRates: FundingRate[] + historicalFundingRates: HistoricalFundingRates + queryStatuses: SmartMarginQueryStatuses + tradeInputs: SmartMarginTradeInputs + editPositionInputs: EditPositionInputs + closePositionOrderInputs: ClosePositionInputs + sltpModalInputs: SLTPInputs + marginDelta: string + orderType: SmartMarginOrderType + orderFeeCap: string + leverageInput: string + selectedLeverageByAsset: Partial> + leverageSide: PositionSide + showSmartMarginOnboard: boolean + previews: { + trade: FuturesPotentialTradeDetails | null + close: FuturesPotentialTradeDetails | null + edit: FuturesPotentialTradeDetails | null + } + previewDebounceCount: number + fees: SmartMarginTradeFees + depositApproved: boolean + cancellingOrder: number | undefined + accounts: Record< + FuturesNetwork, + { + [wallet: string]: SmartMarginAccountData + } + > + + orderPrice: { + price?: string | undefined | null + invalidLabel: string | undefined | null + } + futuresFees: string + futuresFeesForAccount: string +} diff --git a/packages/app/src/state/futures/types.ts b/packages/app/src/state/futures/types.ts index 235246a7ab..c6fb3c743f 100644 --- a/packages/app/src/state/futures/types.ts +++ b/packages/app/src/state/futures/types.ts @@ -1,61 +1,16 @@ import { Period } from '@kwenta/sdk/constants' import { - NetworkId, TransactionStatus, - SmartMarginOrderType, - FuturesMarket, - FuturesOrderTypeDisplay, - FuturesPosition, FuturesPositionHistory, - FuturesPotentialTradeDetails, - FuturesTrade, - FuturesVolumes, - PositionSide, - ConditionalOrder as CrossMarginOrder, FuturesMarketKey, FuturesMarketAsset, - MarginTransfer, - FuturesAccountType, - FuturesFilledPosition, } from '@kwenta/sdk/types' import Wei from '@synthetixio/wei' import { PricesInfo } from 'state/prices/types' import { QueryStatus } from 'state/types' -export type TradeSizeInputs = { - nativeSize: T - susdSize: T -} - -export type SLTPInputs = { - stopLossPrice?: T - takeProfitPrice?: T -} - -export type CrossMarginTradeInputs = TradeSizeInputs & { - stopLossPrice?: T - takeProfitPrice?: T -} - -export type EditPositionInputs = { - nativeSizeDelta: T - marginDelta: T -} - -export type ClosePositionInputsCrossMargin = { - nativeSizeDelta: T - price?: { - value?: string | undefined | null - invalidLabel: string | undefined | null - } - orderType: SmartMarginOrderType -} - -export type ClosePositionInputsIsolatedMargin = { - nativeSizeDelta: T - orderType: 'market' -} +import { AppFuturesMarginType, FuturesTransactionType } from './common/types' export type MarkPrices = Partial> @@ -76,68 +31,11 @@ export type FuturesAction = { action: 'trade' | 'deposit' | 'withdraw' } -export type IsolatedPerpsPortfolio = { - account: string - timestamp: number - assets: { - [asset: string]: number - } - total: number -} - -export type SmartPerpsPortfolio = { - account: string - timestamp: number - assets: { - [asset: string]: number - } - idle: number - total: number -} - export type PortfolioValues = { timestamp: number total: number } -export type FuturesQueryStatuses = { - markets: QueryStatus - crossMarginBalanceInfo: QueryStatus - dailyVolumes: QueryStatus - crossMarginPositions: QueryStatus - crossMarginPositionHistory: QueryStatus - isolatedPositions: QueryStatus - isolatedPositionHistory: QueryStatus - openOrders: QueryStatus - isolatedTradePreview: QueryStatus - crossMarginTradePreview: QueryStatus - crossMarginAccount: QueryStatus - positionHistory: QueryStatus - trades: QueryStatus - selectedTraderPositionHistory: QueryStatus - marginTransfers: QueryStatus - historicalFundingRates: QueryStatus - futuresFees: QueryStatus - futuresFeesForAccount: QueryStatus -} - -export type FuturesTransactionType = - | 'deposit_cross_margin' - | 'withdraw_cross_margin' - | 'approve_cross_margin' - | 'deposit_isolated' - | 'withdraw_isolated' - | 'modify_isolated' - | 'close_isolated' - | 'close_cross_margin' - | 'cancel_delayed_isolated' - | 'execute_delayed_isolated' - | 'close_cross_margin' - | 'submit_cross_order' - | 'cancel_cross_margin_order' - | 'withdraw_keeper_balance' - | 'create_cross_margin_account' - export type FuturesTransaction = { type: FuturesTransactionType status: TransactionStatus @@ -145,37 +43,6 @@ export type FuturesTransaction = { hash: string | null } -export type TransactionEstimation = { - error?: string | null - limit: T - cost: T -} - -export type TransactionEstimations = Record> - -export type TransactionEstimationPayload = { - type: FuturesTransactionType - limit: string - cost: string - error?: string | null -} - -export type CrossMarginBalanceInfo = { - freeMargin: T - keeperEthBal: T - allowance: T - walletEthBal: T -} - -export type CrossMarginTradeFees = { - delayedOrderFee: T - keeperEthDeposit: T -} - -type FuturesErrors = { - tradePreview?: string | undefined | null -} - type FuturesNetwork = number export type InputCurrencyDenomination = 'usd' | 'native' @@ -184,52 +51,13 @@ export type FundingRatePeriods = { [key: number]: string } -export type AccountContext = { - type: FuturesAccountType - network: NetworkId - wallet: string - cmAccount?: string -} - -export type PreviewAction = 'edit' | 'trade' | 'close' - -export type FuturesAccountData = { - position?: FuturesPosition - positions?: FuturesPosition[] - positionHistory?: FuturesPositionHistory[] - trades?: FuturesTrade[] - marginTransfers?: MarginTransfer[] -} - -export type IsolatedAccountData = FuturesAccountData & { - delayedOrders: DelayedOrderWithDetails[] -} - -export type CrossMarginAccountData = FuturesAccountData & { - account: string - idleTransfers: MarginTransfer[] - balanceInfo: CrossMarginBalanceInfo - delayedOrders: DelayedOrderWithDetails[] - conditionalOrders: CrossMarginOrder[] -} - -// TODO: Separate in some way by network and wallet -// so we can have persisted state between switching - export type FuturesState = { - selectedType: FuturesAccountType + selectedType: AppFuturesMarginType confirmationModalOpen: boolean - isolatedMargin: IsolatedMarginState - fundingRates: FundingRate[] - crossMargin: CrossMarginState - markets: Record[]> - queryStatuses: FuturesQueryStatuses - dailyMarketVolumes: FuturesVolumes - transactionEstimations: TransactionEstimations - errors: FuturesErrors selectedInputDenomination: InputCurrencyDenomination selectedInputHours: number selectedChart: 'price' | 'funding' + historicalFundingRatePeriod: Period preferences: { showHistory?: boolean } @@ -246,136 +74,19 @@ export type FuturesState = { > } tradePanelDrawerOpen: boolean - historicalFundingRatePeriod: Period - historicalFundingRates: Partial< - Record - > - futuresFees: string - futuresFeesForAccount: string -} - -export type TradePreviewResult = { - data: FuturesPotentialTradeDetails | null - error: string | null -} - -export type CrossMarginState = { - tradeInputs: CrossMarginTradeInputs - editPositionInputs: EditPositionInputs - sltpModalInputs: SLTPInputs - marginDelta: string - orderType: SmartMarginOrderType - closePositionOrderInputs: ClosePositionInputsCrossMargin - orderFeeCap: string - leverageInput: string - selectedLeverageByAsset: Partial> - leverageSide: PositionSide - selectedMarketKey: FuturesMarketKey - selectedMarketAsset: FuturesMarketAsset - showCrossMarginOnboard: boolean - previews: { - trade: FuturesPotentialTradeDetails | null - close: FuturesPotentialTradeDetails | null - edit: FuturesPotentialTradeDetails | null - } - previewDebounceCount: number - fees: CrossMarginTradeFees - depositApproved: boolean - cancellingOrder: number | undefined - accounts: Record< - FuturesNetwork, - { - [wallet: string]: CrossMarginAccountData - } - > - - orderPrice: { - price?: string | undefined | null - invalidLabel: string | undefined | null + queryStatuses: { + selectedTraderPositionHistory: QueryStatus } } -export type IsolatedMarginState = { - tradeInputs: TradeSizeInputs - editPositionInputs: EditPositionInputs - orderType: 'market' - previews: { - trade: FuturesPotentialTradeDetails | null - close: FuturesPotentialTradeDetails | null - edit: FuturesPotentialTradeDetails | null - } - closePositionOrderInputs: ClosePositionInputsIsolatedMargin - previewDebounceCount: number - leverageSide: PositionSide - selectedMarketKey: FuturesMarketKey - selectedMarketAsset: FuturesMarketAsset - leverageInput: string - tradeFee: string - accounts: Record< - FuturesNetwork, - { - [wallet: string]: IsolatedAccountData - } - > -} - -export type ModifyIsolatedPositionInputs = { - delayed: boolean - offchain: boolean -} - -export type CancelDelayedOrderInputs = { - marketAddress: string - isOffchain: boolean -} - export type ExecuteDelayedOrderInputs = { marketKey: FuturesMarketKey marketAddress: string - isOffchain: boolean } -export type DelayedOrderWithDetails = { - account: string - marketAddress: string - market: string - asset: FuturesMarketAsset +export type ExecuteAsyncOrderInputs = { marketKey: FuturesMarketKey - size: T - commitDeposit: T - keeperDeposit: T - submittedAtTimestamp: number - executableAtTimestamp: number - isOffchain: boolean - desiredFillPrice: T - targetRoundId: T | null - orderType: FuturesOrderTypeDisplay - side: PositionSide - isStale?: boolean - isExecutable?: boolean - isCancelling?: boolean -} - -export type TradePreviewParams = { - market: { - key: FuturesMarketKey - address: string - } - orderPrice: Wei - sizeDelta: Wei - marginDelta: Wei - action: PreviewAction -} - -export type DebouncedPreviewParams = TradePreviewParams & { - debounceCount: number -} - -export type SharePositionParams = { - asset?: FuturesMarketAsset - position?: FuturesFilledPosition - positionHistory?: FuturesPositionHistory - marketPrice?: Wei + marketId: number } export const futuresPositionKeys = new Set([ @@ -396,20 +107,3 @@ export const futuresPositionKeys = new Set([ 'position.pnlPct', 'position.marginRatio', ]) - -export const futuresPositionHistoryKeys = new Set([ - 'size', - 'feesPaid', - 'netFunding', - 'netTransfers', - 'totalDeposits', - 'initialMargin', - 'margin', - 'entryPrice', - 'avgEntryPrice', - 'exitPrice', - 'leverage', - 'pnl', - 'pnlWithFeesPaid', - 'totalVolume', -]) diff --git a/packages/app/src/state/helpers.ts b/packages/app/src/state/helpers.ts index 7dcb6acd22..187188d95e 100644 --- a/packages/app/src/state/helpers.ts +++ b/packages/app/src/state/helpers.ts @@ -1,4 +1,4 @@ -import { FuturesAccountType } from '@kwenta/sdk/types' +import { FuturesMarginType } from '@kwenta/sdk/types' import Wei, { wei } from '@synthetixio/wei' // Redux recommends that values stored in state are serializable @@ -48,5 +48,5 @@ export const deserializeWeiObject = (object: object, keys: Set, prefix?: }, {} as any) } -export const accountType = (type: FuturesAccountType) => - type === 'cross_margin' || type === 'smart_margin' ? 'crossMargin' : 'isolatedMargin' +export const accountType = (type: FuturesMarginType) => + type === FuturesMarginType.CROSS_MARGIN ? 'crossMargin' : 'smartMargin' diff --git a/packages/app/src/state/home/actions.ts b/packages/app/src/state/home/actions.ts index aaa0171b94..3461a2dbf4 100644 --- a/packages/app/src/state/home/actions.ts +++ b/packages/app/src/state/home/actions.ts @@ -1,21 +1,21 @@ import KwentaSDK from '@kwenta/sdk' -import { FuturesMarket } from '@kwenta/sdk/types' +import { PerpsMarketV2 } from '@kwenta/sdk/types' import { createAsyncThunk } from '@reduxjs/toolkit' import { providers } from 'ethers' import { notifyError } from 'components/ErrorNotifier' import { ThunkConfig } from 'state/types' -import { serializeMarkets } from 'utils/futures' +import { serializeV2Markets } from 'utils/futures' import logError from 'utils/logError' export const fetchOptimismMarkets = createAsyncThunk< - { markets: FuturesMarket[] }, + { markets: PerpsMarketV2[] }, providers.Provider, ThunkConfig >('home/fetchOptimismMarkets', async (mainnetL2Provider, { extra: { sdk } }) => { // For the home page we always fetch OP mainnet markets const markets = await sdk.futures.getMarkets({ provider: mainnetL2Provider, networkId: 10 }) - const serializedMarkets = serializeMarkets(markets) + const serializedMarkets = serializeV2Markets(markets) return { markets: serializedMarkets } }) diff --git a/packages/app/src/state/home/reducer.ts b/packages/app/src/state/home/reducer.ts index 9aeb883545..cf12ea7922 100644 --- a/packages/app/src/state/home/reducer.ts +++ b/packages/app/src/state/home/reducer.ts @@ -1,5 +1,5 @@ import KwentaSDK from '@kwenta/sdk' -import { FuturesMarket } from '@kwenta/sdk/types' +import { PerpsMarketV2 } from '@kwenta/sdk/types' import { createSlice } from '@reduxjs/toolkit' import { FetchStatus } from 'state/types' @@ -7,7 +7,7 @@ import { FetchStatus } from 'state/types' import { fetchFuturesStats, fetchOptimismMarkets } from './actions' type HomeState = { - optimismMarkets: FuturesMarket[] + optimismMarkets: PerpsMarketV2[] marketsQueryStatus: FetchStatus futuresStatsQueryStatus: FetchStatus futuresStats: Awaited> diff --git a/packages/app/src/state/home/selectors.ts b/packages/app/src/state/home/selectors.ts index b217daaa9f..1d6ba090fa 100644 --- a/packages/app/src/state/home/selectors.ts +++ b/packages/app/src/state/home/selectors.ts @@ -1,9 +1,9 @@ import { createSelector } from '@reduxjs/toolkit' import { RootState } from 'state/store' -import { unserializeMarkets } from 'utils/futures' +import { unserializeV2Markets } from 'utils/futures' export const selectOptimismMarkets = createSelector( (state: RootState) => state.home.optimismMarkets, - (optimismMarkets) => unserializeMarkets(optimismMarkets) + (optimismMarkets) => unserializeV2Markets(optimismMarkets) ) diff --git a/packages/app/src/state/hooks.ts b/packages/app/src/state/hooks.ts index 3a5b4e8e71..5484c52ca3 100644 --- a/packages/app/src/state/hooks.ts +++ b/packages/app/src/state/hooks.ts @@ -69,7 +69,11 @@ const DEFAULT_INTERVAL = 20000 export const usePollAction = ( actionName: string, action: () => ActionType, - options?: { dependencies?: any[]; disabled?: boolean; intervalTime?: number } + options?: { + dependencies?: any[] + disabled?: boolean + intervalTime?: number + } ) => { const { providerReady } = Connector.useContainer() const startPolling = useStartPollingAction() diff --git a/packages/app/src/state/migrations.ts b/packages/app/src/state/migrations.ts index 8fe472979e..9507e5e16e 100644 --- a/packages/app/src/state/migrations.ts +++ b/packages/app/src/state/migrations.ts @@ -53,17 +53,13 @@ export const migrations = { return { ...state, app: APP_INITIAL_STATE, - } - }, - 33: (state: any) => { - return { - ...state, futures: FUTURES_INITIAL_STATE, + balances: BALANCES_INITIAL_STATE, staking: STAKING_INITIAL_STATE, stats: STATS_INITIAL_STATE, } }, - 34: (state: any) => { + 35: (state: any) => { return { ...state, futures: FUTURES_INITIAL_STATE, diff --git a/packages/app/src/state/store.ts b/packages/app/src/state/store.ts index 99321033dc..97b5364164 100644 --- a/packages/app/src/state/store.ts +++ b/packages/app/src/state/store.ts @@ -19,7 +19,9 @@ import appReducer from './app/reducer' import balancesReducer from './balances/reducer' import earnReducer from './earn/reducer' import exchangeReducer from './exchange/reducer' +import crossMarginReducer from './futures/crossMargin/reducer' import futuresReducer from './futures/reducer' +import smartMarginReducer from './futures/smartMargin/reducer' import homeReducer from './home/reducer' import migrations from './migrations' import preferencesReducer from './preferences/reducer' @@ -34,7 +36,7 @@ const LOG_REDUX = false const persistConfig = { key: 'root1', storage, - version: 34, + version: 35, blacklist: ['app', 'wallet'], migrate: createMigrate(migrations, { debug: true }), } @@ -45,6 +47,8 @@ const combinedReducers = combineReducers({ balances: balancesReducer, exchange: exchangeReducer, futures: futuresReducer, + crossMargin: crossMarginReducer, + smartMargin: smartMarginReducer, home: homeReducer, earn: earnReducer, staking: stakingReducer, diff --git a/packages/app/src/translations/en.json b/packages/app/src/translations/en.json index b7b0b33af9..eb6fd62835 100644 --- a/packages/app/src/translations/en.json +++ b/packages/app/src/translations/en.json @@ -950,7 +950,8 @@ "no-available-margin": "No available margin", "only-available-margin": "Only {{balance}} available margin", "min-margin": "Min. $50 sUSD required to trade", - "tooltip": "Margin currently locked in closed markets. It will become available once the market reopens." + "tooltip": "Margin currently locked in closed markets. It will become available once the market reopens.", + "deposit": "Deposit" }, "confirmation": { "modal": { @@ -1191,7 +1192,9 @@ } }, "onboard": { - "title": "Smart Margin", + "sm-title": "Smart Margin", + "cm-title": "Cross Margin", + "cm-intro": "Start by creating your cross margin account", "step1-intro": "Start by creating your smart margin account", "step2-intro": "Now, approve the contract to spend sUSD", "step3-intro": "Lastly, deposit sUSD to begin trading", @@ -1199,7 +1202,8 @@ "faq1": "What is smart margin?", "faq2": "Is smart margin better than isolated margin?", "faq3": "How will a smart margin account affect my trading?", - "unsupported-network": "Smart margin is not supported on this network" + "unsupported-network": "Smart margin is not supported on this network", + "deposit": "Deposit" } } }, diff --git a/packages/app/src/types/futures.ts b/packages/app/src/types/futures.ts new file mode 100644 index 0000000000..c43a42bce6 --- /dev/null +++ b/packages/app/src/types/futures.ts @@ -0,0 +1,29 @@ +import { + ConditionalOrder, + FuturesPositionHistory, + PerpsMarketV2, + PerpsMarketV3, + PositionSide, +} from '@kwenta/sdk/types' +import Wei from '@synthetixio/wei' + +export type FuturesPositionTablePosition = { + market: PerpsMarketV2 | PerpsMarketV3 + remainingMargin?: Wei + canLiquidatePosition?: boolean + side: PositionSide + notionalValue: Wei + accruedFunding: Wei + initialMargin?: Wei + size: Wei + liquidationPrice?: Wei + leverage?: Wei + pnl: Wei + pnlPct: Wei + marginRatio: Wei + avgEntryPrice: Wei + lastPrice: Wei + stopLoss?: ConditionalOrder + takeProfit?: ConditionalOrder + history?: FuturesPositionHistory +} diff --git a/packages/app/src/utils/__tests__/futures.test.ts b/packages/app/src/utils/__tests__/futures.test.ts index f7cf9bc464..79c6a0e34c 100644 --- a/packages/app/src/utils/__tests__/futures.test.ts +++ b/packages/app/src/utils/__tests__/futures.test.ts @@ -5,14 +5,14 @@ import { minMaxSLPrice } from 'utils/futures' describe('futures utils', () => { test('correct stop loss limitation when LONG', () => { - // Traders can place stop losses at 3% above liquidation price + // Traders can place stop losses at 1% above liquidation price const minStopLoss = minMaxSLPrice(wei(1800), PositionSide.LONG) - expect(minStopLoss?.toNumber()).toEqual(1818) + expect(minStopLoss?.toNumber()).toEqual(1854) }) test('correct stop loss limitation when SHORT', () => { - // Traders can place stop losses at 3% below liquidation price + // Traders can place stop losses at 1% below liquidation price const minStopLoss = minMaxSLPrice(wei(2200), PositionSide.SHORT) - expect(minStopLoss?.toNumber()).toEqual(2178) + expect(minStopLoss?.toNumber()).toEqual(2134) }) }) diff --git a/packages/app/src/utils/balances.ts b/packages/app/src/utils/balances.ts index 0fb7dbc6a6..86bb132189 100644 --- a/packages/app/src/utils/balances.ts +++ b/packages/app/src/utils/balances.ts @@ -1,4 +1,9 @@ -import { SynthBalance, TokenBalances } from '@kwenta/sdk/types' +import { + SynthBalance, + SynthV3Asset, + SynthV3BalancesAndAllowances, + TokenBalances, +} from '@kwenta/sdk/types' import { notNill } from '@kwenta/sdk/utils' import Wei, { wei } from '@synthetixio/wei' import { orderBy } from 'lodash' @@ -17,6 +22,47 @@ export const sortWei = (a: Wei, b: Wei, order: 'descending' | 'ascending') => { } } +export const serializeV3Balances = ( + v3Balances: SynthV3BalancesAndAllowances +): Partial> => { + return Object.keys(v3Balances).reduce>>( + (acc, asset) => { + const key = asset as SynthV3Asset + acc[key] = { + balance: v3Balances[key].balance.toString(), + allowances: Object.keys(v3Balances[key].allowances).reduce>( + (acc, spender) => { + acc[spender as SynthV3Asset] = v3Balances[key].allowances[spender].toString() + return acc + }, + {} + ), + } + return acc + }, + {} + ) +} + +export const unserializeV3Balances = ( + v3Balances: Partial> +): Partial => { + return Object.keys(v3Balances).reduce>((acc, asset) => { + const key = asset as SynthV3Asset + acc[key] = { + balance: wei(v3Balances[key]!.balance), + allowances: Object.keys(v3Balances[key]!.allowances).reduce>( + (acc, spender) => { + acc[spender as SynthV3Asset] = wei(v3Balances[key]!.allowances[spender]) + return acc + }, + {} + ), + } + return acc + }, {}) +} + export const serializeBalances = ( synthBalancesMap: Record, totalUSDBalance: Wei, diff --git a/packages/app/src/utils/futures.ts b/packages/app/src/utils/futures.ts index 5be4f1bc70..c81679bbbc 100644 --- a/packages/app/src/utils/futures.ts +++ b/packages/app/src/utils/futures.ts @@ -4,12 +4,17 @@ import { FuturesMarketAsset, ConditionalOrder, FuturesOrderType, - FuturesPosition, + PerpsV2Position, FuturesPositionHistory, FuturesTrade, FuturesVolumes, PositionSide, PricesMap, + PerpsV3AsyncOrder, + PerpsV3SettlementStrategy, + PerpsMarketV2, + PerpsMarketV3, + PerpsV3Position, } from '@kwenta/sdk/types' import { AssetDisplayByAsset, @@ -20,17 +25,13 @@ import { import Wei, { wei } from '@synthetixio/wei' import { TFunction } from 'i18next' -import { - CrossMarginBalanceInfo, - TradeSizeInputs, - DelayedOrderWithDetails, - TransactionEstimation, - futuresPositionKeys, - FundingRate, - MarkPrices, -} from 'state/futures/types' +import { DelayedOrderWithDetails, TradeSizeInputs } from 'state/futures/common/types' +import { SmartMarginBalanceInfo } from 'state/futures/smartMargin/types' +import { futuresPositionKeys, FundingRate, MarkPrices } from 'state/futures/types' import { deserializeWeiObject } from 'state/helpers' +import { CrossMarginTradePreview } from '../state/futures/crossMargin/types' + export const getSynthDescription = (synth: FuturesMarketAsset, t: TFunction) => { const assetDisplayName = AssetDisplayByAsset[synth] return t('common.currency.futures-market-short-name', { @@ -64,14 +65,14 @@ export const orderPriceInvalidLabel = ( } export const updatePositionUpnl = ( - positionDetails: FuturesPosition, + positionDetails: PerpsV2Position, prices: MarkPrices, positionHistory: FuturesPositionHistory[] -): FuturesPosition => { +): PerpsV2Position => { const deserializedPositionDetails = deserializeWeiObject( positionDetails, futuresPositionKeys - ) as FuturesPosition + ) as PerpsV2Position const offChainPrice = prices[MarketKeyByAsset[deserializedPositionDetails.asset]] const position = deserializedPositionDetails.position const thisPositionHistory = positionHistory.find( @@ -138,10 +139,6 @@ export const serializeMarket = (market: FuturesMarket): FuturesMarket => } } -export const serializeMarkets = (markets: FuturesMarket[]): FuturesMarket[] => { - return markets.map((m) => serializeMarket(m)) -} - export const unserializeMarket = (m: FuturesMarket): FuturesMarket => { return { ...m, @@ -179,13 +176,75 @@ export const unserializeMarket = (m: FuturesMarket): FuturesMarket => { } } -export const unserializeMarkets = (markets: FuturesMarket[]): FuturesMarket[] => { - return markets.map((m) => unserializeMarket(m)) +export const serializeV2Market = (m: PerpsMarketV2): PerpsMarketV2 => { + return { + ...serializeMarket(m), + version: 2, + marketAddress: m.marketAddress, + } +} + +export const unserializeV2Market = (m: PerpsMarketV2): PerpsMarketV2 => { + return { + ...unserializeMarket(m), + version: 2, + marketAddress: m.marketAddress, + } +} + +export const serializeV3Market = (m: PerpsMarketV3): PerpsMarketV3 => { + return { + ...serializeMarket(m), + marketId: m.marketId, + version: 3, + settlementStrategies: m.settlementStrategies.map(serializeSettlementStrategy), + } +} + +export const unserializeV3Market = (m: PerpsMarketV3): PerpsMarketV3 => { + return { + ...unserializeMarket(m), + marketId: m.marketId, + version: 3, + settlementStrategies: m.settlementStrategies.map(unserializeSettlementStrategy), + } +} + +export const serializeV2Markets = (markets: PerpsMarketV2[]): PerpsMarketV2[] => { + return markets.map((m) => serializeV2Market(m)) +} + +export const unserializeV2Markets = (markets: PerpsMarketV2[]): PerpsMarketV2[] => { + return markets.map((m) => unserializeV2Market(m)) +} + +export const serializeSettlementStrategy = ( + strat: PerpsV3SettlementStrategy +): PerpsV3SettlementStrategy => { + return { + ...strat, + settlementDelay: strat.settlementDelay.toString(), + settlementWindowDuration: strat.settlementWindowDuration.toString(), + settlementReward: strat.settlementReward.toString(), + priceDeviationTolerance: strat.priceDeviationTolerance.toString(), + } +} + +export const unserializeSettlementStrategy = ( + strat: PerpsV3SettlementStrategy +): PerpsV3SettlementStrategy => { + return { + ...strat, + settlementDelay: wei(strat.settlementDelay), + settlementWindowDuration: wei(strat.settlementWindowDuration), + settlementReward: wei(strat.settlementReward), + priceDeviationTolerance: wei(strat.priceDeviationTolerance), + } } export const serializeCmBalanceInfo = ( - overview: CrossMarginBalanceInfo -): CrossMarginBalanceInfo => { + overview: SmartMarginBalanceInfo +): SmartMarginBalanceInfo => { return { freeMargin: overview.freeMargin.toString(), keeperEthBal: overview.keeperEthBal.toString(), @@ -195,8 +254,8 @@ export const serializeCmBalanceInfo = ( } export const unserializeCmBalanceInfo = ( - balanceInfo: CrossMarginBalanceInfo -): CrossMarginBalanceInfo => { + balanceInfo: SmartMarginBalanceInfo +): SmartMarginBalanceInfo => { return { freeMargin: wei(balanceInfo.freeMargin), keeperEthBal: wei(balanceInfo.keeperEthBal), @@ -293,12 +352,16 @@ export const unserializeDelayedOrders = ( orders: DelayedOrderWithDetails[] ): DelayedOrderWithDetails[] => orders.map((o) => unserializeDelayedOrder(o)) -export const unserializeGasEstimate = ( - estimate: TransactionEstimation -): TransactionEstimation => ({ - ...estimate, - limit: wei(estimate.limit), - cost: wei(estimate.cost), +export const serializeV3AsyncOrder = (order: PerpsV3AsyncOrder): PerpsV3AsyncOrder => ({ + ...order, + sizeDelta: order.sizeDelta.toString(), + acceptablePrice: order.sizeDelta.toString(), +}) + +export const unserializeV3AsyncOrder = (order: PerpsV3AsyncOrder): PerpsV3AsyncOrder => ({ + ...order, + sizeDelta: wei(order.sizeDelta), + acceptablePrice: wei(order.sizeDelta), }) export const serializePrices = (prices: PricesMap) => { @@ -308,6 +371,28 @@ export const serializePrices = (prices: PricesMap) => { }, {}) } +export const serializeV3Positions = (positions: PerpsV3Position[]): PerpsV3Position[] => { + return positions.map((p) => ({ + ...p, + accruedFunding: p.accruedFunding.toString(), + profitLoss: p.profitLoss.toString(), + size: p.size.toString(), + pnl: p.pnl.toString(), + pnlPct: p.pnlPct.toString(), + })) +} + +export const unserializeV3Positions = (positions: PerpsV3Position[]): PerpsV3Position[] => { + return positions.map((p) => ({ + ...p, + accruedFunding: wei(p.accruedFunding), + profitLoss: wei(p.profitLoss), + size: wei(p.size), + pnl: wei(p.pnl), + pnlPct: wei(p.pnlPct), + })) +} + export const serializePositionHistory = ( positions: FuturesPositionHistory[] ): FuturesPositionHistory[] => { @@ -384,11 +469,11 @@ export const unserializeFundingRates = (rates: FundingRate[]): FundingRa return rates.map((r) => ({ ...r, fundingRate: r.fundingRate ? wei(r.fundingRate) : null })) } -export const formatDelayedOrders = (orders: DelayedOrder[], markets: FuturesMarket[]) => { +export const formatDelayedOrders = (orders: DelayedOrder[], markets: PerpsMarketV2[]) => { return orders .filter((o) => o.size.abs().gt(0)) .reduce((acc, o) => { - const market = markets.find((m) => m.market === o.marketAddress) + const market = markets.find((m) => m.marketAddress === o.marketAddress) if (!market) return acc acc.push({ @@ -408,8 +493,33 @@ export const formatDelayedOrders = (orders: DelayedOrder[], markets: FuturesMark }, [] as DelayedOrderWithDetails[]) } -// Disable stop loss when it is within 1% of the liquidation price -const SL_LIQ_DISABLED_PERCENT = 0.01 +export const serializeCrossMarginTradePreview = ( + preview: CrossMarginTradePreview +): CrossMarginTradePreview => ({ + ...preview, + settlementFee: preview.settlementFee.toString(), + sizeDelta: preview.sizeDelta.toString(), + fillPrice: preview.fillPrice.toString(), + fee: preview.fee.toString(), + leverage: preview.leverage.toString(), + notionalValue: preview.notionalValue.toString(), + priceImpact: preview.priceImpact.toString(), +}) + +export const unserializeCrossMarginTradePreview = ( + preview: CrossMarginTradePreview +): CrossMarginTradePreview => ({ + ...preview, + settlementFee: wei(preview.settlementFee), + sizeDelta: wei(preview.sizeDelta), + fillPrice: wei(preview.fillPrice), + fee: wei(preview.fee), + leverage: wei(preview.leverage), + notionalValue: wei(preview.notionalValue), + priceImpact: wei(preview.priceImpact), +}) +// Disable stop loss when it is within 3% of the liquidation price +const SL_LIQ_DISABLED_PERCENT = 0.03 // Warn users when their stop loss is within 7.5% of their liquidation price const SL_LIQ_PERCENT_WARN = 0.075 diff --git a/packages/app/testing/unit/mocks/data/app.ts b/packages/app/testing/unit/mocks/data/app.ts index 55d07c08d8..791cbacbac 100644 --- a/packages/app/testing/unit/mocks/data/app.ts +++ b/packages/app/testing/unit/mocks/data/app.ts @@ -151,3 +151,15 @@ export const PRELOADED_STATE = { offChainPrices: { sETH: { price: DEFAULT_ETH_PRICE, change: 'up' } } as PricesInfoMap, }, } + +export const createState = (networkId: number) => { + return { + ...PRELOADED_STATE, + wallet: { networkId: networkId as NetworkId, walletAddress: TEST_ADDR }, + } +} + +export const mockTxResponse = (hash: string) => ({ + hash, + wait: () => Promise.resolve({ hash }), +}) diff --git a/packages/app/testing/unit/mocks/data/futures.ts b/packages/app/testing/unit/mocks/data/futures.ts index f95e7bec19..f4fc7112a2 100644 --- a/packages/app/testing/unit/mocks/data/futures.ts +++ b/packages/app/testing/unit/mocks/data/futures.ts @@ -1,4 +1,6 @@ +import { SL_TP_MAX_SIZE } from '@kwenta/sdk/constants' import { + ConditionalOrder, FuturesMarketAsset, FuturesMarketKey, NetworkId, @@ -8,10 +10,11 @@ import { import { wei } from '@synthetixio/wei' import { FUTURES_INITIAL_STATE } from 'state/futures/reducer' +import { SMART_MARGIN_INITIAL_STATE } from 'state/futures/smartMargin/reducer' import { PRELOADED_STATE, TEST_ADDR } from './app' -export const mockSmartMarginAccount = (freeMargin: string = '1000') => ({ +export const mockSmartMarginAccount = (freeMargin: string = '1000', keeperEthBal = '0.05') => ({ account: '0xe1ba3B0A962FbC525a9f9503AEE3310940Bb2a6F', positionHistory: [], trades: [], @@ -19,7 +22,7 @@ export const mockSmartMarginAccount = (freeMargin: string = '1000') => ({ idleTransfers: [], balanceInfo: { freeMargin: freeMargin, - keeperEthBal: '0.05', + keeperEthBal: keeperEthBal, allowance: freeMargin, walletEthBal: '1', }, @@ -29,7 +32,8 @@ export const mockSmartMarginAccount = (freeMargin: string = '1000') => ({ export const SDK_MARKETS = [ { - market: '0x0940B0A96C5e1ba33AEE331a9f950Bb2a6F2Fb25', + version: 2, + marketAddress: '0x0940B0A96C5e1ba33AEE331a9f950Bb2a6F2Fb25', marketKey: 'sBNBPERP' as FuturesMarketKey, marketName: 'BNB/sUSD', asset: 'BNB' as FuturesMarketAsset, @@ -75,7 +79,8 @@ export const SDK_MARKETS = [ }, { - market: '0x2B3bb4c683BFc5239B029131EEf3B1d214478d93', + version: 2, + marketAddress: '0x2B3bb4c683BFc5239B029131EEf3B1d214478d93', marketKey: 'sETHPERP', marketName: 'ETH/sUSD' as FuturesMarketKey, asset: 'sETH' as FuturesMarketAsset, @@ -120,7 +125,8 @@ export const SDK_MARKETS = [ }, }, { - market: '0x59b007E9ea8F89b069c43F8f45834d30853e3699', + version: 2, + marketAddress: '0x59b007E9ea8F89b069c43F8f45834d30853e3699', marketKey: 'sBTCPERP' as FuturesMarketKey, marketName: 'BTC/sUSD', asset: 'sBTC' as FuturesMarketAsset, @@ -183,17 +189,169 @@ export const MOCK_TRADE_PREVIEW = { exceedsPriceProtection: false, } +export const mockConditionalOrders = (): ConditionalOrder[] => { + return [ + { + id: 15, + subgraphId: 'CM-0x23b826B5D9E78764F3A53d29Ff402486101d3629-15', + account: '0x23b826B5D9E78764F3A53d29Ff402486101d3629', + size: wei(SL_TP_MAX_SIZE), + marginDelta: wei('0'), + orderType: 1, + orderTypeDisplay: 'Stop Loss', + desiredFillPrice: wei('4.83911'), + targetPrice: wei('5.0938'), + reduceOnly: true, + sizeTxt: 'Close', + targetPriceTxt: '$5.09', + marketKey: FuturesMarketKey.sDOTPERP, + market: 'DOT/sUSD', + asset: FuturesMarketAsset.DOT, + side: PositionSide.SHORT, + isStale: false, + isExecutable: false, + isSlTp: true, + }, + { + id: 14, + subgraphId: 'CM-0x23b826B5D9E78764F3A53d29Ff402486101d3629-14', + account: '0x23b826B5D9E78764F3A53d29Ff402486101d3629', + size: wei(SL_TP_MAX_SIZE), + marginDelta: wei('0'), + orderType: 0, + orderTypeDisplay: 'Take Profit', + desiredFillPrice: wei('5.01'), + targetPrice: wei('5.278'), + reduceOnly: true, + sizeTxt: 'Close', + targetPriceTxt: '$5.27', + marketKey: FuturesMarketKey.sDOTPERP, + market: 'DOT/sUSD', + asset: FuturesMarketAsset.DOT, + side: PositionSide.SHORT, + isStale: false, + isExecutable: false, + isSlTp: true, + }, + { + id: 13, + subgraphId: 'CM-0x23b826B5D9E78764F3A53d29Ff402486101d3629-13', + account: '0x23b826B5D9E78764F3A53d29Ff402486101d3629', + size: wei('23.322500000000000000'), + marginDelta: wei('60.000000000000000000'), + orderType: 0, + orderTypeDisplay: 'Limit', + desiredFillPrice: wei('5.200000000000000000'), + targetPrice: wei('5.000000000000000000'), + reduceOnly: false, + sizeTxt: '23.32 DOT', + targetPriceTxt: '$5.00', + marketKey: FuturesMarketKey.sDOTPERP, + market: 'DOT/sUSD', + asset: FuturesMarketAsset.DOT, + side: PositionSide.LONG, + isStale: false, + isExecutable: false, + isSlTp: false, + }, + { + id: 12, + subgraphId: 'CM-0x23b826B5D9E78764F3A53d29Ff402486101d3629-12', + account: '0x23b826B5D9E78764F3A53d29Ff402486101d3629', + size: wei('15.789700000000000000'), + marginDelta: wei('60.000000000000000000'), + orderType: 0, + orderTypeDisplay: 'Limit', + desiredFillPrice: wei('5.2'), + targetPrice: wei('5'), + reduceOnly: false, + sizeTxt: '15.79 LINK', + targetPriceTxt: '$5.00', + marketKey: FuturesMarketKey.sLINKPERP, + market: 'LINK/sUSD', + asset: FuturesMarketAsset.LINK, + side: PositionSide.LONG, + isStale: false, + isExecutable: false, + isSlTp: false, + }, + { + id: 11, + subgraphId: 'CM-0x23b826B5D9E78764F3A53d29Ff402486101d3629-11', + account: '0x23b826B5D9E78764F3A53d29Ff402486101d3629', + size: wei(SL_TP_MAX_SIZE), + marginDelta: wei('0'), + orderType: 1, + orderTypeDisplay: 'Stop Loss', + desiredFillPrice: wei('21.664750000000000000'), + targetPrice: wei('22.805000000000000000'), + reduceOnly: true, + sizeTxt: 'Close', + targetPriceTxt: '$22.81', + marketKey: FuturesMarketKey.sSOLPERP, + market: 'SOL/sUSD', + asset: FuturesMarketAsset.SOL, + side: PositionSide.SHORT, + isStale: false, + isExecutable: false, + isSlTp: true, + }, + { + id: 10, + subgraphId: 'CM-0x23b826B5D9E78764F3A53d29Ff402486101d3629-10', + account: '0x23b826B5D9E78764F3A53d29Ff402486101d3629', + size: wei(SL_TP_MAX_SIZE), + marginDelta: wei('0'), + orderType: 0, + orderTypeDisplay: 'Take Profit', + desiredFillPrice: wei('24.07680'), + targetPrice: wei('25.3440'), + reduceOnly: true, + sizeTxt: 'Close', + targetPriceTxt: '$25.34', + marketKey: FuturesMarketKey.sSOLPERP, + market: 'SOL/sUSD', + asset: FuturesMarketAsset.SOL, + side: PositionSide.SHORT, + isStale: false, + isExecutable: false, + isSlTp: true, + }, + { + id: 9, + subgraphId: 'CM-0x23b826B5D9E78764F3A53d29Ff402486101d3629-9', + account: '0x23b826B5D9E78764F3A53d29Ff402486101d3629', + size: wei(SL_TP_MAX_SIZE), + marginDelta: wei('0'), + orderType: 0, + orderTypeDisplay: 'Take Profit', + desiredFillPrice: wei('1852.5'), + targetPrice: wei('1950'), + reduceOnly: true, + sizeTxt: 'Close', + targetPriceTxt: '$1,950.00', + marketKey: FuturesMarketKey.sETHPERP, + market: 'ETH/sUSD', + asset: FuturesMarketAsset.sETH, + side: PositionSide.SHORT, + isStale: false, + isExecutable: false, + isSlTp: true, + }, + ] +} + export const preloadedStateWithSmartMarginAccount = (mockAccount = mockSmartMarginAccount()) => { return { ...PRELOADED_STATE, futures: { ...FUTURES_INITIAL_STATE, - crossMargin: { - ...FUTURES_INITIAL_STATE.crossMargin, - accounts: { - [10 as NetworkId]: { - [TEST_ADDR]: mockAccount, - }, + }, + smartMargin: { + ...SMART_MARGIN_INITIAL_STATE, + accounts: { + [10 as NetworkId]: { + [TEST_ADDR]: mockAccount, }, }, }, diff --git a/packages/app/tsconfig.json b/packages/app/tsconfig.json index 23e294dfb4..b4a6638662 100644 --- a/packages/app/tsconfig.json +++ b/packages/app/tsconfig.json @@ -30,6 +30,6 @@ "**/*.ts", "**/*.tsx", "next.config.js" - ], +, "src/state/futures/common", "src/state/futures/smartMargin" ], "types": ["node", "jest", "@testing-library/jest-dom"], } diff --git a/packages/sdk/README.md b/packages/sdk/README.md index bd8a58874b..725ce60714 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -20,7 +20,7 @@ In certain situations where the SDK needs to inform a client about data changes ## Contracts -Closely related to the context (see section above), when the network changes, we update a list of available contracts on said network internally, to be used on subsequent contract calls. +Based on the currently selected networkId, we maintain a list of available contracts in the context, used for subsequent contract calls. When there is an attempt to access a contract that is not available on the network, an error is thrown. ## Synths @@ -29,72 +29,3 @@ Similarly to contracts, we maintain a list of synths on the current network, whi # Testing One of the main benefits of extracting Kwenta's logic into an SDK is the ability to test business logic independently of the UI. The `tests` folder will contain a number of unit and integration tests that will help us remain confident in the functionality of the SDK, as well as our ability to output sensible errors when one or more of our dependencies do not behave as expected. These tests will also be updated frequently as new features are added and bugs are fixed. - -# Checklist - -The following tasks are expected to be completed before the SDK can be considered feature-complete. This list will likely grow as new features are added. - -## General - -- [x] Remove code that refers to `@synthetixio/*` packages. -- [x] Add contract typings. -- [x] Implement `Context` class. -- [ ] Cache redux state and hydrate on load -- [ ] Ensure type correctness of all SDK methods. -- [ ] Set up foundation for retries on select methods. -- [ ] Set up service for interacting with our subgraphs. -- [ ] Remove Duplicated types and move most data types to sdk. -- [ ] Cache contract data where possible, especially settings, config etc which doesn't change very often -- [ ] Create a contracts class in sdk context where we can cache more dynamic contracts such as markets -- [ ] Ensure types are added to all redux actions and reducers -- [ ] Remove old unused code -- [ ] Ensure consistent logic patterns across various pages, sdk states and services -- [ ] Ensure all data is correctly refetched after some mutation e.g. polling for contract and subgraph changes after a transaction -- [ ] Consider experimenting with WebSockets for realtime data (again). -- [ ] Remove walletAddress from connector and change references to the redux state wallet, this means we're always taking the sdk as source of truth for the wallet and avoids race conditions where queries are attempted before the signer is set. -- [ ] Add query statuses for all key queries and create derived query statuses for components which rely on completion of multiple queries -- [ ] Make all sdk number params consistent, e.g. use Wei everywhere instead of BigNumber or string -- [ ] Remove Duplicated types. -- [ ] Create a standard way of passing in numeric values (particularly amounts) to the SDK. Weigh pros and cons of (`Wei`, `ethers.BigNumber` and `string`). -- [ ] Create interfaces for all the services, so we don't have to colocate method types and logic, especially when the types are verbose. -- [ ] Add acknowledgement for features gotten from Synthetix codebase. -- [ ] Switch to relative imports -- [ ] Create `package.json` and set up TypeScript build. -- [ ] Set up monorepos with Lerna, NX, Yarn Workspaces (or the npm equivalent). - -## Exchange - -- [ ] Refactor `handleExchange` method. -- [ ] Rename quote/base to from/to. -- [ ] Update the write transactions to use the typed calls -- [ ] Ensure all methods use from/to in correct order. -- [ ] Experiment with exchange contexts (store an instance of from/to pairings, so that the client doesn't have to pass it every time). -- [ ] Reduce number of queries, by storing more data in class instance. -- [ ] Write tests for simple functions. -- [ ] Remove duplicate calls in `getSlippagePercent` -- [ ] Consider making the provision of the `txProvider` the client's responsibility. It is a little cumbersome to have to call `this.getTxProvider` in nearly every method. -- [ ] Consider ditching currency keys for simple token addresses. The client can choose to load a token list for UI purposes, but the SDK should not be concerned with such details. For balances, we can fetch them as needed. - -## Futures - -- [ ] Separate methods for isolated and cross-margin accounts. -- [ ] Implement methods for fetching orders, past trades and transfers from the subgraph. -- [ ] Query cross margin accounts from sdk and cache them there. - -## Kwenta Token - -- [ ] Consider breaking up `getEarnDetails` and `getStakingData` functions. - -# Design Considerations - -## General - -- It is important to understand that checking if certain context properties are initialized cannot be done directly by checking if the property is undefined. This is because the getter throws an error on attempting to access these values when they are undefined. - -## Exchange - -## Futures - -# Notes - -- The `ExchangeService` class is still structured very similarly to the `useExchange` hook. It is important to change this, as they are two different paradigms. Without doing this, it is impossible to be efficient with requests and eliminate the overdependence of certain methods on others. diff --git a/packages/sdk/docs/.nojekyll b/packages/sdk/docs/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/packages/sdk/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/packages/sdk/docs/README.md b/packages/sdk/docs/README.md new file mode 100644 index 0000000000..20db8f139d --- /dev/null +++ b/packages/sdk/docs/README.md @@ -0,0 +1,33 @@ +@kwenta/sdk / [Modules](modules.md) + +# Kwenta SDK + +Note: This document is a work in progress, as the implementation of the Kwenta SDK is still in progress. Interfaces, types and overall structure are subject to change. + +# Architecture + +The SDK is a collection of multiple classes, objects and functions which can generally be categorized as follows: + +## Context + +The context class (pending implementation) contains attributes that are used by other classes, especially services (see the section below), to determine what context they are being called in. For example, the context class contains information about the provider, signer, wallet address and network ID. + +## Services + +Services are collection of methods that function together to enable. We have services for futures, exchange, synths and transactions. A service's methods are available under `sdk.[service-name]`. While services function independently for the most part, they may also call methods on other services. + +## Events + +In certain situations where the SDK needs to inform a client about data changes (for example, exchange rate updates), we emit events that clients can listen to. + +## Contracts + +Based on the currently selected networkId, we maintain a list of available contracts in the context, used for subsequent contract calls. When there is an attempt to access a contract that is not available on the network, an error is thrown. + +## Synths + +Similarly to contracts, we maintain a list of synths on the current network, which is used for fetching balances, synth names etc. + +# Testing + +One of the main benefits of extracting Kwenta's logic into an SDK is the ability to test business logic independently of the UI. The `tests` folder will contain a number of unit and integration tests that will help us remain confident in the functionality of the SDK, as well as our ability to output sensible errors when one or more of our dependencies do not behave as expected. These tests will also be updated frequently as new features are added and bugs are fixed. diff --git a/packages/sdk/docs/classes/context.default.md b/packages/sdk/docs/classes/context.default.md new file mode 100644 index 0000000000..e5fffe83f1 --- /dev/null +++ b/packages/sdk/docs/classes/context.default.md @@ -0,0 +1,355 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [context](../modules/context.md) / default + +# Class: default + +[context](../modules/context.md).default + +## Implements + +- [`IContext`](../interfaces/context.IContext.md) + +## Table of contents + +### Constructors + +- [constructor](context.default.md#constructor) + +### Properties + +- [contracts](context.default.md#contracts) +- [events](context.default.md#events) +- [l1MainnetProvider](context.default.md#l1mainnetprovider) +- [multicallContracts](context.default.md#multicallcontracts) +- [multicallProvider](context.default.md#multicallprovider) + +### Accessors + +- [isL2](context.default.md#isl2) +- [isMainnet](context.default.md#ismainnet) +- [networkId](context.default.md#networkid) +- [provider](context.default.md#provider) +- [signer](context.default.md#signer) +- [walletAddress](context.default.md#walletaddress) + +### Methods + +- [logError](context.default.md#logerror) +- [setNetworkId](context.default.md#setnetworkid) +- [setProvider](context.default.md#setprovider) +- [setSigner](context.default.md#setsigner) + +## Constructors + +### constructor + +• **new default**(`context`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `context` | [`IContext`](../interfaces/context.IContext.md) | + +#### Defined in + +[packages/sdk/src/context.ts:35](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L35) + +## Properties + +### contracts + +• **contracts**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `BatchClaimer` | `undefined` \| `BatchClaimer` | +| `ExchangeRates` | `undefined` \| `ExchangeRates` | +| `Exchanger` | `undefined` \| `Exchanger` | +| `FuturesMarketData` | `undefined` \| `FuturesMarketData` | +| `FuturesMarketSettings` | `undefined` \| `FuturesMarketSettings` | +| `KwentaArrakisVault` | `undefined` \| `KwentaArrakisVault` | +| `KwentaStakingRewards` | `undefined` \| `KwentaStakingRewards` | +| `KwentaStakingRewardsV2` | `undefined` \| `KwentaStakingRewardsV2` | +| `KwentaToken` | `undefined` \| `ERC20` | +| `MultipleMerkleDistributor` | `undefined` \| `MultipleMerkleDistributor` | +| `MultipleMerkleDistributorOp` | `undefined` \| `MultipleMerkleDistributorOp` | +| `MultipleMerkleDistributorPerpsV2` | `undefined` \| `MultipleMerkleDistributorPerpsV2` | +| `MultipleMerkleDistributorSnxOp` | `undefined` \| `MultipleMerkleDistributorOp` | +| `PerpsV2MarketData` | `undefined` \| `PerpsV2MarketData` | +| `PerpsV2MarketSettings` | `undefined` \| `PerpsV2MarketSettings` | +| `Pyth` | `undefined` \| `Pyth` | +| `RewardEscrow` | `undefined` \| `RewardEscrow` | +| `RewardEscrowV2` | `undefined` \| `RewardEscrowV2` | +| `SUSD` | `undefined` \| `ERC20` | +| `SmartMarginAccountFactory` | `undefined` \| `SmartMarginAccountFactory` | +| `StakingRewards` | `undefined` \| `StakingRewards` | +| `SupplySchedule` | `undefined` \| `SupplySchedule` | +| `SynthRedeemer` | `undefined` \| `SynthRedeemer` | +| `SynthSwap` | `undefined` \| `SynthSwap` | +| `SynthUtil` | `undefined` \| `SynthUtil` | +| `Synthetix` | `undefined` \| `Synthetix` | +| `SystemSettings` | `undefined` \| `SystemSettings` | +| `SystemStatus` | `undefined` \| `SystemStatus` | +| `perpsV3MarketProxy` | `undefined` \| `PerpsV3MarketProxy` | +| `vKwentaRedeemer` | `undefined` \| `VKwentaRedeemer` | +| `vKwentaToken` | `undefined` \| `ERC20` | +| `veKwentaRedeemer` | `undefined` \| `VeKwentaRedeemer` | +| `veKwentaToken` | `undefined` \| `ERC20` | + +#### Defined in + +[packages/sdk/src/context.ts:30](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L30) + +___ + +### events + +• **events**: `EventEmitter` + +#### Defined in + +[packages/sdk/src/context.ts:32](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L32) + +___ + +### l1MainnetProvider + +• **l1MainnetProvider**: `Provider` + +#### Defined in + +[packages/sdk/src/context.ts:33](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L33) + +___ + +### multicallContracts + +• **multicallContracts**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `DappMaintenance` | `undefined` \| `Contract` | +| `ExchangeRates` | `undefined` \| `Contract` | +| `FuturesMarketData` | `undefined` \| `Contract` | +| `FuturesMarketSettings` | `undefined` \| `Contract` | +| `KwentaArrakisVault` | `undefined` \| `Contract` | +| `KwentaStakingRewards` | `undefined` \| `Contract` | +| `KwentaStakingRewardsV2` | `undefined` \| `Contract` | +| `KwentaToken` | `undefined` \| `Contract` | +| `MultipleMerkleDistributor` | `undefined` \| `Contract` | +| `MultipleMerkleDistributorOp` | `undefined` \| `Contract` | +| `MultipleMerkleDistributorPerpsV2` | `undefined` \| `Contract` | +| `MultipleMerkleDistributorSnxOp` | `undefined` \| `Contract` | +| `PerpsV2MarketData` | `undefined` \| `Contract` | +| `PerpsV2MarketSettings` | `undefined` \| `Contract` | +| `RewardEscrow` | `undefined` \| `Contract` | +| `RewardEscrowV2` | `undefined` \| `Contract` | +| `StakingRewards` | `undefined` \| `Contract` | +| `SupplySchedule` | `undefined` \| `Contract` | +| `SynthRedeemer` | `undefined` \| `Contract` | +| `SystemStatus` | `undefined` \| `Contract` | +| `vKwentaToken` | `undefined` \| `Contract` | +| `veKwentaToken` | `undefined` \| `Contract` | + +#### Defined in + +[packages/sdk/src/context.ts:31](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L31) + +___ + +### multicallProvider + +• **multicallProvider**: `Provider` + +#### Defined in + +[packages/sdk/src/context.ts:29](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L29) + +## Accessors + +### isL2 + +• `get` **isL2**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/src/context.ts:75](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L75) + +___ + +### isMainnet + +• `get` **isMainnet**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/src/context.ts:79](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L79) + +___ + +### networkId + +• `get` **networkId**(): [`NetworkId`](../modules/types_common.md#networkid) + +#### Returns + +[`NetworkId`](../modules/types_common.md#networkid) + +#### Implementation of + +[IContext](../interfaces/context.IContext.md).[networkId](../interfaces/context.IContext.md#networkid) + +#### Defined in + +[packages/sdk/src/context.ts:51](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L51) + +___ + +### provider + +• `get` **provider**(): `Provider` + +#### Returns + +`Provider` + +#### Implementation of + +[IContext](../interfaces/context.IContext.md).[provider](../interfaces/context.IContext.md#provider) + +#### Defined in + +[packages/sdk/src/context.ts:55](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L55) + +___ + +### signer + +• `get` **signer**(): `Signer` + +#### Returns + +`Signer` + +#### Implementation of + +[IContext](../interfaces/context.IContext.md).[signer](../interfaces/context.IContext.md#signer) + +#### Defined in + +[packages/sdk/src/context.ts:59](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L59) + +___ + +### walletAddress + +• `get` **walletAddress**(): `string` + +#### Returns + +`string` + +#### Implementation of + +[IContext](../interfaces/context.IContext.md).[walletAddress](../interfaces/context.IContext.md#walletaddress) + +#### Defined in + +[packages/sdk/src/context.ts:67](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L67) + +## Methods + +### logError + +▸ **logError**(`err`, `skipReport?`): `undefined` \| `void` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `err` | `Error` | `undefined` | +| `skipReport` | `boolean` | `false` | + +#### Returns + +`undefined` \| `void` + +#### Implementation of + +[IContext](../interfaces/context.IContext.md).[logError](../interfaces/context.IContext.md#logerror) + +#### Defined in + +[packages/sdk/src/context.ts:105](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L105) + +___ + +### setNetworkId + +▸ **setNetworkId**(`networkId`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `networkId` | [`NetworkId`](../modules/types_common.md#networkid) | + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/src/context.ts:93](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L93) + +___ + +### setProvider + +▸ **setProvider**(`provider`): `Promise`<[`NetworkId`](../modules/types_common.md#networkid)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `provider` | `Provider` | + +#### Returns + +`Promise`<[`NetworkId`](../modules/types_common.md#networkid)\> + +#### Defined in + +[packages/sdk/src/context.ts:83](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L83) + +___ + +### setSigner + +▸ **setSigner**(`signer`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signer` | `Signer` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[packages/sdk/src/context.ts:100](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L100) diff --git a/packages/sdk/docs/classes/index.default.md b/packages/sdk/docs/classes/index.default.md new file mode 100644 index 0000000000..653deef21d --- /dev/null +++ b/packages/sdk/docs/classes/index.default.md @@ -0,0 +1,185 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [index](../modules/index.md) / default + +# Class: default + +[index](../modules/index.md).default + +## Table of contents + +### Constructors + +- [constructor](index.default.md#constructor) + +### Properties + +- [context](index.default.md#context) +- [exchange](index.default.md#exchange) +- [futures](index.default.md#futures) +- [kwentaToken](index.default.md#kwentatoken) +- [perpsV3](index.default.md#perpsv3) +- [prices](index.default.md#prices) +- [stats](index.default.md#stats) +- [synths](index.default.md#synths) +- [system](index.default.md#system) +- [transactions](index.default.md#transactions) + +### Methods + +- [setProvider](index.default.md#setprovider) +- [setSigner](index.default.md#setsigner) + +## Constructors + +### constructor + +• **new default**(`context`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `context` | [`IContext`](../interfaces/context.IContext.md) | + +#### Defined in + +[packages/sdk/src/index.ts:27](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L27) + +## Properties + +### context + +• **context**: [`default`](context.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:15](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L15) + +___ + +### exchange + +• **exchange**: [`default`](services_exchange.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:17](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L17) + +___ + +### futures + +• **futures**: [`default`](services_futures.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:18](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L18) + +___ + +### kwentaToken + +• **kwentaToken**: [`default`](services_kwentaToken.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:22](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L22) + +___ + +### perpsV3 + +• **perpsV3**: [`default`](services_perpsV3.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:19](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L19) + +___ + +### prices + +• **prices**: [`default`](services_prices.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:23](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L23) + +___ + +### stats + +• **stats**: [`default`](services_stats.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:24](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L24) + +___ + +### synths + +• **synths**: [`default`](services_synths.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:20](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L20) + +___ + +### system + +• **system**: [`default`](services_system.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:25](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L25) + +___ + +### transactions + +• **transactions**: [`default`](services_transactions.default.md) + +#### Defined in + +[packages/sdk/src/index.ts:21](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L21) + +## Methods + +### setProvider + +▸ **setProvider**(`provider`): `Promise`<[`NetworkId`](../modules/types_common.md#networkid)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `provider` | `Provider` | + +#### Returns + +`Promise`<[`NetworkId`](../modules/types_common.md#networkid)\> + +#### Defined in + +[packages/sdk/src/index.ts:40](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L40) + +___ + +### setSigner + +▸ **setSigner**(`signer`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signer` | `Signer` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[packages/sdk/src/index.ts:44](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/index.ts#L44) diff --git a/packages/sdk/docs/classes/services_exchange.default.md b/packages/sdk/docs/classes/services_exchange.default.md new file mode 100644 index 0000000000..5c2ba4eb4e --- /dev/null +++ b/packages/sdk/docs/classes/services_exchange.default.md @@ -0,0 +1,797 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/exchange](../modules/services_exchange.md) / default + +# Class: default + +[services/exchange](../modules/services_exchange.md).default + +## Table of contents + +### Constructors + +- [constructor](services_exchange.default.md#constructor) + +### Accessors + +- [exchangeRates](services_exchange.default.md#exchangerates) +- [mainGqlEndpoint](services_exchange.default.md#maingqlendpoint) +- [synthsMap](services_exchange.default.md#synthsmap) + +### Methods + +- [approveSwap](services_exchange.default.md#approveswap) +- [batchGetCoingeckoPrices](services_exchange.default.md#batchgetcoingeckoprices) +- [checkAllowance](services_exchange.default.md#checkallowance) +- [getApproveAddress](services_exchange.default.md#getapproveaddress) +- [getAtomicRates](services_exchange.default.md#getatomicrates) +- [getBaseFeeRate](services_exchange.default.md#getbasefeerate) +- [getCoingeckoPrices](services_exchange.default.md#getcoingeckoprices) +- [getCurrencyName](services_exchange.default.md#getcurrencyname) +- [getExchangeFeeRate](services_exchange.default.md#getexchangefeerate) +- [getFeeCost](services_exchange.default.md#getfeecost) +- [getFeeReclaimPeriod](services_exchange.default.md#getfeereclaimperiod) +- [getNumEntries](services_exchange.default.md#getnumentries) +- [getOneInchQuote](services_exchange.default.md#getoneinchquote) +- [getOneInchTokenList](services_exchange.default.md#getoneinchtokenlist) +- [getOneInchTokens](services_exchange.default.md#getoneinchtokens) +- [getPriceRate](services_exchange.default.md#getpricerate) +- [getRate](services_exchange.default.md#getrate) +- [getRedeemableDeprecatedSynths](services_exchange.default.md#getredeemabledeprecatedsynths) +- [getSlippagePercent](services_exchange.default.md#getslippagepercent) +- [getSynthSuspensions](services_exchange.default.md#getsynthsuspensions) +- [getSynthsMap](services_exchange.default.md#getsynthsmap) +- [getTokenBalances](services_exchange.default.md#gettokenbalances) +- [getTradePrices](services_exchange.default.md#gettradeprices) +- [getTransactionFee](services_exchange.default.md#gettransactionfee) +- [getTxProvider](services_exchange.default.md#gettxprovider) +- [getWalletTrades](services_exchange.default.md#getwallettrades) +- [handleExchange](services_exchange.default.md#handleexchange) +- [handleSettle](services_exchange.default.md#handlesettle) +- [swapOneInch](services_exchange.default.md#swaponeinch) +- [swapOneInchGasEstimate](services_exchange.default.md#swaponeinchgasestimate) +- [swapOneInchMeta](services_exchange.default.md#swaponeinchmeta) +- [swapSynthSwap](services_exchange.default.md#swapsynthswap) +- [validCurrencyKeys](services_exchange.default.md#validcurrencykeys) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/exchange.ts:56](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L56) + +## Accessors + +### exchangeRates + +• `get` **exchangeRates**(): `Partial`<`Record`<[`AssetKey`](../modules/types_prices.md#assetkey), `Wei`\>\> + +#### Returns + +`Partial`<`Record`<[`AssetKey`](../modules/types_prices.md#assetkey), `Wei`\>\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:60](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L60) + +___ + +### mainGqlEndpoint + +• `get` **mainGqlEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/src/services/exchange.ts:853](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L853) + +___ + +### synthsMap + +• `get` **synthsMap**(): `Partial`<`Record`<`SynthSymbol`, `SynthToken`\>\> + +#### Returns + +`Partial`<`Record`<`SynthSymbol`, `SynthToken`\>\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:797](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L797) + +## Methods + +### approveSwap + +▸ **approveSwap**(`fromCurrencyKey`, `toCurrencyKey`): `Promise`<`undefined` \| `string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | + +#### Returns + +`Promise`<`undefined` \| `string`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:415](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L415) + +___ + +### batchGetCoingeckoPrices + +▸ **batchGetCoingeckoPrices**(`tokenAddresses`, `include24hrChange?`): `Promise`<[`PriceResponse`](../modules/types_exchange.md#priceresponse)\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `tokenAddresses` | `string`[] | `undefined` | +| `include24hrChange` | `boolean` | `false` | + +#### Returns + +`Promise`<[`PriceResponse`](../modules/types_exchange.md#priceresponse)\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:747](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L747) + +___ + +### checkAllowance + +▸ **checkAllowance**(`fromCurrencyKey`, `toCurrencyKey`): `Promise`<`undefined` \| `Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | + +#### Returns + +`Promise`<`undefined` \| `Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:590](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L590) + +___ + +### getApproveAddress + +▸ **getApproveAddress**(`txProvider`): ``"0x6d6273f52b0C8eaB388141393c1e8cfDB3311De6"`` \| `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txProvider` | `undefined` \| ``"synthetix"`` \| ``"1inch"`` \| ``"synthswap"`` | + +#### Returns + +``"0x6d6273f52b0C8eaB388141393c1e8cfDB3311De6"`` \| `Promise`<`string`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:586](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L586) + +___ + +### getAtomicRates + +▸ **getAtomicRates**(`currencyKey`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyKey` | `string` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:401](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L401) + +___ + +### getBaseFeeRate + +▸ **getBaseFeeRate**(`fromCurrencyKey`, `toCurrencyKey`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:128](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L128) + +___ + +### getCoingeckoPrices + +▸ **getCoingeckoPrices**(`fromCurrencyKey`, `toCurrencyKey`): `Promise`<[`PriceResponse`](../modules/types_exchange.md#priceresponse)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | + +#### Returns + +`Promise`<[`PriceResponse`](../modules/types_exchange.md#priceresponse)\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:739](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L739) + +___ + +### getCurrencyName + +▸ **getCurrencyName**(`currencyKey`): `undefined` \| `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyKey` | `string` | + +#### Returns + +`undefined` \| `string` + +#### Defined in + +[packages/sdk/src/services/exchange.ts:608](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L608) + +___ + +### getExchangeFeeRate + +▸ **getExchangeFeeRate**(`fromCurrencyKey`, `toCurrencyKey`): `Promise`<`Wei`\> + +**`Desc`** + +- Get the fee rate for exchanging between two currencies. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `fromCurrencyKey` | `string` | The currency key of the source token. | +| `toCurrencyKey` | `string` | The currency key of the destination token. | + +#### Returns + +`Promise`<`Wei`\> + +Returns the fee rate. + +#### Defined in + +[packages/sdk/src/services/exchange.ts:153](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L153) + +___ + +### getFeeCost + +▸ **getFeeCost**(`fromCurrencyKey`, `toCurrencyKey`, `fromAmount`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | +| `fromAmount` | `string` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:573](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L573) + +___ + +### getFeeReclaimPeriod + +▸ **getFeeReclaimPeriod**(`currencyKey`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyKey` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:204](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L204) + +___ + +### getNumEntries + +▸ **getNumEntries**(`currencyKey`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyKey` | `string` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:388](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L388) + +___ + +### getOneInchQuote + +▸ **getOneInchQuote**(`toCurrencyKey`, `fromCurrencyKey`, `amount`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `toCurrencyKey` | `string` | +| `fromCurrencyKey` | `string` | +| `amount` | `string` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:612](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L612) + +___ + +### getOneInchTokenList + +▸ **getOneInchTokenList**(): `Promise`<{ `symbols`: `string`[] ; `tokens`: { `address`: `string` ; `chainId`: ``1`` \| ``10`` ; `decimals`: `number` ; `logoURI`: `string` ; `name`: `string` ; `symbol`: `string` ; `tags`: `never`[] = [] }[] ; `tokensMap`: `Dictionary`<{ `address`: `string` ; `chainId`: ``1`` \| ``10`` ; `decimals`: `number` ; `logoURI`: `string` ; `name`: `string` ; `symbol`: `string` ; `tags`: `never`[] = [] }\> }\> + +**`Desc`** + +Get the list of whitelisted tokens on 1inch. + +#### Returns + +`Promise`<{ `symbols`: `string`[] ; `tokens`: { `address`: `string` ; `chainId`: ``1`` \| ``10`` ; `decimals`: `number` ; `logoURI`: `string` ; `name`: `string` ; `symbol`: `string` ; `tags`: `never`[] = [] }[] ; `tokensMap`: `Dictionary`<{ `address`: `string` ; `chainId`: ``1`` \| ``10`` ; `decimals`: `number` ; `logoURI`: `string` ; `name`: `string` ; `symbol`: `string` ; `tags`: `never`[] = [] }\> }\> + +Returns the list of tokens currently whitelisted on 1inch. + +#### Defined in + +[packages/sdk/src/services/exchange.ts:190](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L190) + +___ + +### getOneInchTokens + +▸ **getOneInchTokens**(): `Promise`<{ `tokenList`: [`Token`](../modules/types_tokens.md#token)[] ; `tokensMap`: `any` }\> + +#### Returns + +`Promise`<{ `tokenList`: [`Token`](../modules/types_tokens.md#token)[] ; `tokensMap`: `any` }\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:801](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L801) + +___ + +### getPriceRate + +▸ **getPriceRate**(`currencyKey`, `txProvider`, `coinGeckoPrices`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyKey` | `string` | +| `txProvider` | `undefined` \| ``"synthetix"`` \| ``"1inch"`` \| ``"synthswap"`` | +| `coinGeckoPrices` | [`PriceResponse`](../modules/types_exchange.md#priceresponse) | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:661](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L661) + +___ + +### getRate + +▸ **getRate**(`fromCurrencyKey`, `toCurrencyKey`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:166](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L166) + +___ + +### getRedeemableDeprecatedSynths + +▸ **getRedeemableDeprecatedSynths**(): `Promise`<{ `balances`: [`DeprecatedSynthBalance`](../modules/types_synths.md#deprecatedsynthbalance)[] = cryptoBalances; `totalUSDBalance`: `Wei` }\> + +#### Returns + +`Promise`<{ `balances`: [`DeprecatedSynthBalance`](../modules/types_synths.md#deprecatedsynthbalance)[] = cryptoBalances; `totalUSDBalance`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:684](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L684) + +___ + +### getSlippagePercent + +▸ **getSlippagePercent**(`fromCurrencyKey`, `toCurrencyKey`, `fromAmount`, `toAmount`): `Promise`<`undefined` \| `Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | +| `fromAmount` | `Wei` | +| `toAmount` | `Wei` | + +#### Returns + +`Promise`<`undefined` \| `Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:108](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L108) + +___ + +### getSynthSuspensions + +▸ **getSynthSuspensions**(): `Promise`<`Record`<`string`, { `isSuspended`: `boolean` ; `reason`: ``null`` \| [`SynthSuspensionReason`](../modules/types_futures.md#synthsuspensionreason) ; `reasonCode`: `number` }\>\> + +#### Returns + +`Promise`<`Record`<`string`, { `isSuspended`: `boolean` ; `reason`: ``null`` \| [`SynthSuspensionReason`](../modules/types_futures.md#synthsuspensionreason) ; `reasonCode`: `number` }\>\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:811](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L811) + +___ + +### getSynthsMap + +▸ **getSynthsMap**(): `Partial`<`Record`<`SynthSymbol`, `SynthToken`\>\> + +#### Returns + +`Partial`<`Record`<`SynthSymbol`, `SynthToken`\>\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:793](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L793) + +___ + +### getTokenBalances + +▸ **getTokenBalances**(`walletAddress`): `Promise`<[`TokenBalances`](../modules/types_tokens.md#tokenbalances)\> + +Get token balances for the given wallet address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `walletAddress` | `string` | Wallet address | + +#### Returns + +`Promise`<[`TokenBalances`](../modules/types_tokens.md#tokenbalances)\> + +Token balances for the given wallet address + +#### Defined in + +[packages/sdk/src/services/exchange.ts:866](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L866) + +___ + +### getTradePrices + +▸ **getTradePrices**(`txProvider`, `fromCurrencyKey`, `toCurrencyKey`, `fromAmount`, `toAmount`): `Promise`<{ `baseTradePrice`: `Wei` ; `quoteTradePrice`: `Wei` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txProvider` | `undefined` \| ``"synthetix"`` \| ``"1inch"`` \| ``"synthswap"`` | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | +| `fromAmount` | `Wei` | +| `toAmount` | `Wei` | + +#### Returns + +`Promise`<{ `baseTradePrice`: `Wei` ; `quoteTradePrice`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:82](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L82) + +___ + +### getTransactionFee + +▸ **getTransactionFee**(`fromCurrencyKey`, `toCurrencyKey`, `fromAmount`, `toAmount`): `Promise`<``null`` \| `Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | +| `fromAmount` | `string` | +| `toAmount` | `string` | + +#### Returns + +`Promise`<``null`` \| `Wei`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:508](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L508) + +___ + +### getTxProvider + +▸ **getTxProvider**(`fromCurrencyKey`, `toCurrencyKey`): `undefined` \| ``"synthetix"`` \| ``"1inch"`` \| ``"synthswap"`` + +**`Desc`** + +- Get the provider to be used for transactions on a currency pair. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `fromCurrencyKey` | `string` | The currency key of the source token. | +| `toCurrencyKey` | `string` | The currency key of the destination token. | + +#### Returns + +`undefined` \| ``"synthetix"`` \| ``"1inch"`` \| ``"synthswap"`` + +Returns one of '1inch', 'synthetix', or 'synthswap'. + +#### Defined in + +[packages/sdk/src/services/exchange.ts:70](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L70) + +___ + +### getWalletTrades + +▸ **getWalletTrades**(): `Promise`<[`SynthExchange`](../modules/types_exchange.md#synthexchange)[]\> + +#### Returns + +`Promise`<[`SynthExchange`](../modules/types_exchange.md#synthexchange)[]\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:857](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L857) + +___ + +### handleExchange + +▸ **handleExchange**(`fromCurrencyKey`, `toCurrencyKey`, `fromAmount`, `toAmount`): `Promise`<`undefined` \| `string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey` | `string` | +| `toCurrencyKey` | `string` | +| `fromAmount` | `string` | +| `toAmount` | `string` | + +#### Returns + +`Promise`<`undefined` \| `string`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:456](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L456) + +___ + +### handleSettle + +▸ **handleSettle**(`toCurrencyKey`): `Promise`<`undefined` \| `string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `toCurrencyKey` | `string` | + +#### Returns + +`Promise`<`undefined` \| `string`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:433](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L433) + +___ + +### swapOneInch + +▸ **swapOneInch**(`fromTokenAddress`, `toTokenAddress`, `amount`, `fromTokenDecimals`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromTokenAddress` | `string` | +| `toTokenAddress` | `string` | +| `amount` | `string` | +| `fromTokenDecimals` | `number` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:354](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L354) + +___ + +### swapOneInchGasEstimate + +▸ **swapOneInchGasEstimate**(`fromTokenAddress`, `toTokenAddress`, `amount`, `fromTokenDecimals`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromTokenAddress` | `string` | +| `toTokenAddress` | `string` | +| `amount` | `string` | +| `fromTokenDecimals` | `number` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:372](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L372) + +___ + +### swapOneInchMeta + +▸ **swapOneInchMeta**(`fromTokenAddress`, `toTokenAddress`, `amount`, `fromTokenDecimals`): `Promise`<`TransactionRequest`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromTokenAddress` | `string` | +| `toTokenAddress` | `string` | +| `amount` | `string` | +| `fromTokenDecimals` | `number` | + +#### Returns + +`Promise`<`TransactionRequest`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:331](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L331) + +___ + +### swapSynthSwap + +▸ **swapSynthSwap**(`fromToken`, `toToken`, `fromAmount`, `metaOnly?`): `Promise`<`BigNumber` \| `TransactionResponse` \| `PopulatedTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromToken` | [`Token`](../modules/types_tokens.md#token) | +| `toToken` | [`Token`](../modules/types_tokens.md#token) | +| `fromAmount` | `string` | +| `metaOnly?` | ``"meta_tx"`` \| ``"estimate_gas"`` | + +#### Returns + +`Promise`<`BigNumber` \| `TransactionResponse` \| `PopulatedTransaction`\> + +#### Defined in + +[packages/sdk/src/services/exchange.ts:218](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L218) + +___ + +### validCurrencyKeys + +▸ **validCurrencyKeys**(`fromCurrencyKey?`, `toCurrencyKey?`): `boolean`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fromCurrencyKey?` | `string` | +| `toCurrencyKey?` | `string` | + +#### Returns + +`boolean`[] + +#### Defined in + +[packages/sdk/src/services/exchange.ts:730](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/exchange.ts#L730) diff --git a/packages/sdk/docs/classes/services_futures.default.md b/packages/sdk/docs/classes/services_futures.default.md new file mode 100644 index 0000000000..12584871b6 --- /dev/null +++ b/packages/sdk/docs/classes/services_futures.default.md @@ -0,0 +1,1548 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/futures](../modules/services_futures.md) / default + +# Class: default + +[services/futures](../modules/services_futures.md).default + +## Table of contents + +### Constructors + +- [constructor](services_futures.default.md#constructor) + +### Accessors + +- [futuresGqlEndpoint](services_futures.default.md#futuresgqlendpoint) + +### Methods + +- [approveSmartMarginDeposit](services_futures.default.md#approvesmartmargindeposit) +- [cancelConditionalOrder](services_futures.default.md#cancelconditionalorder) +- [cancelDelayedOrder](services_futures.default.md#canceldelayedorder) +- [closeIsolatedPosition](services_futures.default.md#closeisolatedposition) +- [closeSmartMarginPosition](services_futures.default.md#closesmartmarginposition) +- [createSmartMarginAccount](services_futures.default.md#createsmartmarginaccount) +- [depositIsolatedMargin](services_futures.default.md#depositisolatedmargin) +- [depositSmartMarginAccount](services_futures.default.md#depositsmartmarginaccount) +- [executeDelayedOffchainOrder](services_futures.default.md#executedelayedoffchainorder) +- [executeDelayedOrder](services_futures.default.md#executedelayedorder) +- [getAllTrades](services_futures.default.md#getalltrades) +- [getAverageFundingRates](services_futures.default.md#getaveragefundingrates) +- [getConditionalOrders](services_futures.default.md#getconditionalorders) +- [getDailyVolumes](services_futures.default.md#getdailyvolumes) +- [getDelayedOrder](services_futures.default.md#getdelayedorder) +- [getDelayedOrders](services_futures.default.md#getdelayedorders) +- [getFuturesPositions](services_futures.default.md#getfuturespositions) +- [getFuturesTrades](services_futures.default.md#getfuturestrades) +- [getIdleMargin](services_futures.default.md#getidlemargin) +- [getIdleMarginInMarkets](services_futures.default.md#getidlemargininmarkets) +- [getIsolatedMarginTradePreview](services_futures.default.md#getisolatedmargintradepreview) +- [getIsolatedMarginTransfers](services_futures.default.md#getisolatedmargintransfers) +- [getMarketFundingRatesHistory](services_futures.default.md#getmarketfundingrateshistory) +- [getMarkets](services_futures.default.md#getmarkets) +- [getOrderFee](services_futures.default.md#getorderfee) +- [getPositionHistory](services_futures.default.md#getpositionhistory) +- [getSkewAdjustedPrice](services_futures.default.md#getskewadjustedprice) +- [getSmartMarginAccountBalance](services_futures.default.md#getsmartmarginaccountbalance) +- [getSmartMarginAccounts](services_futures.default.md#getsmartmarginaccounts) +- [getSmartMarginBalanceInfo](services_futures.default.md#getsmartmarginbalanceinfo) +- [getSmartMarginTradePreview](services_futures.default.md#getsmartmargintradepreview) +- [getSmartMarginTransfers](services_futures.default.md#getsmartmargintransfers) +- [getTradesForMarket](services_futures.default.md#gettradesformarket) +- [modifySmartMarginMarketMargin](services_futures.default.md#modifysmartmarginmarketmargin) +- [modifySmartMarginPositionSize](services_futures.default.md#modifysmartmarginpositionsize) +- [submitIsolatedMarginOrder](services_futures.default.md#submitisolatedmarginorder) +- [submitSmartMarginOrder](services_futures.default.md#submitsmartmarginorder) +- [updateStopLossAndTakeProfit](services_futures.default.md#updatestoplossandtakeprofit) +- [withdrawAccountKeeperBalance](services_futures.default.md#withdrawaccountkeeperbalance) +- [withdrawIsolatedMargin](services_futures.default.md#withdrawisolatedmargin) +- [withdrawSmartMarginAccount](services_futures.default.md#withdrawsmartmarginaccount) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/futures.ts:84](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L84) + +## Accessors + +### futuresGqlEndpoint + +• `get` **futuresGqlEndpoint**(): `string` + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/src/services/futures.ts:88](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L88) + +## Methods + +### approveSmartMarginDeposit + +▸ **approveSmartMarginDeposit**(`smartMarginAddress`, `amount?`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Approve a smart margin account deposit + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | +| `amount` | `BigNumber` | Amount to approve | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:900](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L900) + +___ + +### cancelConditionalOrder + +▸ **cancelConditionalOrder**(`smartMarginAddress`, `orderId`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Cancels a conditional order + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.cancelConditionalOrder('0x...', 1) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | +| `orderId` | `number` | Conditional order id | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1453](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1453) + +___ + +### cancelDelayedOrder + +▸ **cancelDelayedOrder**(`marketAddress`, `account`, `isOffchain`): `Promise`<`ContractTransaction`\> + +**`Desc`** + +Cancels a pending/expired delayed order, for the given market and account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.cancelDelayedOrder('0x...', '0x...', true) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketAddress` | `string` | Market address | +| `account` | `string` | Wallet address | +| `isOffchain` | `boolean` | Boolean describing if the order is offchain or not | + +#### Returns + +`Promise`<`ContractTransaction`\> + +ethers.js ContractTransaction object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1157](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1157) + +___ + +### closeIsolatedPosition + +▸ **closeIsolatedPosition**(`marketAddress`, `priceImpactDelta`): `Promise`<`ContractTransaction`\> + +**`Desc`** + +Close an open position in an isolated margin market + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.closeIsolatedPosition('0x...', wei(1)) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketAddress` | `string` | Market address | +| `priceImpactDelta` | `Wei` | Price impact delta | + +#### Returns + +`Promise`<`ContractTransaction`\> + +ethers.js ContractTransaction object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1113](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1113) + +___ + +### closeSmartMarginPosition + +▸ **closeSmartMarginPosition**(`market`, `smartMarginAddress`, `desiredFillPrice`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Closes a smart margin position + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.closeSmartMarginPosition( + { address: '0x...', key: FuturesMarketKey.sBTCPERP }, + '0x...', + wei(10000) +) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `market` | `Object` | Object containing market address and key | +| `market.address` | `string` | - | +| `market.key` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | - | +| `smartMarginAddress` | `string` | Smart margin account address | +| `desiredFillPrice` | `Wei` | Desired fill price | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1410](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1410) + +___ + +### createSmartMarginAccount + +▸ **createSmartMarginAccount**(): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Creates a smart margin account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.createSmartMarginAccount() +console.log(txn) +``` + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1220](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1220) + +___ + +### depositIsolatedMargin + +▸ **depositIsolatedMargin**(`marketAddress`, `amount`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Deposit margin for use in an isolated margin market + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.depositIsolatedMargin('0x...', wei(1)) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketAddress` | `string` | Market address | +| `amount` | `Wei` | Amount to deposit | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1075](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1075) + +___ + +### depositSmartMarginAccount + +▸ **depositSmartMarginAccount**(`smartMarginAddress`, `amount`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Deposit sUSD into a smart margin account + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | +| `amount` | `Wei` | Amount to deposit | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:917](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L917) + +___ + +### executeDelayedOffchainOrder + +▸ **executeDelayedOffchainOrder**(`marketKey`, `marketAddress`, `account`): `Promise`<`ContractTransaction`\> + +**`Desc`** + +Executes a pending delayed order, for the given market and account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.executeDelayedOffchainOrder(FuturesMarketKey.sETHPERP, '0x...', '0x...') +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | Futures market key | +| `marketAddress` | `string` | Market address | +| `account` | `string` | Wallet address | + +#### Returns + +`Promise`<`ContractTransaction`\> + +ethers.js ContractTransaction object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1194](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1194) + +___ + +### executeDelayedOrder + +▸ **executeDelayedOrder**(`marketAddress`, `account`): `Promise`<`ContractTransaction`\> + +**`Desc`** + +Executes a pending delayed order, for the given market and account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.executeDelayedOrder('0x...', '0x...') +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketAddress` | `string` | Market address | +| `account` | `string` | Wallet address | + +#### Returns + +`Promise`<`ContractTransaction`\> + +ethers.js ContractTransaction object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1176](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1176) + +___ + +### getAllTrades + +▸ **getAllTrades**(`walletAddress`, `accountType`, `pageLength?`): `Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +**`Desc`** + +Get the trade history for a given account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const trades = await sdk.futures.getAllTrades('0x...', FuturesMarginType.SMART_MARGIN) +console.log(trades) +``` + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `walletAddress` | `string` | `undefined` | Account address | +| `accountType` | [`FuturesMarginType`](../enums/types_futures.FuturesMarginType.md) | `undefined` | Account type (smart or isolated) | +| `pageLength` | `number` | `16` | Number of trades to fetch | + +#### Returns + +`Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +Array of trades for the account on the given market. + +#### Defined in + +[packages/sdk/src/services/futures.ts:765](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L765) + +___ + +### getAverageFundingRates + +▸ **getAverageFundingRates**(`markets`, `prices`, `period`): `Promise`<[`FundingRateResponse`](../modules/types_futures.md#fundingrateresponse)[]\> + +**`Desc`** + +Get the average funding rates for the given markets + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const markets = await sdk.futures.getMarkets() +const prices = +const fundingRates = await sdk.synths.getAverageFundingRates(markets, prices, Period.ONE_DAY) +console.log(fundingRates) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `markets` | [`FuturesMarket`](../modules/types_futures.md#futuresmarket)[] | Futures markets array | +| `prices` | `Partial`<`Record`<[`AssetKey`](../modules/types_prices.md#assetkey), `Wei`\>\> | Prices map | +| `period` | `Period` | Period enum member | + +#### Returns + +`Promise`<[`FundingRateResponse`](../modules/types_futures.md#fundingrateresponse)[]\> + +#### Defined in + +[packages/sdk/src/services/futures.ts:266](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L266) + +___ + +### getConditionalOrders + +▸ **getConditionalOrders**(`account`): `Promise`<[`ConditionalOrder`](../modules/types_futures.md#conditionalorder)[]\> + +**`Desc`** + +Get the conditional orders created by a given smart margin account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const orders = await sdk.futures.getConditionalOrders('0x...') +console.log(orders) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `account` | `string` | Smart margin account address | + +#### Returns + +`Promise`<[`ConditionalOrder`](../modules/types_futures.md#conditionalorder)[]\> + +Array of conditional orders created by the given smart margin account + +#### Defined in + +[packages/sdk/src/services/futures.ts:525](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L525) + +___ + +### getDailyVolumes + +▸ **getDailyVolumes**(): `Promise`<[`FuturesVolumes`](../modules/types_futures.md#futuresvolumes)\> + +**`Desc`** + +Get the daily volumes for all markets + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const dailyVolumes = await sdk.futures.getDailyVolumes() +console.log(dailyVolumes) +``` + +#### Returns + +`Promise`<[`FuturesVolumes`](../modules/types_futures.md#futuresvolumes)\> + +Object with the daily number of trades and volumes for all markets + +#### Defined in + +[packages/sdk/src/services/futures.ts:380](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L380) + +___ + +### getDelayedOrder + +▸ **getDelayedOrder**(`account`, `marketAddress`): `Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)\> + +**`Desc`** + +Get delayed orders associated with a given wallet address, for a specific market + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const order = await sdk.futures.getDelayedOrder('0x...', '0x...') +console.log(order) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `account` | `string` | Wallet address | +| `marketAddress` | `string` | Array of futures market addresses | + +#### Returns + +`Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)\> + +Delayed order for the given market address, associated with the given wallet address + +#### Defined in + +[packages/sdk/src/services/futures.ts:573](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L573) + +___ + +### getDelayedOrders + +▸ **getDelayedOrders**(`account`, `marketAddresses`): `Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)[]\> + +**`Desc`** + +Get delayed orders associated with a given wallet address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `account` | `string` | Wallet address | +| `marketAddresses` | `string`[] | Array of futures market addresses | + +#### Returns + +`Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)[]\> + +Array of delayed orders for the given market addresses, associated with the given wallet address + +#### Defined in + +[packages/sdk/src/services/futures.ts:585](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L585) + +___ + +### getFuturesPositions + +▸ **getFuturesPositions**(`address`, `futuresMarkets`): `Promise`<[`FuturesPosition`](../modules/types_futures.md#futuresposition)[]\> + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const markets = await sdk.futures.getMarkets() +const marketDetails = markets.map((m) => ({ address: m.market, marketKey: m.marketKey, asset: m.asset })) +const positions = await sdk.futures.getFuturesPositions('0x...', marketDetails) +console.log(positions) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | Smart margin or EOA address | +| `futuresMarkets` | { `address`: `string` ; `asset`: [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) ; `marketKey`: [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) }[] | Array of objects with market address, market key, and asset | + +#### Returns + +`Promise`<[`FuturesPosition`](../modules/types_futures.md#futuresposition)[]\> + +Array of futures positions associated with the given address + +#### Defined in + +[packages/sdk/src/services/futures.ts:192](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L192) + +___ + +### getFuturesTrades + +▸ **getFuturesTrades**(`marketKey`, `minTs`, `maxTs`): `Promise`<``null`` \| [`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +**`Desc`** + +Get futures trades for a given market + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const trades = await sdk.futures.getFuturesTrades(FuturesMarketKey.sBTCPERP, 0, 0) +console.log(trades) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | Futures market key | +| `minTs` | `number` | Minimum timestamp | +| `maxTs` | `number` | Maximum timestamp | + +#### Returns + +`Promise`<``null`` \| [`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +Array of trades for the given market + +#### Defined in + +[packages/sdk/src/services/futures.ts:868](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L868) + +___ + +### getIdleMargin + +▸ **getIdleMargin**(`eoa`, `account?`): `Promise`<{ `marketsTotal`: `Wei` = idleMargin.totalIdleInMarkets; `marketsWithMargin`: [`MarketWithIdleMargin`](../modules/types_futures.md#marketwithidlemargin)[] = idleMargin.marketsWithIdleMargin; `total`: `Wei` ; `walletTotal`: `Wei` = susdWalletBalance }\> + +**`Desc`** + +Get idle margin for given wallet address or smart margin account address + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const idleMargin = await sdk.futures.getIdleMargin('0x...') +console.log(idleMargin) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `eoa` | `string` | Wallet address | +| `account?` | `string` | Smart margin account address | + +#### Returns + +`Promise`<{ `marketsTotal`: `Wei` = idleMargin.totalIdleInMarkets; `marketsWithMargin`: [`MarketWithIdleMargin`](../modules/types_futures.md#marketwithidlemargin)[] = idleMargin.marketsWithIdleMargin; `total`: `Wei` ; `walletTotal`: `Wei` = susdWalletBalance }\> + +Total idle margin, idle margin in markets, total wallet balance and the markets with idle margin for the given address(es). + +#### Defined in + +[packages/sdk/src/services/futures.ts:842](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L842) + +___ + +### getIdleMarginInMarkets + +▸ **getIdleMarginInMarkets**(`accountOrEoa`): `Promise`<{ `marketsWithIdleMargin`: [`MarketWithIdleMargin`](../modules/types_futures.md#marketwithidlemargin)[] ; `totalIdleInMarkets`: `Wei` }\> + +**`Desc`** + +Get the idle margin in futures markets + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const idleMargin = await sdk.futures.getIdleMargin('0x...') +console.log(idleMargin) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountOrEoa` | `string` | Wallet address or smart margin account address | + +#### Returns + +`Promise`<{ `marketsWithIdleMargin`: [`MarketWithIdleMargin`](../modules/types_futures.md#marketwithidlemargin)[] ; `totalIdleInMarkets`: `Wei` }\> + +Total idle margin in markets and an array of markets with idle margin + +#### Defined in + +[packages/sdk/src/services/futures.ts:789](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L789) + +___ + +### getIsolatedMarginTradePreview + +▸ **getIsolatedMarginTradePreview**(`marketAddress`, `marketKey`, `orderType`, `inputs`): `Promise`<{ `exceedsPriceProtection`: `boolean` ; `fee`: `Wei` ; `leverage`: `Wei` = leverage; `liqPrice`: `Wei` ; `margin`: `Wei` ; `notionalValue`: `Wei` = notionalValue; `price`: `Wei` ; `priceImpact`: `Wei` = priceImpact; `showStatus`: `boolean` ; `side`: [`PositionSide`](../enums/types_futures.PositionSide.md) = leverageSide; `size`: `Wei` ; `sizeDelta`: `Wei` = nativeSizeDelta; `status`: `number` ; `statusMessage`: `string` }\> + +**`Desc`** + +Generate a trade preview for a potential trade with an isolated margin account. + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const preview = await sdk.futures.getIsolatedMarginTradePreview( + '0x...', + '0x...', + FuturesMarketKey.sBTCPERP, + ContractOrderType.MARKET, + { sizeDelta: wei(1), price: wei(10000), leverageSide: PositionSide.SHORT } +) +console.log(preview) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketAddress` | `string` | Futures market address | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | Futures market key | +| `orderType` | [`ContractOrderType`](../enums/types_futures.ContractOrderType.md) | Order type (market, delayed, delayed offchain) | +| `inputs` | `Object` | Object containing size delta, order price, and leverage side | +| `inputs.leverageSide` | [`PositionSide`](../enums/types_futures.PositionSide.md) | - | +| `inputs.price` | `Wei` | - | +| `inputs.sizeDelta` | `Wei` | - | + +#### Returns + +`Promise`<{ `exceedsPriceProtection`: `boolean` ; `fee`: `Wei` ; `leverage`: `Wei` = leverage; `liqPrice`: `Wei` ; `margin`: `Wei` ; `notionalValue`: `Wei` = notionalValue; `price`: `Wei` ; `priceImpact`: `Wei` = priceImpact; `showStatus`: `boolean` ; `side`: [`PositionSide`](../enums/types_futures.PositionSide.md) = leverageSide; `size`: `Wei` ; `sizeDelta`: `Wei` = nativeSizeDelta; `status`: `number` ; `statusMessage`: `string` }\> + +Object containing details about the potential trade + +#### Defined in + +[packages/sdk/src/services/futures.ts:615](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L615) + +___ + +### getIsolatedMarginTransfers + +▸ **getIsolatedMarginTransfers**(`walletAddress?`): `Promise`<[`MarginTransfer`](../modules/types_futures.md#margintransfer)[]\> + +**`Desc`** + +Get isolated margin transfer history for a given wallet address + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const transfers = await sdk.futures.getIsolatedMarginTransfers() +console.log(transfers) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `walletAddress?` | ``null`` \| `string` | Wallet address | + +#### Returns + +`Promise`<[`MarginTransfer`](../modules/types_futures.md#margintransfer)[]\> + +Array of past isolated margin transfers for the given wallet address + +#### Defined in + +[packages/sdk/src/services/futures.ts:434](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L434) + +___ + +### getMarketFundingRatesHistory + +▸ **getMarketFundingRatesHistory**(`marketAsset`, `periodLength?`): `Promise`<`any`\> + +**`Desc`** + +Get the funding rate history for a given market + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const fundingRateHistory = await sdk.futures.getMarketFundingRatesHistory('ETH') +console.log(fundingRateHistory) +``` + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `marketAsset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | `undefined` | Futures market asset | +| `periodLength` | `number` | `PERIOD_IN_SECONDS.TWO_WEEKS` | Period length in seconds | + +#### Returns + +`Promise`<`any`\> + +Funding rate history for the given market + +#### Defined in + +[packages/sdk/src/services/futures.ts:244](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L244) + +___ + +### getMarkets + +▸ **getMarkets**(`networkOverride?`): `Promise`<{ `appMaxLeverage`: `Wei` ; `asset`: [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) ; `assetHex`: `string` = asset; `contractMaxLeverage`: `Wei` ; `currentFundingRate`: `Wei` ; `currentFundingVelocity`: `Wei` ; `feeRates`: { `makerFee`: `Wei` ; `makerFeeDelayedOrder`: `Wei` ; `makerFeeOffchainDelayedOrder`: `Wei` ; `takerFee`: `Wei` ; `takerFeeDelayedOrder`: `Wei` ; `takerFeeOffchainDelayedOrder`: `Wei` } ; `isSuspended`: `boolean` = isSuspended; `keeperDeposit`: `Wei` = globalSettings.minKeeperFee; `market`: `string` ; `marketClosureReason`: [`SynthSuspensionReason`](../modules/types_futures.md#synthsuspensionreason) = suspendedReason; `marketDebt`: `Wei` ; `marketKey`: [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) ; `marketLimitNative`: `Wei` ; `marketLimitUsd`: `Wei` ; `marketName`: `string` ; `marketSize`: `Wei` ; `marketSkew`: `Wei` ; `minInitialMargin`: `Wei` = globalSettings.minInitialMargin; `openInterest`: { `long`: `Wei` ; `longPct`: `number` ; `longUSD`: `Wei` ; `short`: `Wei` ; `shortPct`: `number` ; `shortUSD`: `Wei` } ; `settings`: { `delayedOrderConfirmWindow`: `number` ; `maxDelayTimeDelta`: `number` ; `maxMarketValue`: `Wei` ; `minDelayTimeDelta`: `number` ; `offchainDelayedOrderMaxAge`: `number` ; `offchainDelayedOrderMinAge`: `number` ; `skewScale`: `Wei` } }[]\> + +**`Desc`** + +Fetches futures markets + +**`Example`** + +```ts +import { KwentaSDK } from '@kwenta/sdk' + +const sdk = new KwentaSDK() +const markets = await sdk.futures.getMarkets() +console.log(markets) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `networkOverride?` | [`NetworkOverrideOptions`](../modules/types_common.md#networkoverrideoptions) | Network override options | + +#### Returns + +`Promise`<{ `appMaxLeverage`: `Wei` ; `asset`: [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) ; `assetHex`: `string` = asset; `contractMaxLeverage`: `Wei` ; `currentFundingRate`: `Wei` ; `currentFundingVelocity`: `Wei` ; `feeRates`: { `makerFee`: `Wei` ; `makerFeeDelayedOrder`: `Wei` ; `makerFeeOffchainDelayedOrder`: `Wei` ; `takerFee`: `Wei` ; `takerFeeDelayedOrder`: `Wei` ; `takerFeeOffchainDelayedOrder`: `Wei` } ; `isSuspended`: `boolean` = isSuspended; `keeperDeposit`: `Wei` = globalSettings.minKeeperFee; `market`: `string` ; `marketClosureReason`: [`SynthSuspensionReason`](../modules/types_futures.md#synthsuspensionreason) = suspendedReason; `marketDebt`: `Wei` ; `marketKey`: [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) ; `marketLimitNative`: `Wei` ; `marketLimitUsd`: `Wei` ; `marketName`: `string` ; `marketSize`: `Wei` ; `marketSkew`: `Wei` ; `minInitialMargin`: `Wei` = globalSettings.minInitialMargin; `openInterest`: { `long`: `Wei` ; `longPct`: `number` ; `longUSD`: `Wei` ; `short`: `Wei` ; `shortPct`: `number` ; `shortUSD`: `Wei` } ; `settings`: { `delayedOrderConfirmWindow`: `number` ; `maxDelayTimeDelta`: `number` ; `maxMarketValue`: `Wei` ; `minDelayTimeDelta`: `number` ; `offchainDelayedOrderMaxAge`: `number` ; `offchainDelayedOrderMinAge`: `number` ; `skewScale`: `Wei` } }[]\> + +Futures markets array + +#### Defined in + +[packages/sdk/src/services/futures.ts:105](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L105) + +___ + +### getOrderFee + +▸ **getOrderFee**(`marketAddress`, `size`): `Promise`<`Wei`\> + +**`Desc`** + +Get order fee, based on the specified market and given order size + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const fee = await sdk.futures.getOrderFee('0x...', wei(1)) +console.log(fee) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketAddress` | `string` | Market address | +| `size` | `Wei` | Size of the order | + +#### Returns + +`Promise`<`Wei`\> + +Fee for the given order size, based on the specified market + +#### Defined in + +[packages/sdk/src/services/futures.ts:886](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L886) + +___ + +### getPositionHistory + +▸ **getPositionHistory**(`address`, `addressType?`): `Promise`<[`FuturesPositionHistory`](../modules/types_futures.md#futurespositionhistory)[]\> + +**`Desc`** + +Get futures positions history for a given wallet address or smart margin account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const positionHistory = await sdk.futures.getPositionHistory('0x...') +console.log(positionHistory) +``` + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `address` | `string` | `undefined` | Wallet address or smart margin account address | +| `addressType` | ``"account"`` \| ``"eoa"`` | `'account'` | Address type (EOA or smart margin account) | + +#### Returns + +`Promise`<[`FuturesPositionHistory`](../modules/types_futures.md#futurespositionhistory)[]\> + +Array of historical futures positions associated with the given address + +#### Defined in + +[packages/sdk/src/services/futures.ts:712](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L712) + +___ + +### getSkewAdjustedPrice + +▸ **getSkewAdjustedPrice**(`price`, `marketAddress`, `marketKey`): `Promise`<`Wei`\> + +**`Desc`** + +Adjusts the given price, based on the current market skew. + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const adjustedPrice = await sdk.futures.getSkewAdjustedPrice(wei(10000), '0x...', FuturesMarketKey.sBTCPERP) +console.log(adjustedPrice) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `price` | `Wei` | Price to adjust | +| `marketAddress` | `string` | Market address | +| `marketKey` | `string` | Market key | + +#### Returns + +`Promise`<`Wei`\> + +Adjusted price, based on the given market's skew. + +#### Defined in + +[packages/sdk/src/services/futures.ts:1617](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1617) + +___ + +### getSmartMarginAccountBalance + +▸ **getSmartMarginAccountBalance**(`smartMarginAddress`): `Promise`<`Wei`\> + +**`Desc`** + +Get the balance of a smart margin account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const balance = await sdk.futures.getSmartMarginAccountBalance('0x...') +console.log(balance) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | + +#### Returns + +`Promise`<`Wei`\> + +Balance of the given smart margin account + +#### Defined in + +[packages/sdk/src/services/futures.ts:468](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L468) + +___ + +### getSmartMarginAccounts + +▸ **getSmartMarginAccounts**(`walletAddress?`): `Promise`<`string`[]\> + +**`Desc`** + +Get the smart margin accounts associated with a given wallet address + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const accounts = await sdk.futures.getSmartMarginAccounts() +console.log(accounts) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `walletAddress?` | ``null`` \| `string` | Wallet address | + +#### Returns + +`Promise`<`string`[]\> + +Array of smart margin account addresses + +#### Defined in + +[packages/sdk/src/services/futures.ts:418](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L418) + +___ + +### getSmartMarginBalanceInfo + +▸ **getSmartMarginBalanceInfo**(`walletAddress`, `smartMarginAddress`): `Promise`<{ `allowance`: `Wei` ; `freeMargin`: `Wei` ; `keeperEthBal`: `Wei` ; `walletEthBal`: `Wei` }\> + +**`Desc`** + +Get important balances for a given smart margin account and wallet address. + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const balanceInfo = await sdk.futures.getSmartMarginBalanceInfo('0x...', '0x...') +console.log(balanceInfo) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `walletAddress` | `string` | Wallet address | +| `smartMarginAddress` | `string` | Smart margin account address | + +#### Returns + +`Promise`<{ `allowance`: `Wei` ; `freeMargin`: `Wei` ; `keeperEthBal`: `Wei` ; `walletEthBal`: `Wei` }\> + +Free margin and keeper balance (in ETH) for given smart margin address, as well as the wallet balance (in ETH), and sUSD allowance for the given wallet address. + +#### Defined in + +[packages/sdk/src/services/futures.ts:490](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L490) + +___ + +### getSmartMarginTradePreview + +▸ **getSmartMarginTradePreview**(`smartMarginAccount`, `marketKey`, `marketAddress`, `tradeParams`): `Promise`<{ `exceedsPriceProtection`: `boolean` ; `fee`: `Wei` ; `leverage`: `Wei` = leverage; `liqPrice`: `Wei` ; `margin`: `Wei` ; `notionalValue`: `Wei` = notionalValue; `price`: `Wei` ; `priceImpact`: `Wei` = priceImpact; `showStatus`: `boolean` ; `side`: [`PositionSide`](../enums/types_futures.PositionSide.md) = leverageSide; `size`: `Wei` ; `sizeDelta`: `Wei` = nativeSizeDelta; `status`: `number` ; `statusMessage`: `string` }\> + +**`Desc`** + +Generate a trade preview for a potential trade with a smart margin account. + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const preview = await sdk.futures.getSmartMarginTradePreview( + '0x...', + FuturesMarketKey.sBTCPERP, + '0x...', + { + sizeDelta: wei(1), + marginDelta: wei(1), + orderPrice: wei(10000), + leverageSide: PositionSide.SHORT, + } +) +console.log(preview) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAccount` | `string` | Smart margin account address | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | Futures market key | +| `marketAddress` | `string` | Futures market address | +| `tradeParams` | `Object` | Object containing size delta, margin delta, order price, and leverage side | +| `tradeParams.leverageSide` | [`PositionSide`](../enums/types_futures.PositionSide.md) | - | +| `tradeParams.marginDelta` | `Wei` | - | +| `tradeParams.orderPrice` | `Wei` | - | +| `tradeParams.sizeDelta` | `Wei` | - | + +#### Returns + +`Promise`<{ `exceedsPriceProtection`: `boolean` ; `fee`: `Wei` ; `leverage`: `Wei` = leverage; `liqPrice`: `Wei` ; `margin`: `Wei` ; `notionalValue`: `Wei` = notionalValue; `price`: `Wei` ; `priceImpact`: `Wei` = priceImpact; `showStatus`: `boolean` ; `side`: [`PositionSide`](../enums/types_futures.PositionSide.md) = leverageSide; `size`: `Wei` ; `sizeDelta`: `Wei` = nativeSizeDelta; `status`: `number` ; `statusMessage`: `string` }\> + +Object containing details about the potential trade + +#### Defined in + +[packages/sdk/src/services/futures.ts:666](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L666) + +___ + +### getSmartMarginTransfers + +▸ **getSmartMarginTransfers**(`walletAddress?`): `Promise`<[`MarginTransfer`](../modules/types_futures.md#margintransfer)[]\> + +**`Desc`** + +Get smart margin transfer history for a given wallet address + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const transfers = await sdk.futures.getSmartMarginTransfers() +console.log(transfers) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `walletAddress?` | ``null`` \| `string` | Wallet address | + +#### Returns + +`Promise`<[`MarginTransfer`](../modules/types_futures.md#margintransfer)[]\> + +Array of past smart margin transfers for the given wallet address + +#### Defined in + +[packages/sdk/src/services/futures.ts:452](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L452) + +___ + +### getTradesForMarket + +▸ **getTradesForMarket**(`marketAsset`, `walletAddress`, `accountType`, `pageLength?`): `Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +**`Desc`** + +Get the trade history for a given account on a specific market + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const trades = await sdk.futures.getTradesForMarket( + FuturesMarketAsset.sBTC, + '0x...', + FuturesMarginType.SMART_MARGIN +) +console.log(trades) +``` + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `marketAsset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | `undefined` | Market asset | +| `walletAddress` | `string` | `undefined` | Account address | +| `accountType` | [`FuturesMarginType`](../enums/types_futures.FuturesMarginType.md) | `undefined` | Account type (smart or isolated) | +| `pageLength` | `number` | `16` | Number of trades to fetch | + +#### Returns + +`Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +Array of trades for the account on the given market. + +#### Defined in + +[packages/sdk/src/services/futures.ts:737](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L737) + +___ + +### modifySmartMarginMarketMargin + +▸ **modifySmartMarginMarketMargin**(`smartMarginAddress`, `marketAddress`, `marginDelta`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Modify the margin for a specific market in a smart margin account + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | +| `marketAddress` | `string` | Market address | +| `marginDelta` | `Wei` | Amount to modify the margin by (can be positive or negative) | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:958](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L958) + +___ + +### modifySmartMarginPositionSize + +▸ **modifySmartMarginPositionSize**(`smartMarginAddress`, `market`, `sizeDelta`, `desiredFillPrice`, `cancelPendingReduceOrders?`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Modify the position size for a specific market in a smart margin account + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.modifySmartMarginPositionSize( + '0x...', + { key: FuturesMarketKey.sBTCPERP, address: '0x...' }, + wei(1), + wei(10000), + true +) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | +| `market` | `Object` | Object containing the market key and address | +| `market.address` | `string` | - | +| `market.key` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | - | +| `sizeDelta` | `Wei` | Intended size change (positive or negative) | +| `desiredFillPrice` | `Wei` | Desired fill price | +| `cancelPendingReduceOrders?` | `boolean` | Boolean describing if pending reduce orders should be cancelled | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1027](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1027) + +___ + +### submitIsolatedMarginOrder + +▸ **submitIsolatedMarginOrder**(`marketAddress`, `sizeDelta`, `priceImpactDelta`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Get idle margin for given wallet address or smart margin account address + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const idleMargin = await sdk.futures.getIdleMargin('0x...') +console.log(idleMargin) +``` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `sizeDelta` | `Wei` | +| `priceImpactDelta` | `Wei` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +Total idle margin, idle margin in markets, total wallet balance and the markets with idle margin for the given address(es). + +#### Defined in + +[packages/sdk/src/services/futures.ts:1130](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1130) + +___ + +### submitSmartMarginOrder + +▸ **submitSmartMarginOrder**(`market`, `walletAddress`, `smartMarginAddress`, `order`, `options?`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Get idle margin for given wallet address or smart margin account address + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const idleMargin = await sdk.futures.getIdleMargin('0x...') +console.log(idleMargin) +``` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `market` | `Object` | +| `market.address` | `string` | +| `market.key` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `walletAddress` | `string` | +| `smartMarginAddress` | `string` | +| `order` | [`SmartMarginOrderInputs`](../modules/types_futures.md#smartmarginorderinputs) | +| `options?` | `Object` | +| `options.cancelExpiredDelayedOrders?` | `boolean` | +| `options.cancelPendingReduceOrders?` | `boolean` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +Total idle margin, idle margin in markets, total wallet balance and the markets with idle margin for the given address(es). + +#### Defined in + +[packages/sdk/src/services/futures.ts:1241](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1241) + +___ + +### updateStopLossAndTakeProfit + +▸ **updateStopLossAndTakeProfit**(`marketKey`, `smartMarginAddress`, `params`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Updates the stop loss and take profit values for a given smart margin account, based on the specified market. + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.updateStopLossAndTakeProfit( + FuturesMarketKey.sBTCPERP, + '0x...', + { + stopLoss: { + price: wei(10000), + sizeDelta: wei(1), + desiredFillPrice: wei(10000), + isCancelled: false, + }, + takeProfit: { + price: wei(10000), + sizeDelta: wei(1), + desiredFillPrice: wei(10000), + isCancelled: false, + }, + keeperEthDeposit: wei(0.1), + } +) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | Market key | +| `smartMarginAddress` | `string` | Smart margin account address | +| `params` | [`SLTPOrderInputs`](../modules/types_futures.md#sltporderinputs) | Object containing the stop loss and take profit values | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1520](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1520) + +___ + +### withdrawAccountKeeperBalance + +▸ **withdrawAccountKeeperBalance**(`smartMarginAddress`, `amount`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Withdraws given smarkt margin account's keeper balance + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.withdrawAccountKeeperBalance('0x...', wei(1)) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | +| `amount` | `Wei` | Amount to withdraw | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1477](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1477) + +___ + +### withdrawIsolatedMargin + +▸ **withdrawIsolatedMargin**(`marketAddress`, `amount`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Withdraw margin from an isolated margin market + +**`Example`** + +```ts +const sdk = new KwentaSDK() +const txn = await sdk.futures.withdrawIsolatedMargin('0x...', wei(1)) +console.log(txn) +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketAddress` | `string` | Market address | +| `amount` | `Wei` | Amount to withdraw | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:1093](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L1093) + +___ + +### withdrawSmartMarginAccount + +▸ **withdrawSmartMarginAccount**(`smartMarginAddress`, `amount`): `Promise`<`TransactionResponse`\> + +**`Desc`** + +Withdraw sUSD from a smart margin account + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `smartMarginAddress` | `string` | Smart margin account address | +| `amount` | `Wei` | Amount to withdraw | + +#### Returns + +`Promise`<`TransactionResponse`\> + +ethers.js TransactionResponse object + +#### Defined in + +[packages/sdk/src/services/futures.ts:935](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/futures.ts#L935) diff --git a/packages/sdk/docs/classes/services_kwentaToken.default.md b/packages/sdk/docs/classes/services_kwentaToken.default.md new file mode 100644 index 0000000000..8ff6079710 --- /dev/null +++ b/packages/sdk/docs/classes/services_kwentaToken.default.md @@ -0,0 +1,695 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/kwentaToken](../modules/services_kwentaToken.md) / default + +# Class: default + +[services/kwentaToken](../modules/services_kwentaToken.md).default + +## Table of contents + +### Constructors + +- [constructor](services_kwentaToken.default.md#constructor) + +### Methods + +- [approveKwentaToken](services_kwentaToken.default.md#approvekwentatoken) +- [approveLPToken](services_kwentaToken.default.md#approvelptoken) +- [approveToken](services_kwentaToken.default.md#approvetoken) +- [changePoolTokens](services_kwentaToken.default.md#changepooltokens) +- [claimMultipleAllRewards](services_kwentaToken.default.md#claimmultipleallrewards) +- [claimMultipleKwentaRewards](services_kwentaToken.default.md#claimmultiplekwentarewards) +- [claimOpRewards](services_kwentaToken.default.md#claimoprewards) +- [claimRewards](services_kwentaToken.default.md#claimrewards) +- [claimStakingRewards](services_kwentaToken.default.md#claimstakingrewards) +- [claimStakingRewardsV2](services_kwentaToken.default.md#claimstakingrewardsv2) +- [compoundRewards](services_kwentaToken.default.md#compoundrewards) +- [getClaimableAllRewards](services_kwentaToken.default.md#getclaimableallrewards) +- [getClaimableRewards](services_kwentaToken.default.md#getclaimablerewards) +- [getEarnDetails](services_kwentaToken.default.md#getearndetails) +- [getEarnTokenPrices](services_kwentaToken.default.md#getearntokenprices) +- [getEscrowData](services_kwentaToken.default.md#getescrowdata) +- [getEscrowV2Data](services_kwentaToken.default.md#getescrowv2data) +- [getEstimatedRewards](services_kwentaToken.default.md#getestimatedrewards) +- [getFuturesFee](services_kwentaToken.default.md#getfuturesfee) +- [getFuturesFeeForAccount](services_kwentaToken.default.md#getfuturesfeeforaccount) +- [getStakingData](services_kwentaToken.default.md#getstakingdata) +- [getStakingV2Data](services_kwentaToken.default.md#getstakingv2data) +- [redeemToken](services_kwentaToken.default.md#redeemtoken) +- [redeemVKwenta](services_kwentaToken.default.md#redeemvkwenta) +- [redeemVeKwenta](services_kwentaToken.default.md#redeemvekwenta) +- [stakeEscrowedKwenta](services_kwentaToken.default.md#stakeescrowedkwenta) +- [stakeEscrowedKwentaV2](services_kwentaToken.default.md#stakeescrowedkwentav2) +- [stakeKwenta](services_kwentaToken.default.md#stakekwenta) +- [stakeKwentaV2](services_kwentaToken.default.md#stakekwentav2) +- [unstakeEscrowedKwenta](services_kwentaToken.default.md#unstakeescrowedkwenta) +- [unstakeEscrowedKwentaV2](services_kwentaToken.default.md#unstakeescrowedkwentav2) +- [unstakeKwenta](services_kwentaToken.default.md#unstakekwenta) +- [unstakeKwentaV2](services_kwentaToken.default.md#unstakekwentav2) +- [vestToken](services_kwentaToken.default.md#vesttoken) +- [vestTokenV2](services_kwentaToken.default.md#vesttokenv2) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:30](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L30) + +## Methods + +### approveKwentaToken + +▸ **approveKwentaToken**(`token`, `amount?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `token` | ``"kwenta"`` \| ``"veKwenta"`` \| ``"vKwenta"`` \| ``"kwentaStakingV2"`` | `undefined` | +| `amount` | `BigNumber` | `ethers.constants.MaxUint256` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:372](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L372) + +___ + +### approveLPToken + +▸ **approveLPToken**(): `Promise`<`TransactionResponse`\> + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:46](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L46) + +___ + +### approveToken + +▸ **approveToken**(`token`, `spender?`, `amount?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `token` | ``"Exchanger"`` \| ``"SystemStatus"`` \| ``"ExchangeRates"`` \| ``"SynthUtil"`` \| ``"SystemSettings"`` \| ``"SynthRedeemer"`` \| ``"FuturesMarketData"`` \| ``"FuturesMarketSettings"`` \| ``"PerpsV2MarketData"`` \| ``"PerpsV2MarketSettings"`` \| ``"Pyth"`` \| ``"SUSD"`` \| ``"Synthetix"`` \| ``"SynthSwap"`` \| ``"SmartMarginAccountFactory"`` \| ``"KwentaArrakisVault"`` \| ``"StakingRewards"`` \| ``"KwentaToken"`` \| ``"KwentaStakingRewards"`` \| ``"KwentaStakingRewardsV2"`` \| ``"RewardEscrow"`` \| ``"RewardEscrowV2"`` \| ``"SupplySchedule"`` \| ``"vKwentaToken"`` \| ``"veKwentaToken"`` \| ``"vKwentaRedeemer"`` \| ``"veKwentaRedeemer"`` \| ``"BatchClaimer"`` \| ``"MultipleMerkleDistributor"`` \| ``"MultipleMerkleDistributorPerpsV2"`` \| ``"MultipleMerkleDistributorOp"`` \| ``"MultipleMerkleDistributorSnxOp"`` \| ``"perpsV3MarketProxy"`` | `undefined` | +| `spender?` | ``"Exchanger"`` \| ``"SystemStatus"`` \| ``"ExchangeRates"`` \| ``"SynthUtil"`` \| ``"SystemSettings"`` \| ``"SynthRedeemer"`` \| ``"FuturesMarketData"`` \| ``"FuturesMarketSettings"`` \| ``"PerpsV2MarketData"`` \| ``"PerpsV2MarketSettings"`` \| ``"Pyth"`` \| ``"SUSD"`` \| ``"Synthetix"`` \| ``"SynthSwap"`` \| ``"SmartMarginAccountFactory"`` \| ``"KwentaArrakisVault"`` \| ``"StakingRewards"`` \| ``"KwentaToken"`` \| ``"KwentaStakingRewards"`` \| ``"KwentaStakingRewardsV2"`` \| ``"RewardEscrow"`` \| ``"RewardEscrowV2"`` \| ``"SupplySchedule"`` \| ``"vKwentaToken"`` \| ``"veKwentaToken"`` \| ``"vKwentaRedeemer"`` \| ``"veKwentaRedeemer"`` \| ``"BatchClaimer"`` \| ``"MultipleMerkleDistributor"`` \| ``"MultipleMerkleDistributorPerpsV2"`` \| ``"MultipleMerkleDistributorOp"`` \| ``"MultipleMerkleDistributorSnxOp"`` \| ``"perpsV3MarketProxy"`` | `undefined` | +| `amount` | `BigNumber` | `ethers.constants.MaxUint256` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:402](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L402) + +___ + +### changePoolTokens + +▸ **changePoolTokens**(`amount`, `action`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` | +| `action` | ``"stake"`` \| ``"withdraw"`` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:34](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L34) + +___ + +### claimMultipleAllRewards + +▸ **claimMultipleAllRewards**(`claimableRewards`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `claimableRewards` | [`ClaimParams`](../modules/types_kwentaToken.md#claimparams)[][] | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:711](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L711) + +___ + +### claimMultipleKwentaRewards + +▸ **claimMultipleKwentaRewards**(`claimableRewards`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `claimableRewards` | [`ClaimParams`](../modules/types_kwentaToken.md#claimparams)[][] | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:697](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L697) + +___ + +### claimOpRewards + +▸ **claimOpRewards**(`claimableRewards`, `isSnx?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `claimableRewards` | [`ClaimParams`](../modules/types_kwentaToken.md#claimparams)[] | `undefined` | +| `isSnx` | `boolean` | `false` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:741](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L741) + +___ + +### claimRewards + +▸ **claimRewards**(): `Promise`<`TransactionResponse`\> + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:108](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L108) + +___ + +### claimStakingRewards + +▸ **claimStakingRewards**(): `Promise`<`TransactionResponse`\> + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:339](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L339) + +___ + +### claimStakingRewardsV2 + +▸ **claimStakingRewardsV2**(): `Promise`<`TransactionResponse`\> + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:349](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L349) + +___ + +### compoundRewards + +▸ **compoundRewards**(): `Promise`<`TransactionResponse`\> + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:359](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L359) + +___ + +### getClaimableAllRewards + +▸ **getClaimableAllRewards**(`epochPeriod`, `isOldDistributor?`, `isOp?`, `isSnx?`): `Promise`<{ `claimableRewards`: [`ClaimParams`](../modules/types_kwentaToken.md#claimparams)[] ; `totalRewards`: `Wei` }\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `epochPeriod` | `number` | `undefined` | +| `isOldDistributor` | `boolean` | `true` | +| `isOp` | `boolean` | `false` | +| `isSnx` | `boolean` | `false` | + +#### Returns + +`Promise`<{ `claimableRewards`: [`ClaimParams`](../modules/types_kwentaToken.md#claimparams)[] ; `totalRewards`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:596](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L596) + +___ + +### getClaimableRewards + +▸ **getClaimableRewards**(`epochPeriod`, `isOldDistributor?`): `Promise`<{ `claimableRewards`: [`ClaimParams`](../modules/types_kwentaToken.md#claimparams)[] ; `totalRewards`: `Wei` }\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `epochPeriod` | `number` | `undefined` | +| `isOldDistributor` | `boolean` | `true` | + +#### Returns + +`Promise`<{ `claimableRewards`: [`ClaimParams`](../modules/types_kwentaToken.md#claimparams)[] ; `totalRewards`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:529](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L529) + +___ + +### getEarnDetails + +▸ **getEarnDetails**(): `Promise`<{ `allowance`: `Wei` ; `balance`: `Wei` ; `earned`: `Wei` ; `endDate`: `any` ; `kwentaAmount`: `Wei` ; `lpTokenBalance`: `Wei` ; `lpTotalSupply`: `Wei` ; `rewardRate`: `Wei` ; `totalSupply`: `Wei` ; `wethAmount`: `Wei` }\> + +#### Returns + +`Promise`<{ `allowance`: `Wei` ; `balance`: `Wei` ; `earned`: `Wei` ; `endDate`: `any` ; `kwentaAmount`: `Wei` ; `lpTokenBalance`: `Wei` ; `lpTotalSupply`: `Wei` ; `rewardRate`: `Wei` ; `totalSupply`: `Wei` ; `wethAmount`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:50](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L50) + +___ + +### getEarnTokenPrices + +▸ **getEarnTokenPrices**(): `Promise`<{ `kwentaPrice`: `Wei` ; `opPrice`: `Wei` ; `wethPrice`: `Wei` }\> + +#### Returns + +`Promise`<{ `kwentaPrice`: `Wei` ; `opPrice`: `Wei` ; `wethPrice`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:95](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L95) + +___ + +### getEscrowData + +▸ **getEscrowData**(): `Promise`<{ `escrowData`: [`EscrowData`](../modules/types_kwentaToken.md#escrowdata)[] ; `totalVestable`: `Wei` }\> + +#### Returns + +`Promise`<{ `escrowData`: [`EscrowData`](../modules/types_kwentaToken.md#escrowdata)[] ; `totalVestable`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:233](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L233) + +___ + +### getEscrowV2Data + +▸ **getEscrowV2Data**(): `Promise`<{ `escrowData`: [`EscrowData`](../modules/types_kwentaToken.md#escrowdata)[] ; `totalVestable`: `Wei` }\> + +#### Returns + +`Promise`<{ `escrowData`: [`EscrowData`](../modules/types_kwentaToken.md#escrowdata)[] ; `totalVestable`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:286](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L286) + +___ + +### getEstimatedRewards + +▸ **getEstimatedRewards**(): `Promise`<{ `estimatedKwentaRewards`: `Wei` ; `estimatedOpRewards`: `Wei` }\> + +#### Returns + +`Promise`<{ `estimatedKwentaRewards`: `Wei` ; `estimatedOpRewards`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:503](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L503) + +___ + +### getFuturesFee + +▸ **getFuturesFee**(`start`, `end`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `start` | `number` | +| `end` | `number` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:756](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L756) + +___ + +### getFuturesFeeForAccount + +▸ **getFuturesFeeForAccount**(`account`, `start`, `end`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `start` | `number` | +| `end` | `number` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:780](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L780) + +___ + +### getStakingData + +▸ **getStakingData**(): `Promise`<{ `claimableBalance`: `Wei` ; `epochPeriod`: `number` ; `kwentaAllowance`: `Wei` ; `kwentaBalance`: `Wei` ; `rewardEscrowBalance`: `Wei` ; `stakedEscrowedBalance`: `Wei` ; `stakedNonEscrowedBalance`: `Wei` ; `totalStakedBalance`: `Wei` ; `vKwentaAllowance`: `Wei` ; `vKwentaBalance`: `Wei` ; `veKwentaAllowance`: `Wei` ; `veKwentaBalance`: `Wei` ; `weekCounter`: `number` }\> + +#### Returns + +`Promise`<{ `claimableBalance`: `Wei` ; `epochPeriod`: `number` ; `kwentaAllowance`: `Wei` ; `kwentaBalance`: `Wei` ; `rewardEscrowBalance`: `Wei` ; `stakedEscrowedBalance`: `Wei` ; `stakedNonEscrowedBalance`: `Wei` ; `totalStakedBalance`: `Wei` ; `vKwentaAllowance`: `Wei` ; `vKwentaBalance`: `Wei` ; `veKwentaAllowance`: `Wei` ; `veKwentaBalance`: `Wei` ; `weekCounter`: `number` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:118](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L118) + +___ + +### getStakingV2Data + +▸ **getStakingV2Data**(): `Promise`<{ `claimableBalance`: `Wei` ; `kwentaStakingV2Allowance`: `Wei` ; `rewardEscrowBalance`: `Wei` ; `stakedEscrowedBalance`: `Wei` ; `stakedNonEscrowedBalance`: `Wei` ; `stakedResetTime`: `number` ; `totalStakedBalance`: `Wei` }\> + +#### Returns + +`Promise`<{ `claimableBalance`: `Wei` ; `kwentaStakingV2Allowance`: `Wei` ; `rewardEscrowBalance`: `Wei` ; `stakedEscrowedBalance`: `Wei` ; `stakedNonEscrowedBalance`: `Wei` ; `stakedResetTime`: `number` ; `totalStakedBalance`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:192](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L192) + +___ + +### redeemToken + +▸ **redeemToken**(`token`, `options?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `token` | ``"Exchanger"`` \| ``"SystemStatus"`` \| ``"ExchangeRates"`` \| ``"SynthUtil"`` \| ``"SystemSettings"`` \| ``"SynthRedeemer"`` \| ``"FuturesMarketData"`` \| ``"FuturesMarketSettings"`` \| ``"PerpsV2MarketData"`` \| ``"PerpsV2MarketSettings"`` \| ``"Pyth"`` \| ``"SUSD"`` \| ``"Synthetix"`` \| ``"SynthSwap"`` \| ``"SmartMarginAccountFactory"`` \| ``"KwentaArrakisVault"`` \| ``"StakingRewards"`` \| ``"KwentaToken"`` \| ``"KwentaStakingRewards"`` \| ``"KwentaStakingRewardsV2"`` \| ``"RewardEscrow"`` \| ``"RewardEscrowV2"`` \| ``"SupplySchedule"`` \| ``"vKwentaToken"`` \| ``"veKwentaToken"`` \| ``"vKwentaRedeemer"`` \| ``"veKwentaRedeemer"`` \| ``"BatchClaimer"`` \| ``"MultipleMerkleDistributor"`` \| ``"MultipleMerkleDistributorPerpsV2"`` \| ``"MultipleMerkleDistributorOp"`` \| ``"MultipleMerkleDistributorSnxOp"`` \| ``"perpsV3MarketProxy"`` | +| `options` | `Object` | +| `options.hasAddress` | `boolean` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:426](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L426) + +___ + +### redeemVKwenta + +▸ **redeemVKwenta**(): `Promise`<`TransactionResponse`\> + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:443](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L443) + +___ + +### redeemVeKwenta + +▸ **redeemVeKwenta**(): `Promise`<`TransactionResponse`\> + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:447](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L447) + +___ + +### stakeEscrowedKwenta + +▸ **stakeEscrowedKwenta**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:479](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L479) + +___ + +### stakeEscrowedKwentaV2 + +▸ **stakeEscrowedKwentaV2**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:495](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L495) + +___ + +### stakeKwenta + +▸ **stakeKwenta**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:471](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L471) + +___ + +### stakeKwentaV2 + +▸ **stakeKwentaV2**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:487](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L487) + +___ + +### unstakeEscrowedKwenta + +▸ **unstakeEscrowedKwenta**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:483](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L483) + +___ + +### unstakeEscrowedKwentaV2 + +▸ **unstakeEscrowedKwentaV2**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:499](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L499) + +___ + +### unstakeKwenta + +▸ **unstakeKwenta**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:475](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L475) + +___ + +### unstakeKwentaV2 + +▸ **unstakeKwentaV2**(`amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `string` \| `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:491](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L491) + +___ + +### vestToken + +▸ **vestToken**(`ids`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ids` | `number`[] | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:451](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L451) + +___ + +### vestTokenV2 + +▸ **vestTokenV2**(`ids`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ids` | `number`[] | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/kwentaToken.ts:461](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/kwentaToken.ts#L461) diff --git a/packages/sdk/docs/classes/services_perpsV3.default.md b/packages/sdk/docs/classes/services_perpsV3.default.md new file mode 100644 index 0000000000..4a9b8bd171 --- /dev/null +++ b/packages/sdk/docs/classes/services_perpsV3.default.md @@ -0,0 +1,684 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/perpsV3](../modules/services_perpsV3.md) / default + +# Class: default + +[services/perpsV3](../modules/services_perpsV3.md).default + +## Table of contents + +### Constructors + +- [constructor](services_perpsV3.default.md#constructor) + +### Properties + +- [internalFuturesMarkets](services_perpsV3.default.md#internalfuturesmarkets) +- [markets](services_perpsV3.default.md#markets) + +### Accessors + +- [subgraphUrl](services_perpsV3.default.md#subgraphurl) + +### Methods + +- [approveDeposit](services_perpsV3.default.md#approvedeposit) +- [cancelDelayedOrder](services_perpsV3.default.md#canceldelayedorder) +- [closePosition](services_perpsV3.default.md#closeposition) +- [createPerpsV3Account](services_perpsV3.default.md#createperpsv3account) +- [depositToAccount](services_perpsV3.default.md#deposittoaccount) +- [executeDelayedOffchainOrder](services_perpsV3.default.md#executedelayedoffchainorder) +- [executeDelayedOrder](services_perpsV3.default.md#executedelayedorder) +- [getAccountCollateral](services_perpsV3.default.md#getaccountcollateral) +- [getAccountOwner](services_perpsV3.default.md#getaccountowner) +- [getAllTrades](services_perpsV3.default.md#getalltrades) +- [getAvailableMargin](services_perpsV3.default.md#getavailablemargin) +- [getAverageFundingRates](services_perpsV3.default.md#getaveragefundingrates) +- [getDailyVolumes](services_perpsV3.default.md#getdailyvolumes) +- [getDelayedOrder](services_perpsV3.default.md#getdelayedorder) +- [getDelayedOrders](services_perpsV3.default.md#getdelayedorders) +- [getFuturesPositions](services_perpsV3.default.md#getfuturespositions) +- [getFuturesTrades](services_perpsV3.default.md#getfuturestrades) +- [getIsolatedTradePreview](services_perpsV3.default.md#getisolatedtradepreview) +- [getMarginTransfers](services_perpsV3.default.md#getmargintransfers) +- [getMarketFundingRatesHistory](services_perpsV3.default.md#getmarketfundingrateshistory) +- [getMarkets](services_perpsV3.default.md#getmarkets) +- [getOrderFee](services_perpsV3.default.md#getorderfee) +- [getPerpsV3AccountIds](services_perpsV3.default.md#getperpsv3accountids) +- [getPositionHistory](services_perpsV3.default.md#getpositionhistory) +- [getSkewAdjustedPrice](services_perpsV3.default.md#getskewadjustedprice) +- [getTradesForMarket](services_perpsV3.default.md#gettradesformarket) +- [submitOrder](services_perpsV3.default.md#submitorder) +- [withdrawFromAccount](services_perpsV3.default.md#withdrawfromaccount) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:60](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L60) + +## Properties + +### internalFuturesMarkets + +• **internalFuturesMarkets**: `Partial`<`Record`<[`NetworkId`](../modules/types_common.md#networkid), { `[marketAddress: string]`: `PerpsV2MarketInternal`; }\>\> = `{}` + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:56](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L56) + +___ + +### markets + +• **markets**: `undefined` \| [`FuturesMarket`](../modules/types_futures.md#futuresmarket)[] + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:55](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L55) + +## Accessors + +### subgraphUrl + +• `get` **subgraphUrl**(): `string` + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:64](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L64) + +## Methods + +### approveDeposit + +▸ **approveDeposit**(`crossMarginAddress`, `amount?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `crossMarginAddress` | `string` | +| `amount` | `BigNumber` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:515](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L515) + +___ + +### cancelDelayedOrder + +▸ **cancelDelayedOrder**(`marketAddress`, `account`, `isOffchain`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `account` | `string` | +| `isOffchain` | `boolean` | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:568](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L568) + +___ + +### closePosition + +▸ **closePosition**(`marketAddress`, `priceImpactDelta`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `priceImpactDelta` | `Wei` | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:542](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L542) + +___ + +### createPerpsV3Account + +▸ **createPerpsV3Account**(`requestedId`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `requestedId` | `BigNumberish` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:596](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L596) + +___ + +### depositToAccount + +▸ **depositToAccount**(`marketAddress`, `amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `amount` | `Wei` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:526](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L526) + +___ + +### executeDelayedOffchainOrder + +▸ **executeDelayedOffchainOrder**(`marketKey`, `marketAddress`, `account`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `marketAddress` | `string` | +| `account` | `string` | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:580](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L580) + +___ + +### executeDelayedOrder + +▸ **executeDelayedOrder**(`marketAddress`, `account`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `account` | `string` | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:575](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L575) + +___ + +### getAccountCollateral + +▸ **getAccountCollateral**(`crossMarginAddress`): `Promise`<{}\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `crossMarginAddress` | `string` | + +#### Returns + +`Promise`<{}\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:417](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L417) + +___ + +### getAccountOwner + +▸ **getAccountOwner**(`id`): `Promise`<``null`` \| `string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `BigNumberish` | + +#### Returns + +`Promise`<``null`` \| `string`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:404](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L404) + +___ + +### getAllTrades + +▸ **getAllTrades**(`walletAddress`, `accountType`, `pageLength?`): `Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `walletAddress` | `string` | `undefined` | +| `accountType` | [`FuturesMarginType`](../enums/types_futures.FuturesMarginType.md) | `undefined` | +| `pageLength` | `number` | `16` | + +#### Returns + +`Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:487](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L487) + +___ + +### getAvailableMargin + +▸ **getAvailableMargin**(`walletAddress`, `crossMarginAddress`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `walletAddress` | `string` | +| `crossMarginAddress` | `string` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:422](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L422) + +___ + +### getAverageFundingRates + +▸ **getAverageFundingRates**(`_markets`, `_prices`, `_period`): `Promise`<`never`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_markets` | [`FuturesMarket`](../modules/types_futures.md#futuresmarket)[] | +| `_prices` | `Partial`<`Record`<[`AssetKey`](../modules/types_prices.md#assetkey), `Wei`\>\> | +| `_period` | `Period` | + +#### Returns + +`Promise`<`never`[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:259](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L259) + +___ + +### getDailyVolumes + +▸ **getDailyVolumes**(): `Promise`<[`FuturesVolumes`](../modules/types_futures.md#futuresvolumes)\> + +#### Returns + +`Promise`<[`FuturesVolumes`](../modules/types_futures.md#futuresvolumes)\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:370](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L370) + +___ + +### getDelayedOrder + +▸ **getDelayedOrder**(`account`, `marketAddress`): `Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `marketAddress` | `string` | + +#### Returns + +`Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:427](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L427) + +___ + +### getDelayedOrders + +▸ **getDelayedOrders**(`account`, `marketAddresses`): `Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `marketAddresses` | `string`[] | + +#### Returns + +`Promise`<[`DelayedOrder`](../modules/types_futures.md#delayedorder)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:433](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L433) + +___ + +### getFuturesPositions + +▸ **getFuturesPositions**(`address`, `futuresMarkets`): `Promise`<[`FuturesPosition`](../modules/types_futures.md#futuresposition)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `string` | +| `futuresMarkets` | { `address`: `string` ; `asset`: [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) ; `marketKey`: [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) }[] | + +#### Returns + +`Promise`<[`FuturesPosition`](../modules/types_futures.md#futuresposition)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:208](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L208) + +___ + +### getFuturesTrades + +▸ **getFuturesTrades**(`marketKey`, `minTs`, `maxTs`): `Promise`<``null`` \| [`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `minTs` | `number` | +| `maxTs` | `number` | + +#### Returns + +`Promise`<``null`` \| [`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:501](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L501) + +___ + +### getIsolatedTradePreview + +▸ **getIsolatedTradePreview**(`_marketAddress`, `_marketKey`, `_orderType`, `_inputs`): `Promise`<{ `fillPrice`: `Wei` ; `leverage`: `Wei` ; `liqPrice`: `Wei` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_marketAddress` | `string` | +| `_marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `_orderType` | [`ContractOrderType`](../enums/types_futures.ContractOrderType.md) | +| `_inputs` | `Object` | +| `_inputs.leverageSide` | [`PositionSide`](../enums/types_futures.PositionSide.md) | +| `_inputs.price` | `Wei` | +| `_inputs.sizeDelta` | `Wei` | + +#### Returns + +`Promise`<{ `fillPrice`: `Wei` ; `leverage`: `Wei` ; `liqPrice`: `Wei` }\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:444](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L444) + +___ + +### getMarginTransfers + +▸ **getMarginTransfers**(`walletAddress?`): `Promise`<[`MarginTransfer`](../modules/types_futures.md#margintransfer)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `walletAddress?` | ``null`` \| `string` | + +#### Returns + +`Promise`<[`MarginTransfer`](../modules/types_futures.md#margintransfer)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:412](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L412) + +___ + +### getMarketFundingRatesHistory + +▸ **getMarketFundingRatesHistory**(`marketAsset`, `periodLength?`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `marketAsset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | `undefined` | +| `periodLength` | `number` | `PERIOD_IN_SECONDS.TWO_WEEKS` | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:251](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L251) + +___ + +### getMarkets + +▸ **getMarkets**(): `Promise`<[`FuturesMarket`](../modules/types_futures.md#futuresmarket)[]\> + +#### Returns + +`Promise`<[`FuturesMarket`](../modules/types_futures.md#futuresmarket)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:68](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L68) + +___ + +### getOrderFee + +▸ **getOrderFee**(`marketAddress`, `size`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `size` | `Wei` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:507](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L507) + +___ + +### getPerpsV3AccountIds + +▸ **getPerpsV3AccountIds**(`walletAddress?`): `Promise`<`string`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `walletAddress?` | ``null`` \| `string` | + +#### Returns + +`Promise`<`string`[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:398](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L398) + +___ + +### getPositionHistory + +▸ **getPositionHistory**(`walletAddress`): `Promise`<[`FuturesPositionHistory`](../modules/types_futures.md#futurespositionhistory)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `walletAddress` | `string` | + +#### Returns + +`Promise`<[`FuturesPositionHistory`](../modules/types_futures.md#futurespositionhistory)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:465](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L465) + +___ + +### getSkewAdjustedPrice + +▸ **getSkewAdjustedPrice**(`price`, `marketAddress`, `marketKey`): `Promise`<`Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `price` | `Wei` | +| `marketAddress` | `string` | +| `marketKey` | `string` | + +#### Returns + +`Promise`<`Wei`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:602](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L602) + +___ + +### getTradesForMarket + +▸ **getTradesForMarket**(`marketAsset`, `walletAddress`, `accountType`, `pageLength?`): `Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `marketAsset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | `undefined` | +| `walletAddress` | `string` | `undefined` | +| `accountType` | [`FuturesMarginType`](../enums/types_futures.FuturesMarginType.md) | `undefined` | +| `pageLength` | `number` | `16` | + +#### Returns + +`Promise`<[`FuturesTrade`](../modules/types_futures.md#futurestrade)[]\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:472](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L472) + +___ + +### submitOrder + +▸ **submitOrder**(`marketId`, `accountId`, `sizeDelta`, `acceptablePrice`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketId` | `string` | +| `accountId` | `string` | +| `sizeDelta` | `Wei` | +| `acceptablePrice` | `Wei` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:547](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L547) + +___ + +### withdrawFromAccount + +▸ **withdrawFromAccount**(`marketAddress`, `amount`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `amount` | `Wei` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/perpsV3.ts:533](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/perpsV3.ts#L533) diff --git a/packages/sdk/docs/classes/services_prices.default.md b/packages/sdk/docs/classes/services_prices.default.md new file mode 100644 index 0000000000..3038325e25 --- /dev/null +++ b/packages/sdk/docs/classes/services_prices.default.md @@ -0,0 +1,321 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/prices](../modules/services_prices.md) / default + +# Class: default + +[services/prices](../modules/services_prices.md).default + +## Table of contents + +### Constructors + +- [constructor](services_prices.default.md#constructor) + +### Properties + +- [throttleOffChainPricesUpdate](services_prices.default.md#throttleoffchainpricesupdate) + +### Accessors + +- [currentPrices](services_prices.default.md#currentprices) +- [pythIds](services_prices.default.md#pythids) + +### Methods + +- [getOffChainPrices](services_prices.default.md#getoffchainprices) +- [getOffchainPrice](services_prices.default.md#getoffchainprice) +- [getOnChainPrices](services_prices.default.md#getonchainprices) +- [getPreviousDayPrices](services_prices.default.md#getpreviousdayprices) +- [getPythPriceUpdateData](services_prices.default.md#getpythpriceupdatedata) +- [onPricesConnectionUpdated](services_prices.default.md#onpricesconnectionupdated) +- [onPricesUpdated](services_prices.default.md#onpricesupdated) +- [removeConnectionListeners](services_prices.default.md#removeconnectionlisteners) +- [removePricesListener](services_prices.default.md#removepriceslistener) +- [removePricesListeners](services_prices.default.md#removepriceslisteners) +- [startPriceUpdates](services_prices.default.md#startpriceupdates) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/prices.ts:48](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L48) + +## Properties + +### throttleOffChainPricesUpdate + +• **throttleOffChainPricesUpdate**: `DebouncedFunc`<(`offChainPrices`: `Partial`<`Record`<[`AssetKey`](../modules/types_prices.md#assetkey), `Wei`\>\>) => `void`\> + +#### Defined in + +[packages/sdk/src/services/prices.ts:289](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L289) + +## Accessors + +### currentPrices + +• `get` **currentPrices**(): `Object` + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `offChain` | `Partial`<`Record`<[`AssetKey`](../modules/types_prices.md#assetkey), `Wei`\>\> | +| `onChain` | `Partial`<`Record`<[`AssetKey`](../modules/types_prices.md#assetkey), `Wei`\>\> | + +#### Defined in + +[packages/sdk/src/services/prices.ts:54](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L54) + +___ + +### pythIds + +• `get` **pythIds**(): `string`[] + +#### Returns + +`string`[] + +#### Defined in + +[packages/sdk/src/services/prices.ts:61](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L61) + +## Methods + +### getOffChainPrices + +▸ **getOffChainPrices**(): `Promise`<`Record`<`string`, `Wei`\>\> + +#### Returns + +`Promise`<`Record`<`string`, `Wei`\>\> + +#### Defined in + +[packages/sdk/src/services/prices.ts:159](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L159) + +___ + +### getOffchainPrice + +▸ **getOffchainPrice**(`marketKey`): `Wei` + +**`Desc`** + +Get offchain price for a given market + +**`Example`** + +```ts +const sdk = new KwentaSDK(); +const price = sdk.prices.getOffchainPrice(FuturesMarketKey.sBTCPERP); +console.log(price); +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | Futures market key | + +#### Returns + +`Wei` + +Offchain price for specified market + +#### Defined in + +[packages/sdk/src/services/prices.ts:76](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L76) + +___ + +### getOnChainPrices + +▸ **getOnChainPrices**(): `Promise`<`Record`<`string`, `Wei`\>\> + +#### Returns + +`Promise`<`Record`<`string`, `Wei`\>\> + +#### Defined in + +[packages/sdk/src/services/prices.ts:130](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L130) + +___ + +### getPreviousDayPrices + +▸ **getPreviousDayPrices**(`marketAssets`, `networkId?`): `Promise`<[`SynthPrice`](../modules/types_prices.md#synthprice)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marketAssets` | `string`[] | +| `networkId?` | [`NetworkId`](../modules/types_common.md#networkid) | + +#### Returns + +`Promise`<[`SynthPrice`](../modules/types_prices.md#synthprice)[]\> + +#### Defined in + +[packages/sdk/src/services/prices.ts:164](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L164) + +___ + +### getPythPriceUpdateData + +▸ **getPythPriceUpdateData**(`marketKey`): `Promise`<`string`[]\> + +**`Desc`** + +Get pyth price update data for a given market + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | Futures market key | + +#### Returns + +`Promise`<`string`[]\> + +Pyth price update data + +#### Defined in + +[packages/sdk/src/services/prices.ts:203](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L203) + +___ + +### onPricesConnectionUpdated + +▸ **onPricesConnectionUpdated**(`listener`): `EventEmitter` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `listener` | (`status`: { `connected`: `boolean` ; `error?`: `Error` }) => `void` | + +#### Returns + +`EventEmitter` + +#### Defined in + +[packages/sdk/src/services/prices.ts:120](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L120) + +___ + +### onPricesUpdated + +▸ **onPricesUpdated**(`listener`): `EventEmitter` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `listener` | [`PricesListener`](../modules/types_prices.md#priceslistener) | + +#### Returns + +`EventEmitter` + +#### Defined in + +[packages/sdk/src/services/prices.ts:108](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L108) + +___ + +### removeConnectionListeners + +▸ **removeConnectionListeners**(): `void` + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/src/services/prices.ts:126](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L126) + +___ + +### removePricesListener + +▸ **removePricesListener**(`listener`): `EventEmitter` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `listener` | [`PricesListener`](../modules/types_prices.md#priceslistener) | + +#### Returns + +`EventEmitter` + +#### Defined in + +[packages/sdk/src/services/prices.ts:112](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L112) + +___ + +### removePricesListeners + +▸ **removePricesListeners**(): `void` + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/src/services/prices.ts:116](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L116) + +___ + +### startPriceUpdates + +▸ **startPriceUpdates**(`intervalTime`): `Promise`<`void`\> + +**`Desc`** + +Start polling pyth price updates + +**`Example`** + +```ts +const sdk = new KwentaSDK(); +await sdk.prices.startPriceUpdates(10000); +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `intervalTime` | `number` | Polling interval in milliseconds | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[packages/sdk/src/services/prices.ts:91](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/prices.ts#L91) diff --git a/packages/sdk/docs/classes/services_stats.default.md b/packages/sdk/docs/classes/services_stats.default.md new file mode 100644 index 0000000000..3371f22296 --- /dev/null +++ b/packages/sdk/docs/classes/services_stats.default.md @@ -0,0 +1,117 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/stats](../modules/services_stats.md) / default + +# Class: default + +[services/stats](../modules/services_stats.md).default + +## Table of contents + +### Constructors + +- [constructor](services_stats.default.md#constructor) + +### Methods + +- [getFuturesCumulativeStats](services_stats.default.md#getfuturescumulativestats) +- [getFuturesStats](services_stats.default.md#getfuturesstats) +- [getFuturesTradersStats](services_stats.default.md#getfuturestradersstats) +- [getLeaderboard](services_stats.default.md#getleaderboard) +- [getStatsVolumes](services_stats.default.md#getstatsvolumes) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/stats.ts:24](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/stats.ts#L24) + +## Methods + +### getFuturesCumulativeStats + +▸ **getFuturesCumulativeStats**(`homepage`): `Promise`<``null`` \| { `averageTradeSize`: `string` ; `totalLiquidations`: `any` = response.futuresCumulativeStat.totalLiquidations; `totalTraders`: `any` = response.futuresCumulativeStat.totalTraders; `totalTrades`: `any` = response.futuresCumulativeStat.totalTrades; `totalVolume`: `string` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `homepage` | `boolean` | + +#### Returns + +`Promise`<``null`` \| { `averageTradeSize`: `string` ; `totalLiquidations`: `any` = response.futuresCumulativeStat.totalLiquidations; `totalTraders`: `any` = response.futuresCumulativeStat.totalTraders; `totalTrades`: `any` = response.futuresCumulativeStat.totalTrades; `totalVolume`: `string` }\> + +#### Defined in + +[packages/sdk/src/services/stats.ts:128](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/stats.ts#L128) + +___ + +### getFuturesStats + +▸ **getFuturesStats**(): `Promise`<{ `liquidations`: `number` ; `pnl`: `string` ; `rank`: `number` ; `rankText`: `string` ; `totalTrades`: `number` ; `totalVolume`: `string` ; `trader`: `string` = stat.account; `traderShort`: `string` }[]\> + +#### Returns + +`Promise`<{ `liquidations`: `number` ; `pnl`: `string` ; `rank`: `number` ; `rankText`: `string` ; `totalTrades`: `number` ; `totalVolume`: `string` ; `trader`: `string` = stat.account; `traderShort`: `string` }[]\> + +#### Defined in + +[packages/sdk/src/services/stats.ts:32](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/stats.ts#L32) + +___ + +### getFuturesTradersStats + +▸ **getFuturesTradersStats**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[packages/sdk/src/services/stats.ts:30](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/stats.ts#L30) + +___ + +### getLeaderboard + +▸ **getLeaderboard**(`searchTerm`): `Promise`<[`Leaderboard`](../modules/types_stats.md#leaderboard)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `searchTerm` | `string` | + +#### Returns + +`Promise`<[`Leaderboard`](../modules/types_stats.md#leaderboard)\> + +#### Defined in + +[packages/sdk/src/services/stats.ts:69](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/stats.ts#L69) + +___ + +### getStatsVolumes + +▸ **getStatsVolumes**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[packages/sdk/src/services/stats.ts:28](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/stats.ts#L28) diff --git a/packages/sdk/docs/classes/services_synths.default.md b/packages/sdk/docs/classes/services_synths.default.md new file mode 100644 index 0000000000..ca07a15fc4 --- /dev/null +++ b/packages/sdk/docs/classes/services_synths.default.md @@ -0,0 +1,57 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/synths](../modules/services_synths.md) / default + +# Class: default + +[services/synths](../modules/services_synths.md).default + +## Table of contents + +### Constructors + +- [constructor](services_synths.default.md#constructor) + +### Methods + +- [getSynthBalances](services_synths.default.md#getsynthbalances) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/synths.ts:17](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/synths.ts#L17) + +## Methods + +### getSynthBalances + +▸ **getSynthBalances**(`walletAddress`): `Promise`<{ `balances`: [`SynthBalance`](../modules/types_synths.md#synthbalance)[] ; `balancesMap`: `Record`<`string`, [`SynthBalance`](../modules/types_synths.md#synthbalance)\> ; `susdWalletBalance`: `Wei` ; `totalUSDBalance`: `Wei` }\> + +**`Desc`** + +Get synth balances for a given wallet address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `walletAddress` | `string` | Wallet address | + +#### Returns + +`Promise`<{ `balances`: [`SynthBalance`](../modules/types_synths.md#synthbalance)[] ; `balancesMap`: `Record`<`string`, [`SynthBalance`](../modules/types_synths.md#synthbalance)\> ; `susdWalletBalance`: `Wei` ; `totalUSDBalance`: `Wei` }\> + +Synth balances for the given wallet address + +#### Defined in + +[packages/sdk/src/services/synths.ts:26](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/synths.ts#L26) diff --git a/packages/sdk/docs/classes/services_system.default.md b/packages/sdk/docs/classes/services_system.default.md new file mode 100644 index 0000000000..50e90fe299 --- /dev/null +++ b/packages/sdk/docs/classes/services_system.default.md @@ -0,0 +1,60 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/system](../modules/services_system.md) / default + +# Class: default + +[services/system](../modules/services_system.md).default + +## Table of contents + +### Constructors + +- [constructor](services_system.default.md#constructor) + +### Methods + +- [getKwentaStatus](services_system.default.md#getkwentastatus) +- [getSynthetixStatus](services_system.default.md#getsynthetixstatus) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/system.ts:10](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/system.ts#L10) + +## Methods + +### getKwentaStatus + +▸ **getKwentaStatus**(): `Promise`<[`KwentaStatus`](../modules/types_system.md#kwentastatus)\> + +#### Returns + +`Promise`<[`KwentaStatus`](../modules/types_system.md#kwentastatus)\> + +#### Defined in + +[packages/sdk/src/services/system.ts:29](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/system.ts#L29) + +___ + +### getSynthetixStatus + +▸ **getSynthetixStatus**(): `Promise`<`boolean`\> + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[packages/sdk/src/services/system.ts:14](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/system.ts#L14) diff --git a/packages/sdk/docs/classes/services_transactions.default.md b/packages/sdk/docs/classes/services_transactions.default.md new file mode 100644 index 0000000000..d439c31301 --- /dev/null +++ b/packages/sdk/docs/classes/services_transactions.default.md @@ -0,0 +1,203 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [services/transactions](../modules/services_transactions.md) / default + +# Class: default + +[services/transactions](../modules/services_transactions.md).default + +## Table of contents + +### Constructors + +- [constructor](services_transactions.default.md#constructor) + +### Methods + +- [createContractTxn](services_transactions.default.md#createcontracttxn) +- [createEVMTxn](services_transactions.default.md#createevmtxn) +- [createSynthetixTxn](services_transactions.default.md#createsynthetixtxn) +- [estimateGas](services_transactions.default.md#estimategas) +- [getGasPrice](services_transactions.default.md#getgasprice) +- [getOptimismLayerOneFees](services_transactions.default.md#getoptimismlayeronefees) +- [hash](services_transactions.default.md#hash) +- [watchTransaction](services_transactions.default.md#watchtransaction) + +## Constructors + +### constructor + +• **new default**(`sdk`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sdk` | [`default`](index.default.md) | + +#### Defined in + +[packages/sdk/src/services/transactions.ts:29](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L29) + +## Methods + +### createContractTxn + +▸ **createContractTxn**(`contract`, `method`, `args`, `txnOptions?`, `options?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `contract` | `Contract` | +| `method` | `string` | +| `args` | `any`[] | +| `txnOptions` | `Partial`<`TransactionRequest`\> | +| `options?` | `Object` | +| `options.gasLimitBuffer?` | `number` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/transactions.ts:78](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L78) + +___ + +### createEVMTxn + +▸ **createEVMTxn**(`txn`, `options?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txn` | `TransactionRequest` | +| `options?` | `any` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/transactions.ts:95](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L95) + +___ + +### createSynthetixTxn + +▸ **createSynthetixTxn**(`contractName`, `method`, `args`, `txnOptions?`, `options?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `contractName` | ``"Exchanger"`` \| ``"SystemStatus"`` \| ``"ExchangeRates"`` \| ``"SynthUtil"`` \| ``"SystemSettings"`` \| ``"SynthRedeemer"`` \| ``"FuturesMarketData"`` \| ``"FuturesMarketSettings"`` \| ``"PerpsV2MarketData"`` \| ``"PerpsV2MarketSettings"`` \| ``"Pyth"`` \| ``"SUSD"`` \| ``"Synthetix"`` \| ``"SynthSwap"`` \| ``"SmartMarginAccountFactory"`` \| ``"KwentaArrakisVault"`` \| ``"StakingRewards"`` \| ``"KwentaToken"`` \| ``"KwentaStakingRewards"`` \| ``"KwentaStakingRewardsV2"`` \| ``"RewardEscrow"`` \| ``"RewardEscrowV2"`` \| ``"SupplySchedule"`` \| ``"vKwentaToken"`` \| ``"veKwentaToken"`` \| ``"vKwentaRedeemer"`` \| ``"veKwentaRedeemer"`` \| ``"BatchClaimer"`` \| ``"MultipleMerkleDistributor"`` \| ``"MultipleMerkleDistributorPerpsV2"`` \| ``"MultipleMerkleDistributorOp"`` \| ``"MultipleMerkleDistributorSnxOp"`` \| ``"perpsV3MarketProxy"`` | +| `method` | `string` | +| `args` | `any`[] | +| `txnOptions` | `Partial`<`TransactionRequest`\> | +| `options?` | `any` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Defined in + +[packages/sdk/src/services/transactions.ts:110](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L110) + +___ + +### estimateGas + +▸ **estimateGas**(`txn`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txn` | `TransactionRequest` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/services/transactions.ts:126](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L126) + +___ + +### getGasPrice + +▸ **getGasPrice**(): `Promise`<{ `average`: { `gasPrice`: `BigNumber` } ; `fast`: { `gasPrice`: `BigNumber` } ; `fastest`: { `gasPrice`: `BigNumber` } } \| { `average`: { `baseFeePerGas`: `BigNumber` ; `maxFeePerGas`: `BigNumber` ; `maxPriorityFeePerGas`: `BigNumber` } ; `fast`: { `baseFeePerGas`: `BigNumber` ; `maxFeePerGas`: `BigNumber` ; `maxPriorityFeePerGas`: `BigNumber` } ; `fastest`: { `baseFeePerGas`: `BigNumber` ; `maxFeePerGas`: `BigNumber` ; `maxPriorityFeePerGas`: `BigNumber` } }\> + +#### Returns + +`Promise`<{ `average`: { `gasPrice`: `BigNumber` } ; `fast`: { `gasPrice`: `BigNumber` } ; `fastest`: { `gasPrice`: `BigNumber` } } \| { `average`: { `baseFeePerGas`: `BigNumber` ; `maxFeePerGas`: `BigNumber` ; `maxPriorityFeePerGas`: `BigNumber` } ; `fast`: { `baseFeePerGas`: `BigNumber` ; `maxFeePerGas`: `BigNumber` ; `maxPriorityFeePerGas`: `BigNumber` } ; `fastest`: { `baseFeePerGas`: `BigNumber` ; `maxFeePerGas`: `BigNumber` ; `maxPriorityFeePerGas`: `BigNumber` } }\> + +#### Defined in + +[packages/sdk/src/services/transactions.ts:158](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L158) + +___ + +### getOptimismLayerOneFees + +▸ **getOptimismLayerOneFees**(`txn?`): `Promise`<``null`` \| `Wei`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txn?` | `TransactionRequest` | + +#### Returns + +`Promise`<``null`` \| `Wei`\> + +#### Defined in + +[packages/sdk/src/services/transactions.ts:132](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L132) + +___ + +### hash + +▸ **hash**(`transactionHash`): [`Emitter`](../interfaces/types_transactions.Emitter.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `transactionHash` | `string` | + +#### Returns + +[`Emitter`](../interfaces/types_transactions.Emitter.md) + +#### Defined in + +[packages/sdk/src/services/transactions.ts:34](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L34) + +___ + +### watchTransaction + +▸ **watchTransaction**(`transactionHash`, `emitter`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `transactionHash` | `string` | +| `emitter` | [`Emitter`](../interfaces/types_transactions.Emitter.md) | + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/src/services/transactions.ts:40](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/services/transactions.ts#L40) diff --git a/packages/sdk/docs/classes/types.PerpsV2Market__factory.md b/packages/sdk/docs/classes/types.PerpsV2Market__factory.md new file mode 100644 index 0000000000..5bcc085c6e --- /dev/null +++ b/packages/sdk/docs/classes/types.PerpsV2Market__factory.md @@ -0,0 +1,71 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / PerpsV2Market\_\_factory + +# Class: PerpsV2Market\_\_factory + +[types](../modules/types.md).PerpsV2Market__factory + +## Table of contents + +### Constructors + +- [constructor](types.PerpsV2Market__factory.md#constructor) + +### Properties + +- [abi](types.PerpsV2Market__factory.md#abi) + +### Methods + +- [connect](types.PerpsV2Market__factory.md#connect) +- [createInterface](types.PerpsV2Market__factory.md#createinterface) + +## Constructors + +### constructor + +• **new PerpsV2Market__factory**() + +## Properties + +### abi + +▪ `Static` `Readonly` **abi**: readonly [{ `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``true`` = true; `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"bool"`` = "bool"; `name`: ``"isOffchain"`` = "isOffchain"; `type`: ``"bool"`` = "bool" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"currentRoundId"`` = "currentRoundId"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"targetRoundId"`` = "targetRoundId"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"commitDeposit"`` = "commitDeposit"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"keeperDeposit"`` = "keeperDeposit"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"DelayedOrderRemoved"`` = "DelayedOrderRemoved"; `type`: ``"event"`` = "event" }, { `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``true`` = true; `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"bool"`` = "bool"; `name`: ``"isOffchain"`` = "isOffchain"; `type`: ``"bool"`` = "bool" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"targetRoundId"`` = "targetRoundId"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"intentionTime"`` = "intentionTime"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"executableAtTime"`` = "executableAtTime"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"commitDeposit"`` = "commitDeposit"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"keeperDeposit"`` = "keeperDeposit"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"DelayedOrderSubmitted"`` = "DelayedOrderSubmitted"; `type`: ``"event"`` = "event" }, { `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"funding"`` = "funding"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"fundingRate"`` = "fundingRate"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"index"`` = "index"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"timestamp"`` = "timestamp"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"FundingRecomputed"`` = "FundingRecomputed"; `type`: ``"event"`` = "event" }, { `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``true`` = true; `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"marginDelta"`` = "marginDelta"; `type`: ``"int256"`` = "int256" }] ; `name`: ``"MarginTransferred"`` = "MarginTransferred"; `type`: ``"event"`` = "event" }, { `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``true`` = true; `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }, { `indexed`: ``false`` = false; `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"baseAsset"`` = "baseAsset"; `type`: ``"bytes32"`` = "bytes32" }, { `indexed`: ``false`` = false; `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"marketKey"`` = "marketKey"; `type`: ``"bytes32"`` = "bytes32" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"fee"`` = "fee"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"PerpsTracking"`` = "PerpsTracking"; `type`: ``"event"`` = "event" }, { `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"id"`` = "id"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"address"`` = "address"; `name`: ``"flagger"`` = "flagger"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"timestamp"`` = "timestamp"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"PositionFlagged"`` = "PositionFlagged"; `type`: ``"event"`` = "event" }, { `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"id"`` = "id"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"address"`` = "address"; `name`: ``"liquidator"`` = "liquidator"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"size"`` = "size"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"price"`` = "price"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"flaggerFee"`` = "flaggerFee"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"liquidatorFee"`` = "liquidatorFee"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"stakersFee"`` = "stakersFee"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"PositionLiquidated"`` = "PositionLiquidated"; `type`: ``"event"`` = "event" }, { `anonymous`: ``false`` = false; `inputs`: readonly [{ `indexed`: ``true`` = true; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"id"`` = "id"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``true`` = true; `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"margin"`` = "margin"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"size"`` = "size"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"tradeSize"`` = "tradeSize"; `type`: ``"int256"`` = "int256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"lastPrice"`` = "lastPrice"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"fundingIndex"`` = "fundingIndex"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"uint256"`` = "uint256"; `name`: ``"fee"`` = "fee"; `type`: ``"uint256"`` = "uint256" }, { `indexed`: ``false`` = false; `internalType`: ``"int256"`` = "int256"; `name`: ``"skew"`` = "skew"; `type`: ``"int256"`` = "int256" }] ; `name`: ``"PositionModified"`` = "PositionModified"; `type`: ``"event"`` = "event" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"accessibleMargin"`` = "accessibleMargin"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"marginAccessible"`` = "marginAccessible"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"accruedFunding"`` = "accruedFunding"; `outputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"funding"`` = "funding"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"assetPrice"`` = "assetPrice"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"price"`` = "price"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"baseAsset"`` = "baseAsset"; `outputs`: readonly [{ `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"key"`` = "key"; `type`: ``"bytes32"`` = "bytes32" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"canLiquidate"`` = "canLiquidate"; `outputs`: readonly [{ `internalType`: ``"bool"`` = "bool"; `name`: ``""`` = ""; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"cancelDelayedOrder"`` = "cancelDelayedOrder"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"cancelOffchainDelayedOrder"`` = "cancelOffchainDelayedOrder"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"closePosition"`` = "closePosition"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"closePositionWithTracking"`` = "closePositionWithTracking"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"currentFundingRate"`` = "currentFundingRate"; `outputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"fundingRate"`` = "fundingRate"; `type`: ``"int256"`` = "int256" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"currentFundingVelocity"`` = "currentFundingVelocity"; `outputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"fundingVelocity"`` = "fundingVelocity"; `type`: ``"int256"`` = "int256" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"delayedOrders"`` = "delayedOrders"; `outputs`: readonly [{ `components`: readonly [{ `internalType`: ``"bool"`` = "bool"; `name`: ``"isOffchain"`` = "isOffchain"; `type`: ``"bool"`` = "bool" }, { `internalType`: ``"int128"`` = "int128"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int128"`` = "int128" }, { `internalType`: ``"uint128"`` = "uint128"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint128"`` = "uint128" }, { `internalType`: ``"uint128"`` = "uint128"; `name`: ``"targetRoundId"`` = "targetRoundId"; `type`: ``"uint128"`` = "uint128" }, { `internalType`: ``"uint128"`` = "uint128"; `name`: ``"commitDeposit"`` = "commitDeposit"; `type`: ``"uint128"`` = "uint128" }, { `internalType`: ``"uint128"`` = "uint128"; `name`: ``"keeperDeposit"`` = "keeperDeposit"; `type`: ``"uint128"`` = "uint128" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"executableAtTime"`` = "executableAtTime"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"intentionTime"`` = "intentionTime"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `internalType`: ``"struct IPerpsV2MarketConsolidated.DelayedOrder"`` = "struct IPerpsV2MarketConsolidated.DelayedOrder"; `name`: ``""`` = ""; `type`: ``"tuple"`` = "tuple" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"executeDelayedOrder"`` = "executeDelayedOrder"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }, { `internalType`: ``"bytes[]"`` = "bytes[]"; `name`: ``"priceUpdateData"`` = "priceUpdateData"; `type`: ``"bytes[]"`` = "bytes[]" }] ; `name`: ``"executeOffchainDelayedOrder"`` = "executeOffchainDelayedOrder"; `outputs`: readonly [] = []; `payable`: ``true`` = true; `stateMutability`: ``"payable"`` = "payable"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }] ; `name`: ``"fillPrice"`` = "fillPrice"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"price"`` = "price"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"flagPosition"`` = "flagPosition"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"forceLiquidatePosition"`` = "forceLiquidatePosition"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"fundingLastRecomputed"`` = "fundingLastRecomputed"; `outputs`: readonly [{ `internalType`: ``"uint32"`` = "uint32"; `name`: ``"timestamp"`` = "timestamp"; `type`: ``"uint32"`` = "uint32" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"fundingRateLastRecomputed"`` = "fundingRateLastRecomputed"; `outputs`: readonly [{ `internalType`: ``"int128"`` = "int128"; `name`: ``"fundingRate"`` = "fundingRate"; `type`: ``"int128"`` = "int128" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"index"`` = "index"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"fundingSequence"`` = "fundingSequence"; `outputs`: readonly [{ `internalType`: ``"int128"`` = "int128"; `name`: ``"netFunding"`` = "netFunding"; `type`: ``"int128"`` = "int128" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"fundingSequenceLength"`` = "fundingSequenceLength"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"length"`` = "length"; `type`: ``"uint256"`` = "uint256" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"isFlagged"`` = "isFlagged"; `outputs`: readonly [{ `internalType`: ``"bool"`` = "bool"; `name`: ``""`` = ""; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"liquidatePosition"`` = "liquidatePosition"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"liquidationFee"`` = "liquidationFee"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``""`` = ""; `type`: ``"uint256"`` = "uint256" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"liquidationPrice"`` = "liquidationPrice"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"price"`` = "price"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"marketDebt"`` = "marketDebt"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"debt"`` = "debt"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"isInvalid"`` = "isInvalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"marketKey"`` = "marketKey"; `outputs`: readonly [{ `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"key"`` = "key"; `type`: ``"bytes32"`` = "bytes32" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"marketSize"`` = "marketSize"; `outputs`: readonly [{ `internalType`: ``"uint128"`` = "uint128"; `name`: ``"size"`` = "size"; `type`: ``"uint128"`` = "uint128" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"marketSizes"`` = "marketSizes"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"long"`` = "long"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"short"`` = "short"; `type`: ``"uint256"`` = "uint256" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"marketSkew"`` = "marketSkew"; `outputs`: readonly [{ `internalType`: ``"int128"`` = "int128"; `name`: ``"skew"`` = "skew"; `type`: ``"int128"`` = "int128" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"modifyPosition"`` = "modifyPosition"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"modifyPositionWithTracking"`` = "modifyPositionWithTracking"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"notionalValue"`` = "notionalValue"; `outputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"value"`` = "value"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"enum IPerpsV2MarketBaseTypes.OrderType"`` = "enum IPerpsV2MarketBaseTypes.OrderType"; `name`: ``"orderType"`` = "orderType"; `type`: ``"uint8"`` = "uint8" }] ; `name`: ``"orderFee"`` = "orderFee"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"fee"`` = "fee"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"positions"`` = "positions"; `outputs`: readonly [{ `components`: readonly [{ `internalType`: ``"uint64"`` = "uint64"; `name`: ``"id"`` = "id"; `type`: ``"uint64"`` = "uint64" }, { `internalType`: ``"uint64"`` = "uint64"; `name`: ``"lastFundingIndex"`` = "lastFundingIndex"; `type`: ``"uint64"`` = "uint64" }, { `internalType`: ``"uint128"`` = "uint128"; `name`: ``"margin"`` = "margin"; `type`: ``"uint128"`` = "uint128" }, { `internalType`: ``"uint128"`` = "uint128"; `name`: ``"lastPrice"`` = "lastPrice"; `type`: ``"uint128"`` = "uint128" }, { `internalType`: ``"int128"`` = "int128"; `name`: ``"size"`` = "size"; `type`: ``"int128"`` = "int128" }] ; `internalType`: ``"struct IPerpsV2MarketConsolidated.Position"`` = "struct IPerpsV2MarketConsolidated.Position"; `name`: ``""`` = ""; `type`: ``"tuple"`` = "tuple" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"tradePrice"`` = "tradePrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"enum IPerpsV2MarketBaseTypes.OrderType"`` = "enum IPerpsV2MarketBaseTypes.OrderType"; `name`: ``"orderType"`` = "orderType"; `type`: ``"uint8"`` = "uint8" }, { `internalType`: ``"address"`` = "address"; `name`: ``"sender"`` = "sender"; `type`: ``"address"`` = "address" }] ; `name`: ``"postTradeDetails"`` = "postTradeDetails"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"margin"`` = "margin"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"int256"`` = "int256"; `name`: ``"size"`` = "size"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"price"`` = "price"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"liqPrice"`` = "liqPrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"fee"`` = "fee"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"enum IPerpsV2MarketConsolidated.Status"`` = "enum IPerpsV2MarketConsolidated.Status"; `name`: ``"status"`` = "status"; `type`: ``"uint8"`` = "uint8" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"profitLoss"`` = "profitLoss"; `outputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"pnl"`` = "pnl"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [] = []; `name`: ``"recomputeFunding"`` = "recomputeFunding"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"lastIndex"`` = "lastIndex"; `type`: ``"uint256"`` = "uint256" }] ; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [{ `internalType`: ``"address"`` = "address"; `name`: ``"account"`` = "account"; `type`: ``"address"`` = "address" }] ; `name`: ``"remainingMargin"`` = "remainingMargin"; `outputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"marginRemaining"`` = "marginRemaining"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredTimeDelta"`` = "desiredTimeDelta"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"submitCloseDelayedOrderWithTracking"`` = "submitCloseDelayedOrderWithTracking"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"submitCloseOffchainDelayedOrderWithTracking"`` = "submitCloseOffchainDelayedOrderWithTracking"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredTimeDelta"`` = "desiredTimeDelta"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"submitDelayedOrder"`` = "submitDelayedOrder"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredTimeDelta"`` = "desiredTimeDelta"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"submitDelayedOrderWithTracking"`` = "submitDelayedOrderWithTracking"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }] ; `name`: ``"submitOffchainDelayedOrder"`` = "submitOffchainDelayedOrder"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"sizeDelta"`` = "sizeDelta"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"uint256"`` = "uint256"; `name`: ``"desiredFillPrice"`` = "desiredFillPrice"; `type`: ``"uint256"`` = "uint256" }, { `internalType`: ``"bytes32"`` = "bytes32"; `name`: ``"trackingCode"`` = "trackingCode"; `type`: ``"bytes32"`` = "bytes32" }] ; `name`: ``"submitOffchainDelayedOrderWithTracking"`` = "submitOffchainDelayedOrderWithTracking"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"marginDelta"`` = "marginDelta"; `type`: ``"int256"`` = "int256" }] ; `name`: ``"transferMargin"`` = "transferMargin"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }, { `constant`: ``true`` = true; `inputs`: readonly [] = []; `name`: ``"unrecordedFunding"`` = "unrecordedFunding"; `outputs`: readonly [{ `internalType`: ``"int256"`` = "int256"; `name`: ``"funding"`` = "funding"; `type`: ``"int256"`` = "int256" }, { `internalType`: ``"bool"`` = "bool"; `name`: ``"invalid"`` = "invalid"; `type`: ``"bool"`` = "bool" }] ; `payable`: ``false`` = false; `stateMutability`: ``"view"`` = "view"; `type`: ``"function"`` = "function" }, { `constant`: ``false`` = false; `inputs`: readonly [] = []; `name`: ``"withdrawAllMargin"`` = "withdrawAllMargin"; `outputs`: readonly [] = []; `payable`: ``false`` = false; `stateMutability`: ``"nonpayable"`` = "nonpayable"; `type`: ``"function"`` = "function" }] = `_abi` + +#### Defined in + +[packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts:1426](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts#L1426) + +## Methods + +### connect + +▸ `Static` **connect**(`address`, `signerOrProvider`): [`PerpsV2Market`](../interfaces/types.PerpsV2Market.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `string` | +| `signerOrProvider` | `Provider` \| `Signer` | + +#### Returns + +[`PerpsV2Market`](../interfaces/types.PerpsV2Market.md) + +#### Defined in + +[packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts:1430](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts#L1430) + +___ + +### createInterface + +▸ `Static` **createInterface**(): `PerpsV2MarketInterface` + +#### Returns + +`PerpsV2MarketInterface` + +#### Defined in + +[packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts:1427](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts#L1427) diff --git a/packages/sdk/docs/enums/types_common.TransactionStatus.md b/packages/sdk/docs/enums/types_common.TransactionStatus.md new file mode 100644 index 0000000000..1a07757805 --- /dev/null +++ b/packages/sdk/docs/enums/types_common.TransactionStatus.md @@ -0,0 +1,54 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/common](../modules/types_common.md) / TransactionStatus + +# Enumeration: TransactionStatus + +[types/common](../modules/types_common.md).TransactionStatus + +## Table of contents + +### Enumeration Members + +- [AwaitingExecution](types_common.TransactionStatus.md#awaitingexecution) +- [Confirmed](types_common.TransactionStatus.md#confirmed) +- [Executed](types_common.TransactionStatus.md#executed) +- [Failed](types_common.TransactionStatus.md#failed) + +## Enumeration Members + +### AwaitingExecution + +• **AwaitingExecution** = ``"AwaitingExecution"`` + +#### Defined in + +[packages/sdk/src/types/common.ts:13](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L13) + +___ + +### Confirmed + +• **Confirmed** = ``"Confirmed"`` + +#### Defined in + +[packages/sdk/src/types/common.ts:15](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L15) + +___ + +### Executed + +• **Executed** = ``"Executed"`` + +#### Defined in + +[packages/sdk/src/types/common.ts:14](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L14) + +___ + +### Failed + +• **Failed** = ``"Failed"`` + +#### Defined in + +[packages/sdk/src/types/common.ts:16](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L16) diff --git a/packages/sdk/docs/enums/types_futures.AccountExecuteFunctions.md b/packages/sdk/docs/enums/types_futures.AccountExecuteFunctions.md new file mode 100644 index 0000000000..10a72f540e --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.AccountExecuteFunctions.md @@ -0,0 +1,164 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / AccountExecuteFunctions + +# Enumeration: AccountExecuteFunctions + +[types/futures](../modules/types_futures.md).AccountExecuteFunctions + +## Table of contents + +### Enumeration Members + +- [ACCOUNT\_MODIFY\_MARGIN](types_futures.AccountExecuteFunctions.md#account_modify_margin) +- [ACCOUNT\_WITHDRAW\_ETH](types_futures.AccountExecuteFunctions.md#account_withdraw_eth) +- [GELATO\_CANCEL\_CONDITIONAL\_ORDER](types_futures.AccountExecuteFunctions.md#gelato_cancel_conditional_order) +- [GELATO\_PLACE\_CONDITIONAL\_ORDER](types_futures.AccountExecuteFunctions.md#gelato_place_conditional_order) +- [PERPS\_V2\_CANCEL\_DELAYED\_ORDER](types_futures.AccountExecuteFunctions.md#perps_v2_cancel_delayed_order) +- [PERPS\_V2\_CANCEL\_OFFCHAIN\_DELAYED\_ORDER](types_futures.AccountExecuteFunctions.md#perps_v2_cancel_offchain_delayed_order) +- [PERPS\_V2\_CLOSE\_POSITION](types_futures.AccountExecuteFunctions.md#perps_v2_close_position) +- [PERPS\_V2\_MODIFY\_MARGIN](types_futures.AccountExecuteFunctions.md#perps_v2_modify_margin) +- [PERPS\_V2\_SUBMIT\_ATOMIC\_ORDER](types_futures.AccountExecuteFunctions.md#perps_v2_submit_atomic_order) +- [PERPS\_V2\_SUBMIT\_CLOSE\_DELAYED\_ORDER](types_futures.AccountExecuteFunctions.md#perps_v2_submit_close_delayed_order) +- [PERPS\_V2\_SUBMIT\_CLOSE\_OFFCHAIN\_DELAYED\_ORDER](types_futures.AccountExecuteFunctions.md#perps_v2_submit_close_offchain_delayed_order) +- [PERPS\_V2\_SUBMIT\_DELAYED\_ORDER](types_futures.AccountExecuteFunctions.md#perps_v2_submit_delayed_order) +- [PERPS\_V2\_SUBMIT\_OFFCHAIN\_DELAYED\_ORDER](types_futures.AccountExecuteFunctions.md#perps_v2_submit_offchain_delayed_order) +- [PERPS\_V2\_WITHDRAW\_ALL\_MARGIN](types_futures.AccountExecuteFunctions.md#perps_v2_withdraw_all_margin) + +## Enumeration Members + +### ACCOUNT\_MODIFY\_MARGIN + +• **ACCOUNT\_MODIFY\_MARGIN** = ``0`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:423](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L423) + +___ + +### ACCOUNT\_WITHDRAW\_ETH + +• **ACCOUNT\_WITHDRAW\_ETH** = ``1`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:424](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L424) + +___ + +### GELATO\_CANCEL\_CONDITIONAL\_ORDER + +• **GELATO\_CANCEL\_CONDITIONAL\_ORDER** = ``13`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:436](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L436) + +___ + +### GELATO\_PLACE\_CONDITIONAL\_ORDER + +• **GELATO\_PLACE\_CONDITIONAL\_ORDER** = ``12`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:435](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L435) + +___ + +### PERPS\_V2\_CANCEL\_DELAYED\_ORDER + +• **PERPS\_V2\_CANCEL\_DELAYED\_ORDER** = ``10`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:433](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L433) + +___ + +### PERPS\_V2\_CANCEL\_OFFCHAIN\_DELAYED\_ORDER + +• **PERPS\_V2\_CANCEL\_OFFCHAIN\_DELAYED\_ORDER** = ``11`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:434](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L434) + +___ + +### PERPS\_V2\_CLOSE\_POSITION + +• **PERPS\_V2\_CLOSE\_POSITION** = ``7`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:430](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L430) + +___ + +### PERPS\_V2\_MODIFY\_MARGIN + +• **PERPS\_V2\_MODIFY\_MARGIN** = ``2`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:425](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L425) + +___ + +### PERPS\_V2\_SUBMIT\_ATOMIC\_ORDER + +• **PERPS\_V2\_SUBMIT\_ATOMIC\_ORDER** = ``4`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:427](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L427) + +___ + +### PERPS\_V2\_SUBMIT\_CLOSE\_DELAYED\_ORDER + +• **PERPS\_V2\_SUBMIT\_CLOSE\_DELAYED\_ORDER** = ``8`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:431](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L431) + +___ + +### PERPS\_V2\_SUBMIT\_CLOSE\_OFFCHAIN\_DELAYED\_ORDER + +• **PERPS\_V2\_SUBMIT\_CLOSE\_OFFCHAIN\_DELAYED\_ORDER** = ``9`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:432](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L432) + +___ + +### PERPS\_V2\_SUBMIT\_DELAYED\_ORDER + +• **PERPS\_V2\_SUBMIT\_DELAYED\_ORDER** = ``5`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:428](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L428) + +___ + +### PERPS\_V2\_SUBMIT\_OFFCHAIN\_DELAYED\_ORDER + +• **PERPS\_V2\_SUBMIT\_OFFCHAIN\_DELAYED\_ORDER** = ``6`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:429](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L429) + +___ + +### PERPS\_V2\_WITHDRAW\_ALL\_MARGIN + +• **PERPS\_V2\_WITHDRAW\_ALL\_MARGIN** = ``3`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:426](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L426) diff --git a/packages/sdk/docs/enums/types_futures.ConditionalOrderTypeEnum.md b/packages/sdk/docs/enums/types_futures.ConditionalOrderTypeEnum.md new file mode 100644 index 0000000000..c1b8382b51 --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.ConditionalOrderTypeEnum.md @@ -0,0 +1,32 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / ConditionalOrderTypeEnum + +# Enumeration: ConditionalOrderTypeEnum + +[types/futures](../modules/types_futures.md).ConditionalOrderTypeEnum + +## Table of contents + +### Enumeration Members + +- [LIMIT](types_futures.ConditionalOrderTypeEnum.md#limit) +- [STOP](types_futures.ConditionalOrderTypeEnum.md#stop) + +## Enumeration Members + +### LIMIT + +• **LIMIT** = ``0`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:309](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L309) + +___ + +### STOP + +• **STOP** = ``1`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:310](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L310) diff --git a/packages/sdk/docs/enums/types_futures.ContractOrderType.md b/packages/sdk/docs/enums/types_futures.ContractOrderType.md new file mode 100644 index 0000000000..5b5dd08286 --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.ContractOrderType.md @@ -0,0 +1,43 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / ContractOrderType + +# Enumeration: ContractOrderType + +[types/futures](../modules/types_futures.md).ContractOrderType + +## Table of contents + +### Enumeration Members + +- [DELAYED](types_futures.ContractOrderType.md#delayed) +- [DELAYED\_OFFCHAIN](types_futures.ContractOrderType.md#delayed_offchain) +- [MARKET](types_futures.ContractOrderType.md#market) + +## Enumeration Members + +### DELAYED + +• **DELAYED** = ``1`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:219](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L219) + +___ + +### DELAYED\_OFFCHAIN + +• **DELAYED\_OFFCHAIN** = ``2`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:220](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L220) + +___ + +### MARKET + +• **MARKET** = ``0`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:218](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L218) diff --git a/packages/sdk/docs/enums/types_futures.FuturesMarginType.md b/packages/sdk/docs/enums/types_futures.FuturesMarginType.md new file mode 100644 index 0000000000..1a55d120e7 --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.FuturesMarginType.md @@ -0,0 +1,43 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / FuturesMarginType + +# Enumeration: FuturesMarginType + +[types/futures](../modules/types_futures.md).FuturesMarginType + +## Table of contents + +### Enumeration Members + +- [CROSS\_MARGIN](types_futures.FuturesMarginType.md#cross_margin) +- [ISOLATED\_MARGIN\_LEGACY](types_futures.FuturesMarginType.md#isolated_margin_legacy) +- [SMART\_MARGIN](types_futures.FuturesMarginType.md#smart_margin) + +## Enumeration Members + +### CROSS\_MARGIN + +• **CROSS\_MARGIN** = ``"cross_margin"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:213](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L213) + +___ + +### ISOLATED\_MARGIN\_LEGACY + +• **ISOLATED\_MARGIN\_LEGACY** = ``"isolated_margin_legacy"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:214](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L214) + +___ + +### SMART\_MARGIN + +• **SMART\_MARGIN** = ``"smart_margin"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:212](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L212) diff --git a/packages/sdk/docs/enums/types_futures.FuturesMarketAsset.md b/packages/sdk/docs/enums/types_futures.FuturesMarketAsset.md new file mode 100644 index 0000000000..8fbb16e067 --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.FuturesMarketAsset.md @@ -0,0 +1,472 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / FuturesMarketAsset + +# Enumeration: FuturesMarketAsset + +[types/futures](../modules/types_futures.md).FuturesMarketAsset + +## Table of contents + +### Enumeration Members + +- [AAVE](types_futures.FuturesMarketAsset.md#aave) +- [ADA](types_futures.FuturesMarketAsset.md#ada) +- [APE](types_futures.FuturesMarketAsset.md#ape) +- [APT](types_futures.FuturesMarketAsset.md#apt) +- [ARB](types_futures.FuturesMarketAsset.md#arb) +- [ATOM](types_futures.FuturesMarketAsset.md#atom) +- [AUD](types_futures.FuturesMarketAsset.md#aud) +- [AVAX](types_futures.FuturesMarketAsset.md#avax) +- [AXS](types_futures.FuturesMarketAsset.md#axs) +- [BCH](types_futures.FuturesMarketAsset.md#bch) +- [BLUR](types_futures.FuturesMarketAsset.md#blur) +- [BNB](types_futures.FuturesMarketAsset.md#bnb) +- [CRV](types_futures.FuturesMarketAsset.md#crv) +- [DOGE](types_futures.FuturesMarketAsset.md#doge) +- [DOT](types_futures.FuturesMarketAsset.md#dot) +- [DYDX](types_futures.FuturesMarketAsset.md#dydx) +- [EUR](types_futures.FuturesMarketAsset.md#eur) +- [FIL](types_futures.FuturesMarketAsset.md#fil) +- [FLOKI](types_futures.FuturesMarketAsset.md#floki) +- [FLOW](types_futures.FuturesMarketAsset.md#flow) +- [FTM](types_futures.FuturesMarketAsset.md#ftm) +- [GBP](types_futures.FuturesMarketAsset.md#gbp) +- [GMX](types_futures.FuturesMarketAsset.md#gmx) +- [INJ](types_futures.FuturesMarketAsset.md#inj) +- [LDO](types_futures.FuturesMarketAsset.md#ldo) +- [LINK](types_futures.FuturesMarketAsset.md#link) +- [LTC](types_futures.FuturesMarketAsset.md#ltc) +- [MATIC](types_futures.FuturesMarketAsset.md#matic) +- [NEAR](types_futures.FuturesMarketAsset.md#near) +- [OP](types_futures.FuturesMarketAsset.md#op) +- [PEPE](types_futures.FuturesMarketAsset.md#pepe) +- [SHIB](types_futures.FuturesMarketAsset.md#shib) +- [SOL](types_futures.FuturesMarketAsset.md#sol) +- [STETH](types_futures.FuturesMarketAsset.md#steth) +- [SUI](types_futures.FuturesMarketAsset.md#sui) +- [TRX](types_futures.FuturesMarketAsset.md#trx) +- [UNI](types_futures.FuturesMarketAsset.md#uni) +- [XAG](types_futures.FuturesMarketAsset.md#xag) +- [XAU](types_futures.FuturesMarketAsset.md#xau) +- [XRP](types_futures.FuturesMarketAsset.md#xrp) +- [sBTC](types_futures.FuturesMarketAsset.md#sbtc) +- [sETH](types_futures.FuturesMarketAsset.md#seth) + +## Enumeration Members + +### AAVE + +• **AAVE** = ``"AAVE"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:127](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L127) + +___ + +### ADA + +• **ADA** = ``"ADA"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:146](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L146) + +___ + +### APE + +• **APE** = ``"APE"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:133](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L133) + +___ + +### APT + +• **APT** = ``"APT"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:147](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L147) + +___ + +### ARB + +• **ARB** = ``"ARB"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:138](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L138) + +___ + +### ATOM + +• **ATOM** = ``"ATOM"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:139](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L139) + +___ + +### AUD + +• **AUD** = ``"AUD"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:144](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L144) + +___ + +### AVAX + +• **AVAX** = ``"AVAX"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:126](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L126) + +___ + +### AXS + +• **AXS** = ``"AXS"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:143](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L143) + +___ + +### BCH + +• **BCH** = ``"BCH"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:148](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L148) + +___ + +### BLUR + +• **BLUR** = ``"BLUR"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:157](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L157) + +___ + +### BNB + +• **BNB** = ``"BNB"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:135](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L135) + +___ + +### CRV + +• **CRV** = ``"CRV"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:149](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L149) + +___ + +### DOGE + +• **DOGE** = ``"DOGE"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:136](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L136) + +___ + +### DOT + +• **DOT** = ``"DOT"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:159](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L159) + +___ + +### DYDX + +• **DYDX** = ``"DYDX"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:134](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L134) + +___ + +### EUR + +• **EUR** = ``"EUR"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:132](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L132) + +___ + +### FIL + +• **FIL** = ``"FIL"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:150](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L150) + +___ + +### FLOKI + +• **FLOKI** = ``"FLOKI"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:161](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L161) + +___ + +### FLOW + +• **FLOW** = ``"FLOW"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:142](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L142) + +___ + +### FTM + +• **FTM** = ``"FTM"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:140](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L140) + +___ + +### GBP + +• **GBP** = ``"GBP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:145](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L145) + +___ + +### GMX + +• **GMX** = ``"GMX"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:151](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L151) + +___ + +### INJ + +• **INJ** = ``"INJ"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:162](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L162) + +___ + +### LDO + +• **LDO** = ``"LDO"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:152](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L152) + +___ + +### LINK + +• **LINK** = ``"LINK"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:124](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L124) + +___ + +### LTC + +• **LTC** = ``"LTC"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:153](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L153) + +___ + +### MATIC + +• **MATIC** = ``"MATIC"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:129](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L129) + +___ + +### NEAR + +• **NEAR** = ``"NEAR"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:141](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L141) + +___ + +### OP + +• **OP** = ``"OP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:137](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L137) + +___ + +### PEPE + +• **PEPE** = ``"PEPE"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:156](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L156) + +___ + +### SHIB + +• **SHIB** = ``"SHIB"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:154](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L154) + +___ + +### SOL + +• **SOL** = ``"SOL"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:125](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L125) + +___ + +### STETH + +• **STETH** = ``"STETH"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:163](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L163) + +___ + +### SUI + +• **SUI** = ``"SUI"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:155](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L155) + +___ + +### TRX + +• **TRX** = ``"TRX"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:160](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L160) + +___ + +### UNI + +• **UNI** = ``"UNI"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:128](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L128) + +___ + +### XAG + +• **XAG** = ``"XAG"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:131](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L131) + +___ + +### XAU + +• **XAU** = ``"XAU"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:130](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L130) + +___ + +### XRP + +• **XRP** = ``"XRP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:158](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L158) + +___ + +### sBTC + +• **sBTC** = ``"sBTC"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:122](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L122) + +___ + +### sETH + +• **sETH** = ``"sETH"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:123](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L123) diff --git a/packages/sdk/docs/enums/types_futures.FuturesMarketKey.md b/packages/sdk/docs/enums/types_futures.FuturesMarketKey.md new file mode 100644 index 0000000000..e94e587d22 --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.FuturesMarketKey.md @@ -0,0 +1,472 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / FuturesMarketKey + +# Enumeration: FuturesMarketKey + +[types/futures](../modules/types_futures.md).FuturesMarketKey + +## Table of contents + +### Enumeration Members + +- [sAAVEPERP](types_futures.FuturesMarketKey.md#saaveperp) +- [sADAPERP](types_futures.FuturesMarketKey.md#sadaperp) +- [sAPEPERP](types_futures.FuturesMarketKey.md#sapeperp) +- [sAPTPERP](types_futures.FuturesMarketKey.md#saptperp) +- [sARBPERP](types_futures.FuturesMarketKey.md#sarbperp) +- [sATOMPERP](types_futures.FuturesMarketKey.md#satomperp) +- [sAUDPERP](types_futures.FuturesMarketKey.md#saudperp) +- [sAVAXPERP](types_futures.FuturesMarketKey.md#savaxperp) +- [sAXSPERP](types_futures.FuturesMarketKey.md#saxsperp) +- [sBCHPERP](types_futures.FuturesMarketKey.md#sbchperp) +- [sBLURPERP](types_futures.FuturesMarketKey.md#sblurperp) +- [sBNBPERP](types_futures.FuturesMarketKey.md#sbnbperp) +- [sBTCPERP](types_futures.FuturesMarketKey.md#sbtcperp) +- [sCRVPERP](types_futures.FuturesMarketKey.md#scrvperp) +- [sDOGEPERP](types_futures.FuturesMarketKey.md#sdogeperp) +- [sDOTPERP](types_futures.FuturesMarketKey.md#sdotperp) +- [sDYDXPERP](types_futures.FuturesMarketKey.md#sdydxperp) +- [sETHPERP](types_futures.FuturesMarketKey.md#sethperp) +- [sEURPERP](types_futures.FuturesMarketKey.md#seurperp) +- [sFILPERP](types_futures.FuturesMarketKey.md#sfilperp) +- [sFLOKIPERP](types_futures.FuturesMarketKey.md#sflokiperp) +- [sFLOWPERP](types_futures.FuturesMarketKey.md#sflowperp) +- [sFTMPERP](types_futures.FuturesMarketKey.md#sftmperp) +- [sGBPPERP](types_futures.FuturesMarketKey.md#sgbpperp) +- [sGMXPERP](types_futures.FuturesMarketKey.md#sgmxperp) +- [sINJPERP](types_futures.FuturesMarketKey.md#sinjperp) +- [sLDOPERP](types_futures.FuturesMarketKey.md#sldoperp) +- [sLINKPERP](types_futures.FuturesMarketKey.md#slinkperp) +- [sLTCPERP](types_futures.FuturesMarketKey.md#sltcperp) +- [sMATICPERP](types_futures.FuturesMarketKey.md#smaticperp) +- [sNEARPERP](types_futures.FuturesMarketKey.md#snearperp) +- [sOPPERP](types_futures.FuturesMarketKey.md#sopperp) +- [sPEPEPERP](types_futures.FuturesMarketKey.md#spepeperp) +- [sSHIBPERP](types_futures.FuturesMarketKey.md#sshibperp) +- [sSOLPERP](types_futures.FuturesMarketKey.md#ssolperp) +- [sSTETHPERP](types_futures.FuturesMarketKey.md#sstethperp) +- [sSUIPERP](types_futures.FuturesMarketKey.md#ssuiperp) +- [sTRXPERP](types_futures.FuturesMarketKey.md#strxperp) +- [sUNIPERP](types_futures.FuturesMarketKey.md#suniperp) +- [sXAGPERP](types_futures.FuturesMarketKey.md#sxagperp) +- [sXAUPERP](types_futures.FuturesMarketKey.md#sxauperp) +- [sXRPPERP](types_futures.FuturesMarketKey.md#sxrpperp) + +## Enumeration Members + +### sAAVEPERP + +• **sAAVEPERP** = ``"sAAVEPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:82](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L82) + +___ + +### sADAPERP + +• **sADAPERP** = ``"sADAPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:101](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L101) + +___ + +### sAPEPERP + +• **sAPEPERP** = ``"sAPEPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:88](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L88) + +___ + +### sAPTPERP + +• **sAPTPERP** = ``"sAPTPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:102](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L102) + +___ + +### sARBPERP + +• **sARBPERP** = ``"sARBPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:93](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L93) + +___ + +### sATOMPERP + +• **sATOMPERP** = ``"sATOMPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:94](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L94) + +___ + +### sAUDPERP + +• **sAUDPERP** = ``"sAUDPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:99](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L99) + +___ + +### sAVAXPERP + +• **sAVAXPERP** = ``"sAVAXPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:81](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L81) + +___ + +### sAXSPERP + +• **sAXSPERP** = ``"sAXSPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:98](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L98) + +___ + +### sBCHPERP + +• **sBCHPERP** = ``"sBCHPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:103](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L103) + +___ + +### sBLURPERP + +• **sBLURPERP** = ``"sBLURPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:112](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L112) + +___ + +### sBNBPERP + +• **sBNBPERP** = ``"sBNBPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:90](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L90) + +___ + +### sBTCPERP + +• **sBTCPERP** = ``"sBTCPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:77](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L77) + +___ + +### sCRVPERP + +• **sCRVPERP** = ``"sCRVPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:104](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L104) + +___ + +### sDOGEPERP + +• **sDOGEPERP** = ``"sDOGEPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:91](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L91) + +___ + +### sDOTPERP + +• **sDOTPERP** = ``"sDOTPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:114](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L114) + +___ + +### sDYDXPERP + +• **sDYDXPERP** = ``"sDYDXPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:89](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L89) + +___ + +### sETHPERP + +• **sETHPERP** = ``"sETHPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:78](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L78) + +___ + +### sEURPERP + +• **sEURPERP** = ``"sEURPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:87](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L87) + +___ + +### sFILPERP + +• **sFILPERP** = ``"sFILPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:105](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L105) + +___ + +### sFLOKIPERP + +• **sFLOKIPERP** = ``"sFLOKIPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:116](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L116) + +___ + +### sFLOWPERP + +• **sFLOWPERP** = ``"sFLOWPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:97](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L97) + +___ + +### sFTMPERP + +• **sFTMPERP** = ``"sFTMPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:95](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L95) + +___ + +### sGBPPERP + +• **sGBPPERP** = ``"sGBPPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:100](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L100) + +___ + +### sGMXPERP + +• **sGMXPERP** = ``"sGMXPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:106](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L106) + +___ + +### sINJPERP + +• **sINJPERP** = ``"sINJPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:117](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L117) + +___ + +### sLDOPERP + +• **sLDOPERP** = ``"sLDOPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:107](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L107) + +___ + +### sLINKPERP + +• **sLINKPERP** = ``"sLINKPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:79](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L79) + +___ + +### sLTCPERP + +• **sLTCPERP** = ``"sLTCPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:108](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L108) + +___ + +### sMATICPERP + +• **sMATICPERP** = ``"sMATICPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:84](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L84) + +___ + +### sNEARPERP + +• **sNEARPERP** = ``"sNEARPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:96](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L96) + +___ + +### sOPPERP + +• **sOPPERP** = ``"sOPPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:92](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L92) + +___ + +### sPEPEPERP + +• **sPEPEPERP** = ``"sPEPEPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:111](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L111) + +___ + +### sSHIBPERP + +• **sSHIBPERP** = ``"sSHIBPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:109](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L109) + +___ + +### sSOLPERP + +• **sSOLPERP** = ``"sSOLPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:80](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L80) + +___ + +### sSTETHPERP + +• **sSTETHPERP** = ``"sSTETHPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:118](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L118) + +___ + +### sSUIPERP + +• **sSUIPERP** = ``"sSUIPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:110](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L110) + +___ + +### sTRXPERP + +• **sTRXPERP** = ``"sTRXPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:115](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L115) + +___ + +### sUNIPERP + +• **sUNIPERP** = ``"sUNIPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:83](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L83) + +___ + +### sXAGPERP + +• **sXAGPERP** = ``"sXAGPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:86](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L86) + +___ + +### sXAUPERP + +• **sXAUPERP** = ``"sXAUPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:85](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L85) + +___ + +### sXRPPERP + +• **sXRPPERP** = ``"sXRPPERP"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:113](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L113) diff --git a/packages/sdk/docs/enums/types_futures.PositionSide.md b/packages/sdk/docs/enums/types_futures.PositionSide.md new file mode 100644 index 0000000000..0d42ad22a9 --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.PositionSide.md @@ -0,0 +1,32 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / PositionSide + +# Enumeration: PositionSide + +[types/futures](../modules/types_futures.md).PositionSide + +## Table of contents + +### Enumeration Members + +- [LONG](types_futures.PositionSide.md#long) +- [SHORT](types_futures.PositionSide.md#short) + +## Enumeration Members + +### LONG + +• **LONG** = ``"long"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:207](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L207) + +___ + +### SHORT + +• **SHORT** = ``"short"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:208](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L208) diff --git a/packages/sdk/docs/enums/types_futures.PotentialTradeStatus.md b/packages/sdk/docs/enums/types_futures.PotentialTradeStatus.md new file mode 100644 index 0000000000..61ec85a3d4 --- /dev/null +++ b/packages/sdk/docs/enums/types_futures.PotentialTradeStatus.md @@ -0,0 +1,175 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / PotentialTradeStatus + +# Enumeration: PotentialTradeStatus + +[types/futures](../modules/types_futures.md).PotentialTradeStatus + +## Table of contents + +### Enumeration Members + +- [CANNOT\_LIQUIDATE](types_futures.PotentialTradeStatus.md#cannot_liquidate) +- [CAN\_LIQUIDATE](types_futures.PotentialTradeStatus.md#can_liquidate) +- [INSUFFICIENT\_FREE\_MARGIN](types_futures.PotentialTradeStatus.md#insufficient_free_margin) +- [INSUFFICIENT\_MARGIN](types_futures.PotentialTradeStatus.md#insufficient_margin) +- [INVALID\_ORDER\_PRICE](types_futures.PotentialTradeStatus.md#invalid_order_price) +- [INVALID\_PRICE](types_futures.PotentialTradeStatus.md#invalid_price) +- [MAX\_LEVERAGE\_EXCEEDED](types_futures.PotentialTradeStatus.md#max_leverage_exceeded) +- [MAX\_MARKET\_SIZE\_EXCEEDED](types_futures.PotentialTradeStatus.md#max_market_size_exceeded) +- [NIL\_ORDER](types_futures.PotentialTradeStatus.md#nil_order) +- [NOT\_PERMITTED](types_futures.PotentialTradeStatus.md#not_permitted) +- [NO\_POSITION\_OPEN](types_futures.PotentialTradeStatus.md#no_position_open) +- [OK](types_futures.PotentialTradeStatus.md#ok) +- [PRICE\_IMPACT\_TOLERANCE\_EXCEEDED](types_futures.PotentialTradeStatus.md#price_impact_tolerance_exceeded) +- [PRICE\_OUT\_OF\_BOUNDS](types_futures.PotentialTradeStatus.md#price_out_of_bounds) +- [PRICE\_TOO\_VOLATILE](types_futures.PotentialTradeStatus.md#price_too_volatile) + +## Enumeration Members + +### CANNOT\_LIQUIDATE + +• **CANNOT\_LIQUIDATE** = ``5`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:377](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L377) + +___ + +### CAN\_LIQUIDATE + +• **CAN\_LIQUIDATE** = ``4`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:376](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L376) + +___ + +### INSUFFICIENT\_FREE\_MARGIN + +• **INSUFFICIENT\_FREE\_MARGIN** = ``100`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:388](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L388) + +___ + +### INSUFFICIENT\_MARGIN + +• **INSUFFICIENT\_MARGIN** = ``8`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:380](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L380) + +___ + +### INVALID\_ORDER\_PRICE + +• **INVALID\_ORDER\_PRICE** = ``2`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:374](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L374) + +___ + +### INVALID\_PRICE + +• **INVALID\_PRICE** = ``1`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:373](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L373) + +___ + +### MAX\_LEVERAGE\_EXCEEDED + +• **MAX\_LEVERAGE\_EXCEEDED** = ``7`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:379](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L379) + +___ + +### MAX\_MARKET\_SIZE\_EXCEEDED + +• **MAX\_MARKET\_SIZE\_EXCEEDED** = ``6`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:378](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L378) + +___ + +### NIL\_ORDER + +• **NIL\_ORDER** = ``10`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:382](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L382) + +___ + +### NOT\_PERMITTED + +• **NOT\_PERMITTED** = ``9`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:381](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L381) + +___ + +### NO\_POSITION\_OPEN + +• **NO\_POSITION\_OPEN** = ``11`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:383](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L383) + +___ + +### OK + +• **OK** = ``0`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:372](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L372) + +___ + +### PRICE\_IMPACT\_TOLERANCE\_EXCEEDED + +• **PRICE\_IMPACT\_TOLERANCE\_EXCEEDED** = ``13`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:385](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L385) + +___ + +### PRICE\_OUT\_OF\_BOUNDS + +• **PRICE\_OUT\_OF\_BOUNDS** = ``3`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:375](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L375) + +___ + +### PRICE\_TOO\_VOLATILE + +• **PRICE\_TOO\_VOLATILE** = ``12`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:384](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L384) diff --git a/packages/sdk/docs/enums/types_system.OperationalStatus.md b/packages/sdk/docs/enums/types_system.OperationalStatus.md new file mode 100644 index 0000000000..e775747218 --- /dev/null +++ b/packages/sdk/docs/enums/types_system.OperationalStatus.md @@ -0,0 +1,43 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/system](../modules/types_system.md) / OperationalStatus + +# Enumeration: OperationalStatus + +[types/system](../modules/types_system.md).OperationalStatus + +## Table of contents + +### Enumeration Members + +- [Degraded](types_system.OperationalStatus.md#degraded) +- [FullyOperational](types_system.OperationalStatus.md#fullyoperational) +- [Offline](types_system.OperationalStatus.md#offline) + +## Enumeration Members + +### Degraded + +• **Degraded** = ``"Degraded"`` + +#### Defined in + +[packages/sdk/src/types/system.ts:3](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/system.ts#L3) + +___ + +### FullyOperational + +• **FullyOperational** = ``"Fully operational"`` + +#### Defined in + +[packages/sdk/src/types/system.ts:2](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/system.ts#L2) + +___ + +### Offline + +• **Offline** = ``"Offline"`` + +#### Defined in + +[packages/sdk/src/types/system.ts:4](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/system.ts#L4) diff --git a/packages/sdk/docs/getting-started.md b/packages/sdk/docs/getting-started.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/sdk/docs/interfaces/context.IContext.md b/packages/sdk/docs/interfaces/context.IContext.md new file mode 100644 index 0000000000..c94d912901 --- /dev/null +++ b/packages/sdk/docs/interfaces/context.IContext.md @@ -0,0 +1,84 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [context](../modules/context.md) / IContext + +# Interface: IContext + +[context](../modules/context.md).IContext + +## Implemented by + +- [`default`](../classes/context.default.md) + +## Table of contents + +### Properties + +- [logError](context.IContext.md#logerror) +- [networkId](context.IContext.md#networkid) +- [provider](context.IContext.md#provider) +- [signer](context.IContext.md#signer) +- [walletAddress](context.IContext.md#walletaddress) + +## Properties + +### logError + +• `Optional` **logError**: (`err`: `Error`, `skipReport?`: `boolean`) => `void` + +#### Type declaration + +▸ (`err`, `skipReport?`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `skipReport?` | `boolean` | + +##### Returns + +`void` + +#### Defined in + +[packages/sdk/src/context.ts:20](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L20) + +___ + +### networkId + +• **networkId**: [`NetworkId`](../modules/types_common.md#networkid) + +#### Defined in + +[packages/sdk/src/context.ts:17](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L17) + +___ + +### provider + +• **provider**: `Provider` + +#### Defined in + +[packages/sdk/src/context.ts:16](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L16) + +___ + +### signer + +• `Optional` **signer**: `Signer` + +#### Defined in + +[packages/sdk/src/context.ts:18](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L18) + +___ + +### walletAddress + +• `Optional` **walletAddress**: `string` + +#### Defined in + +[packages/sdk/src/context.ts:19](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/context.ts#L19) diff --git a/packages/sdk/docs/interfaces/types.PerpsV2Market.md b/packages/sdk/docs/interfaces/types.PerpsV2Market.md new file mode 100644 index 0000000000..ccfc00e337 --- /dev/null +++ b/packages/sdk/docs/interfaces/types.PerpsV2Market.md @@ -0,0 +1,1948 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / PerpsV2Market + +# Interface: PerpsV2Market + +[types](../modules/types.md).PerpsV2Market + +## Hierarchy + +- `BaseContract` + + ↳ **`PerpsV2Market`** + +## Table of contents + +### Properties + +- [\_deployedPromise](types.PerpsV2Market.md#_deployedpromise) +- [\_runningEvents](types.PerpsV2Market.md#_runningevents) +- [\_wrappedEmits](types.PerpsV2Market.md#_wrappedemits) +- [address](types.PerpsV2Market.md#address) +- [callStatic](types.PerpsV2Market.md#callstatic) +- [deployTransaction](types.PerpsV2Market.md#deploytransaction) +- [estimateGas](types.PerpsV2Market.md#estimategas) +- [filters](types.PerpsV2Market.md#filters) +- [functions](types.PerpsV2Market.md#functions) +- [interface](types.PerpsV2Market.md#interface) +- [off](types.PerpsV2Market.md#off) +- [on](types.PerpsV2Market.md#on) +- [once](types.PerpsV2Market.md#once) +- [populateTransaction](types.PerpsV2Market.md#populatetransaction) +- [provider](types.PerpsV2Market.md#provider) +- [removeListener](types.PerpsV2Market.md#removelistener) +- [resolvedAddress](types.PerpsV2Market.md#resolvedaddress) +- [signer](types.PerpsV2Market.md#signer) + +### Methods + +- [\_checkRunningEvents](types.PerpsV2Market.md#_checkrunningevents) +- [\_deployed](types.PerpsV2Market.md#_deployed) +- [\_wrapEvent](types.PerpsV2Market.md#_wrapevent) +- [accessibleMargin](types.PerpsV2Market.md#accessiblemargin) +- [accruedFunding](types.PerpsV2Market.md#accruedfunding) +- [assetPrice](types.PerpsV2Market.md#assetprice) +- [attach](types.PerpsV2Market.md#attach) +- [baseAsset](types.PerpsV2Market.md#baseasset) +- [canLiquidate](types.PerpsV2Market.md#canliquidate) +- [cancelDelayedOrder](types.PerpsV2Market.md#canceldelayedorder) +- [cancelOffchainDelayedOrder](types.PerpsV2Market.md#canceloffchaindelayedorder) +- [closePosition](types.PerpsV2Market.md#closeposition) +- [closePositionWithTracking](types.PerpsV2Market.md#closepositionwithtracking) +- [connect](types.PerpsV2Market.md#connect) +- [currentFundingRate](types.PerpsV2Market.md#currentfundingrate) +- [currentFundingVelocity](types.PerpsV2Market.md#currentfundingvelocity) +- [delayedOrders](types.PerpsV2Market.md#delayedorders) +- [deployed](types.PerpsV2Market.md#deployed) +- [emit](types.PerpsV2Market.md#emit) +- [executeDelayedOrder](types.PerpsV2Market.md#executedelayedorder) +- [executeOffchainDelayedOrder](types.PerpsV2Market.md#executeoffchaindelayedorder) +- [fallback](types.PerpsV2Market.md#fallback) +- [fillPrice](types.PerpsV2Market.md#fillprice) +- [flagPosition](types.PerpsV2Market.md#flagposition) +- [forceLiquidatePosition](types.PerpsV2Market.md#forceliquidateposition) +- [fundingLastRecomputed](types.PerpsV2Market.md#fundinglastrecomputed) +- [fundingRateLastRecomputed](types.PerpsV2Market.md#fundingratelastrecomputed) +- [fundingSequence](types.PerpsV2Market.md#fundingsequence) +- [fundingSequenceLength](types.PerpsV2Market.md#fundingsequencelength) +- [isFlagged](types.PerpsV2Market.md#isflagged) +- [liquidatePosition](types.PerpsV2Market.md#liquidateposition) +- [liquidationFee](types.PerpsV2Market.md#liquidationfee) +- [liquidationPrice](types.PerpsV2Market.md#liquidationprice) +- [listenerCount](types.PerpsV2Market.md#listenercount) +- [listeners](types.PerpsV2Market.md#listeners) +- [marketDebt](types.PerpsV2Market.md#marketdebt) +- [marketKey](types.PerpsV2Market.md#marketkey) +- [marketSize](types.PerpsV2Market.md#marketsize) +- [marketSizes](types.PerpsV2Market.md#marketsizes) +- [marketSkew](types.PerpsV2Market.md#marketskew) +- [modifyPosition](types.PerpsV2Market.md#modifyposition) +- [modifyPositionWithTracking](types.PerpsV2Market.md#modifypositionwithtracking) +- [notionalValue](types.PerpsV2Market.md#notionalvalue) +- [orderFee](types.PerpsV2Market.md#orderfee) +- [positions](types.PerpsV2Market.md#positions) +- [postTradeDetails](types.PerpsV2Market.md#posttradedetails) +- [profitLoss](types.PerpsV2Market.md#profitloss) +- [queryFilter](types.PerpsV2Market.md#queryfilter) +- [recomputeFunding](types.PerpsV2Market.md#recomputefunding) +- [remainingMargin](types.PerpsV2Market.md#remainingmargin) +- [removeAllListeners](types.PerpsV2Market.md#removealllisteners) +- [submitCloseDelayedOrderWithTracking](types.PerpsV2Market.md#submitclosedelayedorderwithtracking) +- [submitCloseOffchainDelayedOrderWithTracking](types.PerpsV2Market.md#submitcloseoffchaindelayedorderwithtracking) +- [submitDelayedOrder](types.PerpsV2Market.md#submitdelayedorder) +- [submitDelayedOrderWithTracking](types.PerpsV2Market.md#submitdelayedorderwithtracking) +- [submitOffchainDelayedOrder](types.PerpsV2Market.md#submitoffchaindelayedorder) +- [submitOffchainDelayedOrderWithTracking](types.PerpsV2Market.md#submitoffchaindelayedorderwithtracking) +- [transferMargin](types.PerpsV2Market.md#transfermargin) +- [unrecordedFunding](types.PerpsV2Market.md#unrecordedfunding) +- [withdrawAllMargin](types.PerpsV2Market.md#withdrawallmargin) + +## Properties + +### \_deployedPromise + +• **\_deployedPromise**: `Promise`<`Contract`\> + +#### Inherited from + +BaseContract.\_deployedPromise + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:100 + +___ + +### \_runningEvents + +• **\_runningEvents**: `Object` + +#### Index signature + +▪ [eventTag: `string`]: `RunningEvent` + +#### Inherited from + +BaseContract.\_runningEvents + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:101 + +___ + +### \_wrappedEmits + +• **\_wrappedEmits**: `Object` + +#### Index signature + +▪ [eventTag: `string`]: (...`args`: `any`[]) => `void` + +#### Inherited from + +BaseContract.\_wrappedEmits + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:104 + +___ + +### address + +• `Readonly` **address**: `string` + +#### Inherited from + +BaseContract.address + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:79 + +___ + +### callStatic + +• **callStatic**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accessibleMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginAccessible`: `BigNumber` }\> | +| `accruedFunding` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> | +| `assetPrice` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> | +| `baseAsset` | (`overrides?`: `CallOverrides`) => `Promise`<`string`\> | +| `canLiquidate` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`boolean`\> | +| `cancelDelayedOrder` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `cancelOffchainDelayedOrder` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `closePosition` | (`desiredFillPrice`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `closePositionWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `currentFundingRate` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `currentFundingVelocity` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `delayedOrders` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`DelayedOrderStructOutput`\> | +| `executeDelayedOrder` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `executeOffchainDelayedOrder` | (`account`: `string`, `priceUpdateData`: `BytesLike`[], `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `fillPrice` | (`sizeDelta`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> | +| `flagPosition` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `forceLiquidatePosition` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `fundingLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<`number`\> | +| `fundingRateLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `fundingSequence` | (`index`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `fundingSequenceLength` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `isFlagged` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`boolean`\> | +| `liquidatePosition` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `liquidationFee` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `liquidationPrice` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> | +| `marketDebt` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `debt`: `BigNumber` ; `isInvalid`: `boolean` }\> | +| `marketKey` | (`overrides?`: `CallOverrides`) => `Promise`<`string`\> | +| `marketSize` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `marketSizes` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `BigNumber`] & { `long`: `BigNumber` ; `short`: `BigNumber` }\> | +| `marketSkew` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `modifyPosition` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `modifyPositionWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `notionalValue` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `value`: `BigNumber` }\> | +| `orderFee` | (`sizeDelta`: `BigNumberish`, `orderType`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `fee`: `BigNumber` ; `invalid`: `boolean` }\> | +| `positions` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PositionStructOutput`\> | +| `postTradeDetails` | (`sizeDelta`: `BigNumberish`, `tradePrice`: `BigNumberish`, `orderType`: `BigNumberish`, `sender`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `number`] & { `fee`: `BigNumber` ; `liqPrice`: `BigNumber` ; `margin`: `BigNumber` ; `price`: `BigNumber` ; `size`: `BigNumber` ; `status`: `number` }\> | +| `profitLoss` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `pnl`: `BigNumber` }\> | +| `recomputeFunding` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `remainingMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginRemaining`: `BigNumber` }\> | +| `submitCloseDelayedOrderWithTracking` | (`desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `submitCloseOffchainDelayedOrderWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `submitDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `submitDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `submitOffchainDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `submitOffchainDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `transferMargin` | (`marginDelta`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`void`\> | +| `unrecordedFunding` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> | +| `withdrawAllMargin` | (`overrides?`: `CallOverrides`) => `Promise`<`void`\> | + +#### Overrides + +BaseContract.callStatic + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1229](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1229) + +___ + +### deployTransaction + +• `Readonly` **deployTransaction**: `TransactionResponse` + +#### Inherited from + +BaseContract.deployTransaction + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:99 + +___ + +### estimateGas + +• **estimateGas**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accessibleMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `accruedFunding` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `assetPrice` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `baseAsset` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `canLiquidate` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `cancelDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `cancelOffchainDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `closePosition` | (`desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `closePositionWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `currentFundingRate` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `currentFundingVelocity` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `delayedOrders` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `executeDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `executeOffchainDelayedOrder` | (`account`: `string`, `priceUpdateData`: `BytesLike`[], `overrides?`: `PayableOverrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `fillPrice` | (`sizeDelta`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `flagPosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `forceLiquidatePosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `fundingLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `fundingRateLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `fundingSequence` | (`index`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `fundingSequenceLength` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `isFlagged` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `liquidatePosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `liquidationFee` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `liquidationPrice` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `marketDebt` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `marketKey` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `marketSize` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `marketSizes` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `marketSkew` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `modifyPosition` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `modifyPositionWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `notionalValue` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `orderFee` | (`sizeDelta`: `BigNumberish`, `orderType`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `positions` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `postTradeDetails` | (`sizeDelta`: `BigNumberish`, `tradePrice`: `BigNumberish`, `orderType`: `BigNumberish`, `sender`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `profitLoss` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `recomputeFunding` | (`overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `remainingMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `submitCloseDelayedOrderWithTracking` | (`desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `submitCloseOffchainDelayedOrderWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `submitDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `submitDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `submitOffchainDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `submitOffchainDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `transferMargin` | (`marginDelta`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | +| `unrecordedFunding` | (`overrides?`: `CallOverrides`) => `Promise`<`BigNumber`\> | +| `withdrawAllMargin` | (`overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`BigNumber`\> | + +#### Overrides + +BaseContract.estimateGas + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1598](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1598) + +___ + +### filters + +• **filters**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `DelayedOrderRemoved` | (`account?`: ``null`` \| `string`, `isOffchain?`: ``null``, `currentRoundId?`: ``null``, `sizeDelta?`: ``null``, `targetRoundId?`: ``null``, `commitDeposit?`: ``null``, `keeperDeposit?`: ``null``, `trackingCode?`: ``null``) => `DelayedOrderRemovedEventFilter` | +| `DelayedOrderRemoved(address,bool,uint256,int256,uint256,uint256,uint256,bytes32)` | (`account?`: ``null`` \| `string`, `isOffchain?`: ``null``, `currentRoundId?`: ``null``, `sizeDelta?`: ``null``, `targetRoundId?`: ``null``, `commitDeposit?`: ``null``, `keeperDeposit?`: ``null``, `trackingCode?`: ``null``) => `DelayedOrderRemovedEventFilter` | +| `DelayedOrderSubmitted` | (`account?`: ``null`` \| `string`, `isOffchain?`: ``null``, `sizeDelta?`: ``null``, `targetRoundId?`: ``null``, `intentionTime?`: ``null``, `executableAtTime?`: ``null``, `commitDeposit?`: ``null``, `keeperDeposit?`: ``null``, `trackingCode?`: ``null``) => `DelayedOrderSubmittedEventFilter` | +| `DelayedOrderSubmitted(address,bool,int256,uint256,uint256,uint256,uint256,uint256,bytes32)` | (`account?`: ``null`` \| `string`, `isOffchain?`: ``null``, `sizeDelta?`: ``null``, `targetRoundId?`: ``null``, `intentionTime?`: ``null``, `executableAtTime?`: ``null``, `commitDeposit?`: ``null``, `keeperDeposit?`: ``null``, `trackingCode?`: ``null``) => `DelayedOrderSubmittedEventFilter` | +| `FundingRecomputed` | (`funding?`: ``null``, `fundingRate?`: ``null``, `index?`: ``null``, `timestamp?`: ``null``) => `FundingRecomputedEventFilter` | +| `FundingRecomputed(int256,int256,uint256,uint256)` | (`funding?`: ``null``, `fundingRate?`: ``null``, `index?`: ``null``, `timestamp?`: ``null``) => `FundingRecomputedEventFilter` | +| `MarginTransferred` | (`account?`: ``null`` \| `string`, `marginDelta?`: ``null``) => `MarginTransferredEventFilter` | +| `MarginTransferred(address,int256)` | (`account?`: ``null`` \| `string`, `marginDelta?`: ``null``) => `MarginTransferredEventFilter` | +| `PerpsTracking` | (`trackingCode?`: ``null`` \| `BytesLike`, `baseAsset?`: ``null``, `marketKey?`: ``null``, `sizeDelta?`: ``null``, `fee?`: ``null``) => `PerpsTrackingEventFilter` | +| `PerpsTracking(bytes32,bytes32,bytes32,int256,uint256)` | (`trackingCode?`: ``null`` \| `BytesLike`, `baseAsset?`: ``null``, `marketKey?`: ``null``, `sizeDelta?`: ``null``, `fee?`: ``null``) => `PerpsTrackingEventFilter` | +| `PositionFlagged` | (`id?`: ``null``, `account?`: ``null``, `flagger?`: ``null``, `timestamp?`: ``null``) => `PositionFlaggedEventFilter` | +| `PositionFlagged(uint256,address,address,uint256)` | (`id?`: ``null``, `account?`: ``null``, `flagger?`: ``null``, `timestamp?`: ``null``) => `PositionFlaggedEventFilter` | +| `PositionLiquidated` | (`id?`: ``null``, `account?`: ``null``, `liquidator?`: ``null``, `size?`: ``null``, `price?`: ``null``, `flaggerFee?`: ``null``, `liquidatorFee?`: ``null``, `stakersFee?`: ``null``) => `PositionLiquidatedEventFilter` | +| `PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)` | (`id?`: ``null``, `account?`: ``null``, `liquidator?`: ``null``, `size?`: ``null``, `price?`: ``null``, `flaggerFee?`: ``null``, `liquidatorFee?`: ``null``, `stakersFee?`: ``null``) => `PositionLiquidatedEventFilter` | +| `PositionModified` | (`id?`: ``null`` \| `BigNumberish`, `account?`: ``null`` \| `string`, `margin?`: ``null``, `size?`: ``null``, `tradeSize?`: ``null``, `lastPrice?`: ``null``, `fundingIndex?`: ``null``, `fee?`: ``null``, `skew?`: ``null``) => `PositionModifiedEventFilter` | +| `PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256,int256)` | (`id?`: ``null`` \| `BigNumberish`, `account?`: ``null`` \| `string`, `margin?`: ``null``, `size?`: ``null``, `tradeSize?`: ``null``, `lastPrice?`: ``null``, `fundingIndex?`: ``null``, `fee?`: ``null``, `skew?`: ``null``) => `PositionModifiedEventFilter` | + +#### Overrides + +BaseContract.filters + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1458](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1458) + +___ + +### functions + +• **functions**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accessibleMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginAccessible`: `BigNumber` }\> | +| `accruedFunding` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> | +| `assetPrice` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> | +| `baseAsset` | (`overrides?`: `CallOverrides`) => `Promise`<[`string`] & { `key`: `string` }\> | +| `canLiquidate` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`boolean`]\> | +| `cancelDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `cancelOffchainDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `closePosition` | (`desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `closePositionWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `currentFundingRate` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`] & { `fundingRate`: `BigNumber` }\> | +| `currentFundingVelocity` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`] & { `fundingVelocity`: `BigNumber` }\> | +| `delayedOrders` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`DelayedOrderStructOutput`]\> | +| `executeDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `executeOffchainDelayedOrder` | (`account`: `string`, `priceUpdateData`: `BytesLike`[], `overrides?`: `PayableOverrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `fillPrice` | (`sizeDelta`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> | +| `flagPosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `forceLiquidatePosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `fundingLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<[`number`] & { `timestamp`: `number` }\> | +| `fundingRateLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`] & { `fundingRate`: `BigNumber` }\> | +| `fundingSequence` | (`index`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`] & { `netFunding`: `BigNumber` }\> | +| `fundingSequenceLength` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`] & { `length`: `BigNumber` }\> | +| `isFlagged` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`boolean`]\> | +| `liquidatePosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `liquidationFee` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`]\> | +| `liquidationPrice` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> | +| `marketDebt` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `debt`: `BigNumber` ; `isInvalid`: `boolean` }\> | +| `marketKey` | (`overrides?`: `CallOverrides`) => `Promise`<[`string`] & { `key`: `string` }\> | +| `marketSize` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`] & { `size`: `BigNumber` }\> | +| `marketSizes` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `BigNumber`] & { `long`: `BigNumber` ; `short`: `BigNumber` }\> | +| `marketSkew` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`] & { `skew`: `BigNumber` }\> | +| `modifyPosition` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `modifyPositionWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `notionalValue` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `value`: `BigNumber` }\> | +| `orderFee` | (`sizeDelta`: `BigNumberish`, `orderType`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `fee`: `BigNumber` ; `invalid`: `boolean` }\> | +| `positions` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`PositionStructOutput`]\> | +| `postTradeDetails` | (`sizeDelta`: `BigNumberish`, `tradePrice`: `BigNumberish`, `orderType`: `BigNumberish`, `sender`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `number`] & { `fee`: `BigNumber` ; `liqPrice`: `BigNumber` ; `margin`: `BigNumber` ; `price`: `BigNumber` ; `size`: `BigNumber` ; `status`: `number` }\> | +| `profitLoss` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `pnl`: `BigNumber` }\> | +| `recomputeFunding` | (`overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `remainingMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginRemaining`: `BigNumber` }\> | +| `submitCloseDelayedOrderWithTracking` | (`desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `submitCloseOffchainDelayedOrderWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `submitDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `submitDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `submitOffchainDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `submitOffchainDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `transferMargin` | (`marginDelta`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | +| `unrecordedFunding` | (`overrides?`: `CallOverrides`) => `Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> | +| `withdrawAllMargin` | (`overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`ContractTransaction`\> | + +#### Overrides + +BaseContract.functions + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:742](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L742) + +___ + +### interface + +• **interface**: `PerpsV2MarketInterface` + +#### Overrides + +BaseContract.interface + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:721](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L721) + +___ + +### off + +• **off**: `OnEvent`<[`PerpsV2Market`](types.PerpsV2Market.md)\> + +#### Overrides + +BaseContract.off + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:737](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L737) + +___ + +### on + +• **on**: `OnEvent`<[`PerpsV2Market`](types.PerpsV2Market.md)\> + +#### Overrides + +BaseContract.on + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:738](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L738) + +___ + +### once + +• **once**: `OnEvent`<[`PerpsV2Market`](types.PerpsV2Market.md)\> + +#### Overrides + +BaseContract.once + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:739](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L739) + +___ + +### populateTransaction + +• **populateTransaction**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accessibleMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `accruedFunding` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `assetPrice` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `baseAsset` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `canLiquidate` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `cancelDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `cancelOffchainDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `closePosition` | (`desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `closePositionWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `currentFundingRate` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `currentFundingVelocity` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `delayedOrders` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `executeDelayedOrder` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `executeOffchainDelayedOrder` | (`account`: `string`, `priceUpdateData`: `BytesLike`[], `overrides?`: `PayableOverrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `fillPrice` | (`sizeDelta`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `flagPosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `forceLiquidatePosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `fundingLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `fundingRateLastRecomputed` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `fundingSequence` | (`index`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `fundingSequenceLength` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `isFlagged` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `liquidatePosition` | (`account`: `string`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `liquidationFee` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `liquidationPrice` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `marketDebt` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `marketKey` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `marketSize` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `marketSizes` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `marketSkew` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `modifyPosition` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `modifyPositionWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `notionalValue` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `orderFee` | (`sizeDelta`: `BigNumberish`, `orderType`: `BigNumberish`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `positions` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `postTradeDetails` | (`sizeDelta`: `BigNumberish`, `tradePrice`: `BigNumberish`, `orderType`: `BigNumberish`, `sender`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `profitLoss` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `recomputeFunding` | (`overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `remainingMargin` | (`account`: `string`, `overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `submitCloseDelayedOrderWithTracking` | (`desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `submitCloseOffchainDelayedOrderWithTracking` | (`desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `submitDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `submitDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredTimeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `submitOffchainDelayedOrder` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `submitOffchainDelayedOrderWithTracking` | (`sizeDelta`: `BigNumberish`, `desiredFillPrice`: `BigNumberish`, `trackingCode`: `BytesLike`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `transferMargin` | (`marginDelta`: `BigNumberish`, `overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | +| `unrecordedFunding` | (`overrides?`: `CallOverrides`) => `Promise`<`PopulatedTransaction`\> | +| `withdrawAllMargin` | (`overrides?`: `Overrides` & { `from?`: `string` }) => `Promise`<`PopulatedTransaction`\> | + +#### Overrides + +BaseContract.populateTransaction + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1810](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1810) + +___ + +### provider + +• `Readonly` **provider**: `Provider` + +#### Inherited from + +BaseContract.provider + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:82 + +___ + +### removeListener + +• **removeListener**: `OnEvent`<[`PerpsV2Market`](types.PerpsV2Market.md)\> + +#### Overrides + +BaseContract.removeListener + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:740](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L740) + +___ + +### resolvedAddress + +• `Readonly` **resolvedAddress**: `Promise`<`string`\> + +#### Inherited from + +BaseContract.resolvedAddress + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:98 + +___ + +### signer + +• `Readonly` **signer**: `Signer` + +#### Inherited from + +BaseContract.signer + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:81 + +## Methods + +### \_checkRunningEvents + +▸ **_checkRunningEvents**(`runningEvent`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `runningEvent` | `RunningEvent` | + +#### Returns + +`void` + +#### Inherited from + +BaseContract.\_checkRunningEvents + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:121 + +___ + +### \_deployed + +▸ **_deployed**(`blockTag?`): `Promise`<`Contract`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `blockTag?` | `BlockTag` | + +#### Returns + +`Promise`<`Contract`\> + +#### Inherited from + +BaseContract.\_deployed + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:114 + +___ + +### \_wrapEvent + +▸ **_wrapEvent**(`runningEvent`, `log`, `listener`): `Event` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `runningEvent` | `RunningEvent` | +| `log` | `Log` | +| `listener` | `Listener` | + +#### Returns + +`Event` + +#### Inherited from + +BaseContract.\_wrapEvent + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:122 + +___ + +### accessibleMargin + +▸ **accessibleMargin**(`account`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginAccessible`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginAccessible`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:995](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L995) + +___ + +### accruedFunding + +▸ **accruedFunding**(`account`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1002](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1002) + +___ + +### assetPrice + +▸ **assetPrice**(`overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1007](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1007) + +___ + +### attach + +▸ **attach**(`addressOrName`): [`PerpsV2Market`](types.PerpsV2Market.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `addressOrName` | `string` | + +#### Returns + +[`PerpsV2Market`](types.PerpsV2Market.md) + +#### Overrides + +BaseContract.attach + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:718](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L718) + +___ + +### baseAsset + +▸ **baseAsset**(`overrides?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1011](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1011) + +___ + +### canLiquidate + +▸ **canLiquidate**(`account`, `overrides?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1013](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1013) + +___ + +### cancelDelayedOrder + +▸ **cancelDelayedOrder**(`account`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1015](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1015) + +___ + +### cancelOffchainDelayedOrder + +▸ **cancelOffchainDelayedOrder**(`account`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1020](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1020) + +___ + +### closePosition + +▸ **closePosition**(`desiredFillPrice`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `desiredFillPrice` | `BigNumberish` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1025](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1025) + +___ + +### closePositionWithTracking + +▸ **closePositionWithTracking**(`desiredFillPrice`, `trackingCode`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `desiredFillPrice` | `BigNumberish` | +| `trackingCode` | `BytesLike` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1030](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1030) + +___ + +### connect + +▸ **connect**(`signerOrProvider`): [`PerpsV2Market`](types.PerpsV2Market.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signerOrProvider` | `string` \| `Provider` \| `Signer` | + +#### Returns + +[`PerpsV2Market`](types.PerpsV2Market.md) + +#### Overrides + +BaseContract.connect + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:717](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L717) + +___ + +### currentFundingRate + +▸ **currentFundingRate**(`overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1036](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1036) + +___ + +### currentFundingVelocity + +▸ **currentFundingVelocity**(`overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1038](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1038) + +___ + +### delayedOrders + +▸ **delayedOrders**(`account`, `overrides?`): `Promise`<`DelayedOrderStructOutput`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`DelayedOrderStructOutput`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1040](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1040) + +___ + +### deployed + +▸ **deployed**(): `Promise`<[`PerpsV2Market`](types.PerpsV2Market.md)\> + +#### Returns + +`Promise`<[`PerpsV2Market`](types.PerpsV2Market.md)\> + +#### Overrides + +BaseContract.deployed + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:719](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L719) + +___ + +### emit + +▸ **emit**(`eventName`, `...args`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `eventName` | `string` \| `EventFilter` | +| `...args` | `any`[] | + +#### Returns + +`boolean` + +#### Inherited from + +BaseContract.emit + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:127 + +___ + +### executeDelayedOrder + +▸ **executeDelayedOrder**(`account`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1045](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1045) + +___ + +### executeOffchainDelayedOrder + +▸ **executeOffchainDelayedOrder**(`account`, `priceUpdateData`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `priceUpdateData` | `BytesLike`[] | +| `overrides?` | `PayableOverrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1050](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1050) + +___ + +### fallback + +▸ **fallback**(`overrides?`): `Promise`<`TransactionResponse`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `TransactionRequest` | + +#### Returns + +`Promise`<`TransactionResponse`\> + +#### Inherited from + +BaseContract.fallback + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:115 + +___ + +### fillPrice + +▸ **fillPrice**(`sizeDelta`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1056](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1056) + +___ + +### flagPosition + +▸ **flagPosition**(`account`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1061](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1061) + +___ + +### forceLiquidatePosition + +▸ **forceLiquidatePosition**(`account`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1066](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1066) + +___ + +### fundingLastRecomputed + +▸ **fundingLastRecomputed**(`overrides?`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1071](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1071) + +___ + +### fundingRateLastRecomputed + +▸ **fundingRateLastRecomputed**(`overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1073](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1073) + +___ + +### fundingSequence + +▸ **fundingSequence**(`index`, `overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `BigNumberish` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1075](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1075) + +___ + +### fundingSequenceLength + +▸ **fundingSequenceLength**(`overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1080](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1080) + +___ + +### isFlagged + +▸ **isFlagged**(`account`, `overrides?`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1082](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1082) + +___ + +### liquidatePosition + +▸ **liquidatePosition**(`account`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1084](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1084) + +___ + +### liquidationFee + +▸ **liquidationFee**(`account`, `overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1089](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1089) + +___ + +### liquidationPrice + +▸ **liquidationPrice**(`account`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `price`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1094](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1094) + +___ + +### listenerCount + +▸ **listenerCount**(`eventName?`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `eventName?` | `string` \| `EventFilter` | + +#### Returns + +`number` + +#### Inherited from + +BaseContract.listenerCount + +#### Defined in + +node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib/index.d.ts:128 + +___ + +### listeners + +▸ **listeners**<`TEvent`\>(`eventFilter?`): `TypedListener`<`TEvent`\>[] + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TEvent` | extends `TypedEvent`<`any`, `any`, `TEvent`\> | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `eventFilter?` | `TypedEventFilter`<`TEvent`\> | + +#### Returns + +`TypedListener`<`TEvent`\>[] + +#### Overrides + +BaseContract.listeners + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:729](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L729) + +▸ **listeners**(`eventName?`): `Listener`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `eventName?` | `string` | + +#### Returns + +`Listener`[] + +#### Overrides + +BaseContract.listeners + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:732](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L732) + +___ + +### marketDebt + +▸ **marketDebt**(`overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `debt`: `BigNumber` ; `isInvalid`: `boolean` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `debt`: `BigNumber` ; `isInvalid`: `boolean` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1099](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1099) + +___ + +### marketKey + +▸ **marketKey**(`overrides?`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1103](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1103) + +___ + +### marketSize + +▸ **marketSize**(`overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1105](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1105) + +___ + +### marketSizes + +▸ **marketSizes**(`overrides?`): `Promise`<[`BigNumber`, `BigNumber`] & { `long`: `BigNumber` ; `short`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `BigNumber`] & { `long`: `BigNumber` ; `short`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1107](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1107) + +___ + +### marketSkew + +▸ **marketSkew**(`overrides?`): `Promise`<`BigNumber`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`BigNumber`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1111](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1111) + +___ + +### modifyPosition + +▸ **modifyPosition**(`sizeDelta`, `desiredFillPrice`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `desiredFillPrice` | `BigNumberish` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1113](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1113) + +___ + +### modifyPositionWithTracking + +▸ **modifyPositionWithTracking**(`sizeDelta`, `desiredFillPrice`, `trackingCode`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `desiredFillPrice` | `BigNumberish` | +| `trackingCode` | `BytesLike` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1119](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1119) + +___ + +### notionalValue + +▸ **notionalValue**(`account`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `value`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `value`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1126](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1126) + +___ + +### orderFee + +▸ **orderFee**(`sizeDelta`, `orderType`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `fee`: `BigNumber` ; `invalid`: `boolean` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `orderType` | `BigNumberish` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `fee`: `BigNumber` ; `invalid`: `boolean` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1131](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1131) + +___ + +### positions + +▸ **positions**(`account`, `overrides?`): `Promise`<`PositionStructOutput`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<`PositionStructOutput`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1137](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1137) + +___ + +### postTradeDetails + +▸ **postTradeDetails**(`sizeDelta`, `tradePrice`, `orderType`, `sender`, `overrides?`): `Promise`<[`BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `number`] & { `fee`: `BigNumber` ; `liqPrice`: `BigNumber` ; `margin`: `BigNumber` ; `price`: `BigNumber` ; `size`: `BigNumber` ; `status`: `number` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `tradePrice` | `BigNumberish` | +| `orderType` | `BigNumberish` | +| `sender` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `BigNumber`, `number`] & { `fee`: `BigNumber` ; `liqPrice`: `BigNumber` ; `margin`: `BigNumber` ; `price`: `BigNumber` ; `size`: `BigNumber` ; `status`: `number` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1142](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1142) + +___ + +### profitLoss + +▸ **profitLoss**(`account`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `pnl`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `pnl`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1159](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1159) + +___ + +### queryFilter + +▸ **queryFilter**<`TEvent`\>(`event`, `fromBlockOrBlockhash?`, `toBlock?`): `Promise`<`TEvent`[]\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TEvent` | extends `TypedEvent`<`any`, `any`, `TEvent`\> | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `TypedEventFilter`<`TEvent`\> | +| `fromBlockOrBlockhash?` | `string` \| `number` | +| `toBlock?` | `string` \| `number` | + +#### Returns + +`Promise`<`TEvent`[]\> + +#### Overrides + +BaseContract.queryFilter + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:723](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L723) + +___ + +### recomputeFunding + +▸ **recomputeFunding**(`overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1164](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1164) + +___ + +### remainingMargin + +▸ **remainingMargin**(`account`, `overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginRemaining`: `BigNumber` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `invalid`: `boolean` ; `marginRemaining`: `BigNumber` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1168](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1168) + +___ + +### removeAllListeners + +▸ **removeAllListeners**<`TEvent`\>(`eventFilter`): [`PerpsV2Market`](types.PerpsV2Market.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TEvent` | extends `TypedEvent`<`any`, `any`, `TEvent`\> | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `eventFilter` | `TypedEventFilter`<`TEvent`\> | + +#### Returns + +[`PerpsV2Market`](types.PerpsV2Market.md) + +#### Overrides + +BaseContract.removeAllListeners + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:733](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L733) + +▸ **removeAllListeners**(`eventName?`): [`PerpsV2Market`](types.PerpsV2Market.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `eventName?` | `string` | + +#### Returns + +[`PerpsV2Market`](types.PerpsV2Market.md) + +#### Overrides + +BaseContract.removeAllListeners + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:736](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L736) + +___ + +### submitCloseDelayedOrderWithTracking + +▸ **submitCloseDelayedOrderWithTracking**(`desiredTimeDelta`, `desiredFillPrice`, `trackingCode`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `desiredTimeDelta` | `BigNumberish` | +| `desiredFillPrice` | `BigNumberish` | +| `trackingCode` | `BytesLike` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1175](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1175) + +___ + +### submitCloseOffchainDelayedOrderWithTracking + +▸ **submitCloseOffchainDelayedOrderWithTracking**(`desiredFillPrice`, `trackingCode`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `desiredFillPrice` | `BigNumberish` | +| `trackingCode` | `BytesLike` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1182](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1182) + +___ + +### submitDelayedOrder + +▸ **submitDelayedOrder**(`sizeDelta`, `desiredTimeDelta`, `desiredFillPrice`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `desiredTimeDelta` | `BigNumberish` | +| `desiredFillPrice` | `BigNumberish` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1188](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1188) + +___ + +### submitDelayedOrderWithTracking + +▸ **submitDelayedOrderWithTracking**(`sizeDelta`, `desiredTimeDelta`, `desiredFillPrice`, `trackingCode`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `desiredTimeDelta` | `BigNumberish` | +| `desiredFillPrice` | `BigNumberish` | +| `trackingCode` | `BytesLike` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1195](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1195) + +___ + +### submitOffchainDelayedOrder + +▸ **submitOffchainDelayedOrder**(`sizeDelta`, `desiredFillPrice`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `desiredFillPrice` | `BigNumberish` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1203](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1203) + +___ + +### submitOffchainDelayedOrderWithTracking + +▸ **submitOffchainDelayedOrderWithTracking**(`sizeDelta`, `desiredFillPrice`, `trackingCode`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sizeDelta` | `BigNumberish` | +| `desiredFillPrice` | `BigNumberish` | +| `trackingCode` | `BytesLike` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1209](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1209) + +___ + +### transferMargin + +▸ **transferMargin**(`marginDelta`, `overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `marginDelta` | `BigNumberish` | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1216](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1216) + +___ + +### unrecordedFunding + +▸ **unrecordedFunding**(`overrides?`): `Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `CallOverrides` | + +#### Returns + +`Promise`<[`BigNumber`, `boolean`] & { `funding`: `BigNumber` ; `invalid`: `boolean` }\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1221](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1221) + +___ + +### withdrawAllMargin + +▸ **withdrawAllMargin**(`overrides?`): `Promise`<`ContractTransaction`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `overrides?` | `Overrides` & { `from?`: `string` } | + +#### Returns + +`Promise`<`ContractTransaction`\> + +#### Defined in + +[packages/sdk/src/contracts/types/PerpsV2Market.ts:1225](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/contracts/types/PerpsV2Market.ts#L1225) diff --git a/packages/sdk/docs/interfaces/types_futures.FuturesMarketConfig.md b/packages/sdk/docs/interfaces/types_futures.FuturesMarketConfig.md new file mode 100644 index 0000000000..5b6a147712 --- /dev/null +++ b/packages/sdk/docs/interfaces/types_futures.FuturesMarketConfig.md @@ -0,0 +1,83 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/futures](../modules/types_futures.md) / FuturesMarketConfig + +# Interface: FuturesMarketConfig + +[types/futures](../modules/types_futures.md).FuturesMarketConfig + +## Table of contents + +### Properties + +- [asset](types_futures.FuturesMarketConfig.md#asset) +- [disabled](types_futures.FuturesMarketConfig.md#disabled) +- [key](types_futures.FuturesMarketConfig.md#key) +- [pythIds](types_futures.FuturesMarketConfig.md#pythids) +- [supports](types_futures.FuturesMarketConfig.md#supports) +- [version](types_futures.FuturesMarketConfig.md#version) + +## Properties + +### asset + +• **asset**: [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) + +#### Defined in + +[packages/sdk/src/types/futures.ts:168](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L168) + +___ + +### disabled + +• `Optional` **disabled**: `boolean` + +#### Defined in + +[packages/sdk/src/types/futures.ts:175](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L175) + +___ + +### key + +• **key**: [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) + +#### Defined in + +[packages/sdk/src/types/futures.ts:167](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L167) + +___ + +### pythIds + +• `Optional` **pythIds**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `mainnet` | `string` | +| `testnet` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:171](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L171) + +___ + +### supports + +• **supports**: ``"mainnet"`` \| ``"testnet"`` \| ``"both"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:169](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L169) + +___ + +### version + +• **version**: ``1`` \| ``2`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:170](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L170) diff --git a/packages/sdk/docs/interfaces/types_transactions.Emitter.md b/packages/sdk/docs/interfaces/types_transactions.Emitter.md new file mode 100644 index 0000000000..4861481611 --- /dev/null +++ b/packages/sdk/docs/interfaces/types_transactions.Emitter.md @@ -0,0 +1,77 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/transactions](../modules/types_transactions.md) / Emitter + +# Interface: Emitter + +[types/transactions](../modules/types_transactions.md).Emitter + +## Table of contents + +### Properties + +- [emit](types_transactions.Emitter.md#emit) +- [listeners](types_transactions.Emitter.md#listeners) +- [on](types_transactions.Emitter.md#on) + +## Properties + +### emit + +• **emit**: (`eventCode`: [`TransactionEventCode`](../modules/types_transactions.md#transactioneventcode), `data`: [`TransactionStatusData`](types_transactions.TransactionStatusData.md)) => `void` + +#### Type declaration + +▸ (`eventCode`, `data`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `eventCode` | [`TransactionEventCode`](../modules/types_transactions.md#transactioneventcode) | +| `data` | [`TransactionStatusData`](types_transactions.TransactionStatusData.md) | + +##### Returns + +`void` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:21](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L21) + +___ + +### listeners + +• **listeners**: `Object` + +#### Index signature + +▪ [key: `string`]: [`EmitterListener`](types_transactions.EmitterListener.md) + +#### Defined in + +[packages/sdk/src/types/transactions.ts:17](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L17) + +___ + +### on + +• **on**: (`eventCode`: [`TransactionEventCode`](../modules/types_transactions.md#transactioneventcode), `listener`: [`EmitterListener`](types_transactions.EmitterListener.md)) => `void` + +#### Type declaration + +▸ (`eventCode`, `listener`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `eventCode` | [`TransactionEventCode`](../modules/types_transactions.md#transactioneventcode) | +| `listener` | [`EmitterListener`](types_transactions.EmitterListener.md) | + +##### Returns + +`void` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:20](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L20) diff --git a/packages/sdk/docs/interfaces/types_transactions.EmitterListener.md b/packages/sdk/docs/interfaces/types_transactions.EmitterListener.md new file mode 100644 index 0000000000..e50d4b775b --- /dev/null +++ b/packages/sdk/docs/interfaces/types_transactions.EmitterListener.md @@ -0,0 +1,25 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/transactions](../modules/types_transactions.md) / EmitterListener + +# Interface: EmitterListener + +[types/transactions](../modules/types_transactions.md).EmitterListener + +## Callable + +### EmitterListener + +▸ **EmitterListener**(`state`): `undefined` \| `boolean` \| `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `state` | [`TransactionStatusData`](types_transactions.TransactionStatusData.md) | + +#### Returns + +`undefined` \| `boolean` \| `void` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:13](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L13) diff --git a/packages/sdk/docs/interfaces/types_transactions.TransactionStatusData.md b/packages/sdk/docs/interfaces/types_transactions.TransactionStatusData.md new file mode 100644 index 0000000000..2b35605261 --- /dev/null +++ b/packages/sdk/docs/interfaces/types_transactions.TransactionStatusData.md @@ -0,0 +1,54 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / [types/transactions](../modules/types_transactions.md) / TransactionStatusData + +# Interface: TransactionStatusData + +[types/transactions](../modules/types_transactions.md).TransactionStatusData + +## Table of contents + +### Properties + +- [blockNumber](types_transactions.TransactionStatusData.md#blocknumber) +- [failureReason](types_transactions.TransactionStatusData.md#failurereason) +- [status](types_transactions.TransactionStatusData.md#status) +- [transactionHash](types_transactions.TransactionStatusData.md#transactionhash) + +## Properties + +### blockNumber + +• `Optional` **blockNumber**: `number` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:8](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L8) + +___ + +### failureReason + +• `Optional` **failureReason**: `string` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:9](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L9) + +___ + +### status + +• `Optional` **status**: `number` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:7](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L7) + +___ + +### transactionHash + +• **transactionHash**: `string` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:6](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L6) diff --git a/packages/sdk/docs/modules.md b/packages/sdk/docs/modules.md new file mode 100644 index 0000000000..7a49b598d3 --- /dev/null +++ b/packages/sdk/docs/modules.md @@ -0,0 +1,32 @@ +[@kwenta/sdk](README.md) / Modules + +# @kwenta/sdk + +## Table of contents + +### Modules + +- [context](modules/context.md) +- [index](modules/index.md) +- [services/exchange](modules/services_exchange.md) +- [services/futures](modules/services_futures.md) +- [services/kwentaToken](modules/services_kwentaToken.md) +- [services/perpsV3](modules/services_perpsV3.md) +- [services/prices](modules/services_prices.md) +- [services/stats](modules/services_stats.md) +- [services/synths](modules/services_synths.md) +- [services/system](modules/services_system.md) +- [services/transactions](modules/services_transactions.md) +- [types](modules/types.md) +- [types/1inch](modules/types_1inch.md) +- [types/common](modules/types_common.md) +- [types/exchange](modules/types_exchange.md) +- [types/futures](modules/types_futures.md) +- [types/kwentaToken](modules/types_kwentaToken.md) +- [types/prices](modules/types_prices.md) +- [types/staking](modules/types_staking.md) +- [types/stats](modules/types_stats.md) +- [types/synths](modules/types_synths.md) +- [types/system](modules/types_system.md) +- [types/tokens](modules/types_tokens.md) +- [types/transactions](modules/types_transactions.md) diff --git a/packages/sdk/docs/modules/context.md b/packages/sdk/docs/modules/context.md new file mode 100644 index 0000000000..75d8a0a55e --- /dev/null +++ b/packages/sdk/docs/modules/context.md @@ -0,0 +1,13 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / context + +# Module: context + +## Table of contents + +### Classes + +- [default](../classes/context.default.md) + +### Interfaces + +- [IContext](../interfaces/context.IContext.md) diff --git a/packages/sdk/docs/modules/index.md b/packages/sdk/docs/modules/index.md new file mode 100644 index 0000000000..fd602251db --- /dev/null +++ b/packages/sdk/docs/modules/index.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / index + +# Module: index + +## Table of contents + +### Classes + +- [default](../classes/index.default.md) diff --git a/packages/sdk/docs/modules/services_exchange.md b/packages/sdk/docs/modules/services_exchange.md new file mode 100644 index 0000000000..a9edb07182 --- /dev/null +++ b/packages/sdk/docs/modules/services_exchange.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/exchange + +# Module: services/exchange + +## Table of contents + +### Classes + +- [default](../classes/services_exchange.default.md) diff --git a/packages/sdk/docs/modules/services_futures.md b/packages/sdk/docs/modules/services_futures.md new file mode 100644 index 0000000000..3e0c547716 --- /dev/null +++ b/packages/sdk/docs/modules/services_futures.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/futures + +# Module: services/futures + +## Table of contents + +### Classes + +- [default](../classes/services_futures.default.md) diff --git a/packages/sdk/docs/modules/services_kwentaToken.md b/packages/sdk/docs/modules/services_kwentaToken.md new file mode 100644 index 0000000000..c3ebc38aec --- /dev/null +++ b/packages/sdk/docs/modules/services_kwentaToken.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/kwentaToken + +# Module: services/kwentaToken + +## Table of contents + +### Classes + +- [default](../classes/services_kwentaToken.default.md) diff --git a/packages/sdk/docs/modules/services_perpsV3.md b/packages/sdk/docs/modules/services_perpsV3.md new file mode 100644 index 0000000000..dfdd65926c --- /dev/null +++ b/packages/sdk/docs/modules/services_perpsV3.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/perpsV3 + +# Module: services/perpsV3 + +## Table of contents + +### Classes + +- [default](../classes/services_perpsV3.default.md) diff --git a/packages/sdk/docs/modules/services_prices.md b/packages/sdk/docs/modules/services_prices.md new file mode 100644 index 0000000000..8b633abc87 --- /dev/null +++ b/packages/sdk/docs/modules/services_prices.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/prices + +# Module: services/prices + +## Table of contents + +### Classes + +- [default](../classes/services_prices.default.md) diff --git a/packages/sdk/docs/modules/services_stats.md b/packages/sdk/docs/modules/services_stats.md new file mode 100644 index 0000000000..5ad652db16 --- /dev/null +++ b/packages/sdk/docs/modules/services_stats.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/stats + +# Module: services/stats + +## Table of contents + +### Classes + +- [default](../classes/services_stats.default.md) diff --git a/packages/sdk/docs/modules/services_synths.md b/packages/sdk/docs/modules/services_synths.md new file mode 100644 index 0000000000..077699ab65 --- /dev/null +++ b/packages/sdk/docs/modules/services_synths.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/synths + +# Module: services/synths + +## Table of contents + +### Classes + +- [default](../classes/services_synths.default.md) diff --git a/packages/sdk/docs/modules/services_system.md b/packages/sdk/docs/modules/services_system.md new file mode 100644 index 0000000000..54657945d2 --- /dev/null +++ b/packages/sdk/docs/modules/services_system.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/system + +# Module: services/system + +## Table of contents + +### Classes + +- [default](../classes/services_system.default.md) diff --git a/packages/sdk/docs/modules/services_transactions.md b/packages/sdk/docs/modules/services_transactions.md new file mode 100644 index 0000000000..26b5f5e6dc --- /dev/null +++ b/packages/sdk/docs/modules/services_transactions.md @@ -0,0 +1,9 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / services/transactions + +# Module: services/transactions + +## Table of contents + +### Classes + +- [default](../classes/services_transactions.default.md) diff --git a/packages/sdk/docs/modules/types.md b/packages/sdk/docs/modules/types.md new file mode 100644 index 0000000000..646d49a370 --- /dev/null +++ b/packages/sdk/docs/modules/types.md @@ -0,0 +1,625 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types + +# Module: types + +## Table of contents + +### References + +- [AccountExecuteFunctions](types.md#accountexecutefunctions) +- [AccountStat](types.md#accountstat) +- [AssetKey](types.md#assetkey) +- [Balances](types.md#balances) +- [ClaimParams](types.md#claimparams) +- [ConditionalOrder](types.md#conditionalorder) +- [ConditionalOrderTypeEnum](types.md#conditionalordertypeenum) +- [ContractOrderType](types.md#contractordertype) +- [CurrencyKey](types.md#currencykey) +- [CurrencyPrice](types.md#currencyprice) +- [DelayedOrder](types.md#delayedorder) +- [DeprecatedSynthBalance](types.md#deprecatedsynthbalance) +- [Emitter](types.md#emitter) +- [EmitterListener](types.md#emitterlistener) +- [EnsInfo](types.md#ensinfo) +- [EpochData](types.md#epochdata) +- [EscrowData](types.md#escrowdata) +- [FundingRateInput](types.md#fundingrateinput) +- [FundingRateResponse](types.md#fundingrateresponse) +- [FundingRateUpdate](types.md#fundingrateupdate) +- [FuturesCumulativeStats](types.md#futurescumulativestats) +- [FuturesFeeForAccountProps](types.md#futuresfeeforaccountprops) +- [FuturesFeeProps](types.md#futuresfeeprops) +- [FuturesFilledPosition](types.md#futuresfilledposition) +- [FuturesMarginType](types.md#futuresmargintype) +- [FuturesMarket](types.md#futuresmarket) +- [FuturesMarketAsset](types.md#futuresmarketasset) +- [FuturesMarketConfig](types.md#futuresmarketconfig) +- [FuturesMarketKey](types.md#futuresmarketkey) +- [FuturesOrderType](types.md#futuresordertype) +- [FuturesOrderTypeDisplay](types.md#futuresordertypedisplay) +- [FuturesPosition](types.md#futuresposition) +- [FuturesPositionHistory](types.md#futurespositionhistory) +- [FuturesPotentialTradeDetails](types.md#futurespotentialtradedetails) +- [FuturesStat](types.md#futuresstat) +- [FuturesTrade](types.md#futurestrade) +- [FuturesVolumes](types.md#futuresvolumes) +- [GasLimitEstimate](types.md#gaslimitestimate) +- [GasPrice](types.md#gasprice) +- [GetCodeParams](types.md#getcodeparams) +- [KwentaStatus](types.md#kwentastatus) +- [Leaderboard](types.md#leaderboard) +- [MarginTransfer](types.md#margintransfer) +- [MarketClosureReason](types.md#marketclosurereason) +- [MarketWithIdleMargin](types.md#marketwithidlemargin) +- [ModifyPositionOptions](types.md#modifypositionoptions) +- [NetworkId](types.md#networkid) +- [NetworkIdByName](types.md#networkidbyname) +- [NetworkNameById](types.md#networknamebyid) +- [NetworkOverrideOptions](types.md#networkoverrideoptions) +- [OneInchApproveSpenderResponse](types.md#oneinchapprovespenderresponse) +- [OneInchQuoteResponse](types.md#oneinchquoteresponse) +- [OneInchSwapResponse](types.md#oneinchswapresponse) +- [OneInchTokenListResponse](types.md#oneinchtokenlistresponse) +- [OperationalStatus](types.md#operationalstatus) +- [OrderEnumByType](types.md#orderenumbytype) +- [PerpsV3Market](types.md#perpsv3market) +- [PositionDetail](types.md#positiondetail) +- [PositionSide](types.md#positionside) +- [PostTradeDetailsResponse](types.md#posttradedetailsresponse) +- [PotentialTradeStatus](types.md#potentialtradestatus) +- [Price](types.md#price) +- [PriceResponse](types.md#priceresponse) +- [PriceServer](types.md#priceserver) +- [PriceType](types.md#pricetype) +- [Prices](types.md#prices) +- [PricesListener](types.md#priceslistener) +- [PricesMap](types.md#pricesmap) +- [Rates](types.md#rates) +- [RevertReasonParams](types.md#revertreasonparams) +- [SLTPOrderInputs](types.md#sltporderinputs) +- [SmartMarginOrderInputs](types.md#smartmarginorderinputs) +- [SmartMarginOrderType](types.md#smartmarginordertype) +- [SynthBalance](types.md#synthbalance) +- [SynthBalancesMap](types.md#synthbalancesmap) +- [SynthExchange](types.md#synthexchange) +- [SynthPrice](types.md#synthprice) +- [SynthPricesTuple](types.md#synthpricestuple) +- [SynthResult](types.md#synthresult) +- [SynthSuspensionReason](types.md#synthsuspensionreason) +- [Token](types.md#token) +- [TokenBalances](types.md#tokenbalances) +- [TradingRewardProps](types.md#tradingrewardprops) +- [TransactionEventCode](types.md#transactioneventcode) +- [TransactionStatus](types.md#transactionstatus) +- [TransactionStatusData](types.md#transactionstatusdata) +- [WalletTradesExchangeResult](types.md#wallettradesexchangeresult) + +### Classes + +- [PerpsV2Market\_\_factory](../classes/types.PerpsV2Market__factory.md) + +### Interfaces + +- [PerpsV2Market](../interfaces/types.PerpsV2Market.md) + +## References + +### AccountExecuteFunctions + +Re-exports [AccountExecuteFunctions](../enums/types_futures.AccountExecuteFunctions.md) + +___ + +### AccountStat + +Re-exports [AccountStat](types_stats.md#accountstat) + +___ + +### AssetKey + +Re-exports [AssetKey](types_prices.md#assetkey) + +___ + +### Balances + +Re-exports [Balances](types_synths.md#balances) + +___ + +### ClaimParams + +Re-exports [ClaimParams](types_kwentaToken.md#claimparams) + +___ + +### ConditionalOrder + +Re-exports [ConditionalOrder](types_futures.md#conditionalorder) + +___ + +### ConditionalOrderTypeEnum + +Re-exports [ConditionalOrderTypeEnum](../enums/types_futures.ConditionalOrderTypeEnum.md) + +___ + +### ContractOrderType + +Re-exports [ContractOrderType](../enums/types_futures.ContractOrderType.md) + +___ + +### CurrencyKey + +Re-exports [CurrencyKey](types_common.md#currencykey) + +___ + +### CurrencyPrice + +Re-exports [CurrencyPrice](types_prices.md#currencyprice) + +___ + +### DelayedOrder + +Re-exports [DelayedOrder](types_futures.md#delayedorder) + +___ + +### DeprecatedSynthBalance + +Re-exports [DeprecatedSynthBalance](types_synths.md#deprecatedsynthbalance) + +___ + +### Emitter + +Re-exports [Emitter](../interfaces/types_transactions.Emitter.md) + +___ + +### EmitterListener + +Re-exports [EmitterListener](../interfaces/types_transactions.EmitterListener.md) + +___ + +### EnsInfo + +Re-exports [EnsInfo](types_stats.md#ensinfo) + +___ + +### EpochData + +Re-exports [EpochData](types_kwentaToken.md#epochdata) + +___ + +### EscrowData + +Re-exports [EscrowData](types_kwentaToken.md#escrowdata) + +___ + +### FundingRateInput + +Re-exports [FundingRateInput](types_futures.md#fundingrateinput) + +___ + +### FundingRateResponse + +Re-exports [FundingRateResponse](types_futures.md#fundingrateresponse) + +___ + +### FundingRateUpdate + +Re-exports [FundingRateUpdate](types_futures.md#fundingrateupdate) + +___ + +### FuturesCumulativeStats + +Re-exports [FuturesCumulativeStats](types_stats.md#futurescumulativestats) + +___ + +### FuturesFeeForAccountProps + +Re-exports [FuturesFeeForAccountProps](types_staking.md#futuresfeeforaccountprops) + +___ + +### FuturesFeeProps + +Re-exports [FuturesFeeProps](types_staking.md#futuresfeeprops) + +___ + +### FuturesFilledPosition + +Re-exports [FuturesFilledPosition](types_futures.md#futuresfilledposition) + +___ + +### FuturesMarginType + +Re-exports [FuturesMarginType](../enums/types_futures.FuturesMarginType.md) + +___ + +### FuturesMarket + +Re-exports [FuturesMarket](types_futures.md#futuresmarket) + +___ + +### FuturesMarketAsset + +Re-exports [FuturesMarketAsset](../enums/types_futures.FuturesMarketAsset.md) + +___ + +### FuturesMarketConfig + +Re-exports [FuturesMarketConfig](../interfaces/types_futures.FuturesMarketConfig.md) + +___ + +### FuturesMarketKey + +Re-exports [FuturesMarketKey](../enums/types_futures.FuturesMarketKey.md) + +___ + +### FuturesOrderType + +Re-exports [FuturesOrderType](types_futures.md#futuresordertype) + +___ + +### FuturesOrderTypeDisplay + +Re-exports [FuturesOrderTypeDisplay](types_futures.md#futuresordertypedisplay) + +___ + +### FuturesPosition + +Re-exports [FuturesPosition](types_futures.md#futuresposition) + +___ + +### FuturesPositionHistory + +Re-exports [FuturesPositionHistory](types_futures.md#futurespositionhistory) + +___ + +### FuturesPotentialTradeDetails + +Re-exports [FuturesPotentialTradeDetails](types_futures.md#futurespotentialtradedetails) + +___ + +### FuturesStat + +Re-exports [FuturesStat](types_stats.md#futuresstat) + +___ + +### FuturesTrade + +Re-exports [FuturesTrade](types_futures.md#futurestrade) + +___ + +### FuturesVolumes + +Re-exports [FuturesVolumes](types_futures.md#futuresvolumes) + +___ + +### GasLimitEstimate + +Re-exports [GasLimitEstimate](types_transactions.md#gaslimitestimate) + +___ + +### GasPrice + +Re-exports [GasPrice](types_transactions.md#gasprice) + +___ + +### GetCodeParams + +Re-exports [GetCodeParams](types_transactions.md#getcodeparams) + +___ + +### KwentaStatus + +Re-exports [KwentaStatus](types_system.md#kwentastatus) + +___ + +### Leaderboard + +Re-exports [Leaderboard](types_stats.md#leaderboard) + +___ + +### MarginTransfer + +Re-exports [MarginTransfer](types_futures.md#margintransfer) + +___ + +### MarketClosureReason + +Re-exports [MarketClosureReason](types_futures.md#marketclosurereason) + +___ + +### MarketWithIdleMargin + +Re-exports [MarketWithIdleMargin](types_futures.md#marketwithidlemargin) + +___ + +### ModifyPositionOptions + +Re-exports [ModifyPositionOptions](types_futures.md#modifypositionoptions) + +___ + +### NetworkId + +Re-exports [NetworkId](types_common.md#networkid) + +___ + +### NetworkIdByName + +Re-exports [NetworkIdByName](types_common.md#networkidbyname) + +___ + +### NetworkNameById + +Re-exports [NetworkNameById](types_common.md#networknamebyid) + +___ + +### NetworkOverrideOptions + +Re-exports [NetworkOverrideOptions](types_common.md#networkoverrideoptions) + +___ + +### OneInchApproveSpenderResponse + +Re-exports [OneInchApproveSpenderResponse](types_1inch.md#oneinchapprovespenderresponse) + +___ + +### OneInchQuoteResponse + +Re-exports [OneInchQuoteResponse](types_1inch.md#oneinchquoteresponse) + +___ + +### OneInchSwapResponse + +Re-exports [OneInchSwapResponse](types_1inch.md#oneinchswapresponse) + +___ + +### OneInchTokenListResponse + +Re-exports [OneInchTokenListResponse](types_1inch.md#oneinchtokenlistresponse) + +___ + +### OperationalStatus + +Re-exports [OperationalStatus](../enums/types_system.OperationalStatus.md) + +___ + +### OrderEnumByType + +Re-exports [OrderEnumByType](types_futures.md#orderenumbytype) + +___ + +### PerpsV3Market + +Re-exports [PerpsV3Market](types_futures.md#perpsv3market) + +___ + +### PositionDetail + +Re-exports [PositionDetail](types_futures.md#positiondetail) + +___ + +### PositionSide + +Re-exports [PositionSide](../enums/types_futures.PositionSide.md) + +___ + +### PostTradeDetailsResponse + +Re-exports [PostTradeDetailsResponse](types_futures.md#posttradedetailsresponse) + +___ + +### PotentialTradeStatus + +Re-exports [PotentialTradeStatus](../enums/types_futures.PotentialTradeStatus.md) + +___ + +### Price + +Re-exports [Price](types_prices.md#price) + +___ + +### PriceResponse + +Re-exports [PriceResponse](types_exchange.md#priceresponse) + +___ + +### PriceServer + +Re-exports [PriceServer](types_common.md#priceserver) + +___ + +### PriceType + +Re-exports [PriceType](types_prices.md#pricetype) + +___ + +### Prices + +Re-exports [Prices](types_prices.md#prices) + +___ + +### PricesListener + +Re-exports [PricesListener](types_prices.md#priceslistener) + +___ + +### PricesMap + +Re-exports [PricesMap](types_prices.md#pricesmap) + +___ + +### Rates + +Re-exports [Rates](types_exchange.md#rates) + +___ + +### RevertReasonParams + +Re-exports [RevertReasonParams](types_transactions.md#revertreasonparams) + +___ + +### SLTPOrderInputs + +Re-exports [SLTPOrderInputs](types_futures.md#sltporderinputs) + +___ + +### SmartMarginOrderInputs + +Re-exports [SmartMarginOrderInputs](types_futures.md#smartmarginorderinputs) + +___ + +### SmartMarginOrderType + +Re-exports [SmartMarginOrderType](types_futures.md#smartmarginordertype) + +___ + +### SynthBalance + +Re-exports [SynthBalance](types_synths.md#synthbalance) + +___ + +### SynthBalancesMap + +Re-exports [SynthBalancesMap](types_synths.md#synthbalancesmap) + +___ + +### SynthExchange + +Re-exports [SynthExchange](types_exchange.md#synthexchange) + +___ + +### SynthPrice + +Re-exports [SynthPrice](types_prices.md#synthprice) + +___ + +### SynthPricesTuple + +Re-exports [SynthPricesTuple](types_prices.md#synthpricestuple) + +___ + +### SynthResult + +Re-exports [SynthResult](types_synths.md#synthresult) + +___ + +### SynthSuspensionReason + +Re-exports [SynthSuspensionReason](types_futures.md#synthsuspensionreason) + +___ + +### Token + +Re-exports [Token](types_tokens.md#token) + +___ + +### TokenBalances + +Re-exports [TokenBalances](types_tokens.md#tokenbalances) + +___ + +### TradingRewardProps + +Re-exports [TradingRewardProps](types_staking.md#tradingrewardprops) + +___ + +### TransactionEventCode + +Re-exports [TransactionEventCode](types_transactions.md#transactioneventcode) + +___ + +### TransactionStatus + +Re-exports [TransactionStatus](../enums/types_common.TransactionStatus.md) + +___ + +### TransactionStatusData + +Re-exports [TransactionStatusData](../interfaces/types_transactions.TransactionStatusData.md) + +___ + +### WalletTradesExchangeResult + +Re-exports [WalletTradesExchangeResult](types_synths.md#wallettradesexchangeresult) diff --git a/packages/sdk/docs/modules/types_1inch.md b/packages/sdk/docs/modules/types_1inch.md new file mode 100644 index 0000000000..846abd1b4f --- /dev/null +++ b/packages/sdk/docs/modules/types_1inch.md @@ -0,0 +1,73 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/1inch + +# Module: types/1inch + +## Table of contents + +### Type Aliases + +- [OneInchApproveSpenderResponse](types_1inch.md#oneinchapprovespenderresponse) +- [OneInchQuoteResponse](types_1inch.md#oneinchquoteresponse) +- [OneInchSwapResponse](types_1inch.md#oneinchswapresponse) +- [OneInchTokenListResponse](types_1inch.md#oneinchtokenlistresponse) + +## Type Aliases + +### OneInchApproveSpenderResponse + +Ƭ **OneInchApproveSpenderResponse**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `address` | `string` | + +#### Defined in + +[packages/sdk/src/types/1inch.ts:27](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/1inch.ts#L27) + +___ + +### OneInchQuoteResponse + +Ƭ **OneInchQuoteResponse**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `fromToken` | `Token` | +| `fromTokenAmount` | `string` | +| `toToken` | `Token` | +| `toTokenAmount` | `string` | + +#### Defined in + +[packages/sdk/src/types/1inch.ts:9](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/1inch.ts#L9) + +___ + +### OneInchSwapResponse + +Ƭ **OneInchSwapResponse**: [`OneInchQuoteResponse`](types_1inch.md#oneinchquoteresponse) & { `tx`: { `data`: `string` ; `from`: `string` ; `gas`: `number` ; `gasPrice`: `string` ; `to`: `string` ; `value`: `string` } } + +#### Defined in + +[packages/sdk/src/types/1inch.ts:16](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/1inch.ts#L16) + +___ + +### OneInchTokenListResponse + +Ƭ **OneInchTokenListResponse**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `tokens` | `Record`<`string`, `Token`\> | + +#### Defined in + +[packages/sdk/src/types/1inch.ts:31](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/1inch.ts#L31) diff --git a/packages/sdk/docs/modules/types_common.md b/packages/sdk/docs/modules/types_common.md new file mode 100644 index 0000000000..b4f9ca7533 --- /dev/null +++ b/packages/sdk/docs/modules/types_common.md @@ -0,0 +1,112 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/common + +# Module: types/common + +## Table of contents + +### Enumerations + +- [TransactionStatus](../enums/types_common.TransactionStatus.md) + +### Type Aliases + +- [CurrencyKey](types_common.md#currencykey) +- [NetworkId](types_common.md#networkid) +- [NetworkOverrideOptions](types_common.md#networkoverrideoptions) +- [PriceServer](types_common.md#priceserver) + +### Variables + +- [NetworkIdByName](types_common.md#networkidbyname) +- [NetworkNameById](types_common.md#networknamebyid) + +## Type Aliases + +### CurrencyKey + +Ƭ **CurrencyKey**: `string` + +#### Defined in + +[packages/sdk/src/types/common.ts:39](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L39) + +___ + +### NetworkId + +Ƭ **NetworkId**: ``1`` \| ``5`` \| ``420`` \| ``10`` \| ``42`` \| ``69`` \| ``31337`` + +#### Defined in + +[packages/sdk/src/types/common.ts:5](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L5) + +___ + +### NetworkOverrideOptions + +Ƭ **NetworkOverrideOptions**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `networkId` | [`NetworkId`](types_common.md#networkid) | +| `provider` | `ethers.providers.Provider` | + +#### Defined in + +[packages/sdk/src/types/common.ts:7](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L7) + +___ + +### PriceServer + +Ƭ **PriceServer**: ``"KWENTA"`` \| ``"PYTH"`` + +#### Defined in + +[packages/sdk/src/types/common.ts:3](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L3) + +## Variables + +### NetworkIdByName + +• `Const` **NetworkIdByName**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `goerli` | ``5`` | +| `goerli-ovm` | ``420`` | +| `kovan` | ``42`` | +| `kovan-ovm` | ``69`` | +| `mainnet` | ``1`` | +| `mainnet-fork` | ``31337`` | +| `mainnet-ovm` | ``10`` | + +#### Defined in + +[packages/sdk/src/types/common.ts:19](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L19) + +___ + +### NetworkNameById + +• `Const` **NetworkNameById**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `1` | ``"mainnet"`` | +| `10` | ``"mainnet-ovm"`` | +| `31337` | ``"mainnet-fork"`` | +| `42` | ``"kovan"`` | +| `420` | ``"goerli-ovm"`` | +| `5` | ``"goerli"`` | +| `69` | ``"kovan-ovm"`` | + +#### Defined in + +[packages/sdk/src/types/common.ts:29](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/common.ts#L29) diff --git a/packages/sdk/docs/modules/types_exchange.md b/packages/sdk/docs/modules/types_exchange.md new file mode 100644 index 0000000000..3e33d24348 --- /dev/null +++ b/packages/sdk/docs/modules/types_exchange.md @@ -0,0 +1,63 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/exchange + +# Module: types/exchange + +## Table of contents + +### Type Aliases + +- [PriceResponse](types_exchange.md#priceresponse) +- [Rates](types_exchange.md#rates) +- [SynthExchange](types_exchange.md#synthexchange) + +## Type Aliases + +### PriceResponse + +Ƭ **PriceResponse**: `Record`<`string`, { `usd`: `number` ; `usd_24h_change`: `number` }\> + +#### Defined in + +[packages/sdk/src/types/exchange.ts:4](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/exchange.ts#L4) + +___ + +### Rates + +Ƭ **Rates**: `Record`<`string`, `Wei`\> + +#### Defined in + +[packages/sdk/src/types/exchange.ts:6](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/exchange.ts#L6) + +___ + +### SynthExchange + +Ƭ **SynthExchange**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `feesInUSD` | `string` | +| `fromAmount` | `string` | +| `fromAmountInUSD` | `string` | +| `fromSynth` | { `id`: `string` ; `name`: `string` ; `symbol`: `SynthSymbol` } | +| `fromSynth.id` | `string` | +| `fromSynth.name` | `string` | +| `fromSynth.symbol` | `SynthSymbol` | +| `gasPrice` | `string` | +| `id` | `string` | +| `timestamp` | `string` | +| `toAddress` | `string` | +| `toAmount` | `string` | +| `toAmountInUSD` | `string` | +| `toSynth` | { `id`: `string` ; `name`: `string` ; `symbol`: `SynthSymbol` } | +| `toSynth.id` | `string` | +| `toSynth.name` | `string` | +| `toSynth.symbol` | `SynthSymbol` | + +#### Defined in + +[packages/sdk/src/types/exchange.ts:8](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/exchange.ts#L8) diff --git a/packages/sdk/docs/modules/types_futures.md b/packages/sdk/docs/modules/types_futures.md new file mode 100644 index 0000000000..7883ed18e3 --- /dev/null +++ b/packages/sdk/docs/modules/types_futures.md @@ -0,0 +1,714 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/futures + +# Module: types/futures + +## Table of contents + +### Enumerations + +- [AccountExecuteFunctions](../enums/types_futures.AccountExecuteFunctions.md) +- [ConditionalOrderTypeEnum](../enums/types_futures.ConditionalOrderTypeEnum.md) +- [ContractOrderType](../enums/types_futures.ContractOrderType.md) +- [FuturesMarginType](../enums/types_futures.FuturesMarginType.md) +- [FuturesMarketAsset](../enums/types_futures.FuturesMarketAsset.md) +- [FuturesMarketKey](../enums/types_futures.FuturesMarketKey.md) +- [PositionSide](../enums/types_futures.PositionSide.md) +- [PotentialTradeStatus](../enums/types_futures.PotentialTradeStatus.md) + +### Interfaces + +- [FuturesMarketConfig](../interfaces/types_futures.FuturesMarketConfig.md) + +### Type Aliases + +- [ConditionalOrder](types_futures.md#conditionalorder) +- [DelayedOrder](types_futures.md#delayedorder) +- [FundingRateInput](types_futures.md#fundingrateinput) +- [FundingRateResponse](types_futures.md#fundingrateresponse) +- [FundingRateUpdate](types_futures.md#fundingrateupdate) +- [FuturesFilledPosition](types_futures.md#futuresfilledposition) +- [FuturesMarket](types_futures.md#futuresmarket) +- [FuturesOrderType](types_futures.md#futuresordertype) +- [FuturesOrderTypeDisplay](types_futures.md#futuresordertypedisplay) +- [FuturesPosition](types_futures.md#futuresposition) +- [FuturesPositionHistory](types_futures.md#futurespositionhistory) +- [FuturesPotentialTradeDetails](types_futures.md#futurespotentialtradedetails) +- [FuturesTrade](types_futures.md#futurestrade) +- [FuturesVolumes](types_futures.md#futuresvolumes) +- [MarginTransfer](types_futures.md#margintransfer) +- [MarketClosureReason](types_futures.md#marketclosurereason) +- [MarketWithIdleMargin](types_futures.md#marketwithidlemargin) +- [ModifyPositionOptions](types_futures.md#modifypositionoptions) +- [PerpsV3Market](types_futures.md#perpsv3market) +- [PositionDetail](types_futures.md#positiondetail) +- [PostTradeDetailsResponse](types_futures.md#posttradedetailsresponse) +- [SLTPOrderInputs](types_futures.md#sltporderinputs) +- [SmartMarginOrderInputs](types_futures.md#smartmarginorderinputs) +- [SmartMarginOrderType](types_futures.md#smartmarginordertype) +- [SynthSuspensionReason](types_futures.md#synthsuspensionreason) + +### Variables + +- [OrderEnumByType](types_futures.md#orderenumbytype) + +## Type Aliases + +### ConditionalOrder + +Ƭ **ConditionalOrder**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `asset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | +| `desiredFillPrice` | `T` | +| `id` | `number` | +| `isCancelling?` | `boolean` | +| `isExecutable?` | `boolean` | +| `isSlTp?` | `boolean` | +| `isStale?` | `boolean` | +| `marginDelta` | `T` | +| `market` | `string` | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `orderType` | [`ConditionalOrderTypeEnum`](../enums/types_futures.ConditionalOrderTypeEnum.md) | +| `orderTypeDisplay` | [`FuturesOrderTypeDisplay`](types_futures.md#futuresordertypedisplay) | +| `reduceOnly` | `boolean` | +| `side?` | [`PositionSide`](../enums/types_futures.PositionSide.md) | +| `size` | `T` | +| `sizeTxt?` | `string` | +| `subgraphId` | `string` | +| `targetPrice` | `T` \| ``null`` | +| `targetPriceTxt?` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:313](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L313) + +___ + +### DelayedOrder + +Ƭ **DelayedOrder**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `commitDeposit` | `T` | +| `desiredFillPrice` | `T` | +| `executableAtTimestamp` | `number` | +| `isOffchain` | `boolean` | +| `keeperDeposit` | `T` | +| `marketAddress` | `string` | +| `orderType` | [`FuturesOrderTypeDisplay`](types_futures.md#futuresordertypedisplay) | +| `side` | [`PositionSide`](../enums/types_futures.PositionSide.md) | +| `size` | `T` | +| `submittedAtTimestamp` | `number` | +| `targetRoundId` | `T` \| ``null`` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:336](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L336) + +___ + +### FundingRateInput + +Ƭ **FundingRateInput**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `currentFundingRate` | `Wei` \| `undefined` | +| `marketAddress` | `string` \| `undefined` | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `price` | `Wei` \| `undefined` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:4](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L4) + +___ + +### FundingRateResponse + +Ƭ **FundingRateResponse**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `asset` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `fundingRate` | `Wei` \| ``null`` | +| `fundingTitle` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:70](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L70) + +___ + +### FundingRateUpdate + +Ƭ **FundingRateUpdate**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `funding` | `Wei` | +| `timestamp` | `number` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:65](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L65) + +___ + +### FuturesFilledPosition + +Ƭ **FuturesFilledPosition**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accruedFunding` | `T` | +| `canLiquidatePosition` | `boolean` | +| `fundingIndex` | `number` | +| `initialLeverage` | `T` | +| `initialMargin` | `T` | +| `lastPrice` | `T` | +| `leverage` | `T` | +| `liquidationPrice` | `T` | +| `marginRatio` | `T` | +| `notionalValue` | `T` | +| `pnl` | `T` | +| `pnlPct` | `T` | +| `profitLoss` | `T` | +| `side` | [`PositionSide`](../enums/types_futures.PositionSide.md) | +| `size` | `T` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:229](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L229) + +___ + +### FuturesMarket + +Ƭ **FuturesMarket**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `appMaxLeverage` | `T` | +| `asset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | +| `assetHex` | `string` | +| `contractMaxLeverage` | `T` | +| `currentFundingRate` | `T` | +| `currentFundingVelocity` | `T` | +| `feeRates` | { `makerFee`: `T` ; `makerFeeDelayedOrder`: `T` ; `makerFeeOffchainDelayedOrder`: `T` ; `takerFee`: `T` ; `takerFeeDelayedOrder`: `T` ; `takerFeeOffchainDelayedOrder`: `T` } | +| `feeRates.makerFee` | `T` | +| `feeRates.makerFeeDelayedOrder` | `T` | +| `feeRates.makerFeeOffchainDelayedOrder` | `T` | +| `feeRates.takerFee` | `T` | +| `feeRates.takerFeeDelayedOrder` | `T` | +| `feeRates.takerFeeOffchainDelayedOrder` | `T` | +| `isSuspended` | `boolean` | +| `keeperDeposit` | `T` | +| `market` | `string` | +| `marketClosureReason` | [`SynthSuspensionReason`](types_futures.md#synthsuspensionreason) | +| `marketDebt` | `T` | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `marketLimitNative` | `T` | +| `marketLimitUsd` | `T` | +| `marketName` | `string` | +| `marketSize` | `T` | +| `marketSkew` | `T` | +| `minInitialMargin` | `T` | +| `openInterest` | { `long`: `T` ; `longPct`: `number` ; `longUSD`: `T` ; `short`: `T` ; `shortPct`: `number` ; `shortUSD`: `T` } | +| `openInterest.long` | `T` | +| `openInterest.longPct` | `number` | +| `openInterest.longUSD` | `T` | +| `openInterest.short` | `T` | +| `openInterest.shortPct` | `number` | +| `openInterest.shortUSD` | `T` | +| `settings` | { `delayedOrderConfirmWindow`: `number` ; `maxDelayTimeDelta`: `number` ; `maxMarketValue`: `T` ; `minDelayTimeDelta`: `number` ; `offchainDelayedOrderMaxAge`: `number` ; `offchainDelayedOrderMinAge`: `number` ; `skewScale`: `T` } | +| `settings.delayedOrderConfirmWindow` | `number` | +| `settings.maxDelayTimeDelta` | `number` | +| `settings.maxMarketValue` | `T` | +| `settings.minDelayTimeDelta` | `number` | +| `settings.offchainDelayedOrderMaxAge` | `number` | +| `settings.offchainDelayedOrderMinAge` | `number` | +| `settings.skewScale` | `T` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:19](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L19) + +___ + +### FuturesOrderType + +Ƭ **FuturesOrderType**: [`SmartMarginOrderType`](types_futures.md#smartmarginordertype) + +#### Defined in + +[packages/sdk/src/types/futures.ts:401](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L401) + +___ + +### FuturesOrderTypeDisplay + +Ƭ **FuturesOrderTypeDisplay**: ``"Next Price"`` \| ``"Limit"`` \| ``"Stop"`` \| ``"Market"`` \| ``"Liquidation"`` \| ``"Delayed"`` \| ``"Take Profit"`` \| ``"Stop Loss"`` \| ``"Delayed Market"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:297](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L297) + +___ + +### FuturesPosition + +Ƭ **FuturesPosition**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accessibleMargin` | `T` | +| `asset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `position` | [`FuturesFilledPosition`](types_futures.md#futuresfilledposition)<`T`\> \| ``null`` | +| `remainingMargin` | `T` | +| `stopLoss?` | [`ConditionalOrder`](types_futures.md#conditionalorder)<`T`\> | +| `takeProfit?` | [`ConditionalOrder`](types_futures.md#conditionalorder)<`T`\> | + +#### Defined in + +[packages/sdk/src/types/futures.ts:279](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L279) + +___ + +### FuturesPositionHistory + +Ƭ **FuturesPositionHistory**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `abstractAccount` | `string` | +| `account` | `string` | +| `accountType` | [`FuturesMarginType`](../enums/types_futures.FuturesMarginType.md) | +| `asset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | +| `avgEntryPrice` | `T` | +| `closeTimestamp` | `number` \| `undefined` | +| `entryPrice` | `T` | +| `exitPrice` | `T` | +| `feesPaid` | `T` | +| `id` | `Number` | +| `initialMargin` | `T` | +| `isLiquidated` | `boolean` | +| `isOpen` | `boolean` | +| `leverage` | `T` | +| `margin` | `T` | +| `market` | `string` | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `netFunding` | `T` | +| `netTransfers` | `T` | +| `openTimestamp` | `number` | +| `pnl` | `T` | +| `pnlWithFeesPaid` | `T` | +| `side` | [`PositionSide`](../enums/types_futures.PositionSide.md) | +| `size` | `T` | +| `timestamp` | `number` | +| `totalDeposits` | `T` | +| `totalVolume` | `T` | +| `trades` | `number` | +| `transactionHash` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:247](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L247) + +___ + +### FuturesPotentialTradeDetails + +Ƭ **FuturesPotentialTradeDetails**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `exceedsPriceProtection` | `boolean` | +| `fee` | `T` | +| `leverage` | `T` | +| `liqPrice` | `T` | +| `margin` | `T` | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `notionalValue` | `T` | +| `price` | `T` | +| `priceImpact` | `T` | +| `showStatus` | `boolean` | +| `side` | [`PositionSide`](../enums/types_futures.PositionSide.md) | +| `size` | `T` | +| `sizeDelta` | `T` | +| `status` | [`PotentialTradeStatus`](../enums/types_futures.PotentialTradeStatus.md) | +| `statusMessage` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:351](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L351) + +___ + +### FuturesTrade + +Ƭ **FuturesTrade**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `accountType` | [`FuturesMarginType`](../enums/types_futures.FuturesMarginType.md) | +| `asset` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | +| `feesPaid` | `T` | +| `keeperFeesPaid` | `T` | +| `margin` | `T` | +| `orderType` | [`FuturesOrderTypeDisplay`](types_futures.md#futuresordertypedisplay) | +| `pnl` | `T` | +| `positionClosed` | `boolean` | +| `positionId` | `string` | +| `positionSize` | `T` | +| `price` | `T` | +| `side` | [`PositionSide`](../enums/types_futures.PositionSide.md) | +| `size` | `T` | +| `timestamp` | `number` | +| `txnHash` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:403](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L403) + +___ + +### FuturesVolumes + +Ƭ **FuturesVolumes**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Index signature + +▪ [asset: `string`]: { `trades`: `T` ; `volume`: `T` } + +#### Defined in + +[packages/sdk/src/types/futures.ts:178](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L178) + +___ + +### MarginTransfer + +Ƭ **MarginTransfer**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `action` | `string` | +| `asset?` | [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) | +| `market?` | `string` | +| `size` | `number` | +| `timestamp` | `number` | +| `txHash` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:439](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L439) + +___ + +### MarketClosureReason + +Ƭ **MarketClosureReason**: [`SynthSuspensionReason`](types_futures.md#synthsuspensionreason) + +#### Defined in + +[packages/sdk/src/types/futures.ts:17](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L17) + +___ + +### MarketWithIdleMargin + +Ƭ **MarketWithIdleMargin**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `marketAddress` | `string` | +| `marketKey` | [`FuturesMarketKey`](../enums/types_futures.FuturesMarketKey.md) | +| `position` | [`FuturesPosition`](types_futures.md#futuresposition) | + +#### Defined in + +[packages/sdk/src/types/futures.ts:449](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L449) + +___ + +### ModifyPositionOptions + +Ƭ **ModifyPositionOptions**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `boolean` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `delayed?` | `boolean` | +| `estimationOnly?` | `T` | +| `offchain?` | `boolean` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:290](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L290) + +___ + +### PerpsV3Market + +Ƭ **PerpsV3Market**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `feedId` | `string` | +| `id` | `string` | +| `initialMarginFraction` | `string` | +| `liquidationRewardRatioD18` | `string` | +| `lockedOiPercent` | `string` | +| `maintenanceMarginFraction` | `string` | +| `makerFee` | `string` | +| `marketName` | `string` | +| `marketOwner` | `string` | +| `marketSymbol` | `string` | +| `maxFundingVelocity` | `string` | +| `maxLiquidationLimitAccumulationMultiplier` | `string` | +| `owner` | `string` | +| `perpsMarketId` | `string` | +| `skewScale` | `string` | +| `takerFee` | `string` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:495](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L495) + +___ + +### PositionDetail + +Ƭ **PositionDetail**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accessibleMargin` | `BigNumber` | +| `accruedFunding` | `BigNumber` | +| `liquidationPrice` | `BigNumber` | +| `notionalValue` | `BigNumber` | +| `order` | { `fee`: `BigNumber` ; `leverage`: `BigNumber` ; `pending`: `boolean` } | +| `order.fee` | `BigNumber` | +| `order.leverage` | `BigNumber` | +| `order.pending` | `boolean` | +| `orderPending` | `boolean` | +| `position` | { `fundingIndex`: `BigNumber` ; `lastPrice`: `BigNumber` ; `margin`: `BigNumber` ; `size`: `BigNumber` } | +| `position.fundingIndex` | `BigNumber` | +| `position.lastPrice` | `BigNumber` | +| `position.margin` | `BigNumber` | +| `position.size` | `BigNumber` | +| `profitLoss` | `BigNumber` | +| `remainingMargin` | `BigNumber` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:185](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L185) + +___ + +### PostTradeDetailsResponse + +Ƭ **PostTradeDetailsResponse**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `fee` | `BigNumber` | +| `liqPrice` | `BigNumber` | +| `margin` | `BigNumber` | +| `price` | `BigNumber` | +| `size` | `BigNumber` | +| `status` | `number` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:391](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L391) + +___ + +### SLTPOrderInputs + +Ƭ **SLTPOrderInputs**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `keeperEthDeposit` | `Wei` | +| `stopLoss?` | { `desiredFillPrice`: `Wei` ; `isCancelled?`: `boolean` ; `price`: `Wei` ; `sizeDelta`: `Wei` } | +| `stopLoss.desiredFillPrice` | `Wei` | +| `stopLoss.isCancelled?` | `boolean` | +| `stopLoss.price` | `Wei` | +| `stopLoss.sizeDelta` | `Wei` | +| `takeProfit?` | { `desiredFillPrice`: `Wei` ; `isCancelled?`: `boolean` ; `price`: `Wei` ; `sizeDelta`: `Wei` } | +| `takeProfit.desiredFillPrice` | `Wei` | +| `takeProfit.isCancelled?` | `boolean` | +| `takeProfit.price` | `Wei` | +| `takeProfit.sizeDelta` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:479](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L479) + +___ + +### SmartMarginOrderInputs + +Ƭ **SmartMarginOrderInputs**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `conditionalOrderInputs?` | { `feeCap`: `Wei` ; `orderType`: [`ConditionalOrderTypeEnum`](../enums/types_futures.ConditionalOrderTypeEnum.md) ; `price`: `Wei` ; `reduceOnly`: `boolean` } | +| `conditionalOrderInputs.feeCap` | `Wei` | +| `conditionalOrderInputs.orderType` | [`ConditionalOrderTypeEnum`](../enums/types_futures.ConditionalOrderTypeEnum.md) | +| `conditionalOrderInputs.price` | `Wei` | +| `conditionalOrderInputs.reduceOnly` | `boolean` | +| `desiredFillPrice` | `Wei` | +| `keeperEthDeposit?` | `Wei` | +| `marginDelta` | `Wei` | +| `sizeDelta` | `Wei` | +| `stopLoss?` | { `desiredFillPrice`: `Wei` ; `price`: `Wei` ; `sizeDelta`: `Wei` } | +| `stopLoss.desiredFillPrice` | `Wei` | +| `stopLoss.price` | `Wei` | +| `stopLoss.sizeDelta` | `Wei` | +| `takeProfit?` | { `desiredFillPrice`: `Wei` ; `price`: `Wei` ; `sizeDelta`: `Wei` } | +| `takeProfit.desiredFillPrice` | `Wei` | +| `takeProfit.price` | `Wei` | +| `takeProfit.sizeDelta` | `Wei` | +| `timeDelta?` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/futures.ts:455](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L455) + +___ + +### SmartMarginOrderType + +Ƭ **SmartMarginOrderType**: ``"market"`` \| ``"stop_market"`` \| ``"limit"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:400](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L400) + +___ + +### SynthSuspensionReason + +Ƭ **SynthSuspensionReason**: ``"system-upgrade"`` \| ``"market-closure"`` \| ``"circuit-breaker"`` \| ``"emergency"`` + +#### Defined in + +[packages/sdk/src/types/futures.ts:11](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L11) + +## Variables + +### OrderEnumByType + +• `Const` **OrderEnumByType**: `Record`<`string`, [`ContractOrderType`](../enums/types_futures.ContractOrderType.md)\> + +#### Defined in + +[packages/sdk/src/types/futures.ts:223](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/futures.ts#L223) diff --git a/packages/sdk/docs/modules/types_kwentaToken.md b/packages/sdk/docs/modules/types_kwentaToken.md new file mode 100644 index 0000000000..dbab0f02a6 --- /dev/null +++ b/packages/sdk/docs/modules/types_kwentaToken.md @@ -0,0 +1,69 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/kwentaToken + +# Module: types/kwentaToken + +## Table of contents + +### Type Aliases + +- [ClaimParams](types_kwentaToken.md#claimparams) +- [EpochData](types_kwentaToken.md#epochdata) +- [EscrowData](types_kwentaToken.md#escrowdata) + +## Type Aliases + +### ClaimParams + +Ƭ **ClaimParams**: [`number`, `string`, `string`, `string`[], `number`] + +#### Defined in + +[packages/sdk/src/types/kwentaToken.ts:3](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/kwentaToken.ts#L3) + +___ + +### EpochData + +Ƭ **EpochData**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `claims` | { `[address: string]`: { `amount`: `string` ; `index`: `number` ; `proof`: `string`[] }; } | +| `merkleRoot` | `string` | +| `period` | `number` | +| `tokenTotal` | `string` | + +#### Defined in + +[packages/sdk/src/types/kwentaToken.ts:5](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/kwentaToken.ts#L5) + +___ + +### EscrowData + +Ƭ **EscrowData**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `amount` | `T` | +| `date` | `string` | +| `fee` | `T` | +| `id` | `number` | +| `status` | ``"Vesting"`` \| ``"Vested"`` | +| `time` | `string` | +| `version` | ``1`` \| ``2`` | +| `vestable` | `T` | + +#### Defined in + +[packages/sdk/src/types/kwentaToken.ts:18](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/kwentaToken.ts#L18) diff --git a/packages/sdk/docs/modules/types_prices.md b/packages/sdk/docs/modules/types_prices.md new file mode 100644 index 0000000000..3cff4dc3cb --- /dev/null +++ b/packages/sdk/docs/modules/types_prices.md @@ -0,0 +1,156 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/prices + +# Module: types/prices + +## Table of contents + +### Type Aliases + +- [AssetKey](types_prices.md#assetkey) +- [CurrencyPrice](types_prices.md#currencyprice) +- [Price](types_prices.md#price) +- [PriceType](types_prices.md#pricetype) +- [Prices](types_prices.md#prices) +- [PricesListener](types_prices.md#priceslistener) +- [PricesMap](types_prices.md#pricesmap) +- [SynthPrice](types_prices.md#synthprice) +- [SynthPricesTuple](types_prices.md#synthpricestuple) + +## Type Aliases + +### AssetKey + +Ƭ **AssetKey**: [`FuturesMarketAsset`](../enums/types_futures.FuturesMarketAsset.md) \| ``"sUSD"`` + +#### Defined in + +[packages/sdk/src/types/prices.ts:13](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L13) + +___ + +### CurrencyPrice + +Ƭ **CurrencyPrice**: `BigNumberish` + +#### Defined in + +[packages/sdk/src/types/prices.ts:6](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L6) + +___ + +### Price + +Ƭ **Price**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `offChain?` | `T` | +| `onChain?` | `T` | + +#### Defined in + +[packages/sdk/src/types/prices.ts:8](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L8) + +___ + +### PriceType + +Ƭ **PriceType**: ``"on_chain"`` \| ``"off_chain"`` + +#### Defined in + +[packages/sdk/src/types/prices.ts:24](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L24) + +___ + +### Prices + +Ƭ **Prices**<`T`\>: `Record`<`string`, [`Price`](types_prices.md#price)<`T`\>\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/prices.ts:15](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L15) + +___ + +### PricesListener + +Ƭ **PricesListener**: (`updatedPrices`: { `prices`: [`PricesMap`](types_prices.md#pricesmap) ; `source`: ``"fetch"`` \| ``"stream"`` ; `type`: [`PriceType`](types_prices.md#pricetype) }) => `void` + +#### Type declaration + +▸ (`updatedPrices`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `updatedPrices` | `Object` | +| `updatedPrices.prices` | [`PricesMap`](types_prices.md#pricesmap) | +| `updatedPrices.source` | ``"fetch"`` \| ``"stream"`` | +| `updatedPrices.type` | [`PriceType`](types_prices.md#pricetype) | + +##### Returns + +`void` + +#### Defined in + +[packages/sdk/src/types/prices.ts:26](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L26) + +___ + +### PricesMap + +Ƭ **PricesMap**<`T`\>: `Partial`<`Record`<[`AssetKey`](types_prices.md#assetkey), `T`\>\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/prices.ts:17](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L17) + +___ + +### SynthPrice + +Ƭ **SynthPrice**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `rate` | `Wei` | +| `synth` | `string` | + +#### Defined in + +[packages/sdk/src/types/prices.ts:19](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L19) + +___ + +### SynthPricesTuple + +Ƭ **SynthPricesTuple**: [`string`[], [`CurrencyPrice`](types_prices.md#currencyprice)[]] + +#### Defined in + +[packages/sdk/src/types/prices.ts:7](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/prices.ts#L7) diff --git a/packages/sdk/docs/modules/types_staking.md b/packages/sdk/docs/modules/types_staking.md new file mode 100644 index 0000000000..0234b50ef8 --- /dev/null +++ b/packages/sdk/docs/modules/types_staking.md @@ -0,0 +1,67 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/staking + +# Module: types/staking + +## Table of contents + +### Type Aliases + +- [FuturesFeeForAccountProps](types_staking.md#futuresfeeforaccountprops) +- [FuturesFeeProps](types_staking.md#futuresfeeprops) +- [TradingRewardProps](types_staking.md#tradingrewardprops) + +## Type Aliases + +### FuturesFeeForAccountProps + +Ƭ **FuturesFeeForAccountProps**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `abstractAccount` | `string` | +| `account` | `string` | +| `accountType` | `string` | +| `feesPaid` | `BigNumber` | +| `keeperFeesPaid` | `BigNumber` | +| `timestamp` | `number` | + +#### Defined in + +[packages/sdk/src/types/staking.ts:9](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/staking.ts#L9) + +___ + +### FuturesFeeProps + +Ƭ **FuturesFeeProps**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `feesKwenta` | `BigNumber` | +| `timestamp` | `string` | + +#### Defined in + +[packages/sdk/src/types/staking.ts:18](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/staking.ts#L18) + +___ + +### TradingRewardProps + +Ƭ **TradingRewardProps**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `end?` | `number` | +| `period` | `number` \| `string` | +| `start?` | `number` | + +#### Defined in + +[packages/sdk/src/types/staking.ts:3](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/staking.ts#L3) diff --git a/packages/sdk/docs/modules/types_stats.md b/packages/sdk/docs/modules/types_stats.md new file mode 100644 index 0000000000..3c34d6b8c4 --- /dev/null +++ b/packages/sdk/docs/modules/types_stats.md @@ -0,0 +1,118 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/stats + +# Module: types/stats + +## Table of contents + +### Type Aliases + +- [AccountStat](types_stats.md#accountstat) +- [EnsInfo](types_stats.md#ensinfo) +- [FuturesCumulativeStats](types_stats.md#futurescumulativestats) +- [FuturesStat](types_stats.md#futuresstat) +- [Leaderboard](types_stats.md#leaderboard) + +## Type Aliases + +### AccountStat + +Ƭ **AccountStat**<`T`, `K`\>: [`FuturesStat`](types_stats.md#futuresstat)<`T`, `K`\> & { `rank`: `number` ; `rankText`: `string` ; `trader`: `string` ; `traderEns?`: `string` \| ``null`` ; `traderShort`: `string` } + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `string` | +| `K` | `string` | + +#### Defined in + +[packages/sdk/src/types/stats.ts:9](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/stats.ts#L9) + +___ + +### EnsInfo + +Ƭ **EnsInfo**: `Object` + +#### Index signature + +▪ [account: `string`]: `string` + +#### Defined in + +[packages/sdk/src/types/stats.ts:33](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/stats.ts#L33) + +___ + +### FuturesCumulativeStats + +Ƭ **FuturesCumulativeStats**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `averageTradeSize` | `string` | +| `totalLiquidations` | `string` | +| `totalTraders` | `string` | +| `totalTrades` | `string` | +| `totalVolume` | `string` | + +#### Defined in + +[packages/sdk/src/types/stats.ts:25](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/stats.ts#L25) + +___ + +### FuturesStat + +Ƭ **FuturesStat**<`T`, `K`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `string` | +| `K` | `string` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `account` | `string` | +| `liquidations` | `K` | +| `pnlWithFeesPaid` | `T` | +| `totalTrades` | `K` | +| `totalVolume` | `T` | + +#### Defined in + +[packages/sdk/src/types/stats.ts:1](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/stats.ts#L1) + +___ + +### Leaderboard + +Ƭ **Leaderboard**<`T`, `K`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `string` | +| `K` | `string` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `all` | [`AccountStat`](types_stats.md#accountstat)<`T`, `K`\>[] | +| `bottom` | [`AccountStat`](types_stats.md#accountstat)<`T`, `K`\>[] | +| `search` | [`AccountStat`](types_stats.md#accountstat)<`T`, `K`\>[] | +| `top` | [`AccountStat`](types_stats.md#accountstat)<`T`, `K`\>[] | +| `wallet` | [`AccountStat`](types_stats.md#accountstat)<`T`, `K`\>[] | + +#### Defined in + +[packages/sdk/src/types/stats.ts:17](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/stats.ts#L17) diff --git a/packages/sdk/docs/modules/types_synths.md b/packages/sdk/docs/modules/types_synths.md new file mode 100644 index 0000000000..b247ef2887 --- /dev/null +++ b/packages/sdk/docs/modules/types_synths.md @@ -0,0 +1,131 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/synths + +# Module: types/synths + +## Table of contents + +### Type Aliases + +- [Balances](types_synths.md#balances) +- [DeprecatedSynthBalance](types_synths.md#deprecatedsynthbalance) +- [SynthBalance](types_synths.md#synthbalance) +- [SynthBalancesMap](types_synths.md#synthbalancesmap) +- [SynthResult](types_synths.md#synthresult) +- [WalletTradesExchangeResult](types_synths.md#wallettradesexchangeresult) + +## Type Aliases + +### Balances + +Ƭ **Balances**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `balances` | [`SynthBalance`](types_synths.md#synthbalance)[] | +| `balancesMap` | [`SynthBalancesMap`](types_synths.md#synthbalancesmap) | +| `totalUSDBalance` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/synths.ts:13](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/synths.ts#L13) + +___ + +### DeprecatedSynthBalance + +Ƭ **DeprecatedSynthBalance**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `balance` | `Wei` | +| `currencyKey` | [`CurrencyKey`](types_common.md#currencykey) | +| `proxyAddress` | `string` | +| `usdBalance` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/synths.ts:41](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/synths.ts#L41) + +___ + +### SynthBalance + +Ƭ **SynthBalance**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `balance` | `T` | +| `currencyKey` | [`CurrencyKey`](types_common.md#currencykey) | +| `usdBalance` | `T` | + +#### Defined in + +[packages/sdk/src/types/synths.ts:5](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/synths.ts#L5) + +___ + +### SynthBalancesMap + +Ƭ **SynthBalancesMap**: `Partial`<{ `[key: string]`: [`SynthBalance`](types_synths.md#synthbalance); }\> + +#### Defined in + +[packages/sdk/src/types/synths.ts:11](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/synths.ts#L11) + +___ + +### SynthResult + +Ƭ **SynthResult**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `id` | `string` | +| `name` | `string` | +| `symbol` | `string` | +| `totalSupply` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/synths.ts:19](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/synths.ts#L19) + +___ + +### WalletTradesExchangeResult + +Ƭ **WalletTradesExchangeResult**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `feesInUSD` | `Wei` | +| `fromAmount` | `Wei` | +| `fromAmountInUSD` | `Wei` | +| `fromSynth` | `Partial`<[`SynthResult`](types_synths.md#synthresult)\> \| ``null`` | +| `gasPrice` | `Wei` | +| `hash` | `string` | +| `id` | `string` | +| `timestamp` | `number` | +| `toAddress` | `string` | +| `toAmount` | `Wei` | +| `toAmountInUSD` | `Wei` | +| `toSynth` | `Partial`<[`SynthResult`](types_synths.md#synthresult)\> \| ``null`` | + +#### Defined in + +[packages/sdk/src/types/synths.ts:26](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/synths.ts#L26) diff --git a/packages/sdk/docs/modules/types_system.md b/packages/sdk/docs/modules/types_system.md new file mode 100644 index 0000000000..9893f23e1b --- /dev/null +++ b/packages/sdk/docs/modules/types_system.md @@ -0,0 +1,31 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/system + +# Module: types/system + +## Table of contents + +### Enumerations + +- [OperationalStatus](../enums/types_system.OperationalStatus.md) + +### Type Aliases + +- [KwentaStatus](types_system.md#kwentastatus) + +## Type Aliases + +### KwentaStatus + +Ƭ **KwentaStatus**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `lastUpdatedAt?` | `number` | +| `message` | `string` | +| `status` | [`OperationalStatus`](../enums/types_system.OperationalStatus.md) | + +#### Defined in + +[packages/sdk/src/types/system.ts:7](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/system.ts#L7) diff --git a/packages/sdk/docs/modules/types_tokens.md b/packages/sdk/docs/modules/types_tokens.md new file mode 100644 index 0000000000..5518ed0947 --- /dev/null +++ b/packages/sdk/docs/modules/types_tokens.md @@ -0,0 +1,48 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/tokens + +# Module: types/tokens + +## Table of contents + +### Type Aliases + +- [Token](types_tokens.md#token) +- [TokenBalances](types_tokens.md#tokenbalances) + +## Type Aliases + +### Token + +Ƭ **Token**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `address` | `string` | +| `chainId` | [`NetworkId`](types_common.md#networkid) | +| `decimals` | `number` | +| `logoURI` | `string` | +| `name` | `string` | +| `symbol` | `string` | +| `tags` | `string`[] | + +#### Defined in + +[packages/sdk/src/types/tokens.ts:13](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/tokens.ts#L13) + +___ + +### TokenBalances + +Ƭ **TokenBalances**<`T`\>: `Record`<`string`, { `balance`: `T` ; `token`: [`Token`](types_tokens.md#token) }\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `Wei` | + +#### Defined in + +[packages/sdk/src/types/tokens.ts:5](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/tokens.ts#L5) diff --git a/packages/sdk/docs/modules/types_transactions.md b/packages/sdk/docs/modules/types_transactions.md new file mode 100644 index 0000000000..25c4911307 --- /dev/null +++ b/packages/sdk/docs/modules/types_transactions.md @@ -0,0 +1,102 @@ +[@kwenta/sdk](../README.md) / [Modules](../modules.md) / types/transactions + +# Module: types/transactions + +## Table of contents + +### Interfaces + +- [Emitter](../interfaces/types_transactions.Emitter.md) +- [EmitterListener](../interfaces/types_transactions.EmitterListener.md) +- [TransactionStatusData](../interfaces/types_transactions.TransactionStatusData.md) + +### Type Aliases + +- [GasLimitEstimate](types_transactions.md#gaslimitestimate) +- [GasPrice](types_transactions.md#gasprice) +- [GetCodeParams](types_transactions.md#getcodeparams) +- [RevertReasonParams](types_transactions.md#revertreasonparams) +- [TransactionEventCode](types_transactions.md#transactioneventcode) + +## Type Aliases + +### GasLimitEstimate + +Ƭ **GasLimitEstimate**: `BigNumber` \| ``null`` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:45](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L45) + +___ + +### GasPrice + +Ƭ **GasPrice**<`T`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `BigNumber` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `baseFeePerGas?` | `T` | +| `gasPrice?` | `T` | +| `maxFeePerGas?` | `T` | +| `maxPriorityFeePerGas?` | `T` | + +#### Defined in + +[packages/sdk/src/types/transactions.ts:38](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L38) + +___ + +### GetCodeParams + +Ƭ **GetCodeParams**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `blockNumber` | `number` | +| `networkId` | `number` | +| `provider` | `ethers.providers.Provider` | +| `tx` | `ethers.providers.TransactionResponse` | + +#### Defined in + +[packages/sdk/src/types/transactions.ts:31](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L31) + +___ + +### RevertReasonParams + +Ƭ **RevertReasonParams**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `blockNumber` | `number` | +| `networkId` | `number` | +| `provider` | `ethers.providers.Provider` | +| `txHash` | `string` | + +#### Defined in + +[packages/sdk/src/types/transactions.ts:24](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L24) + +___ + +### TransactionEventCode + +Ƭ **TransactionEventCode**: ``"txSent"`` \| ``"txConfirmed"`` \| ``"txFailed"`` \| ``"txError"`` + +#### Defined in + +[packages/sdk/src/types/transactions.ts:3](https://github.com/Kwenta/kwenta/blob/60f0875a3/packages/sdk/src/types/transactions.ts#L3) diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 288d52fa25..68f7230a04 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -12,6 +12,8 @@ "build": "tsc -b", "check-types": "tsc --noEmit", "generate-contract-types": "typechain --target ethers-v5 --out-dir ./src/contracts/types './src/contracts/abis/*.json' --show-stack-traces", + "preclean-docs": "rimraf docs", + "generate-docs": "typedoc", "bump-version": "npm version '$(cat package.json | jq -r '.version')'" }, "keywords": [], @@ -70,7 +72,10 @@ "@typechain/ethers-v5": "^11.0.0", "@types/bn.js": "^5.1.1", "@types/lodash": "^4.14.195", + "rimraf": "^5.0.1", "typechain": "^8.2.0", + "typedoc": "^0.24.8", + "typedoc-plugin-markdown": "^3.15.3", "typescript": "^5.1.3" } } diff --git a/packages/sdk/src/constants/futures.ts b/packages/sdk/src/constants/futures.ts index c1613ff050..ee81bdd7c7 100644 --- a/packages/sdk/src/constants/futures.ts +++ b/packages/sdk/src/constants/futures.ts @@ -38,6 +38,11 @@ export const MAIN_ENDPOINT_OP_MAINNET = export const MAIN_ENDPOINT_OP_GOERLI = 'https://api.thegraph.com/subgraphs/name/kwenta/optimism-goerli-main' +export const PERPS_V3_SUBGRAPH_URLS: Record = { + // TODO: Update perps v3 subgraph urls + 420: 'https://api.thegraph.com/subgraphs/name/rickk137/v3-perps-opt-goerli', +} + export const KWENTA_PYTH_SERVER = 'https://price.kwenta.io' export const PUBLIC_PYTH_SERVER = 'https://xc-mainnet.pyth.network' @@ -48,7 +53,7 @@ export const ORDERS_FETCH_SIZE = 500 export const ISOLATED_MARGIN_ORDER_TYPES: FuturesOrderType[] = ['market'] export const CROSS_MARGIN_ORDER_TYPES: SmartMarginOrderType[] = ['market', 'limit', 'stop_market'] -export const ORDER_KEEPER_ETH_DEPOSIT = wei(0.01) +export const MIN_ACCOUNT_KEEPER_BAL = wei(0.01) export const DEFAULT_DELAYED_LEVERAGE_CAP = wei(100) export const MAX_POSITION_BUFFER = 0.01 export const MIN_MARGIN_AMOUNT = wei(50) diff --git a/packages/sdk/src/constants/index.ts b/packages/sdk/src/constants/index.ts index 9040ce95e2..e7d53f6a8d 100644 --- a/packages/sdk/src/constants/index.ts +++ b/packages/sdk/src/constants/index.ts @@ -4,6 +4,7 @@ export * from './futures' export * from './global' export * from './number' export * from './period' +export * from './perpsv3' export * from './prices' export * from './staking' export * from './stats' diff --git a/packages/sdk/src/constants/perpsv3.ts b/packages/sdk/src/constants/perpsv3.ts new file mode 100644 index 0000000000..5fc98043f4 --- /dev/null +++ b/packages/sdk/src/constants/perpsv3.ts @@ -0,0 +1,27 @@ +// TODO: Make this dynamic + +import { FuturesMarketKey } from '../types' + +export const V3_SYNTH_MARKET_IDS = { + SNXUSD: 0, + SNXETH: 2, + SNXBTC: 3, +} as const + +export const V3_PERPS_MARKET_IDS = { + SNXETH: 5, +} + +export type V3SynthMarketKey = keyof typeof V3_SYNTH_MARKET_IDS +export type V3SynthMarketId = (typeof V3_SYNTH_MARKET_IDS)[V3SynthMarketKey] + +export type V3PerpsMarketKey = keyof typeof V3_PERPS_MARKET_IDS +export type V3PerpsMarketId = (typeof V3_PERPS_MARKET_IDS)[V3PerpsMarketKey] + +export const V3_PERPS_ID_TO_V2_MARKET_KEY: Record = { + [V3_PERPS_MARKET_IDS.SNXETH]: FuturesMarketKey.sETHPERP, +} + +export const V3_PERPS_ID_TO_SYNTH_ID: Record = { + [V3_PERPS_MARKET_IDS.SNXETH]: V3_SYNTH_MARKET_IDS.SNXETH, +} diff --git a/packages/sdk/src/contracts/abis/PerpsV3AccountProxy.json b/packages/sdk/src/contracts/abis/PerpsV3AccountProxy.json new file mode 100644 index 0000000000..4959b59ee6 --- /dev/null +++ b/packages/sdk/src/contracts/abis/PerpsV3AccountProxy.json @@ -0,0 +1,808 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "CannotSelfApprove", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestedIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "IndexOverrun", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "InvalidTransferRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenAlreadyMinted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TokenDoesNotExist", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "setAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "setBaseTokenURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] \ No newline at end of file diff --git a/packages/sdk/src/contracts/abis/PerpsV3MarketProxy.json b/packages/sdk/src/contracts/abis/PerpsV3MarketProxy.json new file mode 100644 index 0000000000..b5efc17125 --- /dev/null +++ b/packages/sdk/src/contracts/abis/PerpsV3MarketProxy.json @@ -0,0 +1,3565 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "which", + "type": "bytes32" + } + ], + "name": "FeatureUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "InvalidAccountId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "InvalidPermission", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "origin", + "type": "address" + } + ], + "name": "OnlyAccountTokenProxy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "PermissionDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "PermissionNotGranted", + "type": "error" + }, + { + "inputs": [], + "name": "PositionOutOfBounds", + "type": "error" + }, + { + "inputs": [], + "name": "ValueAlreadyInSet", + "type": "error" + }, + { + "inputs": [], + "name": "ValueNotInSet", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "AccountCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "createAccount", + "outputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedAccountId", + "type": "uint128" + } + ], + "name": "createAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountLastInteraction", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAccountPermissions", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "permissions", + "type": "bytes32[]" + } + ], + "internalType": "struct IAccountModule.AccountPermissions[]", + "name": "accountPerms", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAccountTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "grantPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "hasPermission", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "notifyAccountTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + } + ], + "name": "renouncePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "permission", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "revokePermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "MismatchAssociatedSystemKind", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "MissingAssociatedSystem", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "AssociatedSystemSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "getAssociatedSystem", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "initOrUpgradeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "registerUnmanagedSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationIsSterile", + "type": "error" + }, + { + "inputs": [], + "name": "NoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contr", + "type": "address" + } + ], + "name": "NotAContract", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NotNominated", + "type": "error" + }, + { + "inputs": [], + "name": "UpgradeSimulationFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerNominated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "self", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newNominatedOwner", + "type": "address" + } + ], + "name": "nominateNewOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nominatedOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceNomination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "simulateUpgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "InvalidMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "parameter", + "type": "string" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParameter", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToUint256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToInt256", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint128", + "type": "error" + }, + { + "inputs": [], + "name": "PerpsMarketNotInitialized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "globalPerpsMarketId", + "type": "uint128" + } + ], + "name": "FactoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "string", + "name": "marketName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "marketSymbol", + "type": "string" + } + ], + "name": "MarketCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "requestedMarketId", + "type": "uint128" + }, + { + "internalType": "string", + "name": "marketName", + "type": "string" + }, + { + "internalType": "string", + "name": "marketSymbol", + "type": "string" + } + ], + "name": "createMarket", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initializeFactory", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + } + ], + "name": "minimumCredit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + } + ], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + } + ], + "name": "reportedDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISpotMarketSystem", + "name": "spotMarket", + "type": "address" + } + ], + "name": "setSpotMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISynthetixSystem", + "name": "synthetix", + "type": "address" + } + ], + "name": "setSynthetix", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "AccountLiquidatable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "AccountNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawAmount", + "type": "uint256" + } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + } + ], + "name": "InsufficientCollateralAvailableForWithdraw", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "amountDelta", + "type": "int256" + } + ], + "name": "InvalidAmountDelta", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositAmount", + "type": "uint256" + } + ], + "name": "MaxCollateralExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint128ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "PendingOrderExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "PriceFeedNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "SynthNotEnabledForCollateral", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amountDelta", + "type": "int256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "CollateralModified", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getAvailableMargin", + "outputs": [ + { + "internalType": "int256", + "name": "availableMargin", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getCollateralAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getOpenPosition", + "outputs": [ + { + "internalType": "int256", + "name": "totalPnl", + "type": "int256" + }, + { + "internalType": "int256", + "name": "accruedFunding", + "type": "int256" + }, + { + "internalType": "int128", + "name": "positionSize", + "type": "int128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getRequiredMargins", + "outputs": [ + { + "internalType": "uint256", + "name": "requiredInitialMargin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredMaintenanceMargin", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getWithdrawableMargin", + "outputs": [ + { + "internalType": "int256", + "name": "withdrawableMargin", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "int256", + "name": "amountDelta", + "type": "int256" + } + ], + "name": "modifyCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "totalAccountOpenInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "totalCollateralValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "currentFundingRate", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "currentFundingVelocity", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "orderSize", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "fillPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMarketSummary", + "outputs": [ + { + "components": [ + { + "internalType": "int256", + "name": "skew", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxOpenInterest", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "currentFundingRate", + "type": "int256" + }, + { + "internalType": "int256", + "name": "currentFundingVelocity", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "indexPrice", + "type": "uint256" + } + ], + "internalType": "struct IPerpsMarketModule.MarketSummary", + "name": "summary", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "indexPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "maxOpenInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "metadata", + "outputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "size", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "skew", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + } + ], + "name": "AcceptablePriceExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "availableMargin", + "type": "int256" + }, + { + "internalType": "uint256", + "name": "minMargin", + "type": "uint256" + } + ], + "name": "InsufficientMargin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + } + ], + "name": "InvalidSettlementStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "newSideSize", + "type": "int256" + } + ], + "name": "MaxOpenInterestReached", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowInt256ToInt128", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroSizeOrder", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "enum SettlementStrategy.Type", + "name": "orderType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expirationTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "OrderCommitted", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrder.OrderCommitmentRequest", + "name": "commitment", + "type": "tuple" + } + ], + "name": "commitOrder", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrder.OrderCommitmentRequest", + "name": "request", + "type": "tuple" + } + ], + "internalType": "struct AsyncOrder.Data", + "name": "retOrder", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "fees", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + } + ], + "name": "computeOrderFees", + "outputs": [ + { + "internalType": "uint256", + "name": "orderFees", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "getOrder", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "internalType": "uint128", + "name": "settlementStrategyId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "internalType": "struct AsyncOrder.OrderCommitmentRequest", + "name": "request", + "type": "tuple" + } + ], + "internalType": "struct AsyncOrder.Data", + "name": "order", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "leftover", + "type": "uint256" + } + ], + "name": "InsufficientMarginError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "string[]", + "name": "urls", + "type": "string[]" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "bytes4", + "name": "callbackFunction", + "type": "bytes4" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "OffchainLookup", + "type": "error" + }, + { + "inputs": [], + "name": "OrderNotValid", + "type": "error" + }, + { + "inputs": [], + "name": "OverflowUint256ToUint64", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "deviation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tolerance", + "type": "uint256" + } + ], + "name": "PriceDeviationToleranceExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + } + ], + "name": "SettlementStrategyNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementExpiration", + "type": "uint256" + } + ], + "name": "SettlementWindowExpired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementTime", + "type": "uint256" + } + ], + "name": "SettlementWindowNotOpen", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "skew", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "size", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "sizeDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "currentFundingRate", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "currentFundingVelocity", + "type": "int256" + } + ], + "name": "MarketUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fillPrice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "pnl", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int128", + "name": "sizeDelta", + "type": "int128" + }, + { + "indexed": false, + "internalType": "int128", + "name": "newSize", + "type": "int128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "referralFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collectedFees", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "settler", + "type": "address" + } + ], + "name": "OrderSettled", + "type": "event" + }, + { + "inputs": [], + "name": "PRECISION", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "settle", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "settlePythOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "FeatureFlagAllowAllSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "FeatureFlagAllowlistRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "FeatureFlagDeniersReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "FeatureFlagDenyAllSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addToFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getDeniers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagAllowlist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + } + ], + "name": "getFeatureFlagDenyAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isFeatureAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeFromFeatureFlagAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "deniers", + "type": "address[]" + } + ], + "name": "setDeniers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "allowAll", + "type": "bool" + } + ], + "name": "setFeatureFlagAllowAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "feature", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "denyAll", + "type": "bool" + } + ], + "name": "setFeatureFlagDenyAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "NotEligibleForLiquidation", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "fullLiquidation", + "type": "bool" + } + ], + "name": "AccountLiquidated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + }, + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountLiquidated", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int128", + "name": "currentPositionSize", + "type": "int128" + } + ], + "name": "PositionLiquidated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "accountId", + "type": "uint128" + } + ], + "name": "liquidate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidateFlagged", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxFundingVelocity", + "type": "uint256" + } + ], + "name": "FundingParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "initialMarginRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maintenanceMarginRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationRewardRatioD18", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxSecondsInLiquidationWindow", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minimumPositionMargin", + "type": "uint256" + } + ], + "name": "LiquidationParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedOiRatioD18", + "type": "uint256" + } + ], + "name": "LockedOiRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + } + ], + "name": "MarketPriceDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + } + ], + "name": "MaxMarketSizeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "makerFeeRatio", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "takerFeeRatio", + "type": "uint256" + } + ], + "name": "OrderFeesSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "settlementDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceWindowDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceVerificationContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeviationTolerance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "indexed": false, + "internalType": "struct SettlementStrategy.Data", + "name": "strategy", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + } + ], + "name": "SettlementStrategyAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "SettlementStrategyEnabled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "components": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "settlementDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceWindowDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceVerificationContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeviationTolerance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "internalType": "struct SettlementStrategy.Data", + "name": "strategy", + "type": "tuple" + } + ], + "name": "addSettlementStrategy", + "outputs": [ + { + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getFundingParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFundingVelocity", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getLiquidationParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "initialMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maintenanceMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSecondsInLiquidationWindow", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getLockedOiRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getMaxMarketSize", + "outputs": [ + { + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + } + ], + "name": "getOrderFees", + "outputs": [ + { + "internalType": "uint256", + "name": "makerFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takerFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + } + ], + "name": "getSettlementStrategy", + "outputs": [ + { + "components": [ + { + "internalType": "enum SettlementStrategy.Type", + "name": "strategyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "settlementDelay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "settlementWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceWindowDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceVerificationContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "uint256", + "name": "settlementReward", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDeviationTolerance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "internalType": "struct SettlementStrategy.Data", + "name": "settlementStrategy", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "skewScale", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFundingVelocity", + "type": "uint256" + } + ], + "name": "setFundingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "initialMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maintenanceMarginRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationRewardRatioD18", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSecondsInLiquidationWindow", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minimumPositionMargin", + "type": "uint256" + } + ], + "name": "setLiquidationParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "lockedOiRatioD18", + "type": "uint256" + } + ], + "name": "setLockedOiRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxMarketSize", + "type": "uint256" + } + ], + "name": "setMaxMarketSize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "makerFeeRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takerFeeRatio", + "type": "uint256" + } + ], + "name": "setOrderFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "marketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "strategyId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "setSettlementStrategyEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "perpsMarketId", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "feedId", + "type": "bytes32" + } + ], + "name": "updatePriceData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "invalidFeeCollector", + "type": "address" + } + ], + "name": "InvalidFeeCollectorInterface", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "name": "InvalidReferrerShareRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "name": "FeeCollectorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "minLiquidationRewardUsd", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "maxLiquidationRewardUsd", + "type": "uint256" + } + ], + "name": "LiquidationRewardGuardsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + } + ], + "name": "MaxCollateralAmountSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "name": "ReferrerShareUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128[]", + "name": "newSynthDeductionPriority", + "type": "uint128[]" + } + ], + "name": "SynthDeductionPrioritySet", + "type": "event" + }, + { + "inputs": [], + "name": "getFeeCollector", + "outputs": [ + { + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLiquidationRewardGuards", + "outputs": [ + { + "internalType": "uint256", + "name": "minLiquidationRewardUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationRewardUsd", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + } + ], + "name": "getMaxCollateralAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "getReferrerShare", + "outputs": [ + { + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSynthDeductionPriority", + "outputs": [ + { + "internalType": "uint128[]", + "name": "", + "type": "uint128[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeCollector", + "type": "address" + } + ], + "name": "setFeeCollector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minLiquidationRewardUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationRewardUsd", + "type": "uint256" + } + ], + "name": "setLiquidationRewardGuards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "synthMarketId", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + } + ], + "name": "setMaxCollateralAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128[]", + "name": "newSynthDeductionPriority", + "type": "uint128[]" + } + ], + "name": "setSynthDeductionPriority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalGlobalCollateralValue", + "outputs": [ + { + "internalType": "uint256", + "name": "totalCollateralValue", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shareRatioD18", + "type": "uint256" + } + ], + "name": "updateReferrerShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/sdk/src/contracts/constants.ts b/packages/sdk/src/contracts/constants.ts index 340970603c..9aa2d125d6 100644 --- a/packages/sdk/src/contracts/constants.ts +++ b/packages/sdk/src/contracts/constants.ts @@ -60,6 +60,9 @@ export const ADDRESSES: Record> = { 10: '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9', 420: '0xebaeaad9236615542844adc5c149f86c36ad1136', }, + SNXUSD: { + 420: '0xe487Ad4291019b33e2230F8E2FB1fb6490325260', + }, Synthetix: { 1: '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F', 5: '0x51f44ca59b867E005e48FA573Cb8df83FC7f7597', @@ -147,4 +150,10 @@ export const ADDRESSES: Record> = { 10: '0x54581A23F62D147AC76d454f0b3eF77F9D766058', 420: '0x4259a2004A1E110A86564ff1441c37F1461F344F', }, + PerpsV3MarketProxy: { + 420: '0xf272382cB3BE898A8CdB1A23BE056fA2Fcf4513b', + }, + PerpsV3AccountProxy: { + 420: '0x01C2f64ABd46AF20950736f3C3e1a9cfc5c36c82', + }, } diff --git a/packages/sdk/src/contracts/index.ts b/packages/sdk/src/contracts/index.ts index 93148a7528..33b670c585 100644 --- a/packages/sdk/src/contracts/index.ts +++ b/packages/sdk/src/contracts/index.ts @@ -17,12 +17,14 @@ import MultipleMerkleDistributorPerpsV2ABI from './abis/MultipleMerkleDistributo import PerpsV2MarketABI from './abis/PerpsV2Market.json' import PerpsV2MarketDataABI from './abis/PerpsV2MarketData.json' import PerpsV2MarketSettingsABI from './abis/PerpsV2MarketSettings.json' +import PerpsV3MarketProxyABI from './abis/PerpsV3MarketProxy.json' import RewardEscrowABI from './abis/RewardEscrow.json' import RewardEscrowV2ABI from './abis/RewardEscrowV2.json' import StakingRewardsABI from './abis/StakingRewards.json' import SupplyScheduleABI from './abis/SupplySchedule.json' import SynthRedeemerABI from './abis/SynthRedeemer.json' import SystemStatusABI from './abis/SystemStatus.json' +import PerpsV3AccountProxyABI from './abis/PerpsV3AccountProxy.json' import { ADDRESSES } from './constants' import { SmartMarginAccountFactory__factory, @@ -49,8 +51,10 @@ import { BatchClaimer__factory, MultipleMerkleDistributorOp__factory, MultipleMerkleDistributorPerpsV2__factory, + PerpsV3MarketProxy__factory, RewardEscrowV2__factory, KwentaStakingRewardsV2__factory, + PerpsV3AccountProxy__factory, } from './types' import { PerpsV2MarketData__factory } from './types/factories/PerpsV2MarketData__factory' import { PerpsV2MarketSettings__factory } from './types/factories/PerpsV2MarketSettings__factory' @@ -114,6 +118,9 @@ export const getContractsByNetwork = ( SUSD: ADDRESSES.SUSD[networkId] ? ERC20__factory.connect(ADDRESSES.SUSD[networkId], provider) : undefined, + SNXUSD: ADDRESSES.SNXUSD[networkId] + ? ERC20__factory.connect(ADDRESSES.SNXUSD[networkId], provider) + : undefined, SmartMarginAccountFactory: ADDRESSES.SmartMarginAccountFactory[networkId] ? SmartMarginAccountFactory__factory.connect( ADDRESSES.SmartMarginAccountFactory[networkId], @@ -178,6 +185,12 @@ export const getContractsByNetwork = ( RewardEscrowV2: ADDRESSES.RewardEscrowV2[networkId] ? RewardEscrowV2__factory.connect(ADDRESSES.RewardEscrowV2[networkId], provider) : undefined, + perpsV3MarketProxy: ADDRESSES.PerpsV3MarketProxy[networkId] + ? PerpsV3MarketProxy__factory.connect(ADDRESSES.PerpsV3MarketProxy[networkId], provider) + : undefined, + perpsV3AccountProxy: ADDRESSES.PerpsV3AccountProxy[networkId] + ? PerpsV3AccountProxy__factory.connect(ADDRESSES.PerpsV3AccountProxy[networkId], provider) + : undefined, } } @@ -246,12 +259,21 @@ export const getMulticallContractsByNetwork = (networkId: NetworkId) => { DappMaintenance: ADDRESSES.DappMaintenance[networkId] ? new EthCallContract(ADDRESSES.DappMaintenance[networkId], DappMaintenanceABI) : undefined, + SNXUSD: ADDRESSES.SNXUSD[networkId] + ? new EthCallContract(ADDRESSES.SNXUSD[networkId], ERC20ABI) + : undefined, KwentaStakingRewardsV2: ADDRESSES.KwentaStakingRewardsV2[networkId] ? new EthCallContract(ADDRESSES.KwentaStakingRewardsV2[networkId], KwentaStakingRewardsV2ABI) : undefined, RewardEscrowV2: ADDRESSES.RewardEscrowV2[networkId] ? new EthCallContract(ADDRESSES.RewardEscrowV2[networkId], RewardEscrowV2ABI) : undefined, + perpsV3MarketProxy: ADDRESSES.PerpsV3MarketProxy[networkId] + ? new EthCallContract(ADDRESSES.PerpsV3MarketProxy[networkId], PerpsV3MarketProxyABI) + : undefined, + perpsV3AccountProxy: ADDRESSES.PerpsV3AccountProxy[networkId] + ? new EthCallContract(ADDRESSES.PerpsV3AccountProxy[networkId], PerpsV3AccountProxyABI) + : undefined, } } diff --git a/packages/sdk/src/contracts/types/BatchClaimer.ts b/packages/sdk/src/contracts/types/BatchClaimer.ts index c11250e92f..bfcf9da4f2 100644 --- a/packages/sdk/src/contracts/types/BatchClaimer.ts +++ b/packages/sdk/src/contracts/types/BatchClaimer.ts @@ -2,117 +2,133 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IMultipleMerkleDistributor { - export type ClaimsStruct = { - index: PromiseOrValue - account: PromiseOrValue - amount: PromiseOrValue - merkleProof: PromiseOrValue[] - epoch: PromiseOrValue - } - - export type ClaimsStructOutput = [BigNumber, string, BigNumber, string[], BigNumber] & { - index: BigNumber - account: string - amount: BigNumber - merkleProof: string[] - epoch: BigNumber - } + export type ClaimsStruct = { + index: BigNumberish; + account: string; + amount: BigNumberish; + merkleProof: BytesLike[]; + epoch: BigNumberish; + }; + + export type ClaimsStructOutput = [ + BigNumber, + string, + BigNumber, + string[], + BigNumber + ] & { + index: BigNumber; + account: string; + amount: BigNumber; + merkleProof: string[]; + epoch: BigNumber; + }; } export interface BatchClaimerInterface extends utils.Interface { - functions: { - 'claimMultiple(address[],tuple[][])': FunctionFragment - } + functions: { + "claimMultiple(address[],tuple[][])": FunctionFragment; + }; - getFunction(nameOrSignatureOrTopic: 'claimMultiple'): FunctionFragment + getFunction(nameOrSignatureOrTopic: "claimMultiple"): FunctionFragment; - encodeFunctionData( - functionFragment: 'claimMultiple', - values: [PromiseOrValue[], IMultipleMerkleDistributor.ClaimsStruct[][]] - ): string + encodeFunctionData( + functionFragment: "claimMultiple", + values: [string[], IMultipleMerkleDistributor.ClaimsStruct[][]] + ): string; - decodeFunctionResult(functionFragment: 'claimMultiple', data: BytesLike): Result + decodeFunctionResult( + functionFragment: "claimMultiple", + data: BytesLike + ): Result; - events: {} + events: {}; } export interface BatchClaimer extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: BatchClaimerInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - claimMultiple( - _distributors: PromiseOrValue[], - _claims: IMultipleMerkleDistributor.ClaimsStruct[][], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - claimMultiple( - _distributors: PromiseOrValue[], - _claims: IMultipleMerkleDistributor.ClaimsStruct[][], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - claimMultiple( - _distributors: PromiseOrValue[], - _claims: IMultipleMerkleDistributor.ClaimsStruct[][], - overrides?: CallOverrides - ): Promise - } - - filters: {} - - estimateGas: { - claimMultiple( - _distributors: PromiseOrValue[], - _claims: IMultipleMerkleDistributor.ClaimsStruct[][], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - populateTransaction: { - claimMultiple( - _distributors: PromiseOrValue[], - _claims: IMultipleMerkleDistributor.ClaimsStruct[][], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: BatchClaimerInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + claimMultiple( + _distributors: string[], + _claims: IMultipleMerkleDistributor.ClaimsStruct[][], + overrides?: Overrides & { from?: string } + ): Promise; + }; + + claimMultiple( + _distributors: string[], + _claims: IMultipleMerkleDistributor.ClaimsStruct[][], + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + claimMultiple( + _distributors: string[], + _claims: IMultipleMerkleDistributor.ClaimsStruct[][], + overrides?: CallOverrides + ): Promise; + }; + + filters: {}; + + estimateGas: { + claimMultiple( + _distributors: string[], + _claims: IMultipleMerkleDistributor.ClaimsStruct[][], + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + claimMultiple( + _distributors: string[], + _claims: IMultipleMerkleDistributor.ClaimsStruct[][], + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/DappMaintenance.ts b/packages/sdk/src/contracts/types/DappMaintenance.ts index d51da67f3d..30dcae334c 100644 --- a/packages/sdk/src/contracts/types/DappMaintenance.ts +++ b/packages/sdk/src/contracts/types/DappMaintenance.ts @@ -2,313 +2,378 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface DappMaintenanceInterface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'isPausedSX()': FunctionFragment - 'isPausedStaking()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'setMaintenanceModeAll(bool)': FunctionFragment - 'setMaintenanceModeSX(bool)': FunctionFragment - 'setMaintenanceModeStaking(bool)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'isPausedSX' - | 'isPausedStaking' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'setMaintenanceModeAll' - | 'setMaintenanceModeSX' - | 'setMaintenanceModeStaking' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'isPausedSX', values?: undefined): string - encodeFunctionData(functionFragment: 'isPausedStaking', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData( - functionFragment: 'setMaintenanceModeAll', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaintenanceModeSX', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaintenanceModeStaking', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isPausedSX', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isPausedStaking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaintenanceModeAll', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaintenanceModeSX', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaintenanceModeStaking', data: BytesLike): Result - - events: { - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'SXMaintenance(bool)': EventFragment - 'StakingMaintenance(bool)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SXMaintenance'): EventFragment - getEvent(nameOrSignatureOrTopic: 'StakingMaintenance'): EventFragment + functions: { + "acceptOwnership()": FunctionFragment; + "isPausedSX()": FunctionFragment; + "isPausedStaking()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "setMaintenanceModeAll(bool)": FunctionFragment; + "setMaintenanceModeSX(bool)": FunctionFragment; + "setMaintenanceModeStaking(bool)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "isPausedSX" + | "isPausedStaking" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "setMaintenanceModeAll" + | "setMaintenanceModeSX" + | "setMaintenanceModeStaking" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isPausedSX", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isPausedStaking", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "setMaintenanceModeAll", + values: [boolean] + ): string; + encodeFunctionData( + functionFragment: "setMaintenanceModeSX", + values: [boolean] + ): string; + encodeFunctionData( + functionFragment: "setMaintenanceModeStaking", + values: [boolean] + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isPausedSX", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isPausedStaking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMaintenanceModeAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaintenanceModeSX", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaintenanceModeStaking", + data: BytesLike + ): Result; + + events: { + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "SXMaintenance(bool)": EventFragment; + "StakingMaintenance(bool)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SXMaintenance"): EventFragment; + getEvent(nameOrSignatureOrTopic: "StakingMaintenance"): EventFragment; } export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface SXMaintenanceEventObject { - isPaused: boolean + isPaused: boolean; } -export type SXMaintenanceEvent = TypedEvent<[boolean], SXMaintenanceEventObject> +export type SXMaintenanceEvent = TypedEvent< + [boolean], + SXMaintenanceEventObject +>; -export type SXMaintenanceEventFilter = TypedEventFilter +export type SXMaintenanceEventFilter = TypedEventFilter; export interface StakingMaintenanceEventObject { - isPaused: boolean + isPaused: boolean; } -export type StakingMaintenanceEvent = TypedEvent<[boolean], StakingMaintenanceEventObject> +export type StakingMaintenanceEvent = TypedEvent< + [boolean], + StakingMaintenanceEventObject +>; -export type StakingMaintenanceEventFilter = TypedEventFilter +export type StakingMaintenanceEventFilter = + TypedEventFilter; export interface DappMaintenance extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - interface: DappMaintenanceInterface + interface: DappMaintenanceInterface; - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - isPausedSX(overrides?: CallOverrides): Promise<[boolean]> + isPausedSX(overrides?: CallOverrides): Promise<[boolean]>; - isPausedStaking(overrides?: CallOverrides): Promise<[boolean]> + isPausedStaking(overrides?: CallOverrides): Promise<[boolean]>; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise<[string]> + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - owner(overrides?: CallOverrides): Promise<[string]> + owner(overrides?: CallOverrides): Promise<[string]>; - setMaintenanceModeAll( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeAll( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeSX( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeSX( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeStaking( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + setMaintenanceModeStaking( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + }; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - isPausedSX(overrides?: CallOverrides): Promise + isPausedSX(overrides?: CallOverrides): Promise; - isPausedStaking(overrides?: CallOverrides): Promise + isPausedStaking(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setMaintenanceModeAll( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeAll( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeSX( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeSX( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeStaking( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeStaking( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; - isPausedSX(overrides?: CallOverrides): Promise + isPausedSX(overrides?: CallOverrides): Promise; - isPausedStaking(overrides?: CallOverrides): Promise + isPausedStaking(overrides?: CallOverrides): Promise; - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setMaintenanceModeAll( - isPaused: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setMaintenanceModeAll( + isPaused: boolean, + overrides?: CallOverrides + ): Promise; - setMaintenanceModeSX( - isPaused: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setMaintenanceModeSX( + isPaused: boolean, + overrides?: CallOverrides + ): Promise; - setMaintenanceModeStaking( - isPaused: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + setMaintenanceModeStaking( + isPaused: boolean, + overrides?: CallOverrides + ): Promise; + }; - filters: { - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter + filters: { + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; - 'SXMaintenance(bool)'(isPaused?: null): SXMaintenanceEventFilter - SXMaintenance(isPaused?: null): SXMaintenanceEventFilter + "SXMaintenance(bool)"(isPaused?: null): SXMaintenanceEventFilter; + SXMaintenance(isPaused?: null): SXMaintenanceEventFilter; - 'StakingMaintenance(bool)'(isPaused?: null): StakingMaintenanceEventFilter - StakingMaintenance(isPaused?: null): StakingMaintenanceEventFilter - } + "StakingMaintenance(bool)"(isPaused?: null): StakingMaintenanceEventFilter; + StakingMaintenance(isPaused?: null): StakingMaintenanceEventFilter; + }; - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - isPausedSX(overrides?: CallOverrides): Promise + isPausedSX(overrides?: CallOverrides): Promise; - isPausedStaking(overrides?: CallOverrides): Promise + isPausedStaking(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setMaintenanceModeAll( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeAll( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeSX( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeSX( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeStaking( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + setMaintenanceModeStaking( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + }; - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - isPausedSX(overrides?: CallOverrides): Promise + isPausedSX(overrides?: CallOverrides): Promise; - isPausedStaking(overrides?: CallOverrides): Promise + isPausedStaking(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setMaintenanceModeAll( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeAll( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeSX( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMaintenanceModeSX( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setMaintenanceModeStaking( - isPaused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + setMaintenanceModeStaking( + isPaused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/ERC20.ts b/packages/sdk/src/contracts/types/ERC20.ts index 1de4906073..5a675444d2 100644 --- a/packages/sdk/src/contracts/types/ERC20.ts +++ b/packages/sdk/src/contracts/types/ERC20.ts @@ -2,437 +2,469 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface ERC20Interface extends utils.Interface { - functions: { - 'name()': FunctionFragment - 'approve(address,uint256)': FunctionFragment - 'mint(uint256)': FunctionFragment - 'totalSupply()': FunctionFragment - 'transferFrom(address,address,uint256)': FunctionFragment - 'decimals()': FunctionFragment - 'increaseAllowance(address,uint256)': FunctionFragment - 'balanceOf(address)': FunctionFragment - 'symbol()': FunctionFragment - 'decreaseAllowance(address,uint256)': FunctionFragment - 'transfer(address,uint256)': FunctionFragment - 'allowance(address,address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'name' - | 'approve' - | 'mint' - | 'totalSupply' - | 'transferFrom' - | 'decimals' - | 'increaseAllowance' - | 'balanceOf' - | 'symbol' - | 'decreaseAllowance' - | 'transfer' - | 'allowance' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'name', values?: undefined): string - encodeFunctionData( - functionFragment: 'approve', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'mint', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string - encodeFunctionData( - functionFragment: 'transferFrom', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'decimals', values?: undefined): string - encodeFunctionData( - functionFragment: 'increaseAllowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'symbol', values?: undefined): string - encodeFunctionData( - functionFragment: 'decreaseAllowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transfer', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'allowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result - - events: { - 'Transfer(address,address,uint256)': EventFragment - 'Approval(address,address,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment + functions: { + "name()": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "mint(uint256)": FunctionFragment; + "totalSupply()": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "decimals()": FunctionFragment; + "increaseAllowance(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "symbol()": FunctionFragment; + "decreaseAllowance(address,uint256)": FunctionFragment; + "transfer(address,uint256)": FunctionFragment; + "allowance(address,address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "name" + | "approve" + | "mint" + | "totalSupply" + | "transferFrom" + | "decimals" + | "increaseAllowance" + | "balanceOf" + | "symbol" + | "decreaseAllowance" + | "transfer" + | "allowance" + ): FunctionFragment; + + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "mint", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "decreaseAllowance", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [string, string] + ): string; + + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + + events: { + "Transfer(address,address,uint256)": EventFragment; + "Approval(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; } export interface TransferEventObject { - from: string - to: string - value: BigNumber + from: string; + to: string; + value: BigNumber; } -export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject> +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; -export type TransferEventFilter = TypedEventFilter +export type TransferEventFilter = TypedEventFilter; export interface ApprovalEventObject { - owner: string - spender: string - value: BigNumber + owner: string; + spender: string; + value: BigNumber; } -export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject> +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; -export type ApprovalEventFilter = TypedEventFilter +export type ApprovalEventFilter = TypedEventFilter; export interface ERC20 extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: ERC20Interface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - name(overrides?: CallOverrides): Promise<[string]> - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint( - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]> - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise<[number]> - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - symbol(overrides?: CallOverrides): Promise<[string]> - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - } - - name(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint( - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - symbol(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - callStatic: { - name(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - mint(value: PromiseOrValue, overrides?: CallOverrides): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - decimals(overrides?: CallOverrides): Promise - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - symbol(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'Transfer(address,address,uint256)'( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - Transfer( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - - 'Approval(address,address,uint256)'( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter - Approval( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter - } - - estimateGas: { - name(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint( - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - symbol(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - populateTransaction: { - name(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint( - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - symbol(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ERC20Interface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + name(overrides?: CallOverrides): Promise<[string]>; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mint( + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + }; + + name(overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mint( + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + callStatic: { + name(overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; + + mint(value: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + Transfer( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + + "Approval(address,address,uint256)"( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; + Approval( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; + }; + + estimateGas: { + name(overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mint( + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + name(overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mint( + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/ExchangeRates.ts b/packages/sdk/src/contracts/types/ExchangeRates.ts index 8bdd68a0c3..9da7ab93fe 100644 --- a/packages/sdk/src/contracts/types/ExchangeRates.ts +++ b/packages/sdk/src/contracts/types/ExchangeRates.ts @@ -2,1418 +2,1632 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IDirectIntegrationManager { - export type ParameterIntegrationSettingsStruct = { - currencyKey: PromiseOrValue - dexPriceAggregator: PromiseOrValue - atomicEquivalentForDexPricing: PromiseOrValue - atomicExchangeFeeRate: PromiseOrValue - atomicTwapWindow: PromiseOrValue - atomicMaxVolumePerBlock: PromiseOrValue - atomicVolatilityConsiderationWindow: PromiseOrValue - atomicVolatilityUpdateThreshold: PromiseOrValue - exchangeFeeRate: PromiseOrValue - exchangeMaxDynamicFee: PromiseOrValue - exchangeDynamicFeeRounds: PromiseOrValue - exchangeDynamicFeeThreshold: PromiseOrValue - exchangeDynamicFeeWeightDecay: PromiseOrValue - } - - export type ParameterIntegrationSettingsStructOutput = [ - string, - string, - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - currencyKey: string - dexPriceAggregator: string - atomicEquivalentForDexPricing: string - atomicExchangeFeeRate: BigNumber - atomicTwapWindow: BigNumber - atomicMaxVolumePerBlock: BigNumber - atomicVolatilityConsiderationWindow: BigNumber - atomicVolatilityUpdateThreshold: BigNumber - exchangeFeeRate: BigNumber - exchangeMaxDynamicFee: BigNumber - exchangeDynamicFeeRounds: BigNumber - exchangeDynamicFeeThreshold: BigNumber - exchangeDynamicFeeWeightDecay: BigNumber - } + export type ParameterIntegrationSettingsStruct = { + currencyKey: BytesLike; + dexPriceAggregator: string; + atomicEquivalentForDexPricing: string; + atomicExchangeFeeRate: BigNumberish; + atomicTwapWindow: BigNumberish; + atomicMaxVolumePerBlock: BigNumberish; + atomicVolatilityConsiderationWindow: BigNumberish; + atomicVolatilityUpdateThreshold: BigNumberish; + exchangeFeeRate: BigNumberish; + exchangeMaxDynamicFee: BigNumberish; + exchangeDynamicFeeRounds: BigNumberish; + exchangeDynamicFeeThreshold: BigNumberish; + exchangeDynamicFeeWeightDecay: BigNumberish; + }; + + export type ParameterIntegrationSettingsStructOutput = [ + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + currencyKey: string; + dexPriceAggregator: string; + atomicEquivalentForDexPricing: string; + atomicExchangeFeeRate: BigNumber; + atomicTwapWindow: BigNumber; + atomicMaxVolumePerBlock: BigNumber; + atomicVolatilityConsiderationWindow: BigNumber; + atomicVolatilityUpdateThreshold: BigNumber; + exchangeFeeRate: BigNumber; + exchangeMaxDynamicFee: BigNumber; + exchangeDynamicFeeRounds: BigNumber; + exchangeDynamicFeeThreshold: BigNumber; + exchangeDynamicFeeWeightDecay: BigNumber; + }; } export interface ExchangeRatesInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'addAggregator(bytes32,address)': FunctionFragment - 'aggregatorKeys(uint256)': FunctionFragment - 'aggregatorWarningFlags()': FunctionFragment - 'aggregators(bytes32)': FunctionFragment - 'anyRateIsInvalid(bytes32[])': FunctionFragment - 'anyRateIsInvalidAtRound(bytes32[],uint256[])': FunctionFragment - 'currenciesUsingAggregator(address)': FunctionFragment - 'currencyKeyDecimals(bytes32)': FunctionFragment - 'effectiveAtomicValueAndRates(bytes32,uint256,bytes32)': FunctionFragment - 'effectiveValue(bytes32,uint256,bytes32)': FunctionFragment - 'effectiveValueAndRates(bytes32,uint256,bytes32)': FunctionFragment - 'effectiveValueAndRatesAtRound(bytes32,uint256,bytes32,uint256,uint256)': FunctionFragment - 'getCurrentRoundId(bytes32)': FunctionFragment - 'getLastRoundIdBeforeElapsedSecs(bytes32,uint256,uint256,uint256)': FunctionFragment - 'isResolverCached()': FunctionFragment - 'lastRateUpdateTimes(bytes32)': FunctionFragment - 'lastRateUpdateTimesForCurrencies(bytes32[])': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'rateAndInvalid(bytes32)': FunctionFragment - 'rateAndTimestampAtRound(bytes32,uint256)': FunctionFragment - 'rateAndUpdatedTime(bytes32)': FunctionFragment - 'rateForCurrency(bytes32)': FunctionFragment - 'rateIsFlagged(bytes32)': FunctionFragment - 'rateIsInvalid(bytes32)': FunctionFragment - 'rateIsStale(bytes32)': FunctionFragment - 'rateStalePeriod()': FunctionFragment - 'rateWithSafetyChecks(bytes32)': FunctionFragment - 'ratesAndInvalidForCurrencies(bytes32[])': FunctionFragment - 'ratesAndUpdatedTimeForCurrencyLastNRounds(bytes32,uint256,uint256)': FunctionFragment - 'ratesForCurrencies(bytes32[])': FunctionFragment - 'rebuildCache()': FunctionFragment - 'removeAggregator(bytes32)': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'synthTooVolatileForAtomicExchange(bytes32)': FunctionFragment - 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'acceptOwnership' - | 'addAggregator' - | 'aggregatorKeys' - | 'aggregatorWarningFlags' - | 'aggregators' - | 'anyRateIsInvalid' - | 'anyRateIsInvalidAtRound' - | 'currenciesUsingAggregator' - | 'currencyKeyDecimals' - | 'effectiveAtomicValueAndRates' - | 'effectiveValue' - | 'effectiveValueAndRates' - | 'effectiveValueAndRatesAtRound' - | 'getCurrentRoundId' - | 'getLastRoundIdBeforeElapsedSecs' - | 'isResolverCached' - | 'lastRateUpdateTimes' - | 'lastRateUpdateTimesForCurrencies' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'rateAndInvalid' - | 'rateAndTimestampAtRound' - | 'rateAndUpdatedTime' - | 'rateForCurrency' - | 'rateIsFlagged' - | 'rateIsInvalid' - | 'rateIsStale' - | 'rateStalePeriod' - | 'rateWithSafetyChecks' - | 'ratesAndInvalidForCurrencies' - | 'ratesAndUpdatedTimeForCurrencyLastNRounds' - | 'ratesForCurrencies' - | 'rebuildCache' - | 'removeAggregator' - | 'resolver' - | 'resolverAddressesRequired' - | 'synthTooVolatileForAtomicExchange(bytes32)' - | 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'addAggregator', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'aggregatorKeys', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'aggregatorWarningFlags', values?: undefined): string - encodeFunctionData(functionFragment: 'aggregators', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'anyRateIsInvalid', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'anyRateIsInvalidAtRound', - values: [PromiseOrValue[], PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'currenciesUsingAggregator', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'currencyKeyDecimals', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'effectiveAtomicValueAndRates', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'effectiveValue', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'effectiveValueAndRates', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'effectiveValueAndRatesAtRound', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'getCurrentRoundId', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getLastRoundIdBeforeElapsedSecs', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData( - functionFragment: 'lastRateUpdateTimes', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'lastRateUpdateTimesForCurrencies', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData( - functionFragment: 'rateAndInvalid', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'rateAndTimestampAtRound', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'rateAndUpdatedTime', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'rateForCurrency', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'rateIsFlagged', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rateIsInvalid', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rateIsStale', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rateStalePeriod', values?: undefined): string - encodeFunctionData( - functionFragment: 'rateWithSafetyChecks', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'ratesAndInvalidForCurrencies', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'ratesAndUpdatedTimeForCurrencyLastNRounds', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'ratesForCurrencies', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData( - functionFragment: 'removeAggregator', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData( - functionFragment: 'synthTooVolatileForAtomicExchange(bytes32)', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))', - values: [IDirectIntegrationManager.ParameterIntegrationSettingsStruct] - ): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'addAggregator', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'aggregatorKeys', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'aggregatorWarningFlags', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'aggregators', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'anyRateIsInvalid', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'anyRateIsInvalidAtRound', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currenciesUsingAggregator', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currencyKeyDecimals', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'effectiveAtomicValueAndRates', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'effectiveValue', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'effectiveValueAndRates', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'effectiveValueAndRatesAtRound', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getCurrentRoundId', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getLastRoundIdBeforeElapsedSecs', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastRateUpdateTimes', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'lastRateUpdateTimesForCurrencies', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateAndInvalid', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateAndTimestampAtRound', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateAndUpdatedTime', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateForCurrency', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateIsFlagged', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateIsInvalid', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateIsStale', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateStalePeriod', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rateWithSafetyChecks', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'ratesAndInvalidForCurrencies', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'ratesAndUpdatedTimeForCurrencyLastNRounds', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'ratesForCurrencies', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'removeAggregator', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'synthTooVolatileForAtomicExchange(bytes32)', - data: BytesLike - ): Result - decodeFunctionResult( - functionFragment: 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))', - data: BytesLike - ): Result - - events: { - 'AggregatorAdded(bytes32,address)': EventFragment - 'AggregatorRemoved(bytes32,address)': EventFragment - 'CacheUpdated(bytes32,address)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'AggregatorAdded'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AggregatorRemoved'): EventFragment - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "addAggregator(bytes32,address)": FunctionFragment; + "aggregatorKeys(uint256)": FunctionFragment; + "aggregatorWarningFlags()": FunctionFragment; + "aggregators(bytes32)": FunctionFragment; + "anyRateIsInvalid(bytes32[])": FunctionFragment; + "anyRateIsInvalidAtRound(bytes32[],uint256[])": FunctionFragment; + "currenciesUsingAggregator(address)": FunctionFragment; + "currencyKeyDecimals(bytes32)": FunctionFragment; + "effectiveAtomicValueAndRates(bytes32,uint256,bytes32)": FunctionFragment; + "effectiveValue(bytes32,uint256,bytes32)": FunctionFragment; + "effectiveValueAndRates(bytes32,uint256,bytes32)": FunctionFragment; + "effectiveValueAndRatesAtRound(bytes32,uint256,bytes32,uint256,uint256)": FunctionFragment; + "getCurrentRoundId(bytes32)": FunctionFragment; + "getLastRoundIdBeforeElapsedSecs(bytes32,uint256,uint256,uint256)": FunctionFragment; + "isResolverCached()": FunctionFragment; + "lastRateUpdateTimes(bytes32)": FunctionFragment; + "lastRateUpdateTimesForCurrencies(bytes32[])": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "rateAndInvalid(bytes32)": FunctionFragment; + "rateAndTimestampAtRound(bytes32,uint256)": FunctionFragment; + "rateAndUpdatedTime(bytes32)": FunctionFragment; + "rateForCurrency(bytes32)": FunctionFragment; + "rateIsFlagged(bytes32)": FunctionFragment; + "rateIsInvalid(bytes32)": FunctionFragment; + "rateIsStale(bytes32)": FunctionFragment; + "rateStalePeriod()": FunctionFragment; + "rateWithSafetyChecks(bytes32)": FunctionFragment; + "ratesAndInvalidForCurrencies(bytes32[])": FunctionFragment; + "ratesAndUpdatedTimeForCurrencyLastNRounds(bytes32,uint256,uint256)": FunctionFragment; + "ratesForCurrencies(bytes32[])": FunctionFragment; + "rebuildCache()": FunctionFragment; + "removeAggregator(bytes32)": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "synthTooVolatileForAtomicExchange(bytes32)": FunctionFragment; + "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "acceptOwnership" + | "addAggregator" + | "aggregatorKeys" + | "aggregatorWarningFlags" + | "aggregators" + | "anyRateIsInvalid" + | "anyRateIsInvalidAtRound" + | "currenciesUsingAggregator" + | "currencyKeyDecimals" + | "effectiveAtomicValueAndRates" + | "effectiveValue" + | "effectiveValueAndRates" + | "effectiveValueAndRatesAtRound" + | "getCurrentRoundId" + | "getLastRoundIdBeforeElapsedSecs" + | "isResolverCached" + | "lastRateUpdateTimes" + | "lastRateUpdateTimesForCurrencies" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "rateAndInvalid" + | "rateAndTimestampAtRound" + | "rateAndUpdatedTime" + | "rateForCurrency" + | "rateIsFlagged" + | "rateIsInvalid" + | "rateIsStale" + | "rateStalePeriod" + | "rateWithSafetyChecks" + | "ratesAndInvalidForCurrencies" + | "ratesAndUpdatedTimeForCurrencyLastNRounds" + | "ratesForCurrencies" + | "rebuildCache" + | "removeAggregator" + | "resolver" + | "resolverAddressesRequired" + | "synthTooVolatileForAtomicExchange(bytes32)" + | "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "addAggregator", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "aggregatorKeys", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "aggregatorWarningFlags", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "aggregators", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "anyRateIsInvalid", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "anyRateIsInvalidAtRound", + values: [BytesLike[], BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "currenciesUsingAggregator", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "currencyKeyDecimals", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "effectiveAtomicValueAndRates", + values: [BytesLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "effectiveValue", + values: [BytesLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "effectiveValueAndRates", + values: [BytesLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "effectiveValueAndRatesAtRound", + values: [BytesLike, BigNumberish, BytesLike, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getCurrentRoundId", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getLastRoundIdBeforeElapsedSecs", + values: [BytesLike, BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastRateUpdateTimes", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "lastRateUpdateTimesForCurrencies", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "rateAndInvalid", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rateAndTimestampAtRound", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "rateAndUpdatedTime", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rateForCurrency", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rateIsFlagged", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rateIsInvalid", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rateIsStale", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rateStalePeriod", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rateWithSafetyChecks", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "ratesAndInvalidForCurrencies", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "ratesAndUpdatedTimeForCurrencyLastNRounds", + values: [BytesLike, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "ratesForCurrencies", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "removeAggregator", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "synthTooVolatileForAtomicExchange(bytes32)", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))", + values: [IDirectIntegrationManager.ParameterIntegrationSettingsStruct] + ): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addAggregator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "aggregatorKeys", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "aggregatorWarningFlags", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "aggregators", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "anyRateIsInvalid", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "anyRateIsInvalidAtRound", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currenciesUsingAggregator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currencyKeyDecimals", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "effectiveAtomicValueAndRates", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "effectiveValue", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "effectiveValueAndRates", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "effectiveValueAndRatesAtRound", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getCurrentRoundId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLastRoundIdBeforeElapsedSecs", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastRateUpdateTimes", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastRateUpdateTimesForCurrencies", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rateAndInvalid", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateAndTimestampAtRound", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateAndUpdatedTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateForCurrency", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateIsFlagged", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateIsInvalid", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateIsStale", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateStalePeriod", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateWithSafetyChecks", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "ratesAndInvalidForCurrencies", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "ratesAndUpdatedTimeForCurrencyLastNRounds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "ratesForCurrencies", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "removeAggregator", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthTooVolatileForAtomicExchange(bytes32)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))", + data: BytesLike + ): Result; + + events: { + "AggregatorAdded(bytes32,address)": EventFragment; + "AggregatorRemoved(bytes32,address)": EventFragment; + "CacheUpdated(bytes32,address)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AggregatorAdded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "AggregatorRemoved"): EventFragment; + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; } export interface AggregatorAddedEventObject { - currencyKey: string - aggregator: string + currencyKey: string; + aggregator: string; } -export type AggregatorAddedEvent = TypedEvent<[string, string], AggregatorAddedEventObject> +export type AggregatorAddedEvent = TypedEvent< + [string, string], + AggregatorAddedEventObject +>; -export type AggregatorAddedEventFilter = TypedEventFilter +export type AggregatorAddedEventFilter = TypedEventFilter; export interface AggregatorRemovedEventObject { - currencyKey: string - aggregator: string + currencyKey: string; + aggregator: string; } -export type AggregatorRemovedEvent = TypedEvent<[string, string], AggregatorRemovedEventObject> +export type AggregatorRemovedEvent = TypedEvent< + [string, string], + AggregatorRemovedEventObject +>; -export type AggregatorRemovedEventFilter = TypedEventFilter +export type AggregatorRemovedEventFilter = + TypedEventFilter; export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface ExchangeRates extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: ExchangeRatesInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - addAggregator( - currencyKey: PromiseOrValue, - aggregatorAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - aggregatorKeys(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]> - - aggregatorWarningFlags(overrides?: CallOverrides): Promise<[string]> - - aggregators(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]> - - anyRateIsInvalid( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[boolean]> - - anyRateIsInvalidAtRound( - currencyKeys: PromiseOrValue[], - roundIds: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[boolean]> - - currenciesUsingAggregator( - aggregator: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string[]] & { currencies: string[] }> - - currencyKeyDecimals( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[number]> - - effectiveAtomicValueAndRates( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber] & { - value: BigNumber - systemValue: BigNumber - systemSourceRate: BigNumber - systemDestinationRate: BigNumber - } - > - - effectiveValue( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { value: BigNumber }> - - effectiveValueAndRates( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - value: BigNumber - sourceRate: BigNumber - destinationRate: BigNumber - } - > - - effectiveValueAndRatesAtRound( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - roundIdForSrc: PromiseOrValue, - roundIdForDest: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - value: BigNumber - sourceRate: BigNumber - destinationRate: BigNumber - } - > - - getCurrentRoundId( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - getLastRoundIdBeforeElapsedSecs( - currencyKey: PromiseOrValue, - startingRoundId: PromiseOrValue, - startingTimestamp: PromiseOrValue, - timediff: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - lastRateUpdateTimes( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - lastRateUpdateTimesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber[]]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - rateAndInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { rate: BigNumber; isInvalid: boolean }> - - rateAndTimestampAtRound( - currencyKey: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }> - - rateAndUpdatedTime( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }> - - rateForCurrency( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - rateIsFlagged( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - rateIsInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - rateIsStale( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - rateStalePeriod(overrides?: CallOverrides): Promise<[BigNumber]> - - rateWithSafetyChecks( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - ratesAndInvalidForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber[], boolean] & { rates: BigNumber[]; anyRateInvalid: boolean }> - - ratesAndUpdatedTimeForCurrencyLastNRounds( - currencyKey: PromiseOrValue, - numRounds: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber[], BigNumber[]] & { rates: BigNumber[]; times: BigNumber[] }> - - ratesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber[]]> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - removeAggregator( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - 'synthTooVolatileForAtomicExchange(bytes32)'( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))'( - arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, - overrides?: CallOverrides - ): Promise<[boolean]> - } - - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - addAggregator( - currencyKey: PromiseOrValue, - aggregatorAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - aggregatorKeys(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - aggregatorWarningFlags(overrides?: CallOverrides): Promise - - aggregators(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - anyRateIsInvalid( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - anyRateIsInvalidAtRound( - currencyKeys: PromiseOrValue[], - roundIds: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - currenciesUsingAggregator( - aggregator: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - currencyKeyDecimals(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - effectiveAtomicValueAndRates( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber] & { - value: BigNumber - systemValue: BigNumber - systemSourceRate: BigNumber - systemDestinationRate: BigNumber - } - > - - effectiveValue( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValueAndRates( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - value: BigNumber - sourceRate: BigNumber - destinationRate: BigNumber - } - > - - effectiveValueAndRatesAtRound( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - roundIdForSrc: PromiseOrValue, - roundIdForDest: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - value: BigNumber - sourceRate: BigNumber - destinationRate: BigNumber - } - > - - getCurrentRoundId( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getLastRoundIdBeforeElapsedSecs( - currencyKey: PromiseOrValue, - startingRoundId: PromiseOrValue, - startingTimestamp: PromiseOrValue, - timediff: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - lastRateUpdateTimes( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastRateUpdateTimesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rateAndInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { rate: BigNumber; isInvalid: boolean }> - - rateAndTimestampAtRound( - currencyKey: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }> - - rateAndUpdatedTime( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }> - - rateForCurrency( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsFlagged(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise - - rateIsInvalid(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise - - rateIsStale(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise - - rateStalePeriod(overrides?: CallOverrides): Promise - - rateWithSafetyChecks( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - ratesAndInvalidForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber[], boolean] & { rates: BigNumber[]; anyRateInvalid: boolean }> - - ratesAndUpdatedTimeForCurrencyLastNRounds( - currencyKey: PromiseOrValue, - numRounds: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber[], BigNumber[]] & { rates: BigNumber[]; times: BigNumber[] }> - - ratesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - removeAggregator( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - 'synthTooVolatileForAtomicExchange(bytes32)'( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))'( - arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, - overrides?: CallOverrides - ): Promise - - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: CallOverrides): Promise - - addAggregator( - currencyKey: PromiseOrValue, - aggregatorAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - aggregatorKeys(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - aggregatorWarningFlags(overrides?: CallOverrides): Promise - - aggregators(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - anyRateIsInvalid( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - anyRateIsInvalidAtRound( - currencyKeys: PromiseOrValue[], - roundIds: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - currenciesUsingAggregator( - aggregator: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - currencyKeyDecimals(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - effectiveAtomicValueAndRates( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber] & { - value: BigNumber - systemValue: BigNumber - systemSourceRate: BigNumber - systemDestinationRate: BigNumber - } - > - - effectiveValue( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValueAndRates( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - value: BigNumber - sourceRate: BigNumber - destinationRate: BigNumber - } - > - - effectiveValueAndRatesAtRound( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - roundIdForSrc: PromiseOrValue, - roundIdForDest: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - value: BigNumber - sourceRate: BigNumber - destinationRate: BigNumber - } - > - - getCurrentRoundId( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getLastRoundIdBeforeElapsedSecs( - currencyKey: PromiseOrValue, - startingRoundId: PromiseOrValue, - startingTimestamp: PromiseOrValue, - timediff: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - lastRateUpdateTimes( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastRateUpdateTimesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rateAndInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { rate: BigNumber; isInvalid: boolean }> - - rateAndTimestampAtRound( - currencyKey: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }> - - rateAndUpdatedTime( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }> - - rateForCurrency( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsFlagged( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsStale(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise - - rateStalePeriod(overrides?: CallOverrides): Promise - - rateWithSafetyChecks( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, boolean, boolean] & { - rate: BigNumber - broken: boolean - staleOrInvalid: boolean - } - > - - ratesAndInvalidForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber[], boolean] & { rates: BigNumber[]; anyRateInvalid: boolean }> - - ratesAndUpdatedTimeForCurrencyLastNRounds( - currencyKey: PromiseOrValue, - numRounds: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber[], BigNumber[]] & { rates: BigNumber[]; times: BigNumber[] }> - - ratesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - rebuildCache(overrides?: CallOverrides): Promise - - removeAggregator( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - 'synthTooVolatileForAtomicExchange(bytes32)'( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))'( - arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'AggregatorAdded(bytes32,address)'( - currencyKey?: null, - aggregator?: null - ): AggregatorAddedEventFilter - AggregatorAdded(currencyKey?: null, aggregator?: null): AggregatorAddedEventFilter - - 'AggregatorRemoved(bytes32,address)'( - currencyKey?: null, - aggregator?: null - ): AggregatorRemovedEventFilter - AggregatorRemoved(currencyKey?: null, aggregator?: null): AggregatorRemovedEventFilter - - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - } - - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - addAggregator( - currencyKey: PromiseOrValue, - aggregatorAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - aggregatorKeys( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - aggregatorWarningFlags(overrides?: CallOverrides): Promise - - aggregators(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - anyRateIsInvalid( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - anyRateIsInvalidAtRound( - currencyKeys: PromiseOrValue[], - roundIds: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - currenciesUsingAggregator( - aggregator: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - currencyKeyDecimals( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveAtomicValueAndRates( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValue( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValueAndRates( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValueAndRatesAtRound( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - roundIdForSrc: PromiseOrValue, - roundIdForDest: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getCurrentRoundId( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getLastRoundIdBeforeElapsedSecs( - currencyKey: PromiseOrValue, - startingRoundId: PromiseOrValue, - startingTimestamp: PromiseOrValue, - timediff: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - lastRateUpdateTimes( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastRateUpdateTimesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rateAndInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateAndTimestampAtRound( - currencyKey: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateAndUpdatedTime( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateForCurrency( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsFlagged( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsStale( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateStalePeriod(overrides?: CallOverrides): Promise - - rateWithSafetyChecks( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - ratesAndInvalidForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - ratesAndUpdatedTimeForCurrencyLastNRounds( - currencyKey: PromiseOrValue, - numRounds: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - ratesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - removeAggregator( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - 'synthTooVolatileForAtomicExchange(bytes32)'( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))'( - arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, - overrides?: CallOverrides - ): Promise - } - - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - addAggregator( - currencyKey: PromiseOrValue, - aggregatorAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - aggregatorKeys( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - aggregatorWarningFlags(overrides?: CallOverrides): Promise - - aggregators( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - anyRateIsInvalid( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - anyRateIsInvalidAtRound( - currencyKeys: PromiseOrValue[], - roundIds: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - currenciesUsingAggregator( - aggregator: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - currencyKeyDecimals( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveAtomicValueAndRates( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValue( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValueAndRates( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - effectiveValueAndRatesAtRound( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - roundIdForSrc: PromiseOrValue, - roundIdForDest: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getCurrentRoundId( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getLastRoundIdBeforeElapsedSecs( - currencyKey: PromiseOrValue, - startingRoundId: PromiseOrValue, - startingTimestamp: PromiseOrValue, - timediff: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - lastRateUpdateTimes( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastRateUpdateTimesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rateAndInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateAndTimestampAtRound( - currencyKey: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateAndUpdatedTime( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateForCurrency( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsFlagged( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateIsStale( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rateStalePeriod(overrides?: CallOverrides): Promise - - rateWithSafetyChecks( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - ratesAndInvalidForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - ratesAndUpdatedTimeForCurrencyLastNRounds( - currencyKey: PromiseOrValue, - numRounds: PromiseOrValue, - roundId: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - ratesForCurrencies( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - removeAggregator( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - 'synthTooVolatileForAtomicExchange(bytes32)'( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - 'synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))'( - arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, - overrides?: CallOverrides - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ExchangeRatesInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + addAggregator( + currencyKey: BytesLike, + aggregatorAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + aggregatorKeys( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + aggregatorWarningFlags(overrides?: CallOverrides): Promise<[string]>; + + aggregators(arg0: BytesLike, overrides?: CallOverrides): Promise<[string]>; + + anyRateIsInvalid( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise<[boolean]>; + + anyRateIsInvalidAtRound( + currencyKeys: BytesLike[], + roundIds: BigNumberish[], + overrides?: CallOverrides + ): Promise<[boolean]>; + + currenciesUsingAggregator( + aggregator: string, + overrides?: CallOverrides + ): Promise<[string[]] & { currencies: string[] }>; + + currencyKeyDecimals( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[number]>; + + effectiveAtomicValueAndRates( + arg0: BytesLike, + arg1: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + systemValue: BigNumber; + systemSourceRate: BigNumber; + systemDestinationRate: BigNumber; + } + >; + + effectiveValue( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber] & { value: BigNumber }>; + + effectiveValueAndRates( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + sourceRate: BigNumber; + destinationRate: BigNumber; + } + >; + + effectiveValueAndRatesAtRound( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + roundIdForSrc: BigNumberish, + roundIdForDest: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + sourceRate: BigNumber; + destinationRate: BigNumber; + } + >; + + getCurrentRoundId( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getLastRoundIdBeforeElapsedSecs( + currencyKey: BytesLike, + startingRoundId: BigNumberish, + startingTimestamp: BigNumberish, + timediff: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + lastRateUpdateTimes( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + lastRateUpdateTimesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise<[BigNumber[]]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + rateAndInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { rate: BigNumber; isInvalid: boolean }>; + + rateAndTimestampAtRound( + currencyKey: BytesLike, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }>; + + rateAndUpdatedTime( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }>; + + rateForCurrency( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + rateIsFlagged( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + rateIsInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + rateIsStale( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + rateStalePeriod(overrides?: CallOverrides): Promise<[BigNumber]>; + + rateWithSafetyChecks( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + ratesAndInvalidForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise< + [BigNumber[], boolean] & { rates: BigNumber[]; anyRateInvalid: boolean } + >; + + ratesAndUpdatedTimeForCurrencyLastNRounds( + currencyKey: BytesLike, + numRounds: BigNumberish, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber[], BigNumber[]] & { rates: BigNumber[]; times: BigNumber[] } + >; + + ratesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise<[BigNumber[]]>; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + removeAggregator( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise<[string]>; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; + + "synthTooVolatileForAtomicExchange(bytes32)"( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))"( + arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, + overrides?: CallOverrides + ): Promise<[boolean]>; + }; + + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + addAggregator( + currencyKey: BytesLike, + aggregatorAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + aggregatorKeys( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + aggregatorWarningFlags(overrides?: CallOverrides): Promise; + + aggregators(arg0: BytesLike, overrides?: CallOverrides): Promise; + + anyRateIsInvalid( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + anyRateIsInvalidAtRound( + currencyKeys: BytesLike[], + roundIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + currenciesUsingAggregator( + aggregator: string, + overrides?: CallOverrides + ): Promise; + + currencyKeyDecimals( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveAtomicValueAndRates( + arg0: BytesLike, + arg1: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + systemValue: BigNumber; + systemSourceRate: BigNumber; + systemDestinationRate: BigNumber; + } + >; + + effectiveValue( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValueAndRates( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + sourceRate: BigNumber; + destinationRate: BigNumber; + } + >; + + effectiveValueAndRatesAtRound( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + roundIdForSrc: BigNumberish, + roundIdForDest: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + sourceRate: BigNumber; + destinationRate: BigNumber; + } + >; + + getCurrentRoundId( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getLastRoundIdBeforeElapsedSecs( + currencyKey: BytesLike, + startingRoundId: BigNumberish, + startingTimestamp: BigNumberish, + timediff: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + lastRateUpdateTimes( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastRateUpdateTimesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { rate: BigNumber; isInvalid: boolean }>; + + rateAndTimestampAtRound( + currencyKey: BytesLike, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }>; + + rateAndUpdatedTime( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }>; + + rateForCurrency( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsFlagged( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsStale( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateStalePeriod(overrides?: CallOverrides): Promise; + + rateWithSafetyChecks( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + ratesAndInvalidForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise< + [BigNumber[], boolean] & { rates: BigNumber[]; anyRateInvalid: boolean } + >; + + ratesAndUpdatedTimeForCurrencyLastNRounds( + currencyKey: BytesLike, + numRounds: BigNumberish, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber[], BigNumber[]] & { rates: BigNumber[]; times: BigNumber[] } + >; + + ratesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + removeAggregator( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + "synthTooVolatileForAtomicExchange(bytes32)"( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))"( + arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, + overrides?: CallOverrides + ): Promise; + + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + addAggregator( + currencyKey: BytesLike, + aggregatorAddress: string, + overrides?: CallOverrides + ): Promise; + + aggregatorKeys( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + aggregatorWarningFlags(overrides?: CallOverrides): Promise; + + aggregators(arg0: BytesLike, overrides?: CallOverrides): Promise; + + anyRateIsInvalid( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + anyRateIsInvalidAtRound( + currencyKeys: BytesLike[], + roundIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + currenciesUsingAggregator( + aggregator: string, + overrides?: CallOverrides + ): Promise; + + currencyKeyDecimals( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveAtomicValueAndRates( + arg0: BytesLike, + arg1: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + systemValue: BigNumber; + systemSourceRate: BigNumber; + systemDestinationRate: BigNumber; + } + >; + + effectiveValue( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValueAndRates( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + sourceRate: BigNumber; + destinationRate: BigNumber; + } + >; + + effectiveValueAndRatesAtRound( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + roundIdForSrc: BigNumberish, + roundIdForDest: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + value: BigNumber; + sourceRate: BigNumber; + destinationRate: BigNumber; + } + >; + + getCurrentRoundId( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getLastRoundIdBeforeElapsedSecs( + currencyKey: BytesLike, + startingRoundId: BigNumberish, + startingTimestamp: BigNumberish, + timediff: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + lastRateUpdateTimes( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastRateUpdateTimesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { rate: BigNumber; isInvalid: boolean }>; + + rateAndTimestampAtRound( + currencyKey: BytesLike, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }>; + + rateAndUpdatedTime( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; time: BigNumber }>; + + rateForCurrency( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsFlagged( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsStale( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateStalePeriod(overrides?: CallOverrides): Promise; + + rateWithSafetyChecks( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean, boolean] & { + rate: BigNumber; + broken: boolean; + staleOrInvalid: boolean; + } + >; + + ratesAndInvalidForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise< + [BigNumber[], boolean] & { rates: BigNumber[]; anyRateInvalid: boolean } + >; + + ratesAndUpdatedTimeForCurrencyLastNRounds( + currencyKey: BytesLike, + numRounds: BigNumberish, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber[], BigNumber[]] & { rates: BigNumber[]; times: BigNumber[] } + >; + + ratesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + rebuildCache(overrides?: CallOverrides): Promise; + + removeAggregator( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + "synthTooVolatileForAtomicExchange(bytes32)"( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))"( + arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AggregatorAdded(bytes32,address)"( + currencyKey?: null, + aggregator?: null + ): AggregatorAddedEventFilter; + AggregatorAdded( + currencyKey?: null, + aggregator?: null + ): AggregatorAddedEventFilter; + + "AggregatorRemoved(bytes32,address)"( + currencyKey?: null, + aggregator?: null + ): AggregatorRemovedEventFilter; + AggregatorRemoved( + currencyKey?: null, + aggregator?: null + ): AggregatorRemovedEventFilter; + + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + addAggregator( + currencyKey: BytesLike, + aggregatorAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + aggregatorKeys( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + aggregatorWarningFlags(overrides?: CallOverrides): Promise; + + aggregators(arg0: BytesLike, overrides?: CallOverrides): Promise; + + anyRateIsInvalid( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + anyRateIsInvalidAtRound( + currencyKeys: BytesLike[], + roundIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + currenciesUsingAggregator( + aggregator: string, + overrides?: CallOverrides + ): Promise; + + currencyKeyDecimals( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveAtomicValueAndRates( + arg0: BytesLike, + arg1: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValue( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValueAndRates( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValueAndRatesAtRound( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + roundIdForSrc: BigNumberish, + roundIdForDest: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getCurrentRoundId( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getLastRoundIdBeforeElapsedSecs( + currencyKey: BytesLike, + startingRoundId: BigNumberish, + startingTimestamp: BigNumberish, + timediff: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + lastRateUpdateTimes( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastRateUpdateTimesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateAndTimestampAtRound( + currencyKey: BytesLike, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + rateAndUpdatedTime( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateForCurrency( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsFlagged( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsStale( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateStalePeriod(overrides?: CallOverrides): Promise; + + rateWithSafetyChecks( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + ratesAndInvalidForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + ratesAndUpdatedTimeForCurrencyLastNRounds( + currencyKey: BytesLike, + numRounds: BigNumberish, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + ratesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + rebuildCache(overrides?: Overrides & { from?: string }): Promise; + + removeAggregator( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + "synthTooVolatileForAtomicExchange(bytes32)"( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))"( + arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + addAggregator( + currencyKey: BytesLike, + aggregatorAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + aggregatorKeys( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + aggregatorWarningFlags( + overrides?: CallOverrides + ): Promise; + + aggregators( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + anyRateIsInvalid( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + anyRateIsInvalidAtRound( + currencyKeys: BytesLike[], + roundIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + currenciesUsingAggregator( + aggregator: string, + overrides?: CallOverrides + ): Promise; + + currencyKeyDecimals( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveAtomicValueAndRates( + arg0: BytesLike, + arg1: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValue( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValueAndRates( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + effectiveValueAndRatesAtRound( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + roundIdForSrc: BigNumberish, + roundIdForDest: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getCurrentRoundId( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getLastRoundIdBeforeElapsedSecs( + currencyKey: BytesLike, + startingRoundId: BigNumberish, + startingTimestamp: BigNumberish, + timediff: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + lastRateUpdateTimes( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastRateUpdateTimesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rateAndInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateAndTimestampAtRound( + currencyKey: BytesLike, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + rateAndUpdatedTime( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateForCurrency( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsFlagged( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateIsStale( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateStalePeriod(overrides?: CallOverrides): Promise; + + rateWithSafetyChecks( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + ratesAndInvalidForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + ratesAndUpdatedTimeForCurrencyLastNRounds( + currencyKey: BytesLike, + numRounds: BigNumberish, + roundId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + ratesForCurrencies( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + removeAggregator( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + "synthTooVolatileForAtomicExchange(bytes32)"( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + "synthTooVolatileForAtomicExchange((bytes32,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))"( + arg0: IDirectIntegrationManager.ParameterIntegrationSettingsStruct, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/Exchanger.ts b/packages/sdk/src/contracts/types/Exchanger.ts index dd916f82af..d73b36420d 100644 --- a/packages/sdk/src/contracts/types/Exchanger.ts +++ b/packages/sdk/src/contracts/types/Exchanger.ts @@ -2,959 +2,1110 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface ExchangerInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'calculateAmountAfterSettlement(address,bytes32,uint256,uint256)': FunctionFragment - 'dynamicFeeRateForExchange(bytes32,bytes32)': FunctionFragment - 'exchange(address,address,bytes32,uint256,bytes32,address,bool,address,bytes32)': FunctionFragment - 'exchangeAtomically(address,bytes32,uint256,bytes32,address,bytes32,uint256)': FunctionFragment - 'feeRateForExchange(bytes32,bytes32)': FunctionFragment - 'getAmountsForExchange(uint256,bytes32,bytes32)': FunctionFragment - 'hasWaitingPeriodOrSettlementOwing(address,bytes32)': FunctionFragment - 'isResolverCached()': FunctionFragment - 'isSynthRateInvalid(bytes32)': FunctionFragment - 'lastExchangeRate(bytes32)': FunctionFragment - 'maxSecsLeftInWaitingPeriod(address,bytes32)': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'priceDeviationThresholdFactor()': FunctionFragment - 'rebuildCache()': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'settle(address,bytes32)': FunctionFragment - 'settlementOwing(address,bytes32)': FunctionFragment - 'tradingRewardsEnabled()': FunctionFragment - 'waitingPeriodSecs()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'acceptOwnership' - | 'calculateAmountAfterSettlement' - | 'dynamicFeeRateForExchange' - | 'exchange' - | 'exchangeAtomically' - | 'feeRateForExchange' - | 'getAmountsForExchange' - | 'hasWaitingPeriodOrSettlementOwing' - | 'isResolverCached' - | 'isSynthRateInvalid' - | 'lastExchangeRate' - | 'maxSecsLeftInWaitingPeriod' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'priceDeviationThresholdFactor' - | 'rebuildCache' - | 'resolver' - | 'resolverAddressesRequired' - | 'settle' - | 'settlementOwing' - | 'tradingRewardsEnabled' - | 'waitingPeriodSecs' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'calculateAmountAfterSettlement', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'dynamicFeeRateForExchange', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'exchange', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'exchangeAtomically', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'feeRateForExchange', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getAmountsForExchange', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'hasWaitingPeriodOrSettlementOwing', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData( - functionFragment: 'isSynthRateInvalid', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'lastExchangeRate', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'maxSecsLeftInWaitingPeriod', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'priceDeviationThresholdFactor', values?: undefined): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData( - functionFragment: 'settle', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'settlementOwing', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'tradingRewardsEnabled', values?: undefined): string - encodeFunctionData(functionFragment: 'waitingPeriodSecs', values?: undefined): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'calculateAmountAfterSettlement', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'dynamicFeeRateForExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeAtomically', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'feeRateForExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getAmountsForExchange', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'hasWaitingPeriodOrSettlementOwing', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isSynthRateInvalid', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastExchangeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxSecsLeftInWaitingPeriod', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'priceDeviationThresholdFactor', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'settle', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'settlementOwing', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'tradingRewardsEnabled', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'waitingPeriodSecs', data: BytesLike): Result - - events: { - 'CacheUpdated(bytes32,address)': EventFragment - 'ExchangeEntryAppended(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256)': EventFragment - 'ExchangeEntrySettled(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256,uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeEntryAppended'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeEntrySettled'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "calculateAmountAfterSettlement(address,bytes32,uint256,uint256)": FunctionFragment; + "dynamicFeeRateForExchange(bytes32,bytes32)": FunctionFragment; + "exchange(address,address,bytes32,uint256,bytes32,address,bool,address,bytes32)": FunctionFragment; + "exchangeAtomically(address,bytes32,uint256,bytes32,address,bytes32,uint256)": FunctionFragment; + "feeRateForExchange(bytes32,bytes32)": FunctionFragment; + "getAmountsForExchange(uint256,bytes32,bytes32)": FunctionFragment; + "hasWaitingPeriodOrSettlementOwing(address,bytes32)": FunctionFragment; + "isResolverCached()": FunctionFragment; + "isSynthRateInvalid(bytes32)": FunctionFragment; + "lastExchangeRate(bytes32)": FunctionFragment; + "maxSecsLeftInWaitingPeriod(address,bytes32)": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "priceDeviationThresholdFactor()": FunctionFragment; + "rebuildCache()": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "settle(address,bytes32)": FunctionFragment; + "settlementOwing(address,bytes32)": FunctionFragment; + "tradingRewardsEnabled()": FunctionFragment; + "waitingPeriodSecs()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "acceptOwnership" + | "calculateAmountAfterSettlement" + | "dynamicFeeRateForExchange" + | "exchange" + | "exchangeAtomically" + | "feeRateForExchange" + | "getAmountsForExchange" + | "hasWaitingPeriodOrSettlementOwing" + | "isResolverCached" + | "isSynthRateInvalid" + | "lastExchangeRate" + | "maxSecsLeftInWaitingPeriod" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "priceDeviationThresholdFactor" + | "rebuildCache" + | "resolver" + | "resolverAddressesRequired" + | "settle" + | "settlementOwing" + | "tradingRewardsEnabled" + | "waitingPeriodSecs" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "calculateAmountAfterSettlement", + values: [string, BytesLike, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "dynamicFeeRateForExchange", + values: [BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "exchange", + values: [ + string, + string, + BytesLike, + BigNumberish, + BytesLike, + string, + boolean, + string, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "exchangeAtomically", + values: [ + string, + BytesLike, + BigNumberish, + BytesLike, + string, + BytesLike, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "feeRateForExchange", + values: [BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getAmountsForExchange", + values: [BigNumberish, BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "hasWaitingPeriodOrSettlementOwing", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isSynthRateInvalid", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "lastExchangeRate", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxSecsLeftInWaitingPeriod", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "priceDeviationThresholdFactor", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "settle", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "settlementOwing", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "tradingRewardsEnabled", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "waitingPeriodSecs", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "calculateAmountAfterSettlement", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "dynamicFeeRateForExchange", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "exchange", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "exchangeAtomically", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "feeRateForExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAmountsForExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "hasWaitingPeriodOrSettlementOwing", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isSynthRateInvalid", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastExchangeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxSecsLeftInWaitingPeriod", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "priceDeviationThresholdFactor", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "settle", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "settlementOwing", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tradingRewardsEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "waitingPeriodSecs", + data: BytesLike + ): Result; + + events: { + "CacheUpdated(bytes32,address)": EventFragment; + "ExchangeEntryAppended(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256)": EventFragment; + "ExchangeEntrySettled(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256,uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeEntryAppended"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeEntrySettled"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; } export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface ExchangeEntryAppendedEventObject { - account: string - src: string - amount: BigNumber - dest: string - amountReceived: BigNumber - exchangeFeeRate: BigNumber - roundIdForSrc: BigNumber - roundIdForDest: BigNumber + account: string; + src: string; + amount: BigNumber; + dest: string; + amountReceived: BigNumber; + exchangeFeeRate: BigNumber; + roundIdForSrc: BigNumber; + roundIdForDest: BigNumber; } export type ExchangeEntryAppendedEvent = TypedEvent< - [string, string, BigNumber, string, BigNumber, BigNumber, BigNumber, BigNumber], - ExchangeEntryAppendedEventObject -> - -export type ExchangeEntryAppendedEventFilter = TypedEventFilter + [ + string, + string, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ], + ExchangeEntryAppendedEventObject +>; + +export type ExchangeEntryAppendedEventFilter = + TypedEventFilter; export interface ExchangeEntrySettledEventObject { - from: string - src: string - amount: BigNumber - dest: string - reclaim: BigNumber - rebate: BigNumber - srcRoundIdAtPeriodEnd: BigNumber - destRoundIdAtPeriodEnd: BigNumber - exchangeTimestamp: BigNumber + from: string; + src: string; + amount: BigNumber; + dest: string; + reclaim: BigNumber; + rebate: BigNumber; + srcRoundIdAtPeriodEnd: BigNumber; + destRoundIdAtPeriodEnd: BigNumber; + exchangeTimestamp: BigNumber; } export type ExchangeEntrySettledEvent = TypedEvent< - [string, string, BigNumber, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], - ExchangeEntrySettledEventObject -> - -export type ExchangeEntrySettledEventFilter = TypedEventFilter + [ + string, + string, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ], + ExchangeEntrySettledEventObject +>; + +export type ExchangeEntrySettledEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface Exchanger extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: ExchangerInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - calculateAmountAfterSettlement( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - refunded: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { amountAfterSettlement: BigNumber }> - - dynamicFeeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { feeRate: BigNumber; tooVolatile: boolean }> - - exchange( - exchangeForAddress: PromiseOrValue, - from: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - destinationAddress: PromiseOrValue, - virtualSynth: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - arg3: PromiseOrValue, - arg4: PromiseOrValue, - arg5: PromiseOrValue, - arg6: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - feeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - getAmountsForExchange( - sourceAmount: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amountReceived: BigNumber - fee: BigNumber - exchangeFeeRate: BigNumber - } - > - - hasWaitingPeriodOrSettlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - isSynthRateInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - lastExchangeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxSecsLeftInWaitingPeriod( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise<[BigNumber]> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - settle( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - settlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - reclaimAmount: BigNumber - rebateAmount: BigNumber - numEntries: BigNumber - } - > - - tradingRewardsEnabled(overrides?: CallOverrides): Promise<[boolean]> - - waitingPeriodSecs(overrides?: CallOverrides): Promise<[BigNumber]> - } - - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - calculateAmountAfterSettlement( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - refunded: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - dynamicFeeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { feeRate: BigNumber; tooVolatile: boolean }> - - exchange( - exchangeForAddress: PromiseOrValue, - from: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - destinationAddress: PromiseOrValue, - virtualSynth: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - arg3: PromiseOrValue, - arg4: PromiseOrValue, - arg5: PromiseOrValue, - arg6: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - feeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getAmountsForExchange( - sourceAmount: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amountReceived: BigNumber - fee: BigNumber - exchangeFeeRate: BigNumber - } - > - - hasWaitingPeriodOrSettlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isSynthRateInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastExchangeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxSecsLeftInWaitingPeriod( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - settle( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - settlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - reclaimAmount: BigNumber - rebateAmount: BigNumber - numEntries: BigNumber - } - > - - tradingRewardsEnabled(overrides?: CallOverrides): Promise - - waitingPeriodSecs(overrides?: CallOverrides): Promise - - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: CallOverrides): Promise - - calculateAmountAfterSettlement( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - refunded: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - dynamicFeeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { feeRate: BigNumber; tooVolatile: boolean }> - - exchange( - exchangeForAddress: PromiseOrValue, - from: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - destinationAddress: PromiseOrValue, - virtualSynth: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, string] & { amountReceived: BigNumber; vSynth: string }> - - exchangeAtomically( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - arg3: PromiseOrValue, - arg4: PromiseOrValue, - arg5: PromiseOrValue, - arg6: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - feeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getAmountsForExchange( - sourceAmount: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amountReceived: BigNumber - fee: BigNumber - exchangeFeeRate: BigNumber - } - > - - hasWaitingPeriodOrSettlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isSynthRateInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastExchangeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxSecsLeftInWaitingPeriod( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise - - rebuildCache(overrides?: CallOverrides): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - settle( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - reclaimed: BigNumber - refunded: BigNumber - numEntriesSettled: BigNumber - } - > - - settlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - reclaimAmount: BigNumber - rebateAmount: BigNumber - numEntries: BigNumber - } - > - - tradingRewardsEnabled(overrides?: CallOverrides): Promise - - waitingPeriodSecs(overrides?: CallOverrides): Promise - } - - filters: { - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'ExchangeEntryAppended(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256)'( - account?: PromiseOrValue | null, - src?: null, - amount?: null, - dest?: null, - amountReceived?: null, - exchangeFeeRate?: null, - roundIdForSrc?: null, - roundIdForDest?: null - ): ExchangeEntryAppendedEventFilter - ExchangeEntryAppended( - account?: PromiseOrValue | null, - src?: null, - amount?: null, - dest?: null, - amountReceived?: null, - exchangeFeeRate?: null, - roundIdForSrc?: null, - roundIdForDest?: null - ): ExchangeEntryAppendedEventFilter - - 'ExchangeEntrySettled(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256,uint256)'( - from?: PromiseOrValue | null, - src?: null, - amount?: null, - dest?: null, - reclaim?: null, - rebate?: null, - srcRoundIdAtPeriodEnd?: null, - destRoundIdAtPeriodEnd?: null, - exchangeTimestamp?: null - ): ExchangeEntrySettledEventFilter - ExchangeEntrySettled( - from?: PromiseOrValue | null, - src?: null, - amount?: null, - dest?: null, - reclaim?: null, - rebate?: null, - srcRoundIdAtPeriodEnd?: null, - destRoundIdAtPeriodEnd?: null, - exchangeTimestamp?: null - ): ExchangeEntrySettledEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - } - - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - calculateAmountAfterSettlement( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - refunded: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - dynamicFeeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchange( - exchangeForAddress: PromiseOrValue, - from: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - destinationAddress: PromiseOrValue, - virtualSynth: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - arg3: PromiseOrValue, - arg4: PromiseOrValue, - arg5: PromiseOrValue, - arg6: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - feeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getAmountsForExchange( - sourceAmount: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - hasWaitingPeriodOrSettlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isSynthRateInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastExchangeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxSecsLeftInWaitingPeriod( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise - - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - settle( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - settlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - tradingRewardsEnabled(overrides?: CallOverrides): Promise - - waitingPeriodSecs(overrides?: CallOverrides): Promise - } - - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - calculateAmountAfterSettlement( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - refunded: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - dynamicFeeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchange( - exchangeForAddress: PromiseOrValue, - from: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - destinationAddress: PromiseOrValue, - virtualSynth: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - arg2: PromiseOrValue, - arg3: PromiseOrValue, - arg4: PromiseOrValue, - arg5: PromiseOrValue, - arg6: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - feeRateForExchange( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getAmountsForExchange( - sourceAmount: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - hasWaitingPeriodOrSettlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isSynthRateInvalid( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lastExchangeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxSecsLeftInWaitingPeriod( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - settle( - from: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - settlementOwing( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - tradingRewardsEnabled(overrides?: CallOverrides): Promise - - waitingPeriodSecs(overrides?: CallOverrides): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ExchangerInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + calculateAmountAfterSettlement( + from: string, + currencyKey: BytesLike, + amount: BigNumberish, + refunded: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { amountAfterSettlement: BigNumber }>; + + dynamicFeeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { feeRate: BigNumber; tooVolatile: boolean } + >; + + exchange( + exchangeForAddress: string, + from: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + destinationAddress: string, + virtualSynth: boolean, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + arg0: string, + arg1: BytesLike, + arg2: BigNumberish, + arg3: BytesLike, + arg4: string, + arg5: BytesLike, + arg6: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + feeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getAmountsForExchange( + sourceAmount: BigNumberish, + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amountReceived: BigNumber; + fee: BigNumber; + exchangeFeeRate: BigNumber; + } + >; + + hasWaitingPeriodOrSettlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + isSynthRateInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + lastExchangeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxSecsLeftInWaitingPeriod( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise<[string]>; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; + + settle( + from: string, + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + settlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + reclaimAmount: BigNumber; + rebateAmount: BigNumber; + numEntries: BigNumber; + } + >; + + tradingRewardsEnabled(overrides?: CallOverrides): Promise<[boolean]>; + + waitingPeriodSecs(overrides?: CallOverrides): Promise<[BigNumber]>; + }; + + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + calculateAmountAfterSettlement( + from: string, + currencyKey: BytesLike, + amount: BigNumberish, + refunded: BigNumberish, + overrides?: CallOverrides + ): Promise; + + dynamicFeeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { feeRate: BigNumber; tooVolatile: boolean } + >; + + exchange( + exchangeForAddress: string, + from: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + destinationAddress: string, + virtualSynth: boolean, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + arg0: string, + arg1: BytesLike, + arg2: BigNumberish, + arg3: BytesLike, + arg4: string, + arg5: BytesLike, + arg6: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + feeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAmountsForExchange( + sourceAmount: BigNumberish, + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amountReceived: BigNumber; + fee: BigNumber; + exchangeFeeRate: BigNumber; + } + >; + + hasWaitingPeriodOrSettlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isSynthRateInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastExchangeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxSecsLeftInWaitingPeriod( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + priceDeviationThresholdFactor(overrides?: CallOverrides): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + settle( + from: string, + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + settlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + reclaimAmount: BigNumber; + rebateAmount: BigNumber; + numEntries: BigNumber; + } + >; + + tradingRewardsEnabled(overrides?: CallOverrides): Promise; + + waitingPeriodSecs(overrides?: CallOverrides): Promise; + + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + calculateAmountAfterSettlement( + from: string, + currencyKey: BytesLike, + amount: BigNumberish, + refunded: BigNumberish, + overrides?: CallOverrides + ): Promise; + + dynamicFeeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { feeRate: BigNumber; tooVolatile: boolean } + >; + + exchange( + exchangeForAddress: string, + from: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + destinationAddress: string, + virtualSynth: boolean, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, string] & { amountReceived: BigNumber; vSynth: string } + >; + + exchangeAtomically( + arg0: string, + arg1: BytesLike, + arg2: BigNumberish, + arg3: BytesLike, + arg4: string, + arg5: BytesLike, + arg6: BigNumberish, + overrides?: CallOverrides + ): Promise; + + feeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAmountsForExchange( + sourceAmount: BigNumberish, + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amountReceived: BigNumber; + fee: BigNumber; + exchangeFeeRate: BigNumber; + } + >; + + hasWaitingPeriodOrSettlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isSynthRateInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastExchangeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxSecsLeftInWaitingPeriod( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise; + + rebuildCache(overrides?: CallOverrides): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + settle( + from: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + reclaimed: BigNumber; + refunded: BigNumber; + numEntriesSettled: BigNumber; + } + >; + + settlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + reclaimAmount: BigNumber; + rebateAmount: BigNumber; + numEntries: BigNumber; + } + >; + + tradingRewardsEnabled(overrides?: CallOverrides): Promise; + + waitingPeriodSecs(overrides?: CallOverrides): Promise; + }; + + filters: { + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "ExchangeEntryAppended(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256)"( + account?: string | null, + src?: null, + amount?: null, + dest?: null, + amountReceived?: null, + exchangeFeeRate?: null, + roundIdForSrc?: null, + roundIdForDest?: null + ): ExchangeEntryAppendedEventFilter; + ExchangeEntryAppended( + account?: string | null, + src?: null, + amount?: null, + dest?: null, + amountReceived?: null, + exchangeFeeRate?: null, + roundIdForSrc?: null, + roundIdForDest?: null + ): ExchangeEntryAppendedEventFilter; + + "ExchangeEntrySettled(address,bytes32,uint256,bytes32,uint256,uint256,uint256,uint256,uint256)"( + from?: string | null, + src?: null, + amount?: null, + dest?: null, + reclaim?: null, + rebate?: null, + srcRoundIdAtPeriodEnd?: null, + destRoundIdAtPeriodEnd?: null, + exchangeTimestamp?: null + ): ExchangeEntrySettledEventFilter; + ExchangeEntrySettled( + from?: string | null, + src?: null, + amount?: null, + dest?: null, + reclaim?: null, + rebate?: null, + srcRoundIdAtPeriodEnd?: null, + destRoundIdAtPeriodEnd?: null, + exchangeTimestamp?: null + ): ExchangeEntrySettledEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + calculateAmountAfterSettlement( + from: string, + currencyKey: BytesLike, + amount: BigNumberish, + refunded: BigNumberish, + overrides?: CallOverrides + ): Promise; + + dynamicFeeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + exchange( + exchangeForAddress: string, + from: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + destinationAddress: string, + virtualSynth: boolean, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + arg0: string, + arg1: BytesLike, + arg2: BigNumberish, + arg3: BytesLike, + arg4: string, + arg5: BytesLike, + arg6: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + feeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAmountsForExchange( + sourceAmount: BigNumberish, + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + hasWaitingPeriodOrSettlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isSynthRateInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastExchangeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxSecsLeftInWaitingPeriod( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise; + + rebuildCache(overrides?: Overrides & { from?: string }): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + settle( + from: string, + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + settlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + tradingRewardsEnabled(overrides?: CallOverrides): Promise; + + waitingPeriodSecs(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + calculateAmountAfterSettlement( + from: string, + currencyKey: BytesLike, + amount: BigNumberish, + refunded: BigNumberish, + overrides?: CallOverrides + ): Promise; + + dynamicFeeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + exchange( + exchangeForAddress: string, + from: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + destinationAddress: string, + virtualSynth: boolean, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + arg0: string, + arg1: BytesLike, + arg2: BigNumberish, + arg3: BytesLike, + arg4: string, + arg5: BytesLike, + arg6: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + feeRateForExchange( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAmountsForExchange( + sourceAmount: BigNumberish, + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + hasWaitingPeriodOrSettlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isSynthRateInvalid( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + lastExchangeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxSecsLeftInWaitingPeriod( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + settle( + from: string, + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + settlementOwing( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + tradingRewardsEnabled( + overrides?: CallOverrides + ): Promise; + + waitingPeriodSecs(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/FuturesMarket.ts b/packages/sdk/src/contracts/types/FuturesMarket.ts index bcf10f3640..dc4be5c5d5 100644 --- a/packages/sdk/src/contracts/types/FuturesMarket.ts +++ b/packages/sdk/src/contracts/types/FuturesMarket.ts @@ -2,1299 +2,1574 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface FuturesMarketInterface extends utils.Interface { - functions: { - 'accessibleMargin(address)': FunctionFragment - 'accruedFunding(address)': FunctionFragment - 'assetPrice()': FunctionFragment - 'baseAsset()': FunctionFragment - 'canLiquidate(address)': FunctionFragment - 'cancelNextPriceOrder(address)': FunctionFragment - 'closePosition()': FunctionFragment - 'closePositionWithTracking(bytes32)': FunctionFragment - 'currentFundingRate()': FunctionFragment - 'executeNextPriceOrder(address)': FunctionFragment - 'fundingLastRecomputed()': FunctionFragment - 'fundingSequence(uint256)': FunctionFragment - 'fundingSequenceLength()': FunctionFragment - 'isResolverCached()': FunctionFragment - 'liquidatePosition(address)': FunctionFragment - 'liquidationFee(address)': FunctionFragment - 'liquidationPrice(address)': FunctionFragment - 'marketDebt()': FunctionFragment - 'marketKey()': FunctionFragment - 'marketSize()': FunctionFragment - 'marketSizes()': FunctionFragment - 'marketSkew()': FunctionFragment - 'modifyPosition(int256)': FunctionFragment - 'modifyPositionWithTracking(int256,bytes32)': FunctionFragment - 'nextPriceOrders(address)': FunctionFragment - 'notionalValue(address)': FunctionFragment - 'orderFee(int256)': FunctionFragment - 'positions(address)': FunctionFragment - 'postTradeDetails(int256,address)': FunctionFragment - 'profitLoss(address)': FunctionFragment - 'rebuildCache()': FunctionFragment - 'recomputeFunding()': FunctionFragment - 'remainingMargin(address)': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'submitNextPriceOrder(int256)': FunctionFragment - 'submitNextPriceOrderWithTracking(int256,bytes32)': FunctionFragment - 'transferMargin(int256)': FunctionFragment - 'unrecordedFunding()': FunctionFragment - 'withdrawAllMargin()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'accessibleMargin' - | 'accruedFunding' - | 'assetPrice' - | 'baseAsset' - | 'canLiquidate' - | 'cancelNextPriceOrder' - | 'closePosition' - | 'closePositionWithTracking' - | 'currentFundingRate' - | 'executeNextPriceOrder' - | 'fundingLastRecomputed' - | 'fundingSequence' - | 'fundingSequenceLength' - | 'isResolverCached' - | 'liquidatePosition' - | 'liquidationFee' - | 'liquidationPrice' - | 'marketDebt' - | 'marketKey' - | 'marketSize' - | 'marketSizes' - | 'marketSkew' - | 'modifyPosition' - | 'modifyPositionWithTracking' - | 'nextPriceOrders' - | 'notionalValue' - | 'orderFee' - | 'positions' - | 'postTradeDetails' - | 'profitLoss' - | 'rebuildCache' - | 'recomputeFunding' - | 'remainingMargin' - | 'resolver' - | 'resolverAddressesRequired' - | 'submitNextPriceOrder' - | 'submitNextPriceOrderWithTracking' - | 'transferMargin' - | 'unrecordedFunding' - | 'withdrawAllMargin' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'accessibleMargin', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'accruedFunding', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'assetPrice', values?: undefined): string - encodeFunctionData(functionFragment: 'baseAsset', values?: undefined): string - encodeFunctionData(functionFragment: 'canLiquidate', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'cancelNextPriceOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'closePosition', values?: undefined): string - encodeFunctionData( - functionFragment: 'closePositionWithTracking', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'currentFundingRate', values?: undefined): string - encodeFunctionData( - functionFragment: 'executeNextPriceOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'fundingLastRecomputed', values?: undefined): string - encodeFunctionData( - functionFragment: 'fundingSequence', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'fundingSequenceLength', values?: undefined): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData( - functionFragment: 'liquidatePosition', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'liquidationFee', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'liquidationPrice', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'marketDebt', values?: undefined): string - encodeFunctionData(functionFragment: 'marketKey', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSize', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSizes', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSkew', values?: undefined): string - encodeFunctionData( - functionFragment: 'modifyPosition', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'modifyPositionWithTracking', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'nextPriceOrders', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'notionalValue', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'orderFee', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'positions', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'postTradeDetails', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'profitLoss', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'recomputeFunding', values?: undefined): string - encodeFunctionData(functionFragment: 'remainingMargin', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData( - functionFragment: 'submitNextPriceOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'submitNextPriceOrderWithTracking', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferMargin', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'unrecordedFunding', values?: undefined): string - encodeFunctionData(functionFragment: 'withdrawAllMargin', values?: undefined): string - - decodeFunctionResult(functionFragment: 'accessibleMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'accruedFunding', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'assetPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'baseAsset', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'canLiquidate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'cancelNextPriceOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'closePosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'closePositionWithTracking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currentFundingRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'executeNextPriceOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingLastRecomputed', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingSequence', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingSequenceLength', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidatePosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketDebt', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSize', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSizes', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSkew', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'modifyPosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'modifyPositionWithTracking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nextPriceOrders', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'notionalValue', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'orderFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'positions', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'postTradeDetails', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'profitLoss', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'recomputeFunding', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'remainingMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'submitNextPriceOrder', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'submitNextPriceOrderWithTracking', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'transferMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'unrecordedFunding', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'withdrawAllMargin', data: BytesLike): Result - - events: { - 'CacheUpdated(bytes32,address)': EventFragment - 'FundingRecomputed(int256,uint256,uint256)': EventFragment - 'FuturesTracking(bytes32,bytes32,bytes32,int256,uint256)': EventFragment - 'MarginTransferred(address,int256)': EventFragment - 'NextPriceOrderRemoved(address,uint256,int256,uint256,uint256,uint256,bytes32)': EventFragment - 'NextPriceOrderSubmitted(address,int256,uint256,uint256,uint256,bytes32)': EventFragment - 'PositionLiquidated(uint256,address,address,int256,uint256,uint256)': EventFragment - 'PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FundingRecomputed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FuturesTracking'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MarginTransferred'): EventFragment - getEvent(nameOrSignatureOrTopic: 'NextPriceOrderRemoved'): EventFragment - getEvent(nameOrSignatureOrTopic: 'NextPriceOrderSubmitted'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PositionLiquidated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PositionModified'): EventFragment + functions: { + "accessibleMargin(address)": FunctionFragment; + "accruedFunding(address)": FunctionFragment; + "assetPrice()": FunctionFragment; + "baseAsset()": FunctionFragment; + "canLiquidate(address)": FunctionFragment; + "cancelNextPriceOrder(address)": FunctionFragment; + "closePosition()": FunctionFragment; + "closePositionWithTracking(bytes32)": FunctionFragment; + "currentFundingRate()": FunctionFragment; + "executeNextPriceOrder(address)": FunctionFragment; + "fundingLastRecomputed()": FunctionFragment; + "fundingSequence(uint256)": FunctionFragment; + "fundingSequenceLength()": FunctionFragment; + "isResolverCached()": FunctionFragment; + "liquidatePosition(address)": FunctionFragment; + "liquidationFee(address)": FunctionFragment; + "liquidationPrice(address)": FunctionFragment; + "marketDebt()": FunctionFragment; + "marketKey()": FunctionFragment; + "marketSize()": FunctionFragment; + "marketSizes()": FunctionFragment; + "marketSkew()": FunctionFragment; + "modifyPosition(int256)": FunctionFragment; + "modifyPositionWithTracking(int256,bytes32)": FunctionFragment; + "nextPriceOrders(address)": FunctionFragment; + "notionalValue(address)": FunctionFragment; + "orderFee(int256)": FunctionFragment; + "positions(address)": FunctionFragment; + "postTradeDetails(int256,address)": FunctionFragment; + "profitLoss(address)": FunctionFragment; + "rebuildCache()": FunctionFragment; + "recomputeFunding()": FunctionFragment; + "remainingMargin(address)": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "submitNextPriceOrder(int256)": FunctionFragment; + "submitNextPriceOrderWithTracking(int256,bytes32)": FunctionFragment; + "transferMargin(int256)": FunctionFragment; + "unrecordedFunding()": FunctionFragment; + "withdrawAllMargin()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "accessibleMargin" + | "accruedFunding" + | "assetPrice" + | "baseAsset" + | "canLiquidate" + | "cancelNextPriceOrder" + | "closePosition" + | "closePositionWithTracking" + | "currentFundingRate" + | "executeNextPriceOrder" + | "fundingLastRecomputed" + | "fundingSequence" + | "fundingSequenceLength" + | "isResolverCached" + | "liquidatePosition" + | "liquidationFee" + | "liquidationPrice" + | "marketDebt" + | "marketKey" + | "marketSize" + | "marketSizes" + | "marketSkew" + | "modifyPosition" + | "modifyPositionWithTracking" + | "nextPriceOrders" + | "notionalValue" + | "orderFee" + | "positions" + | "postTradeDetails" + | "profitLoss" + | "rebuildCache" + | "recomputeFunding" + | "remainingMargin" + | "resolver" + | "resolverAddressesRequired" + | "submitNextPriceOrder" + | "submitNextPriceOrderWithTracking" + | "transferMargin" + | "unrecordedFunding" + | "withdrawAllMargin" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "accessibleMargin", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "accruedFunding", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "assetPrice", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "baseAsset", values?: undefined): string; + encodeFunctionData( + functionFragment: "canLiquidate", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "cancelNextPriceOrder", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "closePosition", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "closePositionWithTracking", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "currentFundingRate", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "executeNextPriceOrder", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "fundingLastRecomputed", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "fundingSequence", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fundingSequenceLength", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidatePosition", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "liquidationFee", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "liquidationPrice", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "marketDebt", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "marketKey", values?: undefined): string; + encodeFunctionData( + functionFragment: "marketSize", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "marketSizes", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "marketSkew", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "modifyPosition", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "modifyPositionWithTracking", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "nextPriceOrders", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "notionalValue", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "orderFee", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "positions", values: [string]): string; + encodeFunctionData( + functionFragment: "postTradeDetails", + values: [BigNumberish, string] + ): string; + encodeFunctionData(functionFragment: "profitLoss", values: [string]): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "recomputeFunding", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "remainingMargin", + values: [string] + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "submitNextPriceOrder", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "submitNextPriceOrderWithTracking", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "transferMargin", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "unrecordedFunding", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "withdrawAllMargin", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "accessibleMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "accruedFunding", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "assetPrice", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "baseAsset", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "canLiquidate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "cancelNextPriceOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "closePosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "closePositionWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentFundingRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "executeNextPriceOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingLastRecomputed", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingSequence", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingSequenceLength", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidatePosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationPrice", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "marketDebt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "marketKey", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "marketSize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "marketSizes", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "marketSkew", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "modifyPosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "modifyPositionWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nextPriceOrders", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "notionalValue", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "orderFee", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "positions", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "postTradeDetails", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "profitLoss", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "recomputeFunding", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "remainingMargin", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitNextPriceOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitNextPriceOrderWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "unrecordedFunding", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "withdrawAllMargin", + data: BytesLike + ): Result; + + events: { + "CacheUpdated(bytes32,address)": EventFragment; + "FundingRecomputed(int256,uint256,uint256)": EventFragment; + "FuturesTracking(bytes32,bytes32,bytes32,int256,uint256)": EventFragment; + "MarginTransferred(address,int256)": EventFragment; + "NextPriceOrderRemoved(address,uint256,int256,uint256,uint256,uint256,bytes32)": EventFragment; + "NextPriceOrderSubmitted(address,int256,uint256,uint256,uint256,bytes32)": EventFragment; + "PositionLiquidated(uint256,address,address,int256,uint256,uint256)": EventFragment; + "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FundingRecomputed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FuturesTracking"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MarginTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "NextPriceOrderRemoved"): EventFragment; + getEvent(nameOrSignatureOrTopic: "NextPriceOrderSubmitted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionLiquidated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionModified"): EventFragment; } export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface FundingRecomputedEventObject { - funding: BigNumber - index: BigNumber - timestamp: BigNumber + funding: BigNumber; + index: BigNumber; + timestamp: BigNumber; } export type FundingRecomputedEvent = TypedEvent< - [BigNumber, BigNumber, BigNumber], - FundingRecomputedEventObject -> + [BigNumber, BigNumber, BigNumber], + FundingRecomputedEventObject +>; -export type FundingRecomputedEventFilter = TypedEventFilter +export type FundingRecomputedEventFilter = + TypedEventFilter; export interface FuturesTrackingEventObject { - trackingCode: string - baseAsset: string - marketKey: string - sizeDelta: BigNumber - fee: BigNumber + trackingCode: string; + baseAsset: string; + marketKey: string; + sizeDelta: BigNumber; + fee: BigNumber; } export type FuturesTrackingEvent = TypedEvent< - [string, string, string, BigNumber, BigNumber], - FuturesTrackingEventObject -> + [string, string, string, BigNumber, BigNumber], + FuturesTrackingEventObject +>; -export type FuturesTrackingEventFilter = TypedEventFilter +export type FuturesTrackingEventFilter = TypedEventFilter; export interface MarginTransferredEventObject { - account: string - marginDelta: BigNumber + account: string; + marginDelta: BigNumber; } -export type MarginTransferredEvent = TypedEvent<[string, BigNumber], MarginTransferredEventObject> +export type MarginTransferredEvent = TypedEvent< + [string, BigNumber], + MarginTransferredEventObject +>; -export type MarginTransferredEventFilter = TypedEventFilter +export type MarginTransferredEventFilter = + TypedEventFilter; export interface NextPriceOrderRemovedEventObject { - account: string - currentRoundId: BigNumber - sizeDelta: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - trackingCode: string + account: string; + currentRoundId: BigNumber; + sizeDelta: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + trackingCode: string; } export type NextPriceOrderRemovedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, string], - NextPriceOrderRemovedEventObject -> + [string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, string], + NextPriceOrderRemovedEventObject +>; -export type NextPriceOrderRemovedEventFilter = TypedEventFilter +export type NextPriceOrderRemovedEventFilter = + TypedEventFilter; export interface NextPriceOrderSubmittedEventObject { - account: string - sizeDelta: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - trackingCode: string + account: string; + sizeDelta: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + trackingCode: string; } export type NextPriceOrderSubmittedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, BigNumber, string], - NextPriceOrderSubmittedEventObject -> + [string, BigNumber, BigNumber, BigNumber, BigNumber, string], + NextPriceOrderSubmittedEventObject +>; -export type NextPriceOrderSubmittedEventFilter = TypedEventFilter +export type NextPriceOrderSubmittedEventFilter = + TypedEventFilter; export interface PositionLiquidatedEventObject { - id: BigNumber - account: string - liquidator: string - size: BigNumber - price: BigNumber - fee: BigNumber + id: BigNumber; + account: string; + liquidator: string; + size: BigNumber; + price: BigNumber; + fee: BigNumber; } export type PositionLiquidatedEvent = TypedEvent< - [BigNumber, string, string, BigNumber, BigNumber, BigNumber], - PositionLiquidatedEventObject -> + [BigNumber, string, string, BigNumber, BigNumber, BigNumber], + PositionLiquidatedEventObject +>; -export type PositionLiquidatedEventFilter = TypedEventFilter +export type PositionLiquidatedEventFilter = + TypedEventFilter; export interface PositionModifiedEventObject { - id: BigNumber - account: string - margin: BigNumber - size: BigNumber - tradeSize: BigNumber - lastPrice: BigNumber - fundingIndex: BigNumber - fee: BigNumber + id: BigNumber; + account: string; + margin: BigNumber; + size: BigNumber; + tradeSize: BigNumber; + lastPrice: BigNumber; + fundingIndex: BigNumber; + fee: BigNumber; } export type PositionModifiedEvent = TypedEvent< - [BigNumber, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], - PositionModifiedEventObject -> - -export type PositionModifiedEventFilter = TypedEventFilter + [ + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ], + PositionModifiedEventObject +>; + +export type PositionModifiedEventFilter = + TypedEventFilter; export interface FuturesMarket extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: FuturesMarketInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise<[string]> - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]> - - cancelNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePositionWithTracking( - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise<[BigNumber]> - - executeNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise<[number]> - - fundingSequence( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - fundingSequenceLength(overrides?: CallOverrides): Promise<[BigNumber]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise<[string]> - - marketSize(overrides?: CallOverrides): Promise<[BigNumber]> - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise<[BigNumber]> - - modifyPosition( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nextPriceOrders( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, string] & { - sizeDelta: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - trackingCode: string - } - > - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - positions( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } - > - - postTradeDetails( - sizeDelta: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - recomputeFunding( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - submitNextPriceOrder( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitNextPriceOrderWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - withdrawAllMargin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise - - cancelNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePositionWithTracking( - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - executeNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise - - modifyPosition( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nextPriceOrders( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, string] & { - sizeDelta: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - trackingCode: string - } - > - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - positions( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } - > - - postTradeDetails( - sizeDelta: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - recomputeFunding( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - submitNextPriceOrder( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitNextPriceOrderWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - withdrawAllMargin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise - - cancelNextPriceOrder(account: PromiseOrValue, overrides?: CallOverrides): Promise - - closePosition(overrides?: CallOverrides): Promise - - closePositionWithTracking( - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - executeNextPriceOrder(account: PromiseOrValue, overrides?: CallOverrides): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidatePosition(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise - - modifyPosition( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nextPriceOrders( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, string] & { - sizeDelta: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - trackingCode: string - } - > - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - positions( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } - > - - postTradeDetails( - sizeDelta: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> - - rebuildCache(overrides?: CallOverrides): Promise - - recomputeFunding(overrides?: CallOverrides): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - submitNextPriceOrder( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - submitNextPriceOrderWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - withdrawAllMargin(overrides?: CallOverrides): Promise - } - - filters: { - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'FundingRecomputed(int256,uint256,uint256)'( - funding?: null, - index?: null, - timestamp?: null - ): FundingRecomputedEventFilter - FundingRecomputed(funding?: null, index?: null, timestamp?: null): FundingRecomputedEventFilter - - 'FuturesTracking(bytes32,bytes32,bytes32,int256,uint256)'( - trackingCode?: PromiseOrValue | null, - baseAsset?: null, - marketKey?: null, - sizeDelta?: null, - fee?: null - ): FuturesTrackingEventFilter - FuturesTracking( - trackingCode?: PromiseOrValue | null, - baseAsset?: null, - marketKey?: null, - sizeDelta?: null, - fee?: null - ): FuturesTrackingEventFilter - - 'MarginTransferred(address,int256)'( - account?: PromiseOrValue | null, - marginDelta?: null - ): MarginTransferredEventFilter - MarginTransferred( - account?: PromiseOrValue | null, - marginDelta?: null - ): MarginTransferredEventFilter - - 'NextPriceOrderRemoved(address,uint256,int256,uint256,uint256,uint256,bytes32)'( - account?: PromiseOrValue | null, - currentRoundId?: null, - sizeDelta?: null, - targetRoundId?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): NextPriceOrderRemovedEventFilter - NextPriceOrderRemoved( - account?: PromiseOrValue | null, - currentRoundId?: null, - sizeDelta?: null, - targetRoundId?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): NextPriceOrderRemovedEventFilter - - 'NextPriceOrderSubmitted(address,int256,uint256,uint256,uint256,bytes32)'( - account?: PromiseOrValue | null, - sizeDelta?: null, - targetRoundId?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): NextPriceOrderSubmittedEventFilter - NextPriceOrderSubmitted( - account?: PromiseOrValue | null, - sizeDelta?: null, - targetRoundId?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): NextPriceOrderSubmittedEventFilter - - 'PositionLiquidated(uint256,address,address,int256,uint256,uint256)'( - id?: PromiseOrValue | null, - account?: PromiseOrValue | null, - liquidator?: PromiseOrValue | null, - size?: null, - price?: null, - fee?: null - ): PositionLiquidatedEventFilter - PositionLiquidated( - id?: PromiseOrValue | null, - account?: PromiseOrValue | null, - liquidator?: PromiseOrValue | null, - size?: null, - price?: null, - fee?: null - ): PositionLiquidatedEventFilter - - 'PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256)'( - id?: PromiseOrValue | null, - account?: PromiseOrValue | null, - margin?: null, - size?: null, - tradeSize?: null, - lastPrice?: null, - fundingIndex?: null, - fee?: null - ): PositionModifiedEventFilter - PositionModified( - id?: PromiseOrValue | null, - account?: PromiseOrValue | null, - margin?: null, - size?: null, - tradeSize?: null, - lastPrice?: null, - fundingIndex?: null, - fee?: null - ): PositionModifiedEventFilter - } - - estimateGas: { - accessibleMargin(account: PromiseOrValue, overrides?: CallOverrides): Promise - - accruedFunding(account: PromiseOrValue, overrides?: CallOverrides): Promise - - assetPrice(overrides?: CallOverrides): Promise - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise - - cancelNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - closePositionWithTracking( - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - executeNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationPrice(account: PromiseOrValue, overrides?: CallOverrides): Promise - - marketDebt(overrides?: CallOverrides): Promise - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes(overrides?: CallOverrides): Promise - - marketSkew(overrides?: CallOverrides): Promise - - modifyPosition( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nextPriceOrders(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - notionalValue(account: PromiseOrValue, overrides?: CallOverrides): Promise - - orderFee(sizeDelta: PromiseOrValue, overrides?: CallOverrides): Promise - - positions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - postTradeDetails( - sizeDelta: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - profitLoss(account: PromiseOrValue, overrides?: CallOverrides): Promise - - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - recomputeFunding(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - remainingMargin(account: PromiseOrValue, overrides?: CallOverrides): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - submitNextPriceOrder( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitNextPriceOrderWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - unrecordedFunding(overrides?: CallOverrides): Promise - - withdrawAllMargin(overrides?: Overrides & { from?: PromiseOrValue }): Promise - } - - populateTransaction: { - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - assetPrice(overrides?: CallOverrides): Promise - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - cancelNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePositionWithTracking( - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - executeNextPriceOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: FuturesMarketInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise<[string]>; + + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + cancelNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise<[BigNumber]>; + + executeNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed(overrides?: CallOverrides): Promise<[number]>; + + fundingSequence( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + fundingSequenceLength(overrides?: CallOverrides): Promise<[BigNumber]>; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise<[string]>; + + marketSize(overrides?: CallOverrides): Promise<[BigNumber]>; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise<[BigNumber]>; + + modifyPosition( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nextPriceOrders( + arg0: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, string] & { + sizeDelta: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + trackingCode: string; + } + >; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; + + orderFee( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; + + positions( + arg0: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + } + >; + + postTradeDetails( + sizeDelta: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; + + resolver(overrides?: CallOverrides): Promise<[string]>; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; + + submitNextPriceOrder( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitNextPriceOrderWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + }; + + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate(account: string, overrides?: CallOverrides): Promise; + + cancelNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + executeNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nextPriceOrders( + arg0: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, string] & { + sizeDelta: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + trackingCode: string; + } + >; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; + + orderFee( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; + + positions( + arg0: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + } + >; + + postTradeDetails( + sizeDelta: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + submitNextPriceOrder( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitNextPriceOrderWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate(account: string, overrides?: CallOverrides): Promise; + + cancelNextPriceOrder( + account: string, + overrides?: CallOverrides + ): Promise; + + closePosition(overrides?: CallOverrides): Promise; + + closePositionWithTracking( + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + executeNextPriceOrder( + account: string, + overrides?: CallOverrides + ): Promise; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidatePosition( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + nextPriceOrders( + arg0: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, string] & { + sizeDelta: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + trackingCode: string; + } + >; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; + + orderFee( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; + + positions( + arg0: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + } + >; + + postTradeDetails( + sizeDelta: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; + + rebuildCache(overrides?: CallOverrides): Promise; + + recomputeFunding(overrides?: CallOverrides): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + submitNextPriceOrder( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + submitNextPriceOrderWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + withdrawAllMargin(overrides?: CallOverrides): Promise; + }; + + filters: { + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "FundingRecomputed(int256,uint256,uint256)"( + funding?: null, + index?: null, + timestamp?: null + ): FundingRecomputedEventFilter; + FundingRecomputed( + funding?: null, + index?: null, + timestamp?: null + ): FundingRecomputedEventFilter; + + "FuturesTracking(bytes32,bytes32,bytes32,int256,uint256)"( + trackingCode?: BytesLike | null, + baseAsset?: null, + marketKey?: null, + sizeDelta?: null, + fee?: null + ): FuturesTrackingEventFilter; + FuturesTracking( + trackingCode?: BytesLike | null, + baseAsset?: null, + marketKey?: null, + sizeDelta?: null, + fee?: null + ): FuturesTrackingEventFilter; + + "MarginTransferred(address,int256)"( + account?: string | null, + marginDelta?: null + ): MarginTransferredEventFilter; + MarginTransferred( + account?: string | null, + marginDelta?: null + ): MarginTransferredEventFilter; + + "NextPriceOrderRemoved(address,uint256,int256,uint256,uint256,uint256,bytes32)"( + account?: string | null, + currentRoundId?: null, + sizeDelta?: null, + targetRoundId?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): NextPriceOrderRemovedEventFilter; + NextPriceOrderRemoved( + account?: string | null, + currentRoundId?: null, + sizeDelta?: null, + targetRoundId?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): NextPriceOrderRemovedEventFilter; + + "NextPriceOrderSubmitted(address,int256,uint256,uint256,uint256,bytes32)"( + account?: string | null, + sizeDelta?: null, + targetRoundId?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): NextPriceOrderSubmittedEventFilter; + NextPriceOrderSubmitted( + account?: string | null, + sizeDelta?: null, + targetRoundId?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): NextPriceOrderSubmittedEventFilter; + + "PositionLiquidated(uint256,address,address,int256,uint256,uint256)"( + id?: BigNumberish | null, + account?: string | null, + liquidator?: string | null, + size?: null, + price?: null, + fee?: null + ): PositionLiquidatedEventFilter; + PositionLiquidated( + id?: BigNumberish | null, + account?: string | null, + liquidator?: string | null, + size?: null, + price?: null, + fee?: null + ): PositionLiquidatedEventFilter; + + "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256)"( + id?: BigNumberish | null, + account?: string | null, + margin?: null, + size?: null, + tradeSize?: null, + lastPrice?: null, + fundingIndex?: null, + fee?: null + ): PositionModifiedEventFilter; + PositionModified( + id?: BigNumberish | null, + account?: string | null, + margin?: null, + size?: null, + tradeSize?: null, + lastPrice?: null, + fundingIndex?: null, + fee?: null + ): PositionModifiedEventFilter; + }; + + estimateGas: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise; + + assetPrice(overrides?: CallOverrides): Promise; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise; + + cancelNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + executeNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise; + + marketDebt(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes(overrides?: CallOverrides): Promise; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nextPriceOrders( + arg0: string, + overrides?: CallOverrides + ): Promise; - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise; - marketDebt(overrides?: CallOverrides): Promise + orderFee( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; - marketKey(overrides?: CallOverrides): Promise + positions(arg0: string, overrides?: CallOverrides): Promise; - marketSize(overrides?: CallOverrides): Promise + postTradeDetails( + sizeDelta: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise; - marketSizes(overrides?: CallOverrides): Promise + profitLoss(account: string, overrides?: CallOverrides): Promise; - marketSkew(overrides?: CallOverrides): Promise + rebuildCache(overrides?: Overrides & { from?: string }): Promise; - modifyPosition( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise; - nextPriceOrders( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + resolver(overrides?: CallOverrides): Promise; - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - orderFee( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise + submitNextPriceOrder( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - positions( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + submitNextPriceOrderWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; - postTradeDetails( - sizeDelta: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + unrecordedFunding(overrides?: CallOverrides): Promise; - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + }; - recomputeFunding( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + populateTransaction: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise; - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise; - resolver(overrides?: CallOverrides): Promise + assetPrice(overrides?: CallOverrides): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + baseAsset(overrides?: CallOverrides): Promise; - submitNextPriceOrder( - sizeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise; - submitNextPriceOrderWithTracking( - sizeDelta: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + cancelNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate( + overrides?: CallOverrides + ): Promise; + + executeNextPriceOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed( + overrides?: CallOverrides + ): Promise; - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + fundingSequence( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; - unrecordedFunding(overrides?: CallOverrides): Promise - - withdrawAllMargin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + fundingSequenceLength( + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise; + + marketDebt(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes(overrides?: CallOverrides): Promise; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nextPriceOrders( + arg0: string, + overrides?: CallOverrides + ): Promise; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise; + + orderFee( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + positions( + arg0: string, + overrides?: CallOverrides + ): Promise; + + postTradeDetails( + sizeDelta: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + submitNextPriceOrder( + sizeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitNextPriceOrderWithTracking( + sizeDelta: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + unrecordedFunding(overrides?: CallOverrides): Promise; + + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/FuturesMarketData.ts b/packages/sdk/src/contracts/types/FuturesMarketData.ts index b037dc9094..62511c5ad3 100644 --- a/packages/sdk/src/contracts/types/FuturesMarketData.ts +++ b/packages/sdk/src/contracts/types/FuturesMarketData.ts @@ -2,575 +2,642 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace FuturesMarketData { - export type FeeRatesStruct = { - takerFee: PromiseOrValue - makerFee: PromiseOrValue - takerFeeNextPrice: PromiseOrValue - makerFeeNextPrice: PromiseOrValue - } - - export type FeeRatesStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeNextPrice: BigNumber - makerFeeNextPrice: BigNumber - } - - export type MarketSummaryStruct = { - market: PromiseOrValue - asset: PromiseOrValue - key: PromiseOrValue - maxLeverage: PromiseOrValue - price: PromiseOrValue - marketSize: PromiseOrValue - marketSkew: PromiseOrValue - marketDebt: PromiseOrValue - currentFundingRate: PromiseOrValue - feeRates: FuturesMarketData.FeeRatesStruct - } - - export type MarketSummaryStructOutput = [ - string, - string, - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - FuturesMarketData.FeeRatesStructOutput - ] & { - market: string - asset: string - key: string - maxLeverage: BigNumber - price: BigNumber - marketSize: BigNumber - marketSkew: BigNumber - marketDebt: BigNumber - currentFundingRate: BigNumber - feeRates: FuturesMarketData.FeeRatesStructOutput - } - - export type FuturesGlobalsStruct = { - minInitialMargin: PromiseOrValue - liquidationFeeRatio: PromiseOrValue - liquidationBufferRatio: PromiseOrValue - minKeeperFee: PromiseOrValue - } - - export type FuturesGlobalsStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber] & { - minInitialMargin: BigNumber - liquidationFeeRatio: BigNumber - liquidationBufferRatio: BigNumber - minKeeperFee: BigNumber - } - - export type MarketLimitsStruct = { - maxLeverage: PromiseOrValue - maxMarketValueUSD: PromiseOrValue - } - - export type MarketLimitsStructOutput = [BigNumber, BigNumber] & { - maxLeverage: BigNumber - maxMarketValueUSD: BigNumber - } - - export type FundingParametersStruct = { - maxFundingRate: PromiseOrValue - skewScaleUSD: PromiseOrValue - } - - export type FundingParametersStructOutput = [BigNumber, BigNumber] & { - maxFundingRate: BigNumber - skewScaleUSD: BigNumber - } - - export type SidesStruct = { - long: PromiseOrValue - short: PromiseOrValue - } - - export type SidesStructOutput = [BigNumber, BigNumber] & { - long: BigNumber - short: BigNumber - } - - export type MarketSizeDetailsStruct = { - marketSize: PromiseOrValue - sides: FuturesMarketData.SidesStruct - marketDebt: PromiseOrValue - marketSkew: PromiseOrValue - } - - export type MarketSizeDetailsStructOutput = [ - BigNumber, - FuturesMarketData.SidesStructOutput, - BigNumber, - BigNumber - ] & { - marketSize: BigNumber - sides: FuturesMarketData.SidesStructOutput - marketDebt: BigNumber - marketSkew: BigNumber - } - - export type PriceDetailsStruct = { - price: PromiseOrValue - invalid: PromiseOrValue - } - - export type PriceDetailsStructOutput = [BigNumber, boolean] & { - price: BigNumber - invalid: boolean - } - - export type MarketDataStruct = { - market: PromiseOrValue - baseAsset: PromiseOrValue - marketKey: PromiseOrValue - feeRates: FuturesMarketData.FeeRatesStruct - limits: FuturesMarketData.MarketLimitsStruct - fundingParameters: FuturesMarketData.FundingParametersStruct - marketSizeDetails: FuturesMarketData.MarketSizeDetailsStruct - priceDetails: FuturesMarketData.PriceDetailsStruct - } - - export type MarketDataStructOutput = [ - string, - string, - string, - FuturesMarketData.FeeRatesStructOutput, - FuturesMarketData.MarketLimitsStructOutput, - FuturesMarketData.FundingParametersStructOutput, - FuturesMarketData.MarketSizeDetailsStructOutput, - FuturesMarketData.PriceDetailsStructOutput - ] & { - market: string - baseAsset: string - marketKey: string - feeRates: FuturesMarketData.FeeRatesStructOutput - limits: FuturesMarketData.MarketLimitsStructOutput - fundingParameters: FuturesMarketData.FundingParametersStructOutput - marketSizeDetails: FuturesMarketData.MarketSizeDetailsStructOutput - priceDetails: FuturesMarketData.PriceDetailsStructOutput - } - - export type PositionDataStruct = { - position: IFuturesMarketBaseTypes.PositionStruct - notionalValue: PromiseOrValue - profitLoss: PromiseOrValue - accruedFunding: PromiseOrValue - remainingMargin: PromiseOrValue - accessibleMargin: PromiseOrValue - liquidationPrice: PromiseOrValue - canLiquidatePosition: PromiseOrValue - } - - export type PositionDataStructOutput = [ - IFuturesMarketBaseTypes.PositionStructOutput, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - boolean - ] & { - position: IFuturesMarketBaseTypes.PositionStructOutput - notionalValue: BigNumber - profitLoss: BigNumber - accruedFunding: BigNumber - remainingMargin: BigNumber - accessibleMargin: BigNumber - liquidationPrice: BigNumber - canLiquidatePosition: boolean - } + export type FeeRatesStruct = { + takerFee: BigNumberish; + makerFee: BigNumberish; + takerFeeNextPrice: BigNumberish; + makerFeeNextPrice: BigNumberish; + }; + + export type FeeRatesStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeNextPrice: BigNumber; + makerFeeNextPrice: BigNumber; + }; + + export type MarketSummaryStruct = { + market: string; + asset: BytesLike; + key: BytesLike; + maxLeverage: BigNumberish; + price: BigNumberish; + marketSize: BigNumberish; + marketSkew: BigNumberish; + marketDebt: BigNumberish; + currentFundingRate: BigNumberish; + feeRates: FuturesMarketData.FeeRatesStruct; + }; + + export type MarketSummaryStructOutput = [ + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + FuturesMarketData.FeeRatesStructOutput + ] & { + market: string; + asset: string; + key: string; + maxLeverage: BigNumber; + price: BigNumber; + marketSize: BigNumber; + marketSkew: BigNumber; + marketDebt: BigNumber; + currentFundingRate: BigNumber; + feeRates: FuturesMarketData.FeeRatesStructOutput; + }; + + export type FuturesGlobalsStruct = { + minInitialMargin: BigNumberish; + liquidationFeeRatio: BigNumberish; + liquidationBufferRatio: BigNumberish; + minKeeperFee: BigNumberish; + }; + + export type FuturesGlobalsStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + minInitialMargin: BigNumber; + liquidationFeeRatio: BigNumber; + liquidationBufferRatio: BigNumber; + minKeeperFee: BigNumber; + }; + + export type MarketLimitsStruct = { + maxLeverage: BigNumberish; + maxMarketValueUSD: BigNumberish; + }; + + export type MarketLimitsStructOutput = [BigNumber, BigNumber] & { + maxLeverage: BigNumber; + maxMarketValueUSD: BigNumber; + }; + + export type FundingParametersStruct = { + maxFundingRate: BigNumberish; + skewScaleUSD: BigNumberish; + }; + + export type FundingParametersStructOutput = [BigNumber, BigNumber] & { + maxFundingRate: BigNumber; + skewScaleUSD: BigNumber; + }; + + export type SidesStruct = { long: BigNumberish; short: BigNumberish }; + + export type SidesStructOutput = [BigNumber, BigNumber] & { + long: BigNumber; + short: BigNumber; + }; + + export type MarketSizeDetailsStruct = { + marketSize: BigNumberish; + sides: FuturesMarketData.SidesStruct; + marketDebt: BigNumberish; + marketSkew: BigNumberish; + }; + + export type MarketSizeDetailsStructOutput = [ + BigNumber, + FuturesMarketData.SidesStructOutput, + BigNumber, + BigNumber + ] & { + marketSize: BigNumber; + sides: FuturesMarketData.SidesStructOutput; + marketDebt: BigNumber; + marketSkew: BigNumber; + }; + + export type PriceDetailsStruct = { price: BigNumberish; invalid: boolean }; + + export type PriceDetailsStructOutput = [BigNumber, boolean] & { + price: BigNumber; + invalid: boolean; + }; + + export type MarketDataStruct = { + market: string; + baseAsset: BytesLike; + marketKey: BytesLike; + feeRates: FuturesMarketData.FeeRatesStruct; + limits: FuturesMarketData.MarketLimitsStruct; + fundingParameters: FuturesMarketData.FundingParametersStruct; + marketSizeDetails: FuturesMarketData.MarketSizeDetailsStruct; + priceDetails: FuturesMarketData.PriceDetailsStruct; + }; + + export type MarketDataStructOutput = [ + string, + string, + string, + FuturesMarketData.FeeRatesStructOutput, + FuturesMarketData.MarketLimitsStructOutput, + FuturesMarketData.FundingParametersStructOutput, + FuturesMarketData.MarketSizeDetailsStructOutput, + FuturesMarketData.PriceDetailsStructOutput + ] & { + market: string; + baseAsset: string; + marketKey: string; + feeRates: FuturesMarketData.FeeRatesStructOutput; + limits: FuturesMarketData.MarketLimitsStructOutput; + fundingParameters: FuturesMarketData.FundingParametersStructOutput; + marketSizeDetails: FuturesMarketData.MarketSizeDetailsStructOutput; + priceDetails: FuturesMarketData.PriceDetailsStructOutput; + }; + + export type PositionDataStruct = { + position: IFuturesMarketBaseTypes.PositionStruct; + notionalValue: BigNumberish; + profitLoss: BigNumberish; + accruedFunding: BigNumberish; + remainingMargin: BigNumberish; + accessibleMargin: BigNumberish; + liquidationPrice: BigNumberish; + canLiquidatePosition: boolean; + }; + + export type PositionDataStructOutput = [ + IFuturesMarketBaseTypes.PositionStructOutput, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + boolean + ] & { + position: IFuturesMarketBaseTypes.PositionStructOutput; + notionalValue: BigNumber; + profitLoss: BigNumber; + accruedFunding: BigNumber; + remainingMargin: BigNumber; + accessibleMargin: BigNumber; + liquidationPrice: BigNumber; + canLiquidatePosition: boolean; + }; } export declare namespace IFuturesMarketSettings { - export type ParametersStruct = { - takerFee: PromiseOrValue - makerFee: PromiseOrValue - takerFeeNextPrice: PromiseOrValue - makerFeeNextPrice: PromiseOrValue - nextPriceConfirmWindow: PromiseOrValue - maxLeverage: PromiseOrValue - maxMarketValueUSD: PromiseOrValue - maxFundingRate: PromiseOrValue - skewScaleUSD: PromiseOrValue - } - - export type ParametersStructOutput = [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeNextPrice: BigNumber - makerFeeNextPrice: BigNumber - nextPriceConfirmWindow: BigNumber - maxLeverage: BigNumber - maxMarketValueUSD: BigNumber - maxFundingRate: BigNumber - skewScaleUSD: BigNumber - } + export type ParametersStruct = { + takerFee: BigNumberish; + makerFee: BigNumberish; + takerFeeNextPrice: BigNumberish; + makerFeeNextPrice: BigNumberish; + nextPriceConfirmWindow: BigNumberish; + maxLeverage: BigNumberish; + maxMarketValueUSD: BigNumberish; + maxFundingRate: BigNumberish; + skewScaleUSD: BigNumberish; + }; + + export type ParametersStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeNextPrice: BigNumber; + makerFeeNextPrice: BigNumber; + nextPriceConfirmWindow: BigNumber; + maxLeverage: BigNumber; + maxMarketValueUSD: BigNumber; + maxFundingRate: BigNumber; + skewScaleUSD: BigNumber; + }; } export declare namespace IFuturesMarketBaseTypes { - export type PositionStruct = { - id: PromiseOrValue - lastFundingIndex: PromiseOrValue - margin: PromiseOrValue - lastPrice: PromiseOrValue - size: PromiseOrValue - } - - export type PositionStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } + export type PositionStruct = { + id: BigNumberish; + lastFundingIndex: BigNumberish; + margin: BigNumberish; + lastPrice: BigNumberish; + size: BigNumberish; + }; + + export type PositionStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + }; } export interface FuturesMarketDataInterface extends utils.Interface { - functions: { - 'allMarketSummaries()': FunctionFragment - 'globals()': FunctionFragment - 'marketDetails(address)': FunctionFragment - 'marketDetailsForKey(bytes32)': FunctionFragment - 'marketSummaries(address[])': FunctionFragment - 'marketSummariesForKeys(bytes32[])': FunctionFragment - 'parameters(bytes32)': FunctionFragment - 'positionDetails(address,address)': FunctionFragment - 'positionDetailsForMarketKey(bytes32,address)': FunctionFragment - 'resolverProxy()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'allMarketSummaries' - | 'globals' - | 'marketDetails' - | 'marketDetailsForKey' - | 'marketSummaries' - | 'marketSummariesForKeys' - | 'parameters' - | 'positionDetails' - | 'positionDetailsForMarketKey' - | 'resolverProxy' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'allMarketSummaries', values?: undefined): string - encodeFunctionData(functionFragment: 'globals', values?: undefined): string - encodeFunctionData(functionFragment: 'marketDetails', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'marketDetailsForKey', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'marketSummaries', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'marketSummariesForKeys', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'parameters', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'positionDetails', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'positionDetailsForMarketKey', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'resolverProxy', values?: undefined): string - - decodeFunctionResult(functionFragment: 'allMarketSummaries', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'globals', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketDetails', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketDetailsForKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSummaries', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSummariesForKeys', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'parameters', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'positionDetails', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'positionDetailsForMarketKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverProxy', data: BytesLike): Result - - events: {} + functions: { + "allMarketSummaries()": FunctionFragment; + "globals()": FunctionFragment; + "marketDetails(address)": FunctionFragment; + "marketDetailsForKey(bytes32)": FunctionFragment; + "marketSummaries(address[])": FunctionFragment; + "marketSummariesForKeys(bytes32[])": FunctionFragment; + "parameters(bytes32)": FunctionFragment; + "positionDetails(address,address)": FunctionFragment; + "positionDetailsForMarketKey(bytes32,address)": FunctionFragment; + "resolverProxy()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "allMarketSummaries" + | "globals" + | "marketDetails" + | "marketDetailsForKey" + | "marketSummaries" + | "marketSummariesForKeys" + | "parameters" + | "positionDetails" + | "positionDetailsForMarketKey" + | "resolverProxy" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "allMarketSummaries", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "globals", values?: undefined): string; + encodeFunctionData( + functionFragment: "marketDetails", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "marketDetailsForKey", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "marketSummaries", + values: [string[]] + ): string; + encodeFunctionData( + functionFragment: "marketSummariesForKeys", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "parameters", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "positionDetails", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "positionDetailsForMarketKey", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "resolverProxy", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "allMarketSummaries", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "globals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "marketDetails", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "marketDetailsForKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "marketSummaries", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "marketSummariesForKeys", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "parameters", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "positionDetails", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "positionDetailsForMarketKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resolverProxy", + data: BytesLike + ): Result; + + events: {}; } export interface FuturesMarketData extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: FuturesMarketDataInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - allMarketSummaries( - overrides?: CallOverrides - ): Promise<[FuturesMarketData.MarketSummaryStructOutput[]]> - - globals(overrides?: CallOverrides): Promise<[FuturesMarketData.FuturesGlobalsStructOutput]> - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[FuturesMarketData.MarketDataStructOutput]> - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[FuturesMarketData.MarketDataStructOutput]> - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[FuturesMarketData.MarketSummaryStructOutput[]]> - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[FuturesMarketData.MarketSummaryStructOutput[]]> - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[IFuturesMarketSettings.ParametersStructOutput]> - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[FuturesMarketData.PositionDataStructOutput]> - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[FuturesMarketData.PositionDataStructOutput]> - - resolverProxy(overrides?: CallOverrides): Promise<[string]> - } - - allMarketSummaries( - overrides?: CallOverrides - ): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - - callStatic: { - allMarketSummaries( - overrides?: CallOverrides - ): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - } - - filters: {} - - estimateGas: { - allMarketSummaries(overrides?: CallOverrides): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails(market: PromiseOrValue, overrides?: CallOverrides): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters(marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - } - - populateTransaction: { - allMarketSummaries(overrides?: CallOverrides): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: FuturesMarketDataInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + allMarketSummaries( + overrides?: CallOverrides + ): Promise<[FuturesMarketData.MarketSummaryStructOutput[]]>; + + globals( + overrides?: CallOverrides + ): Promise<[FuturesMarketData.FuturesGlobalsStructOutput]>; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise<[FuturesMarketData.MarketDataStructOutput]>; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[FuturesMarketData.MarketDataStructOutput]>; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise<[FuturesMarketData.MarketSummaryStructOutput[]]>; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise<[FuturesMarketData.MarketSummaryStructOutput[]]>; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[IFuturesMarketSettings.ParametersStructOutput]>; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise<[FuturesMarketData.PositionDataStructOutput]>; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise<[FuturesMarketData.PositionDataStructOutput]>; + + resolverProxy(overrides?: CallOverrides): Promise<[string]>; + }; + + allMarketSummaries( + overrides?: CallOverrides + ): Promise; + + globals( + overrides?: CallOverrides + ): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + + callStatic: { + allMarketSummaries( + overrides?: CallOverrides + ): Promise; + + globals( + overrides?: CallOverrides + ): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + }; + + filters: {}; + + estimateGas: { + allMarketSummaries(overrides?: CallOverrides): Promise; + + globals(overrides?: CallOverrides): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + allMarketSummaries( + overrides?: CallOverrides + ): Promise; + + globals(overrides?: CallOverrides): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/FuturesMarketSettings.ts b/packages/sdk/src/contracts/types/FuturesMarketSettings.ts index 1a635bbe46..64463fd873 100644 --- a/packages/sdk/src/contracts/types/FuturesMarketSettings.ts +++ b/packages/sdk/src/contracts/types/FuturesMarketSettings.ts @@ -2,1267 +2,1489 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface FuturesMarketSettingsInterface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'isResolverCached()': FunctionFragment - 'liquidationBufferRatio()': FunctionFragment - 'liquidationFeeRatio()': FunctionFragment - 'makerFee(bytes32)': FunctionFragment - 'makerFeeNextPrice(bytes32)': FunctionFragment - 'maxFundingRate(bytes32)': FunctionFragment - 'maxLeverage(bytes32)': FunctionFragment - 'maxMarketValueUSD(bytes32)': FunctionFragment - 'minInitialMargin()': FunctionFragment - 'minKeeperFee()': FunctionFragment - 'nextPriceConfirmWindow(bytes32)': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'parameters(bytes32)': FunctionFragment - 'rebuildCache()': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'setLiquidationBufferRatio(uint256)': FunctionFragment - 'setLiquidationFeeRatio(uint256)': FunctionFragment - 'setMakerFee(bytes32,uint256)': FunctionFragment - 'setMakerFeeNextPrice(bytes32,uint256)': FunctionFragment - 'setMaxFundingRate(bytes32,uint256)': FunctionFragment - 'setMaxLeverage(bytes32,uint256)': FunctionFragment - 'setMaxMarketValueUSD(bytes32,uint256)': FunctionFragment - 'setMinInitialMargin(uint256)': FunctionFragment - 'setMinKeeperFee(uint256)': FunctionFragment - 'setNextPriceConfirmWindow(bytes32,uint256)': FunctionFragment - 'setParameters(bytes32,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)': FunctionFragment - 'setSkewScaleUSD(bytes32,uint256)': FunctionFragment - 'setTakerFee(bytes32,uint256)': FunctionFragment - 'setTakerFeeNextPrice(bytes32,uint256)': FunctionFragment - 'skewScaleUSD(bytes32)': FunctionFragment - 'takerFee(bytes32)': FunctionFragment - 'takerFeeNextPrice(bytes32)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'isResolverCached' - | 'liquidationBufferRatio' - | 'liquidationFeeRatio' - | 'makerFee' - | 'makerFeeNextPrice' - | 'maxFundingRate' - | 'maxLeverage' - | 'maxMarketValueUSD' - | 'minInitialMargin' - | 'minKeeperFee' - | 'nextPriceConfirmWindow' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'parameters' - | 'rebuildCache' - | 'resolver' - | 'resolverAddressesRequired' - | 'setLiquidationBufferRatio' - | 'setLiquidationFeeRatio' - | 'setMakerFee' - | 'setMakerFeeNextPrice' - | 'setMaxFundingRate' - | 'setMaxLeverage' - | 'setMaxMarketValueUSD' - | 'setMinInitialMargin' - | 'setMinKeeperFee' - | 'setNextPriceConfirmWindow' - | 'setParameters' - | 'setSkewScaleUSD' - | 'setTakerFee' - | 'setTakerFeeNextPrice' - | 'skewScaleUSD' - | 'takerFee' - | 'takerFeeNextPrice' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidationBufferRatio', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidationFeeRatio', values?: undefined): string - encodeFunctionData(functionFragment: 'makerFee', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'makerFeeNextPrice', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'maxFundingRate', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'maxLeverage', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'maxMarketValueUSD', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'minInitialMargin', values?: undefined): string - encodeFunctionData(functionFragment: 'minKeeperFee', values?: undefined): string - encodeFunctionData( - functionFragment: 'nextPriceConfirmWindow', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'parameters', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData( - functionFragment: 'setLiquidationBufferRatio', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationFeeRatio', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMakerFee', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMakerFeeNextPrice', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxFundingRate', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxLeverage', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxMarketValueUSD', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMinInitialMargin', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMinKeeperFee', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setNextPriceConfirmWindow', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setParameters', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'setSkewScaleUSD', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTakerFee', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTakerFeeNextPrice', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'skewScaleUSD', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'takerFee', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'takerFeeNextPrice', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationBufferRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationFeeRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'makerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'makerFeeNextPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxFundingRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxLeverage', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxMarketValueUSD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'minInitialMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'minKeeperFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nextPriceConfirmWindow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'parameters', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationBufferRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationFeeRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMakerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMakerFeeNextPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxFundingRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxLeverage', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxMarketValueUSD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMinInitialMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMinKeeperFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setNextPriceConfirmWindow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setParameters', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setSkewScaleUSD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTakerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTakerFeeNextPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'skewScaleUSD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'takerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'takerFeeNextPrice', data: BytesLike): Result - - events: { - 'CacheUpdated(bytes32,address)': EventFragment - 'LiquidationBufferRatioUpdated(uint256)': EventFragment - 'LiquidationFeeRatioUpdated(uint256)': EventFragment - 'MinInitialMarginUpdated(uint256)': EventFragment - 'MinKeeperFeeUpdated(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'ParameterUpdated(bytes32,bytes32,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationBufferRatioUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationFeeRatioUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MinInitialMarginUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MinKeeperFeeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ParameterUpdated'): EventFragment + functions: { + "acceptOwnership()": FunctionFragment; + "isResolverCached()": FunctionFragment; + "liquidationBufferRatio()": FunctionFragment; + "liquidationFeeRatio()": FunctionFragment; + "makerFee(bytes32)": FunctionFragment; + "makerFeeNextPrice(bytes32)": FunctionFragment; + "maxFundingRate(bytes32)": FunctionFragment; + "maxLeverage(bytes32)": FunctionFragment; + "maxMarketValueUSD(bytes32)": FunctionFragment; + "minInitialMargin()": FunctionFragment; + "minKeeperFee()": FunctionFragment; + "nextPriceConfirmWindow(bytes32)": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "parameters(bytes32)": FunctionFragment; + "rebuildCache()": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "setLiquidationBufferRatio(uint256)": FunctionFragment; + "setLiquidationFeeRatio(uint256)": FunctionFragment; + "setMakerFee(bytes32,uint256)": FunctionFragment; + "setMakerFeeNextPrice(bytes32,uint256)": FunctionFragment; + "setMaxFundingRate(bytes32,uint256)": FunctionFragment; + "setMaxLeverage(bytes32,uint256)": FunctionFragment; + "setMaxMarketValueUSD(bytes32,uint256)": FunctionFragment; + "setMinInitialMargin(uint256)": FunctionFragment; + "setMinKeeperFee(uint256)": FunctionFragment; + "setNextPriceConfirmWindow(bytes32,uint256)": FunctionFragment; + "setParameters(bytes32,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)": FunctionFragment; + "setSkewScaleUSD(bytes32,uint256)": FunctionFragment; + "setTakerFee(bytes32,uint256)": FunctionFragment; + "setTakerFeeNextPrice(bytes32,uint256)": FunctionFragment; + "skewScaleUSD(bytes32)": FunctionFragment; + "takerFee(bytes32)": FunctionFragment; + "takerFeeNextPrice(bytes32)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "isResolverCached" + | "liquidationBufferRatio" + | "liquidationFeeRatio" + | "makerFee" + | "makerFeeNextPrice" + | "maxFundingRate" + | "maxLeverage" + | "maxMarketValueUSD" + | "minInitialMargin" + | "minKeeperFee" + | "nextPriceConfirmWindow" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "parameters" + | "rebuildCache" + | "resolver" + | "resolverAddressesRequired" + | "setLiquidationBufferRatio" + | "setLiquidationFeeRatio" + | "setMakerFee" + | "setMakerFeeNextPrice" + | "setMaxFundingRate" + | "setMaxLeverage" + | "setMaxMarketValueUSD" + | "setMinInitialMargin" + | "setMinKeeperFee" + | "setNextPriceConfirmWindow" + | "setParameters" + | "setSkewScaleUSD" + | "setTakerFee" + | "setTakerFeeNextPrice" + | "skewScaleUSD" + | "takerFee" + | "takerFeeNextPrice" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationBufferRatio", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationFeeRatio", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "makerFee", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "makerFeeNextPrice", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxFundingRate", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxLeverage", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxMarketValueUSD", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "minInitialMargin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minKeeperFee", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nextPriceConfirmWindow", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "parameters", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setLiquidationBufferRatio", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationFeeRatio", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMakerFee", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMakerFeeNextPrice", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxFundingRate", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxLeverage", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxMarketValueUSD", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMinInitialMargin", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMinKeeperFee", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setNextPriceConfirmWindow", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setParameters", + values: [ + BytesLike, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "setSkewScaleUSD", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTakerFee", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTakerFeeNextPrice", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "skewScaleUSD", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "takerFee", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "takerFeeNextPrice", + values: [BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationBufferRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationFeeRatio", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "makerFee", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "makerFeeNextPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxFundingRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxLeverage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxMarketValueUSD", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minInitialMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minKeeperFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nextPriceConfirmWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "parameters", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationBufferRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationFeeRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMakerFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMakerFeeNextPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxFundingRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxLeverage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxMarketValueUSD", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMinInitialMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMinKeeperFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setNextPriceConfirmWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setParameters", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSkewScaleUSD", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTakerFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTakerFeeNextPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "skewScaleUSD", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "takerFee", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "takerFeeNextPrice", + data: BytesLike + ): Result; + + events: { + "CacheUpdated(bytes32,address)": EventFragment; + "LiquidationBufferRatioUpdated(uint256)": EventFragment; + "LiquidationFeeRatioUpdated(uint256)": EventFragment; + "MinInitialMarginUpdated(uint256)": EventFragment; + "MinKeeperFeeUpdated(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "ParameterUpdated(bytes32,bytes32,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "LiquidationBufferRatioUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidationFeeRatioUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MinInitialMarginUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MinKeeperFeeUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ParameterUpdated"): EventFragment; } export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface LiquidationBufferRatioUpdatedEventObject { - bps: BigNumber + bps: BigNumber; } export type LiquidationBufferRatioUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationBufferRatioUpdatedEventObject -> + [BigNumber], + LiquidationBufferRatioUpdatedEventObject +>; export type LiquidationBufferRatioUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface LiquidationFeeRatioUpdatedEventObject { - bps: BigNumber + bps: BigNumber; } export type LiquidationFeeRatioUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationFeeRatioUpdatedEventObject -> + [BigNumber], + LiquidationFeeRatioUpdatedEventObject +>; export type LiquidationFeeRatioUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface MinInitialMarginUpdatedEventObject { - minMargin: BigNumber + minMargin: BigNumber; } export type MinInitialMarginUpdatedEvent = TypedEvent< - [BigNumber], - MinInitialMarginUpdatedEventObject -> + [BigNumber], + MinInitialMarginUpdatedEventObject +>; -export type MinInitialMarginUpdatedEventFilter = TypedEventFilter +export type MinInitialMarginUpdatedEventFilter = + TypedEventFilter; export interface MinKeeperFeeUpdatedEventObject { - sUSD: BigNumber + sUSD: BigNumber; } -export type MinKeeperFeeUpdatedEvent = TypedEvent<[BigNumber], MinKeeperFeeUpdatedEventObject> +export type MinKeeperFeeUpdatedEvent = TypedEvent< + [BigNumber], + MinKeeperFeeUpdatedEventObject +>; -export type MinKeeperFeeUpdatedEventFilter = TypedEventFilter +export type MinKeeperFeeUpdatedEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface ParameterUpdatedEventObject { - marketKey: string - parameter: string - value: BigNumber + marketKey: string; + parameter: string; + value: BigNumber; } export type ParameterUpdatedEvent = TypedEvent< - [string, string, BigNumber], - ParameterUpdatedEventObject -> + [string, string, BigNumber], + ParameterUpdatedEventObject +>; -export type ParameterUpdatedEventFilter = TypedEventFilter +export type ParameterUpdatedEventFilter = + TypedEventFilter; export interface FuturesMarketSettings extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: FuturesMarketSettingsInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - liquidationBufferRatio(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationFeeRatio(overrides?: CallOverrides): Promise<[BigNumber]> - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - makerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxFundingRate( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxMarketValueUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - minInitialMargin(overrides?: CallOverrides): Promise<[BigNumber]> - - minKeeperFee(overrides?: CallOverrides): Promise<[BigNumber]> - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeNextPrice: BigNumber - makerFeeNextPrice: BigNumber - nextPriceConfirmWindow: BigNumber - maxLeverage: BigNumber - maxMarketValueUSD: BigNumber - maxFundingRate: BigNumber - skewScaleUSD: BigNumber - } - > - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - setLiquidationBufferRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeNextPrice( - _marketKey: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingRate( - _marketKey: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValueUSD( - _marketKey: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - _makerFee: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - _maxLeverage: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScaleUSD( - _marketKey: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeNextPrice( - _marketKey: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScaleUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - takerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - } - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidationBufferRatio(overrides?: CallOverrides): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - makerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingRate( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxLeverage(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - maxMarketValueUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeNextPrice: BigNumber - makerFeeNextPrice: BigNumber - nextPriceConfirmWindow: BigNumber - maxLeverage: BigNumber - maxMarketValueUSD: BigNumber - maxFundingRate: BigNumber - skewScaleUSD: BigNumber - } - > - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setLiquidationBufferRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeNextPrice( - _marketKey: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingRate( - _marketKey: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValueUSD( - _marketKey: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - _makerFee: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - _maxLeverage: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScaleUSD( - _marketKey: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeNextPrice( - _marketKey: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScaleUSD(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidationBufferRatio(overrides?: CallOverrides): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - makerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingRate( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxMarketValueUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeNextPrice: BigNumber - makerFeeNextPrice: BigNumber - nextPriceConfirmWindow: BigNumber - maxLeverage: BigNumber - maxMarketValueUSD: BigNumber - maxFundingRate: BigNumber - skewScaleUSD: BigNumber - } - > - - rebuildCache(overrides?: CallOverrides): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setLiquidationBufferRatio( - _ratio: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMakerFeeNextPrice( - _marketKey: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxFundingRate( - _marketKey: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxMarketValueUSD( - _marketKey: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMinKeeperFee(_sUSD: PromiseOrValue, overrides?: CallOverrides): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - _makerFee: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - _maxLeverage: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setSkewScaleUSD( - _marketKey: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTakerFeeNextPrice( - _marketKey: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - skewScaleUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'LiquidationBufferRatioUpdated(uint256)'(bps?: null): LiquidationBufferRatioUpdatedEventFilter - LiquidationBufferRatioUpdated(bps?: null): LiquidationBufferRatioUpdatedEventFilter - - 'LiquidationFeeRatioUpdated(uint256)'(bps?: null): LiquidationFeeRatioUpdatedEventFilter - LiquidationFeeRatioUpdated(bps?: null): LiquidationFeeRatioUpdatedEventFilter - - 'MinInitialMarginUpdated(uint256)'(minMargin?: null): MinInitialMarginUpdatedEventFilter - MinInitialMarginUpdated(minMargin?: null): MinInitialMarginUpdatedEventFilter - - 'MinKeeperFeeUpdated(uint256)'(sUSD?: null): MinKeeperFeeUpdatedEventFilter - MinKeeperFeeUpdated(sUSD?: null): MinKeeperFeeUpdatedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - - 'ParameterUpdated(bytes32,bytes32,uint256)'( - marketKey?: PromiseOrValue | null, - parameter?: PromiseOrValue | null, - value?: null - ): ParameterUpdatedEventFilter - ParameterUpdated( - marketKey?: PromiseOrValue | null, - parameter?: PromiseOrValue | null, - value?: null - ): ParameterUpdatedEventFilter - } - - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidationBufferRatio(overrides?: CallOverrides): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - makerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingRate( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxMarketValueUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - parameters(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setLiquidationBufferRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeNextPrice( - _marketKey: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingRate( - _marketKey: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValueUSD( - _marketKey: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - _makerFee: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - _maxLeverage: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScaleUSD( - _marketKey: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeNextPrice( - _marketKey: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScaleUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidationBufferRatio(overrides?: CallOverrides): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - makerFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingRate( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxMarketValueUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setLiquidationBufferRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeNextPrice( - _marketKey: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingRate( - _marketKey: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValueUSD( - _marketKey: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - _makerFee: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - _makerFeeNextPrice: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - _maxLeverage: PromiseOrValue, - _maxMarketValueUSD: PromiseOrValue, - _maxFundingRate: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScaleUSD( - _marketKey: PromiseOrValue, - _skewScaleUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeNextPrice( - _marketKey: PromiseOrValue, - _takerFeeNextPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScaleUSD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFeeNextPrice( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: FuturesMarketSettingsInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + liquidationBufferRatio(overrides?: CallOverrides): Promise<[BigNumber]>; + + liquidationFeeRatio(overrides?: CallOverrides): Promise<[BigNumber]>; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + makerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxFundingRate( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxMarketValueUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + minInitialMargin(overrides?: CallOverrides): Promise<[BigNumber]>; + + minKeeperFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeNextPrice: BigNumber; + makerFeeNextPrice: BigNumber; + nextPriceConfirmWindow: BigNumber; + maxLeverage: BigNumber; + maxMarketValueUSD: BigNumber; + maxFundingRate: BigNumber; + skewScaleUSD: BigNumber; + } + >; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise<[string]>; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; + + setLiquidationBufferRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeNextPrice( + _marketKey: BytesLike, + _makerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingRate( + _marketKey: BytesLike, + _maxFundingRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValueUSD( + _marketKey: BytesLike, + _maxMarketValueUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _takerFee: BigNumberish, + _makerFee: BigNumberish, + _takerFeeNextPrice: BigNumberish, + _makerFeeNextPrice: BigNumberish, + _nextPriceConfirmWindow: BigNumberish, + _maxLeverage: BigNumberish, + _maxMarketValueUSD: BigNumberish, + _maxFundingRate: BigNumberish, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScaleUSD( + _marketKey: BytesLike, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeNextPrice( + _marketKey: BytesLike, + _takerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScaleUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + takerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + }; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidationBufferRatio(overrides?: CallOverrides): Promise; + + liquidationFeeRatio(overrides?: CallOverrides): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingRate( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValueUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeNextPrice: BigNumber; + makerFeeNextPrice: BigNumber; + nextPriceConfirmWindow: BigNumber; + maxLeverage: BigNumber; + maxMarketValueUSD: BigNumber; + maxFundingRate: BigNumber; + skewScaleUSD: BigNumber; + } + >; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + setLiquidationBufferRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeNextPrice( + _marketKey: BytesLike, + _makerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingRate( + _marketKey: BytesLike, + _maxFundingRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValueUSD( + _marketKey: BytesLike, + _maxMarketValueUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _takerFee: BigNumberish, + _makerFee: BigNumberish, + _takerFeeNextPrice: BigNumberish, + _makerFeeNextPrice: BigNumberish, + _nextPriceConfirmWindow: BigNumberish, + _maxLeverage: BigNumberish, + _maxMarketValueUSD: BigNumberish, + _maxFundingRate: BigNumberish, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScaleUSD( + _marketKey: BytesLike, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeNextPrice( + _marketKey: BytesLike, + _takerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScaleUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidationBufferRatio(overrides?: CallOverrides): Promise; + + liquidationFeeRatio(overrides?: CallOverrides): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingRate( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValueUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeNextPrice: BigNumber; + makerFeeNextPrice: BigNumber; + nextPriceConfirmWindow: BigNumber; + maxLeverage: BigNumber; + maxMarketValueUSD: BigNumber; + maxFundingRate: BigNumber; + skewScaleUSD: BigNumber; + } + >; + + rebuildCache(overrides?: CallOverrides): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + setLiquidationBufferRatio( + _ratio: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMakerFeeNextPrice( + _marketKey: BytesLike, + _makerFeeNextPrice: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxFundingRate( + _marketKey: BytesLike, + _maxFundingRate: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxMarketValueUSD( + _marketKey: BytesLike, + _maxMarketValueUSD: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setParameters( + _marketKey: BytesLike, + _takerFee: BigNumberish, + _makerFee: BigNumberish, + _takerFeeNextPrice: BigNumberish, + _makerFeeNextPrice: BigNumberish, + _nextPriceConfirmWindow: BigNumberish, + _maxLeverage: BigNumberish, + _maxMarketValueUSD: BigNumberish, + _maxFundingRate: BigNumberish, + _skewScaleUSD: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSkewScaleUSD( + _marketKey: BytesLike, + _skewScaleUSD: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTakerFeeNextPrice( + _marketKey: BytesLike, + _takerFeeNextPrice: BigNumberish, + overrides?: CallOverrides + ): Promise; + + skewScaleUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "LiquidationBufferRatioUpdated(uint256)"( + bps?: null + ): LiquidationBufferRatioUpdatedEventFilter; + LiquidationBufferRatioUpdated( + bps?: null + ): LiquidationBufferRatioUpdatedEventFilter; + + "LiquidationFeeRatioUpdated(uint256)"( + bps?: null + ): LiquidationFeeRatioUpdatedEventFilter; + LiquidationFeeRatioUpdated( + bps?: null + ): LiquidationFeeRatioUpdatedEventFilter; + + "MinInitialMarginUpdated(uint256)"( + minMargin?: null + ): MinInitialMarginUpdatedEventFilter; + MinInitialMarginUpdated( + minMargin?: null + ): MinInitialMarginUpdatedEventFilter; + + "MinKeeperFeeUpdated(uint256)"(sUSD?: null): MinKeeperFeeUpdatedEventFilter; + MinKeeperFeeUpdated(sUSD?: null): MinKeeperFeeUpdatedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "ParameterUpdated(bytes32,bytes32,uint256)"( + marketKey?: BytesLike | null, + parameter?: BytesLike | null, + value?: null + ): ParameterUpdatedEventFilter; + ParameterUpdated( + marketKey?: BytesLike | null, + parameter?: BytesLike | null, + value?: null + ): ParameterUpdatedEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidationBufferRatio(overrides?: CallOverrides): Promise; + + liquidationFeeRatio(overrides?: CallOverrides): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingRate( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValueUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rebuildCache(overrides?: Overrides & { from?: string }): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + setLiquidationBufferRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeNextPrice( + _marketKey: BytesLike, + _makerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingRate( + _marketKey: BytesLike, + _maxFundingRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValueUSD( + _marketKey: BytesLike, + _maxMarketValueUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _takerFee: BigNumberish, + _makerFee: BigNumberish, + _takerFeeNextPrice: BigNumberish, + _makerFeeNextPrice: BigNumberish, + _nextPriceConfirmWindow: BigNumberish, + _maxLeverage: BigNumberish, + _maxMarketValueUSD: BigNumberish, + _maxFundingRate: BigNumberish, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScaleUSD( + _marketKey: BytesLike, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeNextPrice( + _marketKey: BytesLike, + _takerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScaleUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidationBufferRatio( + overrides?: CallOverrides + ): Promise; + + liquidationFeeRatio( + overrides?: CallOverrides + ): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingRate( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValueUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + setLiquidationBufferRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeNextPrice( + _marketKey: BytesLike, + _makerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingRate( + _marketKey: BytesLike, + _maxFundingRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValueUSD( + _marketKey: BytesLike, + _maxMarketValueUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _takerFee: BigNumberish, + _makerFee: BigNumberish, + _takerFeeNextPrice: BigNumberish, + _makerFeeNextPrice: BigNumberish, + _nextPriceConfirmWindow: BigNumberish, + _maxLeverage: BigNumberish, + _maxMarketValueUSD: BigNumberish, + _maxFundingRate: BigNumberish, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScaleUSD( + _marketKey: BytesLike, + _skewScaleUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeNextPrice( + _marketKey: BytesLike, + _takerFeeNextPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScaleUSD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeNextPrice( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/KwentaArrakisVault.ts b/packages/sdk/src/contracts/types/KwentaArrakisVault.ts index bcec24fbe0..dd6e4bcad3 100644 --- a/packages/sdk/src/contracts/types/KwentaArrakisVault.ts +++ b/packages/sdk/src/contracts/types/KwentaArrakisVault.ts @@ -2,1535 +2,1715 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface KwentaArrakisVaultInterface extends utils.Interface { - functions: { - 'GELATO()': FunctionFragment - 'RESTRICTED_MINT_ENABLED()': FunctionFragment - 'allowance(address,address)': FunctionFragment - 'approve(address,uint256)': FunctionFragment - 'arrakisBalance0()': FunctionFragment - 'arrakisBalance1()': FunctionFragment - 'arrakisFeeBPS()': FunctionFragment - 'arrakisTreasury()': FunctionFragment - 'balanceOf(address)': FunctionFragment - 'burn(uint256,address)': FunctionFragment - 'decimals()': FunctionFragment - 'decreaseAllowance(address,uint256)': FunctionFragment - 'executiveRebalance(int24,int24,uint160,uint256,bool)': FunctionFragment - 'gelatoRebalanceBPS()': FunctionFragment - 'gelatoSlippageBPS()': FunctionFragment - 'gelatoSlippageInterval()': FunctionFragment - 'getMintAmounts(uint256,uint256)': FunctionFragment - 'getPositionID()': FunctionFragment - 'getUnderlyingBalances()': FunctionFragment - 'getUnderlyingBalancesAtPrice(uint160)': FunctionFragment - 'increaseAllowance(address,uint256)': FunctionFragment - 'initialize(string,string,address,uint16,int24,int24,address)': FunctionFragment - 'lowerTick()': FunctionFragment - 'manager()': FunctionFragment - 'managerBalance0()': FunctionFragment - 'managerBalance1()': FunctionFragment - 'managerFeeBPS()': FunctionFragment - 'managerTreasury()': FunctionFragment - 'mint(uint256,address)': FunctionFragment - 'name()': FunctionFragment - 'pool()': FunctionFragment - 'rebalance(uint160,uint256,bool,uint256,address)': FunctionFragment - 'renounceOwnership()': FunctionFragment - 'restrictedMintToggle()': FunctionFragment - 'symbol()': FunctionFragment - 'toggleRestrictMint()': FunctionFragment - 'token0()': FunctionFragment - 'token1()': FunctionFragment - 'totalSupply()': FunctionFragment - 'transfer(address,uint256)': FunctionFragment - 'transferFrom(address,address,uint256)': FunctionFragment - 'transferOwnership(address)': FunctionFragment - 'uniswapV3MintCallback(uint256,uint256,bytes)': FunctionFragment - 'uniswapV3SwapCallback(int256,int256,bytes)': FunctionFragment - 'updateManagerParams(int16,address,int16,int16,int32)': FunctionFragment - 'upperTick()': FunctionFragment - 'version()': FunctionFragment - 'withdrawArrakisBalance()': FunctionFragment - 'withdrawManagerBalance()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'GELATO' - | 'RESTRICTED_MINT_ENABLED' - | 'allowance' - | 'approve' - | 'arrakisBalance0' - | 'arrakisBalance1' - | 'arrakisFeeBPS' - | 'arrakisTreasury' - | 'balanceOf' - | 'burn' - | 'decimals' - | 'decreaseAllowance' - | 'executiveRebalance' - | 'gelatoRebalanceBPS' - | 'gelatoSlippageBPS' - | 'gelatoSlippageInterval' - | 'getMintAmounts' - | 'getPositionID' - | 'getUnderlyingBalances' - | 'getUnderlyingBalancesAtPrice' - | 'increaseAllowance' - | 'initialize' - | 'lowerTick' - | 'manager' - | 'managerBalance0' - | 'managerBalance1' - | 'managerFeeBPS' - | 'managerTreasury' - | 'mint' - | 'name' - | 'pool' - | 'rebalance' - | 'renounceOwnership' - | 'restrictedMintToggle' - | 'symbol' - | 'toggleRestrictMint' - | 'token0' - | 'token1' - | 'totalSupply' - | 'transfer' - | 'transferFrom' - | 'transferOwnership' - | 'uniswapV3MintCallback' - | 'uniswapV3SwapCallback' - | 'updateManagerParams' - | 'upperTick' - | 'version' - | 'withdrawArrakisBalance' - | 'withdrawManagerBalance' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'GELATO', values?: undefined): string - encodeFunctionData(functionFragment: 'RESTRICTED_MINT_ENABLED', values?: undefined): string - encodeFunctionData( - functionFragment: 'allowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'approve', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'arrakisBalance0', values?: undefined): string - encodeFunctionData(functionFragment: 'arrakisBalance1', values?: undefined): string - encodeFunctionData(functionFragment: 'arrakisFeeBPS', values?: undefined): string - encodeFunctionData(functionFragment: 'arrakisTreasury', values?: undefined): string - encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'burn', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'decimals', values?: undefined): string - encodeFunctionData( - functionFragment: 'decreaseAllowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'executiveRebalance', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData(functionFragment: 'gelatoRebalanceBPS', values?: undefined): string - encodeFunctionData(functionFragment: 'gelatoSlippageBPS', values?: undefined): string - encodeFunctionData(functionFragment: 'gelatoSlippageInterval', values?: undefined): string - encodeFunctionData( - functionFragment: 'getMintAmounts', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'getPositionID', values?: undefined): string - encodeFunctionData(functionFragment: 'getUnderlyingBalances', values?: undefined): string - encodeFunctionData( - functionFragment: 'getUnderlyingBalancesAtPrice', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'increaseAllowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'initialize', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData(functionFragment: 'lowerTick', values?: undefined): string - encodeFunctionData(functionFragment: 'manager', values?: undefined): string - encodeFunctionData(functionFragment: 'managerBalance0', values?: undefined): string - encodeFunctionData(functionFragment: 'managerBalance1', values?: undefined): string - encodeFunctionData(functionFragment: 'managerFeeBPS', values?: undefined): string - encodeFunctionData(functionFragment: 'managerTreasury', values?: undefined): string - encodeFunctionData( - functionFragment: 'mint', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'name', values?: undefined): string - encodeFunctionData(functionFragment: 'pool', values?: undefined): string - encodeFunctionData( - functionFragment: 'rebalance', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'restrictedMintToggle', values?: undefined): string - encodeFunctionData(functionFragment: 'symbol', values?: undefined): string - encodeFunctionData(functionFragment: 'toggleRestrictMint', values?: undefined): string - encodeFunctionData(functionFragment: 'token0', values?: undefined): string - encodeFunctionData(functionFragment: 'token1', values?: undefined): string - encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string - encodeFunctionData( - functionFragment: 'transfer', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferFrom', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferOwnership', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'uniswapV3MintCallback', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'uniswapV3SwapCallback', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'updateManagerParams', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData(functionFragment: 'upperTick', values?: undefined): string - encodeFunctionData(functionFragment: 'version', values?: undefined): string - encodeFunctionData(functionFragment: 'withdrawArrakisBalance', values?: undefined): string - encodeFunctionData(functionFragment: 'withdrawManagerBalance', values?: undefined): string - - decodeFunctionResult(functionFragment: 'GELATO', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'RESTRICTED_MINT_ENABLED', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'arrakisBalance0', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'arrakisBalance1', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'arrakisFeeBPS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'arrakisTreasury', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'executiveRebalance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'gelatoRebalanceBPS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'gelatoSlippageBPS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'gelatoSlippageInterval', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getMintAmounts', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getPositionID', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getUnderlyingBalances', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getUnderlyingBalancesAtPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lowerTick', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'manager', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'managerBalance0', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'managerBalance1', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'managerFeeBPS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'managerTreasury', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'pool', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebalance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'restrictedMintToggle', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'toggleRestrictMint', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'token0', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'token1', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'uniswapV3MintCallback', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'uniswapV3SwapCallback', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'updateManagerParams', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'upperTick', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'version', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'withdrawArrakisBalance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'withdrawManagerBalance', data: BytesLike): Result - - events: { - 'Approval(address,address,uint256)': EventFragment - 'Burned(address,uint256,uint256,uint256,uint128)': EventFragment - 'FeesEarned(uint256,uint256)': EventFragment - 'Minted(address,uint256,uint256,uint256,uint128)': EventFragment - 'OwnershipTransferred(address,address)': EventFragment - 'Rebalance(int24,int24,uint128,uint128)': EventFragment - 'Transfer(address,address,uint256)': EventFragment - 'UpdateManagerParams(uint16,address,uint16,uint16,uint32)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Burned'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FeesEarned'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Minted'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Rebalance'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment - getEvent(nameOrSignatureOrTopic: 'UpdateManagerParams'): EventFragment + functions: { + "GELATO()": FunctionFragment; + "RESTRICTED_MINT_ENABLED()": FunctionFragment; + "allowance(address,address)": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "arrakisBalance0()": FunctionFragment; + "arrakisBalance1()": FunctionFragment; + "arrakisFeeBPS()": FunctionFragment; + "arrakisTreasury()": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "burn(uint256,address)": FunctionFragment; + "decimals()": FunctionFragment; + "decreaseAllowance(address,uint256)": FunctionFragment; + "executiveRebalance(int24,int24,uint160,uint256,bool)": FunctionFragment; + "gelatoRebalanceBPS()": FunctionFragment; + "gelatoSlippageBPS()": FunctionFragment; + "gelatoSlippageInterval()": FunctionFragment; + "getMintAmounts(uint256,uint256)": FunctionFragment; + "getPositionID()": FunctionFragment; + "getUnderlyingBalances()": FunctionFragment; + "getUnderlyingBalancesAtPrice(uint160)": FunctionFragment; + "increaseAllowance(address,uint256)": FunctionFragment; + "initialize(string,string,address,uint16,int24,int24,address)": FunctionFragment; + "lowerTick()": FunctionFragment; + "manager()": FunctionFragment; + "managerBalance0()": FunctionFragment; + "managerBalance1()": FunctionFragment; + "managerFeeBPS()": FunctionFragment; + "managerTreasury()": FunctionFragment; + "mint(uint256,address)": FunctionFragment; + "name()": FunctionFragment; + "pool()": FunctionFragment; + "rebalance(uint160,uint256,bool,uint256,address)": FunctionFragment; + "renounceOwnership()": FunctionFragment; + "restrictedMintToggle()": FunctionFragment; + "symbol()": FunctionFragment; + "toggleRestrictMint()": FunctionFragment; + "token0()": FunctionFragment; + "token1()": FunctionFragment; + "totalSupply()": FunctionFragment; + "transfer(address,uint256)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + "uniswapV3MintCallback(uint256,uint256,bytes)": FunctionFragment; + "uniswapV3SwapCallback(int256,int256,bytes)": FunctionFragment; + "updateManagerParams(int16,address,int16,int16,int32)": FunctionFragment; + "upperTick()": FunctionFragment; + "version()": FunctionFragment; + "withdrawArrakisBalance()": FunctionFragment; + "withdrawManagerBalance()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "GELATO" + | "RESTRICTED_MINT_ENABLED" + | "allowance" + | "approve" + | "arrakisBalance0" + | "arrakisBalance1" + | "arrakisFeeBPS" + | "arrakisTreasury" + | "balanceOf" + | "burn" + | "decimals" + | "decreaseAllowance" + | "executiveRebalance" + | "gelatoRebalanceBPS" + | "gelatoSlippageBPS" + | "gelatoSlippageInterval" + | "getMintAmounts" + | "getPositionID" + | "getUnderlyingBalances" + | "getUnderlyingBalancesAtPrice" + | "increaseAllowance" + | "initialize" + | "lowerTick" + | "manager" + | "managerBalance0" + | "managerBalance1" + | "managerFeeBPS" + | "managerTreasury" + | "mint" + | "name" + | "pool" + | "rebalance" + | "renounceOwnership" + | "restrictedMintToggle" + | "symbol" + | "toggleRestrictMint" + | "token0" + | "token1" + | "totalSupply" + | "transfer" + | "transferFrom" + | "transferOwnership" + | "uniswapV3MintCallback" + | "uniswapV3SwapCallback" + | "updateManagerParams" + | "upperTick" + | "version" + | "withdrawArrakisBalance" + | "withdrawManagerBalance" + ): FunctionFragment; + + encodeFunctionData(functionFragment: "GELATO", values?: undefined): string; + encodeFunctionData( + functionFragment: "RESTRICTED_MINT_ENABLED", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "arrakisBalance0", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "arrakisBalance1", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "arrakisFeeBPS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "arrakisTreasury", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "burn", + values: [BigNumberish, string] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "decreaseAllowance", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "executiveRebalance", + values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish, boolean] + ): string; + encodeFunctionData( + functionFragment: "gelatoRebalanceBPS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "gelatoSlippageBPS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "gelatoSlippageInterval", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getMintAmounts", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getPositionID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getUnderlyingBalances", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getUnderlyingBalancesAtPrice", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [ + string, + string, + string, + BigNumberish, + BigNumberish, + BigNumberish, + string + ] + ): string; + encodeFunctionData(functionFragment: "lowerTick", values?: undefined): string; + encodeFunctionData(functionFragment: "manager", values?: undefined): string; + encodeFunctionData( + functionFragment: "managerBalance0", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "managerBalance1", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "managerFeeBPS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "managerTreasury", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "mint", + values: [BigNumberish, string] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "pool", values?: undefined): string; + encodeFunctionData( + functionFragment: "rebalance", + values: [BigNumberish, BigNumberish, boolean, BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "restrictedMintToggle", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "toggleRestrictMint", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "token0", values?: undefined): string; + encodeFunctionData(functionFragment: "token1", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "uniswapV3MintCallback", + values: [BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "uniswapV3SwapCallback", + values: [BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "updateManagerParams", + values: [BigNumberish, string, BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "upperTick", values?: undefined): string; + encodeFunctionData(functionFragment: "version", values?: undefined): string; + encodeFunctionData( + functionFragment: "withdrawArrakisBalance", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "withdrawManagerBalance", + values?: undefined + ): string; + + decodeFunctionResult(functionFragment: "GELATO", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "RESTRICTED_MINT_ENABLED", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "arrakisBalance0", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "arrakisBalance1", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "arrakisFeeBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "arrakisTreasury", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "executiveRebalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gelatoRebalanceBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gelatoSlippageBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gelatoSlippageInterval", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getMintAmounts", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPositionID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getUnderlyingBalances", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getUnderlyingBalancesAtPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "lowerTick", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "manager", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "managerBalance0", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "managerBalance1", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "managerFeeBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "managerTreasury", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "pool", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "rebalance", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "restrictedMintToggle", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "toggleRestrictMint", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "token0", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "token1", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapV3MintCallback", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapV3SwapCallback", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateManagerParams", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "upperTick", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "withdrawArrakisBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "withdrawManagerBalance", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "Burned(address,uint256,uint256,uint256,uint128)": EventFragment; + "FeesEarned(uint256,uint256)": EventFragment; + "Minted(address,uint256,uint256,uint256,uint128)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + "Rebalance(int24,int24,uint128,uint128)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + "UpdateManagerParams(uint16,address,uint16,uint16,uint32)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Burned"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeesEarned"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Minted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Rebalance"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; + getEvent(nameOrSignatureOrTopic: "UpdateManagerParams"): EventFragment; } export interface ApprovalEventObject { - owner: string - spender: string - value: BigNumber + owner: string; + spender: string; + value: BigNumber; } -export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject> +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; -export type ApprovalEventFilter = TypedEventFilter +export type ApprovalEventFilter = TypedEventFilter; export interface BurnedEventObject { - receiver: string - burnAmount: BigNumber - amount0Out: BigNumber - amount1Out: BigNumber - liquidityBurned: BigNumber + receiver: string; + burnAmount: BigNumber; + amount0Out: BigNumber; + amount1Out: BigNumber; + liquidityBurned: BigNumber; } export type BurnedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, BigNumber], - BurnedEventObject -> + [string, BigNumber, BigNumber, BigNumber, BigNumber], + BurnedEventObject +>; -export type BurnedEventFilter = TypedEventFilter +export type BurnedEventFilter = TypedEventFilter; export interface FeesEarnedEventObject { - feesEarned0: BigNumber - feesEarned1: BigNumber + feesEarned0: BigNumber; + feesEarned1: BigNumber; } -export type FeesEarnedEvent = TypedEvent<[BigNumber, BigNumber], FeesEarnedEventObject> +export type FeesEarnedEvent = TypedEvent< + [BigNumber, BigNumber], + FeesEarnedEventObject +>; -export type FeesEarnedEventFilter = TypedEventFilter +export type FeesEarnedEventFilter = TypedEventFilter; export interface MintedEventObject { - receiver: string - mintAmount: BigNumber - amount0In: BigNumber - amount1In: BigNumber - liquidityMinted: BigNumber + receiver: string; + mintAmount: BigNumber; + amount0In: BigNumber; + amount1In: BigNumber; + liquidityMinted: BigNumber; } export type MintedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, BigNumber], - MintedEventObject -> + [string, BigNumber, BigNumber, BigNumber, BigNumber], + MintedEventObject +>; -export type MintedEventFilter = TypedEventFilter +export type MintedEventFilter = TypedEventFilter; export interface OwnershipTransferredEventObject { - previousManager: string - newManager: string + previousManager: string; + newManager: string; } export type OwnershipTransferredEvent = TypedEvent< - [string, string], - OwnershipTransferredEventObject -> + [string, string], + OwnershipTransferredEventObject +>; -export type OwnershipTransferredEventFilter = TypedEventFilter +export type OwnershipTransferredEventFilter = + TypedEventFilter; export interface RebalanceEventObject { - lowerTick_: number - upperTick_: number - liquidityBefore: BigNumber - liquidityAfter: BigNumber + lowerTick_: number; + upperTick_: number; + liquidityBefore: BigNumber; + liquidityAfter: BigNumber; } export type RebalanceEvent = TypedEvent< - [number, number, BigNumber, BigNumber], - RebalanceEventObject -> + [number, number, BigNumber, BigNumber], + RebalanceEventObject +>; -export type RebalanceEventFilter = TypedEventFilter +export type RebalanceEventFilter = TypedEventFilter; export interface TransferEventObject { - from: string - to: string - value: BigNumber + from: string; + to: string; + value: BigNumber; } -export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject> +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; -export type TransferEventFilter = TypedEventFilter +export type TransferEventFilter = TypedEventFilter; export interface UpdateManagerParamsEventObject { - managerFeeBPS: number - managerTreasury: string - gelatoRebalanceBPS: number - gelatoSlippageBPS: number - gelatoSlippageInterval: number + managerFeeBPS: number; + managerTreasury: string; + gelatoRebalanceBPS: number; + gelatoSlippageBPS: number; + gelatoSlippageInterval: number; } export type UpdateManagerParamsEvent = TypedEvent< - [number, string, number, number, number], - UpdateManagerParamsEventObject -> + [number, string, number, number, number], + UpdateManagerParamsEventObject +>; -export type UpdateManagerParamsEventFilter = TypedEventFilter +export type UpdateManagerParamsEventFilter = + TypedEventFilter; export interface KwentaArrakisVault extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: KwentaArrakisVaultInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - GELATO(overrides?: CallOverrides): Promise<[string]> - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise<[number]> - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - arrakisBalance0(overrides?: CallOverrides): Promise<[BigNumber]> - - arrakisBalance1(overrides?: CallOverrides): Promise<[BigNumber]> - - arrakisFeeBPS(overrides?: CallOverrides): Promise<[number]> - - arrakisTreasury(overrides?: CallOverrides): Promise<[string]> - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise<[number]> - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise<[number]> - - gelatoSlippageBPS(overrides?: CallOverrides): Promise<[number]> - - gelatoSlippageInterval(overrides?: CallOverrides): Promise<[number]> - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber - amount1: BigNumber - mintAmount: BigNumber - } - > - - getPositionID(overrides?: CallOverrides): Promise<[string] & { positionID: string }> - - getUnderlyingBalances(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber - amount1Current: BigNumber - } - > - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber - amount1Current: BigNumber - } - > - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - lowerTick(overrides?: CallOverrides): Promise<[number]> - - manager(overrides?: CallOverrides): Promise<[string]> - - managerBalance0(overrides?: CallOverrides): Promise<[BigNumber]> - - managerBalance1(overrides?: CallOverrides): Promise<[BigNumber]> - - managerFeeBPS(overrides?: CallOverrides): Promise<[number]> - - managerTreasury(overrides?: CallOverrides): Promise<[string]> - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - name(overrides?: CallOverrides): Promise<[string]> - - pool(overrides?: CallOverrides): Promise<[string]> - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - restrictedMintToggle(overrides?: CallOverrides): Promise<[number]> - - symbol(overrides?: CallOverrides): Promise<[string]> - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token0(overrides?: CallOverrides): Promise<[string]> - - token1(overrides?: CallOverrides): Promise<[string]> - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]> - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upperTick(overrides?: CallOverrides): Promise<[number]> - - version(overrides?: CallOverrides): Promise<[string]> - - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - GELATO(overrides?: CallOverrides): Promise - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - arrakisBalance0(overrides?: CallOverrides): Promise - - arrakisBalance1(overrides?: CallOverrides): Promise - - arrakisFeeBPS(overrides?: CallOverrides): Promise - - arrakisTreasury(overrides?: CallOverrides): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise - - gelatoSlippageBPS(overrides?: CallOverrides): Promise - - gelatoSlippageInterval(overrides?: CallOverrides): Promise - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber - amount1: BigNumber - mintAmount: BigNumber - } - > - - getPositionID(overrides?: CallOverrides): Promise - - getUnderlyingBalances(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber - amount1Current: BigNumber - } - > - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber - amount1Current: BigNumber - } - > - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - lowerTick(overrides?: CallOverrides): Promise - - manager(overrides?: CallOverrides): Promise - - managerBalance0(overrides?: CallOverrides): Promise - - managerBalance1(overrides?: CallOverrides): Promise - - managerFeeBPS(overrides?: CallOverrides): Promise - - managerTreasury(overrides?: CallOverrides): Promise - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - name(overrides?: CallOverrides): Promise - - pool(overrides?: CallOverrides): Promise - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - restrictedMintToggle(overrides?: CallOverrides): Promise - - symbol(overrides?: CallOverrides): Promise - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token0(overrides?: CallOverrides): Promise - - token1(overrides?: CallOverrides): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upperTick(overrides?: CallOverrides): Promise - - version(overrides?: CallOverrides): Promise - - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - GELATO(overrides?: CallOverrides): Promise - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - arrakisBalance0(overrides?: CallOverrides): Promise - - arrakisBalance1(overrides?: CallOverrides): Promise - - arrakisFeeBPS(overrides?: CallOverrides): Promise - - arrakisTreasury(overrides?: CallOverrides): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber - amount1: BigNumber - liquidityBurned: BigNumber - } - > - - decimals(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise - - gelatoSlippageBPS(overrides?: CallOverrides): Promise - - gelatoSlippageInterval(overrides?: CallOverrides): Promise - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber - amount1: BigNumber - mintAmount: BigNumber - } - > - - getPositionID(overrides?: CallOverrides): Promise - - getUnderlyingBalances(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber - amount1Current: BigNumber - } - > - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber] & { - amount0Current: BigNumber - amount1Current: BigNumber - } - > - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - lowerTick(overrides?: CallOverrides): Promise - - manager(overrides?: CallOverrides): Promise - - managerBalance0(overrides?: CallOverrides): Promise - - managerBalance1(overrides?: CallOverrides): Promise - - managerFeeBPS(overrides?: CallOverrides): Promise - - managerTreasury(overrides?: CallOverrides): Promise - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - amount0: BigNumber - amount1: BigNumber - liquidityMinted: BigNumber - } - > - - name(overrides?: CallOverrides): Promise - - pool(overrides?: CallOverrides): Promise - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - renounceOwnership(overrides?: CallOverrides): Promise - - restrictedMintToggle(overrides?: CallOverrides): Promise - - symbol(overrides?: CallOverrides): Promise - - toggleRestrictMint(overrides?: CallOverrides): Promise - - token0(overrides?: CallOverrides): Promise - - token1(overrides?: CallOverrides): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - upperTick(overrides?: CallOverrides): Promise - - version(overrides?: CallOverrides): Promise - - withdrawArrakisBalance(overrides?: CallOverrides): Promise - - withdrawManagerBalance(overrides?: CallOverrides): Promise - } - - filters: { - 'Approval(address,address,uint256)'( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter - Approval( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter - - 'Burned(address,uint256,uint256,uint256,uint128)'( - receiver?: null, - burnAmount?: null, - amount0Out?: null, - amount1Out?: null, - liquidityBurned?: null - ): BurnedEventFilter - Burned( - receiver?: null, - burnAmount?: null, - amount0Out?: null, - amount1Out?: null, - liquidityBurned?: null - ): BurnedEventFilter - - 'FeesEarned(uint256,uint256)'(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter - FeesEarned(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter - - 'Minted(address,uint256,uint256,uint256,uint128)'( - receiver?: null, - mintAmount?: null, - amount0In?: null, - amount1In?: null, - liquidityMinted?: null - ): MintedEventFilter - Minted( - receiver?: null, - mintAmount?: null, - amount0In?: null, - amount1In?: null, - liquidityMinted?: null - ): MintedEventFilter - - 'OwnershipTransferred(address,address)'( - previousManager?: PromiseOrValue | null, - newManager?: PromiseOrValue | null - ): OwnershipTransferredEventFilter - OwnershipTransferred( - previousManager?: PromiseOrValue | null, - newManager?: PromiseOrValue | null - ): OwnershipTransferredEventFilter - - 'Rebalance(int24,int24,uint128,uint128)'( - lowerTick_?: null, - upperTick_?: null, - liquidityBefore?: null, - liquidityAfter?: null - ): RebalanceEventFilter - Rebalance( - lowerTick_?: null, - upperTick_?: null, - liquidityBefore?: null, - liquidityAfter?: null - ): RebalanceEventFilter - - 'Transfer(address,address,uint256)'( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - Transfer( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - - 'UpdateManagerParams(uint16,address,uint16,uint16,uint32)'( - managerFeeBPS?: null, - managerTreasury?: null, - gelatoRebalanceBPS?: null, - gelatoSlippageBPS?: null, - gelatoSlippageInterval?: null - ): UpdateManagerParamsEventFilter - UpdateManagerParams( - managerFeeBPS?: null, - managerTreasury?: null, - gelatoRebalanceBPS?: null, - gelatoSlippageBPS?: null, - gelatoSlippageInterval?: null - ): UpdateManagerParamsEventFilter - } - - estimateGas: { - GELATO(overrides?: CallOverrides): Promise - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - arrakisBalance0(overrides?: CallOverrides): Promise - - arrakisBalance1(overrides?: CallOverrides): Promise - - arrakisFeeBPS(overrides?: CallOverrides): Promise - - arrakisTreasury(overrides?: CallOverrides): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise - - gelatoSlippageBPS(overrides?: CallOverrides): Promise - - gelatoSlippageInterval(overrides?: CallOverrides): Promise - - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPositionID(overrides?: CallOverrides): Promise - - getUnderlyingBalances(overrides?: CallOverrides): Promise - - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - lowerTick(overrides?: CallOverrides): Promise - - manager(overrides?: CallOverrides): Promise - - managerBalance0(overrides?: CallOverrides): Promise - - managerBalance1(overrides?: CallOverrides): Promise - - managerFeeBPS(overrides?: CallOverrides): Promise - - managerTreasury(overrides?: CallOverrides): Promise - - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - name(overrides?: CallOverrides): Promise - - pool(overrides?: CallOverrides): Promise - - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - restrictedMintToggle(overrides?: CallOverrides): Promise - - symbol(overrides?: CallOverrides): Promise - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token0(overrides?: CallOverrides): Promise - - token1(overrides?: CallOverrides): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upperTick(overrides?: CallOverrides): Promise - - version(overrides?: CallOverrides): Promise - - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - populateTransaction: { - GELATO(overrides?: CallOverrides): Promise - - RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - approve( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - arrakisBalance0(overrides?: CallOverrides): Promise - - arrakisBalance1(overrides?: CallOverrides): Promise - - arrakisFeeBPS(overrides?: CallOverrides): Promise - - arrakisTreasury(overrides?: CallOverrides): Promise - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - burn( - burnAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - decimals(overrides?: CallOverrides): Promise - - decreaseAllowance( - spender: PromiseOrValue, - subtractedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executiveRebalance( - newLowerTick: PromiseOrValue, - newUpperTick: PromiseOrValue, - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - gelatoRebalanceBPS(overrides?: CallOverrides): Promise - - gelatoSlippageBPS(overrides?: CallOverrides): Promise - - gelatoSlippageInterval(overrides?: CallOverrides): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: KwentaArrakisVaultInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + GELATO(overrides?: CallOverrides): Promise<[string]>; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise<[number]>; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; + + arrakisBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; + + arrakisFeeBPS(overrides?: CallOverrides): Promise<[number]>; + + arrakisTreasury(overrides?: CallOverrides): Promise<[string]>; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise<[number]>; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise<[number]>; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise<[number]>; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID( + overrides?: CallOverrides + ): Promise<[string] & { positionID: string }>; + + getUnderlyingBalances( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string } + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise<[number]>; + + manager(overrides?: CallOverrides): Promise<[string]>; + + managerBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; + + managerBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; + + managerFeeBPS(overrides?: CallOverrides): Promise<[number]>; + + managerTreasury(overrides?: CallOverrides): Promise<[string]>; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + pool(overrides?: CallOverrides): Promise<[string]>; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise<[number]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + toggleRestrictMint( + overrides?: Overrides & { from?: string } + ): Promise; + + token0(overrides?: CallOverrides): Promise<[string]>; + + token1(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise<[number]>; + + version(overrides?: CallOverrides): Promise<[string]>; + + withdrawArrakisBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + withdrawManagerBalance( + overrides?: Overrides & { from?: string } + ): Promise; + }; + + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string } + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint( + overrides?: Overrides & { from?: string } + ): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + withdrawManagerBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityBurned: BigNumber; + } + >; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: CallOverrides + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: CallOverrides + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityMinted: BigNumber; + } + >; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: CallOverrides + ): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint(overrides?: CallOverrides): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: CallOverrides + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: CallOverrides + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance(overrides?: CallOverrides): Promise; + + withdrawManagerBalance(overrides?: CallOverrides): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; + Approval( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; + + "Burned(address,uint256,uint256,uint256,uint128)"( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null + ): BurnedEventFilter; + Burned( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null + ): BurnedEventFilter; + + "FeesEarned(uint256,uint256)"( + feesEarned0?: null, + feesEarned1?: null + ): FeesEarnedEventFilter; + FeesEarned(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter; + + "Minted(address,uint256,uint256,uint256,uint128)"( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null + ): MintedEventFilter; + Minted( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null + ): MintedEventFilter; + + "OwnershipTransferred(address,address)"( + previousManager?: string | null, + newManager?: string | null + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousManager?: string | null, + newManager?: string | null + ): OwnershipTransferredEventFilter; + + "Rebalance(int24,int24,uint128,uint128)"( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null + ): RebalanceEventFilter; + Rebalance( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null + ): RebalanceEventFilter; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + Transfer( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + + "UpdateManagerParams(uint16,address,uint16,uint16,uint32)"( + managerFeeBPS?: null, + managerTreasury?: null, + gelatoRebalanceBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null + ): UpdateManagerParamsEventFilter; + UpdateManagerParams( + managerFeeBPS?: null, + managerTreasury?: null, + gelatoRebalanceBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null + ): UpdateManagerParamsEventFilter; + }; + + estimateGas: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string } + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; - getMintAmounts( - amount0Max: PromiseOrValue, - amount1Max: PromiseOrValue, - overrides?: CallOverrides - ): Promise + managerBalance0(overrides?: CallOverrides): Promise; - getPositionID(overrides?: CallOverrides): Promise + managerBalance1(overrides?: CallOverrides): Promise; - getUnderlyingBalances(overrides?: CallOverrides): Promise + managerFeeBPS(overrides?: CallOverrides): Promise; - getUnderlyingBalancesAtPrice( - sqrtRatioX96: PromiseOrValue, - overrides?: CallOverrides - ): Promise + managerTreasury(overrides?: CallOverrides): Promise; - increaseAllowance( - spender: PromiseOrValue, - addedValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - initialize( - _name: PromiseOrValue, - _symbol: PromiseOrValue, - _pool: PromiseOrValue, - _managerFeeBPS: PromiseOrValue, - _lowerTick: PromiseOrValue, - _upperTick: PromiseOrValue, - _manager_: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; - lowerTick(overrides?: CallOverrides): Promise + name(overrides?: CallOverrides): Promise; - manager(overrides?: CallOverrides): Promise + pool(overrides?: CallOverrides): Promise; - managerBalance0(overrides?: CallOverrides): Promise + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string } + ): Promise; - managerBalance1(overrides?: CallOverrides): Promise + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - managerFeeBPS(overrides?: CallOverrides): Promise + restrictedMintToggle(overrides?: CallOverrides): Promise; - managerTreasury(overrides?: CallOverrides): Promise + symbol(overrides?: CallOverrides): Promise; - mint( - mintAmount: PromiseOrValue, - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + toggleRestrictMint( + overrides?: Overrides & { from?: string } + ): Promise; - name(overrides?: CallOverrides): Promise + token0(overrides?: CallOverrides): Promise; - pool(overrides?: CallOverrides): Promise + token1(overrides?: CallOverrides): Promise; - rebalance( - swapThresholdPrice: PromiseOrValue, - swapAmountBPS: PromiseOrValue, - zeroForOne: PromiseOrValue, - feeAmount: PromiseOrValue, - paymentToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - renounceOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - restrictedMintToggle(overrides?: CallOverrides): Promise - - symbol(overrides?: CallOverrides): Promise - - toggleRestrictMint( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token0(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - token1(overrides?: CallOverrides): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transfer( - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferFrom( - sender: PromiseOrValue, - recipient: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapV3MintCallback( - amount0Owed: PromiseOrValue, - amount1Owed: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; - uniswapV3SwapCallback( - amount0Delta: PromiseOrValue, - amount1Delta: PromiseOrValue, - arg2: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateManagerParams( - newManagerFeeBPS: PromiseOrValue, - newManagerTreasury: PromiseOrValue, - newRebalanceBPS: PromiseOrValue, - newSlippageBPS: PromiseOrValue, - newSlippageInterval: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upperTick(overrides?: CallOverrides): Promise + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + withdrawManagerBalance( + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED( + overrides?: CallOverrides + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + gelatoRebalanceBPS( + overrides?: CallOverrides + ): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval( + overrides?: CallOverrides + ): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances( + overrides?: CallOverrides + ): Promise; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string } + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + restrictedMintToggle( + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint( + overrides?: Overrides & { from?: string } + ): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; - version(overrides?: CallOverrides): Promise + version(overrides?: CallOverrides): Promise; - withdrawArrakisBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + withdrawArrakisBalance( + overrides?: Overrides & { from?: string } + ): Promise; - withdrawManagerBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + withdrawManagerBalance( + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/KwentaStakingRewards.ts b/packages/sdk/src/contracts/types/KwentaStakingRewards.ts index 813fba93d1..743af98c61 100644 --- a/packages/sdk/src/contracts/types/KwentaStakingRewards.ts +++ b/packages/sdk/src/contracts/types/KwentaStakingRewards.ts @@ -2,944 +2,1139 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface KwentaStakingRewardsInterface extends utils.Interface { - functions: { - '_totalSupply()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'balanceOf(address)': FunctionFragment - 'earned(address)': FunctionFragment - 'escrowedBalanceOf(address)': FunctionFragment - 'exit()': FunctionFragment - 'getReward()': FunctionFragment - 'getRewardForDuration()': FunctionFragment - 'lastTimeRewardApplicable()': FunctionFragment - 'lastUpdateTime()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'nonEscrowedBalanceOf(address)': FunctionFragment - 'notifyRewardAmount(uint256)': FunctionFragment - 'owner()': FunctionFragment - 'pauseStakingRewards()': FunctionFragment - 'paused()': FunctionFragment - 'periodFinish()': FunctionFragment - 'recoverERC20(address,uint256)': FunctionFragment - 'rewardEscrow()': FunctionFragment - 'rewardPerToken()': FunctionFragment - 'rewardPerTokenStored()': FunctionFragment - 'rewardRate()': FunctionFragment - 'rewards(address)': FunctionFragment - 'rewardsDuration()': FunctionFragment - 'setRewardsDuration(uint256)': FunctionFragment - 'stake(uint256)': FunctionFragment - 'stakeEscrow(address,uint256)': FunctionFragment - 'supplySchedule()': FunctionFragment - 'token()': FunctionFragment - 'totalSupply()': FunctionFragment - 'unpauseStakingRewards()': FunctionFragment - 'unstake(uint256)': FunctionFragment - 'unstakeEscrow(address,uint256)': FunctionFragment - 'userRewardPerTokenPaid(address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | '_totalSupply' - | 'acceptOwnership' - | 'balanceOf' - | 'earned' - | 'escrowedBalanceOf' - | 'exit' - | 'getReward' - | 'getRewardForDuration' - | 'lastTimeRewardApplicable' - | 'lastUpdateTime' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'nonEscrowedBalanceOf' - | 'notifyRewardAmount' - | 'owner' - | 'pauseStakingRewards' - | 'paused' - | 'periodFinish' - | 'recoverERC20' - | 'rewardEscrow' - | 'rewardPerToken' - | 'rewardPerTokenStored' - | 'rewardRate' - | 'rewards' - | 'rewardsDuration' - | 'setRewardsDuration' - | 'stake' - | 'stakeEscrow' - | 'supplySchedule' - | 'token' - | 'totalSupply' - | 'unpauseStakingRewards' - | 'unstake' - | 'unstakeEscrow' - | 'userRewardPerTokenPaid' - ): FunctionFragment - - encodeFunctionData(functionFragment: '_totalSupply', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'earned', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'escrowedBalanceOf', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'exit', values?: undefined): string - encodeFunctionData(functionFragment: 'getReward', values?: undefined): string - encodeFunctionData(functionFragment: 'getRewardForDuration', values?: undefined): string - encodeFunctionData(functionFragment: 'lastTimeRewardApplicable', values?: undefined): string - encodeFunctionData(functionFragment: 'lastUpdateTime', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData( - functionFragment: 'nonEscrowedBalanceOf', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'notifyRewardAmount', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'pauseStakingRewards', values?: undefined): string - encodeFunctionData(functionFragment: 'paused', values?: undefined): string - encodeFunctionData(functionFragment: 'periodFinish', values?: undefined): string - encodeFunctionData( - functionFragment: 'recoverERC20', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'rewardEscrow', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardPerToken', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardPerTokenStored', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardRate', values?: undefined): string - encodeFunctionData(functionFragment: 'rewards', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rewardsDuration', values?: undefined): string - encodeFunctionData( - functionFragment: 'setRewardsDuration', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'stake', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'stakeEscrow', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'supplySchedule', values?: undefined): string - encodeFunctionData(functionFragment: 'token', values?: undefined): string - encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string - encodeFunctionData(functionFragment: 'unpauseStakingRewards', values?: undefined): string - encodeFunctionData(functionFragment: 'unstake', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'unstakeEscrow', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'userRewardPerTokenPaid', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: '_totalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'earned', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'escrowedBalanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exit', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getRewardForDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastTimeRewardApplicable', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastUpdateTime', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nonEscrowedBalanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'notifyRewardAmount', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'pauseStakingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'paused', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'periodFinish', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'recoverERC20', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardPerToken', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardPerTokenStored', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardsDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setRewardsDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'stake', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'stakeEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'supplySchedule', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'token', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'unpauseStakingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'unstake', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'unstakeEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'userRewardPerTokenPaid', data: BytesLike): Result - - events: { - 'EscrowStaked(address,uint256)': EventFragment - 'EscrowUnstaked(address,uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'Paused(address)': EventFragment - 'Recovered(address,uint256)': EventFragment - 'RewardAdded(uint256)': EventFragment - 'RewardPaid(address,uint256)': EventFragment - 'RewardsDurationUpdated(uint256)': EventFragment - 'Staked(address,uint256)': EventFragment - 'Unpaused(address)': EventFragment - 'Unstaked(address,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'EscrowStaked'): EventFragment - getEvent(nameOrSignatureOrTopic: 'EscrowUnstaked'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Paused'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Recovered'): EventFragment - getEvent(nameOrSignatureOrTopic: 'RewardAdded'): EventFragment - getEvent(nameOrSignatureOrTopic: 'RewardPaid'): EventFragment - getEvent(nameOrSignatureOrTopic: 'RewardsDurationUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Staked'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Unpaused'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Unstaked'): EventFragment + functions: { + "_totalSupply()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "earned(address)": FunctionFragment; + "escrowedBalanceOf(address)": FunctionFragment; + "exit()": FunctionFragment; + "getReward()": FunctionFragment; + "getRewardForDuration()": FunctionFragment; + "lastTimeRewardApplicable()": FunctionFragment; + "lastUpdateTime()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "nonEscrowedBalanceOf(address)": FunctionFragment; + "notifyRewardAmount(uint256)": FunctionFragment; + "owner()": FunctionFragment; + "pauseStakingRewards()": FunctionFragment; + "paused()": FunctionFragment; + "periodFinish()": FunctionFragment; + "recoverERC20(address,uint256)": FunctionFragment; + "rewardEscrow()": FunctionFragment; + "rewardPerToken()": FunctionFragment; + "rewardPerTokenStored()": FunctionFragment; + "rewardRate()": FunctionFragment; + "rewards(address)": FunctionFragment; + "rewardsDuration()": FunctionFragment; + "setRewardsDuration(uint256)": FunctionFragment; + "stake(uint256)": FunctionFragment; + "stakeEscrow(address,uint256)": FunctionFragment; + "supplySchedule()": FunctionFragment; + "token()": FunctionFragment; + "totalSupply()": FunctionFragment; + "unpauseStakingRewards()": FunctionFragment; + "unstake(uint256)": FunctionFragment; + "unstakeEscrow(address,uint256)": FunctionFragment; + "userRewardPerTokenPaid(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "_totalSupply" + | "acceptOwnership" + | "balanceOf" + | "earned" + | "escrowedBalanceOf" + | "exit" + | "getReward" + | "getRewardForDuration" + | "lastTimeRewardApplicable" + | "lastUpdateTime" + | "nominateNewOwner" + | "nominatedOwner" + | "nonEscrowedBalanceOf" + | "notifyRewardAmount" + | "owner" + | "pauseStakingRewards" + | "paused" + | "periodFinish" + | "recoverERC20" + | "rewardEscrow" + | "rewardPerToken" + | "rewardPerTokenStored" + | "rewardRate" + | "rewards" + | "rewardsDuration" + | "setRewardsDuration" + | "stake" + | "stakeEscrow" + | "supplySchedule" + | "token" + | "totalSupply" + | "unpauseStakingRewards" + | "unstake" + | "unstakeEscrow" + | "userRewardPerTokenPaid" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "_totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData(functionFragment: "earned", values: [string]): string; + encodeFunctionData( + functionFragment: "escrowedBalanceOf", + values: [string] + ): string; + encodeFunctionData(functionFragment: "exit", values?: undefined): string; + encodeFunctionData(functionFragment: "getReward", values?: undefined): string; + encodeFunctionData( + functionFragment: "getRewardForDuration", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastTimeRewardApplicable", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastUpdateTime", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nonEscrowedBalanceOf", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "notifyRewardAmount", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "pauseStakingRewards", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "paused", values?: undefined): string; + encodeFunctionData( + functionFragment: "periodFinish", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "recoverERC20", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "rewardEscrow", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardPerToken", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardPerTokenStored", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardRate", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "rewards", values: [string]): string; + encodeFunctionData( + functionFragment: "rewardsDuration", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setRewardsDuration", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "stake", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "stakeEscrow", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "supplySchedule", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "token", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "unpauseStakingRewards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "unstake", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "unstakeEscrow", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "userRewardPerTokenPaid", + values: [string] + ): string; + + decodeFunctionResult( + functionFragment: "_totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "earned", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "escrowedBalanceOf", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "exit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getReward", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getRewardForDuration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastTimeRewardApplicable", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastUpdateTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nonEscrowedBalanceOf", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "notifyRewardAmount", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "pauseStakingRewards", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "periodFinish", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "recoverERC20", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardEscrow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardPerToken", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardPerTokenStored", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "rewardRate", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "rewards", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rewardsDuration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setRewardsDuration", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "stake", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "stakeEscrow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supplySchedule", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "unpauseStakingRewards", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "unstake", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "unstakeEscrow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "userRewardPerTokenPaid", + data: BytesLike + ): Result; + + events: { + "EscrowStaked(address,uint256)": EventFragment; + "EscrowUnstaked(address,uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "Paused(address)": EventFragment; + "Recovered(address,uint256)": EventFragment; + "RewardAdded(uint256)": EventFragment; + "RewardPaid(address,uint256)": EventFragment; + "RewardsDurationUpdated(uint256)": EventFragment; + "Staked(address,uint256)": EventFragment; + "Unpaused(address)": EventFragment; + "Unstaked(address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "EscrowStaked"): EventFragment; + getEvent(nameOrSignatureOrTopic: "EscrowUnstaked"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Recovered"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RewardAdded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RewardPaid"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RewardsDurationUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Staked"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Unpaused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Unstaked"): EventFragment; } export interface EscrowStakedEventObject { - user: string - amount: BigNumber + user: string; + amount: BigNumber; } -export type EscrowStakedEvent = TypedEvent<[string, BigNumber], EscrowStakedEventObject> +export type EscrowStakedEvent = TypedEvent< + [string, BigNumber], + EscrowStakedEventObject +>; -export type EscrowStakedEventFilter = TypedEventFilter +export type EscrowStakedEventFilter = TypedEventFilter; export interface EscrowUnstakedEventObject { - user: string - amount: BigNumber + user: string; + amount: BigNumber; } -export type EscrowUnstakedEvent = TypedEvent<[string, BigNumber], EscrowUnstakedEventObject> +export type EscrowUnstakedEvent = TypedEvent< + [string, BigNumber], + EscrowUnstakedEventObject +>; -export type EscrowUnstakedEventFilter = TypedEventFilter +export type EscrowUnstakedEventFilter = TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface PausedEventObject { - account: string + account: string; } -export type PausedEvent = TypedEvent<[string], PausedEventObject> +export type PausedEvent = TypedEvent<[string], PausedEventObject>; -export type PausedEventFilter = TypedEventFilter +export type PausedEventFilter = TypedEventFilter; export interface RecoveredEventObject { - token: string - amount: BigNumber + token: string; + amount: BigNumber; } -export type RecoveredEvent = TypedEvent<[string, BigNumber], RecoveredEventObject> +export type RecoveredEvent = TypedEvent< + [string, BigNumber], + RecoveredEventObject +>; -export type RecoveredEventFilter = TypedEventFilter +export type RecoveredEventFilter = TypedEventFilter; export interface RewardAddedEventObject { - reward: BigNumber + reward: BigNumber; } -export type RewardAddedEvent = TypedEvent<[BigNumber], RewardAddedEventObject> +export type RewardAddedEvent = TypedEvent<[BigNumber], RewardAddedEventObject>; -export type RewardAddedEventFilter = TypedEventFilter +export type RewardAddedEventFilter = TypedEventFilter; export interface RewardPaidEventObject { - user: string - reward: BigNumber + user: string; + reward: BigNumber; } -export type RewardPaidEvent = TypedEvent<[string, BigNumber], RewardPaidEventObject> +export type RewardPaidEvent = TypedEvent< + [string, BigNumber], + RewardPaidEventObject +>; -export type RewardPaidEventFilter = TypedEventFilter +export type RewardPaidEventFilter = TypedEventFilter; export interface RewardsDurationUpdatedEventObject { - newDuration: BigNumber + newDuration: BigNumber; } -export type RewardsDurationUpdatedEvent = TypedEvent<[BigNumber], RewardsDurationUpdatedEventObject> +export type RewardsDurationUpdatedEvent = TypedEvent< + [BigNumber], + RewardsDurationUpdatedEventObject +>; -export type RewardsDurationUpdatedEventFilter = TypedEventFilter +export type RewardsDurationUpdatedEventFilter = + TypedEventFilter; export interface StakedEventObject { - user: string - amount: BigNumber + user: string; + amount: BigNumber; } -export type StakedEvent = TypedEvent<[string, BigNumber], StakedEventObject> +export type StakedEvent = TypedEvent<[string, BigNumber], StakedEventObject>; -export type StakedEventFilter = TypedEventFilter +export type StakedEventFilter = TypedEventFilter; export interface UnpausedEventObject { - account: string + account: string; } -export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject> +export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject>; -export type UnpausedEventFilter = TypedEventFilter +export type UnpausedEventFilter = TypedEventFilter; export interface UnstakedEventObject { - user: string - amount: BigNumber + user: string; + amount: BigNumber; } -export type UnstakedEvent = TypedEvent<[string, BigNumber], UnstakedEventObject> +export type UnstakedEvent = TypedEvent< + [string, BigNumber], + UnstakedEventObject +>; -export type UnstakedEventFilter = TypedEventFilter +export type UnstakedEventFilter = TypedEventFilter; export interface KwentaStakingRewards extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - interface: KwentaStakingRewardsInterface + interface: KwentaStakingRewardsInterface; - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - functions: { - _totalSupply(overrides?: CallOverrides): Promise<[BigNumber]> + functions: { + _totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> + earned(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; - escrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> + escrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit( + overrides?: Overrides & { from?: string } + ): Promise; - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getReward( + overrides?: Overrides & { from?: string } + ): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise<[BigNumber]> + getRewardForDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise<[BigNumber]> + lastTimeRewardApplicable(overrides?: CallOverrides): Promise<[BigNumber]>; - lastUpdateTime(overrides?: CallOverrides): Promise<[BigNumber]> + lastUpdateTime(overrides?: CallOverrides): Promise<[BigNumber]>; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise<[string]> + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - nonEscrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> + nonEscrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise<[string]> + owner(overrides?: CallOverrides): Promise<[string]>; - pauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + pauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - paused(overrides?: CallOverrides): Promise<[boolean]> + paused(overrides?: CallOverrides): Promise<[boolean]>; - periodFinish(overrides?: CallOverrides): Promise<[BigNumber]> + periodFinish(overrides?: CallOverrides): Promise<[BigNumber]>; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise<[string]> + rewardEscrow(overrides?: CallOverrides): Promise<[string]>; - rewardPerToken(overrides?: CallOverrides): Promise<[BigNumber]> + rewardPerToken(overrides?: CallOverrides): Promise<[BigNumber]>; - rewardPerTokenStored(overrides?: CallOverrides): Promise<[BigNumber]> + rewardPerTokenStored(overrides?: CallOverrides): Promise<[BigNumber]>; - rewardRate(overrides?: CallOverrides): Promise<[BigNumber]> + rewardRate(overrides?: CallOverrides): Promise<[BigNumber]>; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> + rewards(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; - rewardsDuration(overrides?: CallOverrides): Promise<[BigNumber]> + rewardsDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - supplySchedule(overrides?: CallOverrides): Promise<[string]> + supplySchedule(overrides?: CallOverrides): Promise<[string]>; - token(overrides?: CallOverrides): Promise<[string]> + token(overrides?: CallOverrides): Promise<[string]>; - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]> + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - unpauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unpauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - unstake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - unstakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - } + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + }; - _totalSupply(overrides?: CallOverrides): Promise + _totalSupply(overrides?: CallOverrides): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise + earned(account: string, overrides?: CallOverrides): Promise; - escrowedBalanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + escrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit(overrides?: Overrides & { from?: string }): Promise; - getReward(overrides?: Overrides & { from?: PromiseOrValue }): Promise + getReward( + overrides?: Overrides & { from?: string } + ): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration(overrides?: CallOverrides): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - nonEscrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nonEscrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - pauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + pauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored(overrides?: CallOverrides): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards(arg0: string, overrides?: CallOverrides): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - supplySchedule(overrides?: CallOverrides): Promise + supplySchedule(overrides?: CallOverrides): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - unpauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unpauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - unstake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - unstakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; - callStatic: { - _totalSupply(overrides?: CallOverrides): Promise + callStatic: { + _totalSupply(overrides?: CallOverrides): Promise; - acceptOwnership(overrides?: CallOverrides): Promise + acceptOwnership(overrides?: CallOverrides): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise + earned(account: string, overrides?: CallOverrides): Promise; - escrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + escrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - exit(overrides?: CallOverrides): Promise + exit(overrides?: CallOverrides): Promise; - getReward(overrides?: CallOverrides): Promise + getReward(overrides?: CallOverrides): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration(overrides?: CallOverrides): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - nonEscrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nonEscrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: CallOverrides - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: CallOverrides + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - pauseStakingRewards(overrides?: CallOverrides): Promise + pauseStakingRewards(overrides?: CallOverrides): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: CallOverrides - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: CallOverrides + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored(overrides?: CallOverrides): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards(arg0: string, overrides?: CallOverrides): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: CallOverrides + ): Promise; - stake(amount: PromiseOrValue, overrides?: CallOverrides): Promise + stake(amount: BigNumberish, overrides?: CallOverrides): Promise; - stakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise + stakeEscrow( + account: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; - supplySchedule(overrides?: CallOverrides): Promise + supplySchedule(overrides?: CallOverrides): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - unpauseStakingRewards(overrides?: CallOverrides): Promise + unpauseStakingRewards(overrides?: CallOverrides): Promise; - unstake(amount: PromiseOrValue, overrides?: CallOverrides): Promise + unstake(amount: BigNumberish, overrides?: CallOverrides): Promise; - unstakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise + unstakeEscrow( + account: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; + }; - filters: { - 'EscrowStaked(address,uint256)'( - user?: PromiseOrValue | null, - amount?: null - ): EscrowStakedEventFilter - EscrowStaked(user?: PromiseOrValue | null, amount?: null): EscrowStakedEventFilter + filters: { + "EscrowStaked(address,uint256)"( + user?: string | null, + amount?: null + ): EscrowStakedEventFilter; + EscrowStaked(user?: string | null, amount?: null): EscrowStakedEventFilter; - 'EscrowUnstaked(address,uint256)'(user?: null, amount?: null): EscrowUnstakedEventFilter - EscrowUnstaked(user?: null, amount?: null): EscrowUnstakedEventFilter + "EscrowUnstaked(address,uint256)"( + user?: null, + amount?: null + ): EscrowUnstakedEventFilter; + EscrowUnstaked(user?: null, amount?: null): EscrowUnstakedEventFilter; - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; - 'Paused(address)'(account?: null): PausedEventFilter - Paused(account?: null): PausedEventFilter + "Paused(address)"(account?: null): PausedEventFilter; + Paused(account?: null): PausedEventFilter; - 'Recovered(address,uint256)'(token?: null, amount?: null): RecoveredEventFilter - Recovered(token?: null, amount?: null): RecoveredEventFilter + "Recovered(address,uint256)"( + token?: null, + amount?: null + ): RecoveredEventFilter; + Recovered(token?: null, amount?: null): RecoveredEventFilter; - 'RewardAdded(uint256)'(reward?: null): RewardAddedEventFilter - RewardAdded(reward?: null): RewardAddedEventFilter + "RewardAdded(uint256)"(reward?: null): RewardAddedEventFilter; + RewardAdded(reward?: null): RewardAddedEventFilter; - 'RewardPaid(address,uint256)'( - user?: PromiseOrValue | null, - reward?: null - ): RewardPaidEventFilter - RewardPaid(user?: PromiseOrValue | null, reward?: null): RewardPaidEventFilter + "RewardPaid(address,uint256)"( + user?: string | null, + reward?: null + ): RewardPaidEventFilter; + RewardPaid(user?: string | null, reward?: null): RewardPaidEventFilter; - 'RewardsDurationUpdated(uint256)'(newDuration?: null): RewardsDurationUpdatedEventFilter - RewardsDurationUpdated(newDuration?: null): RewardsDurationUpdatedEventFilter + "RewardsDurationUpdated(uint256)"( + newDuration?: null + ): RewardsDurationUpdatedEventFilter; + RewardsDurationUpdated( + newDuration?: null + ): RewardsDurationUpdatedEventFilter; - 'Staked(address,uint256)'( - user?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter - Staked(user?: PromiseOrValue | null, amount?: null): StakedEventFilter + "Staked(address,uint256)"( + user?: string | null, + amount?: null + ): StakedEventFilter; + Staked(user?: string | null, amount?: null): StakedEventFilter; - 'Unpaused(address)'(account?: null): UnpausedEventFilter - Unpaused(account?: null): UnpausedEventFilter + "Unpaused(address)"(account?: null): UnpausedEventFilter; + Unpaused(account?: null): UnpausedEventFilter; - 'Unstaked(address,uint256)'( - user?: PromiseOrValue | null, - amount?: null - ): UnstakedEventFilter - Unstaked(user?: PromiseOrValue | null, amount?: null): UnstakedEventFilter - } + "Unstaked(address,uint256)"( + user?: string | null, + amount?: null + ): UnstakedEventFilter; + Unstaked(user?: string | null, amount?: null): UnstakedEventFilter; + }; - estimateGas: { - _totalSupply(overrides?: CallOverrides): Promise + estimateGas: { + _totalSupply(overrides?: CallOverrides): Promise; - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise + earned(account: string, overrides?: CallOverrides): Promise; - escrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + escrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit(overrides?: Overrides & { from?: string }): Promise; - getReward(overrides?: Overrides & { from?: PromiseOrValue }): Promise + getReward(overrides?: Overrides & { from?: string }): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration(overrides?: CallOverrides): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - nonEscrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nonEscrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - pauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + pauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored(overrides?: CallOverrides): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards(arg0: string, overrides?: CallOverrides): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - supplySchedule(overrides?: CallOverrides): Promise + supplySchedule(overrides?: CallOverrides): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - unpauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unpauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - unstake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - unstakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; + }; - populateTransaction: { - _totalSupply(overrides?: CallOverrides): Promise + populateTransaction: { + _totalSupply(overrides?: CallOverrides): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + earned( + account: string, + overrides?: CallOverrides + ): Promise; - escrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + escrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit( + overrides?: Overrides & { from?: string } + ): Promise; - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getReward( + overrides?: Overrides & { from?: string } + ): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration( + overrides?: CallOverrides + ): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable( + overrides?: CallOverrides + ): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - nonEscrowedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nonEscrowedBalanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - pauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + pauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored( + overrides?: CallOverrides + ): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards( + arg0: string, + overrides?: CallOverrides + ): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - supplySchedule(overrides?: CallOverrides): Promise + supplySchedule(overrides?: CallOverrides): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - unpauseStakingRewards( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unpauseStakingRewards( + overrides?: Overrides & { from?: string } + ): Promise; - unstake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - unstakeEscrow( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + unstakeEscrow( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/MultipleMerkleDistributor.ts b/packages/sdk/src/contracts/types/MultipleMerkleDistributor.ts index 87994a5481..4996cd20f4 100644 --- a/packages/sdk/src/contracts/types/MultipleMerkleDistributor.ts +++ b/packages/sdk/src/contracts/types/MultipleMerkleDistributor.ts @@ -2,431 +2,515 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IMultipleMerkleDistributor { - export type ClaimsStruct = { - index: PromiseOrValue - account: PromiseOrValue - amount: PromiseOrValue - merkleProof: PromiseOrValue[] - epoch: PromiseOrValue - } - - export type ClaimsStructOutput = [BigNumber, string, BigNumber, string[], BigNumber] & { - index: BigNumber - account: string - amount: BigNumber - merkleProof: string[] - epoch: BigNumber - } + export type ClaimsStruct = { + index: BigNumberish; + account: string; + amount: BigNumberish; + merkleProof: BytesLike[]; + epoch: BigNumberish; + }; + + export type ClaimsStructOutput = [ + BigNumber, + string, + BigNumber, + string[], + BigNumber + ] & { + index: BigNumber; + account: string; + amount: BigNumber; + merkleProof: string[]; + epoch: BigNumber; + }; } export interface MultipleMerkleDistributorInterface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'claim(uint256,address,uint256,bytes32[],uint256)': FunctionFragment - 'claimMultiple((uint256,address,uint256,bytes32[],uint256)[])': FunctionFragment - 'distributionEpoch()': FunctionFragment - 'isClaimed(uint256,uint256)': FunctionFragment - 'merkleRoots(uint256)': FunctionFragment - 'newMerkleRoot(bytes32)': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'rewardEscrow()': FunctionFragment - 'token()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'claim' - | 'claimMultiple' - | 'distributionEpoch' - | 'isClaimed' - | 'merkleRoots' - | 'newMerkleRoot' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'rewardEscrow' - | 'token' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'claim', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue[], - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'claimMultiple', - values: [IMultipleMerkleDistributor.ClaimsStruct[]] - ): string - encodeFunctionData(functionFragment: 'distributionEpoch', values?: undefined): string - encodeFunctionData( - functionFragment: 'isClaimed', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'merkleRoots', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'newMerkleRoot', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardEscrow', values?: undefined): string - encodeFunctionData(functionFragment: 'token', values?: undefined): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'claimMultiple', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'distributionEpoch', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isClaimed', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'merkleRoots', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'newMerkleRoot', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'token', data: BytesLike): Result - - events: { - 'Claimed(uint256,address,uint256,uint256)': EventFragment - 'MerkleRootAdded(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'Claimed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MerkleRootAdded'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment + functions: { + "acceptOwnership()": FunctionFragment; + "claim(uint256,address,uint256,bytes32[],uint256)": FunctionFragment; + "claimMultiple((uint256,address,uint256,bytes32[],uint256)[])": FunctionFragment; + "distributionEpoch()": FunctionFragment; + "isClaimed(uint256,uint256)": FunctionFragment; + "merkleRoots(uint256)": FunctionFragment; + "newMerkleRoot(bytes32)": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "rewardEscrow()": FunctionFragment; + "token()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "claim" + | "claimMultiple" + | "distributionEpoch" + | "isClaimed" + | "merkleRoots" + | "newMerkleRoot" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "rewardEscrow" + | "token" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "claim", + values: [BigNumberish, string, BigNumberish, BytesLike[], BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "claimMultiple", + values: [IMultipleMerkleDistributor.ClaimsStruct[]] + ): string; + encodeFunctionData( + functionFragment: "distributionEpoch", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isClaimed", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "merkleRoots", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "newMerkleRoot", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "rewardEscrow", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "token", values?: undefined): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "claim", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "claimMultiple", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "distributionEpoch", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isClaimed", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "merkleRoots", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "newMerkleRoot", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rewardEscrow", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; + + events: { + "Claimed(uint256,address,uint256,uint256)": EventFragment; + "MerkleRootAdded(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Claimed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MerkleRootAdded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; } export interface ClaimedEventObject { - index: BigNumber - account: string - amount: BigNumber - epoch: BigNumber + index: BigNumber; + account: string; + amount: BigNumber; + epoch: BigNumber; } -export type ClaimedEvent = TypedEvent<[BigNumber, string, BigNumber, BigNumber], ClaimedEventObject> +export type ClaimedEvent = TypedEvent< + [BigNumber, string, BigNumber, BigNumber], + ClaimedEventObject +>; -export type ClaimedEventFilter = TypedEventFilter +export type ClaimedEventFilter = TypedEventFilter; export interface MerkleRootAddedEventObject { - epoch: BigNumber + epoch: BigNumber; } -export type MerkleRootAddedEvent = TypedEvent<[BigNumber], MerkleRootAddedEventObject> +export type MerkleRootAddedEvent = TypedEvent< + [BigNumber], + MerkleRootAddedEventObject +>; -export type MerkleRootAddedEventFilter = TypedEventFilter +export type MerkleRootAddedEventFilter = TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface MultipleMerkleDistributor extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: MultipleMerkleDistributorInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - distributionEpoch(overrides?: CallOverrides): Promise<[BigNumber]> - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]> - - newMerkleRoot( - _merkleRoot: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - rewardEscrow(overrides?: CallOverrides): Promise<[string]> - - token(overrides?: CallOverrides): Promise<[string]> - } - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - distributionEpoch(overrides?: CallOverrides): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - newMerkleRoot( - _merkleRoot: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - token(overrides?: CallOverrides): Promise - - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: CallOverrides - ): Promise - - distributionEpoch(overrides?: CallOverrides): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - newMerkleRoot(_merkleRoot: PromiseOrValue, overrides?: CallOverrides): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - token(overrides?: CallOverrides): Promise - } - - filters: { - 'Claimed(uint256,address,uint256,uint256)'( - index?: null, - account?: null, - amount?: null, - epoch?: null - ): ClaimedEventFilter - Claimed(index?: null, account?: null, amount?: null, epoch?: null): ClaimedEventFilter - - 'MerkleRootAdded(uint256)'(epoch?: null): MerkleRootAddedEventFilter - MerkleRootAdded(epoch?: null): MerkleRootAddedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - } - - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - distributionEpoch(overrides?: CallOverrides): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - newMerkleRoot( - _merkleRoot: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - token(overrides?: CallOverrides): Promise - } - - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - distributionEpoch(overrides?: CallOverrides): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - newMerkleRoot( - _merkleRoot: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - token(overrides?: CallOverrides): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: MultipleMerkleDistributorInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + distributionEpoch(overrides?: CallOverrides): Promise<[BigNumber]>; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise<[boolean]>; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + newMerkleRoot( + _merkleRoot: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + rewardEscrow(overrides?: CallOverrides): Promise<[string]>; + + token(overrides?: CallOverrides): Promise<[string]>; + }; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + distributionEpoch(overrides?: CallOverrides): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + newMerkleRoot( + _merkleRoot: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + token(overrides?: CallOverrides): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: CallOverrides + ): Promise; + + distributionEpoch(overrides?: CallOverrides): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + newMerkleRoot( + _merkleRoot: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + token(overrides?: CallOverrides): Promise; + }; + + filters: { + "Claimed(uint256,address,uint256,uint256)"( + index?: null, + account?: null, + amount?: null, + epoch?: null + ): ClaimedEventFilter; + Claimed( + index?: null, + account?: null, + amount?: null, + epoch?: null + ): ClaimedEventFilter; + + "MerkleRootAdded(uint256)"(epoch?: null): MerkleRootAddedEventFilter; + MerkleRootAdded(epoch?: null): MerkleRootAddedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + distributionEpoch(overrides?: CallOverrides): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + newMerkleRoot( + _merkleRoot: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + token(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + distributionEpoch(overrides?: CallOverrides): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + newMerkleRoot( + _merkleRoot: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + token(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/MultipleMerkleDistributorOp.ts b/packages/sdk/src/contracts/types/MultipleMerkleDistributorOp.ts index 702b3310c7..87616c572c 100644 --- a/packages/sdk/src/contracts/types/MultipleMerkleDistributorOp.ts +++ b/packages/sdk/src/contracts/types/MultipleMerkleDistributorOp.ts @@ -2,414 +2,481 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IMultipleMerkleDistributor { - export type ClaimsStruct = { - index: PromiseOrValue - account: PromiseOrValue - amount: PromiseOrValue - merkleProof: PromiseOrValue[] - epoch: PromiseOrValue - } - - export type ClaimsStructOutput = [BigNumber, string, BigNumber, string[], BigNumber] & { - index: BigNumber - account: string - amount: BigNumber - merkleProof: string[] - epoch: BigNumber - } + export type ClaimsStruct = { + index: BigNumberish; + account: string; + amount: BigNumberish; + merkleProof: BytesLike[]; + epoch: BigNumberish; + }; + + export type ClaimsStructOutput = [ + BigNumber, + string, + BigNumber, + string[], + BigNumber + ] & { + index: BigNumber; + account: string; + amount: BigNumber; + merkleProof: string[]; + epoch: BigNumber; + }; } export interface MultipleMerkleDistributorOpInterface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'claim(uint256,address,uint256,bytes32[],uint256)': FunctionFragment - 'claimMultiple((uint256,address,uint256,bytes32[],uint256)[])': FunctionFragment - 'isClaimed(uint256,uint256)': FunctionFragment - 'merkleRoots(uint256)': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'setMerkleRootForEpoch(bytes32,uint256)': FunctionFragment - 'token()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'claim' - | 'claimMultiple' - | 'isClaimed' - | 'merkleRoots' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'setMerkleRootForEpoch' - | 'token' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'claim', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue[], - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'claimMultiple', - values: [IMultipleMerkleDistributor.ClaimsStruct[]] - ): string - encodeFunctionData( - functionFragment: 'isClaimed', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'merkleRoots', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData( - functionFragment: 'setMerkleRootForEpoch', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'token', values?: undefined): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'claimMultiple', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isClaimed', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'merkleRoots', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMerkleRootForEpoch', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'token', data: BytesLike): Result - - events: { - 'Claimed(uint256,address,uint256,uint256)': EventFragment - 'MerkleRootModified(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'Claimed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MerkleRootModified'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment + functions: { + "acceptOwnership()": FunctionFragment; + "claim(uint256,address,uint256,bytes32[],uint256)": FunctionFragment; + "claimMultiple((uint256,address,uint256,bytes32[],uint256)[])": FunctionFragment; + "isClaimed(uint256,uint256)": FunctionFragment; + "merkleRoots(uint256)": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "setMerkleRootForEpoch(bytes32,uint256)": FunctionFragment; + "token()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "claim" + | "claimMultiple" + | "isClaimed" + | "merkleRoots" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "setMerkleRootForEpoch" + | "token" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "claim", + values: [BigNumberish, string, BigNumberish, BytesLike[], BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "claimMultiple", + values: [IMultipleMerkleDistributor.ClaimsStruct[]] + ): string; + encodeFunctionData( + functionFragment: "isClaimed", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "merkleRoots", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "setMerkleRootForEpoch", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "token", values?: undefined): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "claim", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "claimMultiple", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isClaimed", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "merkleRoots", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMerkleRootForEpoch", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; + + events: { + "Claimed(uint256,address,uint256,uint256)": EventFragment; + "MerkleRootModified(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Claimed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MerkleRootModified"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; } export interface ClaimedEventObject { - index: BigNumber - account: string - amount: BigNumber - epoch: BigNumber + index: BigNumber; + account: string; + amount: BigNumber; + epoch: BigNumber; } -export type ClaimedEvent = TypedEvent<[BigNumber, string, BigNumber, BigNumber], ClaimedEventObject> +export type ClaimedEvent = TypedEvent< + [BigNumber, string, BigNumber, BigNumber], + ClaimedEventObject +>; -export type ClaimedEventFilter = TypedEventFilter +export type ClaimedEventFilter = TypedEventFilter; export interface MerkleRootModifiedEventObject { - epoch: BigNumber + epoch: BigNumber; } -export type MerkleRootModifiedEvent = TypedEvent<[BigNumber], MerkleRootModifiedEventObject> +export type MerkleRootModifiedEvent = TypedEvent< + [BigNumber], + MerkleRootModifiedEventObject +>; -export type MerkleRootModifiedEventFilter = TypedEventFilter +export type MerkleRootModifiedEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface MultipleMerkleDistributorOp extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: MultipleMerkleDistributorOpInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise<[string]> - } - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise - - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: CallOverrides - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - token(overrides?: CallOverrides): Promise - } - - filters: { - 'Claimed(uint256,address,uint256,uint256)'( - index?: null, - account?: null, - amount?: null, - epoch?: null - ): ClaimedEventFilter - Claimed(index?: null, account?: null, amount?: null, epoch?: null): ClaimedEventFilter - - 'MerkleRootModified(uint256)'(epoch?: null): MerkleRootModifiedEventFilter - MerkleRootModified(epoch?: null): MerkleRootModifiedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - } - - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise - } - - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: MultipleMerkleDistributorOpInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise<[boolean]>; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise<[string]>; + }; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: CallOverrides + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + token(overrides?: CallOverrides): Promise; + }; + + filters: { + "Claimed(uint256,address,uint256,uint256)"( + index?: null, + account?: null, + amount?: null, + epoch?: null + ): ClaimedEventFilter; + Claimed( + index?: null, + account?: null, + amount?: null, + epoch?: null + ): ClaimedEventFilter; + + "MerkleRootModified(uint256)"(epoch?: null): MerkleRootModifiedEventFilter; + MerkleRootModified(epoch?: null): MerkleRootModifiedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/MultipleMerkleDistributorPerpsV2.ts b/packages/sdk/src/contracts/types/MultipleMerkleDistributorPerpsV2.ts index 44920d4c41..ba84317629 100644 --- a/packages/sdk/src/contracts/types/MultipleMerkleDistributorPerpsV2.ts +++ b/packages/sdk/src/contracts/types/MultipleMerkleDistributorPerpsV2.ts @@ -2,428 +2,502 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IMultipleMerkleDistributor { - export type ClaimsStruct = { - index: PromiseOrValue - account: PromiseOrValue - amount: PromiseOrValue - merkleProof: PromiseOrValue[] - epoch: PromiseOrValue - } - - export type ClaimsStructOutput = [BigNumber, string, BigNumber, string[], BigNumber] & { - index: BigNumber - account: string - amount: BigNumber - merkleProof: string[] - epoch: BigNumber - } + export type ClaimsStruct = { + index: BigNumberish; + account: string; + amount: BigNumberish; + merkleProof: BytesLike[]; + epoch: BigNumberish; + }; + + export type ClaimsStructOutput = [ + BigNumber, + string, + BigNumber, + string[], + BigNumber + ] & { + index: BigNumber; + account: string; + amount: BigNumber; + merkleProof: string[]; + epoch: BigNumber; + }; } -export interface MultipleMerkleDistributorPerpsV2Interface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'claim(uint256,address,uint256,bytes32[],uint256)': FunctionFragment - 'claimMultiple((uint256,address,uint256,bytes32[],uint256)[])': FunctionFragment - 'isClaimed(uint256,uint256)': FunctionFragment - 'merkleRoots(uint256)': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'rewardEscrow()': FunctionFragment - 'setMerkleRootForEpoch(bytes32,uint256)': FunctionFragment - 'token()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'claim' - | 'claimMultiple' - | 'isClaimed' - | 'merkleRoots' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'rewardEscrow' - | 'setMerkleRootForEpoch' - | 'token' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'claim', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue[], - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'claimMultiple', - values: [IMultipleMerkleDistributor.ClaimsStruct[]] - ): string - encodeFunctionData( - functionFragment: 'isClaimed', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'merkleRoots', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardEscrow', values?: undefined): string - encodeFunctionData( - functionFragment: 'setMerkleRootForEpoch', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'token', values?: undefined): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'claimMultiple', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isClaimed', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'merkleRoots', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMerkleRootForEpoch', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'token', data: BytesLike): Result - - events: { - 'Claimed(uint256,address,uint256,uint256)': EventFragment - 'MerkleRootModified(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'Claimed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MerkleRootModified'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment +export interface MultipleMerkleDistributorPerpsV2Interface + extends utils.Interface { + functions: { + "acceptOwnership()": FunctionFragment; + "claim(uint256,address,uint256,bytes32[],uint256)": FunctionFragment; + "claimMultiple((uint256,address,uint256,bytes32[],uint256)[])": FunctionFragment; + "isClaimed(uint256,uint256)": FunctionFragment; + "merkleRoots(uint256)": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "rewardEscrow()": FunctionFragment; + "setMerkleRootForEpoch(bytes32,uint256)": FunctionFragment; + "token()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "claim" + | "claimMultiple" + | "isClaimed" + | "merkleRoots" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "rewardEscrow" + | "setMerkleRootForEpoch" + | "token" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "claim", + values: [BigNumberish, string, BigNumberish, BytesLike[], BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "claimMultiple", + values: [IMultipleMerkleDistributor.ClaimsStruct[]] + ): string; + encodeFunctionData( + functionFragment: "isClaimed", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "merkleRoots", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "rewardEscrow", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setMerkleRootForEpoch", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "token", values?: undefined): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "claim", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "claimMultiple", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isClaimed", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "merkleRoots", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rewardEscrow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMerkleRootForEpoch", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; + + events: { + "Claimed(uint256,address,uint256,uint256)": EventFragment; + "MerkleRootModified(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Claimed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MerkleRootModified"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; } export interface ClaimedEventObject { - index: BigNumber - account: string - amount: BigNumber - epoch: BigNumber + index: BigNumber; + account: string; + amount: BigNumber; + epoch: BigNumber; } -export type ClaimedEvent = TypedEvent<[BigNumber, string, BigNumber, BigNumber], ClaimedEventObject> +export type ClaimedEvent = TypedEvent< + [BigNumber, string, BigNumber, BigNumber], + ClaimedEventObject +>; -export type ClaimedEventFilter = TypedEventFilter +export type ClaimedEventFilter = TypedEventFilter; export interface MerkleRootModifiedEventObject { - epoch: BigNumber + epoch: BigNumber; } -export type MerkleRootModifiedEvent = TypedEvent<[BigNumber], MerkleRootModifiedEventObject> +export type MerkleRootModifiedEvent = TypedEvent< + [BigNumber], + MerkleRootModifiedEventObject +>; -export type MerkleRootModifiedEventFilter = TypedEventFilter +export type MerkleRootModifiedEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface MultipleMerkleDistributorPerpsV2 extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: MultipleMerkleDistributorPerpsV2Interface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - rewardEscrow(overrides?: CallOverrides): Promise<[string]> - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise<[string]> - } - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise - - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: CallOverrides - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - token(overrides?: CallOverrides): Promise - } - - filters: { - 'Claimed(uint256,address,uint256,uint256)'( - index?: null, - account?: null, - amount?: null, - epoch?: null - ): ClaimedEventFilter - Claimed(index?: null, account?: null, amount?: null, epoch?: null): ClaimedEventFilter - - 'MerkleRootModified(uint256)'(epoch?: null): MerkleRootModifiedEventFilter - MerkleRootModified(epoch?: null): MerkleRootModifiedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - } - - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise - } - - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claim( - index: PromiseOrValue, - account: PromiseOrValue, - amount: PromiseOrValue, - merkleProof: PromiseOrValue[], - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - claimMultiple( - claims: IMultipleMerkleDistributor.ClaimsStruct[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isClaimed( - index: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - merkleRoots( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rewardEscrow(overrides?: CallOverrides): Promise - - setMerkleRootForEpoch( - merkleRoot: PromiseOrValue, - epoch: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - token(overrides?: CallOverrides): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: MultipleMerkleDistributorPerpsV2Interface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise<[boolean]>; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + rewardEscrow(overrides?: CallOverrides): Promise<[string]>; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise<[string]>; + }; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: CallOverrides + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + token(overrides?: CallOverrides): Promise; + }; + + filters: { + "Claimed(uint256,address,uint256,uint256)"( + index?: null, + account?: null, + amount?: null, + epoch?: null + ): ClaimedEventFilter; + Claimed( + index?: null, + account?: null, + amount?: null, + epoch?: null + ): ClaimedEventFilter; + + "MerkleRootModified(uint256)"(epoch?: null): MerkleRootModifiedEventFilter; + MerkleRootModified(epoch?: null): MerkleRootModifiedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + claim( + index: BigNumberish, + account: string, + amount: BigNumberish, + merkleProof: BytesLike[], + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + claimMultiple( + claims: IMultipleMerkleDistributor.ClaimsStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + isClaimed( + index: BigNumberish, + epoch: BigNumberish, + overrides?: CallOverrides + ): Promise; + + merkleRoots( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rewardEscrow(overrides?: CallOverrides): Promise; + + setMerkleRootForEpoch( + merkleRoot: BytesLike, + epoch: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + token(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/PerpsV2Market.ts b/packages/sdk/src/contracts/types/PerpsV2Market.ts index fe553d5ec3..2d7ed6c78f 100644 --- a/packages/sdk/src/contracts/types/PerpsV2Market.ts +++ b/packages/sdk/src/contracts/types/PerpsV2Market.ts @@ -2,1737 +2,2039 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IPerpsV2MarketConsolidated { - export type DelayedOrderStruct = { - isOffchain: PromiseOrValue - sizeDelta: PromiseOrValue - desiredFillPrice: PromiseOrValue - targetRoundId: PromiseOrValue - commitDeposit: PromiseOrValue - keeperDeposit: PromiseOrValue - executableAtTime: PromiseOrValue - intentionTime: PromiseOrValue - trackingCode: PromiseOrValue - } - - export type DelayedOrderStructOutput = [ - boolean, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - string - ] & { - isOffchain: boolean - sizeDelta: BigNumber - desiredFillPrice: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - executableAtTime: BigNumber - intentionTime: BigNumber - trackingCode: string - } - - export type PositionStruct = { - id: PromiseOrValue - lastFundingIndex: PromiseOrValue - margin: PromiseOrValue - lastPrice: PromiseOrValue - size: PromiseOrValue - } - - export type PositionStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } + export type DelayedOrderStruct = { + isOffchain: boolean; + sizeDelta: BigNumberish; + desiredFillPrice: BigNumberish; + targetRoundId: BigNumberish; + commitDeposit: BigNumberish; + keeperDeposit: BigNumberish; + executableAtTime: BigNumberish; + intentionTime: BigNumberish; + trackingCode: BytesLike; + }; + + export type DelayedOrderStructOutput = [ + boolean, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string + ] & { + isOffchain: boolean; + sizeDelta: BigNumber; + desiredFillPrice: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + executableAtTime: BigNumber; + intentionTime: BigNumber; + trackingCode: string; + }; + + export type PositionStruct = { + id: BigNumberish; + lastFundingIndex: BigNumberish; + margin: BigNumberish; + lastPrice: BigNumberish; + size: BigNumberish; + }; + + export type PositionStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + }; } export interface PerpsV2MarketInterface extends utils.Interface { - functions: { - 'accessibleMargin(address)': FunctionFragment - 'accruedFunding(address)': FunctionFragment - 'assetPrice()': FunctionFragment - 'baseAsset()': FunctionFragment - 'canLiquidate(address)': FunctionFragment - 'cancelDelayedOrder(address)': FunctionFragment - 'cancelOffchainDelayedOrder(address)': FunctionFragment - 'closePosition(uint256)': FunctionFragment - 'closePositionWithTracking(uint256,bytes32)': FunctionFragment - 'currentFundingRate()': FunctionFragment - 'currentFundingVelocity()': FunctionFragment - 'delayedOrders(address)': FunctionFragment - 'executeDelayedOrder(address)': FunctionFragment - 'executeOffchainDelayedOrder(address,bytes[])': FunctionFragment - 'fillPrice(int256)': FunctionFragment - 'flagPosition(address)': FunctionFragment - 'forceLiquidatePosition(address)': FunctionFragment - 'fundingLastRecomputed()': FunctionFragment - 'fundingRateLastRecomputed()': FunctionFragment - 'fundingSequence(uint256)': FunctionFragment - 'fundingSequenceLength()': FunctionFragment - 'isFlagged(address)': FunctionFragment - 'liquidatePosition(address)': FunctionFragment - 'liquidationFee(address)': FunctionFragment - 'liquidationPrice(address)': FunctionFragment - 'marketDebt()': FunctionFragment - 'marketKey()': FunctionFragment - 'marketSize()': FunctionFragment - 'marketSizes()': FunctionFragment - 'marketSkew()': FunctionFragment - 'modifyPosition(int256,uint256)': FunctionFragment - 'modifyPositionWithTracking(int256,uint256,bytes32)': FunctionFragment - 'notionalValue(address)': FunctionFragment - 'orderFee(int256,uint8)': FunctionFragment - 'positions(address)': FunctionFragment - 'postTradeDetails(int256,uint256,uint8,address)': FunctionFragment - 'profitLoss(address)': FunctionFragment - 'recomputeFunding()': FunctionFragment - 'remainingMargin(address)': FunctionFragment - 'submitCloseDelayedOrderWithTracking(uint256,uint256,bytes32)': FunctionFragment - 'submitCloseOffchainDelayedOrderWithTracking(uint256,bytes32)': FunctionFragment - 'submitDelayedOrder(int256,uint256,uint256)': FunctionFragment - 'submitDelayedOrderWithTracking(int256,uint256,uint256,bytes32)': FunctionFragment - 'submitOffchainDelayedOrder(int256,uint256)': FunctionFragment - 'submitOffchainDelayedOrderWithTracking(int256,uint256,bytes32)': FunctionFragment - 'transferMargin(int256)': FunctionFragment - 'unrecordedFunding()': FunctionFragment - 'withdrawAllMargin()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'accessibleMargin' - | 'accruedFunding' - | 'assetPrice' - | 'baseAsset' - | 'canLiquidate' - | 'cancelDelayedOrder' - | 'cancelOffchainDelayedOrder' - | 'closePosition' - | 'closePositionWithTracking' - | 'currentFundingRate' - | 'currentFundingVelocity' - | 'delayedOrders' - | 'executeDelayedOrder' - | 'executeOffchainDelayedOrder' - | 'fillPrice' - | 'flagPosition' - | 'forceLiquidatePosition' - | 'fundingLastRecomputed' - | 'fundingRateLastRecomputed' - | 'fundingSequence' - | 'fundingSequenceLength' - | 'isFlagged' - | 'liquidatePosition' - | 'liquidationFee' - | 'liquidationPrice' - | 'marketDebt' - | 'marketKey' - | 'marketSize' - | 'marketSizes' - | 'marketSkew' - | 'modifyPosition' - | 'modifyPositionWithTracking' - | 'notionalValue' - | 'orderFee' - | 'positions' - | 'postTradeDetails' - | 'profitLoss' - | 'recomputeFunding' - | 'remainingMargin' - | 'submitCloseDelayedOrderWithTracking' - | 'submitCloseOffchainDelayedOrderWithTracking' - | 'submitDelayedOrder' - | 'submitDelayedOrderWithTracking' - | 'submitOffchainDelayedOrder' - | 'submitOffchainDelayedOrderWithTracking' - | 'transferMargin' - | 'unrecordedFunding' - | 'withdrawAllMargin' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'accessibleMargin', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'accruedFunding', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'assetPrice', values?: undefined): string - encodeFunctionData(functionFragment: 'baseAsset', values?: undefined): string - encodeFunctionData(functionFragment: 'canLiquidate', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'cancelDelayedOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'cancelOffchainDelayedOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'closePosition', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'closePositionWithTracking', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'currentFundingRate', values?: undefined): string - encodeFunctionData(functionFragment: 'currentFundingVelocity', values?: undefined): string - encodeFunctionData(functionFragment: 'delayedOrders', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'executeDelayedOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'executeOffchainDelayedOrder', - values: [PromiseOrValue, PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'fillPrice', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'flagPosition', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'forceLiquidatePosition', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'fundingLastRecomputed', values?: undefined): string - encodeFunctionData(functionFragment: 'fundingRateLastRecomputed', values?: undefined): string - encodeFunctionData( - functionFragment: 'fundingSequence', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'fundingSequenceLength', values?: undefined): string - encodeFunctionData(functionFragment: 'isFlagged', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'liquidatePosition', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'liquidationFee', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'liquidationPrice', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'marketDebt', values?: undefined): string - encodeFunctionData(functionFragment: 'marketKey', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSize', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSizes', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSkew', values?: undefined): string - encodeFunctionData( - functionFragment: 'modifyPosition', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'modifyPositionWithTracking', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'notionalValue', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'orderFee', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'positions', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'postTradeDetails', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData(functionFragment: 'profitLoss', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'recomputeFunding', values?: undefined): string - encodeFunctionData(functionFragment: 'remainingMargin', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'submitCloseDelayedOrderWithTracking', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'submitCloseOffchainDelayedOrderWithTracking', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'submitDelayedOrder', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'submitDelayedOrderWithTracking', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'submitOffchainDelayedOrder', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'submitOffchainDelayedOrderWithTracking', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferMargin', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'unrecordedFunding', values?: undefined): string - encodeFunctionData(functionFragment: 'withdrawAllMargin', values?: undefined): string - - decodeFunctionResult(functionFragment: 'accessibleMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'accruedFunding', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'assetPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'baseAsset', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'canLiquidate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'cancelDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'cancelOffchainDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'closePosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'closePositionWithTracking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currentFundingRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currentFundingVelocity', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'delayedOrders', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'executeDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'executeOffchainDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fillPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'flagPosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'forceLiquidatePosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingLastRecomputed', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingRateLastRecomputed', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingSequence', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingSequenceLength', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isFlagged', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidatePosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketDebt', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSize', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSizes', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSkew', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'modifyPosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'modifyPositionWithTracking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'notionalValue', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'orderFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'positions', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'postTradeDetails', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'profitLoss', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'recomputeFunding', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'remainingMargin', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'submitCloseDelayedOrderWithTracking', - data: BytesLike - ): Result - decodeFunctionResult( - functionFragment: 'submitCloseOffchainDelayedOrderWithTracking', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'submitDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'submitDelayedOrderWithTracking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'submitOffchainDelayedOrder', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'submitOffchainDelayedOrderWithTracking', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'transferMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'unrecordedFunding', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'withdrawAllMargin', data: BytesLike): Result - - events: { - 'DelayedOrderRemoved(address,bool,uint256,int256,uint256,uint256,uint256,bytes32)': EventFragment - 'DelayedOrderSubmitted(address,bool,int256,uint256,uint256,uint256,uint256,uint256,bytes32)': EventFragment - 'FundingRecomputed(int256,int256,uint256,uint256)': EventFragment - 'MarginTransferred(address,int256)': EventFragment - 'PerpsTracking(bytes32,bytes32,bytes32,int256,uint256)': EventFragment - 'PositionFlagged(uint256,address,address,uint256)': EventFragment - 'PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)': EventFragment - 'PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256,int256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'DelayedOrderRemoved'): EventFragment - getEvent(nameOrSignatureOrTopic: 'DelayedOrderSubmitted'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FundingRecomputed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MarginTransferred'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PerpsTracking'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PositionFlagged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PositionLiquidated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PositionModified'): EventFragment + functions: { + "accessibleMargin(address)": FunctionFragment; + "accruedFunding(address)": FunctionFragment; + "assetPrice()": FunctionFragment; + "baseAsset()": FunctionFragment; + "canLiquidate(address)": FunctionFragment; + "cancelDelayedOrder(address)": FunctionFragment; + "cancelOffchainDelayedOrder(address)": FunctionFragment; + "closePosition(uint256)": FunctionFragment; + "closePositionWithTracking(uint256,bytes32)": FunctionFragment; + "currentFundingRate()": FunctionFragment; + "currentFundingVelocity()": FunctionFragment; + "delayedOrders(address)": FunctionFragment; + "executeDelayedOrder(address)": FunctionFragment; + "executeOffchainDelayedOrder(address,bytes[])": FunctionFragment; + "fillPrice(int256)": FunctionFragment; + "flagPosition(address)": FunctionFragment; + "forceLiquidatePosition(address)": FunctionFragment; + "fundingLastRecomputed()": FunctionFragment; + "fundingRateLastRecomputed()": FunctionFragment; + "fundingSequence(uint256)": FunctionFragment; + "fundingSequenceLength()": FunctionFragment; + "isFlagged(address)": FunctionFragment; + "liquidatePosition(address)": FunctionFragment; + "liquidationFee(address)": FunctionFragment; + "liquidationPrice(address)": FunctionFragment; + "marketDebt()": FunctionFragment; + "marketKey()": FunctionFragment; + "marketSize()": FunctionFragment; + "marketSizes()": FunctionFragment; + "marketSkew()": FunctionFragment; + "modifyPosition(int256,uint256)": FunctionFragment; + "modifyPositionWithTracking(int256,uint256,bytes32)": FunctionFragment; + "notionalValue(address)": FunctionFragment; + "orderFee(int256,uint8)": FunctionFragment; + "positions(address)": FunctionFragment; + "postTradeDetails(int256,uint256,uint8,address)": FunctionFragment; + "profitLoss(address)": FunctionFragment; + "recomputeFunding()": FunctionFragment; + "remainingMargin(address)": FunctionFragment; + "submitCloseDelayedOrderWithTracking(uint256,uint256,bytes32)": FunctionFragment; + "submitCloseOffchainDelayedOrderWithTracking(uint256,bytes32)": FunctionFragment; + "submitDelayedOrder(int256,uint256,uint256)": FunctionFragment; + "submitDelayedOrderWithTracking(int256,uint256,uint256,bytes32)": FunctionFragment; + "submitOffchainDelayedOrder(int256,uint256)": FunctionFragment; + "submitOffchainDelayedOrderWithTracking(int256,uint256,bytes32)": FunctionFragment; + "transferMargin(int256)": FunctionFragment; + "unrecordedFunding()": FunctionFragment; + "withdrawAllMargin()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "accessibleMargin" + | "accruedFunding" + | "assetPrice" + | "baseAsset" + | "canLiquidate" + | "cancelDelayedOrder" + | "cancelOffchainDelayedOrder" + | "closePosition" + | "closePositionWithTracking" + | "currentFundingRate" + | "currentFundingVelocity" + | "delayedOrders" + | "executeDelayedOrder" + | "executeOffchainDelayedOrder" + | "fillPrice" + | "flagPosition" + | "forceLiquidatePosition" + | "fundingLastRecomputed" + | "fundingRateLastRecomputed" + | "fundingSequence" + | "fundingSequenceLength" + | "isFlagged" + | "liquidatePosition" + | "liquidationFee" + | "liquidationPrice" + | "marketDebt" + | "marketKey" + | "marketSize" + | "marketSizes" + | "marketSkew" + | "modifyPosition" + | "modifyPositionWithTracking" + | "notionalValue" + | "orderFee" + | "positions" + | "postTradeDetails" + | "profitLoss" + | "recomputeFunding" + | "remainingMargin" + | "submitCloseDelayedOrderWithTracking" + | "submitCloseOffchainDelayedOrderWithTracking" + | "submitDelayedOrder" + | "submitDelayedOrderWithTracking" + | "submitOffchainDelayedOrder" + | "submitOffchainDelayedOrderWithTracking" + | "transferMargin" + | "unrecordedFunding" + | "withdrawAllMargin" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "accessibleMargin", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "accruedFunding", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "assetPrice", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "baseAsset", values?: undefined): string; + encodeFunctionData( + functionFragment: "canLiquidate", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "cancelDelayedOrder", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "cancelOffchainDelayedOrder", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "closePosition", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "closePositionWithTracking", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "currentFundingRate", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "currentFundingVelocity", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "delayedOrders", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "executeDelayedOrder", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "executeOffchainDelayedOrder", + values: [string, BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "fillPrice", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "flagPosition", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "forceLiquidatePosition", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "fundingLastRecomputed", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "fundingRateLastRecomputed", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "fundingSequence", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fundingSequenceLength", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "isFlagged", values: [string]): string; + encodeFunctionData( + functionFragment: "liquidatePosition", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "liquidationFee", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "liquidationPrice", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "marketDebt", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "marketKey", values?: undefined): string; + encodeFunctionData( + functionFragment: "marketSize", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "marketSizes", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "marketSkew", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "modifyPosition", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "modifyPositionWithTracking", + values: [BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "notionalValue", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "orderFee", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "positions", values: [string]): string; + encodeFunctionData( + functionFragment: "postTradeDetails", + values: [BigNumberish, BigNumberish, BigNumberish, string] + ): string; + encodeFunctionData(functionFragment: "profitLoss", values: [string]): string; + encodeFunctionData( + functionFragment: "recomputeFunding", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "remainingMargin", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "submitCloseDelayedOrderWithTracking", + values: [BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "submitCloseOffchainDelayedOrderWithTracking", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "submitDelayedOrder", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "submitDelayedOrderWithTracking", + values: [BigNumberish, BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "submitOffchainDelayedOrder", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "submitOffchainDelayedOrderWithTracking", + values: [BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "transferMargin", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "unrecordedFunding", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "withdrawAllMargin", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "accessibleMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "accruedFunding", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "assetPrice", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "baseAsset", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "canLiquidate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "cancelDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "cancelOffchainDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "closePosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "closePositionWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentFundingRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentFundingVelocity", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "delayedOrders", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "executeDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "executeOffchainDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "fillPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "flagPosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "forceLiquidatePosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingLastRecomputed", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingRateLastRecomputed", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingSequence", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingSequenceLength", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isFlagged", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "liquidatePosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationPrice", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "marketDebt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "marketKey", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "marketSize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "marketSizes", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "marketSkew", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "modifyPosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "modifyPositionWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "notionalValue", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "orderFee", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "positions", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "postTradeDetails", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "profitLoss", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recomputeFunding", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "remainingMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitCloseDelayedOrderWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitCloseOffchainDelayedOrderWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitDelayedOrderWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitOffchainDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitOffchainDelayedOrderWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "unrecordedFunding", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "withdrawAllMargin", + data: BytesLike + ): Result; + + events: { + "DelayedOrderRemoved(address,bool,uint256,int256,uint256,uint256,uint256,bytes32)": EventFragment; + "DelayedOrderSubmitted(address,bool,int256,uint256,uint256,uint256,uint256,uint256,bytes32)": EventFragment; + "FundingRecomputed(int256,int256,uint256,uint256)": EventFragment; + "MarginTransferred(address,int256)": EventFragment; + "PerpsTracking(bytes32,bytes32,bytes32,int256,uint256)": EventFragment; + "PositionFlagged(uint256,address,address,uint256)": EventFragment; + "PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)": EventFragment; + "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256,int256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "DelayedOrderRemoved"): EventFragment; + getEvent(nameOrSignatureOrTopic: "DelayedOrderSubmitted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FundingRecomputed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MarginTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PerpsTracking"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionFlagged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionLiquidated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionModified"): EventFragment; } export interface DelayedOrderRemovedEventObject { - account: string - isOffchain: boolean - currentRoundId: BigNumber - sizeDelta: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - trackingCode: string + account: string; + isOffchain: boolean; + currentRoundId: BigNumber; + sizeDelta: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + trackingCode: string; } export type DelayedOrderRemovedEvent = TypedEvent< - [string, boolean, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, string], - DelayedOrderRemovedEventObject -> - -export type DelayedOrderRemovedEventFilter = TypedEventFilter + [ + string, + boolean, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string + ], + DelayedOrderRemovedEventObject +>; + +export type DelayedOrderRemovedEventFilter = + TypedEventFilter; export interface DelayedOrderSubmittedEventObject { - account: string - isOffchain: boolean - sizeDelta: BigNumber - targetRoundId: BigNumber - intentionTime: BigNumber - executableAtTime: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - trackingCode: string + account: string; + isOffchain: boolean; + sizeDelta: BigNumber; + targetRoundId: BigNumber; + intentionTime: BigNumber; + executableAtTime: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + trackingCode: string; } export type DelayedOrderSubmittedEvent = TypedEvent< - [string, boolean, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, string], - DelayedOrderSubmittedEventObject -> - -export type DelayedOrderSubmittedEventFilter = TypedEventFilter + [ + string, + boolean, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string + ], + DelayedOrderSubmittedEventObject +>; + +export type DelayedOrderSubmittedEventFilter = + TypedEventFilter; export interface FundingRecomputedEventObject { - funding: BigNumber - fundingRate: BigNumber - index: BigNumber - timestamp: BigNumber + funding: BigNumber; + fundingRate: BigNumber; + index: BigNumber; + timestamp: BigNumber; } export type FundingRecomputedEvent = TypedEvent< - [BigNumber, BigNumber, BigNumber, BigNumber], - FundingRecomputedEventObject -> + [BigNumber, BigNumber, BigNumber, BigNumber], + FundingRecomputedEventObject +>; -export type FundingRecomputedEventFilter = TypedEventFilter +export type FundingRecomputedEventFilter = + TypedEventFilter; export interface MarginTransferredEventObject { - account: string - marginDelta: BigNumber + account: string; + marginDelta: BigNumber; } -export type MarginTransferredEvent = TypedEvent<[string, BigNumber], MarginTransferredEventObject> +export type MarginTransferredEvent = TypedEvent< + [string, BigNumber], + MarginTransferredEventObject +>; -export type MarginTransferredEventFilter = TypedEventFilter +export type MarginTransferredEventFilter = + TypedEventFilter; export interface PerpsTrackingEventObject { - trackingCode: string - baseAsset: string - marketKey: string - sizeDelta: BigNumber - fee: BigNumber + trackingCode: string; + baseAsset: string; + marketKey: string; + sizeDelta: BigNumber; + fee: BigNumber; } export type PerpsTrackingEvent = TypedEvent< - [string, string, string, BigNumber, BigNumber], - PerpsTrackingEventObject -> + [string, string, string, BigNumber, BigNumber], + PerpsTrackingEventObject +>; -export type PerpsTrackingEventFilter = TypedEventFilter +export type PerpsTrackingEventFilter = TypedEventFilter; export interface PositionFlaggedEventObject { - id: BigNumber - account: string - flagger: string - timestamp: BigNumber + id: BigNumber; + account: string; + flagger: string; + timestamp: BigNumber; } export type PositionFlaggedEvent = TypedEvent< - [BigNumber, string, string, BigNumber], - PositionFlaggedEventObject -> + [BigNumber, string, string, BigNumber], + PositionFlaggedEventObject +>; -export type PositionFlaggedEventFilter = TypedEventFilter +export type PositionFlaggedEventFilter = TypedEventFilter; export interface PositionLiquidatedEventObject { - id: BigNumber - account: string - liquidator: string - size: BigNumber - price: BigNumber - flaggerFee: BigNumber - liquidatorFee: BigNumber - stakersFee: BigNumber + id: BigNumber; + account: string; + liquidator: string; + size: BigNumber; + price: BigNumber; + flaggerFee: BigNumber; + liquidatorFee: BigNumber; + stakersFee: BigNumber; } export type PositionLiquidatedEvent = TypedEvent< - [BigNumber, string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], - PositionLiquidatedEventObject -> - -export type PositionLiquidatedEventFilter = TypedEventFilter + [ + BigNumber, + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ], + PositionLiquidatedEventObject +>; + +export type PositionLiquidatedEventFilter = + TypedEventFilter; export interface PositionModifiedEventObject { - id: BigNumber - account: string - margin: BigNumber - size: BigNumber - tradeSize: BigNumber - lastPrice: BigNumber - fundingIndex: BigNumber - fee: BigNumber - skew: BigNumber + id: BigNumber; + account: string; + margin: BigNumber; + size: BigNumber; + tradeSize: BigNumber; + lastPrice: BigNumber; + fundingIndex: BigNumber; + fee: BigNumber; + skew: BigNumber; } export type PositionModifiedEvent = TypedEvent< - [BigNumber, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], - PositionModifiedEventObject -> - -export type PositionModifiedEventFilter = TypedEventFilter + [ + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ], + PositionModifiedEventObject +>; + +export type PositionModifiedEventFilter = + TypedEventFilter; export interface PerpsV2Market extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: PerpsV2MarketInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise<[string] & { key: string }> - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]> - - cancelDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - cancelOffchainDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition( - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePositionWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise<[BigNumber] & { fundingRate: BigNumber }> - - currentFundingVelocity( - overrides?: CallOverrides - ): Promise<[BigNumber] & { fundingVelocity: BigNumber }> - - delayedOrders( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[IPerpsV2MarketConsolidated.DelayedOrderStructOutput]> - - executeDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executeOffchainDelayedOrder( - account: PromiseOrValue, - priceUpdateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - flagPosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - forceLiquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise<[number] & { timestamp: number }> - - fundingRateLastRecomputed( - overrides?: CallOverrides - ): Promise<[BigNumber] & { fundingRate: BigNumber }> - - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { netFunding: BigNumber }> - - fundingSequenceLength(overrides?: CallOverrides): Promise<[BigNumber] & { length: BigNumber }> - - isFlagged(account: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]> - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; isInvalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise<[string] & { key: string }> - - marketSize(overrides?: CallOverrides): Promise<[BigNumber] & { size: BigNumber }> - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise<[BigNumber] & { skew: BigNumber }> - - modifyPosition( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[IPerpsV2MarketConsolidated.PositionStructOutput]> - - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> - - recomputeFunding( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> - - submitCloseDelayedOrderWithTracking( - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitCloseOffchainDelayedOrderWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrder( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrder( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - withdrawAllMargin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise - - cancelDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - cancelOffchainDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition( - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePositionWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - currentFundingVelocity(overrides?: CallOverrides): Promise - - delayedOrders( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - executeDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executeOffchainDelayedOrder( - account: PromiseOrValue, - priceUpdateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - flagPosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - forceLiquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingRateLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isFlagged(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; isInvalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise - - modifyPosition( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> - - recomputeFunding( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> - - submitCloseDelayedOrderWithTracking( - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitCloseOffchainDelayedOrderWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrder( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrder( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - withdrawAllMargin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise - - cancelDelayedOrder(account: PromiseOrValue, overrides?: CallOverrides): Promise - - cancelOffchainDelayedOrder( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - closePosition( - desiredFillPrice: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - closePositionWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - currentFundingVelocity(overrides?: CallOverrides): Promise - - delayedOrders( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - executeDelayedOrder(account: PromiseOrValue, overrides?: CallOverrides): Promise - - executeOffchainDelayedOrder( - account: PromiseOrValue, - priceUpdateData: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - flagPosition(account: PromiseOrValue, overrides?: CallOverrides): Promise - - forceLiquidatePosition( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingRateLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isFlagged(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidatePosition(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; isInvalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise - - modifyPosition( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> - - recomputeFunding(overrides?: CallOverrides): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> - - submitCloseDelayedOrderWithTracking( - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - submitCloseOffchainDelayedOrderWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - submitDelayedOrder( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - submitDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - submitOffchainDelayedOrder( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - submitOffchainDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - withdrawAllMargin(overrides?: CallOverrides): Promise - } - - filters: { - 'DelayedOrderRemoved(address,bool,uint256,int256,uint256,uint256,uint256,bytes32)'( - account?: PromiseOrValue | null, - isOffchain?: null, - currentRoundId?: null, - sizeDelta?: null, - targetRoundId?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): DelayedOrderRemovedEventFilter - DelayedOrderRemoved( - account?: PromiseOrValue | null, - isOffchain?: null, - currentRoundId?: null, - sizeDelta?: null, - targetRoundId?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): DelayedOrderRemovedEventFilter - - 'DelayedOrderSubmitted(address,bool,int256,uint256,uint256,uint256,uint256,uint256,bytes32)'( - account?: PromiseOrValue | null, - isOffchain?: null, - sizeDelta?: null, - targetRoundId?: null, - intentionTime?: null, - executableAtTime?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): DelayedOrderSubmittedEventFilter - DelayedOrderSubmitted( - account?: PromiseOrValue | null, - isOffchain?: null, - sizeDelta?: null, - targetRoundId?: null, - intentionTime?: null, - executableAtTime?: null, - commitDeposit?: null, - keeperDeposit?: null, - trackingCode?: null - ): DelayedOrderSubmittedEventFilter - - 'FundingRecomputed(int256,int256,uint256,uint256)'( - funding?: null, - fundingRate?: null, - index?: null, - timestamp?: null - ): FundingRecomputedEventFilter - FundingRecomputed( - funding?: null, - fundingRate?: null, - index?: null, - timestamp?: null - ): FundingRecomputedEventFilter - - 'MarginTransferred(address,int256)'( - account?: PromiseOrValue | null, - marginDelta?: null - ): MarginTransferredEventFilter - MarginTransferred( - account?: PromiseOrValue | null, - marginDelta?: null - ): MarginTransferredEventFilter - - 'PerpsTracking(bytes32,bytes32,bytes32,int256,uint256)'( - trackingCode?: PromiseOrValue | null, - baseAsset?: null, - marketKey?: null, - sizeDelta?: null, - fee?: null - ): PerpsTrackingEventFilter - PerpsTracking( - trackingCode?: PromiseOrValue | null, - baseAsset?: null, - marketKey?: null, - sizeDelta?: null, - fee?: null - ): PerpsTrackingEventFilter - - 'PositionFlagged(uint256,address,address,uint256)'( - id?: null, - account?: null, - flagger?: null, - timestamp?: null - ): PositionFlaggedEventFilter - PositionFlagged( - id?: null, - account?: null, - flagger?: null, - timestamp?: null - ): PositionFlaggedEventFilter - - 'PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)'( - id?: null, - account?: null, - liquidator?: null, - size?: null, - price?: null, - flaggerFee?: null, - liquidatorFee?: null, - stakersFee?: null - ): PositionLiquidatedEventFilter - PositionLiquidated( - id?: null, - account?: null, - liquidator?: null, - size?: null, - price?: null, - flaggerFee?: null, - liquidatorFee?: null, - stakersFee?: null - ): PositionLiquidatedEventFilter - - 'PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256,int256)'( - id?: PromiseOrValue | null, - account?: PromiseOrValue | null, - margin?: null, - size?: null, - tradeSize?: null, - lastPrice?: null, - fundingIndex?: null, - fee?: null, - skew?: null - ): PositionModifiedEventFilter - PositionModified( - id?: PromiseOrValue | null, - account?: PromiseOrValue | null, - margin?: null, - size?: null, - tradeSize?: null, - lastPrice?: null, - fundingIndex?: null, - fee?: null, - skew?: null - ): PositionModifiedEventFilter - } - - estimateGas: { - accessibleMargin(account: PromiseOrValue, overrides?: CallOverrides): Promise - - accruedFunding(account: PromiseOrValue, overrides?: CallOverrides): Promise - - assetPrice(overrides?: CallOverrides): Promise - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise - - cancelDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - cancelOffchainDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition( - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePositionWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - currentFundingVelocity(overrides?: CallOverrides): Promise - - delayedOrders(account: PromiseOrValue, overrides?: CallOverrides): Promise - - executeDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executeOffchainDelayedOrder( - account: PromiseOrValue, - priceUpdateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - flagPosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - forceLiquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingRateLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isFlagged(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationPrice(account: PromiseOrValue, overrides?: CallOverrides): Promise - - marketDebt(overrides?: CallOverrides): Promise - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes(overrides?: CallOverrides): Promise - - marketSkew(overrides?: CallOverrides): Promise - - modifyPosition( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - notionalValue(account: PromiseOrValue, overrides?: CallOverrides): Promise - - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positions(account: PromiseOrValue, overrides?: CallOverrides): Promise - - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - profitLoss(account: PromiseOrValue, overrides?: CallOverrides): Promise - - recomputeFunding(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - remainingMargin(account: PromiseOrValue, overrides?: CallOverrides): Promise - - submitCloseDelayedOrderWithTracking( - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitCloseOffchainDelayedOrderWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrder( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrder( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - unrecordedFunding(overrides?: CallOverrides): Promise - - withdrawAllMargin(overrides?: Overrides & { from?: PromiseOrValue }): Promise - } - - populateTransaction: { - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - assetPrice(overrides?: CallOverrides): Promise - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - cancelDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - cancelOffchainDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePosition( - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - closePositionWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - currentFundingVelocity(overrides?: CallOverrides): Promise - - delayedOrders( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - executeDelayedOrder( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - executeOffchainDelayedOrder( - account: PromiseOrValue, - priceUpdateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - flagPosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - forceLiquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingRateLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isFlagged( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidatePosition( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidationFee( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketDebt(overrides?: CallOverrides): Promise - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes(overrides?: CallOverrides): Promise - - marketSkew(overrides?: CallOverrides): Promise - - modifyPosition( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - modifyPositionWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - recomputeFunding( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - submitCloseDelayedOrderWithTracking( - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitCloseOffchainDelayedOrderWithTracking( - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrder( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredTimeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrder( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - submitOffchainDelayedOrderWithTracking( - sizeDelta: PromiseOrValue, - desiredFillPrice: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferMargin( - marginDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - unrecordedFunding(overrides?: CallOverrides): Promise - - withdrawAllMargin( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PerpsV2MarketInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise<[string] & { key: string }>; + + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + cancelDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + cancelOffchainDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate( + overrides?: CallOverrides + ): Promise<[BigNumber] & { fundingRate: BigNumber }>; + + currentFundingVelocity( + overrides?: CallOverrides + ): Promise<[BigNumber] & { fundingVelocity: BigNumber }>; + + delayedOrders( + account: string, + overrides?: CallOverrides + ): Promise<[IPerpsV2MarketConsolidated.DelayedOrderStructOutput]>; + + executeDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + executeOffchainDelayedOrder( + account: string, + priceUpdateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + flagPosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + forceLiquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed( + overrides?: CallOverrides + ): Promise<[number] & { timestamp: number }>; + + fundingRateLastRecomputed( + overrides?: CallOverrides + ): Promise<[BigNumber] & { fundingRate: BigNumber }>; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { netFunding: BigNumber }>; + + fundingSequenceLength( + overrides?: CallOverrides + ): Promise<[BigNumber] & { length: BigNumber }>; + + isFlagged(account: string, overrides?: CallOverrides): Promise<[boolean]>; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; isInvalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise<[string] & { key: string }>; + + marketSize( + overrides?: CallOverrides + ): Promise<[BigNumber] & { size: BigNumber }>; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew( + overrides?: CallOverrides + ): Promise<[BigNumber] & { skew: BigNumber }>; + + modifyPosition( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; + + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; + + positions( + account: string, + overrides?: CallOverrides + ): Promise<[IPerpsV2MarketConsolidated.PositionStructOutput]>; + + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; + + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; + + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrder( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrder( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + }; + + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate(account: string, overrides?: CallOverrides): Promise; + + cancelDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + cancelOffchainDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + currentFundingVelocity(overrides?: CallOverrides): Promise; + + delayedOrders( + account: string, + overrides?: CallOverrides + ): Promise; + + executeDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + executeOffchainDelayedOrder( + account: string, + priceUpdateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + flagPosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + forceLiquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingRateLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isFlagged(account: string, overrides?: CallOverrides): Promise; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; isInvalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; + + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; + + positions( + account: string, + overrides?: CallOverrides + ): Promise; + + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; + + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; + + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrder( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrder( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate(account: string, overrides?: CallOverrides): Promise; + + cancelDelayedOrder( + account: string, + overrides?: CallOverrides + ): Promise; + + cancelOffchainDelayedOrder( + account: string, + overrides?: CallOverrides + ): Promise; + + closePosition( + desiredFillPrice: BigNumberish, + overrides?: CallOverrides + ): Promise; + + closePositionWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + currentFundingVelocity(overrides?: CallOverrides): Promise; + + delayedOrders( + account: string, + overrides?: CallOverrides + ): Promise; + + executeDelayedOrder( + account: string, + overrides?: CallOverrides + ): Promise; + + executeOffchainDelayedOrder( + account: string, + priceUpdateData: BytesLike[], + overrides?: CallOverrides + ): Promise; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + flagPosition(account: string, overrides?: CallOverrides): Promise; + + forceLiquidatePosition( + account: string, + overrides?: CallOverrides + ): Promise; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingRateLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isFlagged(account: string, overrides?: CallOverrides): Promise; + + liquidatePosition( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; isInvalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: CallOverrides + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; + + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; + + positions( + account: string, + overrides?: CallOverrides + ): Promise; + + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; + + recomputeFunding(overrides?: CallOverrides): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; + + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + submitDelayedOrder( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: CallOverrides + ): Promise; + + submitDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + submitOffchainDelayedOrder( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: CallOverrides + ): Promise; + + submitOffchainDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + withdrawAllMargin(overrides?: CallOverrides): Promise; + }; + + filters: { + "DelayedOrderRemoved(address,bool,uint256,int256,uint256,uint256,uint256,bytes32)"( + account?: string | null, + isOffchain?: null, + currentRoundId?: null, + sizeDelta?: null, + targetRoundId?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): DelayedOrderRemovedEventFilter; + DelayedOrderRemoved( + account?: string | null, + isOffchain?: null, + currentRoundId?: null, + sizeDelta?: null, + targetRoundId?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): DelayedOrderRemovedEventFilter; + + "DelayedOrderSubmitted(address,bool,int256,uint256,uint256,uint256,uint256,uint256,bytes32)"( + account?: string | null, + isOffchain?: null, + sizeDelta?: null, + targetRoundId?: null, + intentionTime?: null, + executableAtTime?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): DelayedOrderSubmittedEventFilter; + DelayedOrderSubmitted( + account?: string | null, + isOffchain?: null, + sizeDelta?: null, + targetRoundId?: null, + intentionTime?: null, + executableAtTime?: null, + commitDeposit?: null, + keeperDeposit?: null, + trackingCode?: null + ): DelayedOrderSubmittedEventFilter; + + "FundingRecomputed(int256,int256,uint256,uint256)"( + funding?: null, + fundingRate?: null, + index?: null, + timestamp?: null + ): FundingRecomputedEventFilter; + FundingRecomputed( + funding?: null, + fundingRate?: null, + index?: null, + timestamp?: null + ): FundingRecomputedEventFilter; + + "MarginTransferred(address,int256)"( + account?: string | null, + marginDelta?: null + ): MarginTransferredEventFilter; + MarginTransferred( + account?: string | null, + marginDelta?: null + ): MarginTransferredEventFilter; + + "PerpsTracking(bytes32,bytes32,bytes32,int256,uint256)"( + trackingCode?: BytesLike | null, + baseAsset?: null, + marketKey?: null, + sizeDelta?: null, + fee?: null + ): PerpsTrackingEventFilter; + PerpsTracking( + trackingCode?: BytesLike | null, + baseAsset?: null, + marketKey?: null, + sizeDelta?: null, + fee?: null + ): PerpsTrackingEventFilter; + + "PositionFlagged(uint256,address,address,uint256)"( + id?: null, + account?: null, + flagger?: null, + timestamp?: null + ): PositionFlaggedEventFilter; + PositionFlagged( + id?: null, + account?: null, + flagger?: null, + timestamp?: null + ): PositionFlaggedEventFilter; + + "PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)"( + id?: null, + account?: null, + liquidator?: null, + size?: null, + price?: null, + flaggerFee?: null, + liquidatorFee?: null, + stakersFee?: null + ): PositionLiquidatedEventFilter; + PositionLiquidated( + id?: null, + account?: null, + liquidator?: null, + size?: null, + price?: null, + flaggerFee?: null, + liquidatorFee?: null, + stakersFee?: null + ): PositionLiquidatedEventFilter; + + "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256,int256)"( + id?: BigNumberish | null, + account?: string | null, + margin?: null, + size?: null, + tradeSize?: null, + lastPrice?: null, + fundingIndex?: null, + fee?: null, + skew?: null + ): PositionModifiedEventFilter; + PositionModified( + id?: BigNumberish | null, + account?: string | null, + margin?: null, + size?: null, + tradeSize?: null, + lastPrice?: null, + fundingIndex?: null, + fee?: null, + skew?: null + ): PositionModifiedEventFilter; + }; + + estimateGas: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise; + + assetPrice(overrides?: CallOverrides): Promise; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise; + + cancelDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + cancelOffchainDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + currentFundingVelocity(overrides?: CallOverrides): Promise; + + delayedOrders( + account: string, + overrides?: CallOverrides + ): Promise; + + executeDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + executeOffchainDelayedOrder( + account: string, + priceUpdateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + flagPosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + forceLiquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingRateLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isFlagged(account: string, overrides?: CallOverrides): Promise; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise; + + marketDebt(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes(overrides?: CallOverrides): Promise; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise; + + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise; + + positions(account: string, overrides?: CallOverrides): Promise; + + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise; + + profitLoss(account: string, overrides?: CallOverrides): Promise; + + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise; + + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrder( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrder( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + unrecordedFunding(overrides?: CallOverrides): Promise; + + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise; + + assetPrice(overrides?: CallOverrides): Promise; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise; + + cancelDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + cancelOffchainDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + closePosition( + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + closePositionWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + currentFundingRate( + overrides?: CallOverrides + ): Promise; + + currentFundingVelocity( + overrides?: CallOverrides + ): Promise; + + delayedOrders( + account: string, + overrides?: CallOverrides + ): Promise; + + executeDelayedOrder( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + executeOffchainDelayedOrder( + account: string, + priceUpdateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + flagPosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + forceLiquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + fundingLastRecomputed( + overrides?: CallOverrides + ): Promise; + + fundingRateLastRecomputed( + overrides?: CallOverrides + ): Promise; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength( + overrides?: CallOverrides + ): Promise; + + isFlagged( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidatePosition( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise; + + marketDebt(overrides?: CallOverrides): Promise; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes(overrides?: CallOverrides): Promise; + + marketSkew(overrides?: CallOverrides): Promise; + + modifyPosition( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + modifyPositionWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise; + + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise; + + positions( + account: string, + overrides?: CallOverrides + ): Promise; + + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise; + + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise; + + recomputeFunding( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise; + + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrder( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredTimeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrder( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitOffchainDelayedOrderWithTracking( + sizeDelta: BigNumberish, + desiredFillPrice: BigNumberish, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferMargin( + marginDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + unrecordedFunding(overrides?: CallOverrides): Promise; + + withdrawAllMargin( + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/PerpsV2MarketData.ts b/packages/sdk/src/contracts/types/PerpsV2MarketData.ts index e40b6cb401..cc4cc45a4e 100644 --- a/packages/sdk/src/contracts/types/PerpsV2MarketData.ts +++ b/packages/sdk/src/contracts/types/PerpsV2MarketData.ts @@ -2,648 +2,718 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace PerpsV2MarketData { - export type FeeRatesStruct = { - takerFee: PromiseOrValue - makerFee: PromiseOrValue - takerFeeDelayedOrder: PromiseOrValue - makerFeeDelayedOrder: PromiseOrValue - takerFeeOffchainDelayedOrder: PromiseOrValue - makerFeeOffchainDelayedOrder: PromiseOrValue - } - - export type FeeRatesStructOutput = [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeDelayedOrder: BigNumber - makerFeeDelayedOrder: BigNumber - takerFeeOffchainDelayedOrder: BigNumber - makerFeeOffchainDelayedOrder: BigNumber - } - - export type MarketSummaryStruct = { - market: PromiseOrValue - asset: PromiseOrValue - key: PromiseOrValue - maxLeverage: PromiseOrValue - price: PromiseOrValue - marketSize: PromiseOrValue - marketSkew: PromiseOrValue - marketDebt: PromiseOrValue - currentFundingRate: PromiseOrValue - currentFundingVelocity: PromiseOrValue - feeRates: PerpsV2MarketData.FeeRatesStruct - } - - export type MarketSummaryStructOutput = [ - string, - string, - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - PerpsV2MarketData.FeeRatesStructOutput - ] & { - market: string - asset: string - key: string - maxLeverage: BigNumber - price: BigNumber - marketSize: BigNumber - marketSkew: BigNumber - marketDebt: BigNumber - currentFundingRate: BigNumber - currentFundingVelocity: BigNumber - feeRates: PerpsV2MarketData.FeeRatesStructOutput - } - - export type FuturesGlobalsStruct = { - minInitialMargin: PromiseOrValue - liquidationFeeRatio: PromiseOrValue - minKeeperFee: PromiseOrValue - maxKeeperFee: PromiseOrValue - } - - export type FuturesGlobalsStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber] & { - minInitialMargin: BigNumber - liquidationFeeRatio: BigNumber - minKeeperFee: BigNumber - maxKeeperFee: BigNumber - } - - export type MarketLimitsStruct = { - maxLeverage: PromiseOrValue - maxMarketValue: PromiseOrValue - } - - export type MarketLimitsStructOutput = [BigNumber, BigNumber] & { - maxLeverage: BigNumber - maxMarketValue: BigNumber - } - - export type FundingParametersStruct = { - maxFundingVelocity: PromiseOrValue - skewScale: PromiseOrValue - } - - export type FundingParametersStructOutput = [BigNumber, BigNumber] & { - maxFundingVelocity: BigNumber - skewScale: BigNumber - } - - export type SidesStruct = { - long: PromiseOrValue - short: PromiseOrValue - } - - export type SidesStructOutput = [BigNumber, BigNumber] & { - long: BigNumber - short: BigNumber - } - - export type MarketSizeDetailsStruct = { - marketSize: PromiseOrValue - sides: PerpsV2MarketData.SidesStruct - marketDebt: PromiseOrValue - marketSkew: PromiseOrValue - } - - export type MarketSizeDetailsStructOutput = [ - BigNumber, - PerpsV2MarketData.SidesStructOutput, - BigNumber, - BigNumber - ] & { - marketSize: BigNumber - sides: PerpsV2MarketData.SidesStructOutput - marketDebt: BigNumber - marketSkew: BigNumber - } - - export type PriceDetailsStruct = { - price: PromiseOrValue - invalid: PromiseOrValue - } - - export type PriceDetailsStructOutput = [BigNumber, boolean] & { - price: BigNumber - invalid: boolean - } - - export type MarketDataStruct = { - market: PromiseOrValue - baseAsset: PromiseOrValue - marketKey: PromiseOrValue - feeRates: PerpsV2MarketData.FeeRatesStruct - limits: PerpsV2MarketData.MarketLimitsStruct - fundingParameters: PerpsV2MarketData.FundingParametersStruct - marketSizeDetails: PerpsV2MarketData.MarketSizeDetailsStruct - priceDetails: PerpsV2MarketData.PriceDetailsStruct - } - - export type MarketDataStructOutput = [ - string, - string, - string, - PerpsV2MarketData.FeeRatesStructOutput, - PerpsV2MarketData.MarketLimitsStructOutput, - PerpsV2MarketData.FundingParametersStructOutput, - PerpsV2MarketData.MarketSizeDetailsStructOutput, - PerpsV2MarketData.PriceDetailsStructOutput - ] & { - market: string - baseAsset: string - marketKey: string - feeRates: PerpsV2MarketData.FeeRatesStructOutput - limits: PerpsV2MarketData.MarketLimitsStructOutput - fundingParameters: PerpsV2MarketData.FundingParametersStructOutput - marketSizeDetails: PerpsV2MarketData.MarketSizeDetailsStructOutput - priceDetails: PerpsV2MarketData.PriceDetailsStructOutput - } - - export type PositionDataStruct = { - position: IPerpsV2MarketBaseTypes.PositionStruct - notionalValue: PromiseOrValue - profitLoss: PromiseOrValue - accruedFunding: PromiseOrValue - remainingMargin: PromiseOrValue - accessibleMargin: PromiseOrValue - liquidationPrice: PromiseOrValue - canLiquidatePosition: PromiseOrValue - } - - export type PositionDataStructOutput = [ - IPerpsV2MarketBaseTypes.PositionStructOutput, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - boolean - ] & { - position: IPerpsV2MarketBaseTypes.PositionStructOutput - notionalValue: BigNumber - profitLoss: BigNumber - accruedFunding: BigNumber - remainingMargin: BigNumber - accessibleMargin: BigNumber - liquidationPrice: BigNumber - canLiquidatePosition: boolean - } + export type FeeRatesStruct = { + takerFee: BigNumberish; + makerFee: BigNumberish; + takerFeeDelayedOrder: BigNumberish; + makerFeeDelayedOrder: BigNumberish; + takerFeeOffchainDelayedOrder: BigNumberish; + makerFeeOffchainDelayedOrder: BigNumberish; + }; + + export type FeeRatesStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeDelayedOrder: BigNumber; + makerFeeDelayedOrder: BigNumber; + takerFeeOffchainDelayedOrder: BigNumber; + makerFeeOffchainDelayedOrder: BigNumber; + }; + + export type MarketSummaryStruct = { + market: string; + asset: BytesLike; + key: BytesLike; + maxLeverage: BigNumberish; + price: BigNumberish; + marketSize: BigNumberish; + marketSkew: BigNumberish; + marketDebt: BigNumberish; + currentFundingRate: BigNumberish; + currentFundingVelocity: BigNumberish; + feeRates: PerpsV2MarketData.FeeRatesStruct; + }; + + export type MarketSummaryStructOutput = [ + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + PerpsV2MarketData.FeeRatesStructOutput + ] & { + market: string; + asset: string; + key: string; + maxLeverage: BigNumber; + price: BigNumber; + marketSize: BigNumber; + marketSkew: BigNumber; + marketDebt: BigNumber; + currentFundingRate: BigNumber; + currentFundingVelocity: BigNumber; + feeRates: PerpsV2MarketData.FeeRatesStructOutput; + }; + + export type FuturesGlobalsStruct = { + minInitialMargin: BigNumberish; + liquidationFeeRatio: BigNumberish; + minKeeperFee: BigNumberish; + maxKeeperFee: BigNumberish; + }; + + export type FuturesGlobalsStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + minInitialMargin: BigNumber; + liquidationFeeRatio: BigNumber; + minKeeperFee: BigNumber; + maxKeeperFee: BigNumber; + }; + + export type MarketLimitsStruct = { + maxLeverage: BigNumberish; + maxMarketValue: BigNumberish; + }; + + export type MarketLimitsStructOutput = [BigNumber, BigNumber] & { + maxLeverage: BigNumber; + maxMarketValue: BigNumber; + }; + + export type FundingParametersStruct = { + maxFundingVelocity: BigNumberish; + skewScale: BigNumberish; + }; + + export type FundingParametersStructOutput = [BigNumber, BigNumber] & { + maxFundingVelocity: BigNumber; + skewScale: BigNumber; + }; + + export type SidesStruct = { long: BigNumberish; short: BigNumberish }; + + export type SidesStructOutput = [BigNumber, BigNumber] & { + long: BigNumber; + short: BigNumber; + }; + + export type MarketSizeDetailsStruct = { + marketSize: BigNumberish; + sides: PerpsV2MarketData.SidesStruct; + marketDebt: BigNumberish; + marketSkew: BigNumberish; + }; + + export type MarketSizeDetailsStructOutput = [ + BigNumber, + PerpsV2MarketData.SidesStructOutput, + BigNumber, + BigNumber + ] & { + marketSize: BigNumber; + sides: PerpsV2MarketData.SidesStructOutput; + marketDebt: BigNumber; + marketSkew: BigNumber; + }; + + export type PriceDetailsStruct = { price: BigNumberish; invalid: boolean }; + + export type PriceDetailsStructOutput = [BigNumber, boolean] & { + price: BigNumber; + invalid: boolean; + }; + + export type MarketDataStruct = { + market: string; + baseAsset: BytesLike; + marketKey: BytesLike; + feeRates: PerpsV2MarketData.FeeRatesStruct; + limits: PerpsV2MarketData.MarketLimitsStruct; + fundingParameters: PerpsV2MarketData.FundingParametersStruct; + marketSizeDetails: PerpsV2MarketData.MarketSizeDetailsStruct; + priceDetails: PerpsV2MarketData.PriceDetailsStruct; + }; + + export type MarketDataStructOutput = [ + string, + string, + string, + PerpsV2MarketData.FeeRatesStructOutput, + PerpsV2MarketData.MarketLimitsStructOutput, + PerpsV2MarketData.FundingParametersStructOutput, + PerpsV2MarketData.MarketSizeDetailsStructOutput, + PerpsV2MarketData.PriceDetailsStructOutput + ] & { + market: string; + baseAsset: string; + marketKey: string; + feeRates: PerpsV2MarketData.FeeRatesStructOutput; + limits: PerpsV2MarketData.MarketLimitsStructOutput; + fundingParameters: PerpsV2MarketData.FundingParametersStructOutput; + marketSizeDetails: PerpsV2MarketData.MarketSizeDetailsStructOutput; + priceDetails: PerpsV2MarketData.PriceDetailsStructOutput; + }; + + export type PositionDataStruct = { + position: IPerpsV2MarketBaseTypes.PositionStruct; + notionalValue: BigNumberish; + profitLoss: BigNumberish; + accruedFunding: BigNumberish; + remainingMargin: BigNumberish; + accessibleMargin: BigNumberish; + liquidationPrice: BigNumberish; + canLiquidatePosition: boolean; + }; + + export type PositionDataStructOutput = [ + IPerpsV2MarketBaseTypes.PositionStructOutput, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + boolean + ] & { + position: IPerpsV2MarketBaseTypes.PositionStructOutput; + notionalValue: BigNumber; + profitLoss: BigNumber; + accruedFunding: BigNumber; + remainingMargin: BigNumber; + accessibleMargin: BigNumber; + liquidationPrice: BigNumber; + canLiquidatePosition: boolean; + }; } export declare namespace IPerpsV2MarketSettings { - export type ParametersStruct = { - takerFee: PromiseOrValue - makerFee: PromiseOrValue - takerFeeDelayedOrder: PromiseOrValue - makerFeeDelayedOrder: PromiseOrValue - takerFeeOffchainDelayedOrder: PromiseOrValue - makerFeeOffchainDelayedOrder: PromiseOrValue - maxLeverage: PromiseOrValue - maxMarketValue: PromiseOrValue - maxFundingVelocity: PromiseOrValue - skewScale: PromiseOrValue - nextPriceConfirmWindow: PromiseOrValue - delayedOrderConfirmWindow: PromiseOrValue - minDelayTimeDelta: PromiseOrValue - maxDelayTimeDelta: PromiseOrValue - offchainDelayedOrderMinAge: PromiseOrValue - offchainDelayedOrderMaxAge: PromiseOrValue - offchainMarketKey: PromiseOrValue - offchainPriceDivergence: PromiseOrValue - liquidationPremiumMultiplier: PromiseOrValue - liquidationBufferRatio: PromiseOrValue - maxLiquidationDelta: PromiseOrValue - maxPD: PromiseOrValue - } - - export type ParametersStructOutput = [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeDelayedOrder: BigNumber - makerFeeDelayedOrder: BigNumber - takerFeeOffchainDelayedOrder: BigNumber - makerFeeOffchainDelayedOrder: BigNumber - maxLeverage: BigNumber - maxMarketValue: BigNumber - maxFundingVelocity: BigNumber - skewScale: BigNumber - nextPriceConfirmWindow: BigNumber - delayedOrderConfirmWindow: BigNumber - minDelayTimeDelta: BigNumber - maxDelayTimeDelta: BigNumber - offchainDelayedOrderMinAge: BigNumber - offchainDelayedOrderMaxAge: BigNumber - offchainMarketKey: string - offchainPriceDivergence: BigNumber - liquidationPremiumMultiplier: BigNumber - liquidationBufferRatio: BigNumber - maxLiquidationDelta: BigNumber - maxPD: BigNumber - } + export type ParametersStruct = { + takerFee: BigNumberish; + makerFee: BigNumberish; + takerFeeDelayedOrder: BigNumberish; + makerFeeDelayedOrder: BigNumberish; + takerFeeOffchainDelayedOrder: BigNumberish; + makerFeeOffchainDelayedOrder: BigNumberish; + maxLeverage: BigNumberish; + maxMarketValue: BigNumberish; + maxFundingVelocity: BigNumberish; + skewScale: BigNumberish; + nextPriceConfirmWindow: BigNumberish; + delayedOrderConfirmWindow: BigNumberish; + minDelayTimeDelta: BigNumberish; + maxDelayTimeDelta: BigNumberish; + offchainDelayedOrderMinAge: BigNumberish; + offchainDelayedOrderMaxAge: BigNumberish; + offchainMarketKey: BytesLike; + offchainPriceDivergence: BigNumberish; + liquidationPremiumMultiplier: BigNumberish; + liquidationBufferRatio: BigNumberish; + maxLiquidationDelta: BigNumberish; + maxPD: BigNumberish; + }; + + export type ParametersStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeDelayedOrder: BigNumber; + makerFeeDelayedOrder: BigNumber; + takerFeeOffchainDelayedOrder: BigNumber; + makerFeeOffchainDelayedOrder: BigNumber; + maxLeverage: BigNumber; + maxMarketValue: BigNumber; + maxFundingVelocity: BigNumber; + skewScale: BigNumber; + nextPriceConfirmWindow: BigNumber; + delayedOrderConfirmWindow: BigNumber; + minDelayTimeDelta: BigNumber; + maxDelayTimeDelta: BigNumber; + offchainDelayedOrderMinAge: BigNumber; + offchainDelayedOrderMaxAge: BigNumber; + offchainMarketKey: string; + offchainPriceDivergence: BigNumber; + liquidationPremiumMultiplier: BigNumber; + liquidationBufferRatio: BigNumber; + maxLiquidationDelta: BigNumber; + maxPD: BigNumber; + }; } export declare namespace IPerpsV2MarketBaseTypes { - export type PositionStruct = { - id: PromiseOrValue - lastFundingIndex: PromiseOrValue - margin: PromiseOrValue - lastPrice: PromiseOrValue - size: PromiseOrValue - } - - export type PositionStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } + export type PositionStruct = { + id: BigNumberish; + lastFundingIndex: BigNumberish; + margin: BigNumberish; + lastPrice: BigNumberish; + size: BigNumberish; + }; + + export type PositionStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + }; } export interface PerpsV2MarketDataInterface extends utils.Interface { - functions: { - 'allMarketSummaries()': FunctionFragment - 'allProxiedMarketSummaries()': FunctionFragment - 'globals()': FunctionFragment - 'marketDetails(address)': FunctionFragment - 'marketDetailsForKey(bytes32)': FunctionFragment - 'marketSummaries(address[])': FunctionFragment - 'marketSummariesForKeys(bytes32[])': FunctionFragment - 'parameters(bytes32)': FunctionFragment - 'positionDetails(address,address)': FunctionFragment - 'positionDetailsForMarketKey(bytes32,address)': FunctionFragment - 'resolverProxy()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'allMarketSummaries' - | 'allProxiedMarketSummaries' - | 'globals' - | 'marketDetails' - | 'marketDetailsForKey' - | 'marketSummaries' - | 'marketSummariesForKeys' - | 'parameters' - | 'positionDetails' - | 'positionDetailsForMarketKey' - | 'resolverProxy' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'allMarketSummaries', values?: undefined): string - encodeFunctionData(functionFragment: 'allProxiedMarketSummaries', values?: undefined): string - encodeFunctionData(functionFragment: 'globals', values?: undefined): string - encodeFunctionData(functionFragment: 'marketDetails', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'marketDetailsForKey', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'marketSummaries', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'marketSummariesForKeys', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'parameters', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'positionDetails', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'positionDetailsForMarketKey', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'resolverProxy', values?: undefined): string - - decodeFunctionResult(functionFragment: 'allMarketSummaries', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'allProxiedMarketSummaries', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'globals', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketDetails', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketDetailsForKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSummaries', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSummariesForKeys', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'parameters', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'positionDetails', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'positionDetailsForMarketKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverProxy', data: BytesLike): Result - - events: {} + functions: { + "allMarketSummaries()": FunctionFragment; + "allProxiedMarketSummaries()": FunctionFragment; + "globals()": FunctionFragment; + "marketDetails(address)": FunctionFragment; + "marketDetailsForKey(bytes32)": FunctionFragment; + "marketSummaries(address[])": FunctionFragment; + "marketSummariesForKeys(bytes32[])": FunctionFragment; + "parameters(bytes32)": FunctionFragment; + "positionDetails(address,address)": FunctionFragment; + "positionDetailsForMarketKey(bytes32,address)": FunctionFragment; + "resolverProxy()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "allMarketSummaries" + | "allProxiedMarketSummaries" + | "globals" + | "marketDetails" + | "marketDetailsForKey" + | "marketSummaries" + | "marketSummariesForKeys" + | "parameters" + | "positionDetails" + | "positionDetailsForMarketKey" + | "resolverProxy" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "allMarketSummaries", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allProxiedMarketSummaries", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "globals", values?: undefined): string; + encodeFunctionData( + functionFragment: "marketDetails", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "marketDetailsForKey", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "marketSummaries", + values: [string[]] + ): string; + encodeFunctionData( + functionFragment: "marketSummariesForKeys", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "parameters", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "positionDetails", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "positionDetailsForMarketKey", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "resolverProxy", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "allMarketSummaries", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "allProxiedMarketSummaries", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "globals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "marketDetails", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "marketDetailsForKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "marketSummaries", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "marketSummariesForKeys", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "parameters", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "positionDetails", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "positionDetailsForMarketKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resolverProxy", + data: BytesLike + ): Result; + + events: {}; } export interface PerpsV2MarketData extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: PerpsV2MarketDataInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - allMarketSummaries( - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]> - - allProxiedMarketSummaries( - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]> - - globals(overrides?: CallOverrides): Promise<[PerpsV2MarketData.FuturesGlobalsStructOutput]> - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.MarketDataStructOutput]> - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.MarketDataStructOutput]> - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]> - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]> - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[IPerpsV2MarketSettings.ParametersStructOutput]> - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.PositionDataStructOutput]> - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PerpsV2MarketData.PositionDataStructOutput]> - - resolverProxy(overrides?: CallOverrides): Promise<[string]> - } - - allMarketSummaries( - overrides?: CallOverrides - ): Promise - - allProxiedMarketSummaries( - overrides?: CallOverrides - ): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - - callStatic: { - allMarketSummaries( - overrides?: CallOverrides - ): Promise - - allProxiedMarketSummaries( - overrides?: CallOverrides - ): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - } - - filters: {} - - estimateGas: { - allMarketSummaries(overrides?: CallOverrides): Promise - - allProxiedMarketSummaries(overrides?: CallOverrides): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails(market: PromiseOrValue, overrides?: CallOverrides): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters(marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - } - - populateTransaction: { - allMarketSummaries(overrides?: CallOverrides): Promise - - allProxiedMarketSummaries(overrides?: CallOverrides): Promise - - globals(overrides?: CallOverrides): Promise - - marketDetails( - market: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketDetailsForKey( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - marketSummaries( - markets: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - marketSummariesForKeys( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - parameters( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetails( - market: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - positionDetailsForMarketKey( - marketKey: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolverProxy(overrides?: CallOverrides): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PerpsV2MarketDataInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + allMarketSummaries( + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]>; + + allProxiedMarketSummaries( + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]>; + + globals( + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.FuturesGlobalsStructOutput]>; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.MarketDataStructOutput]>; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.MarketDataStructOutput]>; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]>; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.MarketSummaryStructOutput[]]>; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[IPerpsV2MarketSettings.ParametersStructOutput]>; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.PositionDataStructOutput]>; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise<[PerpsV2MarketData.PositionDataStructOutput]>; + + resolverProxy(overrides?: CallOverrides): Promise<[string]>; + }; + + allMarketSummaries( + overrides?: CallOverrides + ): Promise; + + allProxiedMarketSummaries( + overrides?: CallOverrides + ): Promise; + + globals( + overrides?: CallOverrides + ): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + + callStatic: { + allMarketSummaries( + overrides?: CallOverrides + ): Promise; + + allProxiedMarketSummaries( + overrides?: CallOverrides + ): Promise; + + globals( + overrides?: CallOverrides + ): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + }; + + filters: {}; + + estimateGas: { + allMarketSummaries(overrides?: CallOverrides): Promise; + + allProxiedMarketSummaries(overrides?: CallOverrides): Promise; + + globals(overrides?: CallOverrides): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + allMarketSummaries( + overrides?: CallOverrides + ): Promise; + + allProxiedMarketSummaries( + overrides?: CallOverrides + ): Promise; + + globals(overrides?: CallOverrides): Promise; + + marketDetails( + market: string, + overrides?: CallOverrides + ): Promise; + + marketDetailsForKey( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + marketSummaries( + markets: string[], + overrides?: CallOverrides + ): Promise; + + marketSummariesForKeys( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + parameters( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + positionDetails( + market: string, + account: string, + overrides?: CallOverrides + ): Promise; + + positionDetailsForMarketKey( + marketKey: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + resolverProxy(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/PerpsV2MarketSettings.ts b/packages/sdk/src/contracts/types/PerpsV2MarketSettings.ts index 7019f9e45f..abbafe8f99 100644 --- a/packages/sdk/src/contracts/types/PerpsV2MarketSettings.ts +++ b/packages/sdk/src/contracts/types/PerpsV2MarketSettings.ts @@ -2,2211 +2,2540 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IPerpsV2MarketSettings { - export type ParametersStruct = { - takerFee: PromiseOrValue - makerFee: PromiseOrValue - takerFeeDelayedOrder: PromiseOrValue - makerFeeDelayedOrder: PromiseOrValue - takerFeeOffchainDelayedOrder: PromiseOrValue - makerFeeOffchainDelayedOrder: PromiseOrValue - maxLeverage: PromiseOrValue - maxMarketValue: PromiseOrValue - maxFundingVelocity: PromiseOrValue - skewScale: PromiseOrValue - nextPriceConfirmWindow: PromiseOrValue - delayedOrderConfirmWindow: PromiseOrValue - minDelayTimeDelta: PromiseOrValue - maxDelayTimeDelta: PromiseOrValue - offchainDelayedOrderMinAge: PromiseOrValue - offchainDelayedOrderMaxAge: PromiseOrValue - offchainMarketKey: PromiseOrValue - offchainPriceDivergence: PromiseOrValue - liquidationPremiumMultiplier: PromiseOrValue - liquidationBufferRatio: PromiseOrValue - maxLiquidationDelta: PromiseOrValue - maxPD: PromiseOrValue - } - - export type ParametersStructOutput = [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber - ] & { - takerFee: BigNumber - makerFee: BigNumber - takerFeeDelayedOrder: BigNumber - makerFeeDelayedOrder: BigNumber - takerFeeOffchainDelayedOrder: BigNumber - makerFeeOffchainDelayedOrder: BigNumber - maxLeverage: BigNumber - maxMarketValue: BigNumber - maxFundingVelocity: BigNumber - skewScale: BigNumber - nextPriceConfirmWindow: BigNumber - delayedOrderConfirmWindow: BigNumber - minDelayTimeDelta: BigNumber - maxDelayTimeDelta: BigNumber - offchainDelayedOrderMinAge: BigNumber - offchainDelayedOrderMaxAge: BigNumber - offchainMarketKey: string - offchainPriceDivergence: BigNumber - liquidationPremiumMultiplier: BigNumber - liquidationBufferRatio: BigNumber - maxLiquidationDelta: BigNumber - maxPD: BigNumber - } + export type ParametersStruct = { + takerFee: BigNumberish; + makerFee: BigNumberish; + takerFeeDelayedOrder: BigNumberish; + makerFeeDelayedOrder: BigNumberish; + takerFeeOffchainDelayedOrder: BigNumberish; + makerFeeOffchainDelayedOrder: BigNumberish; + maxLeverage: BigNumberish; + maxMarketValue: BigNumberish; + maxFundingVelocity: BigNumberish; + skewScale: BigNumberish; + nextPriceConfirmWindow: BigNumberish; + delayedOrderConfirmWindow: BigNumberish; + minDelayTimeDelta: BigNumberish; + maxDelayTimeDelta: BigNumberish; + offchainDelayedOrderMinAge: BigNumberish; + offchainDelayedOrderMaxAge: BigNumberish; + offchainMarketKey: BytesLike; + offchainPriceDivergence: BigNumberish; + liquidationPremiumMultiplier: BigNumberish; + liquidationBufferRatio: BigNumberish; + maxLiquidationDelta: BigNumberish; + maxPD: BigNumberish; + }; + + export type ParametersStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + takerFee: BigNumber; + makerFee: BigNumber; + takerFeeDelayedOrder: BigNumber; + makerFeeDelayedOrder: BigNumber; + takerFeeOffchainDelayedOrder: BigNumber; + makerFeeOffchainDelayedOrder: BigNumber; + maxLeverage: BigNumber; + maxMarketValue: BigNumber; + maxFundingVelocity: BigNumber; + skewScale: BigNumber; + nextPriceConfirmWindow: BigNumber; + delayedOrderConfirmWindow: BigNumber; + minDelayTimeDelta: BigNumber; + maxDelayTimeDelta: BigNumber; + offchainDelayedOrderMinAge: BigNumber; + offchainDelayedOrderMaxAge: BigNumber; + offchainMarketKey: string; + offchainPriceDivergence: BigNumber; + liquidationPremiumMultiplier: BigNumber; + liquidationBufferRatio: BigNumber; + maxLiquidationDelta: BigNumber; + maxPD: BigNumber; + }; } export interface PerpsV2MarketSettingsInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'delayedOrderConfirmWindow(bytes32)': FunctionFragment - 'isResolverCached()': FunctionFragment - 'keeperLiquidationFee()': FunctionFragment - 'liquidationBufferRatio(bytes32)': FunctionFragment - 'liquidationFeeRatio()': FunctionFragment - 'liquidationPremiumMultiplier(bytes32)': FunctionFragment - 'makerFee(bytes32)': FunctionFragment - 'makerFeeDelayedOrder(bytes32)': FunctionFragment - 'makerFeeOffchainDelayedOrder(bytes32)': FunctionFragment - 'maxDelayTimeDelta(bytes32)': FunctionFragment - 'maxFundingVelocity(bytes32)': FunctionFragment - 'maxKeeperFee()': FunctionFragment - 'maxLeverage(bytes32)': FunctionFragment - 'maxLiquidationDelta(bytes32)': FunctionFragment - 'maxMarketValue(bytes32)': FunctionFragment - 'maxPD(bytes32)': FunctionFragment - 'minDelayTimeDelta(bytes32)': FunctionFragment - 'minInitialMargin()': FunctionFragment - 'minKeeperFee()': FunctionFragment - 'nextPriceConfirmWindow(bytes32)': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'offchainDelayedOrderMaxAge(bytes32)': FunctionFragment - 'offchainDelayedOrderMinAge(bytes32)': FunctionFragment - 'offchainMarketKey(bytes32)': FunctionFragment - 'offchainPriceDivergence(bytes32)': FunctionFragment - 'owner()': FunctionFragment - 'parameters(bytes32)': FunctionFragment - 'rebuildCache()': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'setDelayedOrderConfirmWindow(bytes32,uint256)': FunctionFragment - 'setKeeperLiquidationFee(uint256)': FunctionFragment - 'setLiquidationBufferRatio(bytes32,uint256)': FunctionFragment - 'setLiquidationFeeRatio(uint256)': FunctionFragment - 'setLiquidationPremiumMultiplier(bytes32,uint256)': FunctionFragment - 'setMakerFee(bytes32,uint256)': FunctionFragment - 'setMakerFeeDelayedOrder(bytes32,uint256)': FunctionFragment - 'setMakerFeeOffchainDelayedOrder(bytes32,uint256)': FunctionFragment - 'setMaxDelayTimeDelta(bytes32,uint256)': FunctionFragment - 'setMaxFundingVelocity(bytes32,uint256)': FunctionFragment - 'setMaxKeeperFee(uint256)': FunctionFragment - 'setMaxLeverage(bytes32,uint256)': FunctionFragment - 'setMaxLiquidationDelta(bytes32,uint256)': FunctionFragment - 'setMaxMarketValue(bytes32,uint256)': FunctionFragment - 'setMaxPD(bytes32,uint256)': FunctionFragment - 'setMinDelayTimeDelta(bytes32,uint256)': FunctionFragment - 'setMinInitialMargin(uint256)': FunctionFragment - 'setMinKeeperFee(uint256)': FunctionFragment - 'setNextPriceConfirmWindow(bytes32,uint256)': FunctionFragment - 'setOffchainDelayedOrderMaxAge(bytes32,uint256)': FunctionFragment - 'setOffchainDelayedOrderMinAge(bytes32,uint256)': FunctionFragment - 'setOffchainMarketKey(bytes32,bytes32)': FunctionFragment - 'setOffchainPriceDivergence(bytes32,uint256)': FunctionFragment - 'setParameters(bytes32,(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes32,uint256,uint256,uint256,uint256,uint256))': FunctionFragment - 'setSkewScale(bytes32,uint256)': FunctionFragment - 'setTakerFee(bytes32,uint256)': FunctionFragment - 'setTakerFeeDelayedOrder(bytes32,uint256)': FunctionFragment - 'setTakerFeeOffchainDelayedOrder(bytes32,uint256)': FunctionFragment - 'skewScale(bytes32)': FunctionFragment - 'takerFee(bytes32)': FunctionFragment - 'takerFeeDelayedOrder(bytes32)': FunctionFragment - 'takerFeeOffchainDelayedOrder(bytes32)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'acceptOwnership' - | 'delayedOrderConfirmWindow' - | 'isResolverCached' - | 'keeperLiquidationFee' - | 'liquidationBufferRatio' - | 'liquidationFeeRatio' - | 'liquidationPremiumMultiplier' - | 'makerFee' - | 'makerFeeDelayedOrder' - | 'makerFeeOffchainDelayedOrder' - | 'maxDelayTimeDelta' - | 'maxFundingVelocity' - | 'maxKeeperFee' - | 'maxLeverage' - | 'maxLiquidationDelta' - | 'maxMarketValue' - | 'maxPD' - | 'minDelayTimeDelta' - | 'minInitialMargin' - | 'minKeeperFee' - | 'nextPriceConfirmWindow' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'offchainDelayedOrderMaxAge' - | 'offchainDelayedOrderMinAge' - | 'offchainMarketKey' - | 'offchainPriceDivergence' - | 'owner' - | 'parameters' - | 'rebuildCache' - | 'resolver' - | 'resolverAddressesRequired' - | 'setDelayedOrderConfirmWindow' - | 'setKeeperLiquidationFee' - | 'setLiquidationBufferRatio' - | 'setLiquidationFeeRatio' - | 'setLiquidationPremiumMultiplier' - | 'setMakerFee' - | 'setMakerFeeDelayedOrder' - | 'setMakerFeeOffchainDelayedOrder' - | 'setMaxDelayTimeDelta' - | 'setMaxFundingVelocity' - | 'setMaxKeeperFee' - | 'setMaxLeverage' - | 'setMaxLiquidationDelta' - | 'setMaxMarketValue' - | 'setMaxPD' - | 'setMinDelayTimeDelta' - | 'setMinInitialMargin' - | 'setMinKeeperFee' - | 'setNextPriceConfirmWindow' - | 'setOffchainDelayedOrderMaxAge' - | 'setOffchainDelayedOrderMinAge' - | 'setOffchainMarketKey' - | 'setOffchainPriceDivergence' - | 'setParameters' - | 'setSkewScale' - | 'setTakerFee' - | 'setTakerFeeDelayedOrder' - | 'setTakerFeeOffchainDelayedOrder' - | 'skewScale' - | 'takerFee' - | 'takerFeeDelayedOrder' - | 'takerFeeOffchainDelayedOrder' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'delayedOrderConfirmWindow', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData(functionFragment: 'keeperLiquidationFee', values?: undefined): string - encodeFunctionData( - functionFragment: 'liquidationBufferRatio', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'liquidationFeeRatio', values?: undefined): string - encodeFunctionData( - functionFragment: 'liquidationPremiumMultiplier', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'makerFee', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'makerFeeDelayedOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'makerFeeOffchainDelayedOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'maxDelayTimeDelta', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'maxFundingVelocity', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'maxKeeperFee', values?: undefined): string - encodeFunctionData(functionFragment: 'maxLeverage', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'maxLiquidationDelta', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'maxMarketValue', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'maxPD', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'minDelayTimeDelta', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'minInitialMargin', values?: undefined): string - encodeFunctionData(functionFragment: 'minKeeperFee', values?: undefined): string - encodeFunctionData( - functionFragment: 'nextPriceConfirmWindow', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData( - functionFragment: 'offchainDelayedOrderMaxAge', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'offchainDelayedOrderMinAge', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'offchainMarketKey', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'offchainPriceDivergence', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'parameters', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData( - functionFragment: 'setDelayedOrderConfirmWindow', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setKeeperLiquidationFee', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationBufferRatio', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationFeeRatio', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationPremiumMultiplier', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMakerFee', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMakerFeeDelayedOrder', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMakerFeeOffchainDelayedOrder', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxDelayTimeDelta', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxFundingVelocity', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxKeeperFee', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxLeverage', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxLiquidationDelta', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxMarketValue', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMaxPD', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMinDelayTimeDelta', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMinInitialMargin', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMinKeeperFee', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setNextPriceConfirmWindow', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setOffchainDelayedOrderMaxAge', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setOffchainDelayedOrderMinAge', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setOffchainMarketKey', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setOffchainPriceDivergence', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setParameters', - values: [PromiseOrValue, IPerpsV2MarketSettings.ParametersStruct] - ): string - encodeFunctionData( - functionFragment: 'setSkewScale', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTakerFee', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTakerFeeDelayedOrder', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTakerFeeOffchainDelayedOrder', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'skewScale', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'takerFee', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'takerFeeDelayedOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'takerFeeOffchainDelayedOrder', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'delayedOrderConfirmWindow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'keeperLiquidationFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationBufferRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationFeeRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationPremiumMultiplier', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'makerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'makerFeeDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'makerFeeOffchainDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxDelayTimeDelta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxFundingVelocity', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxKeeperFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxLeverage', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxLiquidationDelta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxMarketValue', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxPD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'minDelayTimeDelta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'minInitialMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'minKeeperFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nextPriceConfirmWindow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'offchainDelayedOrderMaxAge', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'offchainDelayedOrderMinAge', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'offchainMarketKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'offchainPriceDivergence', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'parameters', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setDelayedOrderConfirmWindow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setKeeperLiquidationFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationBufferRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationFeeRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationPremiumMultiplier', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMakerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMakerFeeDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMakerFeeOffchainDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxDelayTimeDelta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxFundingVelocity', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxKeeperFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxLeverage', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxLiquidationDelta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxMarketValue', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMaxPD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMinDelayTimeDelta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMinInitialMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMinKeeperFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setNextPriceConfirmWindow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setOffchainDelayedOrderMaxAge', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setOffchainDelayedOrderMinAge', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setOffchainMarketKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setOffchainPriceDivergence', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setParameters', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setSkewScale', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTakerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTakerFeeDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTakerFeeOffchainDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'skewScale', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'takerFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'takerFeeDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'takerFeeOffchainDelayedOrder', data: BytesLike): Result - - events: { - 'CacheUpdated(bytes32,address)': EventFragment - 'KeeperLiquidationFeeUpdated(uint256)': EventFragment - 'LiquidationBufferRatioUpdated(uint256)': EventFragment - 'LiquidationFeeRatioUpdated(uint256)': EventFragment - 'MaxKeeperFeeUpdated(uint256)': EventFragment - 'MinInitialMarginUpdated(uint256)': EventFragment - 'MinKeeperFeeUpdated(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'ParameterUpdated(bytes32,bytes32,uint256)': EventFragment - 'ParameterUpdatedBytes32(bytes32,bytes32,bytes32)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'KeeperLiquidationFeeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationBufferRatioUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationFeeRatioUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MaxKeeperFeeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MinInitialMarginUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MinKeeperFeeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ParameterUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ParameterUpdatedBytes32'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "delayedOrderConfirmWindow(bytes32)": FunctionFragment; + "isResolverCached()": FunctionFragment; + "keeperLiquidationFee()": FunctionFragment; + "liquidationBufferRatio(bytes32)": FunctionFragment; + "liquidationFeeRatio()": FunctionFragment; + "liquidationPremiumMultiplier(bytes32)": FunctionFragment; + "makerFee(bytes32)": FunctionFragment; + "makerFeeDelayedOrder(bytes32)": FunctionFragment; + "makerFeeOffchainDelayedOrder(bytes32)": FunctionFragment; + "maxDelayTimeDelta(bytes32)": FunctionFragment; + "maxFundingVelocity(bytes32)": FunctionFragment; + "maxKeeperFee()": FunctionFragment; + "maxLeverage(bytes32)": FunctionFragment; + "maxLiquidationDelta(bytes32)": FunctionFragment; + "maxMarketValue(bytes32)": FunctionFragment; + "maxPD(bytes32)": FunctionFragment; + "minDelayTimeDelta(bytes32)": FunctionFragment; + "minInitialMargin()": FunctionFragment; + "minKeeperFee()": FunctionFragment; + "nextPriceConfirmWindow(bytes32)": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "offchainDelayedOrderMaxAge(bytes32)": FunctionFragment; + "offchainDelayedOrderMinAge(bytes32)": FunctionFragment; + "offchainMarketKey(bytes32)": FunctionFragment; + "offchainPriceDivergence(bytes32)": FunctionFragment; + "owner()": FunctionFragment; + "parameters(bytes32)": FunctionFragment; + "rebuildCache()": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "setDelayedOrderConfirmWindow(bytes32,uint256)": FunctionFragment; + "setKeeperLiquidationFee(uint256)": FunctionFragment; + "setLiquidationBufferRatio(bytes32,uint256)": FunctionFragment; + "setLiquidationFeeRatio(uint256)": FunctionFragment; + "setLiquidationPremiumMultiplier(bytes32,uint256)": FunctionFragment; + "setMakerFee(bytes32,uint256)": FunctionFragment; + "setMakerFeeDelayedOrder(bytes32,uint256)": FunctionFragment; + "setMakerFeeOffchainDelayedOrder(bytes32,uint256)": FunctionFragment; + "setMaxDelayTimeDelta(bytes32,uint256)": FunctionFragment; + "setMaxFundingVelocity(bytes32,uint256)": FunctionFragment; + "setMaxKeeperFee(uint256)": FunctionFragment; + "setMaxLeverage(bytes32,uint256)": FunctionFragment; + "setMaxLiquidationDelta(bytes32,uint256)": FunctionFragment; + "setMaxMarketValue(bytes32,uint256)": FunctionFragment; + "setMaxPD(bytes32,uint256)": FunctionFragment; + "setMinDelayTimeDelta(bytes32,uint256)": FunctionFragment; + "setMinInitialMargin(uint256)": FunctionFragment; + "setMinKeeperFee(uint256)": FunctionFragment; + "setNextPriceConfirmWindow(bytes32,uint256)": FunctionFragment; + "setOffchainDelayedOrderMaxAge(bytes32,uint256)": FunctionFragment; + "setOffchainDelayedOrderMinAge(bytes32,uint256)": FunctionFragment; + "setOffchainMarketKey(bytes32,bytes32)": FunctionFragment; + "setOffchainPriceDivergence(bytes32,uint256)": FunctionFragment; + "setParameters(bytes32,(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes32,uint256,uint256,uint256,uint256,uint256))": FunctionFragment; + "setSkewScale(bytes32,uint256)": FunctionFragment; + "setTakerFee(bytes32,uint256)": FunctionFragment; + "setTakerFeeDelayedOrder(bytes32,uint256)": FunctionFragment; + "setTakerFeeOffchainDelayedOrder(bytes32,uint256)": FunctionFragment; + "skewScale(bytes32)": FunctionFragment; + "takerFee(bytes32)": FunctionFragment; + "takerFeeDelayedOrder(bytes32)": FunctionFragment; + "takerFeeOffchainDelayedOrder(bytes32)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "acceptOwnership" + | "delayedOrderConfirmWindow" + | "isResolverCached" + | "keeperLiquidationFee" + | "liquidationBufferRatio" + | "liquidationFeeRatio" + | "liquidationPremiumMultiplier" + | "makerFee" + | "makerFeeDelayedOrder" + | "makerFeeOffchainDelayedOrder" + | "maxDelayTimeDelta" + | "maxFundingVelocity" + | "maxKeeperFee" + | "maxLeverage" + | "maxLiquidationDelta" + | "maxMarketValue" + | "maxPD" + | "minDelayTimeDelta" + | "minInitialMargin" + | "minKeeperFee" + | "nextPriceConfirmWindow" + | "nominateNewOwner" + | "nominatedOwner" + | "offchainDelayedOrderMaxAge" + | "offchainDelayedOrderMinAge" + | "offchainMarketKey" + | "offchainPriceDivergence" + | "owner" + | "parameters" + | "rebuildCache" + | "resolver" + | "resolverAddressesRequired" + | "setDelayedOrderConfirmWindow" + | "setKeeperLiquidationFee" + | "setLiquidationBufferRatio" + | "setLiquidationFeeRatio" + | "setLiquidationPremiumMultiplier" + | "setMakerFee" + | "setMakerFeeDelayedOrder" + | "setMakerFeeOffchainDelayedOrder" + | "setMaxDelayTimeDelta" + | "setMaxFundingVelocity" + | "setMaxKeeperFee" + | "setMaxLeverage" + | "setMaxLiquidationDelta" + | "setMaxMarketValue" + | "setMaxPD" + | "setMinDelayTimeDelta" + | "setMinInitialMargin" + | "setMinKeeperFee" + | "setNextPriceConfirmWindow" + | "setOffchainDelayedOrderMaxAge" + | "setOffchainDelayedOrderMinAge" + | "setOffchainMarketKey" + | "setOffchainPriceDivergence" + | "setParameters" + | "setSkewScale" + | "setTakerFee" + | "setTakerFeeDelayedOrder" + | "setTakerFeeOffchainDelayedOrder" + | "skewScale" + | "takerFee" + | "takerFeeDelayedOrder" + | "takerFeeOffchainDelayedOrder" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "delayedOrderConfirmWindow", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "keeperLiquidationFee", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationBufferRatio", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "liquidationFeeRatio", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationPremiumMultiplier", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "makerFee", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "makerFeeDelayedOrder", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "makerFeeOffchainDelayedOrder", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxDelayTimeDelta", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxFundingVelocity", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxKeeperFee", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "maxLeverage", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxLiquidationDelta", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "maxMarketValue", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "maxPD", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "minDelayTimeDelta", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "minInitialMargin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minKeeperFee", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nextPriceConfirmWindow", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "offchainDelayedOrderMaxAge", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "offchainDelayedOrderMinAge", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "offchainMarketKey", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "offchainPriceDivergence", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "parameters", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setDelayedOrderConfirmWindow", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setKeeperLiquidationFee", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationBufferRatio", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationFeeRatio", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationPremiumMultiplier", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMakerFee", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMakerFeeDelayedOrder", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMakerFeeOffchainDelayedOrder", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxDelayTimeDelta", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxFundingVelocity", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxKeeperFee", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxLeverage", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxLiquidationDelta", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxMarketValue", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxPD", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMinDelayTimeDelta", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMinInitialMargin", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMinKeeperFee", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setNextPriceConfirmWindow", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setOffchainDelayedOrderMaxAge", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setOffchainDelayedOrderMinAge", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setOffchainMarketKey", + values: [BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "setOffchainPriceDivergence", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setParameters", + values: [BytesLike, IPerpsV2MarketSettings.ParametersStruct] + ): string; + encodeFunctionData( + functionFragment: "setSkewScale", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTakerFee", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTakerFeeDelayedOrder", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTakerFeeOffchainDelayedOrder", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "skewScale", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "takerFee", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "takerFeeDelayedOrder", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "takerFeeOffchainDelayedOrder", + values: [BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "delayedOrderConfirmWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "keeperLiquidationFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationBufferRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationFeeRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationPremiumMultiplier", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "makerFee", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "makerFeeDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "makerFeeOffchainDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxDelayTimeDelta", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxFundingVelocity", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxKeeperFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxLeverage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxLiquidationDelta", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxMarketValue", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "maxPD", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "minDelayTimeDelta", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minInitialMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minKeeperFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nextPriceConfirmWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "offchainDelayedOrderMaxAge", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "offchainDelayedOrderMinAge", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "offchainMarketKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "offchainPriceDivergence", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "parameters", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setDelayedOrderConfirmWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setKeeperLiquidationFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationBufferRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationFeeRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationPremiumMultiplier", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMakerFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMakerFeeDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMakerFeeOffchainDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxDelayTimeDelta", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxFundingVelocity", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxKeeperFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxLeverage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxLiquidationDelta", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxMarketValue", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "setMaxPD", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMinDelayTimeDelta", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMinInitialMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMinKeeperFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setNextPriceConfirmWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOffchainDelayedOrderMaxAge", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOffchainDelayedOrderMinAge", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOffchainMarketKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOffchainPriceDivergence", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setParameters", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSkewScale", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTakerFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTakerFeeDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTakerFeeOffchainDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "skewScale", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "takerFee", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "takerFeeDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "takerFeeOffchainDelayedOrder", + data: BytesLike + ): Result; + + events: { + "CacheUpdated(bytes32,address)": EventFragment; + "KeeperLiquidationFeeUpdated(uint256)": EventFragment; + "LiquidationBufferRatioUpdated(uint256)": EventFragment; + "LiquidationFeeRatioUpdated(uint256)": EventFragment; + "MaxKeeperFeeUpdated(uint256)": EventFragment; + "MinInitialMarginUpdated(uint256)": EventFragment; + "MinKeeperFeeUpdated(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "ParameterUpdated(bytes32,bytes32,uint256)": EventFragment; + "ParameterUpdatedBytes32(bytes32,bytes32,bytes32)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "KeeperLiquidationFeeUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "LiquidationBufferRatioUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidationFeeRatioUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MaxKeeperFeeUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MinInitialMarginUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MinKeeperFeeUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ParameterUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ParameterUpdatedBytes32"): EventFragment; } export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface KeeperLiquidationFeeUpdatedEventObject { - keeperFee: BigNumber + keeperFee: BigNumber; } export type KeeperLiquidationFeeUpdatedEvent = TypedEvent< - [BigNumber], - KeeperLiquidationFeeUpdatedEventObject -> + [BigNumber], + KeeperLiquidationFeeUpdatedEventObject +>; export type KeeperLiquidationFeeUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface LiquidationBufferRatioUpdatedEventObject { - bps: BigNumber + bps: BigNumber; } export type LiquidationBufferRatioUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationBufferRatioUpdatedEventObject -> + [BigNumber], + LiquidationBufferRatioUpdatedEventObject +>; export type LiquidationBufferRatioUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface LiquidationFeeRatioUpdatedEventObject { - bps: BigNumber + bps: BigNumber; } export type LiquidationFeeRatioUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationFeeRatioUpdatedEventObject -> + [BigNumber], + LiquidationFeeRatioUpdatedEventObject +>; export type LiquidationFeeRatioUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface MaxKeeperFeeUpdatedEventObject { - sUSD: BigNumber + sUSD: BigNumber; } -export type MaxKeeperFeeUpdatedEvent = TypedEvent<[BigNumber], MaxKeeperFeeUpdatedEventObject> +export type MaxKeeperFeeUpdatedEvent = TypedEvent< + [BigNumber], + MaxKeeperFeeUpdatedEventObject +>; -export type MaxKeeperFeeUpdatedEventFilter = TypedEventFilter +export type MaxKeeperFeeUpdatedEventFilter = + TypedEventFilter; export interface MinInitialMarginUpdatedEventObject { - minMargin: BigNumber + minMargin: BigNumber; } export type MinInitialMarginUpdatedEvent = TypedEvent< - [BigNumber], - MinInitialMarginUpdatedEventObject -> + [BigNumber], + MinInitialMarginUpdatedEventObject +>; -export type MinInitialMarginUpdatedEventFilter = TypedEventFilter +export type MinInitialMarginUpdatedEventFilter = + TypedEventFilter; export interface MinKeeperFeeUpdatedEventObject { - sUSD: BigNumber + sUSD: BigNumber; } -export type MinKeeperFeeUpdatedEvent = TypedEvent<[BigNumber], MinKeeperFeeUpdatedEventObject> +export type MinKeeperFeeUpdatedEvent = TypedEvent< + [BigNumber], + MinKeeperFeeUpdatedEventObject +>; -export type MinKeeperFeeUpdatedEventFilter = TypedEventFilter +export type MinKeeperFeeUpdatedEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface ParameterUpdatedEventObject { - marketKey: string - parameter: string - value: BigNumber + marketKey: string; + parameter: string; + value: BigNumber; } export type ParameterUpdatedEvent = TypedEvent< - [string, string, BigNumber], - ParameterUpdatedEventObject -> + [string, string, BigNumber], + ParameterUpdatedEventObject +>; -export type ParameterUpdatedEventFilter = TypedEventFilter +export type ParameterUpdatedEventFilter = + TypedEventFilter; export interface ParameterUpdatedBytes32EventObject { - marketKey: string - parameter: string - value: string + marketKey: string; + parameter: string; + value: string; } export type ParameterUpdatedBytes32Event = TypedEvent< - [string, string, string], - ParameterUpdatedBytes32EventObject -> + [string, string, string], + ParameterUpdatedBytes32EventObject +>; -export type ParameterUpdatedBytes32EventFilter = TypedEventFilter +export type ParameterUpdatedBytes32EventFilter = + TypedEventFilter; export interface PerpsV2MarketSettings extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: PerpsV2MarketSettingsInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - delayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - keeperLiquidationFee(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationBufferRatio( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - liquidationFeeRatio(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - makerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - makerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxFundingVelocity( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxKeeperFee(overrides?: CallOverrides): Promise<[BigNumber]> - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxLiquidationDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxMarketValue( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - maxPD(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - minDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - minInitialMargin(overrides?: CallOverrides): Promise<[BigNumber]> - - minKeeperFee(overrides?: CallOverrides): Promise<[BigNumber]> - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - offchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - offchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - offchainMarketKey( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]> - - offchainPriceDivergence( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - owner(overrides?: CallOverrides): Promise<[string]> - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[IPerpsV2MarketSettings.ParametersStructOutput]> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - setDelayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - _delayedOrderConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setKeeperLiquidationFee( - _keeperFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationBufferRatio( - _marketKey: PromiseOrValue, - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - _liquidationPremiumMultiplier: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxDelayTimeDelta( - _marketKey: PromiseOrValue, - _maxDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingVelocity( - _marketKey: PromiseOrValue, - _maxFundingVelocity: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLiquidationDelta( - _marketKey: PromiseOrValue, - _maxLiquidationDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValue( - _marketKey: PromiseOrValue, - _maxMarketValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxPD( - _marketKey: PromiseOrValue, - _maxPD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinDelayTimeDelta( - _marketKey: PromiseOrValue, - _minDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMaxAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMinAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainMarketKey( - _marketKey: PromiseOrValue, - _offchainMarketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainPriceDivergence( - _marketKey: PromiseOrValue, - _offchainPriceDivergence: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _parameters: IPerpsV2MarketSettings.ParametersStruct, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScale( - _marketKey: PromiseOrValue, - _skewScale: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScale( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - takerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - takerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - } - - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - delayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - keeperLiquidationFee(overrides?: CallOverrides): Promise - - liquidationBufferRatio( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - liquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - makerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingVelocity( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxKeeperFee(overrides?: CallOverrides): Promise - - maxLeverage(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - maxLiquidationDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxMarketValue( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxPD(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - minDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - offchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainMarketKey( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainPriceDivergence( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - owner(overrides?: CallOverrides): Promise - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setDelayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - _delayedOrderConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setKeeperLiquidationFee( - _keeperFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationBufferRatio( - _marketKey: PromiseOrValue, - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - _liquidationPremiumMultiplier: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxDelayTimeDelta( - _marketKey: PromiseOrValue, - _maxDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingVelocity( - _marketKey: PromiseOrValue, - _maxFundingVelocity: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLiquidationDelta( - _marketKey: PromiseOrValue, - _maxLiquidationDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValue( - _marketKey: PromiseOrValue, - _maxMarketValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxPD( - _marketKey: PromiseOrValue, - _maxPD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinDelayTimeDelta( - _marketKey: PromiseOrValue, - _minDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMaxAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMinAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainMarketKey( - _marketKey: PromiseOrValue, - _offchainMarketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainPriceDivergence( - _marketKey: PromiseOrValue, - _offchainPriceDivergence: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _parameters: IPerpsV2MarketSettings.ParametersStruct, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScale( - _marketKey: PromiseOrValue, - _skewScale: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScale(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: CallOverrides): Promise - - delayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - keeperLiquidationFee(overrides?: CallOverrides): Promise - - liquidationBufferRatio( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - liquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - makerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingVelocity( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxKeeperFee(overrides?: CallOverrides): Promise - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxLiquidationDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxMarketValue( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxPD(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - minDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - offchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainMarketKey( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainPriceDivergence( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - owner(overrides?: CallOverrides): Promise - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rebuildCache(overrides?: CallOverrides): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setDelayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - _delayedOrderConfirmWindow: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setKeeperLiquidationFee( - _keeperFee: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationBufferRatio( - _marketKey: PromiseOrValue, - _ratio: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - _liquidationPremiumMultiplier: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeDelayedOrder: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxDelayTimeDelta( - _marketKey: PromiseOrValue, - _maxDelayTimeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxFundingVelocity( - _marketKey: PromiseOrValue, - _maxFundingVelocity: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxKeeperFee(_sUSD: PromiseOrValue, overrides?: CallOverrides): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxLiquidationDelta( - _marketKey: PromiseOrValue, - _maxLiquidationDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxMarketValue( - _marketKey: PromiseOrValue, - _maxMarketValue: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMaxPD( - _marketKey: PromiseOrValue, - _maxPD: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMinDelayTimeDelta( - _marketKey: PromiseOrValue, - _minDelayTimeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMinKeeperFee(_sUSD: PromiseOrValue, overrides?: CallOverrides): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setOffchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMaxAge: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setOffchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMinAge: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setOffchainMarketKey( - _marketKey: PromiseOrValue, - _offchainMarketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setOffchainPriceDivergence( - _marketKey: PromiseOrValue, - _offchainPriceDivergence: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _parameters: IPerpsV2MarketSettings.ParametersStruct, - overrides?: CallOverrides - ): Promise - - setSkewScale( - _marketKey: PromiseOrValue, - _skewScale: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeDelayedOrder: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - skewScale(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'KeeperLiquidationFeeUpdated(uint256)'(keeperFee?: null): KeeperLiquidationFeeUpdatedEventFilter - KeeperLiquidationFeeUpdated(keeperFee?: null): KeeperLiquidationFeeUpdatedEventFilter - - 'LiquidationBufferRatioUpdated(uint256)'(bps?: null): LiquidationBufferRatioUpdatedEventFilter - LiquidationBufferRatioUpdated(bps?: null): LiquidationBufferRatioUpdatedEventFilter - - 'LiquidationFeeRatioUpdated(uint256)'(bps?: null): LiquidationFeeRatioUpdatedEventFilter - LiquidationFeeRatioUpdated(bps?: null): LiquidationFeeRatioUpdatedEventFilter - - 'MaxKeeperFeeUpdated(uint256)'(sUSD?: null): MaxKeeperFeeUpdatedEventFilter - MaxKeeperFeeUpdated(sUSD?: null): MaxKeeperFeeUpdatedEventFilter - - 'MinInitialMarginUpdated(uint256)'(minMargin?: null): MinInitialMarginUpdatedEventFilter - MinInitialMarginUpdated(minMargin?: null): MinInitialMarginUpdatedEventFilter - - 'MinKeeperFeeUpdated(uint256)'(sUSD?: null): MinKeeperFeeUpdatedEventFilter - MinKeeperFeeUpdated(sUSD?: null): MinKeeperFeeUpdatedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - - 'ParameterUpdated(bytes32,bytes32,uint256)'( - marketKey?: PromiseOrValue | null, - parameter?: PromiseOrValue | null, - value?: null - ): ParameterUpdatedEventFilter - ParameterUpdated( - marketKey?: PromiseOrValue | null, - parameter?: PromiseOrValue | null, - value?: null - ): ParameterUpdatedEventFilter - - 'ParameterUpdatedBytes32(bytes32,bytes32,bytes32)'( - marketKey?: PromiseOrValue | null, - parameter?: PromiseOrValue | null, - value?: null - ): ParameterUpdatedBytes32EventFilter - ParameterUpdatedBytes32( - marketKey?: PromiseOrValue | null, - parameter?: PromiseOrValue | null, - value?: null - ): ParameterUpdatedBytes32EventFilter - } - - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - delayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - keeperLiquidationFee(overrides?: CallOverrides): Promise - - liquidationBufferRatio( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - liquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - makerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingVelocity( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxKeeperFee(overrides?: CallOverrides): Promise - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxLiquidationDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxMarketValue( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxPD(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - minDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - offchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainMarketKey( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainPriceDivergence( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - owner(overrides?: CallOverrides): Promise - - parameters(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setDelayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - _delayedOrderConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setKeeperLiquidationFee( - _keeperFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationBufferRatio( - _marketKey: PromiseOrValue, - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - _liquidationPremiumMultiplier: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxDelayTimeDelta( - _marketKey: PromiseOrValue, - _maxDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingVelocity( - _marketKey: PromiseOrValue, - _maxFundingVelocity: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLiquidationDelta( - _marketKey: PromiseOrValue, - _maxLiquidationDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValue( - _marketKey: PromiseOrValue, - _maxMarketValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxPD( - _marketKey: PromiseOrValue, - _maxPD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinDelayTimeDelta( - _marketKey: PromiseOrValue, - _minDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMaxAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMinAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainMarketKey( - _marketKey: PromiseOrValue, - _offchainMarketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainPriceDivergence( - _marketKey: PromiseOrValue, - _offchainPriceDivergence: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _parameters: IPerpsV2MarketSettings.ParametersStruct, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScale( - _marketKey: PromiseOrValue, - _skewScale: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScale(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFee(_marketKey: PromiseOrValue, overrides?: CallOverrides): Promise - - takerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - delayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - keeperLiquidationFee(overrides?: CallOverrides): Promise - - liquidationBufferRatio( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidationFeeRatio(overrides?: CallOverrides): Promise - - liquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - makerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxFundingVelocity( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxKeeperFee(overrides?: CallOverrides): Promise - - maxLeverage( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxLiquidationDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxMarketValue( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - maxPD( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minDelayTimeDelta( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - minInitialMargin(overrides?: CallOverrides): Promise - - minKeeperFee(overrides?: CallOverrides): Promise - - nextPriceConfirmWindow( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - offchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainMarketKey( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - offchainPriceDivergence( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - owner(overrides?: CallOverrides): Promise - - parameters( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setDelayedOrderConfirmWindow( - _marketKey: PromiseOrValue, - _delayedOrderConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setKeeperLiquidationFee( - _keeperFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationBufferRatio( - _marketKey: PromiseOrValue, - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationFeeRatio( - _ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPremiumMultiplier( - _marketKey: PromiseOrValue, - _liquidationPremiumMultiplier: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFee( - _marketKey: PromiseOrValue, - _makerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _makerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxDelayTimeDelta( - _marketKey: PromiseOrValue, - _maxDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxFundingVelocity( - _marketKey: PromiseOrValue, - _maxFundingVelocity: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLeverage( - _marketKey: PromiseOrValue, - _maxLeverage: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxLiquidationDelta( - _marketKey: PromiseOrValue, - _maxLiquidationDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxMarketValue( - _marketKey: PromiseOrValue, - _maxMarketValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMaxPD( - _marketKey: PromiseOrValue, - _maxPD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinDelayTimeDelta( - _marketKey: PromiseOrValue, - _minDelayTimeDelta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinInitialMargin( - _minMargin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinKeeperFee( - _sUSD: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setNextPriceConfirmWindow( - _marketKey: PromiseOrValue, - _nextPriceConfirmWindow: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMaxAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMaxAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainDelayedOrderMinAge( - _marketKey: PromiseOrValue, - _offchainDelayedOrderMinAge: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainMarketKey( - _marketKey: PromiseOrValue, - _offchainMarketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setOffchainPriceDivergence( - _marketKey: PromiseOrValue, - _offchainPriceDivergence: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setParameters( - _marketKey: PromiseOrValue, - _parameters: IPerpsV2MarketSettings.ParametersStruct, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSkewScale( - _marketKey: PromiseOrValue, - _skewScale: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFee( - _marketKey: PromiseOrValue, - _takerFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTakerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - _takerFeeOffchainDelayedOrder: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - skewScale( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFeeDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - takerFeeOffchainDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PerpsV2MarketSettingsInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + delayedOrderConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + keeperLiquidationFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + liquidationBufferRatio( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + liquidationFeeRatio(overrides?: CallOverrides): Promise<[BigNumber]>; + + liquidationPremiumMultiplier( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + makerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + makerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxFundingVelocity( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxKeeperFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxLiquidationDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxMarketValue( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxPD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + minDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + minInitialMargin(overrides?: CallOverrides): Promise<[BigNumber]>; + + minKeeperFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + offchainDelayedOrderMaxAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + offchainDelayedOrderMinAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + offchainMarketKey( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[string]>; + + offchainPriceDivergence( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[IPerpsV2MarketSettings.ParametersStructOutput]>; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise<[string]>; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; + + setDelayedOrderConfirmWindow( + _marketKey: BytesLike, + _delayedOrderConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setKeeperLiquidationFee( + _keeperFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationBufferRatio( + _marketKey: BytesLike, + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPremiumMultiplier( + _marketKey: BytesLike, + _liquidationPremiumMultiplier: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeDelayedOrder( + _marketKey: BytesLike, + _makerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _makerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxDelayTimeDelta( + _marketKey: BytesLike, + _maxDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingVelocity( + _marketKey: BytesLike, + _maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLiquidationDelta( + _marketKey: BytesLike, + _maxLiquidationDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValue( + _marketKey: BytesLike, + _maxMarketValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxPD( + _marketKey: BytesLike, + _maxPD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinDelayTimeDelta( + _marketKey: BytesLike, + _minDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMaxAge( + _marketKey: BytesLike, + _offchainDelayedOrderMaxAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMinAge( + _marketKey: BytesLike, + _offchainDelayedOrderMinAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainMarketKey( + _marketKey: BytesLike, + _offchainMarketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainPriceDivergence( + _marketKey: BytesLike, + _offchainPriceDivergence: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _parameters: IPerpsV2MarketSettings.ParametersStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScale( + _marketKey: BytesLike, + _skewScale: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeDelayedOrder( + _marketKey: BytesLike, + _takerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _takerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScale( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + takerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + takerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + }; + + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + delayedOrderConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + keeperLiquidationFee(overrides?: CallOverrides): Promise; + + liquidationBufferRatio( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + liquidationFeeRatio(overrides?: CallOverrides): Promise; + + liquidationPremiumMultiplier( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingVelocity( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxKeeperFee(overrides?: CallOverrides): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLiquidationDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValue( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxPD(_marketKey: BytesLike, overrides?: CallOverrides): Promise; + + minDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + offchainDelayedOrderMaxAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainDelayedOrderMinAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainMarketKey( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainPriceDivergence( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + setDelayedOrderConfirmWindow( + _marketKey: BytesLike, + _delayedOrderConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setKeeperLiquidationFee( + _keeperFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationBufferRatio( + _marketKey: BytesLike, + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPremiumMultiplier( + _marketKey: BytesLike, + _liquidationPremiumMultiplier: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeDelayedOrder( + _marketKey: BytesLike, + _makerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _makerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxDelayTimeDelta( + _marketKey: BytesLike, + _maxDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingVelocity( + _marketKey: BytesLike, + _maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLiquidationDelta( + _marketKey: BytesLike, + _maxLiquidationDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValue( + _marketKey: BytesLike, + _maxMarketValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxPD( + _marketKey: BytesLike, + _maxPD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinDelayTimeDelta( + _marketKey: BytesLike, + _minDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMaxAge( + _marketKey: BytesLike, + _offchainDelayedOrderMaxAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMinAge( + _marketKey: BytesLike, + _offchainDelayedOrderMinAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainMarketKey( + _marketKey: BytesLike, + _offchainMarketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainPriceDivergence( + _marketKey: BytesLike, + _offchainPriceDivergence: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _parameters: IPerpsV2MarketSettings.ParametersStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScale( + _marketKey: BytesLike, + _skewScale: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeDelayedOrder( + _marketKey: BytesLike, + _takerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _takerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScale( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + delayedOrderConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + keeperLiquidationFee(overrides?: CallOverrides): Promise; + + liquidationBufferRatio( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + liquidationFeeRatio(overrides?: CallOverrides): Promise; + + liquidationPremiumMultiplier( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingVelocity( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxKeeperFee(overrides?: CallOverrides): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLiquidationDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValue( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxPD(_marketKey: BytesLike, overrides?: CallOverrides): Promise; + + minDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + offchainDelayedOrderMaxAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainDelayedOrderMinAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainMarketKey( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainPriceDivergence( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rebuildCache(overrides?: CallOverrides): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + setDelayedOrderConfirmWindow( + _marketKey: BytesLike, + _delayedOrderConfirmWindow: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setKeeperLiquidationFee( + _keeperFee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationBufferRatio( + _marketKey: BytesLike, + _ratio: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationPremiumMultiplier( + _marketKey: BytesLike, + _liquidationPremiumMultiplier: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMakerFeeDelayedOrder( + _marketKey: BytesLike, + _makerFeeDelayedOrder: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _makerFeeOffchainDelayedOrder: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxDelayTimeDelta( + _marketKey: BytesLike, + _maxDelayTimeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxFundingVelocity( + _marketKey: BytesLike, + _maxFundingVelocity: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxKeeperFee( + _sUSD: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxLiquidationDelta( + _marketKey: BytesLike, + _maxLiquidationDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxMarketValue( + _marketKey: BytesLike, + _maxMarketValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxPD( + _marketKey: BytesLike, + _maxPD: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMinDelayTimeDelta( + _marketKey: BytesLike, + _minDelayTimeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setOffchainDelayedOrderMaxAge( + _marketKey: BytesLike, + _offchainDelayedOrderMaxAge: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setOffchainDelayedOrderMinAge( + _marketKey: BytesLike, + _offchainDelayedOrderMinAge: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setOffchainMarketKey( + _marketKey: BytesLike, + _offchainMarketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + setOffchainPriceDivergence( + _marketKey: BytesLike, + _offchainPriceDivergence: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setParameters( + _marketKey: BytesLike, + _parameters: IPerpsV2MarketSettings.ParametersStruct, + overrides?: CallOverrides + ): Promise; + + setSkewScale( + _marketKey: BytesLike, + _skewScale: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTakerFeeDelayedOrder( + _marketKey: BytesLike, + _takerFeeDelayedOrder: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _takerFeeOffchainDelayedOrder: BigNumberish, + overrides?: CallOverrides + ): Promise; + + skewScale( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "KeeperLiquidationFeeUpdated(uint256)"( + keeperFee?: null + ): KeeperLiquidationFeeUpdatedEventFilter; + KeeperLiquidationFeeUpdated( + keeperFee?: null + ): KeeperLiquidationFeeUpdatedEventFilter; + + "LiquidationBufferRatioUpdated(uint256)"( + bps?: null + ): LiquidationBufferRatioUpdatedEventFilter; + LiquidationBufferRatioUpdated( + bps?: null + ): LiquidationBufferRatioUpdatedEventFilter; + + "LiquidationFeeRatioUpdated(uint256)"( + bps?: null + ): LiquidationFeeRatioUpdatedEventFilter; + LiquidationFeeRatioUpdated( + bps?: null + ): LiquidationFeeRatioUpdatedEventFilter; + + "MaxKeeperFeeUpdated(uint256)"(sUSD?: null): MaxKeeperFeeUpdatedEventFilter; + MaxKeeperFeeUpdated(sUSD?: null): MaxKeeperFeeUpdatedEventFilter; + + "MinInitialMarginUpdated(uint256)"( + minMargin?: null + ): MinInitialMarginUpdatedEventFilter; + MinInitialMarginUpdated( + minMargin?: null + ): MinInitialMarginUpdatedEventFilter; + + "MinKeeperFeeUpdated(uint256)"(sUSD?: null): MinKeeperFeeUpdatedEventFilter; + MinKeeperFeeUpdated(sUSD?: null): MinKeeperFeeUpdatedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "ParameterUpdated(bytes32,bytes32,uint256)"( + marketKey?: BytesLike | null, + parameter?: BytesLike | null, + value?: null + ): ParameterUpdatedEventFilter; + ParameterUpdated( + marketKey?: BytesLike | null, + parameter?: BytesLike | null, + value?: null + ): ParameterUpdatedEventFilter; + + "ParameterUpdatedBytes32(bytes32,bytes32,bytes32)"( + marketKey?: BytesLike | null, + parameter?: BytesLike | null, + value?: null + ): ParameterUpdatedBytes32EventFilter; + ParameterUpdatedBytes32( + marketKey?: BytesLike | null, + parameter?: BytesLike | null, + value?: null + ): ParameterUpdatedBytes32EventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + delayedOrderConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + keeperLiquidationFee(overrides?: CallOverrides): Promise; + + liquidationBufferRatio( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + liquidationFeeRatio(overrides?: CallOverrides): Promise; + + liquidationPremiumMultiplier( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingVelocity( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxKeeperFee(overrides?: CallOverrides): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLiquidationDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValue( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxPD(_marketKey: BytesLike, overrides?: CallOverrides): Promise; + + minDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + offchainDelayedOrderMaxAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainDelayedOrderMinAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainMarketKey( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainPriceDivergence( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rebuildCache(overrides?: Overrides & { from?: string }): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + setDelayedOrderConfirmWindow( + _marketKey: BytesLike, + _delayedOrderConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setKeeperLiquidationFee( + _keeperFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationBufferRatio( + _marketKey: BytesLike, + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPremiumMultiplier( + _marketKey: BytesLike, + _liquidationPremiumMultiplier: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeDelayedOrder( + _marketKey: BytesLike, + _makerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _makerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxDelayTimeDelta( + _marketKey: BytesLike, + _maxDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingVelocity( + _marketKey: BytesLike, + _maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLiquidationDelta( + _marketKey: BytesLike, + _maxLiquidationDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValue( + _marketKey: BytesLike, + _maxMarketValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxPD( + _marketKey: BytesLike, + _maxPD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinDelayTimeDelta( + _marketKey: BytesLike, + _minDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMaxAge( + _marketKey: BytesLike, + _offchainDelayedOrderMaxAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMinAge( + _marketKey: BytesLike, + _offchainDelayedOrderMinAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainMarketKey( + _marketKey: BytesLike, + _offchainMarketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainPriceDivergence( + _marketKey: BytesLike, + _offchainPriceDivergence: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _parameters: IPerpsV2MarketSettings.ParametersStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScale( + _marketKey: BytesLike, + _skewScale: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeDelayedOrder( + _marketKey: BytesLike, + _takerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _takerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScale( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + delayedOrderConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + keeperLiquidationFee( + overrides?: CallOverrides + ): Promise; + + liquidationBufferRatio( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + liquidationFeeRatio( + overrides?: CallOverrides + ): Promise; + + liquidationPremiumMultiplier( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + makerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxFundingVelocity( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxKeeperFee(overrides?: CallOverrides): Promise; + + maxLeverage( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxLiquidationDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxMarketValue( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + maxPD( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minDelayTimeDelta( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + minInitialMargin(overrides?: CallOverrides): Promise; + + minKeeperFee(overrides?: CallOverrides): Promise; + + nextPriceConfirmWindow( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + offchainDelayedOrderMaxAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainDelayedOrderMinAge( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainMarketKey( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + offchainPriceDivergence( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + parameters( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + setDelayedOrderConfirmWindow( + _marketKey: BytesLike, + _delayedOrderConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setKeeperLiquidationFee( + _keeperFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationBufferRatio( + _marketKey: BytesLike, + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationFeeRatio( + _ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPremiumMultiplier( + _marketKey: BytesLike, + _liquidationPremiumMultiplier: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFee( + _marketKey: BytesLike, + _makerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeDelayedOrder( + _marketKey: BytesLike, + _makerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _makerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxDelayTimeDelta( + _marketKey: BytesLike, + _maxDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxFundingVelocity( + _marketKey: BytesLike, + _maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLeverage( + _marketKey: BytesLike, + _maxLeverage: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxLiquidationDelta( + _marketKey: BytesLike, + _maxLiquidationDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketValue( + _marketKey: BytesLike, + _maxMarketValue: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxPD( + _marketKey: BytesLike, + _maxPD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinDelayTimeDelta( + _marketKey: BytesLike, + _minDelayTimeDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinInitialMargin( + _minMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinKeeperFee( + _sUSD: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNextPriceConfirmWindow( + _marketKey: BytesLike, + _nextPriceConfirmWindow: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMaxAge( + _marketKey: BytesLike, + _offchainDelayedOrderMaxAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainDelayedOrderMinAge( + _marketKey: BytesLike, + _offchainDelayedOrderMinAge: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainMarketKey( + _marketKey: BytesLike, + _offchainMarketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setOffchainPriceDivergence( + _marketKey: BytesLike, + _offchainPriceDivergence: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setParameters( + _marketKey: BytesLike, + _parameters: IPerpsV2MarketSettings.ParametersStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + setSkewScale( + _marketKey: BytesLike, + _skewScale: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFee( + _marketKey: BytesLike, + _takerFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeDelayedOrder( + _marketKey: BytesLike, + _takerFeeDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTakerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + _takerFeeOffchainDelayedOrder: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + skewScale( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFee( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + takerFeeOffchainDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/PerpsV2MarketViews.ts b/packages/sdk/src/contracts/types/PerpsV2MarketViews.ts index bd7c3e14ca..0d7af7c19b 100644 --- a/packages/sdk/src/contracts/types/PerpsV2MarketViews.ts +++ b/packages/sdk/src/contracts/types/PerpsV2MarketViews.ts @@ -2,860 +2,1085 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IPerpsV2MarketBaseTypes { - export type PositionStruct = { - id: PromiseOrValue - lastFundingIndex: PromiseOrValue - margin: PromiseOrValue - lastPrice: PromiseOrValue - size: PromiseOrValue - } - - export type PositionStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } + export type PositionStruct = { + id: BigNumberish; + lastFundingIndex: BigNumberish; + margin: BigNumberish; + lastPrice: BigNumberish; + size: BigNumberish; + }; + + export type PositionStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + }; } export interface PerpsV2MarketViewsInterface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'accessibleMargin(address)': FunctionFragment - 'accruedFunding(address)': FunctionFragment - 'assetPrice()': FunctionFragment - 'baseAsset()': FunctionFragment - 'canLiquidate(address)': FunctionFragment - 'currentFundingRate()': FunctionFragment - 'currentFundingVelocity()': FunctionFragment - 'fillPrice(int256)': FunctionFragment - 'fundingLastRecomputed()': FunctionFragment - 'fundingSequence(uint256)': FunctionFragment - 'fundingSequenceLength()': FunctionFragment - 'isResolverCached()': FunctionFragment - 'liquidationFee(address)': FunctionFragment - 'liquidationPrice(address)': FunctionFragment - 'marketDebt()': FunctionFragment - 'marketKey()': FunctionFragment - 'marketSize()': FunctionFragment - 'marketSizes()': FunctionFragment - 'marketSkew()': FunctionFragment - 'marketState()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'notionalValue(address)': FunctionFragment - 'orderFee(int256,uint8)': FunctionFragment - 'owner()': FunctionFragment - 'positions(address)': FunctionFragment - 'postTradeDetails(int256,uint256,uint8,address)': FunctionFragment - 'profitLoss(address)': FunctionFragment - 'rebuildCache()': FunctionFragment - 'remainingMargin(address)': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'unrecordedFunding()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'accessibleMargin' - | 'accruedFunding' - | 'assetPrice' - | 'baseAsset' - | 'canLiquidate' - | 'currentFundingRate' - | 'currentFundingVelocity' - | 'fillPrice' - | 'fundingLastRecomputed' - | 'fundingSequence' - | 'fundingSequenceLength' - | 'isResolverCached' - | 'liquidationFee' - | 'liquidationPrice' - | 'marketDebt' - | 'marketKey' - | 'marketSize' - | 'marketSizes' - | 'marketSkew' - | 'marketState' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'notionalValue' - | 'orderFee' - | 'owner' - | 'positions' - | 'postTradeDetails' - | 'profitLoss' - | 'rebuildCache' - | 'remainingMargin' - | 'resolver' - | 'resolverAddressesRequired' - | 'unrecordedFunding' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'accessibleMargin', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'accruedFunding', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'assetPrice', values?: undefined): string - encodeFunctionData(functionFragment: 'baseAsset', values?: undefined): string - encodeFunctionData(functionFragment: 'canLiquidate', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'currentFundingRate', values?: undefined): string - encodeFunctionData(functionFragment: 'currentFundingVelocity', values?: undefined): string - encodeFunctionData(functionFragment: 'fillPrice', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'fundingLastRecomputed', values?: undefined): string - encodeFunctionData( - functionFragment: 'fundingSequence', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'fundingSequenceLength', values?: undefined): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidationFee', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'liquidationPrice', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'marketDebt', values?: undefined): string - encodeFunctionData(functionFragment: 'marketKey', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSize', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSizes', values?: undefined): string - encodeFunctionData(functionFragment: 'marketSkew', values?: undefined): string - encodeFunctionData(functionFragment: 'marketState', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'notionalValue', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'orderFee', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'positions', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'postTradeDetails', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData(functionFragment: 'profitLoss', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'remainingMargin', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData(functionFragment: 'unrecordedFunding', values?: undefined): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'accessibleMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'accruedFunding', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'assetPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'baseAsset', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'canLiquidate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currentFundingRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currentFundingVelocity', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fillPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingLastRecomputed', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingSequence', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'fundingSequenceLength', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketDebt', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSize', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSizes', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketSkew', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'marketState', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'notionalValue', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'orderFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'positions', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'postTradeDetails', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'profitLoss', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'remainingMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'unrecordedFunding', data: BytesLike): Result - - events: { - 'CacheUpdated(bytes32,address)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment + functions: { + "acceptOwnership()": FunctionFragment; + "accessibleMargin(address)": FunctionFragment; + "accruedFunding(address)": FunctionFragment; + "assetPrice()": FunctionFragment; + "baseAsset()": FunctionFragment; + "canLiquidate(address)": FunctionFragment; + "currentFundingRate()": FunctionFragment; + "currentFundingVelocity()": FunctionFragment; + "fillPrice(int256)": FunctionFragment; + "fundingLastRecomputed()": FunctionFragment; + "fundingSequence(uint256)": FunctionFragment; + "fundingSequenceLength()": FunctionFragment; + "isResolverCached()": FunctionFragment; + "liquidationFee(address)": FunctionFragment; + "liquidationPrice(address)": FunctionFragment; + "marketDebt()": FunctionFragment; + "marketKey()": FunctionFragment; + "marketSize()": FunctionFragment; + "marketSizes()": FunctionFragment; + "marketSkew()": FunctionFragment; + "marketState()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "notionalValue(address)": FunctionFragment; + "orderFee(int256,uint8)": FunctionFragment; + "owner()": FunctionFragment; + "positions(address)": FunctionFragment; + "postTradeDetails(int256,uint256,uint8,address)": FunctionFragment; + "profitLoss(address)": FunctionFragment; + "rebuildCache()": FunctionFragment; + "remainingMargin(address)": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "unrecordedFunding()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "accessibleMargin" + | "accruedFunding" + | "assetPrice" + | "baseAsset" + | "canLiquidate" + | "currentFundingRate" + | "currentFundingVelocity" + | "fillPrice" + | "fundingLastRecomputed" + | "fundingSequence" + | "fundingSequenceLength" + | "isResolverCached" + | "liquidationFee" + | "liquidationPrice" + | "marketDebt" + | "marketKey" + | "marketSize" + | "marketSizes" + | "marketSkew" + | "marketState" + | "nominateNewOwner" + | "nominatedOwner" + | "notionalValue" + | "orderFee" + | "owner" + | "positions" + | "postTradeDetails" + | "profitLoss" + | "rebuildCache" + | "remainingMargin" + | "resolver" + | "resolverAddressesRequired" + | "unrecordedFunding" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "accessibleMargin", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "accruedFunding", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "assetPrice", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "baseAsset", values?: undefined): string; + encodeFunctionData( + functionFragment: "canLiquidate", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "currentFundingRate", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "currentFundingVelocity", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "fillPrice", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fundingLastRecomputed", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "fundingSequence", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fundingSequenceLength", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationFee", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "liquidationPrice", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "marketDebt", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "marketKey", values?: undefined): string; + encodeFunctionData( + functionFragment: "marketSize", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "marketSizes", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "marketSkew", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "marketState", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "notionalValue", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "orderFee", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "positions", values: [string]): string; + encodeFunctionData( + functionFragment: "postTradeDetails", + values: [BigNumberish, BigNumberish, BigNumberish, string] + ): string; + encodeFunctionData(functionFragment: "profitLoss", values: [string]): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "remainingMargin", + values: [string] + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "unrecordedFunding", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "accessibleMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "accruedFunding", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "assetPrice", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "baseAsset", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "canLiquidate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentFundingRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentFundingVelocity", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "fillPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "fundingLastRecomputed", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingSequence", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fundingSequenceLength", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationPrice", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "marketDebt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "marketKey", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "marketSize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "marketSizes", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "marketSkew", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "marketState", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "notionalValue", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "orderFee", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "positions", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "postTradeDetails", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "profitLoss", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "remainingMargin", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "unrecordedFunding", + data: BytesLike + ): Result; + + events: { + "CacheUpdated(bytes32,address)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; } export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface PerpsV2MarketViews extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: PerpsV2MarketViewsInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise<[string] & { key: string }> - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]> - - currentFundingRate(overrides?: CallOverrides): Promise<[BigNumber]> - - currentFundingVelocity(overrides?: CallOverrides): Promise<[BigNumber]> - - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - fundingLastRecomputed(overrides?: CallOverrides): Promise<[number]> - - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - fundingSequenceLength(overrides?: CallOverrides): Promise<[BigNumber]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise<[string] & { key: string }> - - marketSize(overrides?: CallOverrides): Promise<[BigNumber]> - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise<[BigNumber]> - - marketState(overrides?: CallOverrides): Promise<[string]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - owner(overrides?: CallOverrides): Promise<[string]> - - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[IPerpsV2MarketBaseTypes.PositionStructOutput]> - - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > - - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - } - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> - - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - baseAsset(overrides?: CallOverrides): Promise - - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise - - currentFundingRate(overrides?: CallOverrides): Promise - - currentFundingVelocity(overrides?: CallOverrides): Promise - - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - fundingLastRecomputed(overrides?: CallOverrides): Promise - - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - fundingSequenceLength(overrides?: CallOverrides): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise - - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> - - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }> - - marketKey(overrides?: CallOverrides): Promise - - marketSize(overrides?: CallOverrides): Promise - - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> - - marketSkew(overrides?: CallOverrides): Promise - - marketState(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> - - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> - - owner(overrides?: CallOverrides): Promise - - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> + interface: PerpsV2MarketViewsInterface; - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - resolver(overrides?: CallOverrides): Promise + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise<[string] & { key: string }>; + + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + currentFundingRate(overrides?: CallOverrides): Promise<[BigNumber]>; + + currentFundingVelocity(overrides?: CallOverrides): Promise<[BigNumber]>; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + fundingLastRecomputed(overrides?: CallOverrides): Promise<[number]>; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + fundingSequenceLength(overrides?: CallOverrides): Promise<[BigNumber]>; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise<[string] & { key: string }>; + + marketSize(overrides?: CallOverrides): Promise<[BigNumber]>; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise<[BigNumber]>; + + marketState(overrides?: CallOverrides): Promise<[string]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; + + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + positions( + account: string, + overrides?: CallOverrides + ): Promise<[IPerpsV2MarketBaseTypes.PositionStructOutput]>; - resolverAddressesRequired(overrides?: CallOverrides): Promise + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean }> + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> + resolver(overrides?: CallOverrides): Promise<[string]>; - assetPrice( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; - baseAsset(overrides?: CallOverrides): Promise + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + }; - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate(account: string, overrides?: CallOverrides): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + currentFundingVelocity(overrides?: CallOverrides): Promise; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise; - currentFundingRate(overrides?: CallOverrides): Promise + marketState(overrides?: CallOverrides): Promise; - currentFundingVelocity(overrides?: CallOverrides): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> + nominatedOwner(overrides?: CallOverrides): Promise; - fundingLastRecomputed(overrides?: CallOverrides): Promise + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; - fundingSequenceLength(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - isResolverCached(overrides?: CallOverrides): Promise + positions( + account: string, + overrides?: CallOverrides + ): Promise; - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }> + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; - marketDebt( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }> + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - marketKey(overrides?: CallOverrides): Promise + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; - marketSize(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - marketSizes( - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }> + resolverAddressesRequired(overrides?: CallOverrides): Promise; - marketSkew(overrides?: CallOverrides): Promise + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; - marketState(overrides?: CallOverrides): Promise + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginAccessible: BigNumber; invalid: boolean } + >; + + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; - nominatedOwner(overrides?: CallOverrides): Promise + assetPrice( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + baseAsset(overrides?: CallOverrides): Promise; + + canLiquidate(account: string, overrides?: CallOverrides): Promise; + + currentFundingRate(overrides?: CallOverrides): Promise; + + currentFundingVelocity(overrides?: CallOverrides): Promise; + + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + fundingLastRecomputed(overrides?: CallOverrides): Promise; + + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fundingSequenceLength(overrides?: CallOverrides): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + marketDebt( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { debt: BigNumber; invalid: boolean }>; + + marketKey(overrides?: CallOverrides): Promise; + + marketSize(overrides?: CallOverrides): Promise; + + marketSizes( + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { long: BigNumber; short: BigNumber }>; + + marketSkew(overrides?: CallOverrides): Promise; + + marketState(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }> + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { value: BigNumber; invalid: boolean }>; - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }> + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { fee: BigNumber; invalid: boolean }>; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + positions( + account: string, + overrides?: CallOverrides + ): Promise; - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { - margin: BigNumber - size: BigNumber - price: BigNumber - liqPrice: BigNumber - fee: BigNumber - status: number - } - > + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number] & { + margin: BigNumber; + size: BigNumber; + price: BigNumber; + liqPrice: BigNumber; + fee: BigNumber; + status: number; + } + >; - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }> + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { pnl: BigNumber; invalid: boolean }>; - rebuildCache(overrides?: CallOverrides): Promise + rebuildCache(overrides?: CallOverrides): Promise; - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean }> + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } + >; - resolver(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - unrecordedFunding( - overrides?: CallOverrides - ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }> - } + unrecordedFunding( + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { funding: BigNumber; invalid: boolean }>; + }; - filters: { - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter + filters: { + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - } + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + }; - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - accessibleMargin(account: PromiseOrValue, overrides?: CallOverrides): Promise + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise; - accruedFunding(account: PromiseOrValue, overrides?: CallOverrides): Promise + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise; - assetPrice(overrides?: CallOverrides): Promise + assetPrice(overrides?: CallOverrides): Promise; - baseAsset(overrides?: CallOverrides): Promise + baseAsset(overrides?: CallOverrides): Promise; - canLiquidate(account: PromiseOrValue, overrides?: CallOverrides): Promise + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise; - currentFundingRate(overrides?: CallOverrides): Promise + currentFundingRate(overrides?: CallOverrides): Promise; - currentFundingVelocity(overrides?: CallOverrides): Promise + currentFundingVelocity(overrides?: CallOverrides): Promise; - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; - fundingLastRecomputed(overrides?: CallOverrides): Promise + fundingLastRecomputed(overrides?: CallOverrides): Promise; - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; - fundingSequenceLength(overrides?: CallOverrides): Promise + fundingSequenceLength(overrides?: CallOverrides): Promise; - isResolverCached(overrides?: CallOverrides): Promise + isResolverCached(overrides?: CallOverrides): Promise; - liquidationFee(account: PromiseOrValue, overrides?: CallOverrides): Promise + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; - liquidationPrice(account: PromiseOrValue, overrides?: CallOverrides): Promise + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise; - marketDebt(overrides?: CallOverrides): Promise + marketDebt(overrides?: CallOverrides): Promise; - marketKey(overrides?: CallOverrides): Promise + marketKey(overrides?: CallOverrides): Promise; - marketSize(overrides?: CallOverrides): Promise + marketSize(overrides?: CallOverrides): Promise; - marketSizes(overrides?: CallOverrides): Promise + marketSizes(overrides?: CallOverrides): Promise; - marketSkew(overrides?: CallOverrides): Promise + marketSkew(overrides?: CallOverrides): Promise; - marketState(overrides?: CallOverrides): Promise + marketState(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - notionalValue(account: PromiseOrValue, overrides?: CallOverrides): Promise + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise; - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - positions(account: PromiseOrValue, overrides?: CallOverrides): Promise + positions(account: string, overrides?: CallOverrides): Promise; - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise; - profitLoss(account: PromiseOrValue, overrides?: CallOverrides): Promise + profitLoss(account: string, overrides?: CallOverrides): Promise; - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise + rebuildCache(overrides?: Overrides & { from?: string }): Promise; - remainingMargin(account: PromiseOrValue, overrides?: CallOverrides): Promise + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise; - resolver(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - unrecordedFunding(overrides?: CallOverrides): Promise - } + unrecordedFunding(overrides?: CallOverrides): Promise; + }; - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - accessibleMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + accessibleMargin( + account: string, + overrides?: CallOverrides + ): Promise; - accruedFunding( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + accruedFunding( + account: string, + overrides?: CallOverrides + ): Promise; - assetPrice(overrides?: CallOverrides): Promise + assetPrice(overrides?: CallOverrides): Promise; - baseAsset(overrides?: CallOverrides): Promise + baseAsset(overrides?: CallOverrides): Promise; - canLiquidate( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + canLiquidate( + account: string, + overrides?: CallOverrides + ): Promise; - currentFundingRate(overrides?: CallOverrides): Promise + currentFundingRate( + overrides?: CallOverrides + ): Promise; - currentFundingVelocity(overrides?: CallOverrides): Promise + currentFundingVelocity( + overrides?: CallOverrides + ): Promise; - fillPrice( - sizeDelta: PromiseOrValue, - overrides?: CallOverrides - ): Promise + fillPrice( + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; - fundingLastRecomputed(overrides?: CallOverrides): Promise + fundingLastRecomputed( + overrides?: CallOverrides + ): Promise; - fundingSequence( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise + fundingSequence( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; - fundingSequenceLength(overrides?: CallOverrides): Promise + fundingSequenceLength( + overrides?: CallOverrides + ): Promise; - isResolverCached(overrides?: CallOverrides): Promise + isResolverCached(overrides?: CallOverrides): Promise; - liquidationFee( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationFee( + account: string, + overrides?: CallOverrides + ): Promise; - liquidationPrice( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationPrice( + account: string, + overrides?: CallOverrides + ): Promise; - marketDebt(overrides?: CallOverrides): Promise + marketDebt(overrides?: CallOverrides): Promise; - marketKey(overrides?: CallOverrides): Promise + marketKey(overrides?: CallOverrides): Promise; - marketSize(overrides?: CallOverrides): Promise + marketSize(overrides?: CallOverrides): Promise; - marketSizes(overrides?: CallOverrides): Promise + marketSizes(overrides?: CallOverrides): Promise; - marketSkew(overrides?: CallOverrides): Promise + marketSkew(overrides?: CallOverrides): Promise; - marketState(overrides?: CallOverrides): Promise + marketState(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - notionalValue( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + notionalValue( + account: string, + overrides?: CallOverrides + ): Promise; - orderFee( - sizeDelta: PromiseOrValue, - orderType: PromiseOrValue, - overrides?: CallOverrides - ): Promise + orderFee( + sizeDelta: BigNumberish, + orderType: BigNumberish, + overrides?: CallOverrides + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - positions( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + positions( + account: string, + overrides?: CallOverrides + ): Promise; - postTradeDetails( - sizeDelta: PromiseOrValue, - tradePrice: PromiseOrValue, - orderType: PromiseOrValue, - sender: PromiseOrValue, - overrides?: CallOverrides - ): Promise + postTradeDetails( + sizeDelta: BigNumberish, + tradePrice: BigNumberish, + orderType: BigNumberish, + sender: string, + overrides?: CallOverrides + ): Promise; - profitLoss( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + profitLoss( + account: string, + overrides?: CallOverrides + ): Promise; - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - remainingMargin( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + remainingMargin( + account: string, + overrides?: CallOverrides + ): Promise; - resolver(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; - unrecordedFunding(overrides?: CallOverrides): Promise - } + unrecordedFunding(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/PerpsV3AccountProxy.ts b/packages/sdk/src/contracts/types/PerpsV3AccountProxy.ts new file mode 100644 index 0000000000..4e31b81526 --- /dev/null +++ b/packages/sdk/src/contracts/types/PerpsV3AccountProxy.ts @@ -0,0 +1,1174 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; + +export interface PerpsV3AccountProxyInterface extends utils.Interface { + functions: { + "acceptOwnership()": FunctionFragment; + "getImplementation()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "renounceNomination()": FunctionFragment; + "simulateUpgradeTo(address)": FunctionFragment; + "upgradeTo(address)": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "burn(uint256)": FunctionFragment; + "getApproved(uint256)": FunctionFragment; + "initialize(string,string,string)": FunctionFragment; + "isApprovedForAll(address,address)": FunctionFragment; + "isInitialized()": FunctionFragment; + "mint(address,uint256)": FunctionFragment; + "name()": FunctionFragment; + "ownerOf(uint256)": FunctionFragment; + "safeMint(address,uint256,bytes)": FunctionFragment; + "safeTransferFrom(address,address,uint256)": FunctionFragment; + "safeTransferFrom(address,address,uint256,bytes)": FunctionFragment; + "setAllowance(uint256,address)": FunctionFragment; + "setApprovalForAll(address,bool)": FunctionFragment; + "setBaseTokenURI(string)": FunctionFragment; + "supportsInterface(bytes4)": FunctionFragment; + "symbol()": FunctionFragment; + "tokenByIndex(uint256)": FunctionFragment; + "tokenOfOwnerByIndex(address,uint256)": FunctionFragment; + "tokenURI(uint256)": FunctionFragment; + "totalSupply()": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "getImplementation" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "renounceNomination" + | "simulateUpgradeTo" + | "upgradeTo" + | "approve" + | "balanceOf" + | "burn" + | "getApproved" + | "initialize" + | "isApprovedForAll" + | "isInitialized" + | "mint" + | "name" + | "ownerOf" + | "safeMint" + | "safeTransferFrom(address,address,uint256)" + | "safeTransferFrom(address,address,uint256,bytes)" + | "setAllowance" + | "setApprovalForAll" + | "setBaseTokenURI" + | "supportsInterface" + | "symbol" + | "tokenByIndex" + | "tokenOfOwnerByIndex" + | "tokenURI" + | "totalSupply" + | "transferFrom" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getImplementation", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "renounceNomination", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "simulateUpgradeTo", + values: [string] + ): string; + encodeFunctionData(functionFragment: "upgradeTo", values: [string]): string; + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData(functionFragment: "burn", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [string, string, string] + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "isInitialized", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "mint", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "safeMint", + values: [string, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom(address,address,uint256)", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom(address,address,uint256,bytes)", + values: [string, string, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "setAllowance", + values: [BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [string, boolean] + ): string; + encodeFunctionData( + functionFragment: "setBaseTokenURI", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "supportsInterface", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "tokenByIndex", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenOfOwnerByIndex", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenURI", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getImplementation", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "renounceNomination", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "simulateUpgradeTo", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "upgradeTo", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isInitialized", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "safeMint", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom(address,address,uint256)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom(address,address,uint256,bytes)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setBaseTokenURI", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportsInterface", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "tokenByIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenOfOwnerByIndex", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "tokenURI", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + + events: { + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "Upgraded(address,address)": EventFragment; + "Approval(address,address,uint256)": EventFragment; + "ApprovalForAll(address,address,bool)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; +} + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface UpgradedEventObject { + self: string; + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string, string], UpgradedEventObject>; + +export type UpgradedEventFilter = TypedEventFilter; + +export interface ApprovalEventObject { + owner: string; + approved: string; + tokenId: BigNumber; +} +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface ApprovalForAllEventObject { + owner: string; + operator: string; + approved: boolean; +} +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean], + ApprovalForAllEventObject +>; + +export type ApprovalForAllEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + tokenId: BigNumber; +} +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; + +export type TransferEventFilter = TypedEventFilter; + +export interface PerpsV3AccountProxy extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PerpsV3AccountProxyInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise<[string]>; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf( + holder: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { balance: BigNumber }>; + + burn( + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string] & { operator: string }>; + + initialize( + tokenName: string, + tokenSymbol: string, + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isApprovedForAll( + holder: string, + operator: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + isInitialized(overrides?: CallOverrides): Promise<[boolean]>; + + mint( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + safeMint( + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setAllowance( + tokenId: BigNumberish, + spender: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setBaseTokenURI( + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + tokenURI( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(holder: string, overrides?: CallOverrides): Promise; + + burn( + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + initialize( + tokenName: string, + tokenSymbol: string, + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isApprovedForAll( + holder: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + isInitialized(overrides?: CallOverrides): Promise; + + mint( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + safeMint( + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setAllowance( + tokenId: BigNumberish, + spender: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setBaseTokenURI( + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: CallOverrides + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination(overrides?: CallOverrides): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: CallOverrides + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: CallOverrides + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(holder: string, overrides?: CallOverrides): Promise; + + burn(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + initialize( + tokenName: string, + tokenSymbol: string, + uri: string, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + holder: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + isInitialized(overrides?: CallOverrides): Promise; + + mint( + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + name(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + safeMint( + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + setAllowance( + tokenId: BigNumberish, + spender: string, + overrides?: CallOverrides + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: CallOverrides + ): Promise; + + setBaseTokenURI(uri: string, overrides?: CallOverrides): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "Upgraded(address,address)"( + self?: string | null, + implementation?: null + ): UpgradedEventFilter; + Upgraded(self?: string | null, implementation?: null): UpgradedEventFilter; + + "Approval(address,address,uint256)"( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): ApprovalEventFilter; + Approval( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): ApprovalEventFilter; + + "ApprovalForAll(address,address,bool)"( + owner?: string | null, + operator?: string | null, + approved?: null + ): ApprovalForAllEventFilter; + ApprovalForAll( + owner?: string | null, + operator?: string | null, + approved?: null + ): ApprovalForAllEventFilter; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TransferEventFilter; + Transfer( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TransferEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(holder: string, overrides?: CallOverrides): Promise; + + burn( + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + initialize( + tokenName: string, + tokenSymbol: string, + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isApprovedForAll( + holder: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + isInitialized(overrides?: CallOverrides): Promise; + + mint( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + safeMint( + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setAllowance( + tokenId: BigNumberish, + spender: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setBaseTokenURI( + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf( + holder: string, + overrides?: CallOverrides + ): Promise; + + burn( + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + initialize( + tokenName: string, + tokenSymbol: string, + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isApprovedForAll( + holder: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + isInitialized(overrides?: CallOverrides): Promise; + + mint( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + safeMint( + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + setAllowance( + tokenId: BigNumberish, + spender: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setBaseTokenURI( + uri: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; +} diff --git a/packages/sdk/src/contracts/types/PerpsV3MarketProxy.ts b/packages/sdk/src/contracts/types/PerpsV3MarketProxy.ts new file mode 100644 index 0000000000..01a325c7a7 --- /dev/null +++ b/packages/sdk/src/contracts/types/PerpsV3MarketProxy.ts @@ -0,0 +1,4441 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; + +export declare namespace IAccountModule { + export type AccountPermissionsStruct = { + user: string; + permissions: BytesLike[]; + }; + + export type AccountPermissionsStructOutput = [string, string[]] & { + user: string; + permissions: string[]; + }; +} + +export declare namespace IPerpsMarketModule { + export type MarketSummaryStruct = { + skew: BigNumberish; + size: BigNumberish; + maxOpenInterest: BigNumberish; + currentFundingRate: BigNumberish; + currentFundingVelocity: BigNumberish; + indexPrice: BigNumberish; + }; + + export type MarketSummaryStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + skew: BigNumber; + size: BigNumber; + maxOpenInterest: BigNumber; + currentFundingRate: BigNumber; + currentFundingVelocity: BigNumber; + indexPrice: BigNumber; + }; +} + +export declare namespace AsyncOrder { + export type OrderCommitmentRequestStruct = { + marketId: BigNumberish; + accountId: BigNumberish; + sizeDelta: BigNumberish; + settlementStrategyId: BigNumberish; + acceptablePrice: BigNumberish; + trackingCode: BytesLike; + referrer: string; + }; + + export type OrderCommitmentRequestStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + string + ] & { + marketId: BigNumber; + accountId: BigNumber; + sizeDelta: BigNumber; + settlementStrategyId: BigNumber; + acceptablePrice: BigNumber; + trackingCode: string; + referrer: string; + }; + + export type DataStruct = { + settlementTime: BigNumberish; + request: AsyncOrder.OrderCommitmentRequestStruct; + }; + + export type DataStructOutput = [ + BigNumber, + AsyncOrder.OrderCommitmentRequestStructOutput + ] & { + settlementTime: BigNumber; + request: AsyncOrder.OrderCommitmentRequestStructOutput; + }; +} + +export declare namespace SettlementStrategy { + export type DataStruct = { + strategyType: BigNumberish; + settlementDelay: BigNumberish; + settlementWindowDuration: BigNumberish; + priceWindowDuration: BigNumberish; + priceVerificationContract: string; + feedId: BytesLike; + url: string; + settlementReward: BigNumberish; + priceDeviationTolerance: BigNumberish; + disabled: boolean; + }; + + export type DataStructOutput = [ + number, + BigNumber, + BigNumber, + BigNumber, + string, + string, + string, + BigNumber, + BigNumber, + boolean + ] & { + strategyType: number; + settlementDelay: BigNumber; + settlementWindowDuration: BigNumber; + priceWindowDuration: BigNumber; + priceVerificationContract: string; + feedId: string; + url: string; + settlementReward: BigNumber; + priceDeviationTolerance: BigNumber; + disabled: boolean; + }; +} + +export interface PerpsV3MarketProxyInterface extends utils.Interface { + functions: { + "createAccount()": FunctionFragment; + "createAccount(uint128)": FunctionFragment; + "getAccountLastInteraction(uint128)": FunctionFragment; + "getAccountOwner(uint128)": FunctionFragment; + "getAccountPermissions(uint128)": FunctionFragment; + "getAccountTokenAddress()": FunctionFragment; + "grantPermission(uint128,bytes32,address)": FunctionFragment; + "hasPermission(uint128,bytes32,address)": FunctionFragment; + "isAuthorized(uint128,bytes32,address)": FunctionFragment; + "notifyAccountTransfer(address,uint128)": FunctionFragment; + "renouncePermission(uint128,bytes32)": FunctionFragment; + "revokePermission(uint128,bytes32,address)": FunctionFragment; + "getAssociatedSystem(bytes32)": FunctionFragment; + "initOrUpgradeNft(bytes32,string,string,string,address)": FunctionFragment; + "initOrUpgradeToken(bytes32,string,string,uint8,address)": FunctionFragment; + "registerUnmanagedSystem(bytes32,address)": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "getImplementation()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "renounceNomination()": FunctionFragment; + "simulateUpgradeTo(address)": FunctionFragment; + "upgradeTo(address)": FunctionFragment; + "createMarket(uint128,string,string)": FunctionFragment; + "initializeFactory()": FunctionFragment; + "minimumCredit(uint128)": FunctionFragment; + "name(uint128)": FunctionFragment; + "reportedDebt(uint128)": FunctionFragment; + "setSpotMarket(address)": FunctionFragment; + "setSynthetix(address)": FunctionFragment; + "supportsInterface(bytes4)": FunctionFragment; + "getAvailableMargin(uint128)": FunctionFragment; + "getCollateralAmount(uint128,uint128)": FunctionFragment; + "getOpenPosition(uint128,uint128)": FunctionFragment; + "getRequiredMargins(uint128)": FunctionFragment; + "getWithdrawableMargin(uint128)": FunctionFragment; + "modifyCollateral(uint128,uint128,int256)": FunctionFragment; + "totalAccountOpenInterest(uint128)": FunctionFragment; + "totalCollateralValue(uint128)": FunctionFragment; + "currentFundingRate(uint128)": FunctionFragment; + "currentFundingVelocity(uint128)": FunctionFragment; + "fillPrice(uint128,int128,uint256)": FunctionFragment; + "getMarketSummary(uint128)": FunctionFragment; + "indexPrice(uint128)": FunctionFragment; + "maxOpenInterest(uint128)": FunctionFragment; + "metadata(uint128)": FunctionFragment; + "size(uint128)": FunctionFragment; + "skew(uint128)": FunctionFragment; + "commitOrder((uint128,uint128,int128,uint128,uint256,bytes32,address))": FunctionFragment; + "computeOrderFees(uint128,int128)": FunctionFragment; + "getOrder(uint128)": FunctionFragment; + "PRECISION()": FunctionFragment; + "settle(uint128)": FunctionFragment; + "settlePythOrder(bytes,bytes)": FunctionFragment; + "addToFeatureFlagAllowlist(bytes32,address)": FunctionFragment; + "getDeniers(bytes32)": FunctionFragment; + "getFeatureFlagAllowAll(bytes32)": FunctionFragment; + "getFeatureFlagAllowlist(bytes32)": FunctionFragment; + "getFeatureFlagDenyAll(bytes32)": FunctionFragment; + "isFeatureAllowed(bytes32,address)": FunctionFragment; + "removeFromFeatureFlagAllowlist(bytes32,address)": FunctionFragment; + "setDeniers(bytes32,address[])": FunctionFragment; + "setFeatureFlagAllowAll(bytes32,bool)": FunctionFragment; + "setFeatureFlagDenyAll(bytes32,bool)": FunctionFragment; + "liquidate(uint128)": FunctionFragment; + "liquidateFlagged()": FunctionFragment; + "addSettlementStrategy(uint128,(uint8,uint256,uint256,uint256,address,bytes32,string,uint256,uint256,bool))": FunctionFragment; + "getFundingParameters(uint128)": FunctionFragment; + "getLiquidationParameters(uint128)": FunctionFragment; + "getLockedOiRatio(uint128)": FunctionFragment; + "getMaxMarketSize(uint128)": FunctionFragment; + "getOrderFees(uint128)": FunctionFragment; + "getSettlementStrategy(uint128,uint256)": FunctionFragment; + "setFundingParameters(uint128,uint256,uint256)": FunctionFragment; + "setLiquidationParameters(uint128,uint256,uint256,uint256,uint256,uint256,uint256)": FunctionFragment; + "setLockedOiRatio(uint128,uint256)": FunctionFragment; + "setMaxMarketSize(uint128,uint256)": FunctionFragment; + "setOrderFees(uint128,uint256,uint256)": FunctionFragment; + "setSettlementStrategyEnabled(uint128,uint256,bool)": FunctionFragment; + "updatePriceData(uint128,bytes32)": FunctionFragment; + "getFeeCollector()": FunctionFragment; + "getLiquidationRewardGuards()": FunctionFragment; + "getMaxCollateralAmount(uint128)": FunctionFragment; + "getReferrerShare(address)": FunctionFragment; + "getSynthDeductionPriority()": FunctionFragment; + "setFeeCollector(address)": FunctionFragment; + "setLiquidationRewardGuards(uint256,uint256)": FunctionFragment; + "setMaxCollateralAmount(uint128,uint256)": FunctionFragment; + "setSynthDeductionPriority(uint128[])": FunctionFragment; + "totalGlobalCollateralValue()": FunctionFragment; + "updateReferrerShare(address,uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "createAccount()" + | "createAccount(uint128)" + | "getAccountLastInteraction" + | "getAccountOwner" + | "getAccountPermissions" + | "getAccountTokenAddress" + | "grantPermission" + | "hasPermission" + | "isAuthorized" + | "notifyAccountTransfer" + | "renouncePermission" + | "revokePermission" + | "getAssociatedSystem" + | "initOrUpgradeNft" + | "initOrUpgradeToken" + | "registerUnmanagedSystem" + | "acceptOwnership" + | "getImplementation" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "renounceNomination" + | "simulateUpgradeTo" + | "upgradeTo" + | "createMarket" + | "initializeFactory" + | "minimumCredit" + | "name" + | "reportedDebt" + | "setSpotMarket" + | "setSynthetix" + | "supportsInterface" + | "getAvailableMargin" + | "getCollateralAmount" + | "getOpenPosition" + | "getRequiredMargins" + | "getWithdrawableMargin" + | "modifyCollateral" + | "totalAccountOpenInterest" + | "totalCollateralValue" + | "currentFundingRate" + | "currentFundingVelocity" + | "fillPrice" + | "getMarketSummary" + | "indexPrice" + | "maxOpenInterest" + | "metadata" + | "size" + | "skew" + | "commitOrder" + | "computeOrderFees" + | "getOrder" + | "PRECISION" + | "settle" + | "settlePythOrder" + | "addToFeatureFlagAllowlist" + | "getDeniers" + | "getFeatureFlagAllowAll" + | "getFeatureFlagAllowlist" + | "getFeatureFlagDenyAll" + | "isFeatureAllowed" + | "removeFromFeatureFlagAllowlist" + | "setDeniers" + | "setFeatureFlagAllowAll" + | "setFeatureFlagDenyAll" + | "liquidate" + | "liquidateFlagged" + | "addSettlementStrategy" + | "getFundingParameters" + | "getLiquidationParameters" + | "getLockedOiRatio" + | "getMaxMarketSize" + | "getOrderFees" + | "getSettlementStrategy" + | "setFundingParameters" + | "setLiquidationParameters" + | "setLockedOiRatio" + | "setMaxMarketSize" + | "setOrderFees" + | "setSettlementStrategyEnabled" + | "updatePriceData" + | "getFeeCollector" + | "getLiquidationRewardGuards" + | "getMaxCollateralAmount" + | "getReferrerShare" + | "getSynthDeductionPriority" + | "setFeeCollector" + | "setLiquidationRewardGuards" + | "setMaxCollateralAmount" + | "setSynthDeductionPriority" + | "totalGlobalCollateralValue" + | "updateReferrerShare" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "createAccount()", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "createAccount(uint128)", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getAccountLastInteraction", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getAccountOwner", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getAccountPermissions", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getAccountTokenAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "grantPermission", + values: [BigNumberish, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "hasPermission", + values: [BigNumberish, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "isAuthorized", + values: [BigNumberish, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "notifyAccountTransfer", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renouncePermission", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "revokePermission", + values: [BigNumberish, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "getAssociatedSystem", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "initOrUpgradeNft", + values: [BytesLike, string, string, string, string] + ): string; + encodeFunctionData( + functionFragment: "initOrUpgradeToken", + values: [BytesLike, string, string, BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "registerUnmanagedSystem", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getImplementation", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "renounceNomination", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "simulateUpgradeTo", + values: [string] + ): string; + encodeFunctionData(functionFragment: "upgradeTo", values: [string]): string; + encodeFunctionData( + functionFragment: "createMarket", + values: [BigNumberish, string, string] + ): string; + encodeFunctionData( + functionFragment: "initializeFactory", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minimumCredit", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "name", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "reportedDebt", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setSpotMarket", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setSynthetix", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "supportsInterface", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getAvailableMargin", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getCollateralAmount", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getOpenPosition", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getRequiredMargins", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getWithdrawableMargin", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "modifyCollateral", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "totalAccountOpenInterest", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "totalCollateralValue", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "currentFundingRate", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "currentFundingVelocity", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fillPrice", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getMarketSummary", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "indexPrice", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "maxOpenInterest", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "metadata", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "size", values: [BigNumberish]): string; + encodeFunctionData(functionFragment: "skew", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "commitOrder", + values: [AsyncOrder.OrderCommitmentRequestStruct] + ): string; + encodeFunctionData( + functionFragment: "computeOrderFees", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getOrder", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "PRECISION", values?: undefined): string; + encodeFunctionData( + functionFragment: "settle", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "settlePythOrder", + values: [BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "addToFeatureFlagAllowlist", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "getDeniers", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getFeatureFlagAllowAll", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getFeatureFlagAllowlist", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getFeatureFlagDenyAll", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "isFeatureAllowed", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "removeFromFeatureFlagAllowlist", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "setDeniers", + values: [BytesLike, string[]] + ): string; + encodeFunctionData( + functionFragment: "setFeatureFlagAllowAll", + values: [BytesLike, boolean] + ): string; + encodeFunctionData( + functionFragment: "setFeatureFlagDenyAll", + values: [BytesLike, boolean] + ): string; + encodeFunctionData( + functionFragment: "liquidate", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "liquidateFlagged", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "addSettlementStrategy", + values: [BigNumberish, SettlementStrategy.DataStruct] + ): string; + encodeFunctionData( + functionFragment: "getFundingParameters", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getLiquidationParameters", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getLockedOiRatio", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getMaxMarketSize", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getOrderFees", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getSettlementStrategy", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setFundingParameters", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationParameters", + values: [ + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "setLockedOiRatio", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxMarketSize", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setOrderFees", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setSettlementStrategyEnabled", + values: [BigNumberish, BigNumberish, boolean] + ): string; + encodeFunctionData( + functionFragment: "updatePriceData", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getFeeCollector", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getLiquidationRewardGuards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getMaxCollateralAmount", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getReferrerShare", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "getSynthDeductionPriority", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setFeeCollector", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationRewardGuards", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMaxCollateralAmount", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setSynthDeductionPriority", + values: [BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "totalGlobalCollateralValue", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "updateReferrerShare", + values: [string, BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "createAccount()", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createAccount(uint128)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAccountLastInteraction", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAccountOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAccountPermissions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAccountTokenAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "grantPermission", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "hasPermission", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isAuthorized", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "notifyAccountTransfer", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renouncePermission", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "revokePermission", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAssociatedSystem", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "initOrUpgradeNft", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "initOrUpgradeToken", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "registerUnmanagedSystem", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getImplementation", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "renounceNomination", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "simulateUpgradeTo", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "upgradeTo", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "createMarket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "initializeFactory", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minimumCredit", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "reportedDebt", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSpotMarket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSynthetix", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportsInterface", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAvailableMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getCollateralAmount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getOpenPosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getRequiredMargins", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getWithdrawableMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "modifyCollateral", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalAccountOpenInterest", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalCollateralValue", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentFundingRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentFundingVelocity", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "fillPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getMarketSummary", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "indexPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "maxOpenInterest", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "metadata", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "size", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "skew", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "commitOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "computeOrderFees", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getOrder", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "PRECISION", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "settle", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "settlePythOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addToFeatureFlagAllowlist", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getDeniers", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getFeatureFlagAllowAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFeatureFlagAllowlist", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFeatureFlagDenyAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isFeatureAllowed", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "removeFromFeatureFlagAllowlist", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "setDeniers", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setFeatureFlagAllowAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setFeatureFlagDenyAll", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "liquidate", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "liquidateFlagged", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addSettlementStrategy", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFundingParameters", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLiquidationParameters", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLockedOiRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getMaxMarketSize", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getOrderFees", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSettlementStrategy", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setFundingParameters", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationParameters", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLockedOiRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxMarketSize", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOrderFees", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSettlementStrategyEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updatePriceData", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFeeCollector", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLiquidationRewardGuards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getMaxCollateralAmount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getReferrerShare", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSynthDeductionPriority", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setFeeCollector", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationRewardGuards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxCollateralAmount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSynthDeductionPriority", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalGlobalCollateralValue", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateReferrerShare", + data: BytesLike + ): Result; + + events: { + "AccountCreated(uint128,address)": EventFragment; + "PermissionGranted(uint128,bytes32,address,address)": EventFragment; + "PermissionRevoked(uint128,bytes32,address,address)": EventFragment; + "AssociatedSystemSet(bytes32,bytes32,address,address)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "Upgraded(address,address)": EventFragment; + "FactoryInitialized(uint128)": EventFragment; + "MarketCreated(uint128,string,string)": EventFragment; + "CollateralModified(uint128,uint128,int256,address)": EventFragment; + "OrderCommitted(uint128,uint128,uint8,int128,uint256,uint256,uint256,bytes32,address)": EventFragment; + "MarketUpdated(uint128,uint256,int256,uint256,int256,int256,int256)": EventFragment; + "OrderSettled(uint128,uint128,uint256,int256,int128,int128,uint256,uint256,uint256,uint256,bytes32,address)": EventFragment; + "FeatureFlagAllowAllSet(bytes32,bool)": EventFragment; + "FeatureFlagAllowlistAdded(bytes32,address)": EventFragment; + "FeatureFlagAllowlistRemoved(bytes32,address)": EventFragment; + "FeatureFlagDeniersReset(bytes32,address[])": EventFragment; + "FeatureFlagDenyAllSet(bytes32,bool)": EventFragment; + "AccountLiquidated(uint128,uint256,bool)": EventFragment; + "PositionLiquidated(uint128,uint128,uint256,int128)": EventFragment; + "FundingParametersSet(uint128,uint256,uint256)": EventFragment; + "LiquidationParametersSet(uint128,uint256,uint256,uint256,uint256,uint256,uint256)": EventFragment; + "LockedOiRatioSet(uint128,uint256)": EventFragment; + "MarketPriceDataUpdated(uint128,bytes32)": EventFragment; + "MaxMarketSizeSet(uint128,uint256)": EventFragment; + "OrderFeesSet(uint128,uint256,uint256)": EventFragment; + "SettlementStrategyAdded(uint128,tuple,uint256)": EventFragment; + "SettlementStrategyEnabled(uint128,uint256,bool)": EventFragment; + "FeeCollectorSet(address)": EventFragment; + "LiquidationRewardGuardsSet(uint256,uint256)": EventFragment; + "MaxCollateralAmountSet(uint128,uint256)": EventFragment; + "ReferrerShareUpdated(address,uint256)": EventFragment; + "SynthDeductionPrioritySet(uint128[])": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AccountCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PermissionGranted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PermissionRevoked"): EventFragment; + getEvent(nameOrSignatureOrTopic: "AssociatedSystemSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FactoryInitialized"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MarketCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "CollateralModified"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OrderCommitted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MarketUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OrderSettled"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeatureFlagAllowAllSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeatureFlagAllowlistAdded"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "FeatureFlagAllowlistRemoved" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeatureFlagDeniersReset"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeatureFlagDenyAllSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "AccountLiquidated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionLiquidated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FundingParametersSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidationParametersSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "LockedOiRatioSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MarketPriceDataUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MaxMarketSizeSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OrderFeesSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SettlementStrategyAdded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SettlementStrategyEnabled"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeeCollectorSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidationRewardGuardsSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MaxCollateralAmountSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ReferrerShareUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthDeductionPrioritySet"): EventFragment; +} + +export interface AccountCreatedEventObject { + accountId: BigNumber; + owner: string; +} +export type AccountCreatedEvent = TypedEvent< + [BigNumber, string], + AccountCreatedEventObject +>; + +export type AccountCreatedEventFilter = TypedEventFilter; + +export interface PermissionGrantedEventObject { + accountId: BigNumber; + permission: string; + user: string; + sender: string; +} +export type PermissionGrantedEvent = TypedEvent< + [BigNumber, string, string, string], + PermissionGrantedEventObject +>; + +export type PermissionGrantedEventFilter = + TypedEventFilter; + +export interface PermissionRevokedEventObject { + accountId: BigNumber; + permission: string; + user: string; + sender: string; +} +export type PermissionRevokedEvent = TypedEvent< + [BigNumber, string, string, string], + PermissionRevokedEventObject +>; + +export type PermissionRevokedEventFilter = + TypedEventFilter; + +export interface AssociatedSystemSetEventObject { + kind: string; + id: string; + proxy: string; + impl: string; +} +export type AssociatedSystemSetEvent = TypedEvent< + [string, string, string, string], + AssociatedSystemSetEventObject +>; + +export type AssociatedSystemSetEventFilter = + TypedEventFilter; + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface UpgradedEventObject { + self: string; + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string, string], UpgradedEventObject>; + +export type UpgradedEventFilter = TypedEventFilter; + +export interface FactoryInitializedEventObject { + globalPerpsMarketId: BigNumber; +} +export type FactoryInitializedEvent = TypedEvent< + [BigNumber], + FactoryInitializedEventObject +>; + +export type FactoryInitializedEventFilter = + TypedEventFilter; + +export interface MarketCreatedEventObject { + perpsMarketId: BigNumber; + marketName: string; + marketSymbol: string; +} +export type MarketCreatedEvent = TypedEvent< + [BigNumber, string, string], + MarketCreatedEventObject +>; + +export type MarketCreatedEventFilter = TypedEventFilter; + +export interface CollateralModifiedEventObject { + accountId: BigNumber; + synthMarketId: BigNumber; + amountDelta: BigNumber; + sender: string; +} +export type CollateralModifiedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, string], + CollateralModifiedEventObject +>; + +export type CollateralModifiedEventFilter = + TypedEventFilter; + +export interface OrderCommittedEventObject { + marketId: BigNumber; + accountId: BigNumber; + orderType: number; + sizeDelta: BigNumber; + acceptablePrice: BigNumber; + settlementTime: BigNumber; + expirationTime: BigNumber; + trackingCode: string; + sender: string; +} +export type OrderCommittedEvent = TypedEvent< + [ + BigNumber, + BigNumber, + number, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + string + ], + OrderCommittedEventObject +>; + +export type OrderCommittedEventFilter = TypedEventFilter; + +export interface MarketUpdatedEventObject { + marketId: BigNumber; + price: BigNumber; + skew: BigNumber; + size: BigNumber; + sizeDelta: BigNumber; + currentFundingRate: BigNumber; + currentFundingVelocity: BigNumber; +} +export type MarketUpdatedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], + MarketUpdatedEventObject +>; + +export type MarketUpdatedEventFilter = TypedEventFilter; + +export interface OrderSettledEventObject { + marketId: BigNumber; + accountId: BigNumber; + fillPrice: BigNumber; + pnl: BigNumber; + sizeDelta: BigNumber; + newSize: BigNumber; + totalFees: BigNumber; + referralFees: BigNumber; + collectedFees: BigNumber; + settlementReward: BigNumber; + trackingCode: string; + settler: string; +} +export type OrderSettledEvent = TypedEvent< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + string + ], + OrderSettledEventObject +>; + +export type OrderSettledEventFilter = TypedEventFilter; + +export interface FeatureFlagAllowAllSetEventObject { + feature: string; + allowAll: boolean; +} +export type FeatureFlagAllowAllSetEvent = TypedEvent< + [string, boolean], + FeatureFlagAllowAllSetEventObject +>; + +export type FeatureFlagAllowAllSetEventFilter = + TypedEventFilter; + +export interface FeatureFlagAllowlistAddedEventObject { + feature: string; + account: string; +} +export type FeatureFlagAllowlistAddedEvent = TypedEvent< + [string, string], + FeatureFlagAllowlistAddedEventObject +>; + +export type FeatureFlagAllowlistAddedEventFilter = + TypedEventFilter; + +export interface FeatureFlagAllowlistRemovedEventObject { + feature: string; + account: string; +} +export type FeatureFlagAllowlistRemovedEvent = TypedEvent< + [string, string], + FeatureFlagAllowlistRemovedEventObject +>; + +export type FeatureFlagAllowlistRemovedEventFilter = + TypedEventFilter; + +export interface FeatureFlagDeniersResetEventObject { + feature: string; + deniers: string[]; +} +export type FeatureFlagDeniersResetEvent = TypedEvent< + [string, string[]], + FeatureFlagDeniersResetEventObject +>; + +export type FeatureFlagDeniersResetEventFilter = + TypedEventFilter; + +export interface FeatureFlagDenyAllSetEventObject { + feature: string; + denyAll: boolean; +} +export type FeatureFlagDenyAllSetEvent = TypedEvent< + [string, boolean], + FeatureFlagDenyAllSetEventObject +>; + +export type FeatureFlagDenyAllSetEventFilter = + TypedEventFilter; + +export interface AccountLiquidatedEventObject { + accountId: BigNumber; + reward: BigNumber; + fullLiquidation: boolean; +} +export type AccountLiquidatedEvent = TypedEvent< + [BigNumber, BigNumber, boolean], + AccountLiquidatedEventObject +>; + +export type AccountLiquidatedEventFilter = + TypedEventFilter; + +export interface PositionLiquidatedEventObject { + accountId: BigNumber; + marketId: BigNumber; + amountLiquidated: BigNumber; + currentPositionSize: BigNumber; +} +export type PositionLiquidatedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, BigNumber], + PositionLiquidatedEventObject +>; + +export type PositionLiquidatedEventFilter = + TypedEventFilter; + +export interface FundingParametersSetEventObject { + marketId: BigNumber; + skewScale: BigNumber; + maxFundingVelocity: BigNumber; +} +export type FundingParametersSetEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber], + FundingParametersSetEventObject +>; + +export type FundingParametersSetEventFilter = + TypedEventFilter; + +export interface LiquidationParametersSetEventObject { + marketId: BigNumber; + initialMarginRatioD18: BigNumber; + maintenanceMarginRatioD18: BigNumber; + liquidationRewardRatioD18: BigNumber; + maxLiquidationLimitAccumulationMultiplier: BigNumber; + maxSecondsInLiquidationWindow: BigNumber; + minimumPositionMargin: BigNumber; +} +export type LiquidationParametersSetEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], + LiquidationParametersSetEventObject +>; + +export type LiquidationParametersSetEventFilter = + TypedEventFilter; + +export interface LockedOiRatioSetEventObject { + marketId: BigNumber; + lockedOiRatioD18: BigNumber; +} +export type LockedOiRatioSetEvent = TypedEvent< + [BigNumber, BigNumber], + LockedOiRatioSetEventObject +>; + +export type LockedOiRatioSetEventFilter = + TypedEventFilter; + +export interface MarketPriceDataUpdatedEventObject { + marketId: BigNumber; + feedId: string; +} +export type MarketPriceDataUpdatedEvent = TypedEvent< + [BigNumber, string], + MarketPriceDataUpdatedEventObject +>; + +export type MarketPriceDataUpdatedEventFilter = + TypedEventFilter; + +export interface MaxMarketSizeSetEventObject { + marketId: BigNumber; + maxMarketSize: BigNumber; +} +export type MaxMarketSizeSetEvent = TypedEvent< + [BigNumber, BigNumber], + MaxMarketSizeSetEventObject +>; + +export type MaxMarketSizeSetEventFilter = + TypedEventFilter; + +export interface OrderFeesSetEventObject { + marketId: BigNumber; + makerFeeRatio: BigNumber; + takerFeeRatio: BigNumber; +} +export type OrderFeesSetEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber], + OrderFeesSetEventObject +>; + +export type OrderFeesSetEventFilter = TypedEventFilter; + +export interface SettlementStrategyAddedEventObject { + marketId: BigNumber; + strategy: SettlementStrategy.DataStructOutput; + strategyId: BigNumber; +} +export type SettlementStrategyAddedEvent = TypedEvent< + [BigNumber, SettlementStrategy.DataStructOutput, BigNumber], + SettlementStrategyAddedEventObject +>; + +export type SettlementStrategyAddedEventFilter = + TypedEventFilter; + +export interface SettlementStrategyEnabledEventObject { + marketId: BigNumber; + strategyId: BigNumber; + enabled: boolean; +} +export type SettlementStrategyEnabledEvent = TypedEvent< + [BigNumber, BigNumber, boolean], + SettlementStrategyEnabledEventObject +>; + +export type SettlementStrategyEnabledEventFilter = + TypedEventFilter; + +export interface FeeCollectorSetEventObject { + feeCollector: string; +} +export type FeeCollectorSetEvent = TypedEvent< + [string], + FeeCollectorSetEventObject +>; + +export type FeeCollectorSetEventFilter = TypedEventFilter; + +export interface LiquidationRewardGuardsSetEventObject { + minLiquidationRewardUsd: BigNumber; + maxLiquidationRewardUsd: BigNumber; +} +export type LiquidationRewardGuardsSetEvent = TypedEvent< + [BigNumber, BigNumber], + LiquidationRewardGuardsSetEventObject +>; + +export type LiquidationRewardGuardsSetEventFilter = + TypedEventFilter; + +export interface MaxCollateralAmountSetEventObject { + synthMarketId: BigNumber; + collateralAmount: BigNumber; +} +export type MaxCollateralAmountSetEvent = TypedEvent< + [BigNumber, BigNumber], + MaxCollateralAmountSetEventObject +>; + +export type MaxCollateralAmountSetEventFilter = + TypedEventFilter; + +export interface ReferrerShareUpdatedEventObject { + referrer: string; + shareRatioD18: BigNumber; +} +export type ReferrerShareUpdatedEvent = TypedEvent< + [string, BigNumber], + ReferrerShareUpdatedEventObject +>; + +export type ReferrerShareUpdatedEventFilter = + TypedEventFilter; + +export interface SynthDeductionPrioritySetEventObject { + newSynthDeductionPriority: BigNumber[]; +} +export type SynthDeductionPrioritySetEvent = TypedEvent< + [BigNumber[]], + SynthDeductionPrioritySetEventObject +>; + +export type SynthDeductionPrioritySetEventFilter = + TypedEventFilter; + +export interface PerpsV3MarketProxy extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PerpsV3MarketProxyInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + "createAccount()"( + overrides?: Overrides & { from?: string } + ): Promise; + + "createAccount(uint128)"( + requestedAccountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountLastInteraction( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getAccountOwner( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + getAccountPermissions( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [IAccountModule.AccountPermissionsStructOutput[]] & { + accountPerms: IAccountModule.AccountPermissionsStructOutput[]; + } + >; + + getAccountTokenAddress(overrides?: CallOverrides): Promise<[string]>; + + grantPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + hasPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + isAuthorized( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + notifyAccountTransfer( + to: string, + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + renouncePermission( + accountId: BigNumberish, + permission: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + revokePermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getAssociatedSystem( + id: BytesLike, + overrides?: CallOverrides + ): Promise<[string, string] & { addr: string; kind: string }>; + + initOrUpgradeNft( + id: BytesLike, + name: string, + symbol: string, + uri: string, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initOrUpgradeToken( + id: BytesLike, + name: string, + symbol: string, + decimals: BigNumberish, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + registerUnmanagedSystem( + id: BytesLike, + endpoint: string, + overrides?: Overrides & { from?: string } + ): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise<[string]>; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + createMarket( + requestedMarketId: BigNumberish, + marketName: string, + marketSymbol: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initializeFactory( + overrides?: Overrides & { from?: string } + ): Promise; + + minimumCredit( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + name( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + reportedDebt( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + setSpotMarket( + spotMarket: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthetix( + synthetix: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + getAvailableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { availableMargin: BigNumber }>; + + getCollateralAmount( + accountId: BigNumberish, + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getOpenPosition( + accountId: BigNumberish, + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + totalPnl: BigNumber; + accruedFunding: BigNumber; + positionSize: BigNumber; + } + >; + + getRequiredMargins( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + requiredInitialMargin: BigNumber; + requiredMaintenanceMargin: BigNumber; + } + >; + + getWithdrawableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { withdrawableMargin: BigNumber }>; + + modifyCollateral( + accountId: BigNumberish, + synthMarketId: BigNumberish, + amountDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalAccountOpenInterest( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + totalCollateralValue( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + currentFundingRate( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + currentFundingVelocity( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + fillPrice( + marketId: BigNumberish, + orderSize: BigNumberish, + price: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getMarketSummary( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [IPerpsMarketModule.MarketSummaryStructOutput] & { + summary: IPerpsMarketModule.MarketSummaryStructOutput; + } + >; + + indexPrice( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + maxOpenInterest( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + metadata( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string, string] & { name: string; symbol: string }>; + + size( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + skew( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + commitOrder( + commitment: AsyncOrder.OrderCommitmentRequestStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + computeOrderFees( + marketId: BigNumberish, + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { orderFees: BigNumber }>; + + getOrder( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [AsyncOrder.DataStructOutput] & { order: AsyncOrder.DataStructOutput } + >; + + PRECISION(overrides?: CallOverrides): Promise<[BigNumber]>; + + settle(accountId: BigNumberish, overrides?: CallOverrides): Promise<[void]>; + + settlePythOrder( + result: BytesLike, + extraData: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + addToFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getDeniers( + feature: BytesLike, + overrides?: CallOverrides + ): Promise<[string[]]>; + + getFeatureFlagAllowAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + getFeatureFlagAllowlist( + feature: BytesLike, + overrides?: CallOverrides + ): Promise<[string[]]>; + + getFeatureFlagDenyAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + isFeatureAllowed( + feature: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + removeFromFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setDeniers( + feature: BytesLike, + deniers: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagAllowAll( + feature: BytesLike, + allowAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagDenyAll( + feature: BytesLike, + denyAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidate( + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateFlagged( + overrides?: Overrides & { from?: string } + ): Promise; + + addSettlementStrategy( + marketId: BigNumberish, + strategy: SettlementStrategy.DataStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + getFundingParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + skewScale: BigNumber; + maxFundingVelocity: BigNumber; + } + >; + + getLiquidationParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + initialMarginRatioD18: BigNumber; + maintenanceMarginRatioD18: BigNumber; + liquidationRewardRatioD18: BigNumber; + maxLiquidationLimitAccumulationMultiplier: BigNumber; + maxSecondsInLiquidationWindow: BigNumber; + } + >; + + getLockedOiRatio( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getMaxMarketSize( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { maxMarketSize: BigNumber }>; + + getOrderFees( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { makerFee: BigNumber; takerFee: BigNumber } + >; + + getSettlementStrategy( + marketId: BigNumberish, + strategyId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [SettlementStrategy.DataStructOutput] & { + settlementStrategy: SettlementStrategy.DataStructOutput; + } + >; + + setFundingParameters( + marketId: BigNumberish, + skewScale: BigNumberish, + maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationParameters( + marketId: BigNumberish, + initialMarginRatioD18: BigNumberish, + maintenanceMarginRatioD18: BigNumberish, + liquidationRewardRatioD18: BigNumberish, + maxLiquidationLimitAccumulationMultiplier: BigNumberish, + maxSecondsInLiquidationWindow: BigNumberish, + minimumPositionMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLockedOiRatio( + marketId: BigNumberish, + lockedOiRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketSize( + marketId: BigNumberish, + maxMarketSize: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOrderFees( + marketId: BigNumberish, + makerFeeRatio: BigNumberish, + takerFeeRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSettlementStrategyEnabled( + marketId: BigNumberish, + strategyId: BigNumberish, + enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updatePriceData( + perpsMarketId: BigNumberish, + feedId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFeeCollector( + overrides?: CallOverrides + ): Promise<[string] & { feeCollector: string }>; + + getLiquidationRewardGuards( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + minLiquidationRewardUsd: BigNumber; + maxLiquidationRewardUsd: BigNumber; + } + >; + + getMaxCollateralAmount( + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getReferrerShare( + referrer: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { shareRatioD18: BigNumber }>; + + getSynthDeductionPriority( + overrides?: CallOverrides + ): Promise<[BigNumber[]]>; + + setFeeCollector( + feeCollector: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRewardGuards( + minLiquidationRewardUsd: BigNumberish, + maxLiquidationRewardUsd: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxCollateralAmount( + synthMarketId: BigNumberish, + collateralAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthDeductionPriority( + newSynthDeductionPriority: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + totalGlobalCollateralValue( + overrides?: CallOverrides + ): Promise<[BigNumber] & { totalCollateralValue: BigNumber }>; + + updateReferrerShare( + referrer: string, + shareRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + "createAccount()"( + overrides?: Overrides & { from?: string } + ): Promise; + + "createAccount(uint128)"( + requestedAccountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountLastInteraction( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountOwner( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountPermissions( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountTokenAddress(overrides?: CallOverrides): Promise; + + grantPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + hasPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + isAuthorized( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + notifyAccountTransfer( + to: string, + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + renouncePermission( + accountId: BigNumberish, + permission: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + revokePermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getAssociatedSystem( + id: BytesLike, + overrides?: CallOverrides + ): Promise<[string, string] & { addr: string; kind: string }>; + + initOrUpgradeNft( + id: BytesLike, + name: string, + symbol: string, + uri: string, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initOrUpgradeToken( + id: BytesLike, + name: string, + symbol: string, + decimals: BigNumberish, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + registerUnmanagedSystem( + id: BytesLike, + endpoint: string, + overrides?: Overrides & { from?: string } + ): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + createMarket( + requestedMarketId: BigNumberish, + marketName: string, + marketSymbol: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initializeFactory( + overrides?: Overrides & { from?: string } + ): Promise; + + minimumCredit( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + name(perpsMarketId: BigNumberish, overrides?: CallOverrides): Promise; + + reportedDebt( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSpotMarket( + spotMarket: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthetix( + synthetix: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAvailableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getCollateralAmount( + accountId: BigNumberish, + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOpenPosition( + accountId: BigNumberish, + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + totalPnl: BigNumber; + accruedFunding: BigNumber; + positionSize: BigNumber; + } + >; + + getRequiredMargins( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + requiredInitialMargin: BigNumber; + requiredMaintenanceMargin: BigNumber; + } + >; + + getWithdrawableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + modifyCollateral( + accountId: BigNumberish, + synthMarketId: BigNumberish, + amountDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalAccountOpenInterest( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalCollateralValue( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingRate( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingVelocity( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fillPrice( + marketId: BigNumberish, + orderSize: BigNumberish, + price: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMarketSummary( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + indexPrice( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + maxOpenInterest( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + metadata( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string, string] & { name: string; symbol: string }>; + + size(marketId: BigNumberish, overrides?: CallOverrides): Promise; + + skew(marketId: BigNumberish, overrides?: CallOverrides): Promise; + + commitOrder( + commitment: AsyncOrder.OrderCommitmentRequestStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + computeOrderFees( + marketId: BigNumberish, + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrder( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + PRECISION(overrides?: CallOverrides): Promise; + + settle(accountId: BigNumberish, overrides?: CallOverrides): Promise; + + settlePythOrder( + result: BytesLike, + extraData: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + addToFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getDeniers(feature: BytesLike, overrides?: CallOverrides): Promise; + + getFeatureFlagAllowAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagAllowlist( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagDenyAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + isFeatureAllowed( + feature: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + removeFromFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setDeniers( + feature: BytesLike, + deniers: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagAllowAll( + feature: BytesLike, + allowAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagDenyAll( + feature: BytesLike, + denyAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidate( + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateFlagged( + overrides?: Overrides & { from?: string } + ): Promise; + + addSettlementStrategy( + marketId: BigNumberish, + strategy: SettlementStrategy.DataStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + getFundingParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + skewScale: BigNumber; + maxFundingVelocity: BigNumber; + } + >; + + getLiquidationParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + initialMarginRatioD18: BigNumber; + maintenanceMarginRatioD18: BigNumber; + liquidationRewardRatioD18: BigNumber; + maxLiquidationLimitAccumulationMultiplier: BigNumber; + maxSecondsInLiquidationWindow: BigNumber; + } + >; + + getLockedOiRatio( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMaxMarketSize( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrderFees( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { makerFee: BigNumber; takerFee: BigNumber } + >; + + getSettlementStrategy( + marketId: BigNumberish, + strategyId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setFundingParameters( + marketId: BigNumberish, + skewScale: BigNumberish, + maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationParameters( + marketId: BigNumberish, + initialMarginRatioD18: BigNumberish, + maintenanceMarginRatioD18: BigNumberish, + liquidationRewardRatioD18: BigNumberish, + maxLiquidationLimitAccumulationMultiplier: BigNumberish, + maxSecondsInLiquidationWindow: BigNumberish, + minimumPositionMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLockedOiRatio( + marketId: BigNumberish, + lockedOiRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketSize( + marketId: BigNumberish, + maxMarketSize: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOrderFees( + marketId: BigNumberish, + makerFeeRatio: BigNumberish, + takerFeeRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSettlementStrategyEnabled( + marketId: BigNumberish, + strategyId: BigNumberish, + enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updatePriceData( + perpsMarketId: BigNumberish, + feedId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFeeCollector(overrides?: CallOverrides): Promise; + + getLiquidationRewardGuards( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + minLiquidationRewardUsd: BigNumber; + maxLiquidationRewardUsd: BigNumber; + } + >; + + getMaxCollateralAmount( + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getReferrerShare( + referrer: string, + overrides?: CallOverrides + ): Promise; + + getSynthDeductionPriority(overrides?: CallOverrides): Promise; + + setFeeCollector( + feeCollector: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRewardGuards( + minLiquidationRewardUsd: BigNumberish, + maxLiquidationRewardUsd: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxCollateralAmount( + synthMarketId: BigNumberish, + collateralAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthDeductionPriority( + newSynthDeductionPriority: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + totalGlobalCollateralValue(overrides?: CallOverrides): Promise; + + updateReferrerShare( + referrer: string, + shareRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + "createAccount()"(overrides?: CallOverrides): Promise; + + "createAccount(uint128)"( + requestedAccountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountLastInteraction( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountOwner( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountPermissions( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountTokenAddress(overrides?: CallOverrides): Promise; + + grantPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + hasPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + isAuthorized( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + notifyAccountTransfer( + to: string, + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + renouncePermission( + accountId: BigNumberish, + permission: BytesLike, + overrides?: CallOverrides + ): Promise; + + revokePermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + getAssociatedSystem( + id: BytesLike, + overrides?: CallOverrides + ): Promise<[string, string] & { addr: string; kind: string }>; + + initOrUpgradeNft( + id: BytesLike, + name: string, + symbol: string, + uri: string, + impl: string, + overrides?: CallOverrides + ): Promise; + + initOrUpgradeToken( + id: BytesLike, + name: string, + symbol: string, + decimals: BigNumberish, + impl: string, + overrides?: CallOverrides + ): Promise; + + registerUnmanagedSystem( + id: BytesLike, + endpoint: string, + overrides?: CallOverrides + ): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: CallOverrides + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination(overrides?: CallOverrides): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: CallOverrides + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: CallOverrides + ): Promise; + + createMarket( + requestedMarketId: BigNumberish, + marketName: string, + marketSymbol: string, + overrides?: CallOverrides + ): Promise; + + initializeFactory(overrides?: CallOverrides): Promise; + + minimumCredit( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + name( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + reportedDebt( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSpotMarket(spotMarket: string, overrides?: CallOverrides): Promise; + + setSynthetix(synthetix: string, overrides?: CallOverrides): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAvailableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getCollateralAmount( + accountId: BigNumberish, + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOpenPosition( + accountId: BigNumberish, + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + totalPnl: BigNumber; + accruedFunding: BigNumber; + positionSize: BigNumber; + } + >; + + getRequiredMargins( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + requiredInitialMargin: BigNumber; + requiredMaintenanceMargin: BigNumber; + } + >; + + getWithdrawableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + modifyCollateral( + accountId: BigNumberish, + synthMarketId: BigNumberish, + amountDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalAccountOpenInterest( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalCollateralValue( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingRate( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingVelocity( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fillPrice( + marketId: BigNumberish, + orderSize: BigNumberish, + price: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMarketSummary( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + indexPrice( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + maxOpenInterest( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + metadata( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string, string] & { name: string; symbol: string }>; + + size(marketId: BigNumberish, overrides?: CallOverrides): Promise; + + skew(marketId: BigNumberish, overrides?: CallOverrides): Promise; + + commitOrder( + commitment: AsyncOrder.OrderCommitmentRequestStruct, + overrides?: CallOverrides + ): Promise< + [AsyncOrder.DataStructOutput, BigNumber] & { + retOrder: AsyncOrder.DataStructOutput; + fees: BigNumber; + } + >; + + computeOrderFees( + marketId: BigNumberish, + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrder( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + PRECISION(overrides?: CallOverrides): Promise; + + settle(accountId: BigNumberish, overrides?: CallOverrides): Promise; + + settlePythOrder( + result: BytesLike, + extraData: BytesLike, + overrides?: CallOverrides + ): Promise; + + addToFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + getDeniers( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagAllowAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagAllowlist( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagDenyAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + isFeatureAllowed( + feature: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + removeFromFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + setDeniers( + feature: BytesLike, + deniers: string[], + overrides?: CallOverrides + ): Promise; + + setFeatureFlagAllowAll( + feature: BytesLike, + allowAll: boolean, + overrides?: CallOverrides + ): Promise; + + setFeatureFlagDenyAll( + feature: BytesLike, + denyAll: boolean, + overrides?: CallOverrides + ): Promise; + + liquidate( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + liquidateFlagged(overrides?: CallOverrides): Promise; + + addSettlementStrategy( + marketId: BigNumberish, + strategy: SettlementStrategy.DataStruct, + overrides?: CallOverrides + ): Promise; + + getFundingParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + skewScale: BigNumber; + maxFundingVelocity: BigNumber; + } + >; + + getLiquidationParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { + initialMarginRatioD18: BigNumber; + maintenanceMarginRatioD18: BigNumber; + liquidationRewardRatioD18: BigNumber; + maxLiquidationLimitAccumulationMultiplier: BigNumber; + maxSecondsInLiquidationWindow: BigNumber; + } + >; + + getLockedOiRatio( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMaxMarketSize( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrderFees( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { makerFee: BigNumber; takerFee: BigNumber } + >; + + getSettlementStrategy( + marketId: BigNumberish, + strategyId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setFundingParameters( + marketId: BigNumberish, + skewScale: BigNumberish, + maxFundingVelocity: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationParameters( + marketId: BigNumberish, + initialMarginRatioD18: BigNumberish, + maintenanceMarginRatioD18: BigNumberish, + liquidationRewardRatioD18: BigNumberish, + maxLiquidationLimitAccumulationMultiplier: BigNumberish, + maxSecondsInLiquidationWindow: BigNumberish, + minimumPositionMargin: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLockedOiRatio( + marketId: BigNumberish, + lockedOiRatioD18: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxMarketSize( + marketId: BigNumberish, + maxMarketSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setOrderFees( + marketId: BigNumberish, + makerFeeRatio: BigNumberish, + takerFeeRatio: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSettlementStrategyEnabled( + marketId: BigNumberish, + strategyId: BigNumberish, + enabled: boolean, + overrides?: CallOverrides + ): Promise; + + updatePriceData( + perpsMarketId: BigNumberish, + feedId: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeeCollector(overrides?: CallOverrides): Promise; + + getLiquidationRewardGuards( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + minLiquidationRewardUsd: BigNumber; + maxLiquidationRewardUsd: BigNumber; + } + >; + + getMaxCollateralAmount( + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getReferrerShare( + referrer: string, + overrides?: CallOverrides + ): Promise; + + getSynthDeductionPriority(overrides?: CallOverrides): Promise; + + setFeeCollector( + feeCollector: string, + overrides?: CallOverrides + ): Promise; + + setLiquidationRewardGuards( + minLiquidationRewardUsd: BigNumberish, + maxLiquidationRewardUsd: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMaxCollateralAmount( + synthMarketId: BigNumberish, + collateralAmount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSynthDeductionPriority( + newSynthDeductionPriority: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + totalGlobalCollateralValue(overrides?: CallOverrides): Promise; + + updateReferrerShare( + referrer: string, + shareRatioD18: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AccountCreated(uint128,address)"( + accountId?: BigNumberish | null, + owner?: string | null + ): AccountCreatedEventFilter; + AccountCreated( + accountId?: BigNumberish | null, + owner?: string | null + ): AccountCreatedEventFilter; + + "PermissionGranted(uint128,bytes32,address,address)"( + accountId?: BigNumberish | null, + permission?: BytesLike | null, + user?: string | null, + sender?: null + ): PermissionGrantedEventFilter; + PermissionGranted( + accountId?: BigNumberish | null, + permission?: BytesLike | null, + user?: string | null, + sender?: null + ): PermissionGrantedEventFilter; + + "PermissionRevoked(uint128,bytes32,address,address)"( + accountId?: BigNumberish | null, + permission?: BytesLike | null, + user?: string | null, + sender?: null + ): PermissionRevokedEventFilter; + PermissionRevoked( + accountId?: BigNumberish | null, + permission?: BytesLike | null, + user?: string | null, + sender?: null + ): PermissionRevokedEventFilter; + + "AssociatedSystemSet(bytes32,bytes32,address,address)"( + kind?: BytesLike | null, + id?: BytesLike | null, + proxy?: null, + impl?: null + ): AssociatedSystemSetEventFilter; + AssociatedSystemSet( + kind?: BytesLike | null, + id?: BytesLike | null, + proxy?: null, + impl?: null + ): AssociatedSystemSetEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "Upgraded(address,address)"( + self?: string | null, + implementation?: null + ): UpgradedEventFilter; + Upgraded(self?: string | null, implementation?: null): UpgradedEventFilter; + + "FactoryInitialized(uint128)"( + globalPerpsMarketId?: null + ): FactoryInitializedEventFilter; + FactoryInitialized( + globalPerpsMarketId?: null + ): FactoryInitializedEventFilter; + + "MarketCreated(uint128,string,string)"( + perpsMarketId?: BigNumberish | null, + marketName?: null, + marketSymbol?: null + ): MarketCreatedEventFilter; + MarketCreated( + perpsMarketId?: BigNumberish | null, + marketName?: null, + marketSymbol?: null + ): MarketCreatedEventFilter; + + "CollateralModified(uint128,uint128,int256,address)"( + accountId?: BigNumberish | null, + synthMarketId?: BigNumberish | null, + amountDelta?: null, + sender?: string | null + ): CollateralModifiedEventFilter; + CollateralModified( + accountId?: BigNumberish | null, + synthMarketId?: BigNumberish | null, + amountDelta?: null, + sender?: string | null + ): CollateralModifiedEventFilter; + + "OrderCommitted(uint128,uint128,uint8,int128,uint256,uint256,uint256,bytes32,address)"( + marketId?: BigNumberish | null, + accountId?: BigNumberish | null, + orderType?: null, + sizeDelta?: null, + acceptablePrice?: null, + settlementTime?: null, + expirationTime?: null, + trackingCode?: BytesLike | null, + sender?: null + ): OrderCommittedEventFilter; + OrderCommitted( + marketId?: BigNumberish | null, + accountId?: BigNumberish | null, + orderType?: null, + sizeDelta?: null, + acceptablePrice?: null, + settlementTime?: null, + expirationTime?: null, + trackingCode?: BytesLike | null, + sender?: null + ): OrderCommittedEventFilter; + + "MarketUpdated(uint128,uint256,int256,uint256,int256,int256,int256)"( + marketId?: null, + price?: null, + skew?: null, + size?: null, + sizeDelta?: null, + currentFundingRate?: null, + currentFundingVelocity?: null + ): MarketUpdatedEventFilter; + MarketUpdated( + marketId?: null, + price?: null, + skew?: null, + size?: null, + sizeDelta?: null, + currentFundingRate?: null, + currentFundingVelocity?: null + ): MarketUpdatedEventFilter; + + "OrderSettled(uint128,uint128,uint256,int256,int128,int128,uint256,uint256,uint256,uint256,bytes32,address)"( + marketId?: BigNumberish | null, + accountId?: BigNumberish | null, + fillPrice?: null, + pnl?: null, + sizeDelta?: null, + newSize?: null, + totalFees?: null, + referralFees?: null, + collectedFees?: null, + settlementReward?: null, + trackingCode?: BytesLike | null, + settler?: null + ): OrderSettledEventFilter; + OrderSettled( + marketId?: BigNumberish | null, + accountId?: BigNumberish | null, + fillPrice?: null, + pnl?: null, + sizeDelta?: null, + newSize?: null, + totalFees?: null, + referralFees?: null, + collectedFees?: null, + settlementReward?: null, + trackingCode?: BytesLike | null, + settler?: null + ): OrderSettledEventFilter; + + "FeatureFlagAllowAllSet(bytes32,bool)"( + feature?: BytesLike | null, + allowAll?: null + ): FeatureFlagAllowAllSetEventFilter; + FeatureFlagAllowAllSet( + feature?: BytesLike | null, + allowAll?: null + ): FeatureFlagAllowAllSetEventFilter; + + "FeatureFlagAllowlistAdded(bytes32,address)"( + feature?: BytesLike | null, + account?: null + ): FeatureFlagAllowlistAddedEventFilter; + FeatureFlagAllowlistAdded( + feature?: BytesLike | null, + account?: null + ): FeatureFlagAllowlistAddedEventFilter; + + "FeatureFlagAllowlistRemoved(bytes32,address)"( + feature?: BytesLike | null, + account?: null + ): FeatureFlagAllowlistRemovedEventFilter; + FeatureFlagAllowlistRemoved( + feature?: BytesLike | null, + account?: null + ): FeatureFlagAllowlistRemovedEventFilter; + + "FeatureFlagDeniersReset(bytes32,address[])"( + feature?: BytesLike | null, + deniers?: null + ): FeatureFlagDeniersResetEventFilter; + FeatureFlagDeniersReset( + feature?: BytesLike | null, + deniers?: null + ): FeatureFlagDeniersResetEventFilter; + + "FeatureFlagDenyAllSet(bytes32,bool)"( + feature?: BytesLike | null, + denyAll?: null + ): FeatureFlagDenyAllSetEventFilter; + FeatureFlagDenyAllSet( + feature?: BytesLike | null, + denyAll?: null + ): FeatureFlagDenyAllSetEventFilter; + + "AccountLiquidated(uint128,uint256,bool)"( + accountId?: BigNumberish | null, + reward?: null, + fullLiquidation?: null + ): AccountLiquidatedEventFilter; + AccountLiquidated( + accountId?: BigNumberish | null, + reward?: null, + fullLiquidation?: null + ): AccountLiquidatedEventFilter; + + "PositionLiquidated(uint128,uint128,uint256,int128)"( + accountId?: BigNumberish | null, + marketId?: BigNumberish | null, + amountLiquidated?: null, + currentPositionSize?: null + ): PositionLiquidatedEventFilter; + PositionLiquidated( + accountId?: BigNumberish | null, + marketId?: BigNumberish | null, + amountLiquidated?: null, + currentPositionSize?: null + ): PositionLiquidatedEventFilter; + + "FundingParametersSet(uint128,uint256,uint256)"( + marketId?: BigNumberish | null, + skewScale?: null, + maxFundingVelocity?: null + ): FundingParametersSetEventFilter; + FundingParametersSet( + marketId?: BigNumberish | null, + skewScale?: null, + maxFundingVelocity?: null + ): FundingParametersSetEventFilter; + + "LiquidationParametersSet(uint128,uint256,uint256,uint256,uint256,uint256,uint256)"( + marketId?: BigNumberish | null, + initialMarginRatioD18?: null, + maintenanceMarginRatioD18?: null, + liquidationRewardRatioD18?: null, + maxLiquidationLimitAccumulationMultiplier?: null, + maxSecondsInLiquidationWindow?: null, + minimumPositionMargin?: null + ): LiquidationParametersSetEventFilter; + LiquidationParametersSet( + marketId?: BigNumberish | null, + initialMarginRatioD18?: null, + maintenanceMarginRatioD18?: null, + liquidationRewardRatioD18?: null, + maxLiquidationLimitAccumulationMultiplier?: null, + maxSecondsInLiquidationWindow?: null, + minimumPositionMargin?: null + ): LiquidationParametersSetEventFilter; + + "LockedOiRatioSet(uint128,uint256)"( + marketId?: BigNumberish | null, + lockedOiRatioD18?: null + ): LockedOiRatioSetEventFilter; + LockedOiRatioSet( + marketId?: BigNumberish | null, + lockedOiRatioD18?: null + ): LockedOiRatioSetEventFilter; + + "MarketPriceDataUpdated(uint128,bytes32)"( + marketId?: BigNumberish | null, + feedId?: null + ): MarketPriceDataUpdatedEventFilter; + MarketPriceDataUpdated( + marketId?: BigNumberish | null, + feedId?: null + ): MarketPriceDataUpdatedEventFilter; + + "MaxMarketSizeSet(uint128,uint256)"( + marketId?: BigNumberish | null, + maxMarketSize?: null + ): MaxMarketSizeSetEventFilter; + MaxMarketSizeSet( + marketId?: BigNumberish | null, + maxMarketSize?: null + ): MaxMarketSizeSetEventFilter; + + "OrderFeesSet(uint128,uint256,uint256)"( + marketId?: BigNumberish | null, + makerFeeRatio?: null, + takerFeeRatio?: null + ): OrderFeesSetEventFilter; + OrderFeesSet( + marketId?: BigNumberish | null, + makerFeeRatio?: null, + takerFeeRatio?: null + ): OrderFeesSetEventFilter; + + "SettlementStrategyAdded(uint128,tuple,uint256)"( + marketId?: BigNumberish | null, + strategy?: null, + strategyId?: BigNumberish | null + ): SettlementStrategyAddedEventFilter; + SettlementStrategyAdded( + marketId?: BigNumberish | null, + strategy?: null, + strategyId?: BigNumberish | null + ): SettlementStrategyAddedEventFilter; + + "SettlementStrategyEnabled(uint128,uint256,bool)"( + marketId?: BigNumberish | null, + strategyId?: null, + enabled?: null + ): SettlementStrategyEnabledEventFilter; + SettlementStrategyEnabled( + marketId?: BigNumberish | null, + strategyId?: null, + enabled?: null + ): SettlementStrategyEnabledEventFilter; + + "FeeCollectorSet(address)"(feeCollector?: null): FeeCollectorSetEventFilter; + FeeCollectorSet(feeCollector?: null): FeeCollectorSetEventFilter; + + "LiquidationRewardGuardsSet(uint256,uint256)"( + minLiquidationRewardUsd?: BigNumberish | null, + maxLiquidationRewardUsd?: BigNumberish | null + ): LiquidationRewardGuardsSetEventFilter; + LiquidationRewardGuardsSet( + minLiquidationRewardUsd?: BigNumberish | null, + maxLiquidationRewardUsd?: BigNumberish | null + ): LiquidationRewardGuardsSetEventFilter; + + "MaxCollateralAmountSet(uint128,uint256)"( + synthMarketId?: BigNumberish | null, + collateralAmount?: null + ): MaxCollateralAmountSetEventFilter; + MaxCollateralAmountSet( + synthMarketId?: BigNumberish | null, + collateralAmount?: null + ): MaxCollateralAmountSetEventFilter; + + "ReferrerShareUpdated(address,uint256)"( + referrer?: null, + shareRatioD18?: null + ): ReferrerShareUpdatedEventFilter; + ReferrerShareUpdated( + referrer?: null, + shareRatioD18?: null + ): ReferrerShareUpdatedEventFilter; + + "SynthDeductionPrioritySet(uint128[])"( + newSynthDeductionPriority?: null + ): SynthDeductionPrioritySetEventFilter; + SynthDeductionPrioritySet( + newSynthDeductionPriority?: null + ): SynthDeductionPrioritySetEventFilter; + }; + + estimateGas: { + "createAccount()"( + overrides?: Overrides & { from?: string } + ): Promise; + + "createAccount(uint128)"( + requestedAccountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountLastInteraction( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountOwner( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountPermissions( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountTokenAddress(overrides?: CallOverrides): Promise; + + grantPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + hasPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + isAuthorized( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + notifyAccountTransfer( + to: string, + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + renouncePermission( + accountId: BigNumberish, + permission: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + revokePermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getAssociatedSystem( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + initOrUpgradeNft( + id: BytesLike, + name: string, + symbol: string, + uri: string, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initOrUpgradeToken( + id: BytesLike, + name: string, + symbol: string, + decimals: BigNumberish, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + registerUnmanagedSystem( + id: BytesLike, + endpoint: string, + overrides?: Overrides & { from?: string } + ): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + createMarket( + requestedMarketId: BigNumberish, + marketName: string, + marketSymbol: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initializeFactory( + overrides?: Overrides & { from?: string } + ): Promise; + + minimumCredit( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + name( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + reportedDebt( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSpotMarket( + spotMarket: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthetix( + synthetix: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAvailableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getCollateralAmount( + accountId: BigNumberish, + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOpenPosition( + accountId: BigNumberish, + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRequiredMargins( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getWithdrawableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + modifyCollateral( + accountId: BigNumberish, + synthMarketId: BigNumberish, + amountDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalAccountOpenInterest( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalCollateralValue( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingRate( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingVelocity( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fillPrice( + marketId: BigNumberish, + orderSize: BigNumberish, + price: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMarketSummary( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + indexPrice( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + maxOpenInterest( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + metadata( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + size(marketId: BigNumberish, overrides?: CallOverrides): Promise; + + skew(marketId: BigNumberish, overrides?: CallOverrides): Promise; + + commitOrder( + commitment: AsyncOrder.OrderCommitmentRequestStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + computeOrderFees( + marketId: BigNumberish, + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrder( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + PRECISION(overrides?: CallOverrides): Promise; + + settle( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + settlePythOrder( + result: BytesLike, + extraData: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + addToFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getDeniers( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagAllowAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagAllowlist( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagDenyAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + isFeatureAllowed( + feature: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + removeFromFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setDeniers( + feature: BytesLike, + deniers: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagAllowAll( + feature: BytesLike, + allowAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagDenyAll( + feature: BytesLike, + denyAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidate( + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateFlagged( + overrides?: Overrides & { from?: string } + ): Promise; + + addSettlementStrategy( + marketId: BigNumberish, + strategy: SettlementStrategy.DataStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + getFundingParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getLiquidationParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getLockedOiRatio( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMaxMarketSize( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrderFees( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSettlementStrategy( + marketId: BigNumberish, + strategyId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setFundingParameters( + marketId: BigNumberish, + skewScale: BigNumberish, + maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationParameters( + marketId: BigNumberish, + initialMarginRatioD18: BigNumberish, + maintenanceMarginRatioD18: BigNumberish, + liquidationRewardRatioD18: BigNumberish, + maxLiquidationLimitAccumulationMultiplier: BigNumberish, + maxSecondsInLiquidationWindow: BigNumberish, + minimumPositionMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLockedOiRatio( + marketId: BigNumberish, + lockedOiRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketSize( + marketId: BigNumberish, + maxMarketSize: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOrderFees( + marketId: BigNumberish, + makerFeeRatio: BigNumberish, + takerFeeRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSettlementStrategyEnabled( + marketId: BigNumberish, + strategyId: BigNumberish, + enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updatePriceData( + perpsMarketId: BigNumberish, + feedId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFeeCollector(overrides?: CallOverrides): Promise; + + getLiquidationRewardGuards(overrides?: CallOverrides): Promise; + + getMaxCollateralAmount( + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getReferrerShare( + referrer: string, + overrides?: CallOverrides + ): Promise; + + getSynthDeductionPriority(overrides?: CallOverrides): Promise; + + setFeeCollector( + feeCollector: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRewardGuards( + minLiquidationRewardUsd: BigNumberish, + maxLiquidationRewardUsd: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxCollateralAmount( + synthMarketId: BigNumberish, + collateralAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthDeductionPriority( + newSynthDeductionPriority: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + totalGlobalCollateralValue(overrides?: CallOverrides): Promise; + + updateReferrerShare( + referrer: string, + shareRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + "createAccount()"( + overrides?: Overrides & { from?: string } + ): Promise; + + "createAccount(uint128)"( + requestedAccountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountLastInteraction( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountOwner( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountPermissions( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountTokenAddress( + overrides?: CallOverrides + ): Promise; + + grantPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + hasPermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + isAuthorized( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: CallOverrides + ): Promise; + + notifyAccountTransfer( + to: string, + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + renouncePermission( + accountId: BigNumberish, + permission: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + revokePermission( + accountId: BigNumberish, + permission: BytesLike, + user: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getAssociatedSystem( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + initOrUpgradeNft( + id: BytesLike, + name: string, + symbol: string, + uri: string, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initOrUpgradeToken( + id: BytesLike, + name: string, + symbol: string, + decimals: BigNumberish, + impl: string, + overrides?: Overrides & { from?: string } + ): Promise; + + registerUnmanagedSystem( + id: BytesLike, + endpoint: string, + overrides?: Overrides & { from?: string } + ): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + getImplementation(overrides?: CallOverrides): Promise; + + nominateNewOwner( + newNominatedOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceNomination( + overrides?: Overrides & { from?: string } + ): Promise; + + simulateUpgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeTo( + newImplementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + createMarket( + requestedMarketId: BigNumberish, + marketName: string, + marketSymbol: string, + overrides?: Overrides & { from?: string } + ): Promise; + + initializeFactory( + overrides?: Overrides & { from?: string } + ): Promise; + + minimumCredit( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + name( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + reportedDebt( + perpsMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSpotMarket( + spotMarket: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthetix( + synthetix: string, + overrides?: Overrides & { from?: string } + ): Promise; + + supportsInterface( + interfaceId: BytesLike, + overrides?: CallOverrides + ): Promise; + + getAvailableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getCollateralAmount( + accountId: BigNumberish, + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOpenPosition( + accountId: BigNumberish, + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRequiredMargins( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getWithdrawableMargin( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + modifyCollateral( + accountId: BigNumberish, + synthMarketId: BigNumberish, + amountDelta: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + totalAccountOpenInterest( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalCollateralValue( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingRate( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + currentFundingVelocity( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + fillPrice( + marketId: BigNumberish, + orderSize: BigNumberish, + price: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMarketSummary( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + indexPrice( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + maxOpenInterest( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + metadata( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + size( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + skew( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + commitOrder( + commitment: AsyncOrder.OrderCommitmentRequestStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + computeOrderFees( + marketId: BigNumberish, + sizeDelta: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrder( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + PRECISION(overrides?: CallOverrides): Promise; + + settle( + accountId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + settlePythOrder( + result: BytesLike, + extraData: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + addToFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + getDeniers( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagAllowAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagAllowlist( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + getFeatureFlagDenyAll( + feature: BytesLike, + overrides?: CallOverrides + ): Promise; + + isFeatureAllowed( + feature: BytesLike, + account: string, + overrides?: CallOverrides + ): Promise; + + removeFromFeatureFlagAllowlist( + feature: BytesLike, + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setDeniers( + feature: BytesLike, + deniers: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagAllowAll( + feature: BytesLike, + allowAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeatureFlagDenyAll( + feature: BytesLike, + denyAll: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidate( + accountId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateFlagged( + overrides?: Overrides & { from?: string } + ): Promise; + + addSettlementStrategy( + marketId: BigNumberish, + strategy: SettlementStrategy.DataStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + getFundingParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getLiquidationParameters( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getLockedOiRatio( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getMaxMarketSize( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getOrderFees( + marketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSettlementStrategy( + marketId: BigNumberish, + strategyId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setFundingParameters( + marketId: BigNumberish, + skewScale: BigNumberish, + maxFundingVelocity: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationParameters( + marketId: BigNumberish, + initialMarginRatioD18: BigNumberish, + maintenanceMarginRatioD18: BigNumberish, + liquidationRewardRatioD18: BigNumberish, + maxLiquidationLimitAccumulationMultiplier: BigNumberish, + maxSecondsInLiquidationWindow: BigNumberish, + minimumPositionMargin: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLockedOiRatio( + marketId: BigNumberish, + lockedOiRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxMarketSize( + marketId: BigNumberish, + maxMarketSize: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOrderFees( + marketId: BigNumberish, + makerFeeRatio: BigNumberish, + takerFeeRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSettlementStrategyEnabled( + marketId: BigNumberish, + strategyId: BigNumberish, + enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updatePriceData( + perpsMarketId: BigNumberish, + feedId: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFeeCollector(overrides?: CallOverrides): Promise; + + getLiquidationRewardGuards( + overrides?: CallOverrides + ): Promise; + + getMaxCollateralAmount( + synthMarketId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getReferrerShare( + referrer: string, + overrides?: CallOverrides + ): Promise; + + getSynthDeductionPriority( + overrides?: CallOverrides + ): Promise; + + setFeeCollector( + feeCollector: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRewardGuards( + minLiquidationRewardUsd: BigNumberish, + maxLiquidationRewardUsd: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMaxCollateralAmount( + synthMarketId: BigNumberish, + collateralAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSynthDeductionPriority( + newSynthDeductionPriority: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + totalGlobalCollateralValue( + overrides?: CallOverrides + ): Promise; + + updateReferrerShare( + referrer: string, + shareRatioD18: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; +} diff --git a/packages/sdk/src/contracts/types/Pyth.ts b/packages/sdk/src/contracts/types/Pyth.ts index d08e934d97..256953e7f9 100644 --- a/packages/sdk/src/contracts/types/Pyth.ts +++ b/packages/sdk/src/contracts/types/Pyth.ts @@ -2,508 +2,570 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace PythStructs { - export type PriceStruct = { - price: PromiseOrValue - conf: PromiseOrValue - expo: PromiseOrValue - publishTime: PromiseOrValue - } - - export type PriceStructOutput = [BigNumber, BigNumber, number, BigNumber] & { - price: BigNumber - conf: BigNumber - expo: number - publishTime: BigNumber - } - - export type PriceFeedStruct = { - id: PromiseOrValue - price: PythStructs.PriceStruct - emaPrice: PythStructs.PriceStruct - } - - export type PriceFeedStructOutput = [ - string, - PythStructs.PriceStructOutput, - PythStructs.PriceStructOutput - ] & { - id: string - price: PythStructs.PriceStructOutput - emaPrice: PythStructs.PriceStructOutput - } + export type PriceStruct = { + price: BigNumberish; + conf: BigNumberish; + expo: BigNumberish; + publishTime: BigNumberish; + }; + + export type PriceStructOutput = [BigNumber, BigNumber, number, BigNumber] & { + price: BigNumber; + conf: BigNumber; + expo: number; + publishTime: BigNumber; + }; + + export type PriceFeedStruct = { + id: BytesLike; + price: PythStructs.PriceStruct; + emaPrice: PythStructs.PriceStruct; + }; + + export type PriceFeedStructOutput = [ + string, + PythStructs.PriceStructOutput, + PythStructs.PriceStructOutput + ] & { + id: string; + price: PythStructs.PriceStructOutput; + emaPrice: PythStructs.PriceStructOutput; + }; } export interface PythInterface extends utils.Interface { - functions: { - 'getEmaPrice(bytes32)': FunctionFragment - 'getEmaPriceNoOlderThan(bytes32,uint256)': FunctionFragment - 'getEmaPriceUnsafe(bytes32)': FunctionFragment - 'getPrice(bytes32)': FunctionFragment - 'getPriceNoOlderThan(bytes32,uint256)': FunctionFragment - 'getPriceUnsafe(bytes32)': FunctionFragment - 'getUpdateFee(bytes[])': FunctionFragment - 'getValidTimePeriod()': FunctionFragment - 'parsePriceFeedUpdates(bytes[],bytes32[],uint64,uint64)': FunctionFragment - 'updatePriceFeeds(bytes[])': FunctionFragment - 'updatePriceFeedsIfNecessary(bytes[],bytes32[],uint64[])': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'getEmaPrice' - | 'getEmaPriceNoOlderThan' - | 'getEmaPriceUnsafe' - | 'getPrice' - | 'getPriceNoOlderThan' - | 'getPriceUnsafe' - | 'getUpdateFee' - | 'getValidTimePeriod' - | 'parsePriceFeedUpdates' - | 'updatePriceFeeds' - | 'updatePriceFeedsIfNecessary' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'getEmaPrice', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'getEmaPriceNoOlderThan', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getEmaPriceUnsafe', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'getPrice', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'getPriceNoOlderThan', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getPriceUnsafe', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getUpdateFee', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'getValidTimePeriod', values?: undefined): string - encodeFunctionData( - functionFragment: 'parsePriceFeedUpdates', - values: [ - PromiseOrValue[], - PromiseOrValue[], - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'updatePriceFeeds', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'updatePriceFeedsIfNecessary', - values: [ - PromiseOrValue[], - PromiseOrValue[], - PromiseOrValue[] - ] - ): string - - decodeFunctionResult(functionFragment: 'getEmaPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getEmaPriceNoOlderThan', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getEmaPriceUnsafe', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getPrice', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getPriceNoOlderThan', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getPriceUnsafe', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getUpdateFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getValidTimePeriod', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'parsePriceFeedUpdates', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'updatePriceFeeds', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'updatePriceFeedsIfNecessary', data: BytesLike): Result - - events: { - 'BatchPriceFeedUpdate(uint16,uint64)': EventFragment - 'PriceFeedUpdate(bytes32,uint64,int64,uint64)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'BatchPriceFeedUpdate'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PriceFeedUpdate'): EventFragment + functions: { + "getEmaPrice(bytes32)": FunctionFragment; + "getEmaPriceNoOlderThan(bytes32,uint256)": FunctionFragment; + "getEmaPriceUnsafe(bytes32)": FunctionFragment; + "getPrice(bytes32)": FunctionFragment; + "getPriceNoOlderThan(bytes32,uint256)": FunctionFragment; + "getPriceUnsafe(bytes32)": FunctionFragment; + "getUpdateFee(bytes[])": FunctionFragment; + "getValidTimePeriod()": FunctionFragment; + "parsePriceFeedUpdates(bytes[],bytes32[],uint64,uint64)": FunctionFragment; + "updatePriceFeeds(bytes[])": FunctionFragment; + "updatePriceFeedsIfNecessary(bytes[],bytes32[],uint64[])": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "getEmaPrice" + | "getEmaPriceNoOlderThan" + | "getEmaPriceUnsafe" + | "getPrice" + | "getPriceNoOlderThan" + | "getPriceUnsafe" + | "getUpdateFee" + | "getValidTimePeriod" + | "parsePriceFeedUpdates" + | "updatePriceFeeds" + | "updatePriceFeedsIfNecessary" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "getEmaPrice", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getEmaPriceNoOlderThan", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getEmaPriceUnsafe", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "getPrice", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "getPriceNoOlderThan", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getPriceUnsafe", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getUpdateFee", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "getValidTimePeriod", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "parsePriceFeedUpdates", + values: [BytesLike[], BytesLike[], BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "updatePriceFeeds", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "updatePriceFeedsIfNecessary", + values: [BytesLike[], BytesLike[], BigNumberish[]] + ): string; + + decodeFunctionResult( + functionFragment: "getEmaPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getEmaPriceNoOlderThan", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getEmaPriceUnsafe", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getPriceNoOlderThan", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPriceUnsafe", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getUpdateFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getValidTimePeriod", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "parsePriceFeedUpdates", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updatePriceFeeds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updatePriceFeedsIfNecessary", + data: BytesLike + ): Result; + + events: { + "BatchPriceFeedUpdate(uint16,uint64)": EventFragment; + "PriceFeedUpdate(bytes32,uint64,int64,uint64)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "BatchPriceFeedUpdate"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PriceFeedUpdate"): EventFragment; } export interface BatchPriceFeedUpdateEventObject { - chainId: number - sequenceNumber: BigNumber + chainId: number; + sequenceNumber: BigNumber; } export type BatchPriceFeedUpdateEvent = TypedEvent< - [number, BigNumber], - BatchPriceFeedUpdateEventObject -> + [number, BigNumber], + BatchPriceFeedUpdateEventObject +>; -export type BatchPriceFeedUpdateEventFilter = TypedEventFilter +export type BatchPriceFeedUpdateEventFilter = + TypedEventFilter; export interface PriceFeedUpdateEventObject { - id: string - publishTime: BigNumber - price: BigNumber - conf: BigNumber + id: string; + publishTime: BigNumber; + price: BigNumber; + conf: BigNumber; } export type PriceFeedUpdateEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber], - PriceFeedUpdateEventObject -> + [string, BigNumber, BigNumber, BigNumber], + PriceFeedUpdateEventObject +>; -export type PriceFeedUpdateEventFilter = TypedEventFilter +export type PriceFeedUpdateEventFilter = TypedEventFilter; export interface Pyth extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: PythInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - getEmaPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput }> - - getEmaPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput }> - - getEmaPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput }> - - getPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput }> - - getPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput }> - - getPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput }> - - getUpdateFee( - updateData: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber] & { feeAmount: BigNumber }> - - getValidTimePeriod( - overrides?: CallOverrides - ): Promise<[BigNumber] & { validTimePeriod: BigNumber }> - - parsePriceFeedUpdates( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - minPublishTime: PromiseOrValue, - maxPublishTime: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeeds( - updateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeedsIfNecessary( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - publishTimes: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - } - - getEmaPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getEmaPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getEmaPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getUpdateFee( - updateData: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getValidTimePeriod(overrides?: CallOverrides): Promise - - parsePriceFeedUpdates( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - minPublishTime: PromiseOrValue, - maxPublishTime: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeeds( - updateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeedsIfNecessary( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - publishTimes: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - getEmaPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getEmaPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getEmaPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getUpdateFee( - updateData: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getValidTimePeriod(overrides?: CallOverrides): Promise - - parsePriceFeedUpdates( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - minPublishTime: PromiseOrValue, - maxPublishTime: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - updatePriceFeeds( - updateData: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - updatePriceFeedsIfNecessary( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - publishTimes: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - } - - filters: { - 'BatchPriceFeedUpdate(uint16,uint64)'( - chainId?: null, - sequenceNumber?: null - ): BatchPriceFeedUpdateEventFilter - BatchPriceFeedUpdate(chainId?: null, sequenceNumber?: null): BatchPriceFeedUpdateEventFilter - - 'PriceFeedUpdate(bytes32,uint64,int64,uint64)'( - id?: PromiseOrValue | null, - publishTime?: null, - price?: null, - conf?: null - ): PriceFeedUpdateEventFilter - PriceFeedUpdate( - id?: PromiseOrValue | null, - publishTime?: null, - price?: null, - conf?: null - ): PriceFeedUpdateEventFilter - } - - estimateGas: { - getEmaPrice(id: PromiseOrValue, overrides?: CallOverrides): Promise - - getEmaPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getEmaPriceUnsafe(id: PromiseOrValue, overrides?: CallOverrides): Promise - - getPrice(id: PromiseOrValue, overrides?: CallOverrides): Promise - - getPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPriceUnsafe(id: PromiseOrValue, overrides?: CallOverrides): Promise - - getUpdateFee( - updateData: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getValidTimePeriod(overrides?: CallOverrides): Promise - - parsePriceFeedUpdates( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - minPublishTime: PromiseOrValue, - maxPublishTime: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeeds( - updateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeedsIfNecessary( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - publishTimes: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - } - - populateTransaction: { - getEmaPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getEmaPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getEmaPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPrice( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPriceNoOlderThan( - id: PromiseOrValue, - age: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getPriceUnsafe( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getUpdateFee( - updateData: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getValidTimePeriod(overrides?: CallOverrides): Promise - - parsePriceFeedUpdates( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - minPublishTime: PromiseOrValue, - maxPublishTime: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeeds( - updateData: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - updatePriceFeedsIfNecessary( - updateData: PromiseOrValue[], - priceIds: PromiseOrValue[], - publishTimes: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PythInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + getEmaPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise< + [PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput } + >; + + getEmaPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise< + [PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput } + >; + + getEmaPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise< + [PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput } + >; + + getPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise< + [PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput } + >; + + getPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise< + [PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput } + >; + + getPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise< + [PythStructs.PriceStructOutput] & { price: PythStructs.PriceStructOutput } + >; + + getUpdateFee( + updateData: BytesLike[], + overrides?: CallOverrides + ): Promise<[BigNumber] & { feeAmount: BigNumber }>; + + getValidTimePeriod( + overrides?: CallOverrides + ): Promise<[BigNumber] & { validTimePeriod: BigNumber }>; + + parsePriceFeedUpdates( + updateData: BytesLike[], + priceIds: BytesLike[], + minPublishTime: BigNumberish, + maxPublishTime: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeeds( + updateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeedsIfNecessary( + updateData: BytesLike[], + priceIds: BytesLike[], + publishTimes: BigNumberish[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + getEmaPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getEmaPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getEmaPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getUpdateFee( + updateData: BytesLike[], + overrides?: CallOverrides + ): Promise; + + getValidTimePeriod(overrides?: CallOverrides): Promise; + + parsePriceFeedUpdates( + updateData: BytesLike[], + priceIds: BytesLike[], + minPublishTime: BigNumberish, + maxPublishTime: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeeds( + updateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeedsIfNecessary( + updateData: BytesLike[], + priceIds: BytesLike[], + publishTimes: BigNumberish[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + callStatic: { + getEmaPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getEmaPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getEmaPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getUpdateFee( + updateData: BytesLike[], + overrides?: CallOverrides + ): Promise; + + getValidTimePeriod(overrides?: CallOverrides): Promise; + + parsePriceFeedUpdates( + updateData: BytesLike[], + priceIds: BytesLike[], + minPublishTime: BigNumberish, + maxPublishTime: BigNumberish, + overrides?: CallOverrides + ): Promise; + + updatePriceFeeds( + updateData: BytesLike[], + overrides?: CallOverrides + ): Promise; + + updatePriceFeedsIfNecessary( + updateData: BytesLike[], + priceIds: BytesLike[], + publishTimes: BigNumberish[], + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "BatchPriceFeedUpdate(uint16,uint64)"( + chainId?: null, + sequenceNumber?: null + ): BatchPriceFeedUpdateEventFilter; + BatchPriceFeedUpdate( + chainId?: null, + sequenceNumber?: null + ): BatchPriceFeedUpdateEventFilter; + + "PriceFeedUpdate(bytes32,uint64,int64,uint64)"( + id?: BytesLike | null, + publishTime?: null, + price?: null, + conf?: null + ): PriceFeedUpdateEventFilter; + PriceFeedUpdate( + id?: BytesLike | null, + publishTime?: null, + price?: null, + conf?: null + ): PriceFeedUpdateEventFilter; + }; + + estimateGas: { + getEmaPrice(id: BytesLike, overrides?: CallOverrides): Promise; + + getEmaPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getEmaPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getPrice(id: BytesLike, overrides?: CallOverrides): Promise; + + getPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getUpdateFee( + updateData: BytesLike[], + overrides?: CallOverrides + ): Promise; + + getValidTimePeriod(overrides?: CallOverrides): Promise; + + parsePriceFeedUpdates( + updateData: BytesLike[], + priceIds: BytesLike[], + minPublishTime: BigNumberish, + maxPublishTime: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeeds( + updateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeedsIfNecessary( + updateData: BytesLike[], + priceIds: BytesLike[], + publishTimes: BigNumberish[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + getEmaPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getEmaPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getEmaPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getPrice( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getPriceNoOlderThan( + id: BytesLike, + age: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getPriceUnsafe( + id: BytesLike, + overrides?: CallOverrides + ): Promise; + + getUpdateFee( + updateData: BytesLike[], + overrides?: CallOverrides + ): Promise; + + getValidTimePeriod( + overrides?: CallOverrides + ): Promise; + + parsePriceFeedUpdates( + updateData: BytesLike[], + priceIds: BytesLike[], + minPublishTime: BigNumberish, + maxPublishTime: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeeds( + updateData: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + updatePriceFeedsIfNecessary( + updateData: BytesLike[], + priceIds: BytesLike[], + publishTimes: BigNumberish[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/ReverseRecords.ts b/packages/sdk/src/contracts/types/ReverseRecords.ts index 84b9437d03..6706068a9a 100644 --- a/packages/sdk/src/contracts/types/ReverseRecords.ts +++ b/packages/sdk/src/contracts/types/ReverseRecords.ts @@ -2,79 +2,89 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BytesLike, - CallOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface ReverseRecordsInterface extends utils.Interface { - functions: { - 'getNames(address[])': FunctionFragment - } + functions: { + "getNames(address[])": FunctionFragment; + }; - getFunction(nameOrSignatureOrTopic: 'getNames'): FunctionFragment + getFunction(nameOrSignatureOrTopic: "getNames"): FunctionFragment; - encodeFunctionData(functionFragment: 'getNames', values: [PromiseOrValue[]]): string + encodeFunctionData(functionFragment: "getNames", values: [string[]]): string; - decodeFunctionResult(functionFragment: 'getNames', data: BytesLike): Result + decodeFunctionResult(functionFragment: "getNames", data: BytesLike): Result; - events: {} + events: {}; } export interface ReverseRecords extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - interface: ReverseRecordsInterface + interface: ReverseRecordsInterface; - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - functions: { - getNames( - addresses: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[string[]] & { r: string[] }> - } + functions: { + getNames( + addresses: string[], + overrides?: CallOverrides + ): Promise<[string[]] & { r: string[] }>; + }; - getNames(addresses: PromiseOrValue[], overrides?: CallOverrides): Promise + getNames(addresses: string[], overrides?: CallOverrides): Promise; - callStatic: { - getNames(addresses: PromiseOrValue[], overrides?: CallOverrides): Promise - } + callStatic: { + getNames(addresses: string[], overrides?: CallOverrides): Promise; + }; - filters: {} + filters: {}; - estimateGas: { - getNames(addresses: PromiseOrValue[], overrides?: CallOverrides): Promise - } + estimateGas: { + getNames( + addresses: string[], + overrides?: CallOverrides + ): Promise; + }; - populateTransaction: { - getNames( - addresses: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - } + populateTransaction: { + getNames( + addresses: string[], + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/RewardEscrow.ts b/packages/sdk/src/contracts/types/RewardEscrow.ts index 60634b6fc7..c82c6c2944 100644 --- a/packages/sdk/src/contracts/types/RewardEscrow.ts +++ b/packages/sdk/src/contracts/types/RewardEscrow.ts @@ -2,973 +2,1137 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace VestingEntries { - export type VestingEntryWithIDStruct = { - endTime: PromiseOrValue - escrowAmount: PromiseOrValue - entryID: PromiseOrValue - } - - export type VestingEntryWithIDStructOutput = [BigNumber, BigNumber, BigNumber] & { - endTime: BigNumber - escrowAmount: BigNumber - entryID: BigNumber - } + export type VestingEntryWithIDStruct = { + endTime: BigNumberish; + escrowAmount: BigNumberish; + entryID: BigNumberish; + }; + + export type VestingEntryWithIDStructOutput = [ + BigNumber, + BigNumber, + BigNumber + ] & { endTime: BigNumber; escrowAmount: BigNumber; entryID: BigNumber }; } export interface RewardEscrowInterface extends utils.Interface { - functions: { - 'MAX_DURATION()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'accountVestingEntryIDs(address,uint256)': FunctionFragment - 'appendVestingEntry(address,uint256,uint256)': FunctionFragment - 'balanceOf(address)': FunctionFragment - 'createEscrowEntry(address,uint256,uint256)': FunctionFragment - 'getAccountVestingEntryIDs(address,uint256,uint256)': FunctionFragment - 'getKwentaAddress()': FunctionFragment - 'getVestingEntry(address,uint256)': FunctionFragment - 'getVestingEntryClaimable(address,uint256)': FunctionFragment - 'getVestingQuantity(address,uint256[])': FunctionFragment - 'getVestingSchedules(address,uint256,uint256)': FunctionFragment - 'nextEntryId()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'numVestingEntries(address)': FunctionFragment - 'owner()': FunctionFragment - 'setStakingRewards(address)': FunctionFragment - 'setTreasuryDAO(address)': FunctionFragment - 'stakeEscrow(uint256)': FunctionFragment - 'stakingRewards()': FunctionFragment - 'totalEscrowedAccountBalance(address)': FunctionFragment - 'totalEscrowedBalance()': FunctionFragment - 'totalVestedAccountBalance(address)': FunctionFragment - 'treasuryDAO()': FunctionFragment - 'unstakeEscrow(uint256)': FunctionFragment - 'vest(uint256[])': FunctionFragment - 'vestingSchedules(address,uint256)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'MAX_DURATION' - | 'acceptOwnership' - | 'accountVestingEntryIDs' - | 'appendVestingEntry' - | 'balanceOf' - | 'createEscrowEntry' - | 'getAccountVestingEntryIDs' - | 'getKwentaAddress' - | 'getVestingEntry' - | 'getVestingEntryClaimable' - | 'getVestingQuantity' - | 'getVestingSchedules' - | 'nextEntryId' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'numVestingEntries' - | 'owner' - | 'setStakingRewards' - | 'setTreasuryDAO' - | 'stakeEscrow' - | 'stakingRewards' - | 'totalEscrowedAccountBalance' - | 'totalEscrowedBalance' - | 'totalVestedAccountBalance' - | 'treasuryDAO' - | 'unstakeEscrow' - | 'vest' - | 'vestingSchedules' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'MAX_DURATION', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'accountVestingEntryIDs', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'appendVestingEntry', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'createEscrowEntry', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getAccountVestingEntryIDs', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'getKwentaAddress', values?: undefined): string - encodeFunctionData( - functionFragment: 'getVestingEntry', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getVestingEntryClaimable', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getVestingQuantity', - values: [PromiseOrValue, PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'getVestingSchedules', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'nextEntryId', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData( - functionFragment: 'numVestingEntries', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData( - functionFragment: 'setStakingRewards', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'setTreasuryDAO', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'stakeEscrow', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'stakingRewards', values?: undefined): string - encodeFunctionData( - functionFragment: 'totalEscrowedAccountBalance', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'totalEscrowedBalance', values?: undefined): string - encodeFunctionData( - functionFragment: 'totalVestedAccountBalance', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'treasuryDAO', values?: undefined): string - encodeFunctionData( - functionFragment: 'unstakeEscrow', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'vest', values: [PromiseOrValue[]]): string - encodeFunctionData( - functionFragment: 'vestingSchedules', - values: [PromiseOrValue, PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'MAX_DURATION', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'accountVestingEntryIDs', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'appendVestingEntry', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'createEscrowEntry', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getAccountVestingEntryIDs', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getKwentaAddress', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getVestingEntry', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getVestingEntryClaimable', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getVestingQuantity', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getVestingSchedules', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nextEntryId', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'numVestingEntries', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setStakingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTreasuryDAO', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'stakeEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'stakingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalEscrowedAccountBalance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalEscrowedBalance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalVestedAccountBalance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'treasuryDAO', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'unstakeEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'vest', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'vestingSchedules', data: BytesLike): Result - - events: { - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'StakingRewardsSet(address)': EventFragment - 'TreasuryDAOSet(address)': EventFragment - 'Vested(address,uint256)': EventFragment - 'VestingEntryCreated(address,uint256,uint256,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'StakingRewardsSet'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TreasuryDAOSet'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Vested'): EventFragment - getEvent(nameOrSignatureOrTopic: 'VestingEntryCreated'): EventFragment + functions: { + "MAX_DURATION()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "accountVestingEntryIDs(address,uint256)": FunctionFragment; + "appendVestingEntry(address,uint256,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "createEscrowEntry(address,uint256,uint256)": FunctionFragment; + "getAccountVestingEntryIDs(address,uint256,uint256)": FunctionFragment; + "getKwentaAddress()": FunctionFragment; + "getVestingEntry(address,uint256)": FunctionFragment; + "getVestingEntryClaimable(address,uint256)": FunctionFragment; + "getVestingQuantity(address,uint256[])": FunctionFragment; + "getVestingSchedules(address,uint256,uint256)": FunctionFragment; + "nextEntryId()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "numVestingEntries(address)": FunctionFragment; + "owner()": FunctionFragment; + "setStakingRewards(address)": FunctionFragment; + "setTreasuryDAO(address)": FunctionFragment; + "stakeEscrow(uint256)": FunctionFragment; + "stakingRewards()": FunctionFragment; + "totalEscrowedAccountBalance(address)": FunctionFragment; + "totalEscrowedBalance()": FunctionFragment; + "totalVestedAccountBalance(address)": FunctionFragment; + "treasuryDAO()": FunctionFragment; + "unstakeEscrow(uint256)": FunctionFragment; + "vest(uint256[])": FunctionFragment; + "vestingSchedules(address,uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "MAX_DURATION" + | "acceptOwnership" + | "accountVestingEntryIDs" + | "appendVestingEntry" + | "balanceOf" + | "createEscrowEntry" + | "getAccountVestingEntryIDs" + | "getKwentaAddress" + | "getVestingEntry" + | "getVestingEntryClaimable" + | "getVestingQuantity" + | "getVestingSchedules" + | "nextEntryId" + | "nominateNewOwner" + | "nominatedOwner" + | "numVestingEntries" + | "owner" + | "setStakingRewards" + | "setTreasuryDAO" + | "stakeEscrow" + | "stakingRewards" + | "totalEscrowedAccountBalance" + | "totalEscrowedBalance" + | "totalVestedAccountBalance" + | "treasuryDAO" + | "unstakeEscrow" + | "vest" + | "vestingSchedules" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "MAX_DURATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "accountVestingEntryIDs", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "appendVestingEntry", + values: [string, BigNumberish, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "createEscrowEntry", + values: [string, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getAccountVestingEntryIDs", + values: [string, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getKwentaAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getVestingEntry", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getVestingEntryClaimable", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getVestingQuantity", + values: [string, BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "getVestingSchedules", + values: [string, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "nextEntryId", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "numVestingEntries", + values: [string] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "setStakingRewards", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setTreasuryDAO", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "stakeEscrow", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "stakingRewards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalEscrowedAccountBalance", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "totalEscrowedBalance", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalVestedAccountBalance", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "treasuryDAO", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "unstakeEscrow", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "vest", + values: [BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "vestingSchedules", + values: [string, BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "MAX_DURATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "accountVestingEntryIDs", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "appendVestingEntry", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "createEscrowEntry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAccountVestingEntryIDs", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getKwentaAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getVestingEntry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getVestingEntryClaimable", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getVestingQuantity", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getVestingSchedules", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nextEntryId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "numVestingEntries", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setStakingRewards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTreasuryDAO", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "stakeEscrow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "stakingRewards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalEscrowedAccountBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalEscrowedBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalVestedAccountBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "treasuryDAO", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "unstakeEscrow", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "vest", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "vestingSchedules", + data: BytesLike + ): Result; + + events: { + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "StakingRewardsSet(address)": EventFragment; + "TreasuryDAOSet(address)": EventFragment; + "Vested(address,uint256)": EventFragment; + "VestingEntryCreated(address,uint256,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "StakingRewardsSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TreasuryDAOSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Vested"): EventFragment; + getEvent(nameOrSignatureOrTopic: "VestingEntryCreated"): EventFragment; } export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface StakingRewardsSetEventObject { - rewardEscrow: string + rewardEscrow: string; } -export type StakingRewardsSetEvent = TypedEvent<[string], StakingRewardsSetEventObject> +export type StakingRewardsSetEvent = TypedEvent< + [string], + StakingRewardsSetEventObject +>; -export type StakingRewardsSetEventFilter = TypedEventFilter +export type StakingRewardsSetEventFilter = + TypedEventFilter; export interface TreasuryDAOSetEventObject { - treasuryDAO: string + treasuryDAO: string; } -export type TreasuryDAOSetEvent = TypedEvent<[string], TreasuryDAOSetEventObject> +export type TreasuryDAOSetEvent = TypedEvent< + [string], + TreasuryDAOSetEventObject +>; -export type TreasuryDAOSetEventFilter = TypedEventFilter +export type TreasuryDAOSetEventFilter = TypedEventFilter; export interface VestedEventObject { - beneficiary: string - value: BigNumber + beneficiary: string; + value: BigNumber; } -export type VestedEvent = TypedEvent<[string, BigNumber], VestedEventObject> +export type VestedEvent = TypedEvent<[string, BigNumber], VestedEventObject>; -export type VestedEventFilter = TypedEventFilter +export type VestedEventFilter = TypedEventFilter; export interface VestingEntryCreatedEventObject { - beneficiary: string - value: BigNumber - duration: BigNumber - entryID: BigNumber + beneficiary: string; + value: BigNumber; + duration: BigNumber; + entryID: BigNumber; } export type VestingEntryCreatedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber], - VestingEntryCreatedEventObject -> + [string, BigNumber, BigNumber, BigNumber], + VestingEntryCreatedEventObject +>; -export type VestingEntryCreatedEventFilter = TypedEventFilter +export type VestingEntryCreatedEventFilter = + TypedEventFilter; export interface RewardEscrow extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: RewardEscrowInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - MAX_DURATION(overrides?: CallOverrides): Promise<[BigNumber]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - accountVestingEntryIDs( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - appendVestingEntry( - account: PromiseOrValue, - quantity: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - createEscrowEntry( - beneficiary: PromiseOrValue, - deposit: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getAccountVestingEntryIDs( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber[]]> - - getKwentaAddress(overrides?: CallOverrides): Promise<[string]> - - getVestingEntry( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - endTime: BigNumber - escrowAmount: BigNumber - duration: BigNumber - } - > - - getVestingEntryClaimable( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { quantity: BigNumber; fee: BigNumber }> - - getVestingQuantity( - account: PromiseOrValue, - entryIDs: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { total: BigNumber; totalFee: BigNumber }> - - getVestingSchedules( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[VestingEntries.VestingEntryWithIDStructOutput[]]> - - nextEntryId(overrides?: CallOverrides): Promise<[BigNumber]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - numVestingEntries( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - owner(overrides?: CallOverrides): Promise<[string]> - - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakingRewards(overrides?: CallOverrides): Promise<[string]> - - totalEscrowedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - totalEscrowedBalance(overrides?: CallOverrides): Promise<[BigNumber]> - - totalVestedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - treasuryDAO(overrides?: CallOverrides): Promise<[string]> - - unstakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vest( - entryIDs: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vestingSchedules( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - endTime: BigNumber - escrowAmount: BigNumber - duration: BigNumber - } - > - } - - MAX_DURATION(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - accountVestingEntryIDs( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - appendVestingEntry( - account: PromiseOrValue, - quantity: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - createEscrowEntry( - beneficiary: PromiseOrValue, - deposit: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getAccountVestingEntryIDs( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getKwentaAddress(overrides?: CallOverrides): Promise - - getVestingEntry( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - endTime: BigNumber - escrowAmount: BigNumber - duration: BigNumber - } - > - - getVestingEntryClaimable( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { quantity: BigNumber; fee: BigNumber }> - - getVestingQuantity( - account: PromiseOrValue, - entryIDs: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { total: BigNumber; totalFee: BigNumber }> - - getVestingSchedules( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nextEntryId(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - numVestingEntries(account: PromiseOrValue, overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakingRewards(overrides?: CallOverrides): Promise - - totalEscrowedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - totalEscrowedBalance(overrides?: CallOverrides): Promise - - totalVestedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - treasuryDAO(overrides?: CallOverrides): Promise - - unstakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vest( - entryIDs: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vestingSchedules( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - endTime: BigNumber - escrowAmount: BigNumber - duration: BigNumber - } - > - - callStatic: { - MAX_DURATION(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: CallOverrides): Promise - - accountVestingEntryIDs( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - appendVestingEntry( - account: PromiseOrValue, - quantity: PromiseOrValue, - duration: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - createEscrowEntry( - beneficiary: PromiseOrValue, - deposit: PromiseOrValue, - duration: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getAccountVestingEntryIDs( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getKwentaAddress(overrides?: CallOverrides): Promise - - getVestingEntry( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - endTime: BigNumber - escrowAmount: BigNumber - duration: BigNumber - } - > - - getVestingEntryClaimable( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { quantity: BigNumber; fee: BigNumber }> - - getVestingQuantity( - account: PromiseOrValue, - entryIDs: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[BigNumber, BigNumber] & { total: BigNumber; totalFee: BigNumber }> - - getVestingSchedules( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nextEntryId(overrides?: CallOverrides): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - numVestingEntries( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - owner(overrides?: CallOverrides): Promise - - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTreasuryDAO(_treasuryDAO: PromiseOrValue, overrides?: CallOverrides): Promise - - stakeEscrow(_amount: PromiseOrValue, overrides?: CallOverrides): Promise - - stakingRewards(overrides?: CallOverrides): Promise - - totalEscrowedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - totalEscrowedBalance(overrides?: CallOverrides): Promise - - totalVestedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - treasuryDAO(overrides?: CallOverrides): Promise - - unstakeEscrow(_amount: PromiseOrValue, overrides?: CallOverrides): Promise - - vest(entryIDs: PromiseOrValue[], overrides?: CallOverrides): Promise - - vestingSchedules( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - endTime: BigNumber - escrowAmount: BigNumber - duration: BigNumber - } - > - } - - filters: { - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - - 'StakingRewardsSet(address)'(rewardEscrow?: null): StakingRewardsSetEventFilter - StakingRewardsSet(rewardEscrow?: null): StakingRewardsSetEventFilter - - 'TreasuryDAOSet(address)'(treasuryDAO?: null): TreasuryDAOSetEventFilter - TreasuryDAOSet(treasuryDAO?: null): TreasuryDAOSetEventFilter - - 'Vested(address,uint256)'( - beneficiary?: PromiseOrValue | null, - value?: null - ): VestedEventFilter - Vested(beneficiary?: PromiseOrValue | null, value?: null): VestedEventFilter - - 'VestingEntryCreated(address,uint256,uint256,uint256)'( - beneficiary?: PromiseOrValue | null, - value?: null, - duration?: null, - entryID?: null - ): VestingEntryCreatedEventFilter - VestingEntryCreated( - beneficiary?: PromiseOrValue | null, - value?: null, - duration?: null, - entryID?: null - ): VestingEntryCreatedEventFilter - } - - estimateGas: { - MAX_DURATION(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - accountVestingEntryIDs( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - appendVestingEntry( - account: PromiseOrValue, - quantity: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - createEscrowEntry( - beneficiary: PromiseOrValue, - deposit: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getAccountVestingEntryIDs( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getKwentaAddress(overrides?: CallOverrides): Promise - - getVestingEntry( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getVestingEntryClaimable( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getVestingQuantity( - account: PromiseOrValue, - entryIDs: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getVestingSchedules( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nextEntryId(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - numVestingEntries( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - owner(overrides?: CallOverrides): Promise - - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakingRewards(overrides?: CallOverrides): Promise - - totalEscrowedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - totalEscrowedBalance(overrides?: CallOverrides): Promise - - totalVestedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - treasuryDAO(overrides?: CallOverrides): Promise - - unstakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vest( - entryIDs: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vestingSchedules( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - populateTransaction: { - MAX_DURATION(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - accountVestingEntryIDs( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - appendVestingEntry( - account: PromiseOrValue, - quantity: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - createEscrowEntry( - beneficiary: PromiseOrValue, - deposit: PromiseOrValue, - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getAccountVestingEntryIDs( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getKwentaAddress(overrides?: CallOverrides): Promise - - getVestingEntry( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getVestingEntryClaimable( - account: PromiseOrValue, - entryID: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getVestingQuantity( - account: PromiseOrValue, - entryIDs: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getVestingSchedules( - account: PromiseOrValue, - index: PromiseOrValue, - pageSize: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - nextEntryId(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - numVestingEntries( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - owner(overrides?: CallOverrides): Promise - - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - stakingRewards(overrides?: CallOverrides): Promise - - totalEscrowedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - totalEscrowedBalance(overrides?: CallOverrides): Promise - - totalVestedAccountBalance( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - treasuryDAO(overrides?: CallOverrides): Promise - - unstakeEscrow( - _amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vest( - entryIDs: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - vestingSchedules( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: RewardEscrowInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + MAX_DURATION(overrides?: CallOverrides): Promise<[BigNumber]>; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accountVestingEntryIDs( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + appendVestingEntry( + account: string, + quantity: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + createEscrowEntry( + beneficiary: string, + deposit: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountVestingEntryIDs( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber[]]>; + + getKwentaAddress(overrides?: CallOverrides): Promise<[string]>; + + getVestingEntry( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + endTime: BigNumber; + escrowAmount: BigNumber; + duration: BigNumber; + } + >; + + getVestingEntryClaimable( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { quantity: BigNumber; fee: BigNumber } + >; + + getVestingQuantity( + account: string, + entryIDs: BigNumberish[], + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { total: BigNumber; totalFee: BigNumber } + >; + + getVestingSchedules( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise<[VestingEntries.VestingEntryWithIDStructOutput[]]>; + + nextEntryId(overrides?: CallOverrides): Promise<[BigNumber]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + numVestingEntries( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; + + stakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + stakingRewards(overrides?: CallOverrides): Promise<[string]>; + + totalEscrowedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + totalEscrowedBalance(overrides?: CallOverrides): Promise<[BigNumber]>; + + totalVestedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + treasuryDAO(overrides?: CallOverrides): Promise<[string]>; + + unstakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + vest( + entryIDs: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + vestingSchedules( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + endTime: BigNumber; + escrowAmount: BigNumber; + duration: BigNumber; + } + >; + }; + + MAX_DURATION(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accountVestingEntryIDs( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + appendVestingEntry( + account: string, + quantity: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + createEscrowEntry( + beneficiary: string, + deposit: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountVestingEntryIDs( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getKwentaAddress(overrides?: CallOverrides): Promise; + + getVestingEntry( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + endTime: BigNumber; + escrowAmount: BigNumber; + duration: BigNumber; + } + >; + + getVestingEntryClaimable( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber, BigNumber] & { quantity: BigNumber; fee: BigNumber }>; + + getVestingQuantity( + account: string, + entryIDs: BigNumberish[], + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { total: BigNumber; totalFee: BigNumber } + >; + + getVestingSchedules( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nextEntryId(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + numVestingEntries( + account: string, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; + + stakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + stakingRewards(overrides?: CallOverrides): Promise; + + totalEscrowedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + totalEscrowedBalance(overrides?: CallOverrides): Promise; + + totalVestedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + treasuryDAO(overrides?: CallOverrides): Promise; + + unstakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + vest( + entryIDs: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + vestingSchedules( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + endTime: BigNumber; + escrowAmount: BigNumber; + duration: BigNumber; + } + >; + + callStatic: { + MAX_DURATION(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + accountVestingEntryIDs( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + appendVestingEntry( + account: string, + quantity: BigNumberish, + duration: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + createEscrowEntry( + beneficiary: string, + deposit: BigNumberish, + duration: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getAccountVestingEntryIDs( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getKwentaAddress(overrides?: CallOverrides): Promise; + + getVestingEntry( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + endTime: BigNumber; + escrowAmount: BigNumber; + duration: BigNumber; + } + >; + + getVestingEntryClaimable( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { quantity: BigNumber; fee: BigNumber } + >; + + getVestingQuantity( + account: string, + entryIDs: BigNumberish[], + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { total: BigNumber; totalFee: BigNumber } + >; + + getVestingSchedules( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nextEntryId(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + numVestingEntries( + account: string, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + setStakingRewards( + _stakingRewards: string, + overrides?: CallOverrides + ): Promise; + + setTreasuryDAO( + _treasuryDAO: string, + overrides?: CallOverrides + ): Promise; + + stakeEscrow( + _amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + stakingRewards(overrides?: CallOverrides): Promise; + + totalEscrowedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + totalEscrowedBalance(overrides?: CallOverrides): Promise; + + totalVestedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + treasuryDAO(overrides?: CallOverrides): Promise; + + unstakeEscrow( + _amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + vest(entryIDs: BigNumberish[], overrides?: CallOverrides): Promise; + + vestingSchedules( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + endTime: BigNumber; + escrowAmount: BigNumber; + duration: BigNumber; + } + >; + }; + + filters: { + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "StakingRewardsSet(address)"( + rewardEscrow?: null + ): StakingRewardsSetEventFilter; + StakingRewardsSet(rewardEscrow?: null): StakingRewardsSetEventFilter; + + "TreasuryDAOSet(address)"(treasuryDAO?: null): TreasuryDAOSetEventFilter; + TreasuryDAOSet(treasuryDAO?: null): TreasuryDAOSetEventFilter; + + "Vested(address,uint256)"( + beneficiary?: string | null, + value?: null + ): VestedEventFilter; + Vested(beneficiary?: string | null, value?: null): VestedEventFilter; + + "VestingEntryCreated(address,uint256,uint256,uint256)"( + beneficiary?: string | null, + value?: null, + duration?: null, + entryID?: null + ): VestingEntryCreatedEventFilter; + VestingEntryCreated( + beneficiary?: string | null, + value?: null, + duration?: null, + entryID?: null + ): VestingEntryCreatedEventFilter; + }; + + estimateGas: { + MAX_DURATION(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accountVestingEntryIDs( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + appendVestingEntry( + account: string, + quantity: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + createEscrowEntry( + beneficiary: string, + deposit: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountVestingEntryIDs( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getKwentaAddress(overrides?: CallOverrides): Promise; + + getVestingEntry( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getVestingEntryClaimable( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getVestingQuantity( + account: string, + entryIDs: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + getVestingSchedules( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nextEntryId(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + numVestingEntries( + account: string, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; + + stakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + stakingRewards(overrides?: CallOverrides): Promise; + + totalEscrowedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + totalEscrowedBalance(overrides?: CallOverrides): Promise; + + totalVestedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + treasuryDAO(overrides?: CallOverrides): Promise; + + unstakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + vest( + entryIDs: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + vestingSchedules( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + MAX_DURATION(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accountVestingEntryIDs( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + appendVestingEntry( + account: string, + quantity: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; + + createEscrowEntry( + beneficiary: string, + deposit: BigNumberish, + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getAccountVestingEntryIDs( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getKwentaAddress(overrides?: CallOverrides): Promise; + + getVestingEntry( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getVestingEntryClaimable( + account: string, + entryID: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getVestingQuantity( + account: string, + entryIDs: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + getVestingSchedules( + account: string, + index: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + nextEntryId(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + numVestingEntries( + account: string, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; + + stakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + stakingRewards(overrides?: CallOverrides): Promise; + + totalEscrowedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + totalEscrowedBalance( + overrides?: CallOverrides + ): Promise; + + totalVestedAccountBalance( + arg0: string, + overrides?: CallOverrides + ): Promise; + + treasuryDAO(overrides?: CallOverrides): Promise; + + unstakeEscrow( + _amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + vest( + entryIDs: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + vestingSchedules( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SmartMarginAccount.ts b/packages/sdk/src/contracts/types/SmartMarginAccount.ts index f3d251f70b..75f741ce5f 100644 --- a/packages/sdk/src/contracts/types/SmartMarginAccount.ts +++ b/packages/sdk/src/contracts/types/SmartMarginAccount.ts @@ -2,685 +2,761 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export declare namespace IAccount { - export type ConditionalOrderStruct = { - marketKey: PromiseOrValue - marginDelta: PromiseOrValue - sizeDelta: PromiseOrValue - targetPrice: PromiseOrValue - gelatoTaskId: PromiseOrValue - conditionalOrderType: PromiseOrValue - desiredFillPrice: PromiseOrValue - reduceOnly: PromiseOrValue - } - - export type ConditionalOrderStructOutput = [ - string, - BigNumber, - BigNumber, - BigNumber, - string, - number, - BigNumber, - boolean - ] & { - marketKey: string - marginDelta: BigNumber - sizeDelta: BigNumber - targetPrice: BigNumber - gelatoTaskId: string - conditionalOrderType: number - desiredFillPrice: BigNumber - reduceOnly: boolean - } + export type ConditionalOrderStruct = { + marketKey: BytesLike; + marginDelta: BigNumberish; + sizeDelta: BigNumberish; + targetPrice: BigNumberish; + gelatoTaskId: BytesLike; + conditionalOrderType: BigNumberish; + desiredFillPrice: BigNumberish; + reduceOnly: boolean; + }; + + export type ConditionalOrderStructOutput = [ + string, + BigNumber, + BigNumber, + BigNumber, + string, + number, + BigNumber, + boolean + ] & { + marketKey: string; + marginDelta: BigNumber; + sizeDelta: BigNumber; + targetPrice: BigNumber; + gelatoTaskId: string; + conditionalOrderType: number; + desiredFillPrice: BigNumber; + reduceOnly: boolean; + }; } export declare namespace IPerpsV2MarketConsolidated { - export type DelayedOrderStruct = { - isOffchain: PromiseOrValue - sizeDelta: PromiseOrValue - desiredFillPrice: PromiseOrValue - targetRoundId: PromiseOrValue - commitDeposit: PromiseOrValue - keeperDeposit: PromiseOrValue - executableAtTime: PromiseOrValue - intentionTime: PromiseOrValue - trackingCode: PromiseOrValue - } - - export type DelayedOrderStructOutput = [ - boolean, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - string - ] & { - isOffchain: boolean - sizeDelta: BigNumber - desiredFillPrice: BigNumber - targetRoundId: BigNumber - commitDeposit: BigNumber - keeperDeposit: BigNumber - executableAtTime: BigNumber - intentionTime: BigNumber - trackingCode: string - } - - export type PositionStruct = { - id: PromiseOrValue - lastFundingIndex: PromiseOrValue - margin: PromiseOrValue - lastPrice: PromiseOrValue - size: PromiseOrValue - } - - export type PositionStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - id: BigNumber - lastFundingIndex: BigNumber - margin: BigNumber - lastPrice: BigNumber - size: BigNumber - } + export type DelayedOrderStruct = { + isOffchain: boolean; + sizeDelta: BigNumberish; + desiredFillPrice: BigNumberish; + targetRoundId: BigNumberish; + commitDeposit: BigNumberish; + keeperDeposit: BigNumberish; + executableAtTime: BigNumberish; + intentionTime: BigNumberish; + trackingCode: BytesLike; + }; + + export type DelayedOrderStructOutput = [ + boolean, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string + ] & { + isOffchain: boolean; + sizeDelta: BigNumber; + desiredFillPrice: BigNumber; + targetRoundId: BigNumber; + commitDeposit: BigNumber; + keeperDeposit: BigNumber; + executableAtTime: BigNumber; + intentionTime: BigNumber; + trackingCode: string; + }; + + export type PositionStruct = { + id: BigNumberish; + lastFundingIndex: BigNumberish; + margin: BigNumberish; + lastPrice: BigNumberish; + size: BigNumberish; + }; + + export type PositionStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + id: BigNumber; + lastFundingIndex: BigNumber; + margin: BigNumber; + lastPrice: BigNumber; + size: BigNumber; + }; } export interface SmartMarginAccountInterface extends utils.Interface { - functions: { - 'ETH()': FunctionFragment - 'GELATO()': FunctionFragment - 'OPS()': FunctionFragment - 'VERSION()': FunctionFragment - 'addDelegate(address)': FunctionFragment - 'checker(uint256)': FunctionFragment - 'committedMargin()': FunctionFragment - 'conditionalOrderId()': FunctionFragment - 'delegates(address)': FunctionFragment - 'execute(uint8[],bytes[])': FunctionFragment - 'executeConditionalOrder(uint256)': FunctionFragment - 'freeMargin()': FunctionFragment - 'getConditionalOrder(uint256)': FunctionFragment - 'getDelayedOrder(bytes32)': FunctionFragment - 'getPosition(bytes32)': FunctionFragment - 'isAuth()': FunctionFragment - 'isOwner()': FunctionFragment - 'owner()': FunctionFragment - 'removeDelegate(address)': FunctionFragment - 'setInitialOwnership(address)': FunctionFragment - 'transferOwnership(address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'ETH' - | 'GELATO' - | 'OPS' - | 'VERSION' - | 'addDelegate' - | 'checker' - | 'committedMargin' - | 'conditionalOrderId' - | 'delegates' - | 'execute' - | 'executeConditionalOrder' - | 'freeMargin' - | 'getConditionalOrder' - | 'getDelayedOrder' - | 'getPosition' - | 'isAuth' - | 'isOwner' - | 'owner' - | 'removeDelegate' - | 'setInitialOwnership' - | 'transferOwnership' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'ETH', values?: undefined): string - encodeFunctionData(functionFragment: 'GELATO', values?: undefined): string - encodeFunctionData(functionFragment: 'OPS', values?: undefined): string - encodeFunctionData(functionFragment: 'VERSION', values?: undefined): string - encodeFunctionData(functionFragment: 'addDelegate', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'checker', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'committedMargin', values?: undefined): string - encodeFunctionData(functionFragment: 'conditionalOrderId', values?: undefined): string - encodeFunctionData(functionFragment: 'delegates', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'execute', - values: [PromiseOrValue[], PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'executeConditionalOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'freeMargin', values?: undefined): string - encodeFunctionData( - functionFragment: 'getConditionalOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'getDelayedOrder', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'getPosition', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'isAuth', values?: undefined): string - encodeFunctionData(functionFragment: 'isOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'removeDelegate', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'setInitialOwnership', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferOwnership', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'ETH', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'GELATO', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'OPS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'VERSION', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'addDelegate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'checker', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'committedMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'conditionalOrderId', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'delegates', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'execute', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'executeConditionalOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'freeMargin', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getConditionalOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getDelayedOrder', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getPosition', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isAuth', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'removeDelegate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setInitialOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result - - events: { - 'DelegatedAccountAdded(address,address)': EventFragment - 'DelegatedAccountRemoved(address,address)': EventFragment - 'OwnershipTransferred(address,address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'DelegatedAccountAdded'): EventFragment - getEvent(nameOrSignatureOrTopic: 'DelegatedAccountRemoved'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment + functions: { + "ETH()": FunctionFragment; + "GELATO()": FunctionFragment; + "OPS()": FunctionFragment; + "VERSION()": FunctionFragment; + "addDelegate(address)": FunctionFragment; + "checker(uint256)": FunctionFragment; + "committedMargin()": FunctionFragment; + "conditionalOrderId()": FunctionFragment; + "delegates(address)": FunctionFragment; + "execute(uint8[],bytes[])": FunctionFragment; + "executeConditionalOrder(uint256)": FunctionFragment; + "freeMargin()": FunctionFragment; + "getConditionalOrder(uint256)": FunctionFragment; + "getDelayedOrder(bytes32)": FunctionFragment; + "getPosition(bytes32)": FunctionFragment; + "isAuth()": FunctionFragment; + "isOwner()": FunctionFragment; + "owner()": FunctionFragment; + "removeDelegate(address)": FunctionFragment; + "setInitialOwnership(address)": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "ETH" + | "GELATO" + | "OPS" + | "VERSION" + | "addDelegate" + | "checker" + | "committedMargin" + | "conditionalOrderId" + | "delegates" + | "execute" + | "executeConditionalOrder" + | "freeMargin" + | "getConditionalOrder" + | "getDelayedOrder" + | "getPosition" + | "isAuth" + | "isOwner" + | "owner" + | "removeDelegate" + | "setInitialOwnership" + | "transferOwnership" + ): FunctionFragment; + + encodeFunctionData(functionFragment: "ETH", values?: undefined): string; + encodeFunctionData(functionFragment: "GELATO", values?: undefined): string; + encodeFunctionData(functionFragment: "OPS", values?: undefined): string; + encodeFunctionData(functionFragment: "VERSION", values?: undefined): string; + encodeFunctionData(functionFragment: "addDelegate", values: [string]): string; + encodeFunctionData( + functionFragment: "checker", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "committedMargin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "conditionalOrderId", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "delegates", values: [string]): string; + encodeFunctionData( + functionFragment: "execute", + values: [BigNumberish[], BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "executeConditionalOrder", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "freeMargin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getConditionalOrder", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getDelayedOrder", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getPosition", + values: [BytesLike] + ): string; + encodeFunctionData(functionFragment: "isAuth", values?: undefined): string; + encodeFunctionData(functionFragment: "isOwner", values?: undefined): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "removeDelegate", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setInitialOwnership", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [string] + ): string; + + decodeFunctionResult(functionFragment: "ETH", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "GELATO", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "OPS", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "addDelegate", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "checker", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "committedMargin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "conditionalOrderId", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "delegates", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "execute", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "executeConditionalOrder", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "freeMargin", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getConditionalOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getDelayedOrder", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPosition", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isAuth", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "isOwner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "removeDelegate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setInitialOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + + events: { + "DelegatedAccountAdded(address,address)": EventFragment; + "DelegatedAccountRemoved(address,address)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "DelegatedAccountAdded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "DelegatedAccountRemoved"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; } export interface DelegatedAccountAddedEventObject { - caller: string - delegate: string + caller: string; + delegate: string; } export type DelegatedAccountAddedEvent = TypedEvent< - [string, string], - DelegatedAccountAddedEventObject -> + [string, string], + DelegatedAccountAddedEventObject +>; -export type DelegatedAccountAddedEventFilter = TypedEventFilter +export type DelegatedAccountAddedEventFilter = + TypedEventFilter; export interface DelegatedAccountRemovedEventObject { - caller: string - delegate: string + caller: string; + delegate: string; } export type DelegatedAccountRemovedEvent = TypedEvent< - [string, string], - DelegatedAccountRemovedEventObject -> + [string, string], + DelegatedAccountRemovedEventObject +>; -export type DelegatedAccountRemovedEventFilter = TypedEventFilter +export type DelegatedAccountRemovedEventFilter = + TypedEventFilter; export interface OwnershipTransferredEventObject { - caller: string - newOwner: string + caller: string; + newOwner: string; } export type OwnershipTransferredEvent = TypedEvent< - [string, string], - OwnershipTransferredEventObject -> + [string, string], + OwnershipTransferredEventObject +>; -export type OwnershipTransferredEventFilter = TypedEventFilter +export type OwnershipTransferredEventFilter = + TypedEventFilter; export interface SmartMarginAccount extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SmartMarginAccountInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - ETH(overrides?: CallOverrides): Promise<[string]> - - GELATO(overrides?: CallOverrides): Promise<[string]> - - OPS(overrides?: CallOverrides): Promise<[string]> - - VERSION(overrides?: CallOverrides): Promise<[string]> - - addDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - checker( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, string] & { canExec: boolean; execPayload: string }> - - committedMargin(overrides?: CallOverrides): Promise<[BigNumber]> - - conditionalOrderId(overrides?: CallOverrides): Promise<[BigNumber]> + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SmartMarginAccountInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + ETH(overrides?: CallOverrides): Promise<[string]>; - delegates(delegate: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]> + GELATO(overrides?: CallOverrides): Promise<[string]>; - execute( - _commands: PromiseOrValue[], - _inputs: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise + OPS(overrides?: CallOverrides): Promise<[string]>; - executeConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + VERSION(overrides?: CallOverrides): Promise<[string]>; - freeMargin(overrides?: CallOverrides): Promise<[BigNumber]> + addDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; - getConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[IAccount.ConditionalOrderStructOutput]> + checker( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise<[boolean, string] & { canExec: boolean; execPayload: string }>; - getDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [IPerpsV2MarketConsolidated.DelayedOrderStructOutput] & { - order: IPerpsV2MarketConsolidated.DelayedOrderStructOutput - } - > + committedMargin(overrides?: CallOverrides): Promise<[BigNumber]>; - getPosition( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [IPerpsV2MarketConsolidated.PositionStructOutput] & { - position: IPerpsV2MarketConsolidated.PositionStructOutput - } - > + conditionalOrderId(overrides?: CallOverrides): Promise<[BigNumber]>; - isAuth(overrides?: CallOverrides): Promise<[boolean]> + delegates(delegate: string, overrides?: CallOverrides): Promise<[boolean]>; - isOwner(overrides?: CallOverrides): Promise<[boolean]> + execute( + _commands: BigNumberish[], + _inputs: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise<[string]> + executeConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - removeDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + freeMargin(overrides?: CallOverrides): Promise<[BigNumber]>; - setInitialOwnership( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise<[IAccount.ConditionalOrderStructOutput]>; - transferOwnership( - _newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + getDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [IPerpsV2MarketConsolidated.DelayedOrderStructOutput] & { + order: IPerpsV2MarketConsolidated.DelayedOrderStructOutput; + } + >; - ETH(overrides?: CallOverrides): Promise + getPosition( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [IPerpsV2MarketConsolidated.PositionStructOutput] & { + position: IPerpsV2MarketConsolidated.PositionStructOutput; + } + >; - GELATO(overrides?: CallOverrides): Promise + isAuth(overrides?: CallOverrides): Promise<[boolean]>; - OPS(overrides?: CallOverrides): Promise + isOwner(overrides?: CallOverrides): Promise<[boolean]>; - VERSION(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise<[string]>; - addDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + removeDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; - checker( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, string] & { canExec: boolean; execPayload: string }> + setInitialOwnership( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - committedMargin(overrides?: CallOverrides): Promise + transferOwnership( + _newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; - conditionalOrderId(overrides?: CallOverrides): Promise + ETH(overrides?: CallOverrides): Promise; - delegates(delegate: PromiseOrValue, overrides?: CallOverrides): Promise + GELATO(overrides?: CallOverrides): Promise; - execute( - _commands: PromiseOrValue[], - _inputs: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise + OPS(overrides?: CallOverrides): Promise; - executeConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + VERSION(overrides?: CallOverrides): Promise; - freeMargin(overrides?: CallOverrides): Promise + addDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; - getConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise + checker( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise<[boolean, string] & { canExec: boolean; execPayload: string }>; - getDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + committedMargin(overrides?: CallOverrides): Promise; - getPosition( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + conditionalOrderId(overrides?: CallOverrides): Promise; - isAuth(overrides?: CallOverrides): Promise + delegates(delegate: string, overrides?: CallOverrides): Promise; - isOwner(overrides?: CallOverrides): Promise + execute( + _commands: BigNumberish[], + _inputs: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + executeConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - removeDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + freeMargin(overrides?: CallOverrides): Promise; - setInitialOwnership( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise; - transferOwnership( - _newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - callStatic: { - ETH(overrides?: CallOverrides): Promise + getPosition( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - GELATO(overrides?: CallOverrides): Promise + isAuth(overrides?: CallOverrides): Promise; - OPS(overrides?: CallOverrides): Promise + isOwner(overrides?: CallOverrides): Promise; - VERSION(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - addDelegate(_delegate: PromiseOrValue, overrides?: CallOverrides): Promise + removeDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; - checker( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, string] & { canExec: boolean; execPayload: string }> + setInitialOwnership( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - committedMargin(overrides?: CallOverrides): Promise + transferOwnership( + _newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; - conditionalOrderId(overrides?: CallOverrides): Promise + callStatic: { + ETH(overrides?: CallOverrides): Promise; - delegates(delegate: PromiseOrValue, overrides?: CallOverrides): Promise + GELATO(overrides?: CallOverrides): Promise; - execute( - _commands: PromiseOrValue[], - _inputs: PromiseOrValue[], - overrides?: CallOverrides - ): Promise + OPS(overrides?: CallOverrides): Promise; - executeConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise + VERSION(overrides?: CallOverrides): Promise; - freeMargin(overrides?: CallOverrides): Promise + addDelegate(_delegate: string, overrides?: CallOverrides): Promise; - getConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise + checker( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise<[boolean, string] & { canExec: boolean; execPayload: string }>; - getDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + committedMargin(overrides?: CallOverrides): Promise; - getPosition( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + conditionalOrderId(overrides?: CallOverrides): Promise; - isAuth(overrides?: CallOverrides): Promise + delegates(delegate: string, overrides?: CallOverrides): Promise; - isOwner(overrides?: CallOverrides): Promise + execute( + _commands: BigNumberish[], + _inputs: BytesLike[], + overrides?: CallOverrides + ): Promise; - owner(overrides?: CallOverrides): Promise + executeConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise; - removeDelegate(_delegate: PromiseOrValue, overrides?: CallOverrides): Promise + freeMargin(overrides?: CallOverrides): Promise; - setInitialOwnership(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + getConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise; - transferOwnership(_newOwner: PromiseOrValue, overrides?: CallOverrides): Promise - } + getDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - filters: { - 'DelegatedAccountAdded(address,address)'( - caller?: PromiseOrValue | null, - delegate?: PromiseOrValue | null - ): DelegatedAccountAddedEventFilter - DelegatedAccountAdded( - caller?: PromiseOrValue | null, - delegate?: PromiseOrValue | null - ): DelegatedAccountAddedEventFilter + getPosition( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - 'DelegatedAccountRemoved(address,address)'( - caller?: PromiseOrValue | null, - delegate?: PromiseOrValue | null - ): DelegatedAccountRemovedEventFilter - DelegatedAccountRemoved( - caller?: PromiseOrValue | null, - delegate?: PromiseOrValue | null - ): DelegatedAccountRemovedEventFilter + isAuth(overrides?: CallOverrides): Promise; - 'OwnershipTransferred(address,address)'( - caller?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter - OwnershipTransferred( - caller?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter - } + isOwner(overrides?: CallOverrides): Promise; - estimateGas: { - ETH(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - GELATO(overrides?: CallOverrides): Promise + removeDelegate(_delegate: string, overrides?: CallOverrides): Promise; - OPS(overrides?: CallOverrides): Promise + setInitialOwnership( + _owner: string, + overrides?: CallOverrides + ): Promise; - VERSION(overrides?: CallOverrides): Promise + transferOwnership( + _newOwner: string, + overrides?: CallOverrides + ): Promise; + }; - addDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + filters: { + "DelegatedAccountAdded(address,address)"( + caller?: string | null, + delegate?: string | null + ): DelegatedAccountAddedEventFilter; + DelegatedAccountAdded( + caller?: string | null, + delegate?: string | null + ): DelegatedAccountAddedEventFilter; - checker( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise + "DelegatedAccountRemoved(address,address)"( + caller?: string | null, + delegate?: string | null + ): DelegatedAccountRemovedEventFilter; + DelegatedAccountRemoved( + caller?: string | null, + delegate?: string | null + ): DelegatedAccountRemovedEventFilter; - committedMargin(overrides?: CallOverrides): Promise + "OwnershipTransferred(address,address)"( + caller?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + caller?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + }; - conditionalOrderId(overrides?: CallOverrides): Promise + estimateGas: { + ETH(overrides?: CallOverrides): Promise; - delegates(delegate: PromiseOrValue, overrides?: CallOverrides): Promise + GELATO(overrides?: CallOverrides): Promise; - execute( - _commands: PromiseOrValue[], - _inputs: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise + OPS(overrides?: CallOverrides): Promise; - executeConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + VERSION(overrides?: CallOverrides): Promise; - freeMargin(overrides?: CallOverrides): Promise + addDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; - getConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise + checker( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise; - getDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + committedMargin(overrides?: CallOverrides): Promise; - getPosition( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + conditionalOrderId(overrides?: CallOverrides): Promise; - isAuth(overrides?: CallOverrides): Promise + delegates(delegate: string, overrides?: CallOverrides): Promise; + + execute( + _commands: BigNumberish[], + _inputs: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; + + executeConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - isOwner(overrides?: CallOverrides): Promise + freeMargin(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + getConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise; - removeDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setInitialOwnership( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - _newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + getPosition( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - populateTransaction: { - ETH(overrides?: CallOverrides): Promise + isAuth(overrides?: CallOverrides): Promise; + + isOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setInitialOwnership( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + _newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + ETH(overrides?: CallOverrides): Promise; - GELATO(overrides?: CallOverrides): Promise + GELATO(overrides?: CallOverrides): Promise; - OPS(overrides?: CallOverrides): Promise + OPS(overrides?: CallOverrides): Promise; - VERSION(overrides?: CallOverrides): Promise + VERSION(overrides?: CallOverrides): Promise; - addDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + addDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; - checker( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise + checker( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise; - committedMargin(overrides?: CallOverrides): Promise + committedMargin(overrides?: CallOverrides): Promise; - conditionalOrderId(overrides?: CallOverrides): Promise + conditionalOrderId( + overrides?: CallOverrides + ): Promise; - delegates( - delegate: PromiseOrValue, - overrides?: CallOverrides - ): Promise + delegates( + delegate: string, + overrides?: CallOverrides + ): Promise; - execute( - _commands: PromiseOrValue[], - _inputs: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise + execute( + _commands: BigNumberish[], + _inputs: BytesLike[], + overrides?: PayableOverrides & { from?: string } + ): Promise; - executeConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + executeConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - freeMargin(overrides?: CallOverrides): Promise + freeMargin(overrides?: CallOverrides): Promise; - getConditionalOrder( - _conditionalOrderId: PromiseOrValue, - overrides?: CallOverrides - ): Promise + getConditionalOrder( + _conditionalOrderId: BigNumberish, + overrides?: CallOverrides + ): Promise; - getDelayedOrder( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + getDelayedOrder( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - getPosition( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + getPosition( + _marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - isAuth(overrides?: CallOverrides): Promise + isAuth(overrides?: CallOverrides): Promise; - isOwner(overrides?: CallOverrides): Promise + isOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - removeDelegate( - _delegate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + removeDelegate( + _delegate: string, + overrides?: Overrides & { from?: string } + ): Promise; - setInitialOwnership( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setInitialOwnership( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - transferOwnership( - _newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + transferOwnership( + _newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SmartMarginAccountFactory.ts b/packages/sdk/src/contracts/types/SmartMarginAccountFactory.ts index 89663e53f1..d93d9128a3 100644 --- a/packages/sdk/src/contracts/types/SmartMarginAccountFactory.ts +++ b/packages/sdk/src/contracts/types/SmartMarginAccountFactory.ts @@ -2,378 +2,451 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SmartMarginAccountFactoryInterface extends utils.Interface { - functions: { - 'accounts(address)': FunctionFragment - 'canUpgrade()': FunctionFragment - 'getAccountOwner(address)': FunctionFragment - 'getAccountsOwnedBy(address)': FunctionFragment - 'implementation()': FunctionFragment - 'newAccount()': FunctionFragment - 'owner()': FunctionFragment - 'removeUpgradability()': FunctionFragment - 'transferOwnership(address)': FunctionFragment - 'updateAccountOwnership(address,address,address)': FunctionFragment - 'upgradeAccountImplementation(address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'accounts' - | 'canUpgrade' - | 'getAccountOwner' - | 'getAccountsOwnedBy' - | 'implementation' - | 'newAccount' - | 'owner' - | 'removeUpgradability' - | 'transferOwnership' - | 'updateAccountOwnership' - | 'upgradeAccountImplementation' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'accounts', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'canUpgrade', values?: undefined): string - encodeFunctionData(functionFragment: 'getAccountOwner', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'getAccountsOwnedBy', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'implementation', values?: undefined): string - encodeFunctionData(functionFragment: 'newAccount', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'removeUpgradability', values?: undefined): string - encodeFunctionData( - functionFragment: 'transferOwnership', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'updateAccountOwnership', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'upgradeAccountImplementation', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'accounts', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'canUpgrade', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getAccountOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getAccountsOwnedBy', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'implementation', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'newAccount', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'removeUpgradability', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'updateAccountOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'upgradeAccountImplementation', data: BytesLike): Result - - events: { - 'AccountImplementationUpgraded(address)': EventFragment - 'NewAccount(address,address,bytes32)': EventFragment - 'OwnershipTransferred(address,address)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'AccountImplementationUpgraded'): EventFragment - getEvent(nameOrSignatureOrTopic: 'NewAccount'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment + functions: { + "accounts(address)": FunctionFragment; + "canUpgrade()": FunctionFragment; + "getAccountOwner(address)": FunctionFragment; + "getAccountsOwnedBy(address)": FunctionFragment; + "implementation()": FunctionFragment; + "newAccount()": FunctionFragment; + "owner()": FunctionFragment; + "removeUpgradability()": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + "updateAccountOwnership(address,address,address)": FunctionFragment; + "upgradeAccountImplementation(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "accounts" + | "canUpgrade" + | "getAccountOwner" + | "getAccountsOwnedBy" + | "implementation" + | "newAccount" + | "owner" + | "removeUpgradability" + | "transferOwnership" + | "updateAccountOwnership" + | "upgradeAccountImplementation" + ): FunctionFragment; + + encodeFunctionData(functionFragment: "accounts", values: [string]): string; + encodeFunctionData( + functionFragment: "canUpgrade", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getAccountOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "getAccountsOwnedBy", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "implementation", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "newAccount", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "removeUpgradability", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "updateAccountOwnership", + values: [string, string, string] + ): string; + encodeFunctionData( + functionFragment: "upgradeAccountImplementation", + values: [string] + ): string; + + decodeFunctionResult(functionFragment: "accounts", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "canUpgrade", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getAccountOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAccountsOwnedBy", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "implementation", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "newAccount", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "removeUpgradability", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateAccountOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "upgradeAccountImplementation", + data: BytesLike + ): Result; + + events: { + "AccountImplementationUpgraded(address)": EventFragment; + "NewAccount(address,address,bytes32)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + }; + + getEvent( + nameOrSignatureOrTopic: "AccountImplementationUpgraded" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "NewAccount"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; } export interface AccountImplementationUpgradedEventObject { - implementation: string + implementation: string; } export type AccountImplementationUpgradedEvent = TypedEvent< - [string], - AccountImplementationUpgradedEventObject -> + [string], + AccountImplementationUpgradedEventObject +>; export type AccountImplementationUpgradedEventFilter = - TypedEventFilter + TypedEventFilter; export interface NewAccountEventObject { - creator: string - account: string - version: string + creator: string; + account: string; + version: string; } -export type NewAccountEvent = TypedEvent<[string, string, string], NewAccountEventObject> +export type NewAccountEvent = TypedEvent< + [string, string, string], + NewAccountEventObject +>; -export type NewAccountEventFilter = TypedEventFilter +export type NewAccountEventFilter = TypedEventFilter; export interface OwnershipTransferredEventObject { - user: string - newOwner: string + user: string; + newOwner: string; } export type OwnershipTransferredEvent = TypedEvent< - [string, string], - OwnershipTransferredEventObject -> + [string, string], + OwnershipTransferredEventObject +>; -export type OwnershipTransferredEventFilter = TypedEventFilter +export type OwnershipTransferredEventFilter = + TypedEventFilter; export interface SmartMarginAccountFactory extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SmartMarginAccountFactoryInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - accounts( - accounts: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean] & { exist: boolean }> - - canUpgrade(overrides?: CallOverrides): Promise<[boolean]> - - getAccountOwner(_account: PromiseOrValue, overrides?: CallOverrides): Promise<[string]> - - getAccountsOwnedBy( - _owner: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string[]]> - - implementation(overrides?: CallOverrides): Promise<[string]> - - newAccount( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - owner(overrides?: CallOverrides): Promise<[string]> - - removeUpgradability( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccountOwnership( - _account: PromiseOrValue, - _newOwner: PromiseOrValue, - _oldOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upgradeAccountImplementation( - _implementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - accounts(accounts: PromiseOrValue, overrides?: CallOverrides): Promise - - canUpgrade(overrides?: CallOverrides): Promise - - getAccountOwner(_account: PromiseOrValue, overrides?: CallOverrides): Promise - - getAccountsOwnedBy(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - implementation(overrides?: CallOverrides): Promise - - newAccount( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - owner(overrides?: CallOverrides): Promise - - removeUpgradability( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccountOwnership( - _account: PromiseOrValue, - _newOwner: PromiseOrValue, - _oldOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upgradeAccountImplementation( - _implementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - accounts(accounts: PromiseOrValue, overrides?: CallOverrides): Promise - - canUpgrade(overrides?: CallOverrides): Promise - - getAccountOwner(_account: PromiseOrValue, overrides?: CallOverrides): Promise - - getAccountsOwnedBy(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - implementation(overrides?: CallOverrides): Promise - - newAccount(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - removeUpgradability(overrides?: CallOverrides): Promise - - transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise - - updateAccountOwnership( - _account: PromiseOrValue, - _newOwner: PromiseOrValue, - _oldOwner: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - upgradeAccountImplementation( - _implementation: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'AccountImplementationUpgraded(address)'( - implementation?: null - ): AccountImplementationUpgradedEventFilter - AccountImplementationUpgraded(implementation?: null): AccountImplementationUpgradedEventFilter - - 'NewAccount(address,address,bytes32)'( - creator?: PromiseOrValue | null, - account?: PromiseOrValue | null, - version?: null - ): NewAccountEventFilter - NewAccount( - creator?: PromiseOrValue | null, - account?: PromiseOrValue | null, - version?: null - ): NewAccountEventFilter - - 'OwnershipTransferred(address,address)'( - user?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter - OwnershipTransferred( - user?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null - ): OwnershipTransferredEventFilter - } - - estimateGas: { - accounts(accounts: PromiseOrValue, overrides?: CallOverrides): Promise - - canUpgrade(overrides?: CallOverrides): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SmartMarginAccountFactoryInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + accounts( + accounts: string, + overrides?: CallOverrides + ): Promise<[boolean] & { exist: boolean }>; + + canUpgrade(overrides?: CallOverrides): Promise<[boolean]>; + + getAccountOwner( + _account: string, + overrides?: CallOverrides + ): Promise<[string]>; - getAccountOwner(_account: PromiseOrValue, overrides?: CallOverrides): Promise + getAccountsOwnedBy( + _owner: string, + overrides?: CallOverrides + ): Promise<[string[]]>; - getAccountsOwnedBy( - _owner: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - implementation(overrides?: CallOverrides): Promise - - newAccount(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - owner(overrides?: CallOverrides): Promise - - removeUpgradability( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccountOwnership( - _account: PromiseOrValue, - _newOwner: PromiseOrValue, - _oldOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upgradeAccountImplementation( - _implementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - populateTransaction: { - accounts( - accounts: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - canUpgrade(overrides?: CallOverrides): Promise - - getAccountOwner( - _account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - getAccountsOwnedBy( - _owner: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - implementation(overrides?: CallOverrides): Promise - - newAccount( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - owner(overrides?: CallOverrides): Promise - - removeUpgradability( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccountOwnership( - _account: PromiseOrValue, - _newOwner: PromiseOrValue, - _oldOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - upgradeAccountImplementation( - _implementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + implementation(overrides?: CallOverrides): Promise<[string]>; + + newAccount( + overrides?: Overrides & { from?: string } + ): Promise; + + owner(overrides?: CallOverrides): Promise<[string]>; + + removeUpgradability( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccountOwnership( + _account: string, + _newOwner: string, + _oldOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeAccountImplementation( + _implementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + accounts(accounts: string, overrides?: CallOverrides): Promise; + + canUpgrade(overrides?: CallOverrides): Promise; + + getAccountOwner(_account: string, overrides?: CallOverrides): Promise; + + getAccountsOwnedBy( + _owner: string, + overrides?: CallOverrides + ): Promise; + + implementation(overrides?: CallOverrides): Promise; + + newAccount( + overrides?: Overrides & { from?: string } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeUpgradability( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccountOwnership( + _account: string, + _newOwner: string, + _oldOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeAccountImplementation( + _implementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + accounts(accounts: string, overrides?: CallOverrides): Promise; + + canUpgrade(overrides?: CallOverrides): Promise; + + getAccountOwner( + _account: string, + overrides?: CallOverrides + ): Promise; + + getAccountsOwnedBy( + _owner: string, + overrides?: CallOverrides + ): Promise; + + implementation(overrides?: CallOverrides): Promise; + + newAccount(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeUpgradability(overrides?: CallOverrides): Promise; + + transferOwnership( + newOwner: string, + overrides?: CallOverrides + ): Promise; + + updateAccountOwnership( + _account: string, + _newOwner: string, + _oldOwner: string, + overrides?: CallOverrides + ): Promise; + + upgradeAccountImplementation( + _implementation: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AccountImplementationUpgraded(address)"( + implementation?: null + ): AccountImplementationUpgradedEventFilter; + AccountImplementationUpgraded( + implementation?: null + ): AccountImplementationUpgradedEventFilter; + + "NewAccount(address,address,bytes32)"( + creator?: string | null, + account?: string | null, + version?: null + ): NewAccountEventFilter; + NewAccount( + creator?: string | null, + account?: string | null, + version?: null + ): NewAccountEventFilter; + + "OwnershipTransferred(address,address)"( + user?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + user?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + }; + + estimateGas: { + accounts(accounts: string, overrides?: CallOverrides): Promise; + + canUpgrade(overrides?: CallOverrides): Promise; + + getAccountOwner( + _account: string, + overrides?: CallOverrides + ): Promise; + + getAccountsOwnedBy( + _owner: string, + overrides?: CallOverrides + ): Promise; + + implementation(overrides?: CallOverrides): Promise; + + newAccount(overrides?: Overrides & { from?: string }): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeUpgradability( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccountOwnership( + _account: string, + _newOwner: string, + _oldOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeAccountImplementation( + _implementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + accounts( + accounts: string, + overrides?: CallOverrides + ): Promise; + + canUpgrade(overrides?: CallOverrides): Promise; + + getAccountOwner( + _account: string, + overrides?: CallOverrides + ): Promise; + + getAccountsOwnedBy( + _owner: string, + overrides?: CallOverrides + ): Promise; + + implementation(overrides?: CallOverrides): Promise; + + newAccount( + overrides?: Overrides & { from?: string } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + removeUpgradability( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccountOwnership( + _account: string, + _newOwner: string, + _oldOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeAccountImplementation( + _implementation: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/StakingRewards.ts b/packages/sdk/src/contracts/types/StakingRewards.ts index caa77ffe98..0176b20466 100644 --- a/packages/sdk/src/contracts/types/StakingRewards.ts +++ b/packages/sdk/src/contracts/types/StakingRewards.ts @@ -2,782 +2,952 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface StakingRewardsInterface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'balanceOf(address)': FunctionFragment - 'earned(address)': FunctionFragment - 'exit()': FunctionFragment - 'getReward()': FunctionFragment - 'getRewardForDuration()': FunctionFragment - 'lastPauseTime()': FunctionFragment - 'lastTimeRewardApplicable()': FunctionFragment - 'lastUpdateTime()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'notifyRewardAmount(uint256)': FunctionFragment - 'owner()': FunctionFragment - 'paused()': FunctionFragment - 'periodFinish()': FunctionFragment - 'recoverERC20(address,uint256)': FunctionFragment - 'rewardPerToken()': FunctionFragment - 'rewardPerTokenStored()': FunctionFragment - 'rewardRate()': FunctionFragment - 'rewards(address)': FunctionFragment - 'rewardsDistribution()': FunctionFragment - 'rewardsDuration()': FunctionFragment - 'rewardsToken()': FunctionFragment - 'setPaused(bool)': FunctionFragment - 'setRewardsDistribution(address)': FunctionFragment - 'setRewardsDuration(uint256)': FunctionFragment - 'stake(uint256)': FunctionFragment - 'stakingToken()': FunctionFragment - 'totalSupply()': FunctionFragment - 'userRewardPerTokenPaid(address)': FunctionFragment - 'withdraw(uint256)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'balanceOf' - | 'earned' - | 'exit' - | 'getReward' - | 'getRewardForDuration' - | 'lastPauseTime' - | 'lastTimeRewardApplicable' - | 'lastUpdateTime' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'notifyRewardAmount' - | 'owner' - | 'paused' - | 'periodFinish' - | 'recoverERC20' - | 'rewardPerToken' - | 'rewardPerTokenStored' - | 'rewardRate' - | 'rewards' - | 'rewardsDistribution' - | 'rewardsDuration' - | 'rewardsToken' - | 'setPaused' - | 'setRewardsDistribution' - | 'setRewardsDuration' - | 'stake' - | 'stakingToken' - | 'totalSupply' - | 'userRewardPerTokenPaid' - | 'withdraw' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'earned', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'exit', values?: undefined): string - encodeFunctionData(functionFragment: 'getReward', values?: undefined): string - encodeFunctionData(functionFragment: 'getRewardForDuration', values?: undefined): string - encodeFunctionData(functionFragment: 'lastPauseTime', values?: undefined): string - encodeFunctionData(functionFragment: 'lastTimeRewardApplicable', values?: undefined): string - encodeFunctionData(functionFragment: 'lastUpdateTime', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData( - functionFragment: 'notifyRewardAmount', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'paused', values?: undefined): string - encodeFunctionData(functionFragment: 'periodFinish', values?: undefined): string - encodeFunctionData( - functionFragment: 'recoverERC20', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'rewardPerToken', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardPerTokenStored', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardRate', values?: undefined): string - encodeFunctionData(functionFragment: 'rewards', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rewardsDistribution', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardsDuration', values?: undefined): string - encodeFunctionData(functionFragment: 'rewardsToken', values?: undefined): string - encodeFunctionData(functionFragment: 'setPaused', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'setRewardsDistribution', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setRewardsDuration', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'stake', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'stakingToken', values?: undefined): string - encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string - encodeFunctionData( - functionFragment: 'userRewardPerTokenPaid', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'withdraw', values: [PromiseOrValue]): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'earned', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exit', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getRewardForDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastPauseTime', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastTimeRewardApplicable', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastUpdateTime', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'notifyRewardAmount', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'paused', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'periodFinish', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'recoverERC20', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardPerToken', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardPerTokenStored', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardsDistribution', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardsDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardsToken', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setPaused', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setRewardsDistribution', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setRewardsDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'stake', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'stakingToken', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'userRewardPerTokenPaid', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'withdraw', data: BytesLike): Result - - events: { - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'PauseChanged(bool)': EventFragment - 'Recovered(address,uint256)': EventFragment - 'RewardAdded(uint256)': EventFragment - 'RewardPaid(address,uint256)': EventFragment - 'RewardsDurationUpdated(uint256)': EventFragment - 'Staked(address,uint256)': EventFragment - 'Withdrawn(address,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PauseChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Recovered'): EventFragment - getEvent(nameOrSignatureOrTopic: 'RewardAdded'): EventFragment - getEvent(nameOrSignatureOrTopic: 'RewardPaid'): EventFragment - getEvent(nameOrSignatureOrTopic: 'RewardsDurationUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Staked'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Withdrawn'): EventFragment + functions: { + "acceptOwnership()": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "earned(address)": FunctionFragment; + "exit()": FunctionFragment; + "getReward()": FunctionFragment; + "getRewardForDuration()": FunctionFragment; + "lastPauseTime()": FunctionFragment; + "lastTimeRewardApplicable()": FunctionFragment; + "lastUpdateTime()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "notifyRewardAmount(uint256)": FunctionFragment; + "owner()": FunctionFragment; + "paused()": FunctionFragment; + "periodFinish()": FunctionFragment; + "recoverERC20(address,uint256)": FunctionFragment; + "rewardPerToken()": FunctionFragment; + "rewardPerTokenStored()": FunctionFragment; + "rewardRate()": FunctionFragment; + "rewards(address)": FunctionFragment; + "rewardsDistribution()": FunctionFragment; + "rewardsDuration()": FunctionFragment; + "rewardsToken()": FunctionFragment; + "setPaused(bool)": FunctionFragment; + "setRewardsDistribution(address)": FunctionFragment; + "setRewardsDuration(uint256)": FunctionFragment; + "stake(uint256)": FunctionFragment; + "stakingToken()": FunctionFragment; + "totalSupply()": FunctionFragment; + "userRewardPerTokenPaid(address)": FunctionFragment; + "withdraw(uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "balanceOf" + | "earned" + | "exit" + | "getReward" + | "getRewardForDuration" + | "lastPauseTime" + | "lastTimeRewardApplicable" + | "lastUpdateTime" + | "nominateNewOwner" + | "nominatedOwner" + | "notifyRewardAmount" + | "owner" + | "paused" + | "periodFinish" + | "recoverERC20" + | "rewardPerToken" + | "rewardPerTokenStored" + | "rewardRate" + | "rewards" + | "rewardsDistribution" + | "rewardsDuration" + | "rewardsToken" + | "setPaused" + | "setRewardsDistribution" + | "setRewardsDuration" + | "stake" + | "stakingToken" + | "totalSupply" + | "userRewardPerTokenPaid" + | "withdraw" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData(functionFragment: "earned", values: [string]): string; + encodeFunctionData(functionFragment: "exit", values?: undefined): string; + encodeFunctionData(functionFragment: "getReward", values?: undefined): string; + encodeFunctionData( + functionFragment: "getRewardForDuration", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastPauseTime", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastTimeRewardApplicable", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastUpdateTime", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "notifyRewardAmount", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "paused", values?: undefined): string; + encodeFunctionData( + functionFragment: "periodFinish", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "recoverERC20", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "rewardPerToken", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardPerTokenStored", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardRate", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "rewards", values: [string]): string; + encodeFunctionData( + functionFragment: "rewardsDistribution", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardsDuration", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rewardsToken", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "setPaused", values: [boolean]): string; + encodeFunctionData( + functionFragment: "setRewardsDistribution", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setRewardsDuration", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "stake", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "stakingToken", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "userRewardPerTokenPaid", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "withdraw", + values: [BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "earned", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "exit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getReward", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getRewardForDuration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastPauseTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastTimeRewardApplicable", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastUpdateTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "notifyRewardAmount", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "periodFinish", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "recoverERC20", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardPerToken", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardPerTokenStored", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "rewardRate", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "rewards", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rewardsDistribution", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardsDuration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewardsToken", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "setPaused", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setRewardsDistribution", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setRewardsDuration", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "stake", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "stakingToken", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "userRewardPerTokenPaid", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; + + events: { + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "PauseChanged(bool)": EventFragment; + "Recovered(address,uint256)": EventFragment; + "RewardAdded(uint256)": EventFragment; + "RewardPaid(address,uint256)": EventFragment; + "RewardsDurationUpdated(uint256)": EventFragment; + "Staked(address,uint256)": EventFragment; + "Withdrawn(address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PauseChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Recovered"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RewardAdded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RewardPaid"): EventFragment; + getEvent(nameOrSignatureOrTopic: "RewardsDurationUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Staked"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Withdrawn"): EventFragment; } export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface PauseChangedEventObject { - isPaused: boolean + isPaused: boolean; } -export type PauseChangedEvent = TypedEvent<[boolean], PauseChangedEventObject> +export type PauseChangedEvent = TypedEvent<[boolean], PauseChangedEventObject>; -export type PauseChangedEventFilter = TypedEventFilter +export type PauseChangedEventFilter = TypedEventFilter; export interface RecoveredEventObject { - token: string - amount: BigNumber + token: string; + amount: BigNumber; } -export type RecoveredEvent = TypedEvent<[string, BigNumber], RecoveredEventObject> +export type RecoveredEvent = TypedEvent< + [string, BigNumber], + RecoveredEventObject +>; -export type RecoveredEventFilter = TypedEventFilter +export type RecoveredEventFilter = TypedEventFilter; export interface RewardAddedEventObject { - reward: BigNumber + reward: BigNumber; } -export type RewardAddedEvent = TypedEvent<[BigNumber], RewardAddedEventObject> +export type RewardAddedEvent = TypedEvent<[BigNumber], RewardAddedEventObject>; -export type RewardAddedEventFilter = TypedEventFilter +export type RewardAddedEventFilter = TypedEventFilter; export interface RewardPaidEventObject { - user: string - reward: BigNumber + user: string; + reward: BigNumber; } -export type RewardPaidEvent = TypedEvent<[string, BigNumber], RewardPaidEventObject> +export type RewardPaidEvent = TypedEvent< + [string, BigNumber], + RewardPaidEventObject +>; -export type RewardPaidEventFilter = TypedEventFilter +export type RewardPaidEventFilter = TypedEventFilter; export interface RewardsDurationUpdatedEventObject { - newDuration: BigNumber + newDuration: BigNumber; } -export type RewardsDurationUpdatedEvent = TypedEvent<[BigNumber], RewardsDurationUpdatedEventObject> +export type RewardsDurationUpdatedEvent = TypedEvent< + [BigNumber], + RewardsDurationUpdatedEventObject +>; -export type RewardsDurationUpdatedEventFilter = TypedEventFilter +export type RewardsDurationUpdatedEventFilter = + TypedEventFilter; export interface StakedEventObject { - user: string - amount: BigNumber + user: string; + amount: BigNumber; } -export type StakedEvent = TypedEvent<[string, BigNumber], StakedEventObject> +export type StakedEvent = TypedEvent<[string, BigNumber], StakedEventObject>; -export type StakedEventFilter = TypedEventFilter +export type StakedEventFilter = TypedEventFilter; export interface WithdrawnEventObject { - user: string - amount: BigNumber + user: string; + amount: BigNumber; } -export type WithdrawnEvent = TypedEvent<[string, BigNumber], WithdrawnEventObject> +export type WithdrawnEvent = TypedEvent< + [string, BigNumber], + WithdrawnEventObject +>; -export type WithdrawnEventFilter = TypedEventFilter +export type WithdrawnEventFilter = TypedEventFilter; export interface StakingRewards extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - interface: StakingRewardsInterface + interface: StakingRewardsInterface; - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> + earned(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit( + overrides?: Overrides & { from?: string } + ): Promise; - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getReward( + overrides?: Overrides & { from?: string } + ): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise<[BigNumber]> + getRewardForDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - lastPauseTime(overrides?: CallOverrides): Promise<[BigNumber]> + lastPauseTime(overrides?: CallOverrides): Promise<[BigNumber]>; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise<[BigNumber]> + lastTimeRewardApplicable(overrides?: CallOverrides): Promise<[BigNumber]>; - lastUpdateTime(overrides?: CallOverrides): Promise<[BigNumber]> + lastUpdateTime(overrides?: CallOverrides): Promise<[BigNumber]>; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise<[string]> + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise<[string]> + owner(overrides?: CallOverrides): Promise<[string]>; - paused(overrides?: CallOverrides): Promise<[boolean]> + paused(overrides?: CallOverrides): Promise<[boolean]>; - periodFinish(overrides?: CallOverrides): Promise<[BigNumber]> + periodFinish(overrides?: CallOverrides): Promise<[BigNumber]>; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardPerToken(overrides?: CallOverrides): Promise<[BigNumber]> + rewardPerToken(overrides?: CallOverrides): Promise<[BigNumber]>; - rewardPerTokenStored(overrides?: CallOverrides): Promise<[BigNumber]> + rewardPerTokenStored(overrides?: CallOverrides): Promise<[BigNumber]>; - rewardRate(overrides?: CallOverrides): Promise<[BigNumber]> + rewardRate(overrides?: CallOverrides): Promise<[BigNumber]>; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> + rewards(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; - rewardsDistribution(overrides?: CallOverrides): Promise<[string]> + rewardsDistribution(overrides?: CallOverrides): Promise<[string]>; - rewardsDuration(overrides?: CallOverrides): Promise<[BigNumber]> + rewardsDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - rewardsToken(overrides?: CallOverrides): Promise<[string]> + rewardsToken(overrides?: CallOverrides): Promise<[string]>; - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setPaused( + _paused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDistribution( + _rewardsDistribution: string, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingToken(overrides?: CallOverrides): Promise<[string]> + stakingToken(overrides?: CallOverrides): Promise<[string]>; - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]> + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + withdraw( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise + earned(account: string, overrides?: CallOverrides): Promise; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit(overrides?: Overrides & { from?: string }): Promise; - getReward(overrides?: Overrides & { from?: PromiseOrValue }): Promise + getReward( + overrides?: Overrides & { from?: string } + ): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration(overrides?: CallOverrides): Promise; - lastPauseTime(overrides?: CallOverrides): Promise + lastPauseTime(overrides?: CallOverrides): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored(overrides?: CallOverrides): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards(arg0: string, overrides?: CallOverrides): Promise; - rewardsDistribution(overrides?: CallOverrides): Promise + rewardsDistribution(overrides?: CallOverrides): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - rewardsToken(overrides?: CallOverrides): Promise + rewardsToken(overrides?: CallOverrides): Promise; - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setPaused( + _paused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDistribution( + _rewardsDistribution: string, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingToken(overrides?: CallOverrides): Promise + stakingToken(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + withdraw( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise + earned(account: string, overrides?: CallOverrides): Promise; - exit(overrides?: CallOverrides): Promise + exit(overrides?: CallOverrides): Promise; - getReward(overrides?: CallOverrides): Promise + getReward(overrides?: CallOverrides): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration(overrides?: CallOverrides): Promise; - lastPauseTime(overrides?: CallOverrides): Promise + lastPauseTime(overrides?: CallOverrides): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: CallOverrides - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: CallOverrides + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: CallOverrides - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: CallOverrides + ): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored(overrides?: CallOverrides): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards(arg0: string, overrides?: CallOverrides): Promise; - rewardsDistribution(overrides?: CallOverrides): Promise + rewardsDistribution(overrides?: CallOverrides): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - rewardsToken(overrides?: CallOverrides): Promise + rewardsToken(overrides?: CallOverrides): Promise; - setPaused(_paused: PromiseOrValue, overrides?: CallOverrides): Promise + setPaused(_paused: boolean, overrides?: CallOverrides): Promise; - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setRewardsDistribution( + _rewardsDistribution: string, + overrides?: CallOverrides + ): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: CallOverrides + ): Promise; - stake(amount: PromiseOrValue, overrides?: CallOverrides): Promise + stake(amount: BigNumberish, overrides?: CallOverrides): Promise; - stakingToken(overrides?: CallOverrides): Promise + stakingToken(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; - withdraw(amount: PromiseOrValue, overrides?: CallOverrides): Promise - } + withdraw(amount: BigNumberish, overrides?: CallOverrides): Promise; + }; - filters: { - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter + filters: { + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; - 'PauseChanged(bool)'(isPaused?: null): PauseChangedEventFilter - PauseChanged(isPaused?: null): PauseChangedEventFilter + "PauseChanged(bool)"(isPaused?: null): PauseChangedEventFilter; + PauseChanged(isPaused?: null): PauseChangedEventFilter; - 'Recovered(address,uint256)'(token?: null, amount?: null): RecoveredEventFilter - Recovered(token?: null, amount?: null): RecoveredEventFilter + "Recovered(address,uint256)"( + token?: null, + amount?: null + ): RecoveredEventFilter; + Recovered(token?: null, amount?: null): RecoveredEventFilter; - 'RewardAdded(uint256)'(reward?: null): RewardAddedEventFilter - RewardAdded(reward?: null): RewardAddedEventFilter + "RewardAdded(uint256)"(reward?: null): RewardAddedEventFilter; + RewardAdded(reward?: null): RewardAddedEventFilter; - 'RewardPaid(address,uint256)'( - user?: PromiseOrValue | null, - reward?: null - ): RewardPaidEventFilter - RewardPaid(user?: PromiseOrValue | null, reward?: null): RewardPaidEventFilter + "RewardPaid(address,uint256)"( + user?: string | null, + reward?: null + ): RewardPaidEventFilter; + RewardPaid(user?: string | null, reward?: null): RewardPaidEventFilter; - 'RewardsDurationUpdated(uint256)'(newDuration?: null): RewardsDurationUpdatedEventFilter - RewardsDurationUpdated(newDuration?: null): RewardsDurationUpdatedEventFilter + "RewardsDurationUpdated(uint256)"( + newDuration?: null + ): RewardsDurationUpdatedEventFilter; + RewardsDurationUpdated( + newDuration?: null + ): RewardsDurationUpdatedEventFilter; - 'Staked(address,uint256)'( - user?: PromiseOrValue | null, - amount?: null - ): StakedEventFilter - Staked(user?: PromiseOrValue | null, amount?: null): StakedEventFilter + "Staked(address,uint256)"( + user?: string | null, + amount?: null + ): StakedEventFilter; + Staked(user?: string | null, amount?: null): StakedEventFilter; - 'Withdrawn(address,uint256)'( - user?: PromiseOrValue | null, - amount?: null - ): WithdrawnEventFilter - Withdrawn(user?: PromiseOrValue | null, amount?: null): WithdrawnEventFilter - } + "Withdrawn(address,uint256)"( + user?: string | null, + amount?: null + ): WithdrawnEventFilter; + Withdrawn(user?: string | null, amount?: null): WithdrawnEventFilter; + }; - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise + earned(account: string, overrides?: CallOverrides): Promise; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit(overrides?: Overrides & { from?: string }): Promise; - getReward(overrides?: Overrides & { from?: PromiseOrValue }): Promise + getReward(overrides?: Overrides & { from?: string }): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration(overrides?: CallOverrides): Promise; - lastPauseTime(overrides?: CallOverrides): Promise + lastPauseTime(overrides?: CallOverrides): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable(overrides?: CallOverrides): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored(overrides?: CallOverrides): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards(arg0: string, overrides?: CallOverrides): Promise; - rewardsDistribution(overrides?: CallOverrides): Promise + rewardsDistribution(overrides?: CallOverrides): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - rewardsToken(overrides?: CallOverrides): Promise + rewardsToken(overrides?: CallOverrides): Promise; - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setPaused( + _paused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDistribution( + _rewardsDistribution: string, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingToken(overrides?: CallOverrides): Promise + stakingToken(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + withdraw( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - earned( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + earned( + account: string, + overrides?: CallOverrides + ): Promise; - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exit( + overrides?: Overrides & { from?: string } + ): Promise; - getReward( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + getReward( + overrides?: Overrides & { from?: string } + ): Promise; - getRewardForDuration(overrides?: CallOverrides): Promise + getRewardForDuration( + overrides?: CallOverrides + ): Promise; - lastPauseTime(overrides?: CallOverrides): Promise + lastPauseTime(overrides?: CallOverrides): Promise; - lastTimeRewardApplicable(overrides?: CallOverrides): Promise + lastTimeRewardApplicable( + overrides?: CallOverrides + ): Promise; - lastUpdateTime(overrides?: CallOverrides): Promise + lastUpdateTime(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - notifyRewardAmount( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + notifyRewardAmount( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - paused(overrides?: CallOverrides): Promise + paused(overrides?: CallOverrides): Promise; - periodFinish(overrides?: CallOverrides): Promise + periodFinish(overrides?: CallOverrides): Promise; - recoverERC20( - tokenAddress: PromiseOrValue, - tokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + recoverERC20( + tokenAddress: string, + tokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - rewardPerToken(overrides?: CallOverrides): Promise + rewardPerToken(overrides?: CallOverrides): Promise; - rewardPerTokenStored(overrides?: CallOverrides): Promise + rewardPerTokenStored( + overrides?: CallOverrides + ): Promise; - rewardRate(overrides?: CallOverrides): Promise + rewardRate(overrides?: CallOverrides): Promise; - rewards(arg0: PromiseOrValue, overrides?: CallOverrides): Promise + rewards( + arg0: string, + overrides?: CallOverrides + ): Promise; - rewardsDistribution(overrides?: CallOverrides): Promise + rewardsDistribution( + overrides?: CallOverrides + ): Promise; - rewardsDuration(overrides?: CallOverrides): Promise + rewardsDuration(overrides?: CallOverrides): Promise; - rewardsToken(overrides?: CallOverrides): Promise + rewardsToken(overrides?: CallOverrides): Promise; - setPaused( - _paused: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setPaused( + _paused: boolean, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDistribution( - _rewardsDistribution: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDistribution( + _rewardsDistribution: string, + overrides?: Overrides & { from?: string } + ): Promise; - setRewardsDuration( - _rewardsDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setRewardsDuration( + _rewardsDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stake( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + stake( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingToken(overrides?: CallOverrides): Promise + stakingToken(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - userRewardPerTokenPaid( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + userRewardPerTokenPaid( + arg0: string, + overrides?: CallOverrides + ): Promise; - withdraw( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + withdraw( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SupplySchedule.ts b/packages/sdk/src/contracts/types/SupplySchedule.ts index b6d9dc264c..5d1505125a 100644 --- a/packages/sdk/src/contracts/types/SupplySchedule.ts +++ b/packages/sdk/src/contracts/types/SupplySchedule.ts @@ -2,884 +2,1127 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SupplyScheduleInterface extends utils.Interface { - functions: { - 'DECAY_RATE()': FunctionFragment - 'INITIAL_SUPPLY()': FunctionFragment - 'INITIAL_WEEKLY_SUPPLY()': FunctionFragment - 'MAX_MINTER_REWARD()': FunctionFragment - 'MINT_BUFFER()': FunctionFragment - 'MINT_PERIOD_DURATION()': FunctionFragment - 'SUPPLY_DECAY_END()': FunctionFragment - 'SUPPLY_DECAY_START()': FunctionFragment - 'TERMINAL_SUPPLY_RATE_ANNUAL()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'inflationStartDate()': FunctionFragment - 'isMintable()': FunctionFragment - 'kwenta()': FunctionFragment - 'lastMintEvent()': FunctionFragment - 'mint()': FunctionFragment - 'mintableSupply()': FunctionFragment - 'minterReward()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'setKwenta(address)': FunctionFragment - 'setMinterReward(uint256)': FunctionFragment - 'setStakingRewards(address)': FunctionFragment - 'setTradingRewards(address)': FunctionFragment - 'setTradingRewardsDiversion(uint256)': FunctionFragment - 'setTreasuryDAO(address)': FunctionFragment - 'setTreasuryDiversion(uint256)': FunctionFragment - 'stakingRewards()': FunctionFragment - 'terminalInflationSupply(uint256,uint256)': FunctionFragment - 'tokenDecaySupplyForWeek(uint256)': FunctionFragment - 'tradingRewards()': FunctionFragment - 'tradingRewardsDiversion()': FunctionFragment - 'treasuryDAO()': FunctionFragment - 'treasuryDiversion()': FunctionFragment - 'weekCounter()': FunctionFragment - 'weeksSinceLastIssuance()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'DECAY_RATE' - | 'INITIAL_SUPPLY' - | 'INITIAL_WEEKLY_SUPPLY' - | 'MAX_MINTER_REWARD' - | 'MINT_BUFFER' - | 'MINT_PERIOD_DURATION' - | 'SUPPLY_DECAY_END' - | 'SUPPLY_DECAY_START' - | 'TERMINAL_SUPPLY_RATE_ANNUAL' - | 'acceptOwnership' - | 'inflationStartDate' - | 'isMintable' - | 'kwenta' - | 'lastMintEvent' - | 'mint' - | 'mintableSupply' - | 'minterReward' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'setKwenta' - | 'setMinterReward' - | 'setStakingRewards' - | 'setTradingRewards' - | 'setTradingRewardsDiversion' - | 'setTreasuryDAO' - | 'setTreasuryDiversion' - | 'stakingRewards' - | 'terminalInflationSupply' - | 'tokenDecaySupplyForWeek' - | 'tradingRewards' - | 'tradingRewardsDiversion' - | 'treasuryDAO' - | 'treasuryDiversion' - | 'weekCounter' - | 'weeksSinceLastIssuance' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'DECAY_RATE', values?: undefined): string - encodeFunctionData(functionFragment: 'INITIAL_SUPPLY', values?: undefined): string - encodeFunctionData(functionFragment: 'INITIAL_WEEKLY_SUPPLY', values?: undefined): string - encodeFunctionData(functionFragment: 'MAX_MINTER_REWARD', values?: undefined): string - encodeFunctionData(functionFragment: 'MINT_BUFFER', values?: undefined): string - encodeFunctionData(functionFragment: 'MINT_PERIOD_DURATION', values?: undefined): string - encodeFunctionData(functionFragment: 'SUPPLY_DECAY_END', values?: undefined): string - encodeFunctionData(functionFragment: 'SUPPLY_DECAY_START', values?: undefined): string - encodeFunctionData(functionFragment: 'TERMINAL_SUPPLY_RATE_ANNUAL', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'inflationStartDate', values?: undefined): string - encodeFunctionData(functionFragment: 'isMintable', values?: undefined): string - encodeFunctionData(functionFragment: 'kwenta', values?: undefined): string - encodeFunctionData(functionFragment: 'lastMintEvent', values?: undefined): string - encodeFunctionData(functionFragment: 'mint', values?: undefined): string - encodeFunctionData(functionFragment: 'mintableSupply', values?: undefined): string - encodeFunctionData(functionFragment: 'minterReward', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'setKwenta', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'setMinterReward', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setStakingRewards', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTradingRewards', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTradingRewardsDiversion', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'setTreasuryDAO', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'setTreasuryDiversion', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'stakingRewards', values?: undefined): string - encodeFunctionData( - functionFragment: 'terminalInflationSupply', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'tokenDecaySupplyForWeek', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'tradingRewards', values?: undefined): string - encodeFunctionData(functionFragment: 'tradingRewardsDiversion', values?: undefined): string - encodeFunctionData(functionFragment: 'treasuryDAO', values?: undefined): string - encodeFunctionData(functionFragment: 'treasuryDiversion', values?: undefined): string - encodeFunctionData(functionFragment: 'weekCounter', values?: undefined): string - encodeFunctionData(functionFragment: 'weeksSinceLastIssuance', values?: undefined): string - - decodeFunctionResult(functionFragment: 'DECAY_RATE', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'INITIAL_SUPPLY', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'INITIAL_WEEKLY_SUPPLY', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'MAX_MINTER_REWARD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'MINT_BUFFER', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'MINT_PERIOD_DURATION', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SUPPLY_DECAY_END', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SUPPLY_DECAY_START', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'TERMINAL_SUPPLY_RATE_ANNUAL', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'inflationStartDate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isMintable', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'kwenta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'lastMintEvent', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'mintableSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'minterReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setKwenta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMinterReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setStakingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTradingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTradingRewardsDiversion', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTreasuryDAO', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTreasuryDiversion', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'stakingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'terminalInflationSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'tokenDecaySupplyForWeek', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'tradingRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'tradingRewardsDiversion', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'treasuryDAO', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'treasuryDiversion', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'weekCounter', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'weeksSinceLastIssuance', data: BytesLike): Result - - events: { - 'KwentaUpdated(address)': EventFragment - 'MinterRewardUpdated(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'StakingRewardsUpdated(address)': EventFragment - 'SupplyMinted(uint256,uint256,uint256)': EventFragment - 'TradingRewardsDiversionUpdated(uint256)': EventFragment - 'TradingRewardsUpdated(address)': EventFragment - 'TreasuryDAOSet(address)': EventFragment - 'TreasuryDiversionUpdated(uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'KwentaUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MinterRewardUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'StakingRewardsUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SupplyMinted'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TradingRewardsDiversionUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TradingRewardsUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TreasuryDAOSet'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TreasuryDiversionUpdated'): EventFragment + functions: { + "DECAY_RATE()": FunctionFragment; + "INITIAL_SUPPLY()": FunctionFragment; + "INITIAL_WEEKLY_SUPPLY()": FunctionFragment; + "MAX_MINTER_REWARD()": FunctionFragment; + "MINT_BUFFER()": FunctionFragment; + "MINT_PERIOD_DURATION()": FunctionFragment; + "SUPPLY_DECAY_END()": FunctionFragment; + "SUPPLY_DECAY_START()": FunctionFragment; + "TERMINAL_SUPPLY_RATE_ANNUAL()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "inflationStartDate()": FunctionFragment; + "isMintable()": FunctionFragment; + "kwenta()": FunctionFragment; + "lastMintEvent()": FunctionFragment; + "mint()": FunctionFragment; + "mintableSupply()": FunctionFragment; + "minterReward()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "setKwenta(address)": FunctionFragment; + "setMinterReward(uint256)": FunctionFragment; + "setStakingRewards(address)": FunctionFragment; + "setTradingRewards(address)": FunctionFragment; + "setTradingRewardsDiversion(uint256)": FunctionFragment; + "setTreasuryDAO(address)": FunctionFragment; + "setTreasuryDiversion(uint256)": FunctionFragment; + "stakingRewards()": FunctionFragment; + "terminalInflationSupply(uint256,uint256)": FunctionFragment; + "tokenDecaySupplyForWeek(uint256)": FunctionFragment; + "tradingRewards()": FunctionFragment; + "tradingRewardsDiversion()": FunctionFragment; + "treasuryDAO()": FunctionFragment; + "treasuryDiversion()": FunctionFragment; + "weekCounter()": FunctionFragment; + "weeksSinceLastIssuance()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "DECAY_RATE" + | "INITIAL_SUPPLY" + | "INITIAL_WEEKLY_SUPPLY" + | "MAX_MINTER_REWARD" + | "MINT_BUFFER" + | "MINT_PERIOD_DURATION" + | "SUPPLY_DECAY_END" + | "SUPPLY_DECAY_START" + | "TERMINAL_SUPPLY_RATE_ANNUAL" + | "acceptOwnership" + | "inflationStartDate" + | "isMintable" + | "kwenta" + | "lastMintEvent" + | "mint" + | "mintableSupply" + | "minterReward" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "setKwenta" + | "setMinterReward" + | "setStakingRewards" + | "setTradingRewards" + | "setTradingRewardsDiversion" + | "setTreasuryDAO" + | "setTreasuryDiversion" + | "stakingRewards" + | "terminalInflationSupply" + | "tokenDecaySupplyForWeek" + | "tradingRewards" + | "tradingRewardsDiversion" + | "treasuryDAO" + | "treasuryDiversion" + | "weekCounter" + | "weeksSinceLastIssuance" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "DECAY_RATE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "INITIAL_SUPPLY", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "INITIAL_WEEKLY_SUPPLY", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "MAX_MINTER_REWARD", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "MINT_BUFFER", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "MINT_PERIOD_DURATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SUPPLY_DECAY_END", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SUPPLY_DECAY_START", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "TERMINAL_SUPPLY_RATE_ANNUAL", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "inflationStartDate", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isMintable", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "kwenta", values?: undefined): string; + encodeFunctionData( + functionFragment: "lastMintEvent", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "mint", values?: undefined): string; + encodeFunctionData( + functionFragment: "mintableSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minterReward", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "setKwenta", values: [string]): string; + encodeFunctionData( + functionFragment: "setMinterReward", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setStakingRewards", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setTradingRewards", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setTradingRewardsDiversion", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTreasuryDAO", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setTreasuryDiversion", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "stakingRewards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "terminalInflationSupply", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenDecaySupplyForWeek", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tradingRewards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "tradingRewardsDiversion", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "treasuryDAO", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "treasuryDiversion", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "weekCounter", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "weeksSinceLastIssuance", + values?: undefined + ): string; + + decodeFunctionResult(functionFragment: "DECAY_RATE", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "INITIAL_SUPPLY", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "INITIAL_WEEKLY_SUPPLY", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "MAX_MINTER_REWARD", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "MINT_BUFFER", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "MINT_PERIOD_DURATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SUPPLY_DECAY_END", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SUPPLY_DECAY_START", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "TERMINAL_SUPPLY_RATE_ANNUAL", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "inflationStartDate", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isMintable", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "kwenta", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "lastMintEvent", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "mintableSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minterReward", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "setKwenta", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMinterReward", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setStakingRewards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTradingRewards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTradingRewardsDiversion", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTreasuryDAO", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTreasuryDiversion", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "stakingRewards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "terminalInflationSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenDecaySupplyForWeek", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tradingRewards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tradingRewardsDiversion", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "treasuryDAO", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "treasuryDiversion", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "weekCounter", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "weeksSinceLastIssuance", + data: BytesLike + ): Result; + + events: { + "KwentaUpdated(address)": EventFragment; + "MinterRewardUpdated(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "StakingRewardsUpdated(address)": EventFragment; + "SupplyMinted(uint256,uint256,uint256)": EventFragment; + "TradingRewardsDiversionUpdated(uint256)": EventFragment; + "TradingRewardsUpdated(address)": EventFragment; + "TreasuryDAOSet(address)": EventFragment; + "TreasuryDiversionUpdated(uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "KwentaUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MinterRewardUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "StakingRewardsUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SupplyMinted"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "TradingRewardsDiversionUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "TradingRewardsUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TreasuryDAOSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TreasuryDiversionUpdated"): EventFragment; } export interface KwentaUpdatedEventObject { - newAddress: string + newAddress: string; } -export type KwentaUpdatedEvent = TypedEvent<[string], KwentaUpdatedEventObject> +export type KwentaUpdatedEvent = TypedEvent<[string], KwentaUpdatedEventObject>; -export type KwentaUpdatedEventFilter = TypedEventFilter +export type KwentaUpdatedEventFilter = TypedEventFilter; export interface MinterRewardUpdatedEventObject { - newRewardAmount: BigNumber + newRewardAmount: BigNumber; } -export type MinterRewardUpdatedEvent = TypedEvent<[BigNumber], MinterRewardUpdatedEventObject> +export type MinterRewardUpdatedEvent = TypedEvent< + [BigNumber], + MinterRewardUpdatedEventObject +>; -export type MinterRewardUpdatedEventFilter = TypedEventFilter +export type MinterRewardUpdatedEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface StakingRewardsUpdatedEventObject { - newAddress: string + newAddress: string; } -export type StakingRewardsUpdatedEvent = TypedEvent<[string], StakingRewardsUpdatedEventObject> +export type StakingRewardsUpdatedEvent = TypedEvent< + [string], + StakingRewardsUpdatedEventObject +>; -export type StakingRewardsUpdatedEventFilter = TypedEventFilter +export type StakingRewardsUpdatedEventFilter = + TypedEventFilter; export interface SupplyMintedEventObject { - supplyMinted: BigNumber - numberOfWeeksIssued: BigNumber - lastMintEvent: BigNumber + supplyMinted: BigNumber; + numberOfWeeksIssued: BigNumber; + lastMintEvent: BigNumber; } export type SupplyMintedEvent = TypedEvent< - [BigNumber, BigNumber, BigNumber], - SupplyMintedEventObject -> + [BigNumber, BigNumber, BigNumber], + SupplyMintedEventObject +>; -export type SupplyMintedEventFilter = TypedEventFilter +export type SupplyMintedEventFilter = TypedEventFilter; export interface TradingRewardsDiversionUpdatedEventObject { - newPercentage: BigNumber + newPercentage: BigNumber; } export type TradingRewardsDiversionUpdatedEvent = TypedEvent< - [BigNumber], - TradingRewardsDiversionUpdatedEventObject -> + [BigNumber], + TradingRewardsDiversionUpdatedEventObject +>; export type TradingRewardsDiversionUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface TradingRewardsUpdatedEventObject { - newAddress: string + newAddress: string; } -export type TradingRewardsUpdatedEvent = TypedEvent<[string], TradingRewardsUpdatedEventObject> +export type TradingRewardsUpdatedEvent = TypedEvent< + [string], + TradingRewardsUpdatedEventObject +>; -export type TradingRewardsUpdatedEventFilter = TypedEventFilter +export type TradingRewardsUpdatedEventFilter = + TypedEventFilter; export interface TreasuryDAOSetEventObject { - treasuryDAO: string + treasuryDAO: string; } -export type TreasuryDAOSetEvent = TypedEvent<[string], TreasuryDAOSetEventObject> +export type TreasuryDAOSetEvent = TypedEvent< + [string], + TreasuryDAOSetEventObject +>; -export type TreasuryDAOSetEventFilter = TypedEventFilter +export type TreasuryDAOSetEventFilter = TypedEventFilter; export interface TreasuryDiversionUpdatedEventObject { - newPercentage: BigNumber + newPercentage: BigNumber; } export type TreasuryDiversionUpdatedEvent = TypedEvent< - [BigNumber], - TreasuryDiversionUpdatedEventObject -> + [BigNumber], + TreasuryDiversionUpdatedEventObject +>; -export type TreasuryDiversionUpdatedEventFilter = TypedEventFilter +export type TreasuryDiversionUpdatedEventFilter = + TypedEventFilter; export interface SupplySchedule extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - interface: SupplyScheduleInterface + interface: SupplyScheduleInterface; - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - functions: { - DECAY_RATE(overrides?: CallOverrides): Promise<[BigNumber]> + functions: { + DECAY_RATE(overrides?: CallOverrides): Promise<[BigNumber]>; - INITIAL_SUPPLY(overrides?: CallOverrides): Promise<[BigNumber]> + INITIAL_SUPPLY(overrides?: CallOverrides): Promise<[BigNumber]>; - INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise<[BigNumber]> + INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise<[BigNumber]>; - MAX_MINTER_REWARD(overrides?: CallOverrides): Promise<[BigNumber]> + MAX_MINTER_REWARD(overrides?: CallOverrides): Promise<[BigNumber]>; - MINT_BUFFER(overrides?: CallOverrides): Promise<[BigNumber]> + MINT_BUFFER(overrides?: CallOverrides): Promise<[BigNumber]>; - MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise<[BigNumber]> + MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise<[BigNumber]>; - SUPPLY_DECAY_END(overrides?: CallOverrides): Promise<[number]> + SUPPLY_DECAY_END(overrides?: CallOverrides): Promise<[number]>; - SUPPLY_DECAY_START(overrides?: CallOverrides): Promise<[number]> + SUPPLY_DECAY_START(overrides?: CallOverrides): Promise<[number]>; - TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise<[BigNumber]> + TERMINAL_SUPPLY_RATE_ANNUAL( + overrides?: CallOverrides + ): Promise<[BigNumber]>; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - inflationStartDate(overrides?: CallOverrides): Promise<[BigNumber]> + inflationStartDate(overrides?: CallOverrides): Promise<[BigNumber]>; - isMintable(overrides?: CallOverrides): Promise<[boolean]> + isMintable(overrides?: CallOverrides): Promise<[boolean]>; - kwenta(overrides?: CallOverrides): Promise<[string]> + kwenta(overrides?: CallOverrides): Promise<[string]>; - lastMintEvent(overrides?: CallOverrides): Promise<[BigNumber]> + lastMintEvent(overrides?: CallOverrides): Promise<[BigNumber]>; - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise + mint( + overrides?: Overrides & { from?: string } + ): Promise; - mintableSupply(overrides?: CallOverrides): Promise<[BigNumber]> + mintableSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - minterReward(overrides?: CallOverrides): Promise<[BigNumber]> + minterReward(overrides?: CallOverrides): Promise<[BigNumber]>; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise<[string]> + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - owner(overrides?: CallOverrides): Promise<[string]> + owner(overrides?: CallOverrides): Promise<[string]>; - setKwenta( - _kwenta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setKwenta( + _kwenta: string, + overrides?: Overrides & { from?: string } + ): Promise; - setMinterReward( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMinterReward( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewards( - _tradingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewards( + _tradingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewardsDiversion( - _tradingRewardsDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewardsDiversion( + _tradingRewardsDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDiversion( - _treasuryDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDiversion( + _treasuryDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingRewards(overrides?: CallOverrides): Promise<[string]> + stakingRewards(overrides?: CallOverrides): Promise<[string]>; - terminalInflationSupply( - totalSupply: PromiseOrValue, - numOfWeeks: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> + terminalInflationSupply( + totalSupply: BigNumberish, + numOfWeeks: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - tokenDecaySupplyForWeek( - counter: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> + tokenDecaySupplyForWeek( + counter: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - tradingRewards(overrides?: CallOverrides): Promise<[string]> + tradingRewards(overrides?: CallOverrides): Promise<[string]>; - tradingRewardsDiversion(overrides?: CallOverrides): Promise<[BigNumber]> + tradingRewardsDiversion(overrides?: CallOverrides): Promise<[BigNumber]>; - treasuryDAO(overrides?: CallOverrides): Promise<[string]> + treasuryDAO(overrides?: CallOverrides): Promise<[string]>; - treasuryDiversion(overrides?: CallOverrides): Promise<[BigNumber]> + treasuryDiversion(overrides?: CallOverrides): Promise<[BigNumber]>; - weekCounter(overrides?: CallOverrides): Promise<[BigNumber]> + weekCounter(overrides?: CallOverrides): Promise<[BigNumber]>; - weeksSinceLastIssuance(overrides?: CallOverrides): Promise<[BigNumber]> - } + weeksSinceLastIssuance(overrides?: CallOverrides): Promise<[BigNumber]>; + }; - DECAY_RATE(overrides?: CallOverrides): Promise + DECAY_RATE(overrides?: CallOverrides): Promise; - INITIAL_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_SUPPLY(overrides?: CallOverrides): Promise; - INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise; - MAX_MINTER_REWARD(overrides?: CallOverrides): Promise + MAX_MINTER_REWARD(overrides?: CallOverrides): Promise; - MINT_BUFFER(overrides?: CallOverrides): Promise + MINT_BUFFER(overrides?: CallOverrides): Promise; - MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise + MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise; - SUPPLY_DECAY_END(overrides?: CallOverrides): Promise + SUPPLY_DECAY_END(overrides?: CallOverrides): Promise; - SUPPLY_DECAY_START(overrides?: CallOverrides): Promise + SUPPLY_DECAY_START(overrides?: CallOverrides): Promise; - TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise + TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - inflationStartDate(overrides?: CallOverrides): Promise + inflationStartDate(overrides?: CallOverrides): Promise; - isMintable(overrides?: CallOverrides): Promise + isMintable(overrides?: CallOverrides): Promise; - kwenta(overrides?: CallOverrides): Promise + kwenta(overrides?: CallOverrides): Promise; - lastMintEvent(overrides?: CallOverrides): Promise + lastMintEvent(overrides?: CallOverrides): Promise; - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise + mint(overrides?: Overrides & { from?: string }): Promise; - mintableSupply(overrides?: CallOverrides): Promise + mintableSupply(overrides?: CallOverrides): Promise; - minterReward(overrides?: CallOverrides): Promise + minterReward(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setKwenta( - _kwenta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setKwenta( + _kwenta: string, + overrides?: Overrides & { from?: string } + ): Promise; - setMinterReward( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMinterReward( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewards( - _tradingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewards( + _tradingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewardsDiversion( - _tradingRewardsDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewardsDiversion( + _tradingRewardsDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDiversion( - _treasuryDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDiversion( + _treasuryDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingRewards(overrides?: CallOverrides): Promise + stakingRewards(overrides?: CallOverrides): Promise; - terminalInflationSupply( - totalSupply: PromiseOrValue, - numOfWeeks: PromiseOrValue, - overrides?: CallOverrides - ): Promise + terminalInflationSupply( + totalSupply: BigNumberish, + numOfWeeks: BigNumberish, + overrides?: CallOverrides + ): Promise; - tokenDecaySupplyForWeek( - counter: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenDecaySupplyForWeek( + counter: BigNumberish, + overrides?: CallOverrides + ): Promise; - tradingRewards(overrides?: CallOverrides): Promise + tradingRewards(overrides?: CallOverrides): Promise; - tradingRewardsDiversion(overrides?: CallOverrides): Promise + tradingRewardsDiversion(overrides?: CallOverrides): Promise; - treasuryDAO(overrides?: CallOverrides): Promise + treasuryDAO(overrides?: CallOverrides): Promise; - treasuryDiversion(overrides?: CallOverrides): Promise + treasuryDiversion(overrides?: CallOverrides): Promise; - weekCounter(overrides?: CallOverrides): Promise + weekCounter(overrides?: CallOverrides): Promise; - weeksSinceLastIssuance(overrides?: CallOverrides): Promise + weeksSinceLastIssuance(overrides?: CallOverrides): Promise; - callStatic: { - DECAY_RATE(overrides?: CallOverrides): Promise + callStatic: { + DECAY_RATE(overrides?: CallOverrides): Promise; - INITIAL_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_SUPPLY(overrides?: CallOverrides): Promise; - INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise; - MAX_MINTER_REWARD(overrides?: CallOverrides): Promise + MAX_MINTER_REWARD(overrides?: CallOverrides): Promise; - MINT_BUFFER(overrides?: CallOverrides): Promise + MINT_BUFFER(overrides?: CallOverrides): Promise; - MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise + MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise; - SUPPLY_DECAY_END(overrides?: CallOverrides): Promise + SUPPLY_DECAY_END(overrides?: CallOverrides): Promise; - SUPPLY_DECAY_START(overrides?: CallOverrides): Promise + SUPPLY_DECAY_START(overrides?: CallOverrides): Promise; - TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise + TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise; - acceptOwnership(overrides?: CallOverrides): Promise + acceptOwnership(overrides?: CallOverrides): Promise; - inflationStartDate(overrides?: CallOverrides): Promise + inflationStartDate(overrides?: CallOverrides): Promise; - isMintable(overrides?: CallOverrides): Promise + isMintable(overrides?: CallOverrides): Promise; - kwenta(overrides?: CallOverrides): Promise + kwenta(overrides?: CallOverrides): Promise; - lastMintEvent(overrides?: CallOverrides): Promise + lastMintEvent(overrides?: CallOverrides): Promise; - mint(overrides?: CallOverrides): Promise + mint(overrides?: CallOverrides): Promise; - mintableSupply(overrides?: CallOverrides): Promise + mintableSupply(overrides?: CallOverrides): Promise; - minterReward(overrides?: CallOverrides): Promise + minterReward(overrides?: CallOverrides): Promise; - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setKwenta(_kwenta: PromiseOrValue, overrides?: CallOverrides): Promise + setKwenta(_kwenta: string, overrides?: CallOverrides): Promise; - setMinterReward(amount: PromiseOrValue, overrides?: CallOverrides): Promise + setMinterReward( + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setStakingRewards( + _stakingRewards: string, + overrides?: CallOverrides + ): Promise; - setTradingRewards( - _tradingRewards: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setTradingRewards( + _tradingRewards: string, + overrides?: CallOverrides + ): Promise; - setTradingRewardsDiversion( - _tradingRewardsDiversion: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setTradingRewardsDiversion( + _tradingRewardsDiversion: BigNumberish, + overrides?: CallOverrides + ): Promise; - setTreasuryDAO(_treasuryDAO: PromiseOrValue, overrides?: CallOverrides): Promise + setTreasuryDAO( + _treasuryDAO: string, + overrides?: CallOverrides + ): Promise; - setTreasuryDiversion( - _treasuryDiversion: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setTreasuryDiversion( + _treasuryDiversion: BigNumberish, + overrides?: CallOverrides + ): Promise; - stakingRewards(overrides?: CallOverrides): Promise + stakingRewards(overrides?: CallOverrides): Promise; - terminalInflationSupply( - totalSupply: PromiseOrValue, - numOfWeeks: PromiseOrValue, - overrides?: CallOverrides - ): Promise + terminalInflationSupply( + totalSupply: BigNumberish, + numOfWeeks: BigNumberish, + overrides?: CallOverrides + ): Promise; - tokenDecaySupplyForWeek( - counter: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenDecaySupplyForWeek( + counter: BigNumberish, + overrides?: CallOverrides + ): Promise; - tradingRewards(overrides?: CallOverrides): Promise + tradingRewards(overrides?: CallOverrides): Promise; - tradingRewardsDiversion(overrides?: CallOverrides): Promise + tradingRewardsDiversion(overrides?: CallOverrides): Promise; - treasuryDAO(overrides?: CallOverrides): Promise + treasuryDAO(overrides?: CallOverrides): Promise; - treasuryDiversion(overrides?: CallOverrides): Promise + treasuryDiversion(overrides?: CallOverrides): Promise; - weekCounter(overrides?: CallOverrides): Promise + weekCounter(overrides?: CallOverrides): Promise; - weeksSinceLastIssuance(overrides?: CallOverrides): Promise - } + weeksSinceLastIssuance(overrides?: CallOverrides): Promise; + }; - filters: { - 'KwentaUpdated(address)'(newAddress?: null): KwentaUpdatedEventFilter - KwentaUpdated(newAddress?: null): KwentaUpdatedEventFilter + filters: { + "KwentaUpdated(address)"(newAddress?: null): KwentaUpdatedEventFilter; + KwentaUpdated(newAddress?: null): KwentaUpdatedEventFilter; - 'MinterRewardUpdated(uint256)'(newRewardAmount?: null): MinterRewardUpdatedEventFilter - MinterRewardUpdated(newRewardAmount?: null): MinterRewardUpdatedEventFilter + "MinterRewardUpdated(uint256)"( + newRewardAmount?: null + ): MinterRewardUpdatedEventFilter; + MinterRewardUpdated(newRewardAmount?: null): MinterRewardUpdatedEventFilter; - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; - 'StakingRewardsUpdated(address)'(newAddress?: null): StakingRewardsUpdatedEventFilter - StakingRewardsUpdated(newAddress?: null): StakingRewardsUpdatedEventFilter + "StakingRewardsUpdated(address)"( + newAddress?: null + ): StakingRewardsUpdatedEventFilter; + StakingRewardsUpdated(newAddress?: null): StakingRewardsUpdatedEventFilter; - 'SupplyMinted(uint256,uint256,uint256)'( - supplyMinted?: null, - numberOfWeeksIssued?: null, - lastMintEvent?: null - ): SupplyMintedEventFilter - SupplyMinted( - supplyMinted?: null, - numberOfWeeksIssued?: null, - lastMintEvent?: null - ): SupplyMintedEventFilter + "SupplyMinted(uint256,uint256,uint256)"( + supplyMinted?: null, + numberOfWeeksIssued?: null, + lastMintEvent?: null + ): SupplyMintedEventFilter; + SupplyMinted( + supplyMinted?: null, + numberOfWeeksIssued?: null, + lastMintEvent?: null + ): SupplyMintedEventFilter; - 'TradingRewardsDiversionUpdated(uint256)'( - newPercentage?: null - ): TradingRewardsDiversionUpdatedEventFilter - TradingRewardsDiversionUpdated(newPercentage?: null): TradingRewardsDiversionUpdatedEventFilter + "TradingRewardsDiversionUpdated(uint256)"( + newPercentage?: null + ): TradingRewardsDiversionUpdatedEventFilter; + TradingRewardsDiversionUpdated( + newPercentage?: null + ): TradingRewardsDiversionUpdatedEventFilter; - 'TradingRewardsUpdated(address)'(newAddress?: null): TradingRewardsUpdatedEventFilter - TradingRewardsUpdated(newAddress?: null): TradingRewardsUpdatedEventFilter + "TradingRewardsUpdated(address)"( + newAddress?: null + ): TradingRewardsUpdatedEventFilter; + TradingRewardsUpdated(newAddress?: null): TradingRewardsUpdatedEventFilter; - 'TreasuryDAOSet(address)'(treasuryDAO?: null): TreasuryDAOSetEventFilter - TreasuryDAOSet(treasuryDAO?: null): TreasuryDAOSetEventFilter + "TreasuryDAOSet(address)"(treasuryDAO?: null): TreasuryDAOSetEventFilter; + TreasuryDAOSet(treasuryDAO?: null): TreasuryDAOSetEventFilter; - 'TreasuryDiversionUpdated(uint256)'(newPercentage?: null): TreasuryDiversionUpdatedEventFilter - TreasuryDiversionUpdated(newPercentage?: null): TreasuryDiversionUpdatedEventFilter - } + "TreasuryDiversionUpdated(uint256)"( + newPercentage?: null + ): TreasuryDiversionUpdatedEventFilter; + TreasuryDiversionUpdated( + newPercentage?: null + ): TreasuryDiversionUpdatedEventFilter; + }; - estimateGas: { - DECAY_RATE(overrides?: CallOverrides): Promise + estimateGas: { + DECAY_RATE(overrides?: CallOverrides): Promise; - INITIAL_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_SUPPLY(overrides?: CallOverrides): Promise; - INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise; - MAX_MINTER_REWARD(overrides?: CallOverrides): Promise + MAX_MINTER_REWARD(overrides?: CallOverrides): Promise; - MINT_BUFFER(overrides?: CallOverrides): Promise + MINT_BUFFER(overrides?: CallOverrides): Promise; - MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise + MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise; - SUPPLY_DECAY_END(overrides?: CallOverrides): Promise + SUPPLY_DECAY_END(overrides?: CallOverrides): Promise; - SUPPLY_DECAY_START(overrides?: CallOverrides): Promise + SUPPLY_DECAY_START(overrides?: CallOverrides): Promise; - TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise + TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise; - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - inflationStartDate(overrides?: CallOverrides): Promise + inflationStartDate(overrides?: CallOverrides): Promise; - isMintable(overrides?: CallOverrides): Promise + isMintable(overrides?: CallOverrides): Promise; - kwenta(overrides?: CallOverrides): Promise + kwenta(overrides?: CallOverrides): Promise; - lastMintEvent(overrides?: CallOverrides): Promise + lastMintEvent(overrides?: CallOverrides): Promise; - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise + mint(overrides?: Overrides & { from?: string }): Promise; - mintableSupply(overrides?: CallOverrides): Promise + mintableSupply(overrides?: CallOverrides): Promise; - minterReward(overrides?: CallOverrides): Promise + minterReward(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setKwenta( - _kwenta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setKwenta( + _kwenta: string, + overrides?: Overrides & { from?: string } + ): Promise; - setMinterReward( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMinterReward( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewards( - _tradingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewards( + _tradingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewardsDiversion( - _tradingRewardsDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewardsDiversion( + _tradingRewardsDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDiversion( - _treasuryDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDiversion( + _treasuryDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingRewards(overrides?: CallOverrides): Promise + stakingRewards(overrides?: CallOverrides): Promise; - terminalInflationSupply( - totalSupply: PromiseOrValue, - numOfWeeks: PromiseOrValue, - overrides?: CallOverrides - ): Promise + terminalInflationSupply( + totalSupply: BigNumberish, + numOfWeeks: BigNumberish, + overrides?: CallOverrides + ): Promise; - tokenDecaySupplyForWeek( - counter: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenDecaySupplyForWeek( + counter: BigNumberish, + overrides?: CallOverrides + ): Promise; - tradingRewards(overrides?: CallOverrides): Promise + tradingRewards(overrides?: CallOverrides): Promise; - tradingRewardsDiversion(overrides?: CallOverrides): Promise + tradingRewardsDiversion(overrides?: CallOverrides): Promise; - treasuryDAO(overrides?: CallOverrides): Promise + treasuryDAO(overrides?: CallOverrides): Promise; - treasuryDiversion(overrides?: CallOverrides): Promise + treasuryDiversion(overrides?: CallOverrides): Promise; - weekCounter(overrides?: CallOverrides): Promise + weekCounter(overrides?: CallOverrides): Promise; - weeksSinceLastIssuance(overrides?: CallOverrides): Promise - } + weeksSinceLastIssuance(overrides?: CallOverrides): Promise; + }; - populateTransaction: { - DECAY_RATE(overrides?: CallOverrides): Promise + populateTransaction: { + DECAY_RATE(overrides?: CallOverrides): Promise; - INITIAL_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_SUPPLY(overrides?: CallOverrides): Promise; - INITIAL_WEEKLY_SUPPLY(overrides?: CallOverrides): Promise + INITIAL_WEEKLY_SUPPLY( + overrides?: CallOverrides + ): Promise; - MAX_MINTER_REWARD(overrides?: CallOverrides): Promise + MAX_MINTER_REWARD(overrides?: CallOverrides): Promise; - MINT_BUFFER(overrides?: CallOverrides): Promise + MINT_BUFFER(overrides?: CallOverrides): Promise; - MINT_PERIOD_DURATION(overrides?: CallOverrides): Promise + MINT_PERIOD_DURATION( + overrides?: CallOverrides + ): Promise; - SUPPLY_DECAY_END(overrides?: CallOverrides): Promise + SUPPLY_DECAY_END(overrides?: CallOverrides): Promise; - SUPPLY_DECAY_START(overrides?: CallOverrides): Promise + SUPPLY_DECAY_START( + overrides?: CallOverrides + ): Promise; - TERMINAL_SUPPLY_RATE_ANNUAL(overrides?: CallOverrides): Promise + TERMINAL_SUPPLY_RATE_ANNUAL( + overrides?: CallOverrides + ): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - inflationStartDate(overrides?: CallOverrides): Promise + inflationStartDate( + overrides?: CallOverrides + ): Promise; - isMintable(overrides?: CallOverrides): Promise + isMintable(overrides?: CallOverrides): Promise; - kwenta(overrides?: CallOverrides): Promise + kwenta(overrides?: CallOverrides): Promise; - lastMintEvent(overrides?: CallOverrides): Promise + lastMintEvent(overrides?: CallOverrides): Promise; - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise + mint( + overrides?: Overrides & { from?: string } + ): Promise; - mintableSupply(overrides?: CallOverrides): Promise + mintableSupply(overrides?: CallOverrides): Promise; - minterReward(overrides?: CallOverrides): Promise + minterReward(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - setKwenta( - _kwenta: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setKwenta( + _kwenta: string, + overrides?: Overrides & { from?: string } + ): Promise; - setMinterReward( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMinterReward( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setStakingRewards( - _stakingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setStakingRewards( + _stakingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewards( - _tradingRewards: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewards( + _tradingRewards: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTradingRewardsDiversion( - _tradingRewardsDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTradingRewardsDiversion( + _tradingRewardsDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDAO( - _treasuryDAO: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDAO( + _treasuryDAO: string, + overrides?: Overrides & { from?: string } + ): Promise; - setTreasuryDiversion( - _treasuryDiversion: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTreasuryDiversion( + _treasuryDiversion: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - stakingRewards(overrides?: CallOverrides): Promise + stakingRewards(overrides?: CallOverrides): Promise; - terminalInflationSupply( - totalSupply: PromiseOrValue, - numOfWeeks: PromiseOrValue, - overrides?: CallOverrides - ): Promise + terminalInflationSupply( + totalSupply: BigNumberish, + numOfWeeks: BigNumberish, + overrides?: CallOverrides + ): Promise; - tokenDecaySupplyForWeek( - counter: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenDecaySupplyForWeek( + counter: BigNumberish, + overrides?: CallOverrides + ): Promise; - tradingRewards(overrides?: CallOverrides): Promise + tradingRewards(overrides?: CallOverrides): Promise; - tradingRewardsDiversion(overrides?: CallOverrides): Promise + tradingRewardsDiversion( + overrides?: CallOverrides + ): Promise; - treasuryDAO(overrides?: CallOverrides): Promise + treasuryDAO(overrides?: CallOverrides): Promise; - treasuryDiversion(overrides?: CallOverrides): Promise + treasuryDiversion(overrides?: CallOverrides): Promise; - weekCounter(overrides?: CallOverrides): Promise + weekCounter(overrides?: CallOverrides): Promise; - weeksSinceLastIssuance(overrides?: CallOverrides): Promise - } + weeksSinceLastIssuance( + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/Synth.ts b/packages/sdk/src/contracts/types/Synth.ts index 979a8f24c9..6ee560645b 100644 --- a/packages/sdk/src/contracts/types/Synth.ts +++ b/packages/sdk/src/contracts/types/Synth.ts @@ -2,956 +2,1103 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SynthInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'DECIMALS()': FunctionFragment - 'FEE_ADDRESS()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'allowance(address,address)': FunctionFragment - 'approve(address,uint256)': FunctionFragment - 'balanceOf(address)': FunctionFragment - 'burn(address,uint256)': FunctionFragment - 'currencyKey()': FunctionFragment - 'decimals()': FunctionFragment - 'isResolverCached()': FunctionFragment - 'issue(address,uint256)': FunctionFragment - 'messageSender()': FunctionFragment - 'name()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'proxy()': FunctionFragment - 'rebuildCache()': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'setMessageSender(address)': FunctionFragment - 'setProxy(address)': FunctionFragment - 'setTokenState(address)': FunctionFragment - 'setTotalSupply(uint256)': FunctionFragment - 'symbol()': FunctionFragment - 'tokenState()': FunctionFragment - 'totalSupply()': FunctionFragment - 'transfer(address,uint256)': FunctionFragment - 'transferAndSettle(address,uint256)': FunctionFragment - 'transferFrom(address,address,uint256)': FunctionFragment - 'transferFromAndSettle(address,address,uint256)': FunctionFragment - 'transferableSynths(address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'DECIMALS' - | 'FEE_ADDRESS' - | 'acceptOwnership' - | 'allowance' - | 'approve' - | 'balanceOf' - | 'burn' - | 'currencyKey' - | 'decimals' - | 'isResolverCached' - | 'issue' - | 'messageSender' - | 'name' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'proxy' - | 'rebuildCache' - | 'resolver' - | 'resolverAddressesRequired' - | 'setMessageSender' - | 'setProxy' - | 'setTokenState' - | 'setTotalSupply' - | 'symbol' - | 'tokenState' - | 'totalSupply' - | 'transfer' - | 'transferAndSettle' - | 'transferFrom' - | 'transferFromAndSettle' - | 'transferableSynths' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'DECIMALS', values?: undefined): string - encodeFunctionData(functionFragment: 'FEE_ADDRESS', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'allowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'approve', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'burn', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'currencyKey', values?: undefined): string - encodeFunctionData(functionFragment: 'decimals', values?: undefined): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData( - functionFragment: 'issue', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'messageSender', values?: undefined): string - encodeFunctionData(functionFragment: 'name', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'proxy', values?: undefined): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData(functionFragment: 'setMessageSender', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'setProxy', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'setTokenState', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'setTotalSupply', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'symbol', values?: undefined): string - encodeFunctionData(functionFragment: 'tokenState', values?: undefined): string - encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string - encodeFunctionData( - functionFragment: 'transfer', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferAndSettle', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferFrom', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferFromAndSettle', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferableSynths', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'DECIMALS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'FEE_ADDRESS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'currencyKey', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'issue', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'messageSender', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'proxy', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMessageSender', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setProxy', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTokenState', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTotalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'tokenState', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferAndSettle', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferFromAndSettle', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferableSynths', data: BytesLike): Result - - events: { - 'Approval(address,address,uint256)': EventFragment - 'Burned(address,uint256)': EventFragment - 'CacheUpdated(bytes32,address)': EventFragment - 'Issued(address,uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'ProxyUpdated(address)': EventFragment - 'TokenStateUpdated(address)': EventFragment - 'Transfer(address,address,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Burned'): EventFragment - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Issued'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ProxyUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TokenStateUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "DECIMALS()": FunctionFragment; + "FEE_ADDRESS()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "allowance(address,address)": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "burn(address,uint256)": FunctionFragment; + "currencyKey()": FunctionFragment; + "decimals()": FunctionFragment; + "isResolverCached()": FunctionFragment; + "issue(address,uint256)": FunctionFragment; + "messageSender()": FunctionFragment; + "name()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "proxy()": FunctionFragment; + "rebuildCache()": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "setMessageSender(address)": FunctionFragment; + "setProxy(address)": FunctionFragment; + "setTokenState(address)": FunctionFragment; + "setTotalSupply(uint256)": FunctionFragment; + "symbol()": FunctionFragment; + "tokenState()": FunctionFragment; + "totalSupply()": FunctionFragment; + "transfer(address,uint256)": FunctionFragment; + "transferAndSettle(address,uint256)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "transferFromAndSettle(address,address,uint256)": FunctionFragment; + "transferableSynths(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "DECIMALS" + | "FEE_ADDRESS" + | "acceptOwnership" + | "allowance" + | "approve" + | "balanceOf" + | "burn" + | "currencyKey" + | "decimals" + | "isResolverCached" + | "issue" + | "messageSender" + | "name" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "proxy" + | "rebuildCache" + | "resolver" + | "resolverAddressesRequired" + | "setMessageSender" + | "setProxy" + | "setTokenState" + | "setTotalSupply" + | "symbol" + | "tokenState" + | "totalSupply" + | "transfer" + | "transferAndSettle" + | "transferFrom" + | "transferFromAndSettle" + | "transferableSynths" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "DECIMALS", values?: undefined): string; + encodeFunctionData( + functionFragment: "FEE_ADDRESS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "burn", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "currencyKey", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "issue", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "messageSender", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "proxy", values?: undefined): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setMessageSender", + values: [string] + ): string; + encodeFunctionData(functionFragment: "setProxy", values: [string]): string; + encodeFunctionData( + functionFragment: "setTokenState", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setTotalSupply", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "tokenState", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferAndSettle", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFromAndSettle", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferableSynths", + values: [string] + ): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "DECIMALS", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "FEE_ADDRESS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "currencyKey", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "issue", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "messageSender", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "proxy", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMessageSender", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "setProxy", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setTokenState", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTotalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "tokenState", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferAndSettle", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFromAndSettle", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferableSynths", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "Burned(address,uint256)": EventFragment; + "CacheUpdated(bytes32,address)": EventFragment; + "Issued(address,uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "ProxyUpdated(address)": EventFragment; + "TokenStateUpdated(address)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Burned"): EventFragment; + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Issued"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ProxyUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TokenStateUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; } export interface ApprovalEventObject { - owner: string - spender: string - value: BigNumber + owner: string; + spender: string; + value: BigNumber; } -export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject> +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; -export type ApprovalEventFilter = TypedEventFilter +export type ApprovalEventFilter = TypedEventFilter; export interface BurnedEventObject { - account: string - value: BigNumber + account: string; + value: BigNumber; } -export type BurnedEvent = TypedEvent<[string, BigNumber], BurnedEventObject> +export type BurnedEvent = TypedEvent<[string, BigNumber], BurnedEventObject>; -export type BurnedEventFilter = TypedEventFilter +export type BurnedEventFilter = TypedEventFilter; export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface IssuedEventObject { - account: string - value: BigNumber + account: string; + value: BigNumber; } -export type IssuedEvent = TypedEvent<[string, BigNumber], IssuedEventObject> +export type IssuedEvent = TypedEvent<[string, BigNumber], IssuedEventObject>; -export type IssuedEventFilter = TypedEventFilter +export type IssuedEventFilter = TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface ProxyUpdatedEventObject { - proxyAddress: string + proxyAddress: string; } -export type ProxyUpdatedEvent = TypedEvent<[string], ProxyUpdatedEventObject> +export type ProxyUpdatedEvent = TypedEvent<[string], ProxyUpdatedEventObject>; -export type ProxyUpdatedEventFilter = TypedEventFilter +export type ProxyUpdatedEventFilter = TypedEventFilter; export interface TokenStateUpdatedEventObject { - newTokenState: string + newTokenState: string; } -export type TokenStateUpdatedEvent = TypedEvent<[string], TokenStateUpdatedEventObject> +export type TokenStateUpdatedEvent = TypedEvent< + [string], + TokenStateUpdatedEventObject +>; -export type TokenStateUpdatedEventFilter = TypedEventFilter +export type TokenStateUpdatedEventFilter = + TypedEventFilter; export interface TransferEventObject { - from: string - to: string - value: BigNumber + from: string; + to: string; + value: BigNumber; } -export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject> +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; -export type TransferEventFilter = TypedEventFilter +export type TransferEventFilter = TypedEventFilter; export interface Synth extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SynthInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - DECIMALS(overrides?: CallOverrides): Promise<[number]> - - FEE_ADDRESS(overrides?: CallOverrides): Promise<[string]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - burn( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currencyKey(overrides?: CallOverrides): Promise<[string]> - - decimals(overrides?: CallOverrides): Promise<[number]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - issue( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - messageSender(overrides?: CallOverrides): Promise<[string]> - - name(overrides?: CallOverrides): Promise<[string]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - proxy(overrides?: CallOverrides): Promise<[string]> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + interface: SynthInterface; - setTotalSupply( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - symbol(overrides?: CallOverrides): Promise<[string]> + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - tokenState(overrides?: CallOverrides): Promise<[string]> + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]> + DECIMALS(overrides?: CallOverrides): Promise<[number]>; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + FEE_ADDRESS(overrides?: CallOverrides): Promise<[string]>; - transferAndSettle( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - transferFromAndSettle( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - } + currencyKey(overrides?: CallOverrides): Promise<[string]>; - CONTRACT_NAME(overrides?: CallOverrides): Promise + decimals(overrides?: CallOverrides): Promise<[number]>; - DECIMALS(overrides?: CallOverrides): Promise + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; - FEE_ADDRESS(overrides?: CallOverrides): Promise + issue( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + messageSender(overrides?: CallOverrides): Promise<[string]>; - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise + name(overrides?: CallOverrides): Promise<[string]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise<[string]>; - burn( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + proxy(overrides?: CallOverrides): Promise<[string]>; - currencyKey(overrides?: CallOverrides): Promise + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - decimals(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise<[string]>; - isResolverCached(overrides?: CallOverrides): Promise + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; - issue( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; - messageSender(overrides?: CallOverrides): Promise + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; - name(overrides?: CallOverrides): Promise + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTotalSupply( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + symbol(overrides?: CallOverrides): Promise<[string]>; - owner(overrides?: CallOverrides): Promise + tokenState(overrides?: CallOverrides): Promise<[string]>; - proxy(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - resolver(overrides?: CallOverrides): Promise + transferAndSettle( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transferFromAndSettle( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transferableSynths( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + }; - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + CONTRACT_NAME(overrides?: CallOverrides): Promise; - setTotalSupply( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + DECIMALS(overrides?: CallOverrides): Promise; - symbol(overrides?: CallOverrides): Promise + FEE_ADDRESS(overrides?: CallOverrides): Promise; - tokenState(overrides?: CallOverrides): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - totalSupply(overrides?: CallOverrides): Promise + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferAndSettle( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + burn( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferFromAndSettle( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + currencyKey(overrides?: CallOverrides): Promise; - transferableSynths(account: PromiseOrValue, overrides?: CallOverrides): Promise + decimals(overrides?: CallOverrides): Promise; - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise + isResolverCached(overrides?: CallOverrides): Promise; - DECIMALS(overrides?: CallOverrides): Promise + issue( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - FEE_ADDRESS(overrides?: CallOverrides): Promise + messageSender(overrides?: CallOverrides): Promise; - acceptOwnership(overrides?: CallOverrides): Promise + name(overrides?: CallOverrides): Promise; - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - burn( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise + proxy(overrides?: CallOverrides): Promise; - currencyKey(overrides?: CallOverrides): Promise + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - decimals(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - isResolverCached(overrides?: CallOverrides): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - issue( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; - messageSender(overrides?: CallOverrides): Promise + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; - name(overrides?: CallOverrides): Promise + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + setTotalSupply( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + symbol(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + tokenState(overrides?: CallOverrides): Promise; - proxy(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - rebuildCache(overrides?: CallOverrides): Promise + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - resolver(overrides?: CallOverrides): Promise + transferAndSettle( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setMessageSender(sender: PromiseOrValue, overrides?: CallOverrides): Promise + transferFromAndSettle( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setProxy(_proxy: PromiseOrValue, overrides?: CallOverrides): Promise + transferableSynths( + account: string, + overrides?: CallOverrides + ): Promise; - setTokenState(_tokenState: PromiseOrValue, overrides?: CallOverrides): Promise + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; - setTotalSupply(amount: PromiseOrValue, overrides?: CallOverrides): Promise + DECIMALS(overrides?: CallOverrides): Promise; - symbol(overrides?: CallOverrides): Promise + FEE_ADDRESS(overrides?: CallOverrides): Promise; - tokenState(overrides?: CallOverrides): Promise + acceptOwnership(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise + approve( + spender: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; - transferAndSettle( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise + balanceOf(account: string, overrides?: CallOverrides): Promise; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise + burn( + account: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; - transferFromAndSettle( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise + currencyKey(overrides?: CallOverrides): Promise; - transferableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + decimals(overrides?: CallOverrides): Promise; - filters: { - 'Approval(address,address,uint256)'( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter - Approval( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter + isResolverCached(overrides?: CallOverrides): Promise; - 'Burned(address,uint256)'( - account?: PromiseOrValue | null, - value?: null - ): BurnedEventFilter - Burned(account?: PromiseOrValue | null, value?: null): BurnedEventFilter + issue( + account: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter + messageSender(overrides?: CallOverrides): Promise; - 'Issued(address,uint256)'( - account?: PromiseOrValue | null, - value?: null - ): IssuedEventFilter - Issued(account?: PromiseOrValue | null, value?: null): IssuedEventFilter + name(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter + proxy(overrides?: CallOverrides): Promise; - 'ProxyUpdated(address)'(proxyAddress?: null): ProxyUpdatedEventFilter - ProxyUpdated(proxyAddress?: null): ProxyUpdatedEventFilter + rebuildCache(overrides?: CallOverrides): Promise; - 'TokenStateUpdated(address)'(newTokenState?: null): TokenStateUpdatedEventFilter - TokenStateUpdated(newTokenState?: null): TokenStateUpdatedEventFilter + resolver(overrides?: CallOverrides): Promise; - 'Transfer(address,address,uint256)'( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - Transfer( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - } + resolverAddressesRequired(overrides?: CallOverrides): Promise; - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise + setMessageSender(sender: string, overrides?: CallOverrides): Promise; - DECIMALS(overrides?: CallOverrides): Promise + setProxy(_proxy: string, overrides?: CallOverrides): Promise; - FEE_ADDRESS(overrides?: CallOverrides): Promise + setTokenState( + _tokenState: string, + overrides?: CallOverrides + ): Promise; + + setTotalSupply( + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tokenState(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferAndSettle( + to: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise + transferFromAndSettle( + from: string, + to: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - burn( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - currencyKey(overrides?: CallOverrides): Promise - - decimals(overrides?: CallOverrides): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - issue( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - messageSender(overrides?: CallOverrides): Promise + transferableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; + Approval( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; - name(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise + "Burned(address,uint256)"( + account?: string | null, + value?: null + ): BurnedEventFilter; + Burned(account?: string | null, value?: null): BurnedEventFilter; - proxy(overrides?: CallOverrides): Promise + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise + "Issued(address,uint256)"( + account?: string | null, + value?: null + ): IssuedEventFilter; + Issued(account?: string | null, value?: null): IssuedEventFilter; - resolver(overrides?: CallOverrides): Promise + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; - resolverAddressesRequired(overrides?: CallOverrides): Promise + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + "ProxyUpdated(address)"(proxyAddress?: null): ProxyUpdatedEventFilter; + ProxyUpdated(proxyAddress?: null): ProxyUpdatedEventFilter; + + "TokenStateUpdated(address)"( + newTokenState?: null + ): TokenStateUpdatedEventFilter; + TokenStateUpdated(newTokenState?: null): TokenStateUpdatedEventFilter; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + Transfer( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + DECIMALS(overrides?: CallOverrides): Promise; + + FEE_ADDRESS(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + currencyKey(overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + issue( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + messageSender(overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + proxy(overrides?: CallOverrides): Promise; - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + rebuildCache(overrides?: Overrides & { from?: string }): Promise; - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + resolver(overrides?: CallOverrides): Promise; - setTotalSupply( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - symbol(overrides?: CallOverrides): Promise + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; - tokenState(overrides?: CallOverrides): Promise + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; - totalSupply(overrides?: CallOverrides): Promise + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTotalSupply( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferAndSettle( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + symbol(overrides?: CallOverrides): Promise; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + tokenState(overrides?: CallOverrides): Promise; - transferFromAndSettle( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + totalSupply(overrides?: CallOverrides): Promise; - transferableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise + transferAndSettle( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - DECIMALS(overrides?: CallOverrides): Promise + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - FEE_ADDRESS(overrides?: CallOverrides): Promise + transferFromAndSettle( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transferableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + }; - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + DECIMALS(overrides?: CallOverrides): Promise; - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + FEE_ADDRESS(overrides?: CallOverrides): Promise; - burn( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - currencyKey(overrides?: CallOverrides): Promise + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; - decimals(overrides?: CallOverrides): Promise + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - isResolverCached(overrides?: CallOverrides): Promise + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; - issue( - account: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - messageSender(overrides?: CallOverrides): Promise - - name(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise + burn( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise - - proxy(overrides?: CallOverrides): Promise + currencyKey(overrides?: CallOverrides): Promise; - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + decimals(overrides?: CallOverrides): Promise; - setTotalSupply( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + isResolverCached(overrides?: CallOverrides): Promise; + + issue( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + messageSender(overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + proxy(overrides?: CallOverrides): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; - symbol(overrides?: CallOverrides): Promise + setTotalSupply( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - tokenState(overrides?: CallOverrides): Promise + symbol(overrides?: CallOverrides): Promise; - totalSupply(overrides?: CallOverrides): Promise + tokenState(overrides?: CallOverrides): Promise; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + totalSupply(overrides?: CallOverrides): Promise; - transferAndSettle( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transferAndSettle( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferFromAndSettle( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transferFromAndSettle( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + transferableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SynthRedeemer.ts b/packages/sdk/src/contracts/types/SynthRedeemer.ts index b77f5ae273..ab7d1f6e1f 100644 --- a/packages/sdk/src/contracts/types/SynthRedeemer.ts +++ b/packages/sdk/src/contracts/types/SynthRedeemer.ts @@ -2,414 +2,475 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SynthRedeemerInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'balanceOf(address,address)': FunctionFragment - 'deprecate(address,uint256)': FunctionFragment - 'isResolverCached()': FunctionFragment - 'rebuildCache()': FunctionFragment - 'redeem(address)': FunctionFragment - 'redeemAll(address[])': FunctionFragment - 'redeemPartial(address,uint256)': FunctionFragment - 'redemptions(address)': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'totalSupply(address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'balanceOf' - | 'deprecate' - | 'isResolverCached' - | 'rebuildCache' - | 'redeem' - | 'redeemAll' - | 'redeemPartial' - | 'redemptions' - | 'resolver' - | 'resolverAddressesRequired' - | 'totalSupply' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData( - functionFragment: 'balanceOf', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'deprecate', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'redeem', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'redeemAll', values: [PromiseOrValue[]]): string - encodeFunctionData( - functionFragment: 'redeemPartial', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'redemptions', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData(functionFragment: 'totalSupply', values: [PromiseOrValue]): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'deprecate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'redeemAll', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'redeemPartial', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'redemptions', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result - - events: { - 'CacheUpdated(bytes32,address)': EventFragment - 'SynthDeprecated(address,uint256,uint256,uint256)': EventFragment - 'SynthRedeemed(address,address,uint256,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SynthDeprecated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SynthRedeemed'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "balanceOf(address,address)": FunctionFragment; + "deprecate(address,uint256)": FunctionFragment; + "isResolverCached()": FunctionFragment; + "rebuildCache()": FunctionFragment; + "redeem(address)": FunctionFragment; + "redeemAll(address[])": FunctionFragment; + "redeemPartial(address,uint256)": FunctionFragment; + "redemptions(address)": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "totalSupply(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "balanceOf" + | "deprecate" + | "isResolverCached" + | "rebuildCache" + | "redeem" + | "redeemAll" + | "redeemPartial" + | "redemptions" + | "resolver" + | "resolverAddressesRequired" + | "totalSupply" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "deprecate", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "redeem", values: [string]): string; + encodeFunctionData(functionFragment: "redeemAll", values: [string[]]): string; + encodeFunctionData( + functionFragment: "redeemPartial", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "redemptions", values: [string]): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "totalSupply", values: [string]): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "deprecate", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "redeem", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "redeemAll", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "redeemPartial", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "redemptions", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + + events: { + "CacheUpdated(bytes32,address)": EventFragment; + "SynthDeprecated(address,uint256,uint256,uint256)": EventFragment; + "SynthRedeemed(address,address,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthDeprecated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthRedeemed"): EventFragment; } export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface SynthDeprecatedEventObject { - synth: string - rateToRedeem: BigNumber - totalSynthSupply: BigNumber - supplyInsUSD: BigNumber + synth: string; + rateToRedeem: BigNumber; + totalSynthSupply: BigNumber; + supplyInsUSD: BigNumber; } export type SynthDeprecatedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber], - SynthDeprecatedEventObject -> + [string, BigNumber, BigNumber, BigNumber], + SynthDeprecatedEventObject +>; -export type SynthDeprecatedEventFilter = TypedEventFilter +export type SynthDeprecatedEventFilter = TypedEventFilter; export interface SynthRedeemedEventObject { - synth: string - account: string - amountOfSynth: BigNumber - amountInsUSD: BigNumber + synth: string; + account: string; + amountOfSynth: BigNumber; + amountInsUSD: BigNumber; } export type SynthRedeemedEvent = TypedEvent< - [string, string, BigNumber, BigNumber], - SynthRedeemedEventObject -> + [string, string, BigNumber, BigNumber], + SynthRedeemedEventObject +>; -export type SynthRedeemedEventFilter = TypedEventFilter +export type SynthRedeemedEventFilter = TypedEventFilter; export interface SynthRedeemer extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SynthRedeemerInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - balanceOf( - synthProxy: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { balanceInsUSD: BigNumber }> - - deprecate( - synthProxy: PromiseOrValue, - rateToRedeem: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeem( - synthProxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemAll( - synthProxies: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemPartial( - synthProxy: PromiseOrValue, - amountOfSynth: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redemptions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - totalSupply( - synthProxy: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { supplyInsUSD: BigNumber }> - } - - CONTRACT_NAME(overrides?: CallOverrides): Promise - - balanceOf( - synthProxy: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - deprecate( - synthProxy: PromiseOrValue, - rateToRedeem: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeem( - synthProxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemAll( - synthProxies: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemPartial( - synthProxy: PromiseOrValue, - amountOfSynth: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redemptions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - totalSupply(synthProxy: PromiseOrValue, overrides?: CallOverrides): Promise - - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - balanceOf( - synthProxy: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - deprecate( - synthProxy: PromiseOrValue, - rateToRedeem: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - rebuildCache(overrides?: CallOverrides): Promise - - redeem(synthProxy: PromiseOrValue, overrides?: CallOverrides): Promise - - redeemAll(synthProxies: PromiseOrValue[], overrides?: CallOverrides): Promise - - redeemPartial( - synthProxy: PromiseOrValue, - amountOfSynth: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - redemptions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - totalSupply(synthProxy: PromiseOrValue, overrides?: CallOverrides): Promise - } - - filters: { - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'SynthDeprecated(address,uint256,uint256,uint256)'( - synth?: null, - rateToRedeem?: null, - totalSynthSupply?: null, - supplyInsUSD?: null - ): SynthDeprecatedEventFilter - SynthDeprecated( - synth?: null, - rateToRedeem?: null, - totalSynthSupply?: null, - supplyInsUSD?: null - ): SynthDeprecatedEventFilter - - 'SynthRedeemed(address,address,uint256,uint256)'( - synth?: null, - account?: null, - amountOfSynth?: null, - amountInsUSD?: null - ): SynthRedeemedEventFilter - SynthRedeemed( - synth?: null, - account?: null, - amountOfSynth?: null, - amountInsUSD?: null - ): SynthRedeemedEventFilter - } - - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - balanceOf( - synthProxy: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - deprecate( - synthProxy: PromiseOrValue, - rateToRedeem: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - redeem( - synthProxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemAll( - synthProxies: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemPartial( - synthProxy: PromiseOrValue, - amountOfSynth: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redemptions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - totalSupply(synthProxy: PromiseOrValue, overrides?: CallOverrides): Promise - } - - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - balanceOf( - synthProxy: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - deprecate( - synthProxy: PromiseOrValue, - rateToRedeem: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeem( - synthProxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemAll( - synthProxies: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redeemPartial( - synthProxy: PromiseOrValue, - amountOfSynth: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - redemptions( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - totalSupply( - synthProxy: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SynthRedeemerInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; + + balanceOf( + synthProxy: string, + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { balanceInsUSD: BigNumber }>; + + deprecate( + synthProxy: string, + rateToRedeem: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + redeem( + synthProxy: string, + overrides?: Overrides & { from?: string } + ): Promise; + + redeemAll( + synthProxies: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + redeemPartial( + synthProxy: string, + amountOfSynth: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + redemptions(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + resolver(overrides?: CallOverrides): Promise<[string]>; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; + + totalSupply( + synthProxy: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { supplyInsUSD: BigNumber }>; + }; + + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + balanceOf( + synthProxy: string, + account: string, + overrides?: CallOverrides + ): Promise; + + deprecate( + synthProxy: string, + rateToRedeem: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + redeem( + synthProxy: string, + overrides?: Overrides & { from?: string } + ): Promise; + + redeemAll( + synthProxies: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + redeemPartial( + synthProxy: string, + amountOfSynth: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + redemptions(arg0: string, overrides?: CallOverrides): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + totalSupply( + synthProxy: string, + overrides?: CallOverrides + ): Promise; + + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + balanceOf( + synthProxy: string, + account: string, + overrides?: CallOverrides + ): Promise; + + deprecate( + synthProxy: string, + rateToRedeem: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + rebuildCache(overrides?: CallOverrides): Promise; + + redeem(synthProxy: string, overrides?: CallOverrides): Promise; + + redeemAll(synthProxies: string[], overrides?: CallOverrides): Promise; + + redeemPartial( + synthProxy: string, + amountOfSynth: BigNumberish, + overrides?: CallOverrides + ): Promise; + + redemptions(arg0: string, overrides?: CallOverrides): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + totalSupply( + synthProxy: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "SynthDeprecated(address,uint256,uint256,uint256)"( + synth?: null, + rateToRedeem?: null, + totalSynthSupply?: null, + supplyInsUSD?: null + ): SynthDeprecatedEventFilter; + SynthDeprecated( + synth?: null, + rateToRedeem?: null, + totalSynthSupply?: null, + supplyInsUSD?: null + ): SynthDeprecatedEventFilter; + + "SynthRedeemed(address,address,uint256,uint256)"( + synth?: null, + account?: null, + amountOfSynth?: null, + amountInsUSD?: null + ): SynthRedeemedEventFilter; + SynthRedeemed( + synth?: null, + account?: null, + amountOfSynth?: null, + amountInsUSD?: null + ): SynthRedeemedEventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + balanceOf( + synthProxy: string, + account: string, + overrides?: CallOverrides + ): Promise; + + deprecate( + synthProxy: string, + rateToRedeem: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + rebuildCache(overrides?: Overrides & { from?: string }): Promise; + + redeem( + synthProxy: string, + overrides?: Overrides & { from?: string } + ): Promise; + + redeemAll( + synthProxies: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + redeemPartial( + synthProxy: string, + amountOfSynth: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + redemptions(arg0: string, overrides?: CallOverrides): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + totalSupply( + synthProxy: string, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + balanceOf( + synthProxy: string, + account: string, + overrides?: CallOverrides + ): Promise; + + deprecate( + synthProxy: string, + rateToRedeem: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + redeem( + synthProxy: string, + overrides?: Overrides & { from?: string } + ): Promise; + + redeemAll( + synthProxies: string[], + overrides?: Overrides & { from?: string } + ): Promise; + + redeemPartial( + synthProxy: string, + amountOfSynth: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + redemptions( + arg0: string, + overrides?: CallOverrides + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + totalSupply( + synthProxy: string, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SynthSwap.ts b/packages/sdk/src/contracts/types/SynthSwap.ts index 00740dfd9c..9ee3a22fdb 100644 --- a/packages/sdk/src/contracts/types/SynthSwap.ts +++ b/packages/sdk/src/contracts/types/SynthSwap.ts @@ -2,438 +2,491 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SynthSwapInterface extends utils.Interface { - functions: { - 'acceptOwnership()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'rescueFunds(address,uint256)': FunctionFragment - 'swapInto(bytes32,bytes)': FunctionFragment - 'swapOutOf(bytes32,uint256,bytes)': FunctionFragment - 'uniswapSwapInto(bytes32,address,uint256,bytes)': FunctionFragment - 'uniswapSwapOutOf(bytes32,address,uint256,uint256,bytes)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'acceptOwnership' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'rescueFunds' - | 'swapInto' - | 'swapOutOf' - | 'uniswapSwapInto' - | 'uniswapSwapOutOf' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData( - functionFragment: 'rescueFunds', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'swapInto', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'swapOutOf', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'uniswapSwapInto', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'uniswapSwapOutOf', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rescueFunds', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'swapInto', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'swapOutOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'uniswapSwapInto', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'uniswapSwapOutOf', data: BytesLike): Result - - events: { - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'Received(address,uint256)': EventFragment - 'SwapInto(address,uint256)': EventFragment - 'SwapOutOf(address,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Received'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SwapInto'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SwapOutOf'): EventFragment + functions: { + "acceptOwnership()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "rescueFunds(address,uint256)": FunctionFragment; + "swapInto(bytes32,bytes)": FunctionFragment; + "swapOutOf(bytes32,uint256,bytes)": FunctionFragment; + "uniswapSwapInto(bytes32,address,uint256,bytes)": FunctionFragment; + "uniswapSwapOutOf(bytes32,address,uint256,uint256,bytes)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "rescueFunds" + | "swapInto" + | "swapOutOf" + | "uniswapSwapInto" + | "uniswapSwapOutOf" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "rescueFunds", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "swapInto", + values: [BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "swapOutOf", + values: [BytesLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "uniswapSwapInto", + values: [BytesLike, string, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "uniswapSwapOutOf", + values: [BytesLike, string, BigNumberish, BigNumberish, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rescueFunds", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "swapInto", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapOutOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "uniswapSwapInto", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapSwapOutOf", + data: BytesLike + ): Result; + + events: { + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "Received(address,uint256)": EventFragment; + "SwapInto(address,uint256)": EventFragment; + "SwapOutOf(address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Received"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapInto"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapOutOf"): EventFragment; } export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface ReceivedEventObject { - from: string - amountReceived: BigNumber + from: string; + amountReceived: BigNumber; } -export type ReceivedEvent = TypedEvent<[string, BigNumber], ReceivedEventObject> +export type ReceivedEvent = TypedEvent< + [string, BigNumber], + ReceivedEventObject +>; -export type ReceivedEventFilter = TypedEventFilter +export type ReceivedEventFilter = TypedEventFilter; export interface SwapIntoEventObject { - from: string - amountReceived: BigNumber + from: string; + amountReceived: BigNumber; } -export type SwapIntoEvent = TypedEvent<[string, BigNumber], SwapIntoEventObject> +export type SwapIntoEvent = TypedEvent< + [string, BigNumber], + SwapIntoEventObject +>; -export type SwapIntoEventFilter = TypedEventFilter +export type SwapIntoEventFilter = TypedEventFilter; export interface SwapOutOfEventObject { - from: string - amountReceived: BigNumber + from: string; + amountReceived: BigNumber; } -export type SwapOutOfEvent = TypedEvent<[string, BigNumber], SwapOutOfEventObject> +export type SwapOutOfEvent = TypedEvent< + [string, BigNumber], + SwapOutOfEventObject +>; -export type SwapOutOfEventFilter = TypedEventFilter +export type SwapOutOfEventFilter = TypedEventFilter; export interface SynthSwap extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SynthSwapInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - rescueFunds( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - swapInto( - _destSynthCurrencyKey: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - swapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _sourceAmount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapInto( - _destSynthCurrencyKey: PromiseOrValue, - _sourceTokenAddress: PromiseOrValue, - _amount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _destTokenAddress: PromiseOrValue, - _amountOfSynth: PromiseOrValue, - _expectedAmountOfSUSDFromSwap: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rescueFunds( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - swapInto( - _destSynthCurrencyKey: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - swapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _sourceAmount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapInto( - _destSynthCurrencyKey: PromiseOrValue, - _sourceTokenAddress: PromiseOrValue, - _amount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _destTokenAddress: PromiseOrValue, - _amountOfSynth: PromiseOrValue, - _expectedAmountOfSUSDFromSwap: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - acceptOwnership(overrides?: CallOverrides): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rescueFunds( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - swapInto( - _destSynthCurrencyKey: PromiseOrValue, - _data: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - swapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _sourceAmount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - uniswapSwapInto( - _destSynthCurrencyKey: PromiseOrValue, - _sourceTokenAddress: PromiseOrValue, - _amount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - uniswapSwapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _destTokenAddress: PromiseOrValue, - _amountOfSynth: PromiseOrValue, - _expectedAmountOfSUSDFromSwap: PromiseOrValue, - _data: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - - 'Received(address,uint256)'(from?: null, amountReceived?: null): ReceivedEventFilter - Received(from?: null, amountReceived?: null): ReceivedEventFilter - - 'SwapInto(address,uint256)'( - from?: PromiseOrValue | null, - amountReceived?: null - ): SwapIntoEventFilter - SwapInto(from?: PromiseOrValue | null, amountReceived?: null): SwapIntoEventFilter - - 'SwapOutOf(address,uint256)'( - from?: PromiseOrValue | null, - amountReceived?: null - ): SwapOutOfEventFilter - SwapOutOf(from?: PromiseOrValue | null, amountReceived?: null): SwapOutOfEventFilter - } - - estimateGas: { - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rescueFunds( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - swapInto( - _destSynthCurrencyKey: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - swapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _sourceAmount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapInto( - _destSynthCurrencyKey: PromiseOrValue, - _sourceTokenAddress: PromiseOrValue, - _amount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _destTokenAddress: PromiseOrValue, - _amountOfSynth: PromiseOrValue, - _expectedAmountOfSUSDFromSwap: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - populateTransaction: { - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - rescueFunds( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - swapInto( - _destSynthCurrencyKey: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - swapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _sourceAmount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapInto( - _destSynthCurrencyKey: PromiseOrValue, - _sourceTokenAddress: PromiseOrValue, - _amount: PromiseOrValue, - _data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise - - uniswapSwapOutOf( - _sourceSynthCurrencyKey: PromiseOrValue, - _destTokenAddress: PromiseOrValue, - _amountOfSynth: PromiseOrValue, - _expectedAmountOfSUSDFromSwap: PromiseOrValue, - _data: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SynthSwapInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + rescueFunds( + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + swapInto( + _destSynthCurrencyKey: BytesLike, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + swapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _sourceAmount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapSwapInto( + _destSynthCurrencyKey: BytesLike, + _sourceTokenAddress: string, + _amount: BigNumberish, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + uniswapSwapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _destTokenAddress: string, + _amountOfSynth: BigNumberish, + _expectedAmountOfSUSDFromSwap: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rescueFunds( + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + swapInto( + _destSynthCurrencyKey: BytesLike, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + swapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _sourceAmount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapSwapInto( + _destSynthCurrencyKey: BytesLike, + _sourceTokenAddress: string, + _amount: BigNumberish, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + uniswapSwapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _destTokenAddress: string, + _amountOfSynth: BigNumberish, + _expectedAmountOfSUSDFromSwap: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rescueFunds( + token: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + swapInto( + _destSynthCurrencyKey: BytesLike, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + swapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _sourceAmount: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + uniswapSwapInto( + _destSynthCurrencyKey: BytesLike, + _sourceTokenAddress: string, + _amount: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + uniswapSwapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _destTokenAddress: string, + _amountOfSynth: BigNumberish, + _expectedAmountOfSUSDFromSwap: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "Received(address,uint256)"( + from?: null, + amountReceived?: null + ): ReceivedEventFilter; + Received(from?: null, amountReceived?: null): ReceivedEventFilter; + + "SwapInto(address,uint256)"( + from?: string | null, + amountReceived?: null + ): SwapIntoEventFilter; + SwapInto(from?: string | null, amountReceived?: null): SwapIntoEventFilter; + + "SwapOutOf(address,uint256)"( + from?: string | null, + amountReceived?: null + ): SwapOutOfEventFilter; + SwapOutOf( + from?: string | null, + amountReceived?: null + ): SwapOutOfEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rescueFunds( + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + swapInto( + _destSynthCurrencyKey: BytesLike, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + swapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _sourceAmount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapSwapInto( + _destSynthCurrencyKey: BytesLike, + _sourceTokenAddress: string, + _amount: BigNumberish, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + uniswapSwapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _destTokenAddress: string, + _amountOfSynth: BigNumberish, + _expectedAmountOfSUSDFromSwap: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + rescueFunds( + token: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + swapInto( + _destSynthCurrencyKey: BytesLike, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + swapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _sourceAmount: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + uniswapSwapInto( + _destSynthCurrencyKey: BytesLike, + _sourceTokenAddress: string, + _amount: BigNumberish, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + uniswapSwapOutOf( + _sourceSynthCurrencyKey: BytesLike, + _destTokenAddress: string, + _amountOfSynth: BigNumberish, + _expectedAmountOfSUSDFromSwap: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SynthUtil.ts b/packages/sdk/src/contracts/types/SynthUtil.ts index dba21472ea..d6d203a2d6 100644 --- a/packages/sdk/src/contracts/types/SynthUtil.ts +++ b/packages/sdk/src/contracts/types/SynthUtil.ts @@ -2,167 +2,214 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BytesLike, - CallOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SynthUtilInterface extends utils.Interface { - functions: { - 'addressResolverProxy()': FunctionFragment - 'synthsBalances(address)': FunctionFragment - 'synthsRates()': FunctionFragment - 'synthsTotalSupplies()': FunctionFragment - 'totalSynthsInKey(address,bytes32)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'addressResolverProxy' - | 'synthsBalances' - | 'synthsRates' - | 'synthsTotalSupplies' - | 'totalSynthsInKey' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'addressResolverProxy', values?: undefined): string - encodeFunctionData(functionFragment: 'synthsBalances', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'synthsRates', values?: undefined): string - encodeFunctionData(functionFragment: 'synthsTotalSupplies', values?: undefined): string - encodeFunctionData( - functionFragment: 'totalSynthsInKey', - values: [PromiseOrValue, PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'addressResolverProxy', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synthsBalances', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synthsRates', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synthsTotalSupplies', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalSynthsInKey', data: BytesLike): Result - - events: {} + functions: { + "addressResolverProxy()": FunctionFragment; + "synthsBalances(address)": FunctionFragment; + "synthsRates()": FunctionFragment; + "synthsTotalSupplies()": FunctionFragment; + "totalSynthsInKey(address,bytes32)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "addressResolverProxy" + | "synthsBalances" + | "synthsRates" + | "synthsTotalSupplies" + | "totalSynthsInKey" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "addressResolverProxy", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "synthsBalances", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "synthsRates", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "synthsTotalSupplies", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalSynthsInKey", + values: [string, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "addressResolverProxy", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthsBalances", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthsRates", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthsTotalSupplies", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSynthsInKey", + data: BytesLike + ): Result; + + events: {}; } export interface SynthUtil extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SynthUtilInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - addressResolverProxy(overrides?: CallOverrides): Promise<[string]> - - synthsBalances( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string[], BigNumber[], BigNumber[]]> - - synthsRates(overrides?: CallOverrides): Promise<[string[], BigNumber[]]> - - synthsTotalSupplies(overrides?: CallOverrides): Promise<[string[], BigNumber[], BigNumber[]]> - - totalSynthsInKey( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { total: BigNumber }> - } - - addressResolverProxy(overrides?: CallOverrides): Promise - - synthsBalances( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string[], BigNumber[], BigNumber[]]> - - synthsRates(overrides?: CallOverrides): Promise<[string[], BigNumber[]]> - - synthsTotalSupplies(overrides?: CallOverrides): Promise<[string[], BigNumber[], BigNumber[]]> - - totalSynthsInKey( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - callStatic: { - addressResolverProxy(overrides?: CallOverrides): Promise - - synthsBalances( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string[], BigNumber[], BigNumber[]]> - - synthsRates(overrides?: CallOverrides): Promise<[string[], BigNumber[]]> - - synthsTotalSupplies(overrides?: CallOverrides): Promise<[string[], BigNumber[], BigNumber[]]> - - totalSynthsInKey( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: {} - - estimateGas: { - addressResolverProxy(overrides?: CallOverrides): Promise - - synthsBalances(account: PromiseOrValue, overrides?: CallOverrides): Promise - - synthsRates(overrides?: CallOverrides): Promise - - synthsTotalSupplies(overrides?: CallOverrides): Promise - - totalSynthsInKey( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - populateTransaction: { - addressResolverProxy(overrides?: CallOverrides): Promise - - synthsBalances( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - synthsRates(overrides?: CallOverrides): Promise - - synthsTotalSupplies(overrides?: CallOverrides): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SynthUtilInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + addressResolverProxy(overrides?: CallOverrides): Promise<[string]>; + + synthsBalances( + account: string, + overrides?: CallOverrides + ): Promise<[string[], BigNumber[], BigNumber[]]>; + + synthsRates(overrides?: CallOverrides): Promise<[string[], BigNumber[]]>; + + synthsTotalSupplies( + overrides?: CallOverrides + ): Promise<[string[], BigNumber[], BigNumber[]]>; + + totalSynthsInKey( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber] & { total: BigNumber }>; + }; + + addressResolverProxy(overrides?: CallOverrides): Promise; + + synthsBalances( + account: string, + overrides?: CallOverrides + ): Promise<[string[], BigNumber[], BigNumber[]]>; + + synthsRates(overrides?: CallOverrides): Promise<[string[], BigNumber[]]>; + + synthsTotalSupplies( + overrides?: CallOverrides + ): Promise<[string[], BigNumber[], BigNumber[]]>; + + totalSynthsInKey( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + callStatic: { + addressResolverProxy(overrides?: CallOverrides): Promise; + + synthsBalances( + account: string, + overrides?: CallOverrides + ): Promise<[string[], BigNumber[], BigNumber[]]>; + + synthsRates(overrides?: CallOverrides): Promise<[string[], BigNumber[]]>; + + synthsTotalSupplies( + overrides?: CallOverrides + ): Promise<[string[], BigNumber[], BigNumber[]]>; + + totalSynthsInKey( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: {}; + + estimateGas: { + addressResolverProxy(overrides?: CallOverrides): Promise; + + synthsBalances( + account: string, + overrides?: CallOverrides + ): Promise; + + synthsRates(overrides?: CallOverrides): Promise; + + synthsTotalSupplies(overrides?: CallOverrides): Promise; + + totalSynthsInKey( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + addressResolverProxy( + overrides?: CallOverrides + ): Promise; + + synthsBalances( + account: string, + overrides?: CallOverrides + ): Promise; + + synthsRates(overrides?: CallOverrides): Promise; + + synthsTotalSupplies( + overrides?: CallOverrides + ): Promise; - totalSynthsInKey( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + totalSynthsInKey( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/Synthetix.ts b/packages/sdk/src/contracts/types/Synthetix.ts index 20b7d4bb27..72faf56063 100644 --- a/packages/sdk/src/contracts/types/Synthetix.ts +++ b/packages/sdk/src/contracts/types/Synthetix.ts @@ -2,2522 +2,2774 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SynthetixInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'DECIMALS()': FunctionFragment - 'TOKEN_NAME()': FunctionFragment - 'TOKEN_SYMBOL()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'allowance(address,address)': FunctionFragment - 'anySynthOrSNXRateIsInvalid()': FunctionFragment - 'approve(address,uint256)': FunctionFragment - 'availableCurrencyKeys()': FunctionFragment - 'availableSynthCount()': FunctionFragment - 'availableSynths(uint256)': FunctionFragment - 'balanceOf(address)': FunctionFragment - 'burnSecondary(address,uint256)': FunctionFragment - 'burnSynths(uint256)': FunctionFragment - 'burnSynthsOnBehalf(address,uint256)': FunctionFragment - 'burnSynthsToTarget()': FunctionFragment - 'burnSynthsToTargetOnBehalf(address)': FunctionFragment - 'collateral(address)': FunctionFragment - 'collateralisationRatio(address)': FunctionFragment - 'debtBalanceOf(address,bytes32)': FunctionFragment - 'decimals()': FunctionFragment - 'emitAtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)': FunctionFragment - 'emitExchangeRebate(address,bytes32,uint256)': FunctionFragment - 'emitExchangeReclaim(address,bytes32,uint256)': FunctionFragment - 'emitExchangeTracking(bytes32,bytes32,uint256,uint256)': FunctionFragment - 'emitSynthExchange(address,bytes32,uint256,bytes32,uint256,address)': FunctionFragment - 'exchange(bytes32,uint256,bytes32)': FunctionFragment - 'exchangeAtomically(bytes32,uint256,bytes32,bytes32,uint256)': FunctionFragment - 'exchangeOnBehalf(address,bytes32,uint256,bytes32)': FunctionFragment - 'exchangeOnBehalfWithTracking(address,bytes32,uint256,bytes32,address,bytes32)': FunctionFragment - 'exchangeWithTracking(bytes32,uint256,bytes32,address,bytes32)': FunctionFragment - 'exchangeWithTrackingForInitiator(bytes32,uint256,bytes32,address,bytes32)': FunctionFragment - 'exchangeWithVirtual(bytes32,uint256,bytes32,bytes32)': FunctionFragment - 'getFirstNonZeroEscrowIndex(address)': FunctionFragment - 'isResolverCached()': FunctionFragment - 'isWaitingPeriod(bytes32)': FunctionFragment - 'issueMaxSynths()': FunctionFragment - 'issueMaxSynthsOnBehalf(address)': FunctionFragment - 'issueSynths(uint256)': FunctionFragment - 'issueSynthsOnBehalf(address,uint256)': FunctionFragment - 'liquidateDelinquentAccount(address)': FunctionFragment - 'liquidateDelinquentAccountEscrowIndex(address,uint256)': FunctionFragment - 'liquidateSelf()': FunctionFragment - 'maxIssuableSynths(address)': FunctionFragment - 'messageSender()': FunctionFragment - 'migrateEscrowBalanceToRewardEscrowV2()': FunctionFragment - 'migrateEscrowContractBalance()': FunctionFragment - 'mint()': FunctionFragment - 'mintSecondary(address,uint256)': FunctionFragment - 'mintSecondaryRewards(uint256)': FunctionFragment - 'name()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'proxy()': FunctionFragment - 'rebuildCache()': FunctionFragment - 'remainingIssuableSynths(address)': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'sUSD()': FunctionFragment - 'setMessageSender(address)': FunctionFragment - 'setProxy(address)': FunctionFragment - 'setTokenState(address)': FunctionFragment - 'settle(bytes32)': FunctionFragment - 'symbol()': FunctionFragment - 'synths(bytes32)': FunctionFragment - 'synthsByAddress(address)': FunctionFragment - 'tokenState()': FunctionFragment - 'totalIssuedSynths(bytes32)': FunctionFragment - 'totalIssuedSynthsExcludeOtherCollateral(bytes32)': FunctionFragment - 'totalSupply()': FunctionFragment - 'transfer(address,uint256)': FunctionFragment - 'transferFrom(address,address,uint256)': FunctionFragment - 'transferableSynthetix(address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'DECIMALS' - | 'TOKEN_NAME' - | 'TOKEN_SYMBOL' - | 'acceptOwnership' - | 'allowance' - | 'anySynthOrSNXRateIsInvalid' - | 'approve' - | 'availableCurrencyKeys' - | 'availableSynthCount' - | 'availableSynths' - | 'balanceOf' - | 'burnSecondary' - | 'burnSynths' - | 'burnSynthsOnBehalf' - | 'burnSynthsToTarget' - | 'burnSynthsToTargetOnBehalf' - | 'collateral' - | 'collateralisationRatio' - | 'debtBalanceOf' - | 'decimals' - | 'emitAtomicSynthExchange' - | 'emitExchangeRebate' - | 'emitExchangeReclaim' - | 'emitExchangeTracking' - | 'emitSynthExchange' - | 'exchange' - | 'exchangeAtomically' - | 'exchangeOnBehalf' - | 'exchangeOnBehalfWithTracking' - | 'exchangeWithTracking' - | 'exchangeWithTrackingForInitiator' - | 'exchangeWithVirtual' - | 'getFirstNonZeroEscrowIndex' - | 'isResolverCached' - | 'isWaitingPeriod' - | 'issueMaxSynths' - | 'issueMaxSynthsOnBehalf' - | 'issueSynths' - | 'issueSynthsOnBehalf' - | 'liquidateDelinquentAccount' - | 'liquidateDelinquentAccountEscrowIndex' - | 'liquidateSelf' - | 'maxIssuableSynths' - | 'messageSender' - | 'migrateEscrowBalanceToRewardEscrowV2' - | 'migrateEscrowContractBalance' - | 'mint' - | 'mintSecondary' - | 'mintSecondaryRewards' - | 'name' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'proxy' - | 'rebuildCache' - | 'remainingIssuableSynths' - | 'resolver' - | 'resolverAddressesRequired' - | 'sUSD' - | 'setMessageSender' - | 'setProxy' - | 'setTokenState' - | 'settle' - | 'symbol' - | 'synths' - | 'synthsByAddress' - | 'tokenState' - | 'totalIssuedSynths' - | 'totalIssuedSynthsExcludeOtherCollateral' - | 'totalSupply' - | 'transfer' - | 'transferFrom' - | 'transferableSynthetix' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'DECIMALS', values?: undefined): string - encodeFunctionData(functionFragment: 'TOKEN_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'TOKEN_SYMBOL', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'allowance', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'anySynthOrSNXRateIsInvalid', values?: undefined): string - encodeFunctionData( - functionFragment: 'approve', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'availableCurrencyKeys', values?: undefined): string - encodeFunctionData(functionFragment: 'availableSynthCount', values?: undefined): string - encodeFunctionData( - functionFragment: 'availableSynths', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'burnSecondary', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'burnSynths', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'burnSynthsOnBehalf', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'burnSynthsToTarget', values?: undefined): string - encodeFunctionData( - functionFragment: 'burnSynthsToTargetOnBehalf', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'collateral', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'collateralisationRatio', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'debtBalanceOf', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'decimals', values?: undefined): string - encodeFunctionData( - functionFragment: 'emitAtomicSynthExchange', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'emitExchangeRebate', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'emitExchangeReclaim', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'emitExchangeTracking', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'emitSynthExchange', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'exchange', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'exchangeAtomically', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'exchangeOnBehalf', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'exchangeOnBehalfWithTracking', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'exchangeWithTracking', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'exchangeWithTrackingForInitiator', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'exchangeWithVirtual', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'getFirstNonZeroEscrowIndex', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData( - functionFragment: 'isWaitingPeriod', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'issueMaxSynths', values?: undefined): string - encodeFunctionData( - functionFragment: 'issueMaxSynthsOnBehalf', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'issueSynths', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'issueSynthsOnBehalf', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'liquidateDelinquentAccount', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'liquidateDelinquentAccountEscrowIndex', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'liquidateSelf', values?: undefined): string - encodeFunctionData( - functionFragment: 'maxIssuableSynths', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'messageSender', values?: undefined): string - encodeFunctionData( - functionFragment: 'migrateEscrowBalanceToRewardEscrowV2', - values?: undefined - ): string - encodeFunctionData(functionFragment: 'migrateEscrowContractBalance', values?: undefined): string - encodeFunctionData(functionFragment: 'mint', values?: undefined): string - encodeFunctionData( - functionFragment: 'mintSecondary', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'mintSecondaryRewards', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'name', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'proxy', values?: undefined): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData( - functionFragment: 'remainingIssuableSynths', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData(functionFragment: 'sUSD', values?: undefined): string - encodeFunctionData(functionFragment: 'setMessageSender', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'setProxy', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'setTokenState', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'settle', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'symbol', values?: undefined): string - encodeFunctionData(functionFragment: 'synths', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'synthsByAddress', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'tokenState', values?: undefined): string - encodeFunctionData( - functionFragment: 'totalIssuedSynths', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'totalIssuedSynthsExcludeOtherCollateral', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string - encodeFunctionData( - functionFragment: 'transfer', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferFrom', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'transferableSynthetix', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'DECIMALS', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'TOKEN_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'TOKEN_SYMBOL', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'anySynthOrSNXRateIsInvalid', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'availableCurrencyKeys', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'availableSynthCount', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'availableSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'burnSecondary', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'burnSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'burnSynthsOnBehalf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'burnSynthsToTarget', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'burnSynthsToTargetOnBehalf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'collateral', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'collateralisationRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'debtBalanceOf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'emitAtomicSynthExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'emitExchangeRebate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'emitExchangeReclaim', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'emitExchangeTracking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'emitSynthExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeAtomically', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeOnBehalf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeOnBehalfWithTracking', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeWithTracking', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'exchangeWithTrackingForInitiator', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'exchangeWithVirtual', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getFirstNonZeroEscrowIndex', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isWaitingPeriod', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'issueMaxSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'issueMaxSynthsOnBehalf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'issueSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'issueSynthsOnBehalf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidateDelinquentAccount', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'liquidateDelinquentAccountEscrowIndex', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'liquidateSelf', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'maxIssuableSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'messageSender', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'migrateEscrowBalanceToRewardEscrowV2', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'migrateEscrowContractBalance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'mintSecondary', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'mintSecondaryRewards', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'proxy', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'remainingIssuableSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'sUSD', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMessageSender', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setProxy', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTokenState', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'settle', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synthsByAddress', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'tokenState', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'totalIssuedSynths', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'totalIssuedSynthsExcludeOtherCollateral', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'transferableSynthetix', data: BytesLike): Result - - events: { - 'AccountLiquidated(address,uint256,uint256,address)': EventFragment - 'Approval(address,address,uint256)': EventFragment - 'AtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)': EventFragment - 'CacheUpdated(bytes32,address)': EventFragment - 'ExchangeRebate(address,bytes32,uint256)': EventFragment - 'ExchangeReclaim(address,bytes32,uint256)': EventFragment - 'ExchangeTracking(bytes32,bytes32,uint256,uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'ProxyUpdated(address)': EventFragment - 'SynthExchange(address,bytes32,uint256,bytes32,uint256,address)': EventFragment - 'TokenStateUpdated(address)': EventFragment - 'Transfer(address,address,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'AccountLiquidated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AtomicSynthExchange'): EventFragment - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeRebate'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeReclaim'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeTracking'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ProxyUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SynthExchange'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TokenStateUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "DECIMALS()": FunctionFragment; + "TOKEN_NAME()": FunctionFragment; + "TOKEN_SYMBOL()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "allowance(address,address)": FunctionFragment; + "anySynthOrSNXRateIsInvalid()": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "availableCurrencyKeys()": FunctionFragment; + "availableSynthCount()": FunctionFragment; + "availableSynths(uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "burnSecondary(address,uint256)": FunctionFragment; + "burnSynths(uint256)": FunctionFragment; + "burnSynthsOnBehalf(address,uint256)": FunctionFragment; + "burnSynthsToTarget()": FunctionFragment; + "burnSynthsToTargetOnBehalf(address)": FunctionFragment; + "collateral(address)": FunctionFragment; + "collateralisationRatio(address)": FunctionFragment; + "debtBalanceOf(address,bytes32)": FunctionFragment; + "decimals()": FunctionFragment; + "emitAtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)": FunctionFragment; + "emitExchangeRebate(address,bytes32,uint256)": FunctionFragment; + "emitExchangeReclaim(address,bytes32,uint256)": FunctionFragment; + "emitExchangeTracking(bytes32,bytes32,uint256,uint256)": FunctionFragment; + "emitSynthExchange(address,bytes32,uint256,bytes32,uint256,address)": FunctionFragment; + "exchange(bytes32,uint256,bytes32)": FunctionFragment; + "exchangeAtomically(bytes32,uint256,bytes32,bytes32,uint256)": FunctionFragment; + "exchangeOnBehalf(address,bytes32,uint256,bytes32)": FunctionFragment; + "exchangeOnBehalfWithTracking(address,bytes32,uint256,bytes32,address,bytes32)": FunctionFragment; + "exchangeWithTracking(bytes32,uint256,bytes32,address,bytes32)": FunctionFragment; + "exchangeWithTrackingForInitiator(bytes32,uint256,bytes32,address,bytes32)": FunctionFragment; + "exchangeWithVirtual(bytes32,uint256,bytes32,bytes32)": FunctionFragment; + "getFirstNonZeroEscrowIndex(address)": FunctionFragment; + "isResolverCached()": FunctionFragment; + "isWaitingPeriod(bytes32)": FunctionFragment; + "issueMaxSynths()": FunctionFragment; + "issueMaxSynthsOnBehalf(address)": FunctionFragment; + "issueSynths(uint256)": FunctionFragment; + "issueSynthsOnBehalf(address,uint256)": FunctionFragment; + "liquidateDelinquentAccount(address)": FunctionFragment; + "liquidateDelinquentAccountEscrowIndex(address,uint256)": FunctionFragment; + "liquidateSelf()": FunctionFragment; + "maxIssuableSynths(address)": FunctionFragment; + "messageSender()": FunctionFragment; + "migrateEscrowBalanceToRewardEscrowV2()": FunctionFragment; + "migrateEscrowContractBalance()": FunctionFragment; + "mint()": FunctionFragment; + "mintSecondary(address,uint256)": FunctionFragment; + "mintSecondaryRewards(uint256)": FunctionFragment; + "name()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "proxy()": FunctionFragment; + "rebuildCache()": FunctionFragment; + "remainingIssuableSynths(address)": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "sUSD()": FunctionFragment; + "setMessageSender(address)": FunctionFragment; + "setProxy(address)": FunctionFragment; + "setTokenState(address)": FunctionFragment; + "settle(bytes32)": FunctionFragment; + "symbol()": FunctionFragment; + "synths(bytes32)": FunctionFragment; + "synthsByAddress(address)": FunctionFragment; + "tokenState()": FunctionFragment; + "totalIssuedSynths(bytes32)": FunctionFragment; + "totalIssuedSynthsExcludeOtherCollateral(bytes32)": FunctionFragment; + "totalSupply()": FunctionFragment; + "transfer(address,uint256)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "transferableSynthetix(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "DECIMALS" + | "TOKEN_NAME" + | "TOKEN_SYMBOL" + | "acceptOwnership" + | "allowance" + | "anySynthOrSNXRateIsInvalid" + | "approve" + | "availableCurrencyKeys" + | "availableSynthCount" + | "availableSynths" + | "balanceOf" + | "burnSecondary" + | "burnSynths" + | "burnSynthsOnBehalf" + | "burnSynthsToTarget" + | "burnSynthsToTargetOnBehalf" + | "collateral" + | "collateralisationRatio" + | "debtBalanceOf" + | "decimals" + | "emitAtomicSynthExchange" + | "emitExchangeRebate" + | "emitExchangeReclaim" + | "emitExchangeTracking" + | "emitSynthExchange" + | "exchange" + | "exchangeAtomically" + | "exchangeOnBehalf" + | "exchangeOnBehalfWithTracking" + | "exchangeWithTracking" + | "exchangeWithTrackingForInitiator" + | "exchangeWithVirtual" + | "getFirstNonZeroEscrowIndex" + | "isResolverCached" + | "isWaitingPeriod" + | "issueMaxSynths" + | "issueMaxSynthsOnBehalf" + | "issueSynths" + | "issueSynthsOnBehalf" + | "liquidateDelinquentAccount" + | "liquidateDelinquentAccountEscrowIndex" + | "liquidateSelf" + | "maxIssuableSynths" + | "messageSender" + | "migrateEscrowBalanceToRewardEscrowV2" + | "migrateEscrowContractBalance" + | "mint" + | "mintSecondary" + | "mintSecondaryRewards" + | "name" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "proxy" + | "rebuildCache" + | "remainingIssuableSynths" + | "resolver" + | "resolverAddressesRequired" + | "sUSD" + | "setMessageSender" + | "setProxy" + | "setTokenState" + | "settle" + | "symbol" + | "synths" + | "synthsByAddress" + | "tokenState" + | "totalIssuedSynths" + | "totalIssuedSynthsExcludeOtherCollateral" + | "totalSupply" + | "transfer" + | "transferFrom" + | "transferableSynthetix" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "DECIMALS", values?: undefined): string; + encodeFunctionData( + functionFragment: "TOKEN_NAME", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "TOKEN_SYMBOL", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "anySynthOrSNXRateIsInvalid", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "availableCurrencyKeys", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "availableSynthCount", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "availableSynths", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "burnSecondary", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "burnSynths", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "burnSynthsOnBehalf", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "burnSynthsToTarget", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "burnSynthsToTargetOnBehalf", + values: [string] + ): string; + encodeFunctionData(functionFragment: "collateral", values: [string]): string; + encodeFunctionData( + functionFragment: "collateralisationRatio", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "debtBalanceOf", + values: [string, BytesLike] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "emitAtomicSynthExchange", + values: [string, BytesLike, BigNumberish, BytesLike, BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "emitExchangeRebate", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "emitExchangeReclaim", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "emitExchangeTracking", + values: [BytesLike, BytesLike, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "emitSynthExchange", + values: [string, BytesLike, BigNumberish, BytesLike, BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "exchange", + values: [BytesLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "exchangeAtomically", + values: [BytesLike, BigNumberish, BytesLike, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "exchangeOnBehalf", + values: [string, BytesLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "exchangeOnBehalfWithTracking", + values: [string, BytesLike, BigNumberish, BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "exchangeWithTracking", + values: [BytesLike, BigNumberish, BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "exchangeWithTrackingForInitiator", + values: [BytesLike, BigNumberish, BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "exchangeWithVirtual", + values: [BytesLike, BigNumberish, BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getFirstNonZeroEscrowIndex", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isWaitingPeriod", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "issueMaxSynths", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "issueMaxSynthsOnBehalf", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "issueSynths", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "issueSynthsOnBehalf", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "liquidateDelinquentAccount", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "liquidateDelinquentAccountEscrowIndex", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "liquidateSelf", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "maxIssuableSynths", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "messageSender", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "migrateEscrowBalanceToRewardEscrowV2", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "migrateEscrowContractBalance", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "mint", values?: undefined): string; + encodeFunctionData( + functionFragment: "mintSecondary", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "mintSecondaryRewards", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "proxy", values?: undefined): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "remainingIssuableSynths", + values: [string] + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "sUSD", values?: undefined): string; + encodeFunctionData( + functionFragment: "setMessageSender", + values: [string] + ): string; + encodeFunctionData(functionFragment: "setProxy", values: [string]): string; + encodeFunctionData( + functionFragment: "setTokenState", + values: [string] + ): string; + encodeFunctionData(functionFragment: "settle", values: [BytesLike]): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData(functionFragment: "synths", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "synthsByAddress", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "tokenState", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalIssuedSynths", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "totalIssuedSynthsExcludeOtherCollateral", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferableSynthetix", + values: [string] + ): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "DECIMALS", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "TOKEN_NAME", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "TOKEN_SYMBOL", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "anySynthOrSNXRateIsInvalid", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "availableCurrencyKeys", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "availableSynthCount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "availableSynths", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "burnSecondary", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "burnSynths", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "burnSynthsOnBehalf", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "burnSynthsToTarget", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "burnSynthsToTargetOnBehalf", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "collateral", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "collateralisationRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "debtBalanceOf", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "emitAtomicSynthExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "emitExchangeRebate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "emitExchangeReclaim", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "emitExchangeTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "emitSynthExchange", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "exchange", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "exchangeAtomically", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeOnBehalf", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeOnBehalfWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeWithTrackingForInitiator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeWithVirtual", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFirstNonZeroEscrowIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isWaitingPeriod", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "issueMaxSynths", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "issueMaxSynthsOnBehalf", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "issueSynths", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "issueSynthsOnBehalf", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidateDelinquentAccount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidateDelinquentAccountEscrowIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidateSelf", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "maxIssuableSynths", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "messageSender", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "migrateEscrowBalanceToRewardEscrowV2", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "migrateEscrowContractBalance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "mintSecondary", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "mintSecondaryRewards", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "proxy", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "remainingIssuableSynths", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "sUSD", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMessageSender", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "setProxy", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setTokenState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "settle", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "synths", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "synthsByAddress", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "tokenState", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalIssuedSynths", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalIssuedSynthsExcludeOtherCollateral", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferableSynthetix", + data: BytesLike + ): Result; + + events: { + "AccountLiquidated(address,uint256,uint256,address)": EventFragment; + "Approval(address,address,uint256)": EventFragment; + "AtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)": EventFragment; + "CacheUpdated(bytes32,address)": EventFragment; + "ExchangeRebate(address,bytes32,uint256)": EventFragment; + "ExchangeReclaim(address,bytes32,uint256)": EventFragment; + "ExchangeTracking(bytes32,bytes32,uint256,uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "ProxyUpdated(address)": EventFragment; + "SynthExchange(address,bytes32,uint256,bytes32,uint256,address)": EventFragment; + "TokenStateUpdated(address)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AccountLiquidated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "AtomicSynthExchange"): EventFragment; + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeRebate"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeReclaim"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeTracking"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ProxyUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthExchange"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TokenStateUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; } export interface AccountLiquidatedEventObject { - account: string - snxRedeemed: BigNumber - amountLiquidated: BigNumber - liquidator: string + account: string; + snxRedeemed: BigNumber; + amountLiquidated: BigNumber; + liquidator: string; } export type AccountLiquidatedEvent = TypedEvent< - [string, BigNumber, BigNumber, string], - AccountLiquidatedEventObject -> + [string, BigNumber, BigNumber, string], + AccountLiquidatedEventObject +>; -export type AccountLiquidatedEventFilter = TypedEventFilter +export type AccountLiquidatedEventFilter = + TypedEventFilter; export interface ApprovalEventObject { - owner: string - spender: string - value: BigNumber + owner: string; + spender: string; + value: BigNumber; } -export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject> +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; -export type ApprovalEventFilter = TypedEventFilter +export type ApprovalEventFilter = TypedEventFilter; export interface AtomicSynthExchangeEventObject { - account: string - fromCurrencyKey: string - fromAmount: BigNumber - toCurrencyKey: string - toAmount: BigNumber - toAddress: string + account: string; + fromCurrencyKey: string; + fromAmount: BigNumber; + toCurrencyKey: string; + toAmount: BigNumber; + toAddress: string; } export type AtomicSynthExchangeEvent = TypedEvent< - [string, string, BigNumber, string, BigNumber, string], - AtomicSynthExchangeEventObject -> + [string, string, BigNumber, string, BigNumber, string], + AtomicSynthExchangeEventObject +>; -export type AtomicSynthExchangeEventFilter = TypedEventFilter +export type AtomicSynthExchangeEventFilter = + TypedEventFilter; export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface ExchangeRebateEventObject { - account: string - currencyKey: string - amount: BigNumber + account: string; + currencyKey: string; + amount: BigNumber; } -export type ExchangeRebateEvent = TypedEvent<[string, string, BigNumber], ExchangeRebateEventObject> +export type ExchangeRebateEvent = TypedEvent< + [string, string, BigNumber], + ExchangeRebateEventObject +>; -export type ExchangeRebateEventFilter = TypedEventFilter +export type ExchangeRebateEventFilter = TypedEventFilter; export interface ExchangeReclaimEventObject { - account: string - currencyKey: string - amount: BigNumber + account: string; + currencyKey: string; + amount: BigNumber; } export type ExchangeReclaimEvent = TypedEvent< - [string, string, BigNumber], - ExchangeReclaimEventObject -> + [string, string, BigNumber], + ExchangeReclaimEventObject +>; -export type ExchangeReclaimEventFilter = TypedEventFilter +export type ExchangeReclaimEventFilter = TypedEventFilter; export interface ExchangeTrackingEventObject { - trackingCode: string - toCurrencyKey: string - toAmount: BigNumber - fee: BigNumber + trackingCode: string; + toCurrencyKey: string; + toAmount: BigNumber; + fee: BigNumber; } export type ExchangeTrackingEvent = TypedEvent< - [string, string, BigNumber, BigNumber], - ExchangeTrackingEventObject -> + [string, string, BigNumber, BigNumber], + ExchangeTrackingEventObject +>; -export type ExchangeTrackingEventFilter = TypedEventFilter +export type ExchangeTrackingEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface ProxyUpdatedEventObject { - proxyAddress: string + proxyAddress: string; } -export type ProxyUpdatedEvent = TypedEvent<[string], ProxyUpdatedEventObject> +export type ProxyUpdatedEvent = TypedEvent<[string], ProxyUpdatedEventObject>; -export type ProxyUpdatedEventFilter = TypedEventFilter +export type ProxyUpdatedEventFilter = TypedEventFilter; export interface SynthExchangeEventObject { - account: string - fromCurrencyKey: string - fromAmount: BigNumber - toCurrencyKey: string - toAmount: BigNumber - toAddress: string + account: string; + fromCurrencyKey: string; + fromAmount: BigNumber; + toCurrencyKey: string; + toAmount: BigNumber; + toAddress: string; } export type SynthExchangeEvent = TypedEvent< - [string, string, BigNumber, string, BigNumber, string], - SynthExchangeEventObject -> + [string, string, BigNumber, string, BigNumber, string], + SynthExchangeEventObject +>; -export type SynthExchangeEventFilter = TypedEventFilter +export type SynthExchangeEventFilter = TypedEventFilter; export interface TokenStateUpdatedEventObject { - newTokenState: string + newTokenState: string; } -export type TokenStateUpdatedEvent = TypedEvent<[string], TokenStateUpdatedEventObject> +export type TokenStateUpdatedEvent = TypedEvent< + [string], + TokenStateUpdatedEventObject +>; -export type TokenStateUpdatedEventFilter = TypedEventFilter +export type TokenStateUpdatedEventFilter = + TypedEventFilter; export interface TransferEventObject { - from: string - to: string - value: BigNumber + from: string; + to: string; + value: BigNumber; } -export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject> +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; -export type TransferEventFilter = TypedEventFilter +export type TransferEventFilter = TypedEventFilter; export interface Synthetix extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SynthetixInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - DECIMALS(overrides?: CallOverrides): Promise<[number]> - - TOKEN_NAME(overrides?: CallOverrides): Promise<[string]> - - TOKEN_SYMBOL(overrides?: CallOverrides): Promise<[string]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - anySynthOrSNXRateIsInvalid( - overrides?: CallOverrides - ): Promise<[boolean] & { anyRateInvalid: boolean }> - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - availableCurrencyKeys(overrides?: CallOverrides): Promise<[string[]]> - - availableSynthCount(overrides?: CallOverrides): Promise<[BigNumber]> - - availableSynths( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]> - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - burnSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsOnBehalf( - burnForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTarget( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTargetOnBehalf( - burnForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - collateral(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]> - - collateralisationRatio( - _issuer: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - debtBalanceOf( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - decimals(overrides?: CallOverrides): Promise<[number]> - - emitAtomicSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeRebate( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeReclaim( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeTracking( - trackingCode: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - fee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchange( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - minAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalf( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalfWithTracking( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTracking( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTrackingForInitiator( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithVirtual( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getFirstNonZeroEscrowIndex( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - isWaitingPeriod( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - issueMaxSynths( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueMaxSynthsOnBehalf( - issueForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynthsOnBehalf( - issueForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccount( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccountEscrowIndex( - account: PromiseOrValue, - escrowStartIndex: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateSelf( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - maxIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { maxIssuable: BigNumber }> - - messageSender(overrides?: CallOverrides): Promise<[string]> - - migrateEscrowBalanceToRewardEscrowV2( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - migrateEscrowContractBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - mintSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mintSecondaryRewards( - arg0: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - name(overrides?: CallOverrides): Promise<[string]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - proxy(overrides?: CallOverrides): Promise<[string]> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - maxIssuable: BigNumber - alreadyIssued: BigNumber - totalSystemDebt: BigNumber - } - > - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - sUSD(overrides?: CallOverrides): Promise<[string]> - - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - settle( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - symbol(overrides?: CallOverrides): Promise<[string]> - - synths(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise<[string]> - - synthsByAddress( - synthAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]> - - tokenState(overrides?: CallOverrides): Promise<[string]> - - totalIssuedSynths( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - totalIssuedSynthsExcludeOtherCollateral( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - totalSupply(overrides?: CallOverrides): Promise<[BigNumber]> - - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - transferableSynthetix( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber] & { transferable: BigNumber }> - } - - CONTRACT_NAME(overrides?: CallOverrides): Promise - - DECIMALS(overrides?: CallOverrides): Promise - - TOKEN_NAME(overrides?: CallOverrides): Promise - - TOKEN_SYMBOL(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - anySynthOrSNXRateIsInvalid(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - availableCurrencyKeys(overrides?: CallOverrides): Promise - - availableSynthCount(overrides?: CallOverrides): Promise - - availableSynths(index: PromiseOrValue, overrides?: CallOverrides): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - burnSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsOnBehalf( - burnForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTarget( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTargetOnBehalf( - burnForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - collateral(account: PromiseOrValue, overrides?: CallOverrides): Promise - - collateralisationRatio( - _issuer: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - debtBalanceOf( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - decimals(overrides?: CallOverrides): Promise - - emitAtomicSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeRebate( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeReclaim( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeTracking( - trackingCode: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - fee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchange( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - minAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalf( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalfWithTracking( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTracking( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTrackingForInitiator( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithVirtual( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getFirstNonZeroEscrowIndex( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isWaitingPeriod( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - issueMaxSynths( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueMaxSynthsOnBehalf( - issueForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynthsOnBehalf( - issueForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccount( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccountEscrowIndex( - account: PromiseOrValue, - escrowStartIndex: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateSelf( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - maxIssuableSynths(account: PromiseOrValue, overrides?: CallOverrides): Promise - - messageSender(overrides?: CallOverrides): Promise - - migrateEscrowBalanceToRewardEscrowV2( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - migrateEscrowContractBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - mintSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mintSecondaryRewards( - arg0: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - name(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - proxy(overrides?: CallOverrides): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - maxIssuable: BigNumber - alreadyIssued: BigNumber - totalSystemDebt: BigNumber - } - > - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - sUSD(overrides?: CallOverrides): Promise - - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - settle( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - symbol(overrides?: CallOverrides): Promise - - synths(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise - - synthsByAddress(synthAddress: PromiseOrValue, overrides?: CallOverrides): Promise - - tokenState(overrides?: CallOverrides): Promise - - totalIssuedSynths( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SynthetixInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; + + DECIMALS(overrides?: CallOverrides): Promise<[number]>; + + TOKEN_NAME(overrides?: CallOverrides): Promise<[string]>; + + TOKEN_SYMBOL(overrides?: CallOverrides): Promise<[string]>; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + anySynthOrSNXRateIsInvalid( + overrides?: CallOverrides + ): Promise<[boolean] & { anyRateInvalid: boolean }>; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + availableCurrencyKeys(overrides?: CallOverrides): Promise<[string[]]>; + + availableSynthCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + availableSynths( + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + burnSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsOnBehalf( + burnForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTarget( + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTargetOnBehalf( + burnForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + collateral( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + collateralisationRatio( + _issuer: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + debtBalanceOf( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + emitAtomicSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeRebate( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeReclaim( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeTracking( + trackingCode: BytesLike, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + fee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + exchange( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + minAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalf( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalfWithTracking( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTracking( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTrackingForInitiator( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithVirtual( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFirstNonZeroEscrowIndex( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; + + isWaitingPeriod( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + issueMaxSynths( + overrides?: Overrides & { from?: string } + ): Promise; + + issueMaxSynthsOnBehalf( + issueForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynthsOnBehalf( + issueForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccount( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccountEscrowIndex( + account: string, + escrowStartIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateSelf( + overrides?: Overrides & { from?: string } + ): Promise; + + maxIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { maxIssuable: BigNumber }>; + + messageSender(overrides?: CallOverrides): Promise<[string]>; + + migrateEscrowBalanceToRewardEscrowV2( + overrides?: Overrides & { from?: string } + ): Promise; + + migrateEscrowContractBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + mint( + overrides?: Overrides & { from?: string } + ): Promise; + + mintSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mintSecondaryRewards( + arg0: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + proxy(overrides?: CallOverrides): Promise<[string]>; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + maxIssuable: BigNumber; + alreadyIssued: BigNumber; + totalSystemDebt: BigNumber; + } + >; + + resolver(overrides?: CallOverrides): Promise<[string]>; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; + + sUSD(overrides?: CallOverrides): Promise<[string]>; + + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; + + settle( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + synths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[string]>; + + synthsByAddress( + synthAddress: string, + overrides?: CallOverrides + ): Promise<[string]>; - totalIssuedSynthsExcludeOtherCollateral( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + tokenState(overrides?: CallOverrides): Promise<[string]>; - totalSupply(overrides?: CallOverrides): Promise + totalIssuedSynths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + totalIssuedSynthsExcludeOtherCollateral( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferableSynthetix( + account: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { transferable: BigNumber }>; + }; + + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + DECIMALS(overrides?: CallOverrides): Promise; + + TOKEN_NAME(overrides?: CallOverrides): Promise; + + TOKEN_SYMBOL(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + anySynthOrSNXRateIsInvalid(overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + availableCurrencyKeys(overrides?: CallOverrides): Promise; + + availableSynthCount(overrides?: CallOverrides): Promise; + + availableSynths( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burnSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsOnBehalf( + burnForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTarget( + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTargetOnBehalf( + burnForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + collateral(account: string, overrides?: CallOverrides): Promise; + + collateralisationRatio( + _issuer: string, + overrides?: CallOverrides + ): Promise; + + debtBalanceOf( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + emitAtomicSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeRebate( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeReclaim( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeTracking( + trackingCode: BytesLike, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + fee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + exchange( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + minAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalf( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalfWithTracking( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTracking( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTrackingForInitiator( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithVirtual( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFirstNonZeroEscrowIndex( + account: string, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isWaitingPeriod( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + issueMaxSynths( + overrides?: Overrides & { from?: string } + ): Promise; + + issueMaxSynthsOnBehalf( + issueForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynthsOnBehalf( + issueForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccount( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccountEscrowIndex( + account: string, + escrowStartIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateSelf( + overrides?: Overrides & { from?: string } + ): Promise; + + maxIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + + messageSender(overrides?: CallOverrides): Promise; + + migrateEscrowBalanceToRewardEscrowV2( + overrides?: Overrides & { from?: string } + ): Promise; + + migrateEscrowContractBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + mint(overrides?: Overrides & { from?: string }): Promise; + + mintSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mintSecondaryRewards( + arg0: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + proxy(overrides?: CallOverrides): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - transferableSynthetix( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + remainingIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + maxIssuable: BigNumber; + alreadyIssued: BigNumber; + totalSystemDebt: BigNumber; + } + >; - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - DECIMALS(overrides?: CallOverrides): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - TOKEN_NAME(overrides?: CallOverrides): Promise + sUSD(overrides?: CallOverrides): Promise; - TOKEN_SYMBOL(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: CallOverrides): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - anySynthOrSNXRateIsInvalid(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - availableCurrencyKeys(overrides?: CallOverrides): Promise - - availableSynthCount(overrides?: CallOverrides): Promise - - availableSynths(index: PromiseOrValue, overrides?: CallOverrides): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - burnSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - burnSynths(amount: PromiseOrValue, overrides?: CallOverrides): Promise - - burnSynthsOnBehalf( - burnForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - burnSynthsToTarget(overrides?: CallOverrides): Promise - - burnSynthsToTargetOnBehalf( - burnForAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - collateral(account: PromiseOrValue, overrides?: CallOverrides): Promise - - collateralisationRatio( - _issuer: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - debtBalanceOf( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - decimals(overrides?: CallOverrides): Promise - - emitAtomicSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - emitExchangeRebate( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - emitExchangeReclaim( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - emitExchangeTracking( - trackingCode: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - fee: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - emitSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchange( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchangeAtomically( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - minAmount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchangeOnBehalf( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchangeOnBehalfWithTracking( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchangeWithTracking( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchangeWithTrackingForInitiator( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchangeWithVirtual( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber, string] & { amountReceived: BigNumber; vSynth: string }> - - getFirstNonZeroEscrowIndex( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isWaitingPeriod( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - issueMaxSynths(overrides?: CallOverrides): Promise - - issueMaxSynthsOnBehalf( - issueForAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - issueSynths(amount: PromiseOrValue, overrides?: CallOverrides): Promise - - issueSynthsOnBehalf( - issueForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidateDelinquentAccount( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidateDelinquentAccountEscrowIndex( - account: PromiseOrValue, - escrowStartIndex: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - liquidateSelf(overrides?: CallOverrides): Promise - - maxIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - messageSender(overrides?: CallOverrides): Promise - - migrateEscrowBalanceToRewardEscrowV2(overrides?: CallOverrides): Promise - - migrateEscrowContractBalance(overrides?: CallOverrides): Promise - - mint(overrides?: CallOverrides): Promise - - mintSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - mintSecondaryRewards( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - name(overrides?: CallOverrides): Promise - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - proxy(overrides?: CallOverrides): Promise - - rebuildCache(overrides?: CallOverrides): Promise - - remainingIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - maxIssuable: BigNumber - alreadyIssued: BigNumber - totalSystemDebt: BigNumber - } - > - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - sUSD(overrides?: CallOverrides): Promise - - setMessageSender(sender: PromiseOrValue, overrides?: CallOverrides): Promise - - setProxy(_proxy: PromiseOrValue, overrides?: CallOverrides): Promise - - setTokenState(_tokenState: PromiseOrValue, overrides?: CallOverrides): Promise - - settle( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise< - [BigNumber, BigNumber, BigNumber] & { - reclaimed: BigNumber - refunded: BigNumber - numEntriesSettled: BigNumber - } - > - - symbol(overrides?: CallOverrides): Promise - - synths(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise - - synthsByAddress( - synthAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - tokenState(overrides?: CallOverrides): Promise - - totalIssuedSynths( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - totalIssuedSynthsExcludeOtherCollateral( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - totalSupply(overrides?: CallOverrides): Promise - - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - transferableSynthetix( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'AccountLiquidated(address,uint256,uint256,address)'( - account?: PromiseOrValue | null, - snxRedeemed?: null, - amountLiquidated?: null, - liquidator?: null - ): AccountLiquidatedEventFilter - AccountLiquidated( - account?: PromiseOrValue | null, - snxRedeemed?: null, - amountLiquidated?: null, - liquidator?: null - ): AccountLiquidatedEventFilter - - 'Approval(address,address,uint256)'( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter - Approval( - owner?: PromiseOrValue | null, - spender?: PromiseOrValue | null, - value?: null - ): ApprovalEventFilter - - 'AtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)'( - account?: PromiseOrValue | null, - fromCurrencyKey?: null, - fromAmount?: null, - toCurrencyKey?: null, - toAmount?: null, - toAddress?: null - ): AtomicSynthExchangeEventFilter - AtomicSynthExchange( - account?: PromiseOrValue | null, - fromCurrencyKey?: null, - fromAmount?: null, - toCurrencyKey?: null, - toAmount?: null, - toAddress?: null - ): AtomicSynthExchangeEventFilter - - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'ExchangeRebate(address,bytes32,uint256)'( - account?: PromiseOrValue | null, - currencyKey?: null, - amount?: null - ): ExchangeRebateEventFilter - ExchangeRebate( - account?: PromiseOrValue | null, - currencyKey?: null, - amount?: null - ): ExchangeRebateEventFilter - - 'ExchangeReclaim(address,bytes32,uint256)'( - account?: PromiseOrValue | null, - currencyKey?: null, - amount?: null - ): ExchangeReclaimEventFilter - ExchangeReclaim( - account?: PromiseOrValue | null, - currencyKey?: null, - amount?: null - ): ExchangeReclaimEventFilter - - 'ExchangeTracking(bytes32,bytes32,uint256,uint256)'( - trackingCode?: PromiseOrValue | null, - toCurrencyKey?: null, - toAmount?: null, - fee?: null - ): ExchangeTrackingEventFilter - ExchangeTracking( - trackingCode?: PromiseOrValue | null, - toCurrencyKey?: null, - toAmount?: null, - fee?: null - ): ExchangeTrackingEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - - 'ProxyUpdated(address)'(proxyAddress?: null): ProxyUpdatedEventFilter - ProxyUpdated(proxyAddress?: null): ProxyUpdatedEventFilter - - 'SynthExchange(address,bytes32,uint256,bytes32,uint256,address)'( - account?: PromiseOrValue | null, - fromCurrencyKey?: null, - fromAmount?: null, - toCurrencyKey?: null, - toAmount?: null, - toAddress?: null - ): SynthExchangeEventFilter - SynthExchange( - account?: PromiseOrValue | null, - fromCurrencyKey?: null, - fromAmount?: null, - toCurrencyKey?: null, - toAmount?: null, - toAddress?: null - ): SynthExchangeEventFilter - - 'TokenStateUpdated(address)'(newTokenState?: null): TokenStateUpdatedEventFilter - TokenStateUpdated(newTokenState?: null): TokenStateUpdatedEventFilter - - 'Transfer(address,address,uint256)'( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - Transfer( - from?: PromiseOrValue | null, - to?: PromiseOrValue | null, - value?: null - ): TransferEventFilter - } - - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - DECIMALS(overrides?: CallOverrides): Promise - - TOKEN_NAME(overrides?: CallOverrides): Promise - - TOKEN_SYMBOL(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - anySynthOrSNXRateIsInvalid(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - availableCurrencyKeys(overrides?: CallOverrides): Promise - - availableSynthCount(overrides?: CallOverrides): Promise - - availableSynths( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise - - burnSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsOnBehalf( - burnForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTarget( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTargetOnBehalf( - burnForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - collateral(account: PromiseOrValue, overrides?: CallOverrides): Promise - - collateralisationRatio( - _issuer: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - debtBalanceOf( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - decimals(overrides?: CallOverrides): Promise - - emitAtomicSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeRebate( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeReclaim( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeTracking( - trackingCode: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - fee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchange( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - minAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalf( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalfWithTracking( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTracking( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTrackingForInitiator( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithVirtual( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getFirstNonZeroEscrowIndex( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isWaitingPeriod( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - issueMaxSynths(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - issueMaxSynthsOnBehalf( - issueForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynthsOnBehalf( - issueForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccount( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccountEscrowIndex( - account: PromiseOrValue, - escrowStartIndex: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateSelf(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - maxIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - messageSender(overrides?: CallOverrides): Promise - - migrateEscrowBalanceToRewardEscrowV2( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - migrateEscrowContractBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - mintSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mintSecondaryRewards( - arg0: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - name(overrides?: CallOverrides): Promise + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + settle( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; - proxy(overrides?: CallOverrides): Promise + symbol(overrides?: CallOverrides): Promise; - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise + synths(currencyKey: BytesLike, overrides?: CallOverrides): Promise; - remainingIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise + synthsByAddress( + synthAddress: string, + overrides?: CallOverrides + ): Promise; - resolver(overrides?: CallOverrides): Promise + tokenState(overrides?: CallOverrides): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + totalIssuedSynths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - sUSD(overrides?: CallOverrides): Promise + totalIssuedSynthsExcludeOtherCollateral( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + totalSupply(overrides?: CallOverrides): Promise; - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferableSynthetix( + account: string, + overrides?: CallOverrides + ): Promise; - settle( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + DECIMALS(overrides?: CallOverrides): Promise; - symbol(overrides?: CallOverrides): Promise + TOKEN_NAME(overrides?: CallOverrides): Promise; + + TOKEN_SYMBOL(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + anySynthOrSNXRateIsInvalid(overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; + + availableCurrencyKeys(overrides?: CallOverrides): Promise; + + availableSynthCount(overrides?: CallOverrides): Promise; + + availableSynths( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burnSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + burnSynths(amount: BigNumberish, overrides?: CallOverrides): Promise; + + burnSynthsOnBehalf( + burnForAddress: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + burnSynthsToTarget(overrides?: CallOverrides): Promise; + + burnSynthsToTargetOnBehalf( + burnForAddress: string, + overrides?: CallOverrides + ): Promise; + + collateral(account: string, overrides?: CallOverrides): Promise; + + collateralisationRatio( + _issuer: string, + overrides?: CallOverrides + ): Promise; + + debtBalanceOf( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + emitAtomicSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: CallOverrides + ): Promise; + + emitExchangeRebate( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + emitExchangeReclaim( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + emitExchangeTracking( + trackingCode: BytesLike, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + fee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + emitSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: CallOverrides + ): Promise; + + exchange( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + exchangeAtomically( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + minAmount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + exchangeOnBehalf( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + exchangeOnBehalfWithTracking( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + exchangeWithTracking( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + exchangeWithTrackingForInitiator( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise; + + exchangeWithVirtual( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, string] & { amountReceived: BigNumber; vSynth: string } + >; + + getFirstNonZeroEscrowIndex( + account: string, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isWaitingPeriod( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + issueMaxSynths(overrides?: CallOverrides): Promise; + + issueMaxSynthsOnBehalf( + issueForAddress: string, + overrides?: CallOverrides + ): Promise; + + issueSynths(amount: BigNumberish, overrides?: CallOverrides): Promise; + + issueSynthsOnBehalf( + issueForAddress: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + liquidateDelinquentAccount( + account: string, + overrides?: CallOverrides + ): Promise; + + liquidateDelinquentAccountEscrowIndex( + account: string, + escrowStartIndex: BigNumberish, + overrides?: CallOverrides + ): Promise; + + liquidateSelf(overrides?: CallOverrides): Promise; + + maxIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + + messageSender(overrides?: CallOverrides): Promise; + + migrateEscrowBalanceToRewardEscrowV2( + overrides?: CallOverrides + ): Promise; + + migrateEscrowContractBalance(overrides?: CallOverrides): Promise; + + mint(overrides?: CallOverrides): Promise; + + mintSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + mintSecondaryRewards( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + proxy(overrides?: CallOverrides): Promise; + + rebuildCache(overrides?: CallOverrides): Promise; + + remainingIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + maxIssuable: BigNumber; + alreadyIssued: BigNumber; + totalSystemDebt: BigNumber; + } + >; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired(overrides?: CallOverrides): Promise; + + sUSD(overrides?: CallOverrides): Promise; + + setMessageSender(sender: string, overrides?: CallOverrides): Promise; + + setProxy(_proxy: string, overrides?: CallOverrides): Promise; + + setTokenState( + _tokenState: string, + overrides?: CallOverrides + ): Promise; + + settle( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + reclaimed: BigNumber; + refunded: BigNumber; + numEntriesSettled: BigNumber; + } + >; + + symbol(overrides?: CallOverrides): Promise; + + synths(currencyKey: BytesLike, overrides?: CallOverrides): Promise; + + synthsByAddress( + synthAddress: string, + overrides?: CallOverrides + ): Promise; + + tokenState(overrides?: CallOverrides): Promise; + + totalIssuedSynths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + totalIssuedSynthsExcludeOtherCollateral( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferableSynthetix( + account: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AccountLiquidated(address,uint256,uint256,address)"( + account?: string | null, + snxRedeemed?: null, + amountLiquidated?: null, + liquidator?: null + ): AccountLiquidatedEventFilter; + AccountLiquidated( + account?: string | null, + snxRedeemed?: null, + amountLiquidated?: null, + liquidator?: null + ): AccountLiquidatedEventFilter; + + "Approval(address,address,uint256)"( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; + Approval( + owner?: string | null, + spender?: string | null, + value?: null + ): ApprovalEventFilter; + + "AtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)"( + account?: string | null, + fromCurrencyKey?: null, + fromAmount?: null, + toCurrencyKey?: null, + toAmount?: null, + toAddress?: null + ): AtomicSynthExchangeEventFilter; + AtomicSynthExchange( + account?: string | null, + fromCurrencyKey?: null, + fromAmount?: null, + toCurrencyKey?: null, + toAmount?: null, + toAddress?: null + ): AtomicSynthExchangeEventFilter; + + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "ExchangeRebate(address,bytes32,uint256)"( + account?: string | null, + currencyKey?: null, + amount?: null + ): ExchangeRebateEventFilter; + ExchangeRebate( + account?: string | null, + currencyKey?: null, + amount?: null + ): ExchangeRebateEventFilter; + + "ExchangeReclaim(address,bytes32,uint256)"( + account?: string | null, + currencyKey?: null, + amount?: null + ): ExchangeReclaimEventFilter; + ExchangeReclaim( + account?: string | null, + currencyKey?: null, + amount?: null + ): ExchangeReclaimEventFilter; + + "ExchangeTracking(bytes32,bytes32,uint256,uint256)"( + trackingCode?: BytesLike | null, + toCurrencyKey?: null, + toAmount?: null, + fee?: null + ): ExchangeTrackingEventFilter; + ExchangeTracking( + trackingCode?: BytesLike | null, + toCurrencyKey?: null, + toAmount?: null, + fee?: null + ): ExchangeTrackingEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "ProxyUpdated(address)"(proxyAddress?: null): ProxyUpdatedEventFilter; + ProxyUpdated(proxyAddress?: null): ProxyUpdatedEventFilter; + + "SynthExchange(address,bytes32,uint256,bytes32,uint256,address)"( + account?: string | null, + fromCurrencyKey?: null, + fromAmount?: null, + toCurrencyKey?: null, + toAmount?: null, + toAddress?: null + ): SynthExchangeEventFilter; + SynthExchange( + account?: string | null, + fromCurrencyKey?: null, + fromAmount?: null, + toCurrencyKey?: null, + toAmount?: null, + toAddress?: null + ): SynthExchangeEventFilter; + + "TokenStateUpdated(address)"( + newTokenState?: null + ): TokenStateUpdatedEventFilter; + TokenStateUpdated(newTokenState?: null): TokenStateUpdatedEventFilter; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + Transfer( + from?: string | null, + to?: string | null, + value?: null + ): TransferEventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + DECIMALS(overrides?: CallOverrides): Promise; + + TOKEN_NAME(overrides?: CallOverrides): Promise; + + TOKEN_SYMBOL(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + anySynthOrSNXRateIsInvalid(overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + availableCurrencyKeys(overrides?: CallOverrides): Promise; + + availableSynthCount(overrides?: CallOverrides): Promise; + + availableSynths( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burnSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsOnBehalf( + burnForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTarget( + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTargetOnBehalf( + burnForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + collateral(account: string, overrides?: CallOverrides): Promise; + + collateralisationRatio( + _issuer: string, + overrides?: CallOverrides + ): Promise; + + debtBalanceOf( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + emitAtomicSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeRebate( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeReclaim( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeTracking( + trackingCode: BytesLike, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + fee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + exchange( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + minAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalf( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalfWithTracking( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTracking( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTrackingForInitiator( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithVirtual( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFirstNonZeroEscrowIndex( + account: string, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isWaitingPeriod( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + issueMaxSynths( + overrides?: Overrides & { from?: string } + ): Promise; + + issueMaxSynthsOnBehalf( + issueForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynthsOnBehalf( + issueForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccount( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccountEscrowIndex( + account: string, + escrowStartIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateSelf( + overrides?: Overrides & { from?: string } + ): Promise; + + maxIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + + messageSender(overrides?: CallOverrides): Promise; + + migrateEscrowBalanceToRewardEscrowV2( + overrides?: Overrides & { from?: string } + ): Promise; + + migrateEscrowContractBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + mint(overrides?: Overrides & { from?: string }): Promise; + + mintSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mintSecondaryRewards( + arg0: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + proxy(overrides?: CallOverrides): Promise; + + rebuildCache(overrides?: Overrides & { from?: string }): Promise; - synths(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise + remainingIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise; - synthsByAddress( - synthAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise + resolver(overrides?: CallOverrides): Promise; - tokenState(overrides?: CallOverrides): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - totalIssuedSynths( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + sUSD(overrides?: CallOverrides): Promise; - totalIssuedSynthsExcludeOtherCollateral( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; - totalSupply(overrides?: CallOverrides): Promise + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + settle( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; - transferableSynthetix( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - DECIMALS(overrides?: CallOverrides): Promise - - TOKEN_NAME(overrides?: CallOverrides): Promise - - TOKEN_SYMBOL(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - allowance( - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - anySynthOrSNXRateIsInvalid(overrides?: CallOverrides): Promise - - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - availableCurrencyKeys(overrides?: CallOverrides): Promise - - availableSynthCount(overrides?: CallOverrides): Promise - - availableSynths( - index: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - balanceOf( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - burnSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsOnBehalf( - burnForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTarget( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - burnSynthsToTargetOnBehalf( - burnForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - collateral( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - collateralisationRatio( - _issuer: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - debtBalanceOf( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - decimals(overrides?: CallOverrides): Promise - - emitAtomicSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeRebate( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeReclaim( - account: PromiseOrValue, - currencyKey: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitExchangeTracking( - trackingCode: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - fee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - emitSynthExchange( - account: PromiseOrValue, - fromCurrencyKey: PromiseOrValue, - fromAmount: PromiseOrValue, - toCurrencyKey: PromiseOrValue, - toAmount: PromiseOrValue, - toAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchange( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeAtomically( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - minAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalf( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeOnBehalfWithTracking( - exchangeForAddress: PromiseOrValue, - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTracking( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithTrackingForInitiator( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - rewardAddress: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - exchangeWithVirtual( - sourceCurrencyKey: PromiseOrValue, - sourceAmount: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - trackingCode: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - getFirstNonZeroEscrowIndex( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - isResolverCached(overrides?: CallOverrides): Promise - - isWaitingPeriod( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - issueMaxSynths( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueMaxSynthsOnBehalf( - issueForAddress: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynths( - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - issueSynthsOnBehalf( - issueForAddress: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccount( - account: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateDelinquentAccountEscrowIndex( - account: PromiseOrValue, - escrowStartIndex: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - liquidateSelf( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - maxIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - messageSender(overrides?: CallOverrides): Promise - - migrateEscrowBalanceToRewardEscrowV2( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - migrateEscrowContractBalance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mint(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - mintSecondary( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - mintSecondaryRewards( - arg0: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - name(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - proxy(overrides?: CallOverrides): Promise - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - remainingIssuableSynths( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resolver(overrides?: CallOverrides): Promise - - resolverAddressesRequired(overrides?: CallOverrides): Promise - - sUSD(overrides?: CallOverrides): Promise - - setMessageSender( - sender: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setProxy( - _proxy: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTokenState( - _tokenState: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - settle( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - symbol(overrides?: CallOverrides): Promise + symbol(overrides?: CallOverrides): Promise; + + synths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthsByAddress( + synthAddress: string, + overrides?: CallOverrides + ): Promise; + + tokenState(overrides?: CallOverrides): Promise; - synths( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + totalIssuedSynths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - synthsByAddress( - synthAddress: PromiseOrValue, - overrides?: CallOverrides - ): Promise + totalIssuedSynthsExcludeOtherCollateral( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - tokenState(overrides?: CallOverrides): Promise + totalSupply(overrides?: CallOverrides): Promise; - totalIssuedSynths( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferableSynthetix( + account: string, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + DECIMALS(overrides?: CallOverrides): Promise; + + TOKEN_NAME(overrides?: CallOverrides): Promise; + + TOKEN_SYMBOL(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + anySynthOrSNXRateIsInvalid( + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + availableCurrencyKeys( + overrides?: CallOverrides + ): Promise; + + availableSynthCount( + overrides?: CallOverrides + ): Promise; + + availableSynths( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; + + burnSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsOnBehalf( + burnForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTarget( + overrides?: Overrides & { from?: string } + ): Promise; + + burnSynthsToTargetOnBehalf( + burnForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + collateral( + account: string, + overrides?: CallOverrides + ): Promise; + + collateralisationRatio( + _issuer: string, + overrides?: CallOverrides + ): Promise; + + debtBalanceOf( + account: string, + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + emitAtomicSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeRebate( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeReclaim( + account: string, + currencyKey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitExchangeTracking( + trackingCode: BytesLike, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + fee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + emitSynthExchange( + account: string, + fromCurrencyKey: BytesLike, + fromAmount: BigNumberish, + toCurrencyKey: BytesLike, + toAmount: BigNumberish, + toAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + exchange( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeAtomically( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + minAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalf( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeOnBehalfWithTracking( + exchangeForAddress: string, + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTracking( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithTrackingForInitiator( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + rewardAddress: string, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + exchangeWithVirtual( + sourceCurrencyKey: BytesLike, + sourceAmount: BigNumberish, + destinationCurrencyKey: BytesLike, + trackingCode: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getFirstNonZeroEscrowIndex( + account: string, + overrides?: CallOverrides + ): Promise; + + isResolverCached(overrides?: CallOverrides): Promise; + + isWaitingPeriod( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + issueMaxSynths( + overrides?: Overrides & { from?: string } + ): Promise; + + issueMaxSynthsOnBehalf( + issueForAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynths( + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + issueSynthsOnBehalf( + issueForAddress: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccount( + account: string, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateDelinquentAccountEscrowIndex( + account: string, + escrowStartIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + liquidateSelf( + overrides?: Overrides & { from?: string } + ): Promise; + + maxIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + + messageSender(overrides?: CallOverrides): Promise; + + migrateEscrowBalanceToRewardEscrowV2( + overrides?: Overrides & { from?: string } + ): Promise; + + migrateEscrowContractBalance( + overrides?: Overrides & { from?: string } + ): Promise; + + mint( + overrides?: Overrides & { from?: string } + ): Promise; + + mintSecondary( + arg0: string, + arg1: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + mintSecondaryRewards( + arg0: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + proxy(overrides?: CallOverrides): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + remainingIssuableSynths( + account: string, + overrides?: CallOverrides + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + sUSD(overrides?: CallOverrides): Promise; + + setMessageSender( + sender: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setProxy( + _proxy: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setTokenState( + _tokenState: string, + overrides?: Overrides & { from?: string } + ): Promise; + + settle( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + synths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthsByAddress( + synthAddress: string, + overrides?: CallOverrides + ): Promise; + + tokenState(overrides?: CallOverrides): Promise; - totalIssuedSynthsExcludeOtherCollateral( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + totalIssuedSynths( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - totalSupply(overrides?: CallOverrides): Promise + totalIssuedSynthsExcludeOtherCollateral( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - transfer( - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + totalSupply(overrides?: CallOverrides): Promise; - transferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - transferableSynthetix( - account: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + transferableSynthetix( + account: string, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SystemSettings.ts b/packages/sdk/src/contracts/types/SystemSettings.ts index cd4999f399..a830964f6a 100644 --- a/packages/sdk/src/contracts/types/SystemSettings.ts +++ b/packages/sdk/src/contracts/types/SystemSettings.ts @@ -2,3104 +2,3697 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SystemSettingsInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'aggregatorWarningFlags()': FunctionFragment - 'atomicEquivalentForDexPricing(bytes32)': FunctionFragment - 'atomicExchangeFeeRate(bytes32)': FunctionFragment - 'atomicMaxVolumePerBlock()': FunctionFragment - 'atomicTwapWindow()': FunctionFragment - 'atomicVolatilityConsiderationWindow(bytes32)': FunctionFragment - 'atomicVolatilityUpdateThreshold(bytes32)': FunctionFragment - 'collapseFeeRate(address)': FunctionFragment - 'crossChainSynthTransferEnabled(bytes32)': FunctionFragment - 'crossDomainMessageGasLimit(uint8)': FunctionFragment - 'debtSnapshotStaleTime()': FunctionFragment - 'etherWrapperBurnFeeRate()': FunctionFragment - 'etherWrapperMaxETH()': FunctionFragment - 'etherWrapperMintFeeRate()': FunctionFragment - 'exchangeDynamicFeeRounds()': FunctionFragment - 'exchangeDynamicFeeThreshold()': FunctionFragment - 'exchangeDynamicFeeWeightDecay()': FunctionFragment - 'exchangeFeeRate(bytes32)': FunctionFragment - 'exchangeMaxDynamicFee()': FunctionFragment - 'feePeriodDuration()': FunctionFragment - 'flagReward()': FunctionFragment - 'interactionDelay(address)': FunctionFragment - 'isResolverCached()': FunctionFragment - 'issuanceRatio()': FunctionFragment - 'liquidateReward()': FunctionFragment - 'liquidationDelay()': FunctionFragment - 'liquidationEscrowDuration()': FunctionFragment - 'liquidationPenalty()': FunctionFragment - 'liquidationRatio()': FunctionFragment - 'minimumStakeTime()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'priceDeviationThresholdFactor()': FunctionFragment - 'pureChainlinkPriceForAtomicSwapsEnabled(bytes32)': FunctionFragment - 'rateStalePeriod()': FunctionFragment - 'rebuildCache()': FunctionFragment - 'resolver()': FunctionFragment - 'resolverAddressesRequired()': FunctionFragment - 'selfLiquidationPenalty()': FunctionFragment - 'setAggregatorWarningFlags(address)': FunctionFragment - 'setAtomicEquivalentForDexPricing(bytes32,address)': FunctionFragment - 'setAtomicExchangeFeeRate(bytes32,uint256)': FunctionFragment - 'setAtomicMaxVolumePerBlock(uint256)': FunctionFragment - 'setAtomicTwapWindow(uint256)': FunctionFragment - 'setAtomicVolatilityConsiderationWindow(bytes32,uint256)': FunctionFragment - 'setAtomicVolatilityUpdateThreshold(bytes32,uint256)': FunctionFragment - 'setCollapseFeeRate(address,uint256)': FunctionFragment - 'setCrossChainSynthTransferEnabled(bytes32,uint256)': FunctionFragment - 'setCrossDomainMessageGasLimit(uint8,uint256)': FunctionFragment - 'setDebtSnapshotStaleTime(uint256)': FunctionFragment - 'setEtherWrapperBurnFeeRate(uint256)': FunctionFragment - 'setEtherWrapperMaxETH(uint256)': FunctionFragment - 'setEtherWrapperMintFeeRate(uint256)': FunctionFragment - 'setExchangeDynamicFeeRounds(uint256)': FunctionFragment - 'setExchangeDynamicFeeThreshold(uint256)': FunctionFragment - 'setExchangeDynamicFeeWeightDecay(uint256)': FunctionFragment - 'setExchangeFeeRateForSynths(bytes32[],uint256[])': FunctionFragment - 'setExchangeMaxDynamicFee(uint256)': FunctionFragment - 'setFeePeriodDuration(uint256)': FunctionFragment - 'setFlagReward(uint256)': FunctionFragment - 'setInteractionDelay(address,uint256)': FunctionFragment - 'setIssuanceRatio(uint256)': FunctionFragment - 'setLiquidateReward(uint256)': FunctionFragment - 'setLiquidationDelay(uint256)': FunctionFragment - 'setLiquidationEscrowDuration(uint256)': FunctionFragment - 'setLiquidationPenalty(uint256)': FunctionFragment - 'setLiquidationRatio(uint256)': FunctionFragment - 'setMinimumStakeTime(uint256)': FunctionFragment - 'setPriceDeviationThresholdFactor(uint256)': FunctionFragment - 'setPureChainlinkPriceForAtomicSwapsEnabled(bytes32,bool)': FunctionFragment - 'setRateStalePeriod(uint256)': FunctionFragment - 'setSelfLiquidationPenalty(uint256)': FunctionFragment - 'setSnxLiquidationPenalty(uint256)': FunctionFragment - 'setTargetThreshold(uint256)': FunctionFragment - 'setTradingRewardsEnabled(bool)': FunctionFragment - 'setWaitingPeriodSecs(uint256)': FunctionFragment - 'setWrapperBurnFeeRate(address,int256)': FunctionFragment - 'setWrapperMaxTokenAmount(address,uint256)': FunctionFragment - 'setWrapperMintFeeRate(address,int256)': FunctionFragment - 'snxLiquidationPenalty()': FunctionFragment - 'targetThreshold()': FunctionFragment - 'tradingRewardsEnabled()': FunctionFragment - 'waitingPeriodSecs()': FunctionFragment - 'wrapperBurnFeeRate(address)': FunctionFragment - 'wrapperMaxTokenAmount(address)': FunctionFragment - 'wrapperMintFeeRate(address)': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'acceptOwnership' - | 'aggregatorWarningFlags' - | 'atomicEquivalentForDexPricing' - | 'atomicExchangeFeeRate' - | 'atomicMaxVolumePerBlock' - | 'atomicTwapWindow' - | 'atomicVolatilityConsiderationWindow' - | 'atomicVolatilityUpdateThreshold' - | 'collapseFeeRate' - | 'crossChainSynthTransferEnabled' - | 'crossDomainMessageGasLimit' - | 'debtSnapshotStaleTime' - | 'etherWrapperBurnFeeRate' - | 'etherWrapperMaxETH' - | 'etherWrapperMintFeeRate' - | 'exchangeDynamicFeeRounds' - | 'exchangeDynamicFeeThreshold' - | 'exchangeDynamicFeeWeightDecay' - | 'exchangeFeeRate' - | 'exchangeMaxDynamicFee' - | 'feePeriodDuration' - | 'flagReward' - | 'interactionDelay' - | 'isResolverCached' - | 'issuanceRatio' - | 'liquidateReward' - | 'liquidationDelay' - | 'liquidationEscrowDuration' - | 'liquidationPenalty' - | 'liquidationRatio' - | 'minimumStakeTime' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'priceDeviationThresholdFactor' - | 'pureChainlinkPriceForAtomicSwapsEnabled' - | 'rateStalePeriod' - | 'rebuildCache' - | 'resolver' - | 'resolverAddressesRequired' - | 'selfLiquidationPenalty' - | 'setAggregatorWarningFlags' - | 'setAtomicEquivalentForDexPricing' - | 'setAtomicExchangeFeeRate' - | 'setAtomicMaxVolumePerBlock' - | 'setAtomicTwapWindow' - | 'setAtomicVolatilityConsiderationWindow' - | 'setAtomicVolatilityUpdateThreshold' - | 'setCollapseFeeRate' - | 'setCrossChainSynthTransferEnabled' - | 'setCrossDomainMessageGasLimit' - | 'setDebtSnapshotStaleTime' - | 'setEtherWrapperBurnFeeRate' - | 'setEtherWrapperMaxETH' - | 'setEtherWrapperMintFeeRate' - | 'setExchangeDynamicFeeRounds' - | 'setExchangeDynamicFeeThreshold' - | 'setExchangeDynamicFeeWeightDecay' - | 'setExchangeFeeRateForSynths' - | 'setExchangeMaxDynamicFee' - | 'setFeePeriodDuration' - | 'setFlagReward' - | 'setInteractionDelay' - | 'setIssuanceRatio' - | 'setLiquidateReward' - | 'setLiquidationDelay' - | 'setLiquidationEscrowDuration' - | 'setLiquidationPenalty' - | 'setLiquidationRatio' - | 'setMinimumStakeTime' - | 'setPriceDeviationThresholdFactor' - | 'setPureChainlinkPriceForAtomicSwapsEnabled' - | 'setRateStalePeriod' - | 'setSelfLiquidationPenalty' - | 'setSnxLiquidationPenalty' - | 'setTargetThreshold' - | 'setTradingRewardsEnabled' - | 'setWaitingPeriodSecs' - | 'setWrapperBurnFeeRate' - | 'setWrapperMaxTokenAmount' - | 'setWrapperMintFeeRate' - | 'snxLiquidationPenalty' - | 'targetThreshold' - | 'tradingRewardsEnabled' - | 'waitingPeriodSecs' - | 'wrapperBurnFeeRate' - | 'wrapperMaxTokenAmount' - | 'wrapperMintFeeRate' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData(functionFragment: 'aggregatorWarningFlags', values?: undefined): string - encodeFunctionData( - functionFragment: 'atomicEquivalentForDexPricing', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'atomicExchangeFeeRate', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'atomicMaxVolumePerBlock', values?: undefined): string - encodeFunctionData(functionFragment: 'atomicTwapWindow', values?: undefined): string - encodeFunctionData( - functionFragment: 'atomicVolatilityConsiderationWindow', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'atomicVolatilityUpdateThreshold', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'collapseFeeRate', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'crossChainSynthTransferEnabled', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'crossDomainMessageGasLimit', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'debtSnapshotStaleTime', values?: undefined): string - encodeFunctionData(functionFragment: 'etherWrapperBurnFeeRate', values?: undefined): string - encodeFunctionData(functionFragment: 'etherWrapperMaxETH', values?: undefined): string - encodeFunctionData(functionFragment: 'etherWrapperMintFeeRate', values?: undefined): string - encodeFunctionData(functionFragment: 'exchangeDynamicFeeRounds', values?: undefined): string - encodeFunctionData(functionFragment: 'exchangeDynamicFeeThreshold', values?: undefined): string - encodeFunctionData(functionFragment: 'exchangeDynamicFeeWeightDecay', values?: undefined): string - encodeFunctionData( - functionFragment: 'exchangeFeeRate', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'exchangeMaxDynamicFee', values?: undefined): string - encodeFunctionData(functionFragment: 'feePeriodDuration', values?: undefined): string - encodeFunctionData(functionFragment: 'flagReward', values?: undefined): string - encodeFunctionData(functionFragment: 'interactionDelay', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'isResolverCached', values?: undefined): string - encodeFunctionData(functionFragment: 'issuanceRatio', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidateReward', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidationDelay', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidationEscrowDuration', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidationPenalty', values?: undefined): string - encodeFunctionData(functionFragment: 'liquidationRatio', values?: undefined): string - encodeFunctionData(functionFragment: 'minimumStakeTime', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'priceDeviationThresholdFactor', values?: undefined): string - encodeFunctionData( - functionFragment: 'pureChainlinkPriceForAtomicSwapsEnabled', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'rateStalePeriod', values?: undefined): string - encodeFunctionData(functionFragment: 'rebuildCache', values?: undefined): string - encodeFunctionData(functionFragment: 'resolver', values?: undefined): string - encodeFunctionData(functionFragment: 'resolverAddressesRequired', values?: undefined): string - encodeFunctionData(functionFragment: 'selfLiquidationPenalty', values?: undefined): string - encodeFunctionData( - functionFragment: 'setAggregatorWarningFlags', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setAtomicEquivalentForDexPricing', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setAtomicExchangeFeeRate', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setAtomicMaxVolumePerBlock', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setAtomicTwapWindow', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setAtomicVolatilityConsiderationWindow', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setAtomicVolatilityUpdateThreshold', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setCollapseFeeRate', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setCrossChainSynthTransferEnabled', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setCrossDomainMessageGasLimit', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setDebtSnapshotStaleTime', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setEtherWrapperBurnFeeRate', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setEtherWrapperMaxETH', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setEtherWrapperMintFeeRate', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setExchangeDynamicFeeRounds', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setExchangeDynamicFeeThreshold', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setExchangeDynamicFeeWeightDecay', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setExchangeFeeRateForSynths', - values: [PromiseOrValue[], PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'setExchangeMaxDynamicFee', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setFeePeriodDuration', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setFlagReward', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setInteractionDelay', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setIssuanceRatio', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidateReward', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationDelay', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationEscrowDuration', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationPenalty', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setLiquidationRatio', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setMinimumStakeTime', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setPriceDeviationThresholdFactor', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setPureChainlinkPriceForAtomicSwapsEnabled', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setRateStalePeriod', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setSelfLiquidationPenalty', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setSnxLiquidationPenalty', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTargetThreshold', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setTradingRewardsEnabled', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setWaitingPeriodSecs', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setWrapperBurnFeeRate', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setWrapperMaxTokenAmount', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'setWrapperMintFeeRate', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'snxLiquidationPenalty', values?: undefined): string - encodeFunctionData(functionFragment: 'targetThreshold', values?: undefined): string - encodeFunctionData(functionFragment: 'tradingRewardsEnabled', values?: undefined): string - encodeFunctionData(functionFragment: 'waitingPeriodSecs', values?: undefined): string - encodeFunctionData( - functionFragment: 'wrapperBurnFeeRate', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'wrapperMaxTokenAmount', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'wrapperMintFeeRate', - values: [PromiseOrValue] - ): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'aggregatorWarningFlags', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'atomicEquivalentForDexPricing', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'atomicExchangeFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'atomicMaxVolumePerBlock', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'atomicTwapWindow', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'atomicVolatilityConsiderationWindow', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'atomicVolatilityUpdateThreshold', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'collapseFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'crossChainSynthTransferEnabled', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'crossDomainMessageGasLimit', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'debtSnapshotStaleTime', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'etherWrapperBurnFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'etherWrapperMaxETH', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'etherWrapperMintFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeDynamicFeeRounds', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeDynamicFeeThreshold', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeDynamicFeeWeightDecay', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeMaxDynamicFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'feePeriodDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'flagReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'interactionDelay', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isResolverCached', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'issuanceRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidateReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationDelay', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationEscrowDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationPenalty', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'liquidationRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'minimumStakeTime', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'priceDeviationThresholdFactor', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'pureChainlinkPriceForAtomicSwapsEnabled', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'rateStalePeriod', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rebuildCache', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resolverAddressesRequired', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'selfLiquidationPenalty', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setAggregatorWarningFlags', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'setAtomicEquivalentForDexPricing', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'setAtomicExchangeFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setAtomicMaxVolumePerBlock', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setAtomicTwapWindow', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'setAtomicVolatilityConsiderationWindow', - data: BytesLike - ): Result - decodeFunctionResult( - functionFragment: 'setAtomicVolatilityUpdateThreshold', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'setCollapseFeeRate', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'setCrossChainSynthTransferEnabled', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'setCrossDomainMessageGasLimit', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setDebtSnapshotStaleTime', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setEtherWrapperBurnFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setEtherWrapperMaxETH', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setEtherWrapperMintFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setExchangeDynamicFeeRounds', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setExchangeDynamicFeeThreshold', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'setExchangeDynamicFeeWeightDecay', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'setExchangeFeeRateForSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setExchangeMaxDynamicFee', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setFeePeriodDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setFlagReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setInteractionDelay', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setIssuanceRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidateReward', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationDelay', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationEscrowDuration', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationPenalty', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setLiquidationRatio', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setMinimumStakeTime', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'setPriceDeviationThresholdFactor', - data: BytesLike - ): Result - decodeFunctionResult( - functionFragment: 'setPureChainlinkPriceForAtomicSwapsEnabled', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'setRateStalePeriod', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setSelfLiquidationPenalty', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setSnxLiquidationPenalty', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTargetThreshold', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setTradingRewardsEnabled', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setWaitingPeriodSecs', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setWrapperBurnFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setWrapperMaxTokenAmount', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'setWrapperMintFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'snxLiquidationPenalty', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'targetThreshold', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'tradingRewardsEnabled', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'waitingPeriodSecs', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'wrapperBurnFeeRate', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'wrapperMaxTokenAmount', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'wrapperMintFeeRate', data: BytesLike): Result - - events: { - 'AggregatorWarningFlagsUpdated(address)': EventFragment - 'AtomicEquivalentForDexPricingUpdated(bytes32,address)': EventFragment - 'AtomicExchangeFeeUpdated(bytes32,uint256)': EventFragment - 'AtomicMaxVolumePerBlockUpdated(uint256)': EventFragment - 'AtomicTwapWindowUpdated(uint256)': EventFragment - 'AtomicVolatilityConsiderationWindowUpdated(bytes32,uint256)': EventFragment - 'AtomicVolatilityUpdateThresholdUpdated(bytes32,uint256)': EventFragment - 'CacheUpdated(bytes32,address)': EventFragment - 'CollapseFeeRateUpdated(uint256)': EventFragment - 'CrossChainSynthTransferEnabledUpdated(bytes32,uint256)': EventFragment - 'CrossDomainMessageGasLimitChanged(uint8,uint256)': EventFragment - 'DebtSnapshotStaleTimeUpdated(uint256)': EventFragment - 'EtherWrapperBurnFeeRateUpdated(uint256)': EventFragment - 'EtherWrapperMaxETHUpdated(uint256)': EventFragment - 'EtherWrapperMintFeeRateUpdated(uint256)': EventFragment - 'ExchangeDynamicFeeRoundsUpdated(uint256)': EventFragment - 'ExchangeDynamicFeeThresholdUpdated(uint256)': EventFragment - 'ExchangeDynamicFeeWeightDecayUpdated(uint256)': EventFragment - 'ExchangeFeeUpdated(bytes32,uint256)': EventFragment - 'ExchangeMaxDynamicFeeUpdated(uint256)': EventFragment - 'FeePeriodDurationUpdated(uint256)': EventFragment - 'FlagRewardUpdated(uint256)': EventFragment - 'InteractionDelayUpdated(uint256)': EventFragment - 'IssuanceRatioUpdated(uint256)': EventFragment - 'LiquidateRewardUpdated(uint256)': EventFragment - 'LiquidationDelayUpdated(uint256)': EventFragment - 'LiquidationEscrowDurationUpdated(uint256)': EventFragment - 'LiquidationPenaltyUpdated(uint256)': EventFragment - 'LiquidationRatioUpdated(uint256)': EventFragment - 'MinimumStakeTimeUpdated(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'PriceDeviationThresholdUpdated(uint256)': EventFragment - 'PureChainlinkPriceForAtomicSwapsEnabledUpdated(bytes32,bool)': EventFragment - 'RateStalePeriodUpdated(uint256)': EventFragment - 'SelfLiquidationPenaltyUpdated(uint256)': EventFragment - 'SnxLiquidationPenaltyUpdated(uint256)': EventFragment - 'TargetThresholdUpdated(uint256)': EventFragment - 'TradingRewardsEnabled(bool)': EventFragment - 'WaitingPeriodSecsUpdated(uint256)': EventFragment - 'WrapperBurnFeeRateUpdated(address,int256)': EventFragment - 'WrapperMaxTokenAmountUpdated(address,uint256)': EventFragment - 'WrapperMintFeeRateUpdated(address,int256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'AggregatorWarningFlagsUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AtomicEquivalentForDexPricingUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AtomicExchangeFeeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AtomicMaxVolumePerBlockUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AtomicTwapWindowUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AtomicVolatilityConsiderationWindowUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'AtomicVolatilityUpdateThresholdUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'CacheUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'CollapseFeeRateUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'CrossChainSynthTransferEnabledUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'CrossDomainMessageGasLimitChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'DebtSnapshotStaleTimeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'EtherWrapperBurnFeeRateUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'EtherWrapperMaxETHUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'EtherWrapperMintFeeRateUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeDynamicFeeRoundsUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeDynamicFeeThresholdUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeDynamicFeeWeightDecayUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeFeeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeMaxDynamicFeeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FeePeriodDurationUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FlagRewardUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'InteractionDelayUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'IssuanceRatioUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidateRewardUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationDelayUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationEscrowDurationUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationPenaltyUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'LiquidationRatioUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'MinimumStakeTimeUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PriceDeviationThresholdUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'PureChainlinkPriceForAtomicSwapsEnabledUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'RateStalePeriodUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SelfLiquidationPenaltyUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SnxLiquidationPenaltyUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TargetThresholdUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'TradingRewardsEnabled'): EventFragment - getEvent(nameOrSignatureOrTopic: 'WaitingPeriodSecsUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'WrapperBurnFeeRateUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'WrapperMaxTokenAmountUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'WrapperMintFeeRateUpdated'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "aggregatorWarningFlags()": FunctionFragment; + "atomicEquivalentForDexPricing(bytes32)": FunctionFragment; + "atomicExchangeFeeRate(bytes32)": FunctionFragment; + "atomicMaxVolumePerBlock()": FunctionFragment; + "atomicTwapWindow()": FunctionFragment; + "atomicVolatilityConsiderationWindow(bytes32)": FunctionFragment; + "atomicVolatilityUpdateThreshold(bytes32)": FunctionFragment; + "collapseFeeRate(address)": FunctionFragment; + "crossChainSynthTransferEnabled(bytes32)": FunctionFragment; + "crossDomainMessageGasLimit(uint8)": FunctionFragment; + "debtSnapshotStaleTime()": FunctionFragment; + "etherWrapperBurnFeeRate()": FunctionFragment; + "etherWrapperMaxETH()": FunctionFragment; + "etherWrapperMintFeeRate()": FunctionFragment; + "exchangeDynamicFeeRounds()": FunctionFragment; + "exchangeDynamicFeeThreshold()": FunctionFragment; + "exchangeDynamicFeeWeightDecay()": FunctionFragment; + "exchangeFeeRate(bytes32)": FunctionFragment; + "exchangeMaxDynamicFee()": FunctionFragment; + "feePeriodDuration()": FunctionFragment; + "flagReward()": FunctionFragment; + "interactionDelay(address)": FunctionFragment; + "isResolverCached()": FunctionFragment; + "issuanceRatio()": FunctionFragment; + "liquidateReward()": FunctionFragment; + "liquidationDelay()": FunctionFragment; + "liquidationEscrowDuration()": FunctionFragment; + "liquidationPenalty()": FunctionFragment; + "liquidationRatio()": FunctionFragment; + "minimumStakeTime()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "priceDeviationThresholdFactor()": FunctionFragment; + "pureChainlinkPriceForAtomicSwapsEnabled(bytes32)": FunctionFragment; + "rateStalePeriod()": FunctionFragment; + "rebuildCache()": FunctionFragment; + "resolver()": FunctionFragment; + "resolverAddressesRequired()": FunctionFragment; + "selfLiquidationPenalty()": FunctionFragment; + "setAggregatorWarningFlags(address)": FunctionFragment; + "setAtomicEquivalentForDexPricing(bytes32,address)": FunctionFragment; + "setAtomicExchangeFeeRate(bytes32,uint256)": FunctionFragment; + "setAtomicMaxVolumePerBlock(uint256)": FunctionFragment; + "setAtomicTwapWindow(uint256)": FunctionFragment; + "setAtomicVolatilityConsiderationWindow(bytes32,uint256)": FunctionFragment; + "setAtomicVolatilityUpdateThreshold(bytes32,uint256)": FunctionFragment; + "setCollapseFeeRate(address,uint256)": FunctionFragment; + "setCrossChainSynthTransferEnabled(bytes32,uint256)": FunctionFragment; + "setCrossDomainMessageGasLimit(uint8,uint256)": FunctionFragment; + "setDebtSnapshotStaleTime(uint256)": FunctionFragment; + "setEtherWrapperBurnFeeRate(uint256)": FunctionFragment; + "setEtherWrapperMaxETH(uint256)": FunctionFragment; + "setEtherWrapperMintFeeRate(uint256)": FunctionFragment; + "setExchangeDynamicFeeRounds(uint256)": FunctionFragment; + "setExchangeDynamicFeeThreshold(uint256)": FunctionFragment; + "setExchangeDynamicFeeWeightDecay(uint256)": FunctionFragment; + "setExchangeFeeRateForSynths(bytes32[],uint256[])": FunctionFragment; + "setExchangeMaxDynamicFee(uint256)": FunctionFragment; + "setFeePeriodDuration(uint256)": FunctionFragment; + "setFlagReward(uint256)": FunctionFragment; + "setInteractionDelay(address,uint256)": FunctionFragment; + "setIssuanceRatio(uint256)": FunctionFragment; + "setLiquidateReward(uint256)": FunctionFragment; + "setLiquidationDelay(uint256)": FunctionFragment; + "setLiquidationEscrowDuration(uint256)": FunctionFragment; + "setLiquidationPenalty(uint256)": FunctionFragment; + "setLiquidationRatio(uint256)": FunctionFragment; + "setMinimumStakeTime(uint256)": FunctionFragment; + "setPriceDeviationThresholdFactor(uint256)": FunctionFragment; + "setPureChainlinkPriceForAtomicSwapsEnabled(bytes32,bool)": FunctionFragment; + "setRateStalePeriod(uint256)": FunctionFragment; + "setSelfLiquidationPenalty(uint256)": FunctionFragment; + "setSnxLiquidationPenalty(uint256)": FunctionFragment; + "setTargetThreshold(uint256)": FunctionFragment; + "setTradingRewardsEnabled(bool)": FunctionFragment; + "setWaitingPeriodSecs(uint256)": FunctionFragment; + "setWrapperBurnFeeRate(address,int256)": FunctionFragment; + "setWrapperMaxTokenAmount(address,uint256)": FunctionFragment; + "setWrapperMintFeeRate(address,int256)": FunctionFragment; + "snxLiquidationPenalty()": FunctionFragment; + "targetThreshold()": FunctionFragment; + "tradingRewardsEnabled()": FunctionFragment; + "waitingPeriodSecs()": FunctionFragment; + "wrapperBurnFeeRate(address)": FunctionFragment; + "wrapperMaxTokenAmount(address)": FunctionFragment; + "wrapperMintFeeRate(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "acceptOwnership" + | "aggregatorWarningFlags" + | "atomicEquivalentForDexPricing" + | "atomicExchangeFeeRate" + | "atomicMaxVolumePerBlock" + | "atomicTwapWindow" + | "atomicVolatilityConsiderationWindow" + | "atomicVolatilityUpdateThreshold" + | "collapseFeeRate" + | "crossChainSynthTransferEnabled" + | "crossDomainMessageGasLimit" + | "debtSnapshotStaleTime" + | "etherWrapperBurnFeeRate" + | "etherWrapperMaxETH" + | "etherWrapperMintFeeRate" + | "exchangeDynamicFeeRounds" + | "exchangeDynamicFeeThreshold" + | "exchangeDynamicFeeWeightDecay" + | "exchangeFeeRate" + | "exchangeMaxDynamicFee" + | "feePeriodDuration" + | "flagReward" + | "interactionDelay" + | "isResolverCached" + | "issuanceRatio" + | "liquidateReward" + | "liquidationDelay" + | "liquidationEscrowDuration" + | "liquidationPenalty" + | "liquidationRatio" + | "minimumStakeTime" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "priceDeviationThresholdFactor" + | "pureChainlinkPriceForAtomicSwapsEnabled" + | "rateStalePeriod" + | "rebuildCache" + | "resolver" + | "resolverAddressesRequired" + | "selfLiquidationPenalty" + | "setAggregatorWarningFlags" + | "setAtomicEquivalentForDexPricing" + | "setAtomicExchangeFeeRate" + | "setAtomicMaxVolumePerBlock" + | "setAtomicTwapWindow" + | "setAtomicVolatilityConsiderationWindow" + | "setAtomicVolatilityUpdateThreshold" + | "setCollapseFeeRate" + | "setCrossChainSynthTransferEnabled" + | "setCrossDomainMessageGasLimit" + | "setDebtSnapshotStaleTime" + | "setEtherWrapperBurnFeeRate" + | "setEtherWrapperMaxETH" + | "setEtherWrapperMintFeeRate" + | "setExchangeDynamicFeeRounds" + | "setExchangeDynamicFeeThreshold" + | "setExchangeDynamicFeeWeightDecay" + | "setExchangeFeeRateForSynths" + | "setExchangeMaxDynamicFee" + | "setFeePeriodDuration" + | "setFlagReward" + | "setInteractionDelay" + | "setIssuanceRatio" + | "setLiquidateReward" + | "setLiquidationDelay" + | "setLiquidationEscrowDuration" + | "setLiquidationPenalty" + | "setLiquidationRatio" + | "setMinimumStakeTime" + | "setPriceDeviationThresholdFactor" + | "setPureChainlinkPriceForAtomicSwapsEnabled" + | "setRateStalePeriod" + | "setSelfLiquidationPenalty" + | "setSnxLiquidationPenalty" + | "setTargetThreshold" + | "setTradingRewardsEnabled" + | "setWaitingPeriodSecs" + | "setWrapperBurnFeeRate" + | "setWrapperMaxTokenAmount" + | "setWrapperMintFeeRate" + | "snxLiquidationPenalty" + | "targetThreshold" + | "tradingRewardsEnabled" + | "waitingPeriodSecs" + | "wrapperBurnFeeRate" + | "wrapperMaxTokenAmount" + | "wrapperMintFeeRate" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "aggregatorWarningFlags", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "atomicEquivalentForDexPricing", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "atomicExchangeFeeRate", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "atomicMaxVolumePerBlock", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "atomicTwapWindow", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "atomicVolatilityConsiderationWindow", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "atomicVolatilityUpdateThreshold", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "collapseFeeRate", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "crossChainSynthTransferEnabled", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "crossDomainMessageGasLimit", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "debtSnapshotStaleTime", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "etherWrapperBurnFeeRate", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "etherWrapperMaxETH", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "etherWrapperMintFeeRate", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "exchangeDynamicFeeRounds", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "exchangeDynamicFeeThreshold", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "exchangeDynamicFeeWeightDecay", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "exchangeFeeRate", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "exchangeMaxDynamicFee", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "feePeriodDuration", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "flagReward", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "interactionDelay", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "isResolverCached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "issuanceRatio", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidateReward", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationDelay", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationEscrowDuration", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationPenalty", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "liquidationRatio", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "minimumStakeTime", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "priceDeviationThresholdFactor", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pureChainlinkPriceForAtomicSwapsEnabled", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "rateStalePeriod", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rebuildCache", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "resolver", values?: undefined): string; + encodeFunctionData( + functionFragment: "resolverAddressesRequired", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "selfLiquidationPenalty", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setAggregatorWarningFlags", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setAtomicEquivalentForDexPricing", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "setAtomicExchangeFeeRate", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setAtomicMaxVolumePerBlock", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setAtomicTwapWindow", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setAtomicVolatilityConsiderationWindow", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setAtomicVolatilityUpdateThreshold", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setCollapseFeeRate", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setCrossChainSynthTransferEnabled", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setCrossDomainMessageGasLimit", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setDebtSnapshotStaleTime", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setEtherWrapperBurnFeeRate", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setEtherWrapperMaxETH", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setEtherWrapperMintFeeRate", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setExchangeDynamicFeeRounds", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setExchangeDynamicFeeThreshold", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setExchangeDynamicFeeWeightDecay", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setExchangeFeeRateForSynths", + values: [BytesLike[], BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "setExchangeMaxDynamicFee", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setFeePeriodDuration", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setFlagReward", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setInteractionDelay", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setIssuanceRatio", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidateReward", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationDelay", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationEscrowDuration", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationPenalty", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setLiquidationRatio", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setMinimumStakeTime", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setPriceDeviationThresholdFactor", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setPureChainlinkPriceForAtomicSwapsEnabled", + values: [BytesLike, boolean] + ): string; + encodeFunctionData( + functionFragment: "setRateStalePeriod", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setSelfLiquidationPenalty", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setSnxLiquidationPenalty", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTargetThreshold", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTradingRewardsEnabled", + values: [boolean] + ): string; + encodeFunctionData( + functionFragment: "setWaitingPeriodSecs", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setWrapperBurnFeeRate", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setWrapperMaxTokenAmount", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setWrapperMintFeeRate", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "snxLiquidationPenalty", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "targetThreshold", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "tradingRewardsEnabled", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "waitingPeriodSecs", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "wrapperBurnFeeRate", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "wrapperMaxTokenAmount", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "wrapperMintFeeRate", + values: [string] + ): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "aggregatorWarningFlags", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "atomicEquivalentForDexPricing", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "atomicExchangeFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "atomicMaxVolumePerBlock", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "atomicTwapWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "atomicVolatilityConsiderationWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "atomicVolatilityUpdateThreshold", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "collapseFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "crossChainSynthTransferEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "crossDomainMessageGasLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "debtSnapshotStaleTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "etherWrapperBurnFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "etherWrapperMaxETH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "etherWrapperMintFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeDynamicFeeRounds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeDynamicFeeThreshold", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeDynamicFeeWeightDecay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeMaxDynamicFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "feePeriodDuration", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "flagReward", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "interactionDelay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isResolverCached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "issuanceRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidateReward", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationDelay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationEscrowDuration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationPenalty", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "liquidationRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "minimumStakeTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "priceDeviationThresholdFactor", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pureChainlinkPriceForAtomicSwapsEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rateStalePeriod", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rebuildCache", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "resolver", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resolverAddressesRequired", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "selfLiquidationPenalty", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAggregatorWarningFlags", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAtomicEquivalentForDexPricing", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAtomicExchangeFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAtomicMaxVolumePerBlock", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAtomicTwapWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAtomicVolatilityConsiderationWindow", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAtomicVolatilityUpdateThreshold", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setCollapseFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setCrossChainSynthTransferEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setCrossDomainMessageGasLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setDebtSnapshotStaleTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setEtherWrapperBurnFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setEtherWrapperMaxETH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setEtherWrapperMintFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setExchangeDynamicFeeRounds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setExchangeDynamicFeeThreshold", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setExchangeDynamicFeeWeightDecay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setExchangeFeeRateForSynths", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setExchangeMaxDynamicFee", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setFeePeriodDuration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setFlagReward", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setInteractionDelay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setIssuanceRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidateReward", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationDelay", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationEscrowDuration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationPenalty", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationRatio", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMinimumStakeTime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setPriceDeviationThresholdFactor", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setPureChainlinkPriceForAtomicSwapsEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setRateStalePeriod", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSelfLiquidationPenalty", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setSnxLiquidationPenalty", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTargetThreshold", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTradingRewardsEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setWaitingPeriodSecs", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setWrapperBurnFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setWrapperMaxTokenAmount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setWrapperMintFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "snxLiquidationPenalty", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "targetThreshold", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tradingRewardsEnabled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "waitingPeriodSecs", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "wrapperBurnFeeRate", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "wrapperMaxTokenAmount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "wrapperMintFeeRate", + data: BytesLike + ): Result; + + events: { + "AggregatorWarningFlagsUpdated(address)": EventFragment; + "AtomicEquivalentForDexPricingUpdated(bytes32,address)": EventFragment; + "AtomicExchangeFeeUpdated(bytes32,uint256)": EventFragment; + "AtomicMaxVolumePerBlockUpdated(uint256)": EventFragment; + "AtomicTwapWindowUpdated(uint256)": EventFragment; + "AtomicVolatilityConsiderationWindowUpdated(bytes32,uint256)": EventFragment; + "AtomicVolatilityUpdateThresholdUpdated(bytes32,uint256)": EventFragment; + "CacheUpdated(bytes32,address)": EventFragment; + "CollapseFeeRateUpdated(uint256)": EventFragment; + "CrossChainSynthTransferEnabledUpdated(bytes32,uint256)": EventFragment; + "CrossDomainMessageGasLimitChanged(uint8,uint256)": EventFragment; + "DebtSnapshotStaleTimeUpdated(uint256)": EventFragment; + "EtherWrapperBurnFeeRateUpdated(uint256)": EventFragment; + "EtherWrapperMaxETHUpdated(uint256)": EventFragment; + "EtherWrapperMintFeeRateUpdated(uint256)": EventFragment; + "ExchangeDynamicFeeRoundsUpdated(uint256)": EventFragment; + "ExchangeDynamicFeeThresholdUpdated(uint256)": EventFragment; + "ExchangeDynamicFeeWeightDecayUpdated(uint256)": EventFragment; + "ExchangeFeeUpdated(bytes32,uint256)": EventFragment; + "ExchangeMaxDynamicFeeUpdated(uint256)": EventFragment; + "FeePeriodDurationUpdated(uint256)": EventFragment; + "FlagRewardUpdated(uint256)": EventFragment; + "InteractionDelayUpdated(uint256)": EventFragment; + "IssuanceRatioUpdated(uint256)": EventFragment; + "LiquidateRewardUpdated(uint256)": EventFragment; + "LiquidationDelayUpdated(uint256)": EventFragment; + "LiquidationEscrowDurationUpdated(uint256)": EventFragment; + "LiquidationPenaltyUpdated(uint256)": EventFragment; + "LiquidationRatioUpdated(uint256)": EventFragment; + "MinimumStakeTimeUpdated(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "PriceDeviationThresholdUpdated(uint256)": EventFragment; + "PureChainlinkPriceForAtomicSwapsEnabledUpdated(bytes32,bool)": EventFragment; + "RateStalePeriodUpdated(uint256)": EventFragment; + "SelfLiquidationPenaltyUpdated(uint256)": EventFragment; + "SnxLiquidationPenaltyUpdated(uint256)": EventFragment; + "TargetThresholdUpdated(uint256)": EventFragment; + "TradingRewardsEnabled(bool)": EventFragment; + "WaitingPeriodSecsUpdated(uint256)": EventFragment; + "WrapperBurnFeeRateUpdated(address,int256)": EventFragment; + "WrapperMaxTokenAmountUpdated(address,uint256)": EventFragment; + "WrapperMintFeeRateUpdated(address,int256)": EventFragment; + }; + + getEvent( + nameOrSignatureOrTopic: "AggregatorWarningFlagsUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "AtomicEquivalentForDexPricingUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "AtomicExchangeFeeUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "AtomicMaxVolumePerBlockUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "AtomicTwapWindowUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "AtomicVolatilityConsiderationWindowUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "AtomicVolatilityUpdateThresholdUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "CollapseFeeRateUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "CrossChainSynthTransferEnabledUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "CrossDomainMessageGasLimitChanged" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "DebtSnapshotStaleTimeUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "EtherWrapperBurnFeeRateUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "EtherWrapperMaxETHUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "EtherWrapperMintFeeRateUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "ExchangeDynamicFeeRoundsUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "ExchangeDynamicFeeThresholdUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "ExchangeDynamicFeeWeightDecayUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeFeeUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "ExchangeMaxDynamicFeeUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeePeriodDurationUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FlagRewardUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "InteractionDelayUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "IssuanceRatioUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidateRewardUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidationDelayUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "LiquidationEscrowDurationUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidationPenaltyUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiquidationRatioUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MinimumStakeTimeUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "PriceDeviationThresholdUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "PureChainlinkPriceForAtomicSwapsEnabledUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "RateStalePeriodUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "SelfLiquidationPenaltyUpdated" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "SnxLiquidationPenaltyUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "TargetThresholdUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TradingRewardsEnabled"): EventFragment; + getEvent(nameOrSignatureOrTopic: "WaitingPeriodSecsUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "WrapperBurnFeeRateUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "WrapperMaxTokenAmountUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "WrapperMintFeeRateUpdated"): EventFragment; } export interface AggregatorWarningFlagsUpdatedEventObject { - flags: string + flags: string; } export type AggregatorWarningFlagsUpdatedEvent = TypedEvent< - [string], - AggregatorWarningFlagsUpdatedEventObject -> + [string], + AggregatorWarningFlagsUpdatedEventObject +>; export type AggregatorWarningFlagsUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface AtomicEquivalentForDexPricingUpdatedEventObject { - synthKey: string - equivalent: string + synthKey: string; + equivalent: string; } export type AtomicEquivalentForDexPricingUpdatedEvent = TypedEvent< - [string, string], - AtomicEquivalentForDexPricingUpdatedEventObject -> + [string, string], + AtomicEquivalentForDexPricingUpdatedEventObject +>; export type AtomicEquivalentForDexPricingUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface AtomicExchangeFeeUpdatedEventObject { - synthKey: string - newExchangeFeeRate: BigNumber + synthKey: string; + newExchangeFeeRate: BigNumber; } export type AtomicExchangeFeeUpdatedEvent = TypedEvent< - [string, BigNumber], - AtomicExchangeFeeUpdatedEventObject -> + [string, BigNumber], + AtomicExchangeFeeUpdatedEventObject +>; -export type AtomicExchangeFeeUpdatedEventFilter = TypedEventFilter +export type AtomicExchangeFeeUpdatedEventFilter = + TypedEventFilter; export interface AtomicMaxVolumePerBlockUpdatedEventObject { - newMaxVolume: BigNumber + newMaxVolume: BigNumber; } export type AtomicMaxVolumePerBlockUpdatedEvent = TypedEvent< - [BigNumber], - AtomicMaxVolumePerBlockUpdatedEventObject -> + [BigNumber], + AtomicMaxVolumePerBlockUpdatedEventObject +>; export type AtomicMaxVolumePerBlockUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface AtomicTwapWindowUpdatedEventObject { - newWindow: BigNumber + newWindow: BigNumber; } export type AtomicTwapWindowUpdatedEvent = TypedEvent< - [BigNumber], - AtomicTwapWindowUpdatedEventObject -> + [BigNumber], + AtomicTwapWindowUpdatedEventObject +>; -export type AtomicTwapWindowUpdatedEventFilter = TypedEventFilter +export type AtomicTwapWindowUpdatedEventFilter = + TypedEventFilter; export interface AtomicVolatilityConsiderationWindowUpdatedEventObject { - synthKey: string - newVolatilityConsiderationWindow: BigNumber + synthKey: string; + newVolatilityConsiderationWindow: BigNumber; } export type AtomicVolatilityConsiderationWindowUpdatedEvent = TypedEvent< - [string, BigNumber], - AtomicVolatilityConsiderationWindowUpdatedEventObject -> + [string, BigNumber], + AtomicVolatilityConsiderationWindowUpdatedEventObject +>; export type AtomicVolatilityConsiderationWindowUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface AtomicVolatilityUpdateThresholdUpdatedEventObject { - synthKey: string - newVolatilityUpdateThreshold: BigNumber + synthKey: string; + newVolatilityUpdateThreshold: BigNumber; } export type AtomicVolatilityUpdateThresholdUpdatedEvent = TypedEvent< - [string, BigNumber], - AtomicVolatilityUpdateThresholdUpdatedEventObject -> + [string, BigNumber], + AtomicVolatilityUpdateThresholdUpdatedEventObject +>; export type AtomicVolatilityUpdateThresholdUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface CacheUpdatedEventObject { - name: string - destination: string + name: string; + destination: string; } -export type CacheUpdatedEvent = TypedEvent<[string, string], CacheUpdatedEventObject> +export type CacheUpdatedEvent = TypedEvent< + [string, string], + CacheUpdatedEventObject +>; -export type CacheUpdatedEventFilter = TypedEventFilter +export type CacheUpdatedEventFilter = TypedEventFilter; export interface CollapseFeeRateUpdatedEventObject { - collapseFeeRate: BigNumber + collapseFeeRate: BigNumber; } -export type CollapseFeeRateUpdatedEvent = TypedEvent<[BigNumber], CollapseFeeRateUpdatedEventObject> +export type CollapseFeeRateUpdatedEvent = TypedEvent< + [BigNumber], + CollapseFeeRateUpdatedEventObject +>; -export type CollapseFeeRateUpdatedEventFilter = TypedEventFilter +export type CollapseFeeRateUpdatedEventFilter = + TypedEventFilter; export interface CrossChainSynthTransferEnabledUpdatedEventObject { - synthKey: string - value: BigNumber + synthKey: string; + value: BigNumber; } export type CrossChainSynthTransferEnabledUpdatedEvent = TypedEvent< - [string, BigNumber], - CrossChainSynthTransferEnabledUpdatedEventObject -> + [string, BigNumber], + CrossChainSynthTransferEnabledUpdatedEventObject +>; export type CrossChainSynthTransferEnabledUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface CrossDomainMessageGasLimitChangedEventObject { - gasLimitType: number - newLimit: BigNumber + gasLimitType: number; + newLimit: BigNumber; } export type CrossDomainMessageGasLimitChangedEvent = TypedEvent< - [number, BigNumber], - CrossDomainMessageGasLimitChangedEventObject -> + [number, BigNumber], + CrossDomainMessageGasLimitChangedEventObject +>; export type CrossDomainMessageGasLimitChangedEventFilter = - TypedEventFilter + TypedEventFilter; export interface DebtSnapshotStaleTimeUpdatedEventObject { - debtSnapshotStaleTime: BigNumber + debtSnapshotStaleTime: BigNumber; } export type DebtSnapshotStaleTimeUpdatedEvent = TypedEvent< - [BigNumber], - DebtSnapshotStaleTimeUpdatedEventObject -> + [BigNumber], + DebtSnapshotStaleTimeUpdatedEventObject +>; export type DebtSnapshotStaleTimeUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface EtherWrapperBurnFeeRateUpdatedEventObject { - rate: BigNumber + rate: BigNumber; } export type EtherWrapperBurnFeeRateUpdatedEvent = TypedEvent< - [BigNumber], - EtherWrapperBurnFeeRateUpdatedEventObject -> + [BigNumber], + EtherWrapperBurnFeeRateUpdatedEventObject +>; export type EtherWrapperBurnFeeRateUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface EtherWrapperMaxETHUpdatedEventObject { - maxETH: BigNumber + maxETH: BigNumber; } export type EtherWrapperMaxETHUpdatedEvent = TypedEvent< - [BigNumber], - EtherWrapperMaxETHUpdatedEventObject -> + [BigNumber], + EtherWrapperMaxETHUpdatedEventObject +>; -export type EtherWrapperMaxETHUpdatedEventFilter = TypedEventFilter +export type EtherWrapperMaxETHUpdatedEventFilter = + TypedEventFilter; export interface EtherWrapperMintFeeRateUpdatedEventObject { - rate: BigNumber + rate: BigNumber; } export type EtherWrapperMintFeeRateUpdatedEvent = TypedEvent< - [BigNumber], - EtherWrapperMintFeeRateUpdatedEventObject -> + [BigNumber], + EtherWrapperMintFeeRateUpdatedEventObject +>; export type EtherWrapperMintFeeRateUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface ExchangeDynamicFeeRoundsUpdatedEventObject { - dynamicFeeRounds: BigNumber + dynamicFeeRounds: BigNumber; } export type ExchangeDynamicFeeRoundsUpdatedEvent = TypedEvent< - [BigNumber], - ExchangeDynamicFeeRoundsUpdatedEventObject -> + [BigNumber], + ExchangeDynamicFeeRoundsUpdatedEventObject +>; export type ExchangeDynamicFeeRoundsUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface ExchangeDynamicFeeThresholdUpdatedEventObject { - dynamicFeeThreshold: BigNumber + dynamicFeeThreshold: BigNumber; } export type ExchangeDynamicFeeThresholdUpdatedEvent = TypedEvent< - [BigNumber], - ExchangeDynamicFeeThresholdUpdatedEventObject -> + [BigNumber], + ExchangeDynamicFeeThresholdUpdatedEventObject +>; export type ExchangeDynamicFeeThresholdUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface ExchangeDynamicFeeWeightDecayUpdatedEventObject { - dynamicFeeWeightDecay: BigNumber + dynamicFeeWeightDecay: BigNumber; } export type ExchangeDynamicFeeWeightDecayUpdatedEvent = TypedEvent< - [BigNumber], - ExchangeDynamicFeeWeightDecayUpdatedEventObject -> + [BigNumber], + ExchangeDynamicFeeWeightDecayUpdatedEventObject +>; export type ExchangeDynamicFeeWeightDecayUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface ExchangeFeeUpdatedEventObject { - synthKey: string - newExchangeFeeRate: BigNumber + synthKey: string; + newExchangeFeeRate: BigNumber; } -export type ExchangeFeeUpdatedEvent = TypedEvent<[string, BigNumber], ExchangeFeeUpdatedEventObject> +export type ExchangeFeeUpdatedEvent = TypedEvent< + [string, BigNumber], + ExchangeFeeUpdatedEventObject +>; -export type ExchangeFeeUpdatedEventFilter = TypedEventFilter +export type ExchangeFeeUpdatedEventFilter = + TypedEventFilter; export interface ExchangeMaxDynamicFeeUpdatedEventObject { - maxDynamicFee: BigNumber + maxDynamicFee: BigNumber; } export type ExchangeMaxDynamicFeeUpdatedEvent = TypedEvent< - [BigNumber], - ExchangeMaxDynamicFeeUpdatedEventObject -> + [BigNumber], + ExchangeMaxDynamicFeeUpdatedEventObject +>; export type ExchangeMaxDynamicFeeUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface FeePeriodDurationUpdatedEventObject { - newFeePeriodDuration: BigNumber + newFeePeriodDuration: BigNumber; } export type FeePeriodDurationUpdatedEvent = TypedEvent< - [BigNumber], - FeePeriodDurationUpdatedEventObject -> + [BigNumber], + FeePeriodDurationUpdatedEventObject +>; -export type FeePeriodDurationUpdatedEventFilter = TypedEventFilter +export type FeePeriodDurationUpdatedEventFilter = + TypedEventFilter; export interface FlagRewardUpdatedEventObject { - newReward: BigNumber + newReward: BigNumber; } -export type FlagRewardUpdatedEvent = TypedEvent<[BigNumber], FlagRewardUpdatedEventObject> +export type FlagRewardUpdatedEvent = TypedEvent< + [BigNumber], + FlagRewardUpdatedEventObject +>; -export type FlagRewardUpdatedEventFilter = TypedEventFilter +export type FlagRewardUpdatedEventFilter = + TypedEventFilter; export interface InteractionDelayUpdatedEventObject { - interactionDelay: BigNumber + interactionDelay: BigNumber; } export type InteractionDelayUpdatedEvent = TypedEvent< - [BigNumber], - InteractionDelayUpdatedEventObject -> + [BigNumber], + InteractionDelayUpdatedEventObject +>; -export type InteractionDelayUpdatedEventFilter = TypedEventFilter +export type InteractionDelayUpdatedEventFilter = + TypedEventFilter; export interface IssuanceRatioUpdatedEventObject { - newRatio: BigNumber + newRatio: BigNumber; } -export type IssuanceRatioUpdatedEvent = TypedEvent<[BigNumber], IssuanceRatioUpdatedEventObject> +export type IssuanceRatioUpdatedEvent = TypedEvent< + [BigNumber], + IssuanceRatioUpdatedEventObject +>; -export type IssuanceRatioUpdatedEventFilter = TypedEventFilter +export type IssuanceRatioUpdatedEventFilter = + TypedEventFilter; export interface LiquidateRewardUpdatedEventObject { - newReward: BigNumber + newReward: BigNumber; } -export type LiquidateRewardUpdatedEvent = TypedEvent<[BigNumber], LiquidateRewardUpdatedEventObject> +export type LiquidateRewardUpdatedEvent = TypedEvent< + [BigNumber], + LiquidateRewardUpdatedEventObject +>; -export type LiquidateRewardUpdatedEventFilter = TypedEventFilter +export type LiquidateRewardUpdatedEventFilter = + TypedEventFilter; export interface LiquidationDelayUpdatedEventObject { - newDelay: BigNumber + newDelay: BigNumber; } export type LiquidationDelayUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationDelayUpdatedEventObject -> + [BigNumber], + LiquidationDelayUpdatedEventObject +>; -export type LiquidationDelayUpdatedEventFilter = TypedEventFilter +export type LiquidationDelayUpdatedEventFilter = + TypedEventFilter; export interface LiquidationEscrowDurationUpdatedEventObject { - newDuration: BigNumber + newDuration: BigNumber; } export type LiquidationEscrowDurationUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationEscrowDurationUpdatedEventObject -> + [BigNumber], + LiquidationEscrowDurationUpdatedEventObject +>; export type LiquidationEscrowDurationUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface LiquidationPenaltyUpdatedEventObject { - newPenalty: BigNumber + newPenalty: BigNumber; } export type LiquidationPenaltyUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationPenaltyUpdatedEventObject -> + [BigNumber], + LiquidationPenaltyUpdatedEventObject +>; -export type LiquidationPenaltyUpdatedEventFilter = TypedEventFilter +export type LiquidationPenaltyUpdatedEventFilter = + TypedEventFilter; export interface LiquidationRatioUpdatedEventObject { - newRatio: BigNumber + newRatio: BigNumber; } export type LiquidationRatioUpdatedEvent = TypedEvent< - [BigNumber], - LiquidationRatioUpdatedEventObject -> + [BigNumber], + LiquidationRatioUpdatedEventObject +>; -export type LiquidationRatioUpdatedEventFilter = TypedEventFilter +export type LiquidationRatioUpdatedEventFilter = + TypedEventFilter; export interface MinimumStakeTimeUpdatedEventObject { - minimumStakeTime: BigNumber + minimumStakeTime: BigNumber; } export type MinimumStakeTimeUpdatedEvent = TypedEvent< - [BigNumber], - MinimumStakeTimeUpdatedEventObject -> + [BigNumber], + MinimumStakeTimeUpdatedEventObject +>; -export type MinimumStakeTimeUpdatedEventFilter = TypedEventFilter +export type MinimumStakeTimeUpdatedEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface PriceDeviationThresholdUpdatedEventObject { - threshold: BigNumber + threshold: BigNumber; } export type PriceDeviationThresholdUpdatedEvent = TypedEvent< - [BigNumber], - PriceDeviationThresholdUpdatedEventObject -> + [BigNumber], + PriceDeviationThresholdUpdatedEventObject +>; export type PriceDeviationThresholdUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventObject { - synthKey: string - enabled: boolean + synthKey: string; + enabled: boolean; } export type PureChainlinkPriceForAtomicSwapsEnabledUpdatedEvent = TypedEvent< - [string, boolean], - PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventObject -> + [string, boolean], + PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventObject +>; export type PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface RateStalePeriodUpdatedEventObject { - rateStalePeriod: BigNumber + rateStalePeriod: BigNumber; } -export type RateStalePeriodUpdatedEvent = TypedEvent<[BigNumber], RateStalePeriodUpdatedEventObject> +export type RateStalePeriodUpdatedEvent = TypedEvent< + [BigNumber], + RateStalePeriodUpdatedEventObject +>; -export type RateStalePeriodUpdatedEventFilter = TypedEventFilter +export type RateStalePeriodUpdatedEventFilter = + TypedEventFilter; export interface SelfLiquidationPenaltyUpdatedEventObject { - newPenalty: BigNumber + newPenalty: BigNumber; } export type SelfLiquidationPenaltyUpdatedEvent = TypedEvent< - [BigNumber], - SelfLiquidationPenaltyUpdatedEventObject -> + [BigNumber], + SelfLiquidationPenaltyUpdatedEventObject +>; export type SelfLiquidationPenaltyUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface SnxLiquidationPenaltyUpdatedEventObject { - newPenalty: BigNumber + newPenalty: BigNumber; } export type SnxLiquidationPenaltyUpdatedEvent = TypedEvent< - [BigNumber], - SnxLiquidationPenaltyUpdatedEventObject -> + [BigNumber], + SnxLiquidationPenaltyUpdatedEventObject +>; export type SnxLiquidationPenaltyUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface TargetThresholdUpdatedEventObject { - newTargetThreshold: BigNumber + newTargetThreshold: BigNumber; } -export type TargetThresholdUpdatedEvent = TypedEvent<[BigNumber], TargetThresholdUpdatedEventObject> +export type TargetThresholdUpdatedEvent = TypedEvent< + [BigNumber], + TargetThresholdUpdatedEventObject +>; -export type TargetThresholdUpdatedEventFilter = TypedEventFilter +export type TargetThresholdUpdatedEventFilter = + TypedEventFilter; export interface TradingRewardsEnabledEventObject { - enabled: boolean + enabled: boolean; } -export type TradingRewardsEnabledEvent = TypedEvent<[boolean], TradingRewardsEnabledEventObject> +export type TradingRewardsEnabledEvent = TypedEvent< + [boolean], + TradingRewardsEnabledEventObject +>; -export type TradingRewardsEnabledEventFilter = TypedEventFilter +export type TradingRewardsEnabledEventFilter = + TypedEventFilter; export interface WaitingPeriodSecsUpdatedEventObject { - waitingPeriodSecs: BigNumber + waitingPeriodSecs: BigNumber; } export type WaitingPeriodSecsUpdatedEvent = TypedEvent< - [BigNumber], - WaitingPeriodSecsUpdatedEventObject -> + [BigNumber], + WaitingPeriodSecsUpdatedEventObject +>; -export type WaitingPeriodSecsUpdatedEventFilter = TypedEventFilter +export type WaitingPeriodSecsUpdatedEventFilter = + TypedEventFilter; export interface WrapperBurnFeeRateUpdatedEventObject { - wrapper: string - rate: BigNumber + wrapper: string; + rate: BigNumber; } export type WrapperBurnFeeRateUpdatedEvent = TypedEvent< - [string, BigNumber], - WrapperBurnFeeRateUpdatedEventObject -> + [string, BigNumber], + WrapperBurnFeeRateUpdatedEventObject +>; -export type WrapperBurnFeeRateUpdatedEventFilter = TypedEventFilter +export type WrapperBurnFeeRateUpdatedEventFilter = + TypedEventFilter; export interface WrapperMaxTokenAmountUpdatedEventObject { - wrapper: string - maxTokenAmount: BigNumber + wrapper: string; + maxTokenAmount: BigNumber; } export type WrapperMaxTokenAmountUpdatedEvent = TypedEvent< - [string, BigNumber], - WrapperMaxTokenAmountUpdatedEventObject -> + [string, BigNumber], + WrapperMaxTokenAmountUpdatedEventObject +>; export type WrapperMaxTokenAmountUpdatedEventFilter = - TypedEventFilter + TypedEventFilter; export interface WrapperMintFeeRateUpdatedEventObject { - wrapper: string - rate: BigNumber + wrapper: string; + rate: BigNumber; } export type WrapperMintFeeRateUpdatedEvent = TypedEvent< - [string, BigNumber], - WrapperMintFeeRateUpdatedEventObject -> + [string, BigNumber], + WrapperMintFeeRateUpdatedEventObject +>; -export type WrapperMintFeeRateUpdatedEventFilter = TypedEventFilter +export type WrapperMintFeeRateUpdatedEventFilter = + TypedEventFilter; export interface SystemSettings extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SystemSettingsInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - aggregatorWarningFlags(overrides?: CallOverrides): Promise<[string]> - - atomicEquivalentForDexPricing( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]> - - atomicExchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise<[BigNumber]> - - atomicTwapWindow(overrides?: CallOverrides): Promise<[BigNumber]> - - atomicVolatilityConsiderationWindow( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - atomicVolatilityUpdateThreshold( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - collapseFeeRate( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - crossChainSynthTransferEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - crossDomainMessageGasLimit( - gasLimitType: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - debtSnapshotStaleTime(overrides?: CallOverrides): Promise<[BigNumber]> - - etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise<[BigNumber]> - - etherWrapperMaxETH(overrides?: CallOverrides): Promise<[BigNumber]> - - etherWrapperMintFeeRate(overrides?: CallOverrides): Promise<[BigNumber]> - - exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise<[BigNumber]> - - exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise<[BigNumber]> - - exchangeDynamicFeeWeightDecay(overrides?: CallOverrides): Promise<[BigNumber]> - - exchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - exchangeMaxDynamicFee(overrides?: CallOverrides): Promise<[BigNumber]> - - feePeriodDuration(overrides?: CallOverrides): Promise<[BigNumber]> - - flagReward(overrides?: CallOverrides): Promise<[BigNumber]> - - interactionDelay( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - - isResolverCached(overrides?: CallOverrides): Promise<[boolean]> - - issuanceRatio(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidateReward(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationDelay(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationEscrowDuration(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationPenalty(overrides?: CallOverrides): Promise<[BigNumber]> - - liquidationRatio(overrides?: CallOverrides): Promise<[BigNumber]> - - minimumStakeTime(overrides?: CallOverrides): Promise<[BigNumber]> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise<[BigNumber]> - - pureChainlinkPriceForAtomicSwapsEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - rateStalePeriod(overrides?: CallOverrides): Promise<[BigNumber]> - - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resolver(overrides?: CallOverrides): Promise<[string]> - - resolverAddressesRequired( - overrides?: CallOverrides - ): Promise<[string[]] & { addresses: string[] }> - - selfLiquidationPenalty(overrides?: CallOverrides): Promise<[BigNumber]> + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - setAggregatorWarningFlags( - _flags: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + interface: SystemSettingsInterface; - setAtomicEquivalentForDexPricing( - _currencyKey: PromiseOrValue, - _equivalent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - setAtomicExchangeFeeRate( - _currencyKey: PromiseOrValue, - _exchangeFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - setAtomicMaxVolumePerBlock( - _maxVolume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; - setAtomicTwapWindow( - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - setAtomicVolatilityConsiderationWindow( - _currencyKey: PromiseOrValue, - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + aggregatorWarningFlags(overrides?: CallOverrides): Promise<[string]>; - setAtomicVolatilityUpdateThreshold( - _currencyKey: PromiseOrValue, - _threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setCollapseFeeRate( - _collateral: PromiseOrValue, - _collapseFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setCrossChainSynthTransferEnabled( - _currencyKey: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setCrossDomainMessageGasLimit( - _gasLimitType: PromiseOrValue, - _crossDomainMessageGasLimit: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setDebtSnapshotStaleTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperBurnFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMaxETH( - _maxETH: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMintFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeRounds( - rounds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeThreshold( - threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeWeightDecay( - weightDecay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeFeeRateForSynths( - synthKeys: PromiseOrValue[], - exchangeFeeRates: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeMaxDynamicFee( - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFeePeriodDuration( - _feePeriodDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFlagReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setInteractionDelay( - _collateral: PromiseOrValue, - _interactionDelay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setIssuanceRatio( - ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidateReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationDelay( - time: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationEscrowDuration( - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationRatio( - _liquidationRatio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinimumStakeTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPriceDeviationThresholdFactor( - _priceDeviationThresholdFactor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPureChainlinkPriceForAtomicSwapsEnabled( - _currencyKey: PromiseOrValue, - _enabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setRateStalePeriod( - period: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSelfLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSnxLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTargetThreshold( - percent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTradingRewardsEnabled( - _tradingRewardsEnabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWaitingPeriodSecs( - _waitingPeriodSecs: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperBurnFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperMaxTokenAmount( - _wrapper: PromiseOrValue, - _maxTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicEquivalentForDexPricing( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[string]>; - setWrapperMintFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicExchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - snxLiquidationPenalty(overrides?: CallOverrides): Promise<[BigNumber]> + atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise<[BigNumber]>; - targetThreshold(overrides?: CallOverrides): Promise<[BigNumber]> + atomicTwapWindow(overrides?: CallOverrides): Promise<[BigNumber]>; - tradingRewardsEnabled(overrides?: CallOverrides): Promise<[boolean]> + atomicVolatilityConsiderationWindow( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - waitingPeriodSecs(overrides?: CallOverrides): Promise<[BigNumber]> + atomicVolatilityUpdateThreshold( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - wrapperBurnFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> + collapseFeeRate( + collateral: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - wrapperMaxTokenAmount( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> + crossChainSynthTransferEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - wrapperMintFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]> - } + crossDomainMessageGasLimit( + gasLimitType: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - CONTRACT_NAME(overrides?: CallOverrides): Promise + debtSnapshotStaleTime(overrides?: CallOverrides): Promise<[BigNumber]>; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise<[BigNumber]>; - aggregatorWarningFlags(overrides?: CallOverrides): Promise + etherWrapperMaxETH(overrides?: CallOverrides): Promise<[BigNumber]>; - atomicEquivalentForDexPricing( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + etherWrapperMintFeeRate(overrides?: CallOverrides): Promise<[BigNumber]>; - atomicExchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise<[BigNumber]>; - atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise + exchangeDynamicFeeThreshold( + overrides?: CallOverrides + ): Promise<[BigNumber]>; - atomicTwapWindow(overrides?: CallOverrides): Promise + exchangeDynamicFeeWeightDecay( + overrides?: CallOverrides + ): Promise<[BigNumber]>; - atomicVolatilityConsiderationWindow( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + exchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - atomicVolatilityUpdateThreshold( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + exchangeMaxDynamicFee(overrides?: CallOverrides): Promise<[BigNumber]>; - collapseFeeRate(collateral: PromiseOrValue, overrides?: CallOverrides): Promise + feePeriodDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - crossChainSynthTransferEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + flagReward(overrides?: CallOverrides): Promise<[BigNumber]>; - crossDomainMessageGasLimit( - gasLimitType: PromiseOrValue, - overrides?: CallOverrides - ): Promise + interactionDelay( + collateral: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - debtSnapshotStaleTime(overrides?: CallOverrides): Promise + isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; - etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise + issuanceRatio(overrides?: CallOverrides): Promise<[BigNumber]>; - etherWrapperMaxETH(overrides?: CallOverrides): Promise + liquidateReward(overrides?: CallOverrides): Promise<[BigNumber]>; - etherWrapperMintFeeRate(overrides?: CallOverrides): Promise + liquidationDelay(overrides?: CallOverrides): Promise<[BigNumber]>; - exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise + liquidationEscrowDuration(overrides?: CallOverrides): Promise<[BigNumber]>; - exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise + liquidationPenalty(overrides?: CallOverrides): Promise<[BigNumber]>; - exchangeDynamicFeeWeightDecay(overrides?: CallOverrides): Promise + liquidationRatio(overrides?: CallOverrides): Promise<[BigNumber]>; - exchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + minimumStakeTime(overrides?: CallOverrides): Promise<[BigNumber]>; - exchangeMaxDynamicFee(overrides?: CallOverrides): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - feePeriodDuration(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; - flagReward(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise<[string]>; - interactionDelay( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise<[BigNumber]>; - isResolverCached(overrides?: CallOverrides): Promise + pureChainlinkPriceForAtomicSwapsEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; - issuanceRatio(overrides?: CallOverrides): Promise + rateStalePeriod(overrides?: CallOverrides): Promise<[BigNumber]>; - liquidateReward(overrides?: CallOverrides): Promise + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - liquidationDelay(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise<[string]>; - liquidationEscrowDuration(overrides?: CallOverrides): Promise + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise<[string[]] & { addresses: string[] }>; - liquidationPenalty(overrides?: CallOverrides): Promise + selfLiquidationPenalty(overrides?: CallOverrides): Promise<[BigNumber]>; - liquidationRatio(overrides?: CallOverrides): Promise + setAggregatorWarningFlags( + _flags: string, + overrides?: Overrides & { from?: string } + ): Promise; - minimumStakeTime(overrides?: CallOverrides): Promise + setAtomicEquivalentForDexPricing( + _currencyKey: BytesLike, + _equivalent: string, + overrides?: Overrides & { from?: string } + ): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setAtomicExchangeFeeRate( + _currencyKey: BytesLike, + _exchangeFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + setAtomicMaxVolumePerBlock( + _maxVolume: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + setAtomicTwapWindow( + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicVolatilityConsiderationWindow( + _currencyKey: BytesLike, + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicVolatilityUpdateThreshold( + _currencyKey: BytesLike, + _threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCollapseFeeRate( + _collateral: string, + _collapseFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCrossChainSynthTransferEnabled( + _currencyKey: BytesLike, + _value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCrossDomainMessageGasLimit( + _gasLimitType: BigNumberish, + _crossDomainMessageGasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setDebtSnapshotStaleTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperBurnFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMaxETH( + _maxETH: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMintFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeRounds( + rounds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeThreshold( + threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeWeightDecay( + weightDecay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeFeeRateForSynths( + synthKeys: BytesLike[], + exchangeFeeRates: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeMaxDynamicFee( + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeePeriodDuration( + _feePeriodDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFlagReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setInteractionDelay( + _collateral: string, + _interactionDelay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setIssuanceRatio( + ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidateReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationDelay( + time: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationEscrowDuration( + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRatio( + _liquidationRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinimumStakeTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPriceDeviationThresholdFactor( + _priceDeviationThresholdFactor: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPureChainlinkPriceForAtomicSwapsEnabled( + _currencyKey: BytesLike, + _enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setRateStalePeriod( + period: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSelfLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSnxLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTargetThreshold( + percent: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTradingRewardsEnabled( + _tradingRewardsEnabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setWaitingPeriodSecs( + _waitingPeriodSecs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperBurnFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperMaxTokenAmount( + _wrapper: string, + _maxTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise + setWrapperMintFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - pureChainlinkPriceForAtomicSwapsEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + snxLiquidationPenalty(overrides?: CallOverrides): Promise<[BigNumber]>; - rateStalePeriod(overrides?: CallOverrides): Promise + targetThreshold(overrides?: CallOverrides): Promise<[BigNumber]>; - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + tradingRewardsEnabled(overrides?: CallOverrides): Promise<[boolean]>; - resolver(overrides?: CallOverrides): Promise + waitingPeriodSecs(overrides?: CallOverrides): Promise<[BigNumber]>; - resolverAddressesRequired(overrides?: CallOverrides): Promise + wrapperBurnFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - selfLiquidationPenalty(overrides?: CallOverrides): Promise + wrapperMaxTokenAmount( + wrapper: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; - setAggregatorWarningFlags( - _flags: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + wrapperMintFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + }; - setAtomicEquivalentForDexPricing( - _currencyKey: PromiseOrValue, - _equivalent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + CONTRACT_NAME(overrides?: CallOverrides): Promise; - setAtomicExchangeFeeRate( - _currencyKey: PromiseOrValue, - _exchangeFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - setAtomicMaxVolumePerBlock( - _maxVolume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + aggregatorWarningFlags(overrides?: CallOverrides): Promise; - setAtomicTwapWindow( - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicEquivalentForDexPricing( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setAtomicVolatilityConsiderationWindow( - _currencyKey: PromiseOrValue, - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicExchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setAtomicVolatilityUpdateThreshold( - _currencyKey: PromiseOrValue, - _threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise; - setCollapseFeeRate( - _collateral: PromiseOrValue, - _collapseFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicTwapWindow(overrides?: CallOverrides): Promise; - setCrossChainSynthTransferEnabled( - _currencyKey: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setCrossDomainMessageGasLimit( - _gasLimitType: PromiseOrValue, - _crossDomainMessageGasLimit: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setDebtSnapshotStaleTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperBurnFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMaxETH( - _maxETH: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMintFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeRounds( - rounds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeThreshold( - threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeWeightDecay( - weightDecay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeFeeRateForSynths( - synthKeys: PromiseOrValue[], - exchangeFeeRates: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeMaxDynamicFee( - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFeePeriodDuration( - _feePeriodDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFlagReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setInteractionDelay( - _collateral: PromiseOrValue, - _interactionDelay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setIssuanceRatio( - ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidateReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationDelay( - time: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationEscrowDuration( - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationRatio( - _liquidationRatio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinimumStakeTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPriceDeviationThresholdFactor( - _priceDeviationThresholdFactor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPureChainlinkPriceForAtomicSwapsEnabled( - _currencyKey: PromiseOrValue, - _enabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setRateStalePeriod( - period: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSelfLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSnxLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTargetThreshold( - percent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTradingRewardsEnabled( - _tradingRewardsEnabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicVolatilityConsiderationWindow( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setWaitingPeriodSecs( - _waitingPeriodSecs: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + atomicVolatilityUpdateThreshold( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setWrapperBurnFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + collapseFeeRate( + collateral: string, + overrides?: CallOverrides + ): Promise; - setWrapperMaxTokenAmount( - _wrapper: PromiseOrValue, - _maxTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + crossChainSynthTransferEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setWrapperMintFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + crossDomainMessageGasLimit( + gasLimitType: BigNumberish, + overrides?: CallOverrides + ): Promise; - snxLiquidationPenalty(overrides?: CallOverrides): Promise + debtSnapshotStaleTime(overrides?: CallOverrides): Promise; - targetThreshold(overrides?: CallOverrides): Promise + etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise; - tradingRewardsEnabled(overrides?: CallOverrides): Promise + etherWrapperMaxETH(overrides?: CallOverrides): Promise; - waitingPeriodSecs(overrides?: CallOverrides): Promise + etherWrapperMintFeeRate(overrides?: CallOverrides): Promise; - wrapperBurnFeeRate(wrapper: PromiseOrValue, overrides?: CallOverrides): Promise + exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise; - wrapperMaxTokenAmount( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise + exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise; - wrapperMintFeeRate(wrapper: PromiseOrValue, overrides?: CallOverrides): Promise + exchangeDynamicFeeWeightDecay(overrides?: CallOverrides): Promise; - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise + exchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - acceptOwnership(overrides?: CallOverrides): Promise + exchangeMaxDynamicFee(overrides?: CallOverrides): Promise; - aggregatorWarningFlags(overrides?: CallOverrides): Promise + feePeriodDuration(overrides?: CallOverrides): Promise; - atomicEquivalentForDexPricing( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + flagReward(overrides?: CallOverrides): Promise; - atomicExchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + interactionDelay( + collateral: string, + overrides?: CallOverrides + ): Promise; - atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise + isResolverCached(overrides?: CallOverrides): Promise; - atomicTwapWindow(overrides?: CallOverrides): Promise + issuanceRatio(overrides?: CallOverrides): Promise; - atomicVolatilityConsiderationWindow( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidateReward(overrides?: CallOverrides): Promise; - atomicVolatilityUpdateThreshold( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationDelay(overrides?: CallOverrides): Promise; - collapseFeeRate( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationEscrowDuration(overrides?: CallOverrides): Promise; - crossChainSynthTransferEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationPenalty(overrides?: CallOverrides): Promise; - crossDomainMessageGasLimit( - gasLimitType: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationRatio(overrides?: CallOverrides): Promise; - debtSnapshotStaleTime(overrides?: CallOverrides): Promise + minimumStakeTime(overrides?: CallOverrides): Promise; - etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - etherWrapperMaxETH(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - etherWrapperMintFeeRate(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise + priceDeviationThresholdFactor(overrides?: CallOverrides): Promise; - exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise + pureChainlinkPriceForAtomicSwapsEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - exchangeDynamicFeeWeightDecay(overrides?: CallOverrides): Promise + rateStalePeriod(overrides?: CallOverrides): Promise; - exchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; - exchangeMaxDynamicFee(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - feePeriodDuration(overrides?: CallOverrides): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - flagReward(overrides?: CallOverrides): Promise + selfLiquidationPenalty(overrides?: CallOverrides): Promise; - interactionDelay( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setAggregatorWarningFlags( + _flags: string, + overrides?: Overrides & { from?: string } + ): Promise; - isResolverCached(overrides?: CallOverrides): Promise + setAtomicEquivalentForDexPricing( + _currencyKey: BytesLike, + _equivalent: string, + overrides?: Overrides & { from?: string } + ): Promise; - issuanceRatio(overrides?: CallOverrides): Promise + setAtomicExchangeFeeRate( + _currencyKey: BytesLike, + _exchangeFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - liquidateReward(overrides?: CallOverrides): Promise + setAtomicMaxVolumePerBlock( + _maxVolume: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - liquidationDelay(overrides?: CallOverrides): Promise + setAtomicTwapWindow( + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - liquidationEscrowDuration(overrides?: CallOverrides): Promise + setAtomicVolatilityConsiderationWindow( + _currencyKey: BytesLike, + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - liquidationPenalty(overrides?: CallOverrides): Promise + setAtomicVolatilityUpdateThreshold( + _currencyKey: BytesLike, + _threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - liquidationRatio(overrides?: CallOverrides): Promise + setCollapseFeeRate( + _collateral: string, + _collapseFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - minimumStakeTime(overrides?: CallOverrides): Promise + setCrossChainSynthTransferEnabled( + _currencyKey: BytesLike, + _value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCrossDomainMessageGasLimit( + _gasLimitType: BigNumberish, + _crossDomainMessageGasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setDebtSnapshotStaleTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperBurnFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMaxETH( + _maxETH: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMintFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeRounds( + rounds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeThreshold( + threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeWeightDecay( + weightDecay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeFeeRateForSynths( + synthKeys: BytesLike[], + exchangeFeeRates: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeMaxDynamicFee( + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeePeriodDuration( + _feePeriodDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFlagReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setInteractionDelay( + _collateral: string, + _interactionDelay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setIssuanceRatio( + ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidateReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationDelay( + time: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationEscrowDuration( + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRatio( + _liquidationRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinimumStakeTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPriceDeviationThresholdFactor( + _priceDeviationThresholdFactor: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPureChainlinkPriceForAtomicSwapsEnabled( + _currencyKey: BytesLike, + _enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setRateStalePeriod( + period: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSelfLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSnxLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTargetThreshold( + percent: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTradingRewardsEnabled( + _tradingRewardsEnabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setWaitingPeriodSecs( + _waitingPeriodSecs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperBurnFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperMaxTokenAmount( + _wrapper: string, + _maxTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise + setWrapperMintFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + snxLiquidationPenalty(overrides?: CallOverrides): Promise; - owner(overrides?: CallOverrides): Promise + targetThreshold(overrides?: CallOverrides): Promise; - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise + tradingRewardsEnabled(overrides?: CallOverrides): Promise; - pureChainlinkPriceForAtomicSwapsEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + waitingPeriodSecs(overrides?: CallOverrides): Promise; - rateStalePeriod(overrides?: CallOverrides): Promise + wrapperBurnFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; - rebuildCache(overrides?: CallOverrides): Promise + wrapperMaxTokenAmount( + wrapper: string, + overrides?: CallOverrides + ): Promise; - resolver(overrides?: CallOverrides): Promise + wrapperMintFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; - selfLiquidationPenalty(overrides?: CallOverrides): Promise + acceptOwnership(overrides?: CallOverrides): Promise; - setAggregatorWarningFlags( - _flags: PromiseOrValue, - overrides?: CallOverrides - ): Promise + aggregatorWarningFlags(overrides?: CallOverrides): Promise; - setAtomicEquivalentForDexPricing( - _currencyKey: PromiseOrValue, - _equivalent: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicEquivalentForDexPricing( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setAtomicExchangeFeeRate( - _currencyKey: PromiseOrValue, - _exchangeFeeRate: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicExchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setAtomicMaxVolumePerBlock( - _maxVolume: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise; - setAtomicTwapWindow( - _window: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicTwapWindow(overrides?: CallOverrides): Promise; - setAtomicVolatilityConsiderationWindow( - _currencyKey: PromiseOrValue, - _window: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicVolatilityConsiderationWindow( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setAtomicVolatilityUpdateThreshold( - _currencyKey: PromiseOrValue, - _threshold: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicVolatilityUpdateThreshold( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setCollapseFeeRate( - _collateral: PromiseOrValue, - _collapseFeeRate: PromiseOrValue, - overrides?: CallOverrides - ): Promise + collapseFeeRate( + collateral: string, + overrides?: CallOverrides + ): Promise; - setCrossChainSynthTransferEnabled( - _currencyKey: PromiseOrValue, - _value: PromiseOrValue, - overrides?: CallOverrides - ): Promise + crossChainSynthTransferEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setCrossDomainMessageGasLimit( - _gasLimitType: PromiseOrValue, - _crossDomainMessageGasLimit: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setDebtSnapshotStaleTime( - _seconds: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setEtherWrapperBurnFeeRate( - _rate: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setEtherWrapperMaxETH( - _maxETH: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setEtherWrapperMintFeeRate( - _rate: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setExchangeDynamicFeeRounds( - rounds: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setExchangeDynamicFeeThreshold( - threshold: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setExchangeDynamicFeeWeightDecay( - weightDecay: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setExchangeFeeRateForSynths( - synthKeys: PromiseOrValue[], - exchangeFeeRates: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - setExchangeMaxDynamicFee( - maxFee: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setFeePeriodDuration( - _feePeriodDuration: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setFlagReward(reward: PromiseOrValue, overrides?: CallOverrides): Promise - - setInteractionDelay( - _collateral: PromiseOrValue, - _interactionDelay: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setIssuanceRatio(ratio: PromiseOrValue, overrides?: CallOverrides): Promise - - setLiquidateReward( - reward: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationDelay( - time: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationEscrowDuration( - duration: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setLiquidationRatio( - _liquidationRatio: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setMinimumStakeTime( - _seconds: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setPriceDeviationThresholdFactor( - _priceDeviationThresholdFactor: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setPureChainlinkPriceForAtomicSwapsEnabled( - _currencyKey: PromiseOrValue, - _enabled: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setRateStalePeriod( - period: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setSelfLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setSnxLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTargetThreshold( - percent: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setTradingRewardsEnabled( - _tradingRewardsEnabled: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setWaitingPeriodSecs( - _waitingPeriodSecs: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setWrapperBurnFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setWrapperMaxTokenAmount( - _wrapper: PromiseOrValue, - _maxTokenAmount: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - setWrapperMintFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - snxLiquidationPenalty(overrides?: CallOverrides): Promise - - targetThreshold(overrides?: CallOverrides): Promise - - tradingRewardsEnabled(overrides?: CallOverrides): Promise - - waitingPeriodSecs(overrides?: CallOverrides): Promise - - wrapperBurnFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - wrapperMaxTokenAmount( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - wrapperMintFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } - - filters: { - 'AggregatorWarningFlagsUpdated(address)'(flags?: null): AggregatorWarningFlagsUpdatedEventFilter - AggregatorWarningFlagsUpdated(flags?: null): AggregatorWarningFlagsUpdatedEventFilter - - 'AtomicEquivalentForDexPricingUpdated(bytes32,address)'( - synthKey?: null, - equivalent?: null - ): AtomicEquivalentForDexPricingUpdatedEventFilter - AtomicEquivalentForDexPricingUpdated( - synthKey?: null, - equivalent?: null - ): AtomicEquivalentForDexPricingUpdatedEventFilter - - 'AtomicExchangeFeeUpdated(bytes32,uint256)'( - synthKey?: null, - newExchangeFeeRate?: null - ): AtomicExchangeFeeUpdatedEventFilter - AtomicExchangeFeeUpdated( - synthKey?: null, - newExchangeFeeRate?: null - ): AtomicExchangeFeeUpdatedEventFilter - - 'AtomicMaxVolumePerBlockUpdated(uint256)'( - newMaxVolume?: null - ): AtomicMaxVolumePerBlockUpdatedEventFilter - AtomicMaxVolumePerBlockUpdated(newMaxVolume?: null): AtomicMaxVolumePerBlockUpdatedEventFilter - - 'AtomicTwapWindowUpdated(uint256)'(newWindow?: null): AtomicTwapWindowUpdatedEventFilter - AtomicTwapWindowUpdated(newWindow?: null): AtomicTwapWindowUpdatedEventFilter - - 'AtomicVolatilityConsiderationWindowUpdated(bytes32,uint256)'( - synthKey?: null, - newVolatilityConsiderationWindow?: null - ): AtomicVolatilityConsiderationWindowUpdatedEventFilter - AtomicVolatilityConsiderationWindowUpdated( - synthKey?: null, - newVolatilityConsiderationWindow?: null - ): AtomicVolatilityConsiderationWindowUpdatedEventFilter - - 'AtomicVolatilityUpdateThresholdUpdated(bytes32,uint256)'( - synthKey?: null, - newVolatilityUpdateThreshold?: null - ): AtomicVolatilityUpdateThresholdUpdatedEventFilter - AtomicVolatilityUpdateThresholdUpdated( - synthKey?: null, - newVolatilityUpdateThreshold?: null - ): AtomicVolatilityUpdateThresholdUpdatedEventFilter - - 'CacheUpdated(bytes32,address)'(name?: null, destination?: null): CacheUpdatedEventFilter - CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter - - 'CollapseFeeRateUpdated(uint256)'(collapseFeeRate?: null): CollapseFeeRateUpdatedEventFilter - CollapseFeeRateUpdated(collapseFeeRate?: null): CollapseFeeRateUpdatedEventFilter - - 'CrossChainSynthTransferEnabledUpdated(bytes32,uint256)'( - synthKey?: null, - value?: null - ): CrossChainSynthTransferEnabledUpdatedEventFilter - CrossChainSynthTransferEnabledUpdated( - synthKey?: null, - value?: null - ): CrossChainSynthTransferEnabledUpdatedEventFilter - - 'CrossDomainMessageGasLimitChanged(uint8,uint256)'( - gasLimitType?: null, - newLimit?: null - ): CrossDomainMessageGasLimitChangedEventFilter - CrossDomainMessageGasLimitChanged( - gasLimitType?: null, - newLimit?: null - ): CrossDomainMessageGasLimitChangedEventFilter - - 'DebtSnapshotStaleTimeUpdated(uint256)'( - debtSnapshotStaleTime?: null - ): DebtSnapshotStaleTimeUpdatedEventFilter - DebtSnapshotStaleTimeUpdated( - debtSnapshotStaleTime?: null - ): DebtSnapshotStaleTimeUpdatedEventFilter - - 'EtherWrapperBurnFeeRateUpdated(uint256)'( - rate?: null - ): EtherWrapperBurnFeeRateUpdatedEventFilter - EtherWrapperBurnFeeRateUpdated(rate?: null): EtherWrapperBurnFeeRateUpdatedEventFilter - - 'EtherWrapperMaxETHUpdated(uint256)'(maxETH?: null): EtherWrapperMaxETHUpdatedEventFilter - EtherWrapperMaxETHUpdated(maxETH?: null): EtherWrapperMaxETHUpdatedEventFilter - - 'EtherWrapperMintFeeRateUpdated(uint256)'( - rate?: null - ): EtherWrapperMintFeeRateUpdatedEventFilter - EtherWrapperMintFeeRateUpdated(rate?: null): EtherWrapperMintFeeRateUpdatedEventFilter - - 'ExchangeDynamicFeeRoundsUpdated(uint256)'( - dynamicFeeRounds?: null - ): ExchangeDynamicFeeRoundsUpdatedEventFilter - ExchangeDynamicFeeRoundsUpdated( - dynamicFeeRounds?: null - ): ExchangeDynamicFeeRoundsUpdatedEventFilter - - 'ExchangeDynamicFeeThresholdUpdated(uint256)'( - dynamicFeeThreshold?: null - ): ExchangeDynamicFeeThresholdUpdatedEventFilter - ExchangeDynamicFeeThresholdUpdated( - dynamicFeeThreshold?: null - ): ExchangeDynamicFeeThresholdUpdatedEventFilter - - 'ExchangeDynamicFeeWeightDecayUpdated(uint256)'( - dynamicFeeWeightDecay?: null - ): ExchangeDynamicFeeWeightDecayUpdatedEventFilter - ExchangeDynamicFeeWeightDecayUpdated( - dynamicFeeWeightDecay?: null - ): ExchangeDynamicFeeWeightDecayUpdatedEventFilter - - 'ExchangeFeeUpdated(bytes32,uint256)'( - synthKey?: null, - newExchangeFeeRate?: null - ): ExchangeFeeUpdatedEventFilter - ExchangeFeeUpdated(synthKey?: null, newExchangeFeeRate?: null): ExchangeFeeUpdatedEventFilter - - 'ExchangeMaxDynamicFeeUpdated(uint256)'( - maxDynamicFee?: null - ): ExchangeMaxDynamicFeeUpdatedEventFilter - ExchangeMaxDynamicFeeUpdated(maxDynamicFee?: null): ExchangeMaxDynamicFeeUpdatedEventFilter - - 'FeePeriodDurationUpdated(uint256)'( - newFeePeriodDuration?: null - ): FeePeriodDurationUpdatedEventFilter - FeePeriodDurationUpdated(newFeePeriodDuration?: null): FeePeriodDurationUpdatedEventFilter - - 'FlagRewardUpdated(uint256)'(newReward?: null): FlagRewardUpdatedEventFilter - FlagRewardUpdated(newReward?: null): FlagRewardUpdatedEventFilter - - 'InteractionDelayUpdated(uint256)'(interactionDelay?: null): InteractionDelayUpdatedEventFilter - InteractionDelayUpdated(interactionDelay?: null): InteractionDelayUpdatedEventFilter - - 'IssuanceRatioUpdated(uint256)'(newRatio?: null): IssuanceRatioUpdatedEventFilter - IssuanceRatioUpdated(newRatio?: null): IssuanceRatioUpdatedEventFilter - - 'LiquidateRewardUpdated(uint256)'(newReward?: null): LiquidateRewardUpdatedEventFilter - LiquidateRewardUpdated(newReward?: null): LiquidateRewardUpdatedEventFilter - - 'LiquidationDelayUpdated(uint256)'(newDelay?: null): LiquidationDelayUpdatedEventFilter - LiquidationDelayUpdated(newDelay?: null): LiquidationDelayUpdatedEventFilter - - 'LiquidationEscrowDurationUpdated(uint256)'( - newDuration?: null - ): LiquidationEscrowDurationUpdatedEventFilter - LiquidationEscrowDurationUpdated( - newDuration?: null - ): LiquidationEscrowDurationUpdatedEventFilter - - 'LiquidationPenaltyUpdated(uint256)'(newPenalty?: null): LiquidationPenaltyUpdatedEventFilter - LiquidationPenaltyUpdated(newPenalty?: null): LiquidationPenaltyUpdatedEventFilter - - 'LiquidationRatioUpdated(uint256)'(newRatio?: null): LiquidationRatioUpdatedEventFilter - LiquidationRatioUpdated(newRatio?: null): LiquidationRatioUpdatedEventFilter - - 'MinimumStakeTimeUpdated(uint256)'(minimumStakeTime?: null): MinimumStakeTimeUpdatedEventFilter - MinimumStakeTimeUpdated(minimumStakeTime?: null): MinimumStakeTimeUpdatedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - - 'PriceDeviationThresholdUpdated(uint256)'( - threshold?: null - ): PriceDeviationThresholdUpdatedEventFilter - PriceDeviationThresholdUpdated(threshold?: null): PriceDeviationThresholdUpdatedEventFilter - - 'PureChainlinkPriceForAtomicSwapsEnabledUpdated(bytes32,bool)'( - synthKey?: null, - enabled?: null - ): PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventFilter - PureChainlinkPriceForAtomicSwapsEnabledUpdated( - synthKey?: null, - enabled?: null - ): PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventFilter - - 'RateStalePeriodUpdated(uint256)'(rateStalePeriod?: null): RateStalePeriodUpdatedEventFilter - RateStalePeriodUpdated(rateStalePeriod?: null): RateStalePeriodUpdatedEventFilter - - 'SelfLiquidationPenaltyUpdated(uint256)'( - newPenalty?: null - ): SelfLiquidationPenaltyUpdatedEventFilter - SelfLiquidationPenaltyUpdated(newPenalty?: null): SelfLiquidationPenaltyUpdatedEventFilter - - 'SnxLiquidationPenaltyUpdated(uint256)'( - newPenalty?: null - ): SnxLiquidationPenaltyUpdatedEventFilter - SnxLiquidationPenaltyUpdated(newPenalty?: null): SnxLiquidationPenaltyUpdatedEventFilter - - 'TargetThresholdUpdated(uint256)'(newTargetThreshold?: null): TargetThresholdUpdatedEventFilter - TargetThresholdUpdated(newTargetThreshold?: null): TargetThresholdUpdatedEventFilter + crossDomainMessageGasLimit( + gasLimitType: BigNumberish, + overrides?: CallOverrides + ): Promise; - 'TradingRewardsEnabled(bool)'(enabled?: null): TradingRewardsEnabledEventFilter - TradingRewardsEnabled(enabled?: null): TradingRewardsEnabledEventFilter + debtSnapshotStaleTime(overrides?: CallOverrides): Promise; - 'WaitingPeriodSecsUpdated(uint256)'( - waitingPeriodSecs?: null - ): WaitingPeriodSecsUpdatedEventFilter - WaitingPeriodSecsUpdated(waitingPeriodSecs?: null): WaitingPeriodSecsUpdatedEventFilter + etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise; - 'WrapperBurnFeeRateUpdated(address,int256)'( - wrapper?: null, - rate?: null - ): WrapperBurnFeeRateUpdatedEventFilter - WrapperBurnFeeRateUpdated(wrapper?: null, rate?: null): WrapperBurnFeeRateUpdatedEventFilter + etherWrapperMaxETH(overrides?: CallOverrides): Promise; - 'WrapperMaxTokenAmountUpdated(address,uint256)'( - wrapper?: null, - maxTokenAmount?: null - ): WrapperMaxTokenAmountUpdatedEventFilter - WrapperMaxTokenAmountUpdated( - wrapper?: null, - maxTokenAmount?: null - ): WrapperMaxTokenAmountUpdatedEventFilter + etherWrapperMintFeeRate(overrides?: CallOverrides): Promise; - 'WrapperMintFeeRateUpdated(address,int256)'( - wrapper?: null, - rate?: null - ): WrapperMintFeeRateUpdatedEventFilter - WrapperMintFeeRateUpdated(wrapper?: null, rate?: null): WrapperMintFeeRateUpdatedEventFilter - } + exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise; - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise + exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise; - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise + exchangeDynamicFeeWeightDecay( + overrides?: CallOverrides + ): Promise; - aggregatorWarningFlags(overrides?: CallOverrides): Promise + exchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - atomicEquivalentForDexPricing( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + exchangeMaxDynamicFee(overrides?: CallOverrides): Promise; - atomicExchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + feePeriodDuration(overrides?: CallOverrides): Promise; - atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise + flagReward(overrides?: CallOverrides): Promise; - atomicTwapWindow(overrides?: CallOverrides): Promise + interactionDelay( + collateral: string, + overrides?: CallOverrides + ): Promise; - atomicVolatilityConsiderationWindow( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + isResolverCached(overrides?: CallOverrides): Promise; - atomicVolatilityUpdateThreshold( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + issuanceRatio(overrides?: CallOverrides): Promise; - collapseFeeRate( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidateReward(overrides?: CallOverrides): Promise; - crossChainSynthTransferEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationDelay(overrides?: CallOverrides): Promise; - crossDomainMessageGasLimit( - gasLimitType: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationEscrowDuration(overrides?: CallOverrides): Promise; - debtSnapshotStaleTime(overrides?: CallOverrides): Promise + liquidationPenalty(overrides?: CallOverrides): Promise; - etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise + liquidationRatio(overrides?: CallOverrides): Promise; - etherWrapperMaxETH(overrides?: CallOverrides): Promise + minimumStakeTime(overrides?: CallOverrides): Promise; - etherWrapperMintFeeRate(overrides?: CallOverrides): Promise + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; - exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - exchangeDynamicFeeWeightDecay(overrides?: CallOverrides): Promise + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise; - exchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + pureChainlinkPriceForAtomicSwapsEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - exchangeMaxDynamicFee(overrides?: CallOverrides): Promise + rateStalePeriod(overrides?: CallOverrides): Promise; - feePeriodDuration(overrides?: CallOverrides): Promise + rebuildCache(overrides?: CallOverrides): Promise; - flagReward(overrides?: CallOverrides): Promise + resolver(overrides?: CallOverrides): Promise; - interactionDelay( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - isResolverCached(overrides?: CallOverrides): Promise + selfLiquidationPenalty(overrides?: CallOverrides): Promise; - issuanceRatio(overrides?: CallOverrides): Promise + setAggregatorWarningFlags( + _flags: string, + overrides?: CallOverrides + ): Promise; - liquidateReward(overrides?: CallOverrides): Promise + setAtomicEquivalentForDexPricing( + _currencyKey: BytesLike, + _equivalent: string, + overrides?: CallOverrides + ): Promise; - liquidationDelay(overrides?: CallOverrides): Promise + setAtomicExchangeFeeRate( + _currencyKey: BytesLike, + _exchangeFeeRate: BigNumberish, + overrides?: CallOverrides + ): Promise; - liquidationEscrowDuration(overrides?: CallOverrides): Promise + setAtomicMaxVolumePerBlock( + _maxVolume: BigNumberish, + overrides?: CallOverrides + ): Promise; - liquidationPenalty(overrides?: CallOverrides): Promise + setAtomicTwapWindow( + _window: BigNumberish, + overrides?: CallOverrides + ): Promise; - liquidationRatio(overrides?: CallOverrides): Promise + setAtomicVolatilityConsiderationWindow( + _currencyKey: BytesLike, + _window: BigNumberish, + overrides?: CallOverrides + ): Promise; - minimumStakeTime(overrides?: CallOverrides): Promise + setAtomicVolatilityUpdateThreshold( + _currencyKey: BytesLike, + _threshold: BigNumberish, + overrides?: CallOverrides + ): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + setCollapseFeeRate( + _collateral: string, + _collapseFeeRate: BigNumberish, + overrides?: CallOverrides + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + setCrossChainSynthTransferEnabled( + _currencyKey: BytesLike, + _value: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setCrossDomainMessageGasLimit( + _gasLimitType: BigNumberish, + _crossDomainMessageGasLimit: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setDebtSnapshotStaleTime( + _seconds: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setEtherWrapperBurnFeeRate( + _rate: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setEtherWrapperMaxETH( + _maxETH: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setEtherWrapperMintFeeRate( + _rate: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setExchangeDynamicFeeRounds( + rounds: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setExchangeDynamicFeeThreshold( + threshold: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setExchangeDynamicFeeWeightDecay( + weightDecay: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setExchangeFeeRateForSynths( + synthKeys: BytesLike[], + exchangeFeeRates: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + setExchangeMaxDynamicFee( + maxFee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setFeePeriodDuration( + _feePeriodDuration: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setFlagReward( + reward: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setInteractionDelay( + _collateral: string, + _interactionDelay: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setIssuanceRatio( + ratio: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidateReward( + reward: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationDelay( + time: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationEscrowDuration( + duration: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationPenalty( + penalty: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setLiquidationRatio( + _liquidationRatio: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setMinimumStakeTime( + _seconds: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setPriceDeviationThresholdFactor( + _priceDeviationThresholdFactor: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setPureChainlinkPriceForAtomicSwapsEnabled( + _currencyKey: BytesLike, + _enabled: boolean, + overrides?: CallOverrides + ): Promise; + + setRateStalePeriod( + period: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSelfLiquidationPenalty( + penalty: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setSnxLiquidationPenalty( + penalty: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTargetThreshold( + percent: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTradingRewardsEnabled( + _tradingRewardsEnabled: boolean, + overrides?: CallOverrides + ): Promise; + + setWaitingPeriodSecs( + _waitingPeriodSecs: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setWrapperBurnFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setWrapperMaxTokenAmount( + _wrapper: string, + _maxTokenAmount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setWrapperMintFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: CallOverrides + ): Promise; + + snxLiquidationPenalty(overrides?: CallOverrides): Promise; + + targetThreshold(overrides?: CallOverrides): Promise; + + tradingRewardsEnabled(overrides?: CallOverrides): Promise; + + waitingPeriodSecs(overrides?: CallOverrides): Promise; + + wrapperBurnFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; + + wrapperMaxTokenAmount( + wrapper: string, + overrides?: CallOverrides + ): Promise; + + wrapperMintFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AggregatorWarningFlagsUpdated(address)"( + flags?: null + ): AggregatorWarningFlagsUpdatedEventFilter; + AggregatorWarningFlagsUpdated( + flags?: null + ): AggregatorWarningFlagsUpdatedEventFilter; + + "AtomicEquivalentForDexPricingUpdated(bytes32,address)"( + synthKey?: null, + equivalent?: null + ): AtomicEquivalentForDexPricingUpdatedEventFilter; + AtomicEquivalentForDexPricingUpdated( + synthKey?: null, + equivalent?: null + ): AtomicEquivalentForDexPricingUpdatedEventFilter; + + "AtomicExchangeFeeUpdated(bytes32,uint256)"( + synthKey?: null, + newExchangeFeeRate?: null + ): AtomicExchangeFeeUpdatedEventFilter; + AtomicExchangeFeeUpdated( + synthKey?: null, + newExchangeFeeRate?: null + ): AtomicExchangeFeeUpdatedEventFilter; + + "AtomicMaxVolumePerBlockUpdated(uint256)"( + newMaxVolume?: null + ): AtomicMaxVolumePerBlockUpdatedEventFilter; + AtomicMaxVolumePerBlockUpdated( + newMaxVolume?: null + ): AtomicMaxVolumePerBlockUpdatedEventFilter; + + "AtomicTwapWindowUpdated(uint256)"( + newWindow?: null + ): AtomicTwapWindowUpdatedEventFilter; + AtomicTwapWindowUpdated( + newWindow?: null + ): AtomicTwapWindowUpdatedEventFilter; + + "AtomicVolatilityConsiderationWindowUpdated(bytes32,uint256)"( + synthKey?: null, + newVolatilityConsiderationWindow?: null + ): AtomicVolatilityConsiderationWindowUpdatedEventFilter; + AtomicVolatilityConsiderationWindowUpdated( + synthKey?: null, + newVolatilityConsiderationWindow?: null + ): AtomicVolatilityConsiderationWindowUpdatedEventFilter; + + "AtomicVolatilityUpdateThresholdUpdated(bytes32,uint256)"( + synthKey?: null, + newVolatilityUpdateThreshold?: null + ): AtomicVolatilityUpdateThresholdUpdatedEventFilter; + AtomicVolatilityUpdateThresholdUpdated( + synthKey?: null, + newVolatilityUpdateThreshold?: null + ): AtomicVolatilityUpdateThresholdUpdatedEventFilter; + + "CacheUpdated(bytes32,address)"( + name?: null, + destination?: null + ): CacheUpdatedEventFilter; + CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + + "CollapseFeeRateUpdated(uint256)"( + collapseFeeRate?: null + ): CollapseFeeRateUpdatedEventFilter; + CollapseFeeRateUpdated( + collapseFeeRate?: null + ): CollapseFeeRateUpdatedEventFilter; + + "CrossChainSynthTransferEnabledUpdated(bytes32,uint256)"( + synthKey?: null, + value?: null + ): CrossChainSynthTransferEnabledUpdatedEventFilter; + CrossChainSynthTransferEnabledUpdated( + synthKey?: null, + value?: null + ): CrossChainSynthTransferEnabledUpdatedEventFilter; + + "CrossDomainMessageGasLimitChanged(uint8,uint256)"( + gasLimitType?: null, + newLimit?: null + ): CrossDomainMessageGasLimitChangedEventFilter; + CrossDomainMessageGasLimitChanged( + gasLimitType?: null, + newLimit?: null + ): CrossDomainMessageGasLimitChangedEventFilter; + + "DebtSnapshotStaleTimeUpdated(uint256)"( + debtSnapshotStaleTime?: null + ): DebtSnapshotStaleTimeUpdatedEventFilter; + DebtSnapshotStaleTimeUpdated( + debtSnapshotStaleTime?: null + ): DebtSnapshotStaleTimeUpdatedEventFilter; + + "EtherWrapperBurnFeeRateUpdated(uint256)"( + rate?: null + ): EtherWrapperBurnFeeRateUpdatedEventFilter; + EtherWrapperBurnFeeRateUpdated( + rate?: null + ): EtherWrapperBurnFeeRateUpdatedEventFilter; + + "EtherWrapperMaxETHUpdated(uint256)"( + maxETH?: null + ): EtherWrapperMaxETHUpdatedEventFilter; + EtherWrapperMaxETHUpdated( + maxETH?: null + ): EtherWrapperMaxETHUpdatedEventFilter; + + "EtherWrapperMintFeeRateUpdated(uint256)"( + rate?: null + ): EtherWrapperMintFeeRateUpdatedEventFilter; + EtherWrapperMintFeeRateUpdated( + rate?: null + ): EtherWrapperMintFeeRateUpdatedEventFilter; + + "ExchangeDynamicFeeRoundsUpdated(uint256)"( + dynamicFeeRounds?: null + ): ExchangeDynamicFeeRoundsUpdatedEventFilter; + ExchangeDynamicFeeRoundsUpdated( + dynamicFeeRounds?: null + ): ExchangeDynamicFeeRoundsUpdatedEventFilter; + + "ExchangeDynamicFeeThresholdUpdated(uint256)"( + dynamicFeeThreshold?: null + ): ExchangeDynamicFeeThresholdUpdatedEventFilter; + ExchangeDynamicFeeThresholdUpdated( + dynamicFeeThreshold?: null + ): ExchangeDynamicFeeThresholdUpdatedEventFilter; + + "ExchangeDynamicFeeWeightDecayUpdated(uint256)"( + dynamicFeeWeightDecay?: null + ): ExchangeDynamicFeeWeightDecayUpdatedEventFilter; + ExchangeDynamicFeeWeightDecayUpdated( + dynamicFeeWeightDecay?: null + ): ExchangeDynamicFeeWeightDecayUpdatedEventFilter; + + "ExchangeFeeUpdated(bytes32,uint256)"( + synthKey?: null, + newExchangeFeeRate?: null + ): ExchangeFeeUpdatedEventFilter; + ExchangeFeeUpdated( + synthKey?: null, + newExchangeFeeRate?: null + ): ExchangeFeeUpdatedEventFilter; + + "ExchangeMaxDynamicFeeUpdated(uint256)"( + maxDynamicFee?: null + ): ExchangeMaxDynamicFeeUpdatedEventFilter; + ExchangeMaxDynamicFeeUpdated( + maxDynamicFee?: null + ): ExchangeMaxDynamicFeeUpdatedEventFilter; + + "FeePeriodDurationUpdated(uint256)"( + newFeePeriodDuration?: null + ): FeePeriodDurationUpdatedEventFilter; + FeePeriodDurationUpdated( + newFeePeriodDuration?: null + ): FeePeriodDurationUpdatedEventFilter; + + "FlagRewardUpdated(uint256)"( + newReward?: null + ): FlagRewardUpdatedEventFilter; + FlagRewardUpdated(newReward?: null): FlagRewardUpdatedEventFilter; + + "InteractionDelayUpdated(uint256)"( + interactionDelay?: null + ): InteractionDelayUpdatedEventFilter; + InteractionDelayUpdated( + interactionDelay?: null + ): InteractionDelayUpdatedEventFilter; + + "IssuanceRatioUpdated(uint256)"( + newRatio?: null + ): IssuanceRatioUpdatedEventFilter; + IssuanceRatioUpdated(newRatio?: null): IssuanceRatioUpdatedEventFilter; + + "LiquidateRewardUpdated(uint256)"( + newReward?: null + ): LiquidateRewardUpdatedEventFilter; + LiquidateRewardUpdated(newReward?: null): LiquidateRewardUpdatedEventFilter; + + "LiquidationDelayUpdated(uint256)"( + newDelay?: null + ): LiquidationDelayUpdatedEventFilter; + LiquidationDelayUpdated( + newDelay?: null + ): LiquidationDelayUpdatedEventFilter; + + "LiquidationEscrowDurationUpdated(uint256)"( + newDuration?: null + ): LiquidationEscrowDurationUpdatedEventFilter; + LiquidationEscrowDurationUpdated( + newDuration?: null + ): LiquidationEscrowDurationUpdatedEventFilter; + + "LiquidationPenaltyUpdated(uint256)"( + newPenalty?: null + ): LiquidationPenaltyUpdatedEventFilter; + LiquidationPenaltyUpdated( + newPenalty?: null + ): LiquidationPenaltyUpdatedEventFilter; + + "LiquidationRatioUpdated(uint256)"( + newRatio?: null + ): LiquidationRatioUpdatedEventFilter; + LiquidationRatioUpdated( + newRatio?: null + ): LiquidationRatioUpdatedEventFilter; + + "MinimumStakeTimeUpdated(uint256)"( + minimumStakeTime?: null + ): MinimumStakeTimeUpdatedEventFilter; + MinimumStakeTimeUpdated( + minimumStakeTime?: null + ): MinimumStakeTimeUpdatedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "PriceDeviationThresholdUpdated(uint256)"( + threshold?: null + ): PriceDeviationThresholdUpdatedEventFilter; + PriceDeviationThresholdUpdated( + threshold?: null + ): PriceDeviationThresholdUpdatedEventFilter; + + "PureChainlinkPriceForAtomicSwapsEnabledUpdated(bytes32,bool)"( + synthKey?: null, + enabled?: null + ): PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventFilter; + PureChainlinkPriceForAtomicSwapsEnabledUpdated( + synthKey?: null, + enabled?: null + ): PureChainlinkPriceForAtomicSwapsEnabledUpdatedEventFilter; + + "RateStalePeriodUpdated(uint256)"( + rateStalePeriod?: null + ): RateStalePeriodUpdatedEventFilter; + RateStalePeriodUpdated( + rateStalePeriod?: null + ): RateStalePeriodUpdatedEventFilter; + + "SelfLiquidationPenaltyUpdated(uint256)"( + newPenalty?: null + ): SelfLiquidationPenaltyUpdatedEventFilter; + SelfLiquidationPenaltyUpdated( + newPenalty?: null + ): SelfLiquidationPenaltyUpdatedEventFilter; + + "SnxLiquidationPenaltyUpdated(uint256)"( + newPenalty?: null + ): SnxLiquidationPenaltyUpdatedEventFilter; + SnxLiquidationPenaltyUpdated( + newPenalty?: null + ): SnxLiquidationPenaltyUpdatedEventFilter; + + "TargetThresholdUpdated(uint256)"( + newTargetThreshold?: null + ): TargetThresholdUpdatedEventFilter; + TargetThresholdUpdated( + newTargetThreshold?: null + ): TargetThresholdUpdatedEventFilter; + + "TradingRewardsEnabled(bool)"( + enabled?: null + ): TradingRewardsEnabledEventFilter; + TradingRewardsEnabled(enabled?: null): TradingRewardsEnabledEventFilter; + + "WaitingPeriodSecsUpdated(uint256)"( + waitingPeriodSecs?: null + ): WaitingPeriodSecsUpdatedEventFilter; + WaitingPeriodSecsUpdated( + waitingPeriodSecs?: null + ): WaitingPeriodSecsUpdatedEventFilter; + + "WrapperBurnFeeRateUpdated(address,int256)"( + wrapper?: null, + rate?: null + ): WrapperBurnFeeRateUpdatedEventFilter; + WrapperBurnFeeRateUpdated( + wrapper?: null, + rate?: null + ): WrapperBurnFeeRateUpdatedEventFilter; + + "WrapperMaxTokenAmountUpdated(address,uint256)"( + wrapper?: null, + maxTokenAmount?: null + ): WrapperMaxTokenAmountUpdatedEventFilter; + WrapperMaxTokenAmountUpdated( + wrapper?: null, + maxTokenAmount?: null + ): WrapperMaxTokenAmountUpdatedEventFilter; + + "WrapperMintFeeRateUpdated(address,int256)"( + wrapper?: null, + rate?: null + ): WrapperMintFeeRateUpdatedEventFilter; + WrapperMintFeeRateUpdated( + wrapper?: null, + rate?: null + ): WrapperMintFeeRateUpdatedEventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + aggregatorWarningFlags(overrides?: CallOverrides): Promise; + + atomicEquivalentForDexPricing( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + atomicExchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - owner(overrides?: CallOverrides): Promise + atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise; - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise + atomicTwapWindow(overrides?: CallOverrides): Promise; - pureChainlinkPriceForAtomicSwapsEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicVolatilityConsiderationWindow( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - rateStalePeriod(overrides?: CallOverrides): Promise + atomicVolatilityUpdateThreshold( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - rebuildCache(overrides?: Overrides & { from?: PromiseOrValue }): Promise + collapseFeeRate( + collateral: string, + overrides?: CallOverrides + ): Promise; - resolver(overrides?: CallOverrides): Promise + crossChainSynthTransferEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + crossDomainMessageGasLimit( + gasLimitType: BigNumberish, + overrides?: CallOverrides + ): Promise; - selfLiquidationPenalty(overrides?: CallOverrides): Promise + debtSnapshotStaleTime(overrides?: CallOverrides): Promise; - setAggregatorWarningFlags( - _flags: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise; - setAtomicEquivalentForDexPricing( - _currencyKey: PromiseOrValue, - _equivalent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + etherWrapperMaxETH(overrides?: CallOverrides): Promise; - setAtomicExchangeFeeRate( - _currencyKey: PromiseOrValue, - _exchangeFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + etherWrapperMintFeeRate(overrides?: CallOverrides): Promise; - setAtomicMaxVolumePerBlock( - _maxVolume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise; - setAtomicTwapWindow( - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise; - setAtomicVolatilityConsiderationWindow( - _currencyKey: PromiseOrValue, - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + exchangeDynamicFeeWeightDecay( + overrides?: CallOverrides + ): Promise; - setAtomicVolatilityUpdateThreshold( - _currencyKey: PromiseOrValue, - _threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + exchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - setCollapseFeeRate( - _collateral: PromiseOrValue, - _collapseFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + exchangeMaxDynamicFee(overrides?: CallOverrides): Promise; - setCrossChainSynthTransferEnabled( - _currencyKey: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setCrossDomainMessageGasLimit( - _gasLimitType: PromiseOrValue, - _crossDomainMessageGasLimit: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setDebtSnapshotStaleTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperBurnFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMaxETH( - _maxETH: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMintFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeRounds( - rounds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeThreshold( - threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeWeightDecay( - weightDecay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeFeeRateForSynths( - synthKeys: PromiseOrValue[], - exchangeFeeRates: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeMaxDynamicFee( - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFeePeriodDuration( - _feePeriodDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFlagReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setInteractionDelay( - _collateral: PromiseOrValue, - _interactionDelay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setIssuanceRatio( - ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidateReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationDelay( - time: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationEscrowDuration( - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationRatio( - _liquidationRatio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinimumStakeTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPriceDeviationThresholdFactor( - _priceDeviationThresholdFactor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPureChainlinkPriceForAtomicSwapsEnabled( - _currencyKey: PromiseOrValue, - _enabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setRateStalePeriod( - period: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSelfLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSnxLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTargetThreshold( - percent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTradingRewardsEnabled( - _tradingRewardsEnabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWaitingPeriodSecs( - _waitingPeriodSecs: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperBurnFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperMaxTokenAmount( - _wrapper: PromiseOrValue, - _maxTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperMintFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + feePeriodDuration(overrides?: CallOverrides): Promise; - snxLiquidationPenalty(overrides?: CallOverrides): Promise + flagReward(overrides?: CallOverrides): Promise; - targetThreshold(overrides?: CallOverrides): Promise + interactionDelay( + collateral: string, + overrides?: CallOverrides + ): Promise; - tradingRewardsEnabled(overrides?: CallOverrides): Promise + isResolverCached(overrides?: CallOverrides): Promise; - waitingPeriodSecs(overrides?: CallOverrides): Promise + issuanceRatio(overrides?: CallOverrides): Promise; - wrapperBurnFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidateReward(overrides?: CallOverrides): Promise; - wrapperMaxTokenAmount( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise + liquidationDelay(overrides?: CallOverrides): Promise; - wrapperMintFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + liquidationEscrowDuration(overrides?: CallOverrides): Promise; - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise + liquidationPenalty(overrides?: CallOverrides): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + liquidationRatio(overrides?: CallOverrides): Promise; - aggregatorWarningFlags(overrides?: CallOverrides): Promise + minimumStakeTime(overrides?: CallOverrides): Promise; - atomicEquivalentForDexPricing( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - atomicExchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + nominatedOwner(overrides?: CallOverrides): Promise; - atomicMaxVolumePerBlock(overrides?: CallOverrides): Promise + owner(overrides?: CallOverrides): Promise; - atomicTwapWindow(overrides?: CallOverrides): Promise + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise; - atomicVolatilityConsiderationWindow( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + pureChainlinkPriceForAtomicSwapsEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - atomicVolatilityUpdateThreshold( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + rateStalePeriod(overrides?: CallOverrides): Promise; - collapseFeeRate( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise + rebuildCache(overrides?: Overrides & { from?: string }): Promise; - crossChainSynthTransferEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + resolver(overrides?: CallOverrides): Promise; - crossDomainMessageGasLimit( - gasLimitType: PromiseOrValue, - overrides?: CallOverrides - ): Promise + resolverAddressesRequired(overrides?: CallOverrides): Promise; - debtSnapshotStaleTime(overrides?: CallOverrides): Promise + selfLiquidationPenalty(overrides?: CallOverrides): Promise; - etherWrapperBurnFeeRate(overrides?: CallOverrides): Promise + setAggregatorWarningFlags( + _flags: string, + overrides?: Overrides & { from?: string } + ): Promise; - etherWrapperMaxETH(overrides?: CallOverrides): Promise + setAtomicEquivalentForDexPricing( + _currencyKey: BytesLike, + _equivalent: string, + overrides?: Overrides & { from?: string } + ): Promise; - etherWrapperMintFeeRate(overrides?: CallOverrides): Promise + setAtomicExchangeFeeRate( + _currencyKey: BytesLike, + _exchangeFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - exchangeDynamicFeeRounds(overrides?: CallOverrides): Promise + setAtomicMaxVolumePerBlock( + _maxVolume: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - exchangeDynamicFeeThreshold(overrides?: CallOverrides): Promise + setAtomicTwapWindow( + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - exchangeDynamicFeeWeightDecay(overrides?: CallOverrides): Promise + setAtomicVolatilityConsiderationWindow( + _currencyKey: BytesLike, + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - exchangeFeeRate( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + setAtomicVolatilityUpdateThreshold( + _currencyKey: BytesLike, + _threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - exchangeMaxDynamicFee(overrides?: CallOverrides): Promise + setCollapseFeeRate( + _collateral: string, + _collapseFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; - feePeriodDuration(overrides?: CallOverrides): Promise + setCrossChainSynthTransferEnabled( + _currencyKey: BytesLike, + _value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCrossDomainMessageGasLimit( + _gasLimitType: BigNumberish, + _crossDomainMessageGasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setDebtSnapshotStaleTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperBurnFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMaxETH( + _maxETH: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMintFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeRounds( + rounds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeThreshold( + threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeWeightDecay( + weightDecay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeFeeRateForSynths( + synthKeys: BytesLike[], + exchangeFeeRates: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeMaxDynamicFee( + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeePeriodDuration( + _feePeriodDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFlagReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setInteractionDelay( + _collateral: string, + _interactionDelay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setIssuanceRatio( + ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidateReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationDelay( + time: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationEscrowDuration( + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRatio( + _liquidationRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinimumStakeTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPriceDeviationThresholdFactor( + _priceDeviationThresholdFactor: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPureChainlinkPriceForAtomicSwapsEnabled( + _currencyKey: BytesLike, + _enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setRateStalePeriod( + period: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSelfLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSnxLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTargetThreshold( + percent: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTradingRewardsEnabled( + _tradingRewardsEnabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setWaitingPeriodSecs( + _waitingPeriodSecs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperBurnFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperMaxTokenAmount( + _wrapper: string, + _maxTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperMintFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + snxLiquidationPenalty(overrides?: CallOverrides): Promise; + + targetThreshold(overrides?: CallOverrides): Promise; + + tradingRewardsEnabled(overrides?: CallOverrides): Promise; + + waitingPeriodSecs(overrides?: CallOverrides): Promise; + + wrapperBurnFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; + + wrapperMaxTokenAmount( + wrapper: string, + overrides?: CallOverrides + ): Promise; + + wrapperMintFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + aggregatorWarningFlags( + overrides?: CallOverrides + ): Promise; + + atomicEquivalentForDexPricing( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - flagReward(overrides?: CallOverrides): Promise + atomicExchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - interactionDelay( - collateral: PromiseOrValue, - overrides?: CallOverrides - ): Promise + atomicMaxVolumePerBlock( + overrides?: CallOverrides + ): Promise; - isResolverCached(overrides?: CallOverrides): Promise + atomicTwapWindow(overrides?: CallOverrides): Promise; - issuanceRatio(overrides?: CallOverrides): Promise + atomicVolatilityConsiderationWindow( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - liquidateReward(overrides?: CallOverrides): Promise + atomicVolatilityUpdateThreshold( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - liquidationDelay(overrides?: CallOverrides): Promise + collapseFeeRate( + collateral: string, + overrides?: CallOverrides + ): Promise; - liquidationEscrowDuration(overrides?: CallOverrides): Promise + crossChainSynthTransferEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - liquidationPenalty(overrides?: CallOverrides): Promise + crossDomainMessageGasLimit( + gasLimitType: BigNumberish, + overrides?: CallOverrides + ): Promise; - liquidationRatio(overrides?: CallOverrides): Promise + debtSnapshotStaleTime( + overrides?: CallOverrides + ): Promise; - minimumStakeTime(overrides?: CallOverrides): Promise + etherWrapperBurnFeeRate( + overrides?: CallOverrides + ): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + etherWrapperMaxETH( + overrides?: CallOverrides + ): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + etherWrapperMintFeeRate( + overrides?: CallOverrides + ): Promise; - owner(overrides?: CallOverrides): Promise + exchangeDynamicFeeRounds( + overrides?: CallOverrides + ): Promise; - priceDeviationThresholdFactor(overrides?: CallOverrides): Promise + exchangeDynamicFeeThreshold( + overrides?: CallOverrides + ): Promise; - pureChainlinkPriceForAtomicSwapsEnabled( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + exchangeDynamicFeeWeightDecay( + overrides?: CallOverrides + ): Promise; - rateStalePeriod(overrides?: CallOverrides): Promise + exchangeFeeRate( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - rebuildCache( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + exchangeMaxDynamicFee( + overrides?: CallOverrides + ): Promise; - resolver(overrides?: CallOverrides): Promise + feePeriodDuration(overrides?: CallOverrides): Promise; - resolverAddressesRequired(overrides?: CallOverrides): Promise + flagReward(overrides?: CallOverrides): Promise; - selfLiquidationPenalty(overrides?: CallOverrides): Promise + interactionDelay( + collateral: string, + overrides?: CallOverrides + ): Promise; - setAggregatorWarningFlags( - _flags: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + isResolverCached(overrides?: CallOverrides): Promise; - setAtomicEquivalentForDexPricing( - _currencyKey: PromiseOrValue, - _equivalent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + issuanceRatio(overrides?: CallOverrides): Promise; - setAtomicExchangeFeeRate( - _currencyKey: PromiseOrValue, - _exchangeFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + liquidateReward(overrides?: CallOverrides): Promise; - setAtomicMaxVolumePerBlock( - _maxVolume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + liquidationDelay(overrides?: CallOverrides): Promise; - setAtomicTwapWindow( - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + liquidationEscrowDuration( + overrides?: CallOverrides + ): Promise; - setAtomicVolatilityConsiderationWindow( - _currencyKey: PromiseOrValue, - _window: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + liquidationPenalty( + overrides?: CallOverrides + ): Promise; - setAtomicVolatilityUpdateThreshold( - _currencyKey: PromiseOrValue, - _threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + liquidationRatio(overrides?: CallOverrides): Promise; - setCollapseFeeRate( - _collateral: PromiseOrValue, - _collapseFeeRate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + minimumStakeTime(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; - setCrossChainSynthTransferEnabled( - _currencyKey: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setCrossDomainMessageGasLimit( - _gasLimitType: PromiseOrValue, - _crossDomainMessageGasLimit: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setDebtSnapshotStaleTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperBurnFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMaxETH( - _maxETH: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setEtherWrapperMintFeeRate( - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeRounds( - rounds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeThreshold( - threshold: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeDynamicFeeWeightDecay( - weightDecay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeFeeRateForSynths( - synthKeys: PromiseOrValue[], - exchangeFeeRates: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setExchangeMaxDynamicFee( - maxFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFeePeriodDuration( - _feePeriodDuration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setFlagReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setInteractionDelay( - _collateral: PromiseOrValue, - _interactionDelay: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setIssuanceRatio( - ratio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidateReward( - reward: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationDelay( - time: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationEscrowDuration( - duration: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setLiquidationRatio( - _liquidationRatio: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setMinimumStakeTime( - _seconds: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPriceDeviationThresholdFactor( - _priceDeviationThresholdFactor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setPureChainlinkPriceForAtomicSwapsEnabled( - _currencyKey: PromiseOrValue, - _enabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setRateStalePeriod( - period: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSelfLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setSnxLiquidationPenalty( - penalty: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTargetThreshold( - percent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setTradingRewardsEnabled( - _tradingRewardsEnabled: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWaitingPeriodSecs( - _waitingPeriodSecs: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperBurnFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperMaxTokenAmount( - _wrapper: PromiseOrValue, - _maxTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - setWrapperMintFeeRate( - _wrapper: PromiseOrValue, - _rate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - snxLiquidationPenalty(overrides?: CallOverrides): Promise - - targetThreshold(overrides?: CallOverrides): Promise - - tradingRewardsEnabled(overrides?: CallOverrides): Promise - - waitingPeriodSecs(overrides?: CallOverrides): Promise - - wrapperBurnFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - wrapperMaxTokenAmount( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - wrapperMintFeeRate( - wrapper: PromiseOrValue, - overrides?: CallOverrides - ): Promise - } + owner(overrides?: CallOverrides): Promise; + + priceDeviationThresholdFactor( + overrides?: CallOverrides + ): Promise; + + pureChainlinkPriceForAtomicSwapsEnabled( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + rateStalePeriod(overrides?: CallOverrides): Promise; + + rebuildCache( + overrides?: Overrides & { from?: string } + ): Promise; + + resolver(overrides?: CallOverrides): Promise; + + resolverAddressesRequired( + overrides?: CallOverrides + ): Promise; + + selfLiquidationPenalty( + overrides?: CallOverrides + ): Promise; + + setAggregatorWarningFlags( + _flags: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicEquivalentForDexPricing( + _currencyKey: BytesLike, + _equivalent: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicExchangeFeeRate( + _currencyKey: BytesLike, + _exchangeFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicMaxVolumePerBlock( + _maxVolume: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicTwapWindow( + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicVolatilityConsiderationWindow( + _currencyKey: BytesLike, + _window: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setAtomicVolatilityUpdateThreshold( + _currencyKey: BytesLike, + _threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCollapseFeeRate( + _collateral: string, + _collapseFeeRate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCrossChainSynthTransferEnabled( + _currencyKey: BytesLike, + _value: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setCrossDomainMessageGasLimit( + _gasLimitType: BigNumberish, + _crossDomainMessageGasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setDebtSnapshotStaleTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperBurnFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMaxETH( + _maxETH: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEtherWrapperMintFeeRate( + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeRounds( + rounds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeThreshold( + threshold: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeDynamicFeeWeightDecay( + weightDecay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeFeeRateForSynths( + synthKeys: BytesLike[], + exchangeFeeRates: BigNumberish[], + overrides?: Overrides & { from?: string } + ): Promise; + + setExchangeMaxDynamicFee( + maxFee: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFeePeriodDuration( + _feePeriodDuration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setFlagReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setInteractionDelay( + _collateral: string, + _interactionDelay: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setIssuanceRatio( + ratio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidateReward( + reward: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationDelay( + time: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationEscrowDuration( + duration: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiquidationRatio( + _liquidationRatio: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setMinimumStakeTime( + _seconds: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPriceDeviationThresholdFactor( + _priceDeviationThresholdFactor: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setPureChainlinkPriceForAtomicSwapsEnabled( + _currencyKey: BytesLike, + _enabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setRateStalePeriod( + period: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSelfLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setSnxLiquidationPenalty( + penalty: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTargetThreshold( + percent: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTradingRewardsEnabled( + _tradingRewardsEnabled: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + setWaitingPeriodSecs( + _waitingPeriodSecs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperBurnFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperMaxTokenAmount( + _wrapper: string, + _maxTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setWrapperMintFeeRate( + _wrapper: string, + _rate: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + snxLiquidationPenalty( + overrides?: CallOverrides + ): Promise; + + targetThreshold(overrides?: CallOverrides): Promise; + + tradingRewardsEnabled( + overrides?: CallOverrides + ): Promise; + + waitingPeriodSecs(overrides?: CallOverrides): Promise; + + wrapperBurnFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; + + wrapperMaxTokenAmount( + wrapper: string, + overrides?: CallOverrides + ): Promise; + + wrapperMintFeeRate( + wrapper: string, + overrides?: CallOverrides + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/SystemStatus.ts b/packages/sdk/src/contracts/types/SystemStatus.ts index d70d9f46bd..6c0eb6b3a9 100644 --- a/packages/sdk/src/contracts/types/SystemStatus.ts +++ b/packages/sdk/src/contracts/types/SystemStatus.ts @@ -2,1842 +2,2232 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface SystemStatusInterface extends utils.Interface { - functions: { - 'CONTRACT_NAME()': FunctionFragment - 'SECTION_EXCHANGE()': FunctionFragment - 'SECTION_FUTURES()': FunctionFragment - 'SECTION_ISSUANCE()': FunctionFragment - 'SECTION_SYNTH()': FunctionFragment - 'SECTION_SYNTH_EXCHANGE()': FunctionFragment - 'SECTION_SYSTEM()': FunctionFragment - 'SUSPENSION_REASON_UPGRADE()': FunctionFragment - 'acceptOwnership()': FunctionFragment - 'accessControl(bytes32,address)': FunctionFragment - 'exchangeSuspension()': FunctionFragment - 'futuresMarketSuspension(bytes32)': FunctionFragment - 'futuresSuspension()': FunctionFragment - 'getFuturesMarketSuspensions(bytes32[])': FunctionFragment - 'getSynthExchangeSuspensions(bytes32[])': FunctionFragment - 'getSynthSuspensions(bytes32[])': FunctionFragment - 'isSystemUpgrading()': FunctionFragment - 'issuanceSuspension()': FunctionFragment - 'nominateNewOwner(address)': FunctionFragment - 'nominatedOwner()': FunctionFragment - 'owner()': FunctionFragment - 'requireExchangeActive()': FunctionFragment - 'requireExchangeBetweenSynthsAllowed(bytes32,bytes32)': FunctionFragment - 'requireFuturesActive()': FunctionFragment - 'requireFuturesMarketActive(bytes32)': FunctionFragment - 'requireIssuanceActive()': FunctionFragment - 'requireSynthActive(bytes32)': FunctionFragment - 'requireSynthExchangeActive(bytes32)': FunctionFragment - 'requireSynthsActive(bytes32,bytes32)': FunctionFragment - 'requireSystemActive()': FunctionFragment - 'resumeExchange()': FunctionFragment - 'resumeFutures()': FunctionFragment - 'resumeFuturesMarket(bytes32)': FunctionFragment - 'resumeFuturesMarkets(bytes32[])': FunctionFragment - 'resumeIssuance()': FunctionFragment - 'resumeSynth(bytes32)': FunctionFragment - 'resumeSynthExchange(bytes32)': FunctionFragment - 'resumeSynths(bytes32[])': FunctionFragment - 'resumeSynthsExchange(bytes32[])': FunctionFragment - 'resumeSystem()': FunctionFragment - 'suspendExchange(uint256)': FunctionFragment - 'suspendFutures(uint256)': FunctionFragment - 'suspendFuturesMarket(bytes32,uint256)': FunctionFragment - 'suspendFuturesMarkets(bytes32[],uint256)': FunctionFragment - 'suspendIssuance(uint256)': FunctionFragment - 'suspendSynth(bytes32,uint256)': FunctionFragment - 'suspendSynthExchange(bytes32,uint256)': FunctionFragment - 'suspendSynths(bytes32[],uint256)': FunctionFragment - 'suspendSynthsExchange(bytes32[],uint256)': FunctionFragment - 'suspendSystem(uint256)': FunctionFragment - 'synthExchangeSuspension(bytes32)': FunctionFragment - 'synthSuspended(bytes32)': FunctionFragment - 'synthSuspension(bytes32)': FunctionFragment - 'systemSuspended()': FunctionFragment - 'systemSuspension()': FunctionFragment - 'updateAccessControl(bytes32,address,bool,bool)': FunctionFragment - 'updateAccessControls(bytes32[],address[],bool[],bool[])': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: - | 'CONTRACT_NAME' - | 'SECTION_EXCHANGE' - | 'SECTION_FUTURES' - | 'SECTION_ISSUANCE' - | 'SECTION_SYNTH' - | 'SECTION_SYNTH_EXCHANGE' - | 'SECTION_SYSTEM' - | 'SUSPENSION_REASON_UPGRADE' - | 'acceptOwnership' - | 'accessControl' - | 'exchangeSuspension' - | 'futuresMarketSuspension' - | 'futuresSuspension' - | 'getFuturesMarketSuspensions' - | 'getSynthExchangeSuspensions' - | 'getSynthSuspensions' - | 'isSystemUpgrading' - | 'issuanceSuspension' - | 'nominateNewOwner' - | 'nominatedOwner' - | 'owner' - | 'requireExchangeActive' - | 'requireExchangeBetweenSynthsAllowed' - | 'requireFuturesActive' - | 'requireFuturesMarketActive' - | 'requireIssuanceActive' - | 'requireSynthActive' - | 'requireSynthExchangeActive' - | 'requireSynthsActive' - | 'requireSystemActive' - | 'resumeExchange' - | 'resumeFutures' - | 'resumeFuturesMarket' - | 'resumeFuturesMarkets' - | 'resumeIssuance' - | 'resumeSynth' - | 'resumeSynthExchange' - | 'resumeSynths' - | 'resumeSynthsExchange' - | 'resumeSystem' - | 'suspendExchange' - | 'suspendFutures' - | 'suspendFuturesMarket' - | 'suspendFuturesMarkets' - | 'suspendIssuance' - | 'suspendSynth' - | 'suspendSynthExchange' - | 'suspendSynths' - | 'suspendSynthsExchange' - | 'suspendSystem' - | 'synthExchangeSuspension' - | 'synthSuspended' - | 'synthSuspension' - | 'systemSuspended' - | 'systemSuspension' - | 'updateAccessControl' - | 'updateAccessControls' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'CONTRACT_NAME', values?: undefined): string - encodeFunctionData(functionFragment: 'SECTION_EXCHANGE', values?: undefined): string - encodeFunctionData(functionFragment: 'SECTION_FUTURES', values?: undefined): string - encodeFunctionData(functionFragment: 'SECTION_ISSUANCE', values?: undefined): string - encodeFunctionData(functionFragment: 'SECTION_SYNTH', values?: undefined): string - encodeFunctionData(functionFragment: 'SECTION_SYNTH_EXCHANGE', values?: undefined): string - encodeFunctionData(functionFragment: 'SECTION_SYSTEM', values?: undefined): string - encodeFunctionData(functionFragment: 'SUSPENSION_REASON_UPGRADE', values?: undefined): string - encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string - encodeFunctionData( - functionFragment: 'accessControl', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'exchangeSuspension', values?: undefined): string - encodeFunctionData( - functionFragment: 'futuresMarketSuspension', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'futuresSuspension', values?: undefined): string - encodeFunctionData( - functionFragment: 'getFuturesMarketSuspensions', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'getSynthExchangeSuspensions', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'getSynthSuspensions', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'isSystemUpgrading', values?: undefined): string - encodeFunctionData(functionFragment: 'issuanceSuspension', values?: undefined): string - encodeFunctionData(functionFragment: 'nominateNewOwner', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'nominatedOwner', values?: undefined): string - encodeFunctionData(functionFragment: 'owner', values?: undefined): string - encodeFunctionData(functionFragment: 'requireExchangeActive', values?: undefined): string - encodeFunctionData( - functionFragment: 'requireExchangeBetweenSynthsAllowed', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'requireFuturesActive', values?: undefined): string - encodeFunctionData( - functionFragment: 'requireFuturesMarketActive', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'requireIssuanceActive', values?: undefined): string - encodeFunctionData( - functionFragment: 'requireSynthActive', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'requireSynthExchangeActive', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'requireSynthsActive', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'requireSystemActive', values?: undefined): string - encodeFunctionData(functionFragment: 'resumeExchange', values?: undefined): string - encodeFunctionData(functionFragment: 'resumeFutures', values?: undefined): string - encodeFunctionData( - functionFragment: 'resumeFuturesMarket', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'resumeFuturesMarkets', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'resumeIssuance', values?: undefined): string - encodeFunctionData(functionFragment: 'resumeSynth', values: [PromiseOrValue]): string - encodeFunctionData( - functionFragment: 'resumeSynthExchange', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'resumeSynths', - values: [PromiseOrValue[]] - ): string - encodeFunctionData( - functionFragment: 'resumeSynthsExchange', - values: [PromiseOrValue[]] - ): string - encodeFunctionData(functionFragment: 'resumeSystem', values?: undefined): string - encodeFunctionData( - functionFragment: 'suspendExchange', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendFutures', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendFuturesMarket', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendFuturesMarkets', - values: [PromiseOrValue[], PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendIssuance', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendSynth', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendSynthExchange', - values: [PromiseOrValue, PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendSynths', - values: [PromiseOrValue[], PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendSynthsExchange', - values: [PromiseOrValue[], PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'suspendSystem', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'synthExchangeSuspension', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'synthSuspended', - values: [PromiseOrValue] - ): string - encodeFunctionData( - functionFragment: 'synthSuspension', - values: [PromiseOrValue] - ): string - encodeFunctionData(functionFragment: 'systemSuspended', values?: undefined): string - encodeFunctionData(functionFragment: 'systemSuspension', values?: undefined): string - encodeFunctionData( - functionFragment: 'updateAccessControl', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] - ): string - encodeFunctionData( - functionFragment: 'updateAccessControls', - values: [ - PromiseOrValue[], - PromiseOrValue[], - PromiseOrValue[], - PromiseOrValue[] - ] - ): string - - decodeFunctionResult(functionFragment: 'CONTRACT_NAME', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SECTION_EXCHANGE', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SECTION_FUTURES', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SECTION_ISSUANCE', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SECTION_SYNTH', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SECTION_SYNTH_EXCHANGE', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SECTION_SYSTEM', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'SUSPENSION_REASON_UPGRADE', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'accessControl', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'exchangeSuspension', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'futuresMarketSuspension', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'futuresSuspension', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getFuturesMarketSuspensions', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getSynthExchangeSuspensions', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'getSynthSuspensions', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'isSystemUpgrading', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'issuanceSuspension', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominateNewOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'nominatedOwner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'requireExchangeActive', data: BytesLike): Result - decodeFunctionResult( - functionFragment: 'requireExchangeBetweenSynthsAllowed', - data: BytesLike - ): Result - decodeFunctionResult(functionFragment: 'requireFuturesActive', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'requireFuturesMarketActive', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'requireIssuanceActive', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'requireSynthActive', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'requireSynthExchangeActive', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'requireSynthsActive', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'requireSystemActive', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeFutures', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeFuturesMarket', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeFuturesMarkets', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeIssuance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeSynth', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeSynthExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeSynthsExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'resumeSystem', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendFutures', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendFuturesMarket', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendFuturesMarkets', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendIssuance', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendSynth', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendSynthExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendSynths', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendSynthsExchange', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'suspendSystem', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synthExchangeSuspension', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synthSuspended', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'synthSuspension', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'systemSuspended', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'systemSuspension', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'updateAccessControl', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'updateAccessControls', data: BytesLike): Result - - events: { - 'AccessControlUpdated(bytes32,address,bool,bool)': EventFragment - 'ExchangeResumed(uint256)': EventFragment - 'ExchangeSuspended(uint256)': EventFragment - 'FuturesMarketResumed(bytes32,uint256)': EventFragment - 'FuturesMarketSuspended(bytes32,uint256)': EventFragment - 'FuturesResumed(uint256)': EventFragment - 'FuturesSuspended(uint256)': EventFragment - 'IssuanceResumed(uint256)': EventFragment - 'IssuanceSuspended(uint256)': EventFragment - 'OwnerChanged(address,address)': EventFragment - 'OwnerNominated(address)': EventFragment - 'SynthExchangeResumed(bytes32,uint256)': EventFragment - 'SynthExchangeSuspended(bytes32,uint256)': EventFragment - 'SynthResumed(bytes32,uint256)': EventFragment - 'SynthSuspended(bytes32,uint256)': EventFragment - 'SystemResumed(uint256)': EventFragment - 'SystemSuspended(uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'AccessControlUpdated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeResumed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'ExchangeSuspended'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FuturesMarketResumed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FuturesMarketSuspended'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FuturesResumed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'FuturesSuspended'): EventFragment - getEvent(nameOrSignatureOrTopic: 'IssuanceResumed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'IssuanceSuspended'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerChanged'): EventFragment - getEvent(nameOrSignatureOrTopic: 'OwnerNominated'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SynthExchangeResumed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SynthExchangeSuspended'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SynthResumed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SynthSuspended'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SystemResumed'): EventFragment - getEvent(nameOrSignatureOrTopic: 'SystemSuspended'): EventFragment + functions: { + "CONTRACT_NAME()": FunctionFragment; + "SECTION_EXCHANGE()": FunctionFragment; + "SECTION_FUTURES()": FunctionFragment; + "SECTION_ISSUANCE()": FunctionFragment; + "SECTION_SYNTH()": FunctionFragment; + "SECTION_SYNTH_EXCHANGE()": FunctionFragment; + "SECTION_SYSTEM()": FunctionFragment; + "SUSPENSION_REASON_UPGRADE()": FunctionFragment; + "acceptOwnership()": FunctionFragment; + "accessControl(bytes32,address)": FunctionFragment; + "exchangeSuspension()": FunctionFragment; + "futuresMarketSuspension(bytes32)": FunctionFragment; + "futuresSuspension()": FunctionFragment; + "getFuturesMarketSuspensions(bytes32[])": FunctionFragment; + "getSynthExchangeSuspensions(bytes32[])": FunctionFragment; + "getSynthSuspensions(bytes32[])": FunctionFragment; + "isSystemUpgrading()": FunctionFragment; + "issuanceSuspension()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "requireExchangeActive()": FunctionFragment; + "requireExchangeBetweenSynthsAllowed(bytes32,bytes32)": FunctionFragment; + "requireFuturesActive()": FunctionFragment; + "requireFuturesMarketActive(bytes32)": FunctionFragment; + "requireIssuanceActive()": FunctionFragment; + "requireSynthActive(bytes32)": FunctionFragment; + "requireSynthExchangeActive(bytes32)": FunctionFragment; + "requireSynthsActive(bytes32,bytes32)": FunctionFragment; + "requireSystemActive()": FunctionFragment; + "resumeExchange()": FunctionFragment; + "resumeFutures()": FunctionFragment; + "resumeFuturesMarket(bytes32)": FunctionFragment; + "resumeFuturesMarkets(bytes32[])": FunctionFragment; + "resumeIssuance()": FunctionFragment; + "resumeSynth(bytes32)": FunctionFragment; + "resumeSynthExchange(bytes32)": FunctionFragment; + "resumeSynths(bytes32[])": FunctionFragment; + "resumeSynthsExchange(bytes32[])": FunctionFragment; + "resumeSystem()": FunctionFragment; + "suspendExchange(uint256)": FunctionFragment; + "suspendFutures(uint256)": FunctionFragment; + "suspendFuturesMarket(bytes32,uint256)": FunctionFragment; + "suspendFuturesMarkets(bytes32[],uint256)": FunctionFragment; + "suspendIssuance(uint256)": FunctionFragment; + "suspendSynth(bytes32,uint256)": FunctionFragment; + "suspendSynthExchange(bytes32,uint256)": FunctionFragment; + "suspendSynths(bytes32[],uint256)": FunctionFragment; + "suspendSynthsExchange(bytes32[],uint256)": FunctionFragment; + "suspendSystem(uint256)": FunctionFragment; + "synthExchangeSuspension(bytes32)": FunctionFragment; + "synthSuspended(bytes32)": FunctionFragment; + "synthSuspension(bytes32)": FunctionFragment; + "systemSuspended()": FunctionFragment; + "systemSuspension()": FunctionFragment; + "updateAccessControl(bytes32,address,bool,bool)": FunctionFragment; + "updateAccessControls(bytes32[],address[],bool[],bool[])": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CONTRACT_NAME" + | "SECTION_EXCHANGE" + | "SECTION_FUTURES" + | "SECTION_ISSUANCE" + | "SECTION_SYNTH" + | "SECTION_SYNTH_EXCHANGE" + | "SECTION_SYSTEM" + | "SUSPENSION_REASON_UPGRADE" + | "acceptOwnership" + | "accessControl" + | "exchangeSuspension" + | "futuresMarketSuspension" + | "futuresSuspension" + | "getFuturesMarketSuspensions" + | "getSynthExchangeSuspensions" + | "getSynthSuspensions" + | "isSystemUpgrading" + | "issuanceSuspension" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "requireExchangeActive" + | "requireExchangeBetweenSynthsAllowed" + | "requireFuturesActive" + | "requireFuturesMarketActive" + | "requireIssuanceActive" + | "requireSynthActive" + | "requireSynthExchangeActive" + | "requireSynthsActive" + | "requireSystemActive" + | "resumeExchange" + | "resumeFutures" + | "resumeFuturesMarket" + | "resumeFuturesMarkets" + | "resumeIssuance" + | "resumeSynth" + | "resumeSynthExchange" + | "resumeSynths" + | "resumeSynthsExchange" + | "resumeSystem" + | "suspendExchange" + | "suspendFutures" + | "suspendFuturesMarket" + | "suspendFuturesMarkets" + | "suspendIssuance" + | "suspendSynth" + | "suspendSynthExchange" + | "suspendSynths" + | "suspendSynthsExchange" + | "suspendSystem" + | "synthExchangeSuspension" + | "synthSuspended" + | "synthSuspension" + | "systemSuspended" + | "systemSuspension" + | "updateAccessControl" + | "updateAccessControls" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SECTION_EXCHANGE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SECTION_FUTURES", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SECTION_ISSUANCE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SECTION_SYNTH", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SECTION_SYNTH_EXCHANGE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SECTION_SYSTEM", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SUSPENSION_REASON_UPGRADE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "accessControl", + values: [BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "exchangeSuspension", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "futuresMarketSuspension", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "futuresSuspension", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getFuturesMarketSuspensions", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "getSynthExchangeSuspensions", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "getSynthSuspensions", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "isSystemUpgrading", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "issuanceSuspension", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "requireExchangeActive", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "requireExchangeBetweenSynthsAllowed", + values: [BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "requireFuturesActive", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "requireFuturesMarketActive", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "requireIssuanceActive", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "requireSynthActive", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "requireSynthExchangeActive", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "requireSynthsActive", + values: [BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "requireSystemActive", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "resumeExchange", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "resumeFutures", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "resumeFuturesMarket", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "resumeFuturesMarkets", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "resumeIssuance", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "resumeSynth", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "resumeSynthExchange", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "resumeSynths", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "resumeSynthsExchange", + values: [BytesLike[]] + ): string; + encodeFunctionData( + functionFragment: "resumeSystem", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "suspendExchange", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendFutures", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendFuturesMarket", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendFuturesMarkets", + values: [BytesLike[], BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendIssuance", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendSynth", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendSynthExchange", + values: [BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendSynths", + values: [BytesLike[], BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendSynthsExchange", + values: [BytesLike[], BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "suspendSystem", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "synthExchangeSuspension", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "synthSuspended", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "synthSuspension", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "systemSuspended", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "systemSuspension", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "updateAccessControl", + values: [BytesLike, string, boolean, boolean] + ): string; + encodeFunctionData( + functionFragment: "updateAccessControls", + values: [BytesLike[], string[], boolean[], boolean[]] + ): string; + + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SECTION_EXCHANGE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SECTION_FUTURES", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SECTION_ISSUANCE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SECTION_SYNTH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SECTION_SYNTH_EXCHANGE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SECTION_SYSTEM", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SUSPENSION_REASON_UPGRADE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "accessControl", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exchangeSuspension", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "futuresMarketSuspension", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "futuresSuspension", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFuturesMarketSuspensions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSynthExchangeSuspensions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSynthSuspensions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isSystemUpgrading", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "issuanceSuspension", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "requireExchangeActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireExchangeBetweenSynthsAllowed", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireFuturesActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireFuturesMarketActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireIssuanceActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireSynthActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireSynthExchangeActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireSynthsActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requireSystemActive", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeFutures", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeFuturesMarket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeFuturesMarkets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeIssuance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeSynth", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeSynthExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeSynths", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeSynthsExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "resumeSystem", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendFutures", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendFuturesMarket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendFuturesMarkets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendIssuance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendSynth", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendSynthExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendSynths", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendSynthsExchange", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "suspendSystem", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthExchangeSuspension", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthSuspended", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "synthSuspension", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "systemSuspended", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "systemSuspension", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateAccessControl", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateAccessControls", + data: BytesLike + ): Result; + + events: { + "AccessControlUpdated(bytes32,address,bool,bool)": EventFragment; + "ExchangeResumed(uint256)": EventFragment; + "ExchangeSuspended(uint256)": EventFragment; + "FuturesMarketResumed(bytes32,uint256)": EventFragment; + "FuturesMarketSuspended(bytes32,uint256)": EventFragment; + "FuturesResumed(uint256)": EventFragment; + "FuturesSuspended(uint256)": EventFragment; + "IssuanceResumed(uint256)": EventFragment; + "IssuanceSuspended(uint256)": EventFragment; + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "SynthExchangeResumed(bytes32,uint256)": EventFragment; + "SynthExchangeSuspended(bytes32,uint256)": EventFragment; + "SynthResumed(bytes32,uint256)": EventFragment; + "SynthSuspended(bytes32,uint256)": EventFragment; + "SystemResumed(uint256)": EventFragment; + "SystemSuspended(uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AccessControlUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeResumed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ExchangeSuspended"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FuturesMarketResumed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FuturesMarketSuspended"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FuturesResumed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FuturesSuspended"): EventFragment; + getEvent(nameOrSignatureOrTopic: "IssuanceResumed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "IssuanceSuspended"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthExchangeResumed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthExchangeSuspended"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthResumed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SynthSuspended"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SystemResumed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SystemSuspended"): EventFragment; } export interface AccessControlUpdatedEventObject { - section: string - account: string - canSuspend: boolean - canResume: boolean + section: string; + account: string; + canSuspend: boolean; + canResume: boolean; } export type AccessControlUpdatedEvent = TypedEvent< - [string, string, boolean, boolean], - AccessControlUpdatedEventObject -> + [string, string, boolean, boolean], + AccessControlUpdatedEventObject +>; -export type AccessControlUpdatedEventFilter = TypedEventFilter +export type AccessControlUpdatedEventFilter = + TypedEventFilter; export interface ExchangeResumedEventObject { - reason: BigNumber + reason: BigNumber; } -export type ExchangeResumedEvent = TypedEvent<[BigNumber], ExchangeResumedEventObject> +export type ExchangeResumedEvent = TypedEvent< + [BigNumber], + ExchangeResumedEventObject +>; -export type ExchangeResumedEventFilter = TypedEventFilter +export type ExchangeResumedEventFilter = TypedEventFilter; export interface ExchangeSuspendedEventObject { - reason: BigNumber + reason: BigNumber; } -export type ExchangeSuspendedEvent = TypedEvent<[BigNumber], ExchangeSuspendedEventObject> +export type ExchangeSuspendedEvent = TypedEvent< + [BigNumber], + ExchangeSuspendedEventObject +>; -export type ExchangeSuspendedEventFilter = TypedEventFilter +export type ExchangeSuspendedEventFilter = + TypedEventFilter; export interface FuturesMarketResumedEventObject { - marketKey: string - reason: BigNumber + marketKey: string; + reason: BigNumber; } export type FuturesMarketResumedEvent = TypedEvent< - [string, BigNumber], - FuturesMarketResumedEventObject -> + [string, BigNumber], + FuturesMarketResumedEventObject +>; -export type FuturesMarketResumedEventFilter = TypedEventFilter +export type FuturesMarketResumedEventFilter = + TypedEventFilter; export interface FuturesMarketSuspendedEventObject { - marketKey: string - reason: BigNumber + marketKey: string; + reason: BigNumber; } export type FuturesMarketSuspendedEvent = TypedEvent< - [string, BigNumber], - FuturesMarketSuspendedEventObject -> + [string, BigNumber], + FuturesMarketSuspendedEventObject +>; -export type FuturesMarketSuspendedEventFilter = TypedEventFilter +export type FuturesMarketSuspendedEventFilter = + TypedEventFilter; export interface FuturesResumedEventObject { - reason: BigNumber + reason: BigNumber; } -export type FuturesResumedEvent = TypedEvent<[BigNumber], FuturesResumedEventObject> +export type FuturesResumedEvent = TypedEvent< + [BigNumber], + FuturesResumedEventObject +>; -export type FuturesResumedEventFilter = TypedEventFilter +export type FuturesResumedEventFilter = TypedEventFilter; export interface FuturesSuspendedEventObject { - reason: BigNumber + reason: BigNumber; } -export type FuturesSuspendedEvent = TypedEvent<[BigNumber], FuturesSuspendedEventObject> +export type FuturesSuspendedEvent = TypedEvent< + [BigNumber], + FuturesSuspendedEventObject +>; -export type FuturesSuspendedEventFilter = TypedEventFilter +export type FuturesSuspendedEventFilter = + TypedEventFilter; export interface IssuanceResumedEventObject { - reason: BigNumber + reason: BigNumber; } -export type IssuanceResumedEvent = TypedEvent<[BigNumber], IssuanceResumedEventObject> +export type IssuanceResumedEvent = TypedEvent< + [BigNumber], + IssuanceResumedEventObject +>; -export type IssuanceResumedEventFilter = TypedEventFilter +export type IssuanceResumedEventFilter = TypedEventFilter; export interface IssuanceSuspendedEventObject { - reason: BigNumber + reason: BigNumber; } -export type IssuanceSuspendedEvent = TypedEvent<[BigNumber], IssuanceSuspendedEventObject> +export type IssuanceSuspendedEvent = TypedEvent< + [BigNumber], + IssuanceSuspendedEventObject +>; -export type IssuanceSuspendedEventFilter = TypedEventFilter +export type IssuanceSuspendedEventFilter = + TypedEventFilter; export interface OwnerChangedEventObject { - oldOwner: string - newOwner: string + oldOwner: string; + newOwner: string; } -export type OwnerChangedEvent = TypedEvent<[string, string], OwnerChangedEventObject> +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; -export type OwnerChangedEventFilter = TypedEventFilter +export type OwnerChangedEventFilter = TypedEventFilter; export interface OwnerNominatedEventObject { - newOwner: string + newOwner: string; } -export type OwnerNominatedEvent = TypedEvent<[string], OwnerNominatedEventObject> +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; -export type OwnerNominatedEventFilter = TypedEventFilter +export type OwnerNominatedEventFilter = TypedEventFilter; export interface SynthExchangeResumedEventObject { - currencyKey: string - reason: BigNumber + currencyKey: string; + reason: BigNumber; } export type SynthExchangeResumedEvent = TypedEvent< - [string, BigNumber], - SynthExchangeResumedEventObject -> + [string, BigNumber], + SynthExchangeResumedEventObject +>; -export type SynthExchangeResumedEventFilter = TypedEventFilter +export type SynthExchangeResumedEventFilter = + TypedEventFilter; export interface SynthExchangeSuspendedEventObject { - currencyKey: string - reason: BigNumber + currencyKey: string; + reason: BigNumber; } export type SynthExchangeSuspendedEvent = TypedEvent< - [string, BigNumber], - SynthExchangeSuspendedEventObject -> + [string, BigNumber], + SynthExchangeSuspendedEventObject +>; -export type SynthExchangeSuspendedEventFilter = TypedEventFilter +export type SynthExchangeSuspendedEventFilter = + TypedEventFilter; export interface SynthResumedEventObject { - currencyKey: string - reason: BigNumber + currencyKey: string; + reason: BigNumber; } -export type SynthResumedEvent = TypedEvent<[string, BigNumber], SynthResumedEventObject> +export type SynthResumedEvent = TypedEvent< + [string, BigNumber], + SynthResumedEventObject +>; -export type SynthResumedEventFilter = TypedEventFilter +export type SynthResumedEventFilter = TypedEventFilter; export interface SynthSuspendedEventObject { - currencyKey: string - reason: BigNumber + currencyKey: string; + reason: BigNumber; } -export type SynthSuspendedEvent = TypedEvent<[string, BigNumber], SynthSuspendedEventObject> +export type SynthSuspendedEvent = TypedEvent< + [string, BigNumber], + SynthSuspendedEventObject +>; -export type SynthSuspendedEventFilter = TypedEventFilter +export type SynthSuspendedEventFilter = TypedEventFilter; export interface SystemResumedEventObject { - reason: BigNumber + reason: BigNumber; } -export type SystemResumedEvent = TypedEvent<[BigNumber], SystemResumedEventObject> +export type SystemResumedEvent = TypedEvent< + [BigNumber], + SystemResumedEventObject +>; -export type SystemResumedEventFilter = TypedEventFilter +export type SystemResumedEventFilter = TypedEventFilter; export interface SystemSuspendedEventObject { - reason: BigNumber + reason: BigNumber; } -export type SystemSuspendedEvent = TypedEvent<[BigNumber], SystemSuspendedEventObject> +export type SystemSuspendedEvent = TypedEvent< + [BigNumber], + SystemSuspendedEventObject +>; -export type SystemSuspendedEventFilter = TypedEventFilter +export type SystemSuspendedEventFilter = TypedEventFilter; export interface SystemStatus extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise - - interface: SystemStatusInterface - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> - - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent - - functions: { - CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]> - - SECTION_EXCHANGE(overrides?: CallOverrides): Promise<[string]> - - SECTION_FUTURES(overrides?: CallOverrides): Promise<[string]> - - SECTION_ISSUANCE(overrides?: CallOverrides): Promise<[string]> - - SECTION_SYNTH(overrides?: CallOverrides): Promise<[string]> - - SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise<[string]> - - SECTION_SYSTEM(overrides?: CallOverrides): Promise<[string]> - - SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise<[BigNumber]> - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - accessControl( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, boolean] & { canSuspend: boolean; canResume: boolean }> - - exchangeSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - futuresMarketSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - futuresSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - getFuturesMarketSuspensions( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise< - [boolean[], BigNumber[]] & { - suspensions: boolean[] - reasons: BigNumber[] - } - > - - getSynthExchangeSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise< - [boolean[], BigNumber[]] & { - exchangeSuspensions: boolean[] - reasons: BigNumber[] - } - > - - getSynthSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise< - [boolean[], BigNumber[]] & { - suspensions: boolean[] - reasons: BigNumber[] - } - > - - isSystemUpgrading(overrides?: CallOverrides): Promise<[boolean]> - - issuanceSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise<[string]> - - owner(overrides?: CallOverrides): Promise<[string]> - - requireExchangeActive(overrides?: CallOverrides): Promise<[void]> - - requireExchangeBetweenSynthsAllowed( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[void]> - - requireFuturesActive(overrides?: CallOverrides): Promise<[void]> - - requireFuturesMarketActive( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[void]> - - requireIssuanceActive(overrides?: CallOverrides): Promise<[void]> - - requireSynthActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[void]> - - requireSynthExchangeActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[void]> - - requireSynthsActive( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[void]> - - requireSystemActive(overrides?: CallOverrides): Promise<[void]> - - resumeExchange( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFutures( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFuturesMarket( - marketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFuturesMarkets( - marketKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeIssuance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynth( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthExchange( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynths( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthsExchange( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSystem( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendExchange( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFutures( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarket( - marketKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarkets( - marketKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendIssuance( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynth( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthExchange( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynths( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthsExchange( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSystem( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - synthExchangeSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - synthSuspended( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]> - - synthSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - systemSuspended(overrides?: CallOverrides): Promise<[boolean]> - - systemSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - updateAccessControl( - section: PromiseOrValue, - account: PromiseOrValue, - canSuspend: PromiseOrValue, - canResume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccessControls( - sections: PromiseOrValue[], - accounts: PromiseOrValue[], - canSuspends: PromiseOrValue[], - canResumes: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - CONTRACT_NAME(overrides?: CallOverrides): Promise - - SECTION_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_FUTURES(overrides?: CallOverrides): Promise - - SECTION_ISSUANCE(overrides?: CallOverrides): Promise - - SECTION_SYNTH(overrides?: CallOverrides): Promise - - SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_SYSTEM(overrides?: CallOverrides): Promise - - SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise - - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - accessControl( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, boolean] & { canSuspend: boolean; canResume: boolean }> - - exchangeSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - futuresMarketSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - futuresSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - getFuturesMarketSuspensions( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[boolean[], BigNumber[]] & { suspensions: boolean[]; reasons: BigNumber[] }> - - getSynthExchangeSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise< - [boolean[], BigNumber[]] & { - exchangeSuspensions: boolean[] - reasons: BigNumber[] - } - > - - getSynthSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise<[boolean[], BigNumber[]] & { suspensions: boolean[]; reasons: BigNumber[] }> - - isSystemUpgrading(overrides?: CallOverrides): Promise - - issuanceSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - requireExchangeActive(overrides?: CallOverrides): Promise - - requireExchangeBetweenSynthsAllowed( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireFuturesActive(overrides?: CallOverrides): Promise - - requireFuturesMarketActive( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireIssuanceActive(overrides?: CallOverrides): Promise - - requireSynthActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSynthExchangeActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSynthsActive( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSystemActive(overrides?: CallOverrides): Promise - - resumeExchange( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFutures( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFuturesMarket( - marketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFuturesMarkets( - marketKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeIssuance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynth( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthExchange( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynths( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthsExchange( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSystem( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendExchange( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFutures( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarket( - marketKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarkets( - marketKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendIssuance( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynth( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthExchange( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynths( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthsExchange( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSystem( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - synthExchangeSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - synthSuspended( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - synthSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - systemSuspended(overrides?: CallOverrides): Promise - - systemSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - updateAccessControl( - section: PromiseOrValue, - account: PromiseOrValue, - canSuspend: PromiseOrValue, - canResume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccessControls( - sections: PromiseOrValue[], - accounts: PromiseOrValue[], - canSuspends: PromiseOrValue[], - canResumes: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - callStatic: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - SECTION_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_FUTURES(overrides?: CallOverrides): Promise - - SECTION_ISSUANCE(overrides?: CallOverrides): Promise - - SECTION_SYNTH(overrides?: CallOverrides): Promise - - SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_SYSTEM(overrides?: CallOverrides): Promise - - SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: CallOverrides): Promise - - accessControl( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, boolean] & { canSuspend: boolean; canResume: boolean }> - - exchangeSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - futuresMarketSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - futuresSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - getFuturesMarketSuspensions( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise< - [boolean[], BigNumber[]] & { - suspensions: boolean[] - reasons: BigNumber[] - } - > - - getSynthExchangeSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise< - [boolean[], BigNumber[]] & { - exchangeSuspensions: boolean[] - reasons: BigNumber[] - } - > - - getSynthSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise< - [boolean[], BigNumber[]] & { - suspensions: boolean[] - reasons: BigNumber[] - } - > - - isSystemUpgrading(overrides?: CallOverrides): Promise - - issuanceSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - nominateNewOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - requireExchangeActive(overrides?: CallOverrides): Promise - - requireExchangeBetweenSynthsAllowed( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireFuturesActive(overrides?: CallOverrides): Promise - - requireFuturesMarketActive( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireIssuanceActive(overrides?: CallOverrides): Promise - - requireSynthActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSynthExchangeActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSynthsActive( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSystemActive(overrides?: CallOverrides): Promise - - resumeExchange(overrides?: CallOverrides): Promise - - resumeFutures(overrides?: CallOverrides): Promise - - resumeFuturesMarket( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resumeFuturesMarkets( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - resumeIssuance(overrides?: CallOverrides): Promise - - resumeSynth(currencyKey: PromiseOrValue, overrides?: CallOverrides): Promise - - resumeSynthExchange( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - resumeSynths( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - resumeSynthsExchange( - currencyKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - resumeSystem(overrides?: CallOverrides): Promise - - suspendExchange(reason: PromiseOrValue, overrides?: CallOverrides): Promise - - suspendFutures(reason: PromiseOrValue, overrides?: CallOverrides): Promise - - suspendFuturesMarket( - marketKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - suspendFuturesMarkets( - marketKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - suspendIssuance(reason: PromiseOrValue, overrides?: CallOverrides): Promise - - suspendSynth( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - suspendSynthExchange( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - suspendSynths( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - suspendSynthsExchange( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - suspendSystem(reason: PromiseOrValue, overrides?: CallOverrides): Promise - - synthExchangeSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - synthSuspended( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - synthSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - systemSuspended(overrides?: CallOverrides): Promise - - systemSuspension( - overrides?: CallOverrides - ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }> - - updateAccessControl( - section: PromiseOrValue, - account: PromiseOrValue, - canSuspend: PromiseOrValue, - canResume: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - updateAccessControls( - sections: PromiseOrValue[], - accounts: PromiseOrValue[], - canSuspends: PromiseOrValue[], - canResumes: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - } - - filters: { - 'AccessControlUpdated(bytes32,address,bool,bool)'( - section?: PromiseOrValue | null, - account?: PromiseOrValue | null, - canSuspend?: null, - canResume?: null - ): AccessControlUpdatedEventFilter - AccessControlUpdated( - section?: PromiseOrValue | null, - account?: PromiseOrValue | null, - canSuspend?: null, - canResume?: null - ): AccessControlUpdatedEventFilter - - 'ExchangeResumed(uint256)'(reason?: null): ExchangeResumedEventFilter - ExchangeResumed(reason?: null): ExchangeResumedEventFilter - - 'ExchangeSuspended(uint256)'(reason?: null): ExchangeSuspendedEventFilter - ExchangeSuspended(reason?: null): ExchangeSuspendedEventFilter - - 'FuturesMarketResumed(bytes32,uint256)'( - marketKey?: null, - reason?: null - ): FuturesMarketResumedEventFilter - FuturesMarketResumed(marketKey?: null, reason?: null): FuturesMarketResumedEventFilter - - 'FuturesMarketSuspended(bytes32,uint256)'( - marketKey?: null, - reason?: null - ): FuturesMarketSuspendedEventFilter - FuturesMarketSuspended(marketKey?: null, reason?: null): FuturesMarketSuspendedEventFilter - - 'FuturesResumed(uint256)'(reason?: null): FuturesResumedEventFilter - FuturesResumed(reason?: null): FuturesResumedEventFilter - - 'FuturesSuspended(uint256)'(reason?: null): FuturesSuspendedEventFilter - FuturesSuspended(reason?: null): FuturesSuspendedEventFilter - - 'IssuanceResumed(uint256)'(reason?: null): IssuanceResumedEventFilter - IssuanceResumed(reason?: null): IssuanceResumedEventFilter - - 'IssuanceSuspended(uint256)'(reason?: null): IssuanceSuspendedEventFilter - IssuanceSuspended(reason?: null): IssuanceSuspendedEventFilter - - 'OwnerChanged(address,address)'(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter - - 'OwnerNominated(address)'(newOwner?: null): OwnerNominatedEventFilter - OwnerNominated(newOwner?: null): OwnerNominatedEventFilter - - 'SynthExchangeResumed(bytes32,uint256)'( - currencyKey?: null, - reason?: null - ): SynthExchangeResumedEventFilter - SynthExchangeResumed(currencyKey?: null, reason?: null): SynthExchangeResumedEventFilter - - 'SynthExchangeSuspended(bytes32,uint256)'( - currencyKey?: null, - reason?: null - ): SynthExchangeSuspendedEventFilter - SynthExchangeSuspended(currencyKey?: null, reason?: null): SynthExchangeSuspendedEventFilter - - 'SynthResumed(bytes32,uint256)'(currencyKey?: null, reason?: null): SynthResumedEventFilter - SynthResumed(currencyKey?: null, reason?: null): SynthResumedEventFilter - - 'SynthSuspended(bytes32,uint256)'(currencyKey?: null, reason?: null): SynthSuspendedEventFilter - SynthSuspended(currencyKey?: null, reason?: null): SynthSuspendedEventFilter - - 'SystemResumed(uint256)'(reason?: null): SystemResumedEventFilter - SystemResumed(reason?: null): SystemResumedEventFilter - - 'SystemSuspended(uint256)'(reason?: null): SystemSuspendedEventFilter - SystemSuspended(reason?: null): SystemSuspendedEventFilter - } - - estimateGas: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - SECTION_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_FUTURES(overrides?: CallOverrides): Promise - - SECTION_ISSUANCE(overrides?: CallOverrides): Promise - - SECTION_SYNTH(overrides?: CallOverrides): Promise - - SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_SYSTEM(overrides?: CallOverrides): Promise - - SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise - - acceptOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - accessControl( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - exchangeSuspension(overrides?: CallOverrides): Promise - - futuresMarketSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - futuresSuspension(overrides?: CallOverrides): Promise - - getFuturesMarketSuspensions( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getSynthExchangeSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - getSynthSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise - - isSystemUpgrading(overrides?: CallOverrides): Promise - - issuanceSuspension(overrides?: CallOverrides): Promise - - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - nominatedOwner(overrides?: CallOverrides): Promise - - owner(overrides?: CallOverrides): Promise - - requireExchangeActive(overrides?: CallOverrides): Promise - - requireExchangeBetweenSynthsAllowed( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireFuturesActive(overrides?: CallOverrides): Promise - - requireFuturesMarketActive( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireIssuanceActive(overrides?: CallOverrides): Promise - - requireSynthActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSynthExchangeActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSynthsActive( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSystemActive(overrides?: CallOverrides): Promise - - resumeExchange(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - resumeFutures(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - resumeFuturesMarket( - marketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFuturesMarkets( - marketKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeIssuance(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - resumeSynth( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthExchange( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynths( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthsExchange( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSystem(overrides?: Overrides & { from?: PromiseOrValue }): Promise - - suspendExchange( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFutures( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarket( - marketKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarkets( - marketKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendIssuance( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynth( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthExchange( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynths( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthsExchange( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSystem( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - synthExchangeSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - synthSuspended( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - synthSuspension(arg0: PromiseOrValue, overrides?: CallOverrides): Promise - - systemSuspended(overrides?: CallOverrides): Promise - - systemSuspension(overrides?: CallOverrides): Promise - - updateAccessControl( - section: PromiseOrValue, - account: PromiseOrValue, - canSuspend: PromiseOrValue, - canResume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccessControls( - sections: PromiseOrValue[], - accounts: PromiseOrValue[], - canSuspends: PromiseOrValue[], - canResumes: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } - - populateTransaction: { - CONTRACT_NAME(overrides?: CallOverrides): Promise - - SECTION_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_FUTURES(overrides?: CallOverrides): Promise - - SECTION_ISSUANCE(overrides?: CallOverrides): Promise - - SECTION_SYNTH(overrides?: CallOverrides): Promise - - SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise - - SECTION_SYSTEM(overrides?: CallOverrides): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SystemStatusInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; + + SECTION_EXCHANGE(overrides?: CallOverrides): Promise<[string]>; + + SECTION_FUTURES(overrides?: CallOverrides): Promise<[string]>; + + SECTION_ISSUANCE(overrides?: CallOverrides): Promise<[string]>; + + SECTION_SYNTH(overrides?: CallOverrides): Promise<[string]>; + + SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise<[string]>; + + SECTION_SYSTEM(overrides?: CallOverrides): Promise<[string]>; + + SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise<[BigNumber]>; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accessControl( + arg0: BytesLike, + arg1: string, + overrides?: CallOverrides + ): Promise< + [boolean, boolean] & { canSuspend: boolean; canResume: boolean } + >; + + exchangeSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + futuresMarketSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + futuresSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + getFuturesMarketSuspensions( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { + suspensions: boolean[]; + reasons: BigNumber[]; + } + >; + + getSynthExchangeSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { + exchangeSuspensions: boolean[]; + reasons: BigNumber[]; + } + >; + + getSynthSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { + suspensions: boolean[]; + reasons: BigNumber[]; + } + >; + + isSystemUpgrading(overrides?: CallOverrides): Promise<[boolean]>; + + issuanceSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + requireExchangeActive(overrides?: CallOverrides): Promise<[void]>; + + requireExchangeBetweenSynthsAllowed( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[void]>; + + requireFuturesActive(overrides?: CallOverrides): Promise<[void]>; + + requireFuturesMarketActive( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise<[void]>; + + requireIssuanceActive(overrides?: CallOverrides): Promise<[void]>; + + requireSynthActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[void]>; + + requireSynthExchangeActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[void]>; + + requireSynthsActive( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[void]>; + + requireSystemActive(overrides?: CallOverrides): Promise<[void]>; + + resumeExchange( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFutures( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarket( + marketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarkets( + marketKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeIssuance( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynth( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthExchange( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynths( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthsExchange( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSystem( + overrides?: Overrides & { from?: string } + ): Promise; + + suspendExchange( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFutures( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarket( + marketKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarkets( + marketKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendIssuance( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynth( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthExchange( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynths( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthsExchange( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSystem( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + synthExchangeSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + synthSuspended( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + synthSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + systemSuspended(overrides?: CallOverrides): Promise<[boolean]>; + + systemSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + updateAccessControl( + section: BytesLike, + account: string, + canSuspend: boolean, + canResume: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccessControls( + sections: BytesLike[], + accounts: string[], + canSuspends: boolean[], + canResumes: boolean[], + overrides?: Overrides & { from?: string } + ): Promise; + }; + + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + SECTION_EXCHANGE(overrides?: CallOverrides): Promise; + + SECTION_FUTURES(overrides?: CallOverrides): Promise; + + SECTION_ISSUANCE(overrides?: CallOverrides): Promise; + + SECTION_SYNTH(overrides?: CallOverrides): Promise; + + SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise; + + SECTION_SYSTEM(overrides?: CallOverrides): Promise; + + SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accessControl( + arg0: BytesLike, + arg1: string, + overrides?: CallOverrides + ): Promise<[boolean, boolean] & { canSuspend: boolean; canResume: boolean }>; + + exchangeSuspension( + overrides?: CallOverrides + ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }>; + + futuresMarketSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }>; + + futuresSuspension( + overrides?: CallOverrides + ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }>; + + getFuturesMarketSuspensions( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { suspensions: boolean[]; reasons: BigNumber[] } + >; + + getSynthExchangeSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { + exchangeSuspensions: boolean[]; + reasons: BigNumber[]; + } + >; + + getSynthSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { suspensions: boolean[]; reasons: BigNumber[] } + >; + + isSystemUpgrading(overrides?: CallOverrides): Promise; + + issuanceSuspension( + overrides?: CallOverrides + ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }>; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + requireExchangeActive(overrides?: CallOverrides): Promise; + + requireExchangeBetweenSynthsAllowed( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireFuturesActive(overrides?: CallOverrides): Promise; + + requireFuturesMarketActive( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireIssuanceActive(overrides?: CallOverrides): Promise; + + requireSynthActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSynthExchangeActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSynthsActive( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSystemActive(overrides?: CallOverrides): Promise; + + resumeExchange( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFutures( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarket( + marketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarkets( + marketKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeIssuance( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynth( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthExchange( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynths( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthsExchange( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSystem( + overrides?: Overrides & { from?: string } + ): Promise; + + suspendExchange( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFutures( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarket( + marketKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarkets( + marketKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendIssuance( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynth( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthExchange( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynths( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthsExchange( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSystem( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + synthExchangeSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }>; + + synthSuspended( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }>; + + systemSuspended(overrides?: CallOverrides): Promise; + + systemSuspension( + overrides?: CallOverrides + ): Promise<[boolean, BigNumber] & { suspended: boolean; reason: BigNumber }>; + + updateAccessControl( + section: BytesLike, + account: string, + canSuspend: boolean, + canResume: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccessControls( + sections: BytesLike[], + accounts: string[], + canSuspends: boolean[], + canResumes: boolean[], + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + SECTION_EXCHANGE(overrides?: CallOverrides): Promise; + + SECTION_FUTURES(overrides?: CallOverrides): Promise; + + SECTION_ISSUANCE(overrides?: CallOverrides): Promise; + + SECTION_SYNTH(overrides?: CallOverrides): Promise; + + SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise; + + SECTION_SYSTEM(overrides?: CallOverrides): Promise; + + SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise; + + acceptOwnership(overrides?: CallOverrides): Promise; + + accessControl( + arg0: BytesLike, + arg1: string, + overrides?: CallOverrides + ): Promise< + [boolean, boolean] & { canSuspend: boolean; canResume: boolean } + >; + + exchangeSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + futuresMarketSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + futuresSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + getFuturesMarketSuspensions( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { + suspensions: boolean[]; + reasons: BigNumber[]; + } + >; + + getSynthExchangeSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { + exchangeSuspensions: boolean[]; + reasons: BigNumber[]; + } + >; + + getSynthSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise< + [boolean[], BigNumber[]] & { + suspensions: boolean[]; + reasons: BigNumber[]; + } + >; + + isSystemUpgrading(overrides?: CallOverrides): Promise; + + issuanceSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + nominateNewOwner(_owner: string, overrides?: CallOverrides): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + requireExchangeActive(overrides?: CallOverrides): Promise; + + requireExchangeBetweenSynthsAllowed( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireFuturesActive(overrides?: CallOverrides): Promise; + + requireFuturesMarketActive( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireIssuanceActive(overrides?: CallOverrides): Promise; + + requireSynthActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSynthExchangeActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSynthsActive( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSystemActive(overrides?: CallOverrides): Promise; + + resumeExchange(overrides?: CallOverrides): Promise; + + resumeFutures(overrides?: CallOverrides): Promise; + + resumeFuturesMarket( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + resumeFuturesMarkets( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + resumeIssuance(overrides?: CallOverrides): Promise; + + resumeSynth( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + resumeSynthExchange( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + resumeSynths( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + resumeSynthsExchange( + currencyKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + resumeSystem(overrides?: CallOverrides): Promise; + + suspendExchange( + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendFutures( + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendFuturesMarket( + marketKey: BytesLike, + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendFuturesMarkets( + marketKeys: BytesLike[], + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendIssuance( + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendSynth( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendSynthExchange( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendSynths( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendSynthsExchange( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + suspendSystem( + reason: BigNumberish, + overrides?: CallOverrides + ): Promise; + + synthExchangeSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + synthSuspended( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + systemSuspended(overrides?: CallOverrides): Promise; + + systemSuspension( + overrides?: CallOverrides + ): Promise< + [boolean, BigNumber] & { suspended: boolean; reason: BigNumber } + >; + + updateAccessControl( + section: BytesLike, + account: string, + canSuspend: boolean, + canResume: boolean, + overrides?: CallOverrides + ): Promise; + + updateAccessControls( + sections: BytesLike[], + accounts: string[], + canSuspends: boolean[], + canResumes: boolean[], + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AccessControlUpdated(bytes32,address,bool,bool)"( + section?: BytesLike | null, + account?: string | null, + canSuspend?: null, + canResume?: null + ): AccessControlUpdatedEventFilter; + AccessControlUpdated( + section?: BytesLike | null, + account?: string | null, + canSuspend?: null, + canResume?: null + ): AccessControlUpdatedEventFilter; + + "ExchangeResumed(uint256)"(reason?: null): ExchangeResumedEventFilter; + ExchangeResumed(reason?: null): ExchangeResumedEventFilter; + + "ExchangeSuspended(uint256)"(reason?: null): ExchangeSuspendedEventFilter; + ExchangeSuspended(reason?: null): ExchangeSuspendedEventFilter; + + "FuturesMarketResumed(bytes32,uint256)"( + marketKey?: null, + reason?: null + ): FuturesMarketResumedEventFilter; + FuturesMarketResumed( + marketKey?: null, + reason?: null + ): FuturesMarketResumedEventFilter; + + "FuturesMarketSuspended(bytes32,uint256)"( + marketKey?: null, + reason?: null + ): FuturesMarketSuspendedEventFilter; + FuturesMarketSuspended( + marketKey?: null, + reason?: null + ): FuturesMarketSuspendedEventFilter; + + "FuturesResumed(uint256)"(reason?: null): FuturesResumedEventFilter; + FuturesResumed(reason?: null): FuturesResumedEventFilter; + + "FuturesSuspended(uint256)"(reason?: null): FuturesSuspendedEventFilter; + FuturesSuspended(reason?: null): FuturesSuspendedEventFilter; + + "IssuanceResumed(uint256)"(reason?: null): IssuanceResumedEventFilter; + IssuanceResumed(reason?: null): IssuanceResumedEventFilter; + + "IssuanceSuspended(uint256)"(reason?: null): IssuanceSuspendedEventFilter; + IssuanceSuspended(reason?: null): IssuanceSuspendedEventFilter; + + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "SynthExchangeResumed(bytes32,uint256)"( + currencyKey?: null, + reason?: null + ): SynthExchangeResumedEventFilter; + SynthExchangeResumed( + currencyKey?: null, + reason?: null + ): SynthExchangeResumedEventFilter; + + "SynthExchangeSuspended(bytes32,uint256)"( + currencyKey?: null, + reason?: null + ): SynthExchangeSuspendedEventFilter; + SynthExchangeSuspended( + currencyKey?: null, + reason?: null + ): SynthExchangeSuspendedEventFilter; + + "SynthResumed(bytes32,uint256)"( + currencyKey?: null, + reason?: null + ): SynthResumedEventFilter; + SynthResumed(currencyKey?: null, reason?: null): SynthResumedEventFilter; + + "SynthSuspended(bytes32,uint256)"( + currencyKey?: null, + reason?: null + ): SynthSuspendedEventFilter; + SynthSuspended( + currencyKey?: null, + reason?: null + ): SynthSuspendedEventFilter; + + "SystemResumed(uint256)"(reason?: null): SystemResumedEventFilter; + SystemResumed(reason?: null): SystemResumedEventFilter; + + "SystemSuspended(uint256)"(reason?: null): SystemSuspendedEventFilter; + SystemSuspended(reason?: null): SystemSuspendedEventFilter; + }; + + estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + SECTION_EXCHANGE(overrides?: CallOverrides): Promise; + + SECTION_FUTURES(overrides?: CallOverrides): Promise; + + SECTION_ISSUANCE(overrides?: CallOverrides): Promise; + + SECTION_SYNTH(overrides?: CallOverrides): Promise; + + SECTION_SYNTH_EXCHANGE(overrides?: CallOverrides): Promise; - SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise + SECTION_SYSTEM(overrides?: CallOverrides): Promise; - acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + SUSPENSION_REASON_UPGRADE(overrides?: CallOverrides): Promise; - accessControl( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides - ): Promise + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; - exchangeSuspension(overrides?: CallOverrides): Promise + accessControl( + arg0: BytesLike, + arg1: string, + overrides?: CallOverrides + ): Promise; - futuresMarketSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise + exchangeSuspension(overrides?: CallOverrides): Promise; - futuresSuspension(overrides?: CallOverrides): Promise + futuresMarketSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; - getFuturesMarketSuspensions( - marketKeys: PromiseOrValue[], - overrides?: CallOverrides - ): Promise + futuresSuspension(overrides?: CallOverrides): Promise; - getSynthExchangeSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise + getFuturesMarketSuspensions( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; - getSynthSuspensions( - synths: PromiseOrValue[], - overrides?: CallOverrides - ): Promise + getSynthExchangeSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise; - isSystemUpgrading(overrides?: CallOverrides): Promise + getSynthSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise; - issuanceSuspension(overrides?: CallOverrides): Promise + isSystemUpgrading(overrides?: CallOverrides): Promise; - nominateNewOwner( - _owner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + issuanceSuspension(overrides?: CallOverrides): Promise; - nominatedOwner(overrides?: CallOverrides): Promise + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; - owner(overrides?: CallOverrides): Promise + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + requireExchangeActive(overrides?: CallOverrides): Promise; - requireExchangeActive(overrides?: CallOverrides): Promise + requireExchangeBetweenSynthsAllowed( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - requireExchangeBetweenSynthsAllowed( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + requireFuturesActive(overrides?: CallOverrides): Promise; - requireFuturesActive(overrides?: CallOverrides): Promise + requireFuturesMarketActive( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; - requireFuturesMarketActive( - marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + requireIssuanceActive(overrides?: CallOverrides): Promise; - requireIssuanceActive(overrides?: CallOverrides): Promise + requireSynthActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - requireSynthActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - requireSynthExchangeActive( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + requireSynthExchangeActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - requireSynthsActive( - sourceCurrencyKey: PromiseOrValue, - destinationCurrencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise + requireSynthsActive( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; - requireSystemActive(overrides?: CallOverrides): Promise + requireSystemActive(overrides?: CallOverrides): Promise; - resumeExchange( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + resumeExchange( + overrides?: Overrides & { from?: string } + ): Promise; - resumeFutures( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFuturesMarket( - marketKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeFuturesMarkets( - marketKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeIssuance( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynth( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthExchange( - currencyKey: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynths( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSynthsExchange( - currencyKeys: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - resumeSystem( - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendExchange( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFutures( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarket( - marketKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendFuturesMarkets( - marketKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendIssuance( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynth( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthExchange( - currencyKey: PromiseOrValue, - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynths( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSynthsExchange( - currencyKeys: PromiseOrValue[], - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - suspendSystem( - reason: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - synthExchangeSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - synthSuspended( - currencyKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - synthSuspension( - arg0: PromiseOrValue, - overrides?: CallOverrides - ): Promise - - systemSuspended(overrides?: CallOverrides): Promise - - systemSuspension(overrides?: CallOverrides): Promise - - updateAccessControl( - section: PromiseOrValue, - account: PromiseOrValue, - canSuspend: PromiseOrValue, - canResume: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - - updateAccessControls( - sections: PromiseOrValue[], - accounts: PromiseOrValue[], - canSuspends: PromiseOrValue[], - canResumes: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise - } + resumeFutures( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarket( + marketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarkets( + marketKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeIssuance( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynth( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthExchange( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynths( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthsExchange( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSystem(overrides?: Overrides & { from?: string }): Promise; + + suspendExchange( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFutures( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarket( + marketKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarkets( + marketKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendIssuance( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynth( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthExchange( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynths( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthsExchange( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSystem( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + synthExchangeSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthSuspended( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + systemSuspended(overrides?: CallOverrides): Promise; + + systemSuspension(overrides?: CallOverrides): Promise; + + updateAccessControl( + section: BytesLike, + account: string, + canSuspend: boolean, + canResume: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccessControls( + sections: BytesLike[], + accounts: string[], + canSuspends: boolean[], + canResumes: boolean[], + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + + SECTION_EXCHANGE(overrides?: CallOverrides): Promise; + + SECTION_FUTURES(overrides?: CallOverrides): Promise; + + SECTION_ISSUANCE(overrides?: CallOverrides): Promise; + + SECTION_SYNTH(overrides?: CallOverrides): Promise; + + SECTION_SYNTH_EXCHANGE( + overrides?: CallOverrides + ): Promise; + + SECTION_SYSTEM(overrides?: CallOverrides): Promise; + + SUSPENSION_REASON_UPGRADE( + overrides?: CallOverrides + ): Promise; + + acceptOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + accessControl( + arg0: BytesLike, + arg1: string, + overrides?: CallOverrides + ): Promise; + + exchangeSuspension( + overrides?: CallOverrides + ): Promise; + + futuresMarketSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + futuresSuspension(overrides?: CallOverrides): Promise; + + getFuturesMarketSuspensions( + marketKeys: BytesLike[], + overrides?: CallOverrides + ): Promise; + + getSynthExchangeSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise; + + getSynthSuspensions( + synths: BytesLike[], + overrides?: CallOverrides + ): Promise; + + isSystemUpgrading(overrides?: CallOverrides): Promise; + + issuanceSuspension( + overrides?: CallOverrides + ): Promise; + + nominateNewOwner( + _owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + requireExchangeActive( + overrides?: CallOverrides + ): Promise; + + requireExchangeBetweenSynthsAllowed( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireFuturesActive( + overrides?: CallOverrides + ): Promise; + + requireFuturesMarketActive( + marketKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireIssuanceActive( + overrides?: CallOverrides + ): Promise; + + requireSynthActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSynthExchangeActive( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSynthsActive( + sourceCurrencyKey: BytesLike, + destinationCurrencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + requireSystemActive( + overrides?: CallOverrides + ): Promise; + + resumeExchange( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFutures( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarket( + marketKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeFuturesMarkets( + marketKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeIssuance( + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynth( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthExchange( + currencyKey: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynths( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSynthsExchange( + currencyKeys: BytesLike[], + overrides?: Overrides & { from?: string } + ): Promise; + + resumeSystem( + overrides?: Overrides & { from?: string } + ): Promise; + + suspendExchange( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFutures( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarket( + marketKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendFuturesMarkets( + marketKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendIssuance( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynth( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthExchange( + currencyKey: BytesLike, + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynths( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSynthsExchange( + currencyKeys: BytesLike[], + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + suspendSystem( + reason: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + synthExchangeSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthSuspended( + currencyKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + synthSuspension( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + systemSuspended(overrides?: CallOverrides): Promise; + + systemSuspension(overrides?: CallOverrides): Promise; + + updateAccessControl( + section: BytesLike, + account: string, + canSuspend: boolean, + canResume: boolean, + overrides?: Overrides & { from?: string } + ): Promise; + + updateAccessControls( + sections: BytesLike[], + accounts: string[], + canSuspends: boolean[], + canResumes: boolean[], + overrides?: Overrides & { from?: string } + ): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/VKwentaRedeemer.ts b/packages/sdk/src/contracts/types/VKwentaRedeemer.ts index 07f6460665..fcced87c09 100644 --- a/packages/sdk/src/contracts/types/VKwentaRedeemer.ts +++ b/packages/sdk/src/contracts/types/VKwentaRedeemer.ts @@ -2,116 +2,141 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface VKwentaRedeemerInterface extends utils.Interface { - functions: { - 'redeem()': FunctionFragment - 'token()': FunctionFragment - 'vToken()': FunctionFragment - } + functions: { + "redeem()": FunctionFragment; + "token()": FunctionFragment; + "vToken()": FunctionFragment; + }; - getFunction(nameOrSignatureOrTopic: 'redeem' | 'token' | 'vToken'): FunctionFragment + getFunction( + nameOrSignatureOrTopic: "redeem" | "token" | "vToken" + ): FunctionFragment; - encodeFunctionData(functionFragment: 'redeem', values?: undefined): string - encodeFunctionData(functionFragment: 'token', values?: undefined): string - encodeFunctionData(functionFragment: 'vToken', values?: undefined): string + encodeFunctionData(functionFragment: "redeem", values?: undefined): string; + encodeFunctionData(functionFragment: "token", values?: undefined): string; + encodeFunctionData(functionFragment: "vToken", values?: undefined): string; - decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'token', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'vToken', data: BytesLike): Result + decodeFunctionResult(functionFragment: "redeem", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "vToken", data: BytesLike): Result; - events: { - 'Redeemed(address,uint256)': EventFragment - } + events: { + "Redeemed(address,uint256)": EventFragment; + }; - getEvent(nameOrSignatureOrTopic: 'Redeemed'): EventFragment + getEvent(nameOrSignatureOrTopic: "Redeemed"): EventFragment; } export interface RedeemedEventObject { - redeemer: string - redeemedAmount: BigNumber + redeemer: string; + redeemedAmount: BigNumber; } -export type RedeemedEvent = TypedEvent<[string, BigNumber], RedeemedEventObject> +export type RedeemedEvent = TypedEvent< + [string, BigNumber], + RedeemedEventObject +>; -export type RedeemedEventFilter = TypedEventFilter +export type RedeemedEventFilter = TypedEventFilter; export interface VKwentaRedeemer extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - interface: VKwentaRedeemerInterface + interface: VKwentaRedeemerInterface; - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - functions: { - redeem(overrides?: Overrides & { from?: PromiseOrValue }): Promise + functions: { + redeem( + overrides?: Overrides & { from?: string } + ): Promise; - token(overrides?: CallOverrides): Promise<[string]> + token(overrides?: CallOverrides): Promise<[string]>; - vToken(overrides?: CallOverrides): Promise<[string]> - } + vToken(overrides?: CallOverrides): Promise<[string]>; + }; - redeem(overrides?: Overrides & { from?: PromiseOrValue }): Promise + redeem( + overrides?: Overrides & { from?: string } + ): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - vToken(overrides?: CallOverrides): Promise + vToken(overrides?: CallOverrides): Promise; - callStatic: { - redeem(overrides?: CallOverrides): Promise + callStatic: { + redeem(overrides?: CallOverrides): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - vToken(overrides?: CallOverrides): Promise - } + vToken(overrides?: CallOverrides): Promise; + }; - filters: { - 'Redeemed(address,uint256)'(redeemer?: null, redeemedAmount?: null): RedeemedEventFilter - Redeemed(redeemer?: null, redeemedAmount?: null): RedeemedEventFilter - } + filters: { + "Redeemed(address,uint256)"( + redeemer?: null, + redeemedAmount?: null + ): RedeemedEventFilter; + Redeemed(redeemer?: null, redeemedAmount?: null): RedeemedEventFilter; + }; - estimateGas: { - redeem(overrides?: Overrides & { from?: PromiseOrValue }): Promise + estimateGas: { + redeem(overrides?: Overrides & { from?: string }): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - vToken(overrides?: CallOverrides): Promise - } + vToken(overrides?: CallOverrides): Promise; + }; - populateTransaction: { - redeem(overrides?: Overrides & { from?: PromiseOrValue }): Promise + populateTransaction: { + redeem( + overrides?: Overrides & { from?: string } + ): Promise; - token(overrides?: CallOverrides): Promise + token(overrides?: CallOverrides): Promise; - vToken(overrides?: CallOverrides): Promise - } + vToken(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/VeKwentaRedeemer.ts b/packages/sdk/src/contracts/types/VeKwentaRedeemer.ts index 043651ede9..a939b999ca 100644 --- a/packages/sdk/src/contracts/types/VeKwentaRedeemer.ts +++ b/packages/sdk/src/contracts/types/VeKwentaRedeemer.ts @@ -2,152 +2,172 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumber, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers' -import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' -import type { Listener, Provider } from '@ethersproject/providers' -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common' + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; export interface VeKwentaRedeemerInterface extends utils.Interface { - functions: { - 'kwenta()': FunctionFragment - 'redeem(address)': FunctionFragment - 'rewardEscrow()': FunctionFragment - 'veKwenta()': FunctionFragment - } - - getFunction( - nameOrSignatureOrTopic: 'kwenta' | 'redeem' | 'rewardEscrow' | 'veKwenta' - ): FunctionFragment - - encodeFunctionData(functionFragment: 'kwenta', values?: undefined): string - encodeFunctionData(functionFragment: 'redeem', values: [PromiseOrValue]): string - encodeFunctionData(functionFragment: 'rewardEscrow', values?: undefined): string - encodeFunctionData(functionFragment: 'veKwenta', values?: undefined): string - - decodeFunctionResult(functionFragment: 'kwenta', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'rewardEscrow', data: BytesLike): Result - decodeFunctionResult(functionFragment: 'veKwenta', data: BytesLike): Result - - events: { - 'Redeemed(address,address,uint256)': EventFragment - } - - getEvent(nameOrSignatureOrTopic: 'Redeemed'): EventFragment + functions: { + "kwenta()": FunctionFragment; + "redeem(address)": FunctionFragment; + "rewardEscrow()": FunctionFragment; + "veKwenta()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: "kwenta" | "redeem" | "rewardEscrow" | "veKwenta" + ): FunctionFragment; + + encodeFunctionData(functionFragment: "kwenta", values?: undefined): string; + encodeFunctionData(functionFragment: "redeem", values: [string]): string; + encodeFunctionData( + functionFragment: "rewardEscrow", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "veKwenta", values?: undefined): string; + + decodeFunctionResult(functionFragment: "kwenta", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "redeem", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "rewardEscrow", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "veKwenta", data: BytesLike): Result; + + events: { + "Redeemed(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Redeemed"): EventFragment; } export interface RedeemedEventObject { - redeemer: string - beneficiary: string - redeemedAmount: BigNumber + redeemer: string; + beneficiary: string; + redeemedAmount: BigNumber; } -export type RedeemedEvent = TypedEvent<[string, string, BigNumber], RedeemedEventObject> +export type RedeemedEvent = TypedEvent< + [string, string, BigNumber], + RedeemedEventObject +>; -export type RedeemedEventFilter = TypedEventFilter +export type RedeemedEventFilter = TypedEventFilter; export interface VeKwentaRedeemer extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this - attach(addressOrName: string): this - deployed(): Promise + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; - interface: VeKwentaRedeemerInterface + interface: VeKwentaRedeemerInterface; - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise> + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; - listeners( - eventFilter?: TypedEventFilter - ): Array> - listeners(eventName?: string): Array - removeAllListeners(eventFilter: TypedEventFilter): this - removeAllListeners(eventName?: string): this - off: OnEvent - on: OnEvent - once: OnEvent - removeListener: OnEvent + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; - functions: { - kwenta(overrides?: CallOverrides): Promise<[string]> + functions: { + kwenta(overrides?: CallOverrides): Promise<[string]>; - redeem( - _beneficiary: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + redeem( + _beneficiary: string, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise<[string]> + rewardEscrow(overrides?: CallOverrides): Promise<[string]>; - veKwenta(overrides?: CallOverrides): Promise<[string]> - } + veKwenta(overrides?: CallOverrides): Promise<[string]>; + }; - kwenta(overrides?: CallOverrides): Promise + kwenta(overrides?: CallOverrides): Promise; - redeem( - _beneficiary: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + redeem( + _beneficiary: string, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - veKwenta(overrides?: CallOverrides): Promise + veKwenta(overrides?: CallOverrides): Promise; - callStatic: { - kwenta(overrides?: CallOverrides): Promise + callStatic: { + kwenta(overrides?: CallOverrides): Promise; - redeem(_beneficiary: PromiseOrValue, overrides?: CallOverrides): Promise + redeem(_beneficiary: string, overrides?: CallOverrides): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - veKwenta(overrides?: CallOverrides): Promise - } + veKwenta(overrides?: CallOverrides): Promise; + }; - filters: { - 'Redeemed(address,address,uint256)'( - redeemer?: PromiseOrValue | null, - beneficiary?: PromiseOrValue | null, - redeemedAmount?: null - ): RedeemedEventFilter - Redeemed( - redeemer?: PromiseOrValue | null, - beneficiary?: PromiseOrValue | null, - redeemedAmount?: null - ): RedeemedEventFilter - } + filters: { + "Redeemed(address,address,uint256)"( + redeemer?: string | null, + beneficiary?: string | null, + redeemedAmount?: null + ): RedeemedEventFilter; + Redeemed( + redeemer?: string | null, + beneficiary?: string | null, + redeemedAmount?: null + ): RedeemedEventFilter; + }; - estimateGas: { - kwenta(overrides?: CallOverrides): Promise + estimateGas: { + kwenta(overrides?: CallOverrides): Promise; - redeem( - _beneficiary: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + redeem( + _beneficiary: string, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - veKwenta(overrides?: CallOverrides): Promise - } + veKwenta(overrides?: CallOverrides): Promise; + }; - populateTransaction: { - kwenta(overrides?: CallOverrides): Promise + populateTransaction: { + kwenta(overrides?: CallOverrides): Promise; - redeem( - _beneficiary: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise + redeem( + _beneficiary: string, + overrides?: Overrides & { from?: string } + ): Promise; - rewardEscrow(overrides?: CallOverrides): Promise + rewardEscrow(overrides?: CallOverrides): Promise; - veKwenta(overrides?: CallOverrides): Promise - } + veKwenta(overrides?: CallOverrides): Promise; + }; } diff --git a/packages/sdk/src/contracts/types/common.ts b/packages/sdk/src/contracts/types/common.ts index 573298608c..2fc40c7fb1 100644 --- a/packages/sdk/src/contracts/types/common.ts +++ b/packages/sdk/src/contracts/types/common.ts @@ -1,37 +1,44 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -import type { Listener } from '@ethersproject/providers' -import type { Event, EventFilter } from 'ethers' - -export interface TypedEvent = any, TArgsObject = any> extends Event { - args: TArgsArray & TArgsObject +import type { Listener } from "@ethersproject/providers"; +import type { Event, EventFilter } from "ethers"; + +export interface TypedEvent< + TArgsArray extends Array = any, + TArgsObject = any +> extends Event { + args: TArgsArray & TArgsObject; } -export interface TypedEventFilter<_TEvent extends TypedEvent> extends EventFilter {} +export interface TypedEventFilter<_TEvent extends TypedEvent> + extends EventFilter {} export interface TypedListener { - (...listenerArg: [...__TypechainArgsArray, TEvent]): void + (...listenerArg: [...__TypechainArgsArray, TEvent]): void; } -type __TypechainArgsArray = T extends TypedEvent ? U : never +type __TypechainArgsArray = T extends TypedEvent ? U : never; export interface OnEvent { - ( - eventFilter: TypedEventFilter, - listener: TypedListener - ): TRes - (eventName: string, listener: Listener): TRes + ( + eventFilter: TypedEventFilter, + listener: TypedListener + ): TRes; + (eventName: string, listener: Listener): TRes; } export type MinEthersFactory = { - deploy(...a: ARGS[]): Promise -} + deploy(...a: ARGS[]): Promise; +}; -export type GetContractTypeFromFactory = F extends MinEthersFactory ? C : never +export type GetContractTypeFromFactory = F extends MinEthersFactory< + infer C, + any +> + ? C + : never; export type GetARGsTypeFromFactory = F extends MinEthersFactory - ? Parameters - : never - -export type PromiseOrValue = T | Promise + ? Parameters + : never; diff --git a/packages/sdk/src/contracts/types/factories/BatchClaimer__factory.ts b/packages/sdk/src/contracts/types/factories/BatchClaimer__factory.ts index a92d748683..58f33be508 100644 --- a/packages/sdk/src/contracts/types/factories/BatchClaimer__factory.ts +++ b/packages/sdk/src/contracts/types/factories/BatchClaimer__factory.ts @@ -2,64 +2,67 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { BatchClaimer, BatchClaimerInterface } from '../BatchClaimer' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { BatchClaimer, BatchClaimerInterface } from "../BatchClaimer"; const _abi = [ - { - inputs: [ - { - internalType: 'contract IMultipleMerkleDistributor[]', - name: '_distributors', - type: 'address[]', - }, - { - components: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32[]', - name: 'merkleProof', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - internalType: 'struct IMultipleMerkleDistributor.Claims[][]', - name: '_claims', - type: 'tuple[][]', - }, - ], - name: 'claimMultiple', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "contract IMultipleMerkleDistributor[]", + name: "_distributors", + type: "address[]", + }, + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "merkleProof", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + internalType: "struct IMultipleMerkleDistributor.Claims[][]", + name: "_claims", + type: "tuple[][]", + }, + ], + name: "claimMultiple", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class BatchClaimer__factory { - static readonly abi = _abi - static createInterface(): BatchClaimerInterface { - return new utils.Interface(_abi) as BatchClaimerInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): BatchClaimer { - return new Contract(address, _abi, signerOrProvider) as BatchClaimer - } + static readonly abi = _abi; + static createInterface(): BatchClaimerInterface { + return new utils.Interface(_abi) as BatchClaimerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): BatchClaimer { + return new Contract(address, _abi, signerOrProvider) as BatchClaimer; + } } diff --git a/packages/sdk/src/contracts/types/factories/DappMaintenance__factory.ts b/packages/sdk/src/contracts/types/factories/DappMaintenance__factory.ts index 6c570264d5..490b696189 100644 --- a/packages/sdk/src/contracts/types/factories/DappMaintenance__factory.ts +++ b/packages/sdk/src/contracts/types/factories/DappMaintenance__factory.ts @@ -2,218 +2,224 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { DappMaintenance, DappMaintenanceInterface } from '../DappMaintenance' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + DappMaintenance, + DappMaintenanceInterface, +} from "../DappMaintenance"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'SXMaintenance', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'StakingMaintenance', - type: 'event', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isPausedSX', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isPausedStaking', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'setMaintenanceModeAll', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'setMaintenanceModeSX', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'setMaintenanceModeStaking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "SXMaintenance", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "StakingMaintenance", + type: "event", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isPausedSX", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isPausedStaking", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "setMaintenanceModeAll", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "setMaintenanceModeSX", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "setMaintenanceModeStaking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class DappMaintenance__factory { - static readonly abi = _abi - static createInterface(): DappMaintenanceInterface { - return new utils.Interface(_abi) as DappMaintenanceInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): DappMaintenance { - return new Contract(address, _abi, signerOrProvider) as DappMaintenance - } + static readonly abi = _abi; + static createInterface(): DappMaintenanceInterface { + return new utils.Interface(_abi) as DappMaintenanceInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): DappMaintenance { + return new Contract(address, _abi, signerOrProvider) as DappMaintenance; + } } diff --git a/packages/sdk/src/contracts/types/factories/ERC20__factory.ts b/packages/sdk/src/contracts/types/factories/ERC20__factory.ts index f2486f8216..04ea74421d 100644 --- a/packages/sdk/src/contracts/types/factories/ERC20__factory.ts +++ b/packages/sdk/src/contracts/types/factories/ERC20__factory.ts @@ -2,353 +2,353 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { ERC20, ERC20Interface } from '../ERC20' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { ERC20, ERC20Interface } from "../ERC20"; const _abi = [ - { - constant: true, - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'mint', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'addedValue', - type: 'uint256', - }, - ], - name: 'increaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'string', - name: 'name', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol', - type: 'string', - }, - { - internalType: 'uint8', - name: 'decimals', - type: 'uint8', - }, - { - internalType: 'uint256', - name: 'initialSupply', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, -] + { + constant: true, + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "mint", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "subtractedValue", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "symbol", + type: "string", + }, + { + internalType: "uint8", + name: "decimals", + type: "uint8", + }, + { + internalType: "uint256", + name: "initialSupply", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, +] as const; export class ERC20__factory { - static readonly abi = _abi - static createInterface(): ERC20Interface { - return new utils.Interface(_abi) as ERC20Interface - } - static connect(address: string, signerOrProvider: Signer | Provider): ERC20 { - return new Contract(address, _abi, signerOrProvider) as ERC20 - } + static readonly abi = _abi; + static createInterface(): ERC20Interface { + return new utils.Interface(_abi) as ERC20Interface; + } + static connect(address: string, signerOrProvider: Signer | Provider): ERC20 { + return new Contract(address, _abi, signerOrProvider) as ERC20; + } } diff --git a/packages/sdk/src/contracts/types/factories/ExchangeRates__factory.ts b/packages/sdk/src/contracts/types/factories/ExchangeRates__factory.ts index ba4bdbac4c..9ec13deee9 100644 --- a/packages/sdk/src/contracts/types/factories/ExchangeRates__factory.ts +++ b/packages/sdk/src/contracts/types/factories/ExchangeRates__factory.ts @@ -2,1102 +2,1106 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { ExchangeRates, ExchangeRatesInterface } from '../ExchangeRates' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { ExchangeRates, ExchangeRatesInterface } from "../ExchangeRates"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'aggregator', - type: 'address', - }, - ], - name: 'AggregatorAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'aggregator', - type: 'address', - }, - ], - name: 'AggregatorRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'aggregatorAddress', - type: 'address', - }, - ], - name: 'addAggregator', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'aggregatorKeys', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'aggregatorWarningFlags', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'aggregators', - outputs: [ - { - internalType: 'contract AggregatorV2V3Interface', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - ], - name: 'anyRateIsInvalid', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - { - internalType: 'uint256[]', - name: 'roundIds', - type: 'uint256[]', - }, - ], - name: 'anyRateIsInvalidAtRound', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'aggregator', - type: 'address', - }, - ], - name: 'currenciesUsingAggregator', - outputs: [ - { - internalType: 'bytes32[]', - name: 'currencies', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'currencyKeyDecimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'effectiveAtomicValueAndRates', - outputs: [ - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'systemValue', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'systemSourceRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'systemDestinationRate', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'effectiveValue', - outputs: [ - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'effectiveValueAndRates', - outputs: [ - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'sourceRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'destinationRate', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'roundIdForSrc', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'roundIdForDest', - type: 'uint256', - }, - ], - name: 'effectiveValueAndRatesAtRound', - outputs: [ - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'sourceRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'destinationRate', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'getCurrentRoundId', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'startingRoundId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startingTimestamp', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'timediff', - type: 'uint256', - }, - ], - name: 'getLastRoundIdBeforeElapsedSecs', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'lastRateUpdateTimes', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - ], - name: 'lastRateUpdateTimesForCurrencies', - outputs: [ - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'rateAndInvalid', - outputs: [ - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isInvalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'roundId', - type: 'uint256', - }, - ], - name: 'rateAndTimestampAtRound', - outputs: [ - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'time', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'rateAndUpdatedTime', - outputs: [ - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'time', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'rateForCurrency', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'rateIsFlagged', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'rateIsInvalid', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'rateIsStale', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rateStalePeriod', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'rateWithSafetyChecks', - outputs: [ - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'broken', - type: 'bool', - }, - { - internalType: 'bool', - name: 'staleOrInvalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - ], - name: 'ratesAndInvalidForCurrencies', - outputs: [ - { - internalType: 'uint256[]', - name: 'rates', - type: 'uint256[]', - }, - { - internalType: 'bool', - name: 'anyRateInvalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'numRounds', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'roundId', - type: 'uint256', - }, - ], - name: 'ratesAndUpdatedTimeForCurrencyLastNRounds', - outputs: [ - { - internalType: 'uint256[]', - name: 'rates', - type: 'uint256[]', - }, - { - internalType: 'uint256[]', - name: 'times', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - ], - name: 'ratesForCurrencies', - outputs: [ - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'removeAggregator', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'synthTooVolatileForAtomicExchange', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'dexPriceAggregator', - type: 'address', - }, - { - internalType: 'address', - name: 'atomicEquivalentForDexPricing', - type: 'address', - }, - { - internalType: 'uint256', - name: 'atomicExchangeFeeRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'atomicTwapWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'atomicMaxVolumePerBlock', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'atomicVolatilityConsiderationWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'atomicVolatilityUpdateThreshold', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'exchangeFeeRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'exchangeMaxDynamicFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'exchangeDynamicFeeRounds', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'exchangeDynamicFeeThreshold', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'exchangeDynamicFeeWeightDecay', - type: 'uint256', - }, - ], - internalType: 'struct IDirectIntegrationManager.ParameterIntegrationSettings', - name: '', - type: 'tuple', - }, - ], - name: 'synthTooVolatileForAtomicExchange', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "aggregator", + type: "address", + }, + ], + name: "AggregatorAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "aggregator", + type: "address", + }, + ], + name: "AggregatorRemoved", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "aggregatorAddress", + type: "address", + }, + ], + name: "addAggregator", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "aggregatorKeys", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "aggregatorWarningFlags", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "aggregators", + outputs: [ + { + internalType: "contract AggregatorV2V3Interface", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + ], + name: "anyRateIsInvalid", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + { + internalType: "uint256[]", + name: "roundIds", + type: "uint256[]", + }, + ], + name: "anyRateIsInvalidAtRound", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "aggregator", + type: "address", + }, + ], + name: "currenciesUsingAggregator", + outputs: [ + { + internalType: "bytes32[]", + name: "currencies", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "currencyKeyDecimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "effectiveAtomicValueAndRates", + outputs: [ + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "systemValue", + type: "uint256", + }, + { + internalType: "uint256", + name: "systemSourceRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "systemDestinationRate", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "effectiveValue", + outputs: [ + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "effectiveValueAndRates", + outputs: [ + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "sourceRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "destinationRate", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "roundIdForSrc", + type: "uint256", + }, + { + internalType: "uint256", + name: "roundIdForDest", + type: "uint256", + }, + ], + name: "effectiveValueAndRatesAtRound", + outputs: [ + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "sourceRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "destinationRate", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "getCurrentRoundId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "startingRoundId", + type: "uint256", + }, + { + internalType: "uint256", + name: "startingTimestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "timediff", + type: "uint256", + }, + ], + name: "getLastRoundIdBeforeElapsedSecs", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "lastRateUpdateTimes", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + ], + name: "lastRateUpdateTimesForCurrencies", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "rateAndInvalid", + outputs: [ + { + internalType: "uint256", + name: "rate", + type: "uint256", + }, + { + internalType: "bool", + name: "isInvalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "roundId", + type: "uint256", + }, + ], + name: "rateAndTimestampAtRound", + outputs: [ + { + internalType: "uint256", + name: "rate", + type: "uint256", + }, + { + internalType: "uint256", + name: "time", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "rateAndUpdatedTime", + outputs: [ + { + internalType: "uint256", + name: "rate", + type: "uint256", + }, + { + internalType: "uint256", + name: "time", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "rateForCurrency", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "rateIsFlagged", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "rateIsInvalid", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "rateIsStale", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rateStalePeriod", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "rateWithSafetyChecks", + outputs: [ + { + internalType: "uint256", + name: "rate", + type: "uint256", + }, + { + internalType: "bool", + name: "broken", + type: "bool", + }, + { + internalType: "bool", + name: "staleOrInvalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + ], + name: "ratesAndInvalidForCurrencies", + outputs: [ + { + internalType: "uint256[]", + name: "rates", + type: "uint256[]", + }, + { + internalType: "bool", + name: "anyRateInvalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "numRounds", + type: "uint256", + }, + { + internalType: "uint256", + name: "roundId", + type: "uint256", + }, + ], + name: "ratesAndUpdatedTimeForCurrencyLastNRounds", + outputs: [ + { + internalType: "uint256[]", + name: "rates", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "times", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + ], + name: "ratesForCurrencies", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "removeAggregator", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "synthTooVolatileForAtomicExchange", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + components: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "dexPriceAggregator", + type: "address", + }, + { + internalType: "address", + name: "atomicEquivalentForDexPricing", + type: "address", + }, + { + internalType: "uint256", + name: "atomicExchangeFeeRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "atomicTwapWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "atomicMaxVolumePerBlock", + type: "uint256", + }, + { + internalType: "uint256", + name: "atomicVolatilityConsiderationWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "atomicVolatilityUpdateThreshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "exchangeFeeRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "exchangeMaxDynamicFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "exchangeDynamicFeeRounds", + type: "uint256", + }, + { + internalType: "uint256", + name: "exchangeDynamicFeeThreshold", + type: "uint256", + }, + { + internalType: "uint256", + name: "exchangeDynamicFeeWeightDecay", + type: "uint256", + }, + ], + internalType: + "struct IDirectIntegrationManager.ParameterIntegrationSettings", + name: "", + type: "tuple", + }, + ], + name: "synthTooVolatileForAtomicExchange", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class ExchangeRates__factory { - static readonly abi = _abi - static createInterface(): ExchangeRatesInterface { - return new utils.Interface(_abi) as ExchangeRatesInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): ExchangeRates { - return new Contract(address, _abi, signerOrProvider) as ExchangeRates - } + static readonly abi = _abi; + static createInterface(): ExchangeRatesInterface { + return new utils.Interface(_abi) as ExchangeRatesInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ExchangeRates { + return new Contract(address, _abi, signerOrProvider) as ExchangeRates; + } } diff --git a/packages/sdk/src/contracts/types/factories/Exchanger__factory.ts b/packages/sdk/src/contracts/types/factories/Exchanger__factory.ts index b92cc56f4a..17edb53e7b 100644 --- a/packages/sdk/src/contracts/types/factories/Exchanger__factory.ts +++ b/packages/sdk/src/contracts/types/factories/Exchanger__factory.ts @@ -2,788 +2,791 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { Exchanger, ExchangerInterface } from '../Exchanger' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { Exchanger, ExchangerInterface } from "../Exchanger"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'src', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'dest', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'exchangeFeeRate', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'roundIdForSrc', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'roundIdForDest', - type: 'uint256', - }, - ], - name: 'ExchangeEntryAppended', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'src', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'dest', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reclaim', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'rebate', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'srcRoundIdAtPeriodEnd', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'destRoundIdAtPeriodEnd', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'exchangeTimestamp', - type: 'uint256', - }, - ], - name: 'ExchangeEntrySettled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'refunded', - type: 'uint256', - }, - ], - name: 'calculateAmountAfterSettlement', - outputs: [ - { - internalType: 'uint256', - name: 'amountAfterSettlement', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'dynamicFeeRateForExchange', - outputs: [ - { - internalType: 'uint256', - name: 'feeRate', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'tooVolatile', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'exchangeForAddress', - type: 'address', - }, - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'destinationAddress', - type: 'address', - }, - { - internalType: 'bool', - name: 'virtualSynth', - type: 'bool', - }, - { - internalType: 'address', - name: 'rewardAddress', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'exchange', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - { - internalType: 'contract IVirtualSynth', - name: 'vSynth', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'exchangeAtomically', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'feeRateForExchange', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'getAmountsForExchange', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'exchangeFeeRate', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'hasWaitingPeriodOrSettlementOwing', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'isSynthRateInvalid', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'lastExchangeRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'maxSecsLeftInWaitingPeriod', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'priceDeviationThresholdFactor', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'settle', - outputs: [ - { - internalType: 'uint256', - name: 'reclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'refunded', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'numEntriesSettled', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'settlementOwing', - outputs: [ - { - internalType: 'uint256', - name: 'reclaimAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rebateAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'numEntries', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'tradingRewardsEnabled', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'waitingPeriodSecs', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "src", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "dest", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "exchangeFeeRate", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "roundIdForSrc", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "roundIdForDest", + type: "uint256", + }, + ], + name: "ExchangeEntryAppended", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "src", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "dest", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "reclaim", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "rebate", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "srcRoundIdAtPeriodEnd", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "destRoundIdAtPeriodEnd", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "exchangeTimestamp", + type: "uint256", + }, + ], + name: "ExchangeEntrySettled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "refunded", + type: "uint256", + }, + ], + name: "calculateAmountAfterSettlement", + outputs: [ + { + internalType: "uint256", + name: "amountAfterSettlement", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "dynamicFeeRateForExchange", + outputs: [ + { + internalType: "uint256", + name: "feeRate", + type: "uint256", + }, + { + internalType: "bool", + name: "tooVolatile", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "exchangeForAddress", + type: "address", + }, + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "destinationAddress", + type: "address", + }, + { + internalType: "bool", + name: "virtualSynth", + type: "bool", + }, + { + internalType: "address", + name: "rewardAddress", + type: "address", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "exchange", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + { + internalType: "contract IVirtualSynth", + name: "vSynth", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "exchangeAtomically", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "feeRateForExchange", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "getAmountsForExchange", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "uint256", + name: "exchangeFeeRate", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "hasWaitingPeriodOrSettlementOwing", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "isSynthRateInvalid", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "lastExchangeRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "maxSecsLeftInWaitingPeriod", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "priceDeviationThresholdFactor", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "settle", + outputs: [ + { + internalType: "uint256", + name: "reclaimed", + type: "uint256", + }, + { + internalType: "uint256", + name: "refunded", + type: "uint256", + }, + { + internalType: "uint256", + name: "numEntriesSettled", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "settlementOwing", + outputs: [ + { + internalType: "uint256", + name: "reclaimAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "rebateAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "numEntries", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "tradingRewardsEnabled", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "waitingPeriodSecs", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class Exchanger__factory { - static readonly abi = _abi - static createInterface(): ExchangerInterface { - return new utils.Interface(_abi) as ExchangerInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): Exchanger { - return new Contract(address, _abi, signerOrProvider) as Exchanger - } + static readonly abi = _abi; + static createInterface(): ExchangerInterface { + return new utils.Interface(_abi) as ExchangerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): Exchanger { + return new Contract(address, _abi, signerOrProvider) as Exchanger; + } } diff --git a/packages/sdk/src/contracts/types/factories/FuturesMarketData__factory.ts b/packages/sdk/src/contracts/types/factories/FuturesMarketData__factory.ts index feef3f05b1..beb3ecd82c 100644 --- a/packages/sdk/src/contracts/types/factories/FuturesMarketData__factory.ts +++ b/packages/sdk/src/contracts/types/factories/FuturesMarketData__factory.ts @@ -2,930 +2,936 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { FuturesMarketData, FuturesMarketDataInterface } from '../FuturesMarketData' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + FuturesMarketData, + FuturesMarketDataInterface, +} from "../FuturesMarketData"; const _abi = [ - { - inputs: [ - { - internalType: 'contract IAddressResolver', - name: '_resolverProxy', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - constant: true, - inputs: [], - name: 'allMarketSummaries', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'asset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'currentFundingRate', - type: 'int256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeNextPrice', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - ], - internalType: 'struct FuturesMarketData.MarketSummary[]', - name: '', - type: 'tuple[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'globals', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'minInitialMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationFeeRatio', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationBufferRatio', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minKeeperFee', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FuturesGlobals', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'contract IFuturesMarket', - name: 'market', - type: 'address', - }, - ], - name: 'marketDetails', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'baseAsset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeNextPrice', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValueUSD', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.MarketLimits', - name: 'limits', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxFundingRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScaleUSD', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FundingParameters', - name: 'fundingParameters', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'long', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'short', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.Sides', - name: 'sides', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - ], - internalType: 'struct FuturesMarketData.MarketSizeDetails', - name: 'marketSizeDetails', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - internalType: 'struct FuturesMarketData.PriceDetails', - name: 'priceDetails', - type: 'tuple', - }, - ], - internalType: 'struct FuturesMarketData.MarketData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - ], - name: 'marketDetailsForKey', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'baseAsset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeNextPrice', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValueUSD', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.MarketLimits', - name: 'limits', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxFundingRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScaleUSD', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FundingParameters', - name: 'fundingParameters', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'long', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'short', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.Sides', - name: 'sides', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - ], - internalType: 'struct FuturesMarketData.MarketSizeDetails', - name: 'marketSizeDetails', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - internalType: 'struct FuturesMarketData.PriceDetails', - name: 'priceDetails', - type: 'tuple', - }, - ], - internalType: 'struct FuturesMarketData.MarketData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address[]', - name: 'markets', - type: 'address[]', - }, - ], - name: 'marketSummaries', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'asset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'currentFundingRate', - type: 'int256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeNextPrice', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - ], - internalType: 'struct FuturesMarketData.MarketSummary[]', - name: '', - type: 'tuple[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'marketKeys', - type: 'bytes32[]', - }, - ], - name: 'marketSummariesForKeys', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'asset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'currentFundingRate', - type: 'int256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeNextPrice', - type: 'uint256', - }, - ], - internalType: 'struct FuturesMarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - ], - internalType: 'struct FuturesMarketData.MarketSummary[]', - name: '', - type: 'tuple[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - ], - name: 'parameters', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'nextPriceConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValueUSD', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxFundingRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScaleUSD', - type: 'uint256', - }, - ], - internalType: 'struct IFuturesMarketSettings.Parameters', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'contract IFuturesMarket', - name: 'market', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'positionDetails', - outputs: [ - { - components: [ - { - components: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - internalType: 'struct IFuturesMarketBaseTypes.Position', - name: 'position', - type: 'tuple', - }, - { - internalType: 'int256', - name: 'notionalValue', - type: 'int256', - }, - { - internalType: 'int256', - name: 'profitLoss', - type: 'int256', - }, - { - internalType: 'int256', - name: 'accruedFunding', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'remainingMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'accessibleMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationPrice', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'canLiquidatePosition', - type: 'bool', - }, - ], - internalType: 'struct FuturesMarketData.PositionData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'positionDetailsForMarketKey', - outputs: [ - { - components: [ - { - components: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - internalType: 'struct IFuturesMarketBaseTypes.Position', - name: 'position', - type: 'tuple', - }, - { - internalType: 'int256', - name: 'notionalValue', - type: 'int256', - }, - { - internalType: 'int256', - name: 'profitLoss', - type: 'int256', - }, - { - internalType: 'int256', - name: 'accruedFunding', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'remainingMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'accessibleMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationPrice', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'canLiquidatePosition', - type: 'bool', - }, - ], - internalType: 'struct FuturesMarketData.PositionData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverProxy', - outputs: [ - { - internalType: 'contract IAddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "contract IAddressResolver", + name: "_resolverProxy", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + constant: true, + inputs: [], + name: "allMarketSummaries", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "asset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeNextPrice", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + ], + internalType: "struct FuturesMarketData.MarketSummary[]", + name: "", + type: "tuple[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "globals", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "minInitialMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationFeeRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationBufferRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "minKeeperFee", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FuturesGlobals", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "contract IFuturesMarket", + name: "market", + type: "address", + }, + ], + name: "marketDetails", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "baseAsset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeNextPrice", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValueUSD", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.MarketLimits", + name: "limits", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScaleUSD", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FundingParameters", + name: "fundingParameters", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "long", + type: "uint256", + }, + { + internalType: "uint256", + name: "short", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.Sides", + name: "sides", + type: "tuple", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + ], + internalType: "struct FuturesMarketData.MarketSizeDetails", + name: "marketSizeDetails", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + internalType: "struct FuturesMarketData.PriceDetails", + name: "priceDetails", + type: "tuple", + }, + ], + internalType: "struct FuturesMarketData.MarketData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + ], + name: "marketDetailsForKey", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "baseAsset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeNextPrice", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValueUSD", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.MarketLimits", + name: "limits", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScaleUSD", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FundingParameters", + name: "fundingParameters", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "long", + type: "uint256", + }, + { + internalType: "uint256", + name: "short", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.Sides", + name: "sides", + type: "tuple", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + ], + internalType: "struct FuturesMarketData.MarketSizeDetails", + name: "marketSizeDetails", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + internalType: "struct FuturesMarketData.PriceDetails", + name: "priceDetails", + type: "tuple", + }, + ], + internalType: "struct FuturesMarketData.MarketData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address[]", + name: "markets", + type: "address[]", + }, + ], + name: "marketSummaries", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "asset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeNextPrice", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + ], + internalType: "struct FuturesMarketData.MarketSummary[]", + name: "", + type: "tuple[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "marketKeys", + type: "bytes32[]", + }, + ], + name: "marketSummariesForKeys", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "asset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeNextPrice", + type: "uint256", + }, + ], + internalType: "struct FuturesMarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + ], + internalType: "struct FuturesMarketData.MarketSummary[]", + name: "", + type: "tuple[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + ], + name: "parameters", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "nextPriceConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValueUSD", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScaleUSD", + type: "uint256", + }, + ], + internalType: "struct IFuturesMarketSettings.Parameters", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "contract IFuturesMarket", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "positionDetails", + outputs: [ + { + components: [ + { + components: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + internalType: "struct IFuturesMarketBaseTypes.Position", + name: "position", + type: "tuple", + }, + { + internalType: "int256", + name: "notionalValue", + type: "int256", + }, + { + internalType: "int256", + name: "profitLoss", + type: "int256", + }, + { + internalType: "int256", + name: "accruedFunding", + type: "int256", + }, + { + internalType: "uint256", + name: "remainingMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "accessibleMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationPrice", + type: "uint256", + }, + { + internalType: "bool", + name: "canLiquidatePosition", + type: "bool", + }, + ], + internalType: "struct FuturesMarketData.PositionData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "positionDetailsForMarketKey", + outputs: [ + { + components: [ + { + components: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + internalType: "struct IFuturesMarketBaseTypes.Position", + name: "position", + type: "tuple", + }, + { + internalType: "int256", + name: "notionalValue", + type: "int256", + }, + { + internalType: "int256", + name: "profitLoss", + type: "int256", + }, + { + internalType: "int256", + name: "accruedFunding", + type: "int256", + }, + { + internalType: "uint256", + name: "remainingMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "accessibleMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationPrice", + type: "uint256", + }, + { + internalType: "bool", + name: "canLiquidatePosition", + type: "bool", + }, + ], + internalType: "struct FuturesMarketData.PositionData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverProxy", + outputs: [ + { + internalType: "contract IAddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class FuturesMarketData__factory { - static readonly abi = _abi - static createInterface(): FuturesMarketDataInterface { - return new utils.Interface(_abi) as FuturesMarketDataInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): FuturesMarketData { - return new Contract(address, _abi, signerOrProvider) as FuturesMarketData - } + static readonly abi = _abi; + static createInterface(): FuturesMarketDataInterface { + return new utils.Interface(_abi) as FuturesMarketDataInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): FuturesMarketData { + return new Contract(address, _abi, signerOrProvider) as FuturesMarketData; + } } diff --git a/packages/sdk/src/contracts/types/factories/FuturesMarketSettings__factory.ts b/packages/sdk/src/contracts/types/factories/FuturesMarketSettings__factory.ts index 7b7eda45cd..54e5e0677e 100644 --- a/packages/sdk/src/contracts/types/factories/FuturesMarketSettings__factory.ts +++ b/packages/sdk/src/contracts/types/factories/FuturesMarketSettings__factory.ts @@ -2,885 +2,892 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; import type { - FuturesMarketSettings, - FuturesMarketSettingsInterface, -} from '../FuturesMarketSettings' + FuturesMarketSettings, + FuturesMarketSettingsInterface, +} from "../FuturesMarketSettings"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'bps', - type: 'uint256', - }, - ], - name: 'LiquidationBufferRatioUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'bps', - type: 'uint256', - }, - ], - name: 'LiquidationFeeRatioUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'minMargin', - type: 'uint256', - }, - ], - name: 'MinInitialMarginUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'sUSD', - type: 'uint256', - }, - ], - name: 'MinKeeperFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'parameter', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'ParameterUpdated', - type: 'event', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidationBufferRatio', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidationFeeRatio', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'makerFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'makerFeeNextPrice', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxFundingRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxLeverage', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxMarketValueUSD', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'minInitialMargin', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'minKeeperFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'nextPriceConfirmWindow', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'parameters', - outputs: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'nextPriceConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValueUSD', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxFundingRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScaleUSD', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_ratio', - type: 'uint256', - }, - ], - name: 'setLiquidationBufferRatio', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_ratio', - type: 'uint256', - }, - ], - name: 'setLiquidationFeeRatio', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_makerFee', - type: 'uint256', - }, - ], - name: 'setMakerFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_makerFeeNextPrice', - type: 'uint256', - }, - ], - name: 'setMakerFeeNextPrice', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxFundingRate', - type: 'uint256', - }, - ], - name: 'setMaxFundingRate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxLeverage', - type: 'uint256', - }, - ], - name: 'setMaxLeverage', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxMarketValueUSD', - type: 'uint256', - }, - ], - name: 'setMaxMarketValueUSD', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_minMargin', - type: 'uint256', - }, - ], - name: 'setMinInitialMargin', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_sUSD', - type: 'uint256', - }, - ], - name: 'setMinKeeperFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_nextPriceConfirmWindow', - type: 'uint256', - }, - ], - name: 'setNextPriceConfirmWindow', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_takerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_makerFeeNextPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_nextPriceConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_maxMarketValueUSD', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_maxFundingRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_skewScaleUSD', - type: 'uint256', - }, - ], - name: 'setParameters', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_skewScaleUSD', - type: 'uint256', - }, - ], - name: 'setSkewScaleUSD', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_takerFee', - type: 'uint256', - }, - ], - name: 'setTakerFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_takerFeeNextPrice', - type: 'uint256', - }, - ], - name: 'setTakerFeeNextPrice', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'skewScaleUSD', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'takerFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'takerFeeNextPrice', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - 'payab`le': false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bps", + type: "uint256", + }, + ], + name: "LiquidationBufferRatioUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bps", + type: "uint256", + }, + ], + name: "LiquidationFeeRatioUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "minMargin", + type: "uint256", + }, + ], + name: "MinInitialMarginUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "sUSD", + type: "uint256", + }, + ], + name: "MinKeeperFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "parameter", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "ParameterUpdated", + type: "event", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidationBufferRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidationFeeRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "makerFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "makerFeeNextPrice", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxFundingRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxLeverage", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxMarketValueUSD", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "minInitialMargin", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "minKeeperFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "nextPriceConfirmWindow", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "parameters", + outputs: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "nextPriceConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValueUSD", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScaleUSD", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_ratio", + type: "uint256", + }, + ], + name: "setLiquidationBufferRatio", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_ratio", + type: "uint256", + }, + ], + name: "setLiquidationFeeRatio", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_makerFee", + type: "uint256", + }, + ], + name: "setMakerFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_makerFeeNextPrice", + type: "uint256", + }, + ], + name: "setMakerFeeNextPrice", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxFundingRate", + type: "uint256", + }, + ], + name: "setMaxFundingRate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxLeverage", + type: "uint256", + }, + ], + name: "setMaxLeverage", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxMarketValueUSD", + type: "uint256", + }, + ], + name: "setMaxMarketValueUSD", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_minMargin", + type: "uint256", + }, + ], + name: "setMinInitialMargin", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_sUSD", + type: "uint256", + }, + ], + name: "setMinKeeperFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_nextPriceConfirmWindow", + type: "uint256", + }, + ], + name: "setNextPriceConfirmWindow", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "_makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "_takerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "_makerFeeNextPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "_nextPriceConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "_maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "_maxMarketValueUSD", + type: "uint256", + }, + { + internalType: "uint256", + name: "_maxFundingRate", + type: "uint256", + }, + { + internalType: "uint256", + name: "_skewScaleUSD", + type: "uint256", + }, + ], + name: "setParameters", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_skewScaleUSD", + type: "uint256", + }, + ], + name: "setSkewScaleUSD", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_takerFee", + type: "uint256", + }, + ], + name: "setTakerFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_takerFeeNextPrice", + type: "uint256", + }, + ], + name: "setTakerFeeNextPrice", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "skewScaleUSD", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "takerFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "takerFeeNextPrice", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + "payab`le": false, + stateMutability: "view", + type: "function", + }, +] as const; export class FuturesMarketSettings__factory { - static readonly abi = _abi - static createInterface(): FuturesMarketSettingsInterface { - return new utils.Interface(_abi) as FuturesMarketSettingsInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): FuturesMarketSettings { - return new Contract(address, _abi, signerOrProvider) as FuturesMarketSettings - } + static readonly abi = _abi; + static createInterface(): FuturesMarketSettingsInterface { + return new utils.Interface(_abi) as FuturesMarketSettingsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): FuturesMarketSettings { + return new Contract( + address, + _abi, + signerOrProvider + ) as FuturesMarketSettings; + } } diff --git a/packages/sdk/src/contracts/types/factories/FuturesMarket__factory.ts b/packages/sdk/src/contracts/types/factories/FuturesMarket__factory.ts index 5730359d37..d7b990df4a 100644 --- a/packages/sdk/src/contracts/types/factories/FuturesMarket__factory.ts +++ b/packages/sdk/src/contracts/types/factories/FuturesMarket__factory.ts @@ -2,1126 +2,1129 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { FuturesMarket, FuturesMarketInterface } from '../FuturesMarket' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { FuturesMarket, FuturesMarketInterface } from "../FuturesMarket"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - { - internalType: 'bytes32', - name: '_baseAsset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'timestamp', - type: 'uint256', - }, - ], - name: 'FundingRecomputed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'baseAsset', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'FuturesTracking', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'int256', - name: 'marginDelta', - type: 'int256', - }, - ], - name: 'MarginTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'currentRoundId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'targetRoundId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'commitDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'keeperDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'NextPriceOrderRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'targetRoundId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'commitDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'keeperDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'NextPriceOrderSubmitted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'id', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'liquidator', - type: 'address', - }, - { - indexed: false, - internalType: 'int256', - name: 'size', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'PositionLiquidated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'id', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'margin', - type: 'uint256', - }, - { - indexed: false, - internalType: 'int256', - name: 'size', - type: 'int256', - }, - { - indexed: false, - internalType: 'int256', - name: 'tradeSize', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'lastPrice', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fundingIndex', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'PositionModified', - type: 'event', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'accessibleMargin', - outputs: [ - { - internalType: 'uint256', - name: 'marginAccessible', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'accruedFunding', - outputs: [ - { - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'assetPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'baseAsset', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'canLiquidate', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'cancelNextPriceOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'closePosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'closePositionWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'currentFundingRate', - outputs: [ - { - internalType: 'int256', - name: '', - type: 'int256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'executeNextPriceOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'fundingLastRecomputed', - outputs: [ - { - internalType: 'uint32', - name: '', - type: 'uint32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'fundingSequence', - outputs: [ - { - internalType: 'int128', - name: '', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'fundingSequenceLength', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidatePosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidationFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidationPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketDebt', - outputs: [ - { - internalType: 'uint256', - name: 'debt', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketKey', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSize', - outputs: [ - { - internalType: 'uint128', - name: '', - type: 'uint128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSizes', - outputs: [ - { - internalType: 'uint256', - name: 'long', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'short', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSkew', - outputs: [ - { - internalType: 'int128', - name: '', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - ], - name: 'modifyPosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'modifyPositionWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'nextPriceOrders', - outputs: [ - { - internalType: 'int128', - name: 'sizeDelta', - type: 'int128', - }, - { - internalType: 'uint128', - name: 'targetRoundId', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'commitDeposit', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'keeperDeposit', - type: 'uint128', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'notionalValue', - outputs: [ - { - internalType: 'int256', - name: 'value', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - ], - name: 'orderFee', - outputs: [ - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'positions', - outputs: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'postTradeDetails', - outputs: [ - { - internalType: 'uint256', - name: 'margin', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'size', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liqPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'enum IFuturesMarketBaseTypes.Status', - name: 'status', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'profitLoss', - outputs: [ - { - internalType: 'int256', - name: 'pnl', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'recomputeFunding', - outputs: [ - { - internalType: 'uint256', - name: 'lastIndex', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'remainingMargin', - outputs: [ - { - internalType: 'uint256', - name: 'marginRemaining', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - ], - name: 'submitNextPriceOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'submitNextPriceOrderWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'marginDelta', - type: 'int256', - }, - ], - name: 'transferMargin', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'unrecordedFunding', - outputs: [ - { - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'withdrawAllMargin', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_resolver", + type: "address", + }, + { + internalType: "bytes32", + name: "_baseAsset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "int256", + name: "funding", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "timestamp", + type: "uint256", + }, + ], + name: "FundingRecomputed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + indexed: false, + internalType: "bytes32", + name: "baseAsset", + type: "bytes32", + }, + { + indexed: false, + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "FuturesTracking", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "marginDelta", + type: "int256", + }, + ], + name: "MarginTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "currentRoundId", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "targetRoundId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "commitDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "keeperDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "NextPriceOrderRemoved", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "targetRoundId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "commitDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "keeperDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "NextPriceOrderSubmitted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "liquidator", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "size", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "PositionLiquidated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "margin", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "size", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "tradeSize", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "lastPrice", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fundingIndex", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "PositionModified", + type: "event", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "accessibleMargin", + outputs: [ + { + internalType: "uint256", + name: "marginAccessible", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "accruedFunding", + outputs: [ + { + internalType: "int256", + name: "funding", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "assetPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "baseAsset", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "canLiquidate", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "cancelNextPriceOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "closePosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "closePositionWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "currentFundingRate", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "executeNextPriceOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "fundingLastRecomputed", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "fundingSequence", + outputs: [ + { + internalType: "int128", + name: "", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "fundingSequenceLength", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidatePosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidationFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidationPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketDebt", + outputs: [ + { + internalType: "uint256", + name: "debt", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketKey", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSize", + outputs: [ + { + internalType: "uint128", + name: "", + type: "uint128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSizes", + outputs: [ + { + internalType: "uint256", + name: "long", + type: "uint256", + }, + { + internalType: "uint256", + name: "short", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSkew", + outputs: [ + { + internalType: "int128", + name: "", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + ], + name: "modifyPosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "modifyPositionWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "nextPriceOrders", + outputs: [ + { + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + internalType: "uint128", + name: "targetRoundId", + type: "uint128", + }, + { + internalType: "uint128", + name: "commitDeposit", + type: "uint128", + }, + { + internalType: "uint128", + name: "keeperDeposit", + type: "uint128", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "notionalValue", + outputs: [ + { + internalType: "int256", + name: "value", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + ], + name: "orderFee", + outputs: [ + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "positions", + outputs: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "postTradeDetails", + outputs: [ + { + internalType: "uint256", + name: "margin", + type: "uint256", + }, + { + internalType: "int256", + name: "size", + type: "int256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "liqPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "enum IFuturesMarketBaseTypes.Status", + name: "status", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "profitLoss", + outputs: [ + { + internalType: "int256", + name: "pnl", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "recomputeFunding", + outputs: [ + { + internalType: "uint256", + name: "lastIndex", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "remainingMargin", + outputs: [ + { + internalType: "uint256", + name: "marginRemaining", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + ], + name: "submitNextPriceOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "submitNextPriceOrderWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "marginDelta", + type: "int256", + }, + ], + name: "transferMargin", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "unrecordedFunding", + outputs: [ + { + internalType: "int256", + name: "funding", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "withdrawAllMargin", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class FuturesMarket__factory { - static readonly abi = _abi - static createInterface(): FuturesMarketInterface { - return new utils.Interface(_abi) as FuturesMarketInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): FuturesMarket { - return new Contract(address, _abi, signerOrProvider) as FuturesMarket - } + static readonly abi = _abi; + static createInterface(): FuturesMarketInterface { + return new utils.Interface(_abi) as FuturesMarketInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): FuturesMarket { + return new Contract(address, _abi, signerOrProvider) as FuturesMarket; + } } diff --git a/packages/sdk/src/contracts/types/factories/KwentaArrakisVault__factory.ts b/packages/sdk/src/contracts/types/factories/KwentaArrakisVault__factory.ts index 6d269be6d4..f81ab47f06 100644 --- a/packages/sdk/src/contracts/types/factories/KwentaArrakisVault__factory.ts +++ b/packages/sdk/src/contracts/types/factories/KwentaArrakisVault__factory.ts @@ -2,1144 +2,1150 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { KwentaArrakisVault, KwentaArrakisVaultInterface } from '../KwentaArrakisVault' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + KwentaArrakisVault, + KwentaArrakisVaultInterface, +} from "../KwentaArrakisVault"; const _abi = [ - { - inputs: [ - { - internalType: 'address payable', - name: '_gelato', - type: 'address', - }, - { - internalType: 'address', - name: '_arrakisTreasury', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'burnAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0Out', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1Out', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint128', - name: 'liquidityBurned', - type: 'uint128', - }, - ], - name: 'Burned', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'feesEarned0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'feesEarned1', - type: 'uint256', - }, - ], - name: 'FeesEarned', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'mintAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0In', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1In', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint128', - name: 'liquidityMinted', - type: 'uint128', - }, - ], - name: 'Minted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousManager', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newManager', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'int24', - name: 'lowerTick_', - type: 'int24', - }, - { - indexed: false, - internalType: 'int24', - name: 'upperTick_', - type: 'int24', - }, - { - indexed: false, - internalType: 'uint128', - name: 'liquidityBefore', - type: 'uint128', - }, - { - indexed: false, - internalType: 'uint128', - name: 'liquidityAfter', - type: 'uint128', - }, - ], - name: 'Rebalance', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint16', - name: 'managerFeeBPS', - type: 'uint16', - }, - { - indexed: false, - internalType: 'address', - name: 'managerTreasury', - type: 'address', - }, - { - indexed: false, - internalType: 'uint16', - name: 'gelatoRebalanceBPS', - type: 'uint16', - }, - { - indexed: false, - internalType: 'uint16', - name: 'gelatoSlippageBPS', - type: 'uint16', - }, - { - indexed: false, - internalType: 'uint32', - name: 'gelatoSlippageInterval', - type: 'uint32', - }, - ], - name: 'UpdateManagerParams', - type: 'event', - }, - { - inputs: [], - name: 'GELATO', - outputs: [ - { - internalType: 'address payable', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'RESTRICTED_MINT_ENABLED', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'arrakisBalance0', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'arrakisBalance1', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'arrakisFeeBPS', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'arrakisTreasury', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'burnAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'burn', - outputs: [ - { - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - { - internalType: 'uint128', - name: 'liquidityBurned', - type: 'uint128', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'int24', - name: 'newLowerTick', - type: 'int24', - }, - { - internalType: 'int24', - name: 'newUpperTick', - type: 'int24', - }, - { - internalType: 'uint160', - name: 'swapThresholdPrice', - type: 'uint160', - }, - { - internalType: 'uint256', - name: 'swapAmountBPS', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'zeroForOne', - type: 'bool', - }, - ], - name: 'executiveRebalance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'gelatoRebalanceBPS', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'gelatoSlippageBPS', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'gelatoSlippageInterval', - outputs: [ - { - internalType: 'uint32', - name: '', - type: 'uint32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount0Max', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1Max', - type: 'uint256', - }, - ], - name: 'getMintAmounts', - outputs: [ - { - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'mintAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPositionID', - outputs: [ - { - internalType: 'bytes32', - name: 'positionID', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getUnderlyingBalances', - outputs: [ - { - internalType: 'uint256', - name: 'amount0Current', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1Current', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint160', - name: 'sqrtRatioX96', - type: 'uint160', - }, - ], - name: 'getUnderlyingBalancesAtPrice', - outputs: [ - { - internalType: 'uint256', - name: 'amount0Current', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1Current', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'addedValue', - type: 'uint256', - }, - ], - name: 'increaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'string', - name: '_name', - type: 'string', - }, - { - internalType: 'string', - name: '_symbol', - type: 'string', - }, - { - internalType: 'address', - name: '_pool', - type: 'address', - }, - { - internalType: 'uint16', - name: '_managerFeeBPS', - type: 'uint16', - }, - { - internalType: 'int24', - name: '_lowerTick', - type: 'int24', - }, - { - internalType: 'int24', - name: '_upperTick', - type: 'int24', - }, - { - internalType: 'address', - name: '_manager_', - type: 'address', - }, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'lowerTick', - outputs: [ - { - internalType: 'int24', - name: '', - type: 'int24', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'manager', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'managerBalance0', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'managerBalance1', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'managerFeeBPS', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'managerTreasury', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'mintAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'mint', - outputs: [ - { - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - { - internalType: 'uint128', - name: 'liquidityMinted', - type: 'uint128', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'pool', - outputs: [ - { - internalType: 'contract IUniswapV3Pool', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint160', - name: 'swapThresholdPrice', - type: 'uint160', - }, - { - internalType: 'uint256', - name: 'swapAmountBPS', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'zeroForOne', - type: 'bool', - }, - { - internalType: 'uint256', - name: 'feeAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'paymentToken', - type: 'address', - }, - ], - name: 'rebalance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'restrictedMintToggle', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'toggleRestrictMint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'token0', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'token1', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount0Owed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1Owed', - type: 'uint256', - }, - { - internalType: 'bytes', - name: '', - type: 'bytes', - }, - ], - name: 'uniswapV3MintCallback', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'int256', - name: 'amount0Delta', - type: 'int256', - }, - { - internalType: 'int256', - name: 'amount1Delta', - type: 'int256', - }, - { - internalType: 'bytes', - name: '', - type: 'bytes', - }, - ], - name: 'uniswapV3SwapCallback', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'int16', - name: 'newManagerFeeBPS', - type: 'int16', - }, - { - internalType: 'address', - name: 'newManagerTreasury', - type: 'address', - }, - { - internalType: 'int16', - name: 'newRebalanceBPS', - type: 'int16', - }, - { - internalType: 'int16', - name: 'newSlippageBPS', - type: 'int16', - }, - { - internalType: 'int32', - name: 'newSlippageInterval', - type: 'int32', - }, - ], - name: 'updateManagerParams', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'upperTick', - outputs: [ - { - internalType: 'int24', - name: '', - type: 'int24', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'version', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'withdrawArrakisBalance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'withdrawManagerBalance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address payable", + name: "_gelato", + type: "address", + }, + { + internalType: "address", + name: "_arrakisTreasury", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "receiver", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "burnAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0Out", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1Out", + type: "uint256", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityBurned", + type: "uint128", + }, + ], + name: "Burned", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "feesEarned0", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "feesEarned1", + type: "uint256", + }, + ], + name: "FeesEarned", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "receiver", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "mintAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0In", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1In", + type: "uint256", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityMinted", + type: "uint128", + }, + ], + name: "Minted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousManager", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newManager", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "int24", + name: "lowerTick_", + type: "int24", + }, + { + indexed: false, + internalType: "int24", + name: "upperTick_", + type: "int24", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityBefore", + type: "uint128", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityAfter", + type: "uint128", + }, + ], + name: "Rebalance", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint16", + name: "managerFeeBPS", + type: "uint16", + }, + { + indexed: false, + internalType: "address", + name: "managerTreasury", + type: "address", + }, + { + indexed: false, + internalType: "uint16", + name: "gelatoRebalanceBPS", + type: "uint16", + }, + { + indexed: false, + internalType: "uint16", + name: "gelatoSlippageBPS", + type: "uint16", + }, + { + indexed: false, + internalType: "uint32", + name: "gelatoSlippageInterval", + type: "uint32", + }, + ], + name: "UpdateManagerParams", + type: "event", + }, + { + inputs: [], + name: "GELATO", + outputs: [ + { + internalType: "address payable", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "RESTRICTED_MINT_ENABLED", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "arrakisBalance0", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "arrakisBalance1", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "arrakisFeeBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "arrakisTreasury", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "burnAmount", + type: "uint256", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "burn", + outputs: [ + { + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + { + internalType: "uint128", + name: "liquidityBurned", + type: "uint128", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "subtractedValue", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int24", + name: "newLowerTick", + type: "int24", + }, + { + internalType: "int24", + name: "newUpperTick", + type: "int24", + }, + { + internalType: "uint160", + name: "swapThresholdPrice", + type: "uint160", + }, + { + internalType: "uint256", + name: "swapAmountBPS", + type: "uint256", + }, + { + internalType: "bool", + name: "zeroForOne", + type: "bool", + }, + ], + name: "executiveRebalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "gelatoRebalanceBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gelatoSlippageBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gelatoSlippageInterval", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount0Max", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Max", + type: "uint256", + }, + ], + name: "getMintAmounts", + outputs: [ + { + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + { + internalType: "uint256", + name: "mintAmount", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPositionID", + outputs: [ + { + internalType: "bytes32", + name: "positionID", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getUnderlyingBalances", + outputs: [ + { + internalType: "uint256", + name: "amount0Current", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Current", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint160", + name: "sqrtRatioX96", + type: "uint160", + }, + ], + name: "getUnderlyingBalancesAtPrice", + outputs: [ + { + internalType: "uint256", + name: "amount0Current", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Current", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "string", + name: "_symbol", + type: "string", + }, + { + internalType: "address", + name: "_pool", + type: "address", + }, + { + internalType: "uint16", + name: "_managerFeeBPS", + type: "uint16", + }, + { + internalType: "int24", + name: "_lowerTick", + type: "int24", + }, + { + internalType: "int24", + name: "_upperTick", + type: "int24", + }, + { + internalType: "address", + name: "_manager_", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "lowerTick", + outputs: [ + { + internalType: "int24", + name: "", + type: "int24", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "manager", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerBalance0", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerBalance1", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerFeeBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerTreasury", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "mintAmount", + type: "uint256", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "mint", + outputs: [ + { + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + { + internalType: "uint128", + name: "liquidityMinted", + type: "uint128", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pool", + outputs: [ + { + internalType: "contract IUniswapV3Pool", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint160", + name: "swapThresholdPrice", + type: "uint160", + }, + { + internalType: "uint256", + name: "swapAmountBPS", + type: "uint256", + }, + { + internalType: "bool", + name: "zeroForOne", + type: "bool", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address", + name: "paymentToken", + type: "address", + }, + ], + name: "rebalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "restrictedMintToggle", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "toggleRestrictMint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "token0", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "token1", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount0Owed", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Owed", + type: "uint256", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "uniswapV3MintCallback", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int256", + name: "amount0Delta", + type: "int256", + }, + { + internalType: "int256", + name: "amount1Delta", + type: "int256", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "uniswapV3SwapCallback", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int16", + name: "newManagerFeeBPS", + type: "int16", + }, + { + internalType: "address", + name: "newManagerTreasury", + type: "address", + }, + { + internalType: "int16", + name: "newRebalanceBPS", + type: "int16", + }, + { + internalType: "int16", + name: "newSlippageBPS", + type: "int16", + }, + { + internalType: "int32", + name: "newSlippageInterval", + type: "int32", + }, + ], + name: "updateManagerParams", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "upperTick", + outputs: [ + { + internalType: "int24", + name: "", + type: "int24", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "version", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "withdrawArrakisBalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "withdrawManagerBalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class KwentaArrakisVault__factory { - static readonly abi = _abi - static createInterface(): KwentaArrakisVaultInterface { - return new utils.Interface(_abi) as KwentaArrakisVaultInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): KwentaArrakisVault { - return new Contract(address, _abi, signerOrProvider) as KwentaArrakisVault - } + static readonly abi = _abi; + static createInterface(): KwentaArrakisVaultInterface { + return new utils.Interface(_abi) as KwentaArrakisVaultInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): KwentaArrakisVault { + return new Contract(address, _abi, signerOrProvider) as KwentaArrakisVault; + } } diff --git a/packages/sdk/src/contracts/types/factories/KwentaStakingRewards__factory.ts b/packages/sdk/src/contracts/types/factories/KwentaStakingRewards__factory.ts index 0f27fde552..e58d01b4fd 100644 --- a/packages/sdk/src/contracts/types/factories/KwentaStakingRewards__factory.ts +++ b/packages/sdk/src/contracts/types/factories/KwentaStakingRewards__factory.ts @@ -2,714 +2,724 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { KwentaStakingRewards, KwentaStakingRewardsInterface } from '../KwentaStakingRewards' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + KwentaStakingRewards, + KwentaStakingRewardsInterface, +} from "../KwentaStakingRewards"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_token', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardEscrow', - type: 'address', - }, - { - internalType: 'address', - name: '_supplySchedule', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'EscrowStaked', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'EscrowUnstaked', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'Paused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'token', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Recovered', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'RewardAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'RewardPaid', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newDuration', - type: 'uint256', - }, - ], - name: 'RewardsDurationUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Staked', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'Unpaused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Unstaked', - type: 'event', - }, - { - inputs: [], - name: '_totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'earned', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'escrowedBalanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'exit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getReward', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getRewardForDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lastTimeRewardApplicable', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lastUpdateTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'nonEscrowedBalanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'notifyRewardAmount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'pauseStakingRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'paused', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'periodFinish', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'tokenAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenAmount', - type: 'uint256', - }, - ], - name: 'recoverERC20', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'rewardEscrow', - outputs: [ - { - internalType: 'contract IRewardEscrow', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardPerToken', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardPerTokenStored', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'rewards', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardsDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_rewardsDuration', - type: 'uint256', - }, - ], - name: 'setRewardsDuration', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'stake', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'stakeEscrow', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'supplySchedule', - outputs: [ - { - internalType: 'contract ISupplySchedule', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'token', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'unpauseStakingRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'unstake', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'unstakeEscrow', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'userRewardPerTokenPaid', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address", + }, + { + internalType: "address", + name: "_rewardEscrow", + type: "address", + }, + { + internalType: "address", + name: "_supplySchedule", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "EscrowStaked", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "EscrowUnstaked", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Paused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Recovered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "RewardAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "RewardPaid", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newDuration", + type: "uint256", + }, + ], + name: "RewardsDurationUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Staked", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Unpaused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Unstaked", + type: "event", + }, + { + inputs: [], + name: "_totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "earned", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "escrowedBalanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "exit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "getReward", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "getRewardForDuration", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastTimeRewardApplicable", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastUpdateTime", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "nonEscrowedBalanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "notifyRewardAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pauseStakingRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "paused", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "periodFinish", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenAmount", + type: "uint256", + }, + ], + name: "recoverERC20", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "rewardEscrow", + outputs: [ + { + internalType: "contract IRewardEscrow", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardPerToken", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardPerTokenStored", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "rewards", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardsDuration", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_rewardsDuration", + type: "uint256", + }, + ], + name: "setRewardsDuration", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "stake", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "stakeEscrow", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "supplySchedule", + outputs: [ + { + internalType: "contract ISupplySchedule", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "token", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "unpauseStakingRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "unstake", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "unstakeEscrow", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "userRewardPerTokenPaid", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class KwentaStakingRewards__factory { - static readonly abi = _abi - static createInterface(): KwentaStakingRewardsInterface { - return new utils.Interface(_abi) as KwentaStakingRewardsInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): KwentaStakingRewards { - return new Contract(address, _abi, signerOrProvider) as KwentaStakingRewards - } + static readonly abi = _abi; + static createInterface(): KwentaStakingRewardsInterface { + return new utils.Interface(_abi) as KwentaStakingRewardsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): KwentaStakingRewards { + return new Contract( + address, + _abi, + signerOrProvider + ) as KwentaStakingRewards; + } } diff --git a/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorOp__factory.ts b/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorOp__factory.ts index 296bee68ea..e3baaedac2 100644 --- a/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorOp__factory.ts +++ b/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorOp__factory.ts @@ -2,310 +2,314 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; import type { - MultipleMerkleDistributorOp, - MultipleMerkleDistributorOpInterface, -} from '../MultipleMerkleDistributorOp' + MultipleMerkleDistributorOp, + MultipleMerkleDistributorOpInterface, +} from "../MultipleMerkleDistributorOp"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_token', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'Claimed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'MerkleRootModified', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32[]', - name: 'merkleProof', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'claim', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32[]', - name: 'merkleProof', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - internalType: 'struct IMultipleMerkleDistributor.Claims[]', - name: 'claims', - type: 'tuple[]', - }, - ], - name: 'claimMultiple', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'isClaimed', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'merkleRoots', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'merkleRoot', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'setMerkleRootForEpoch', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'token', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_token", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "Claimed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "MerkleRootModified", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "merkleProof", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "merkleProof", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + internalType: "struct IMultipleMerkleDistributor.Claims[]", + name: "claims", + type: "tuple[]", + }, + ], + name: "claimMultiple", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "isClaimed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "merkleRoots", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "merkleRoot", + type: "bytes32", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "setMerkleRootForEpoch", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "token", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class MultipleMerkleDistributorOp__factory { - static readonly abi = _abi - static createInterface(): MultipleMerkleDistributorOpInterface { - return new utils.Interface(_abi) as MultipleMerkleDistributorOpInterface - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): MultipleMerkleDistributorOp { - return new Contract(address, _abi, signerOrProvider) as MultipleMerkleDistributorOp - } + static readonly abi = _abi; + static createInterface(): MultipleMerkleDistributorOpInterface { + return new utils.Interface(_abi) as MultipleMerkleDistributorOpInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): MultipleMerkleDistributorOp { + return new Contract( + address, + _abi, + signerOrProvider + ) as MultipleMerkleDistributorOp; + } } diff --git a/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorPerpsV2__factory.ts b/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorPerpsV2__factory.ts index 24ee8ceffb..e65da0d3a8 100644 --- a/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorPerpsV2__factory.ts +++ b/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributorPerpsV2__factory.ts @@ -2,328 +2,334 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; import type { - MultipleMerkleDistributorPerpsV2, - MultipleMerkleDistributorPerpsV2Interface, -} from '../MultipleMerkleDistributorPerpsV2' + MultipleMerkleDistributorPerpsV2, + MultipleMerkleDistributorPerpsV2Interface, +} from "../MultipleMerkleDistributorPerpsV2"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_token', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardEscrow', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'Claimed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'MerkleRootModified', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32[]', - name: 'merkleProof', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'claim', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32[]', - name: 'merkleProof', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - internalType: 'struct IMultipleMerkleDistributor.Claims[]', - name: 'claims', - type: 'tuple[]', - }, - ], - name: 'claimMultiple', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'isClaimed', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'merkleRoots', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardEscrow', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'merkleRoot', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'setMerkleRootForEpoch', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'token', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_token", + type: "address", + }, + { + internalType: "address", + name: "_rewardEscrow", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "Claimed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "MerkleRootModified", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "merkleProof", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "merkleProof", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + internalType: "struct IMultipleMerkleDistributor.Claims[]", + name: "claims", + type: "tuple[]", + }, + ], + name: "claimMultiple", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "isClaimed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "merkleRoots", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardEscrow", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "merkleRoot", + type: "bytes32", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "setMerkleRootForEpoch", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "token", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class MultipleMerkleDistributorPerpsV2__factory { - static readonly abi = _abi - static createInterface(): MultipleMerkleDistributorPerpsV2Interface { - return new utils.Interface(_abi) as MultipleMerkleDistributorPerpsV2Interface - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): MultipleMerkleDistributorPerpsV2 { - return new Contract(address, _abi, signerOrProvider) as MultipleMerkleDistributorPerpsV2 - } + static readonly abi = _abi; + static createInterface(): MultipleMerkleDistributorPerpsV2Interface { + return new utils.Interface( + _abi + ) as MultipleMerkleDistributorPerpsV2Interface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): MultipleMerkleDistributorPerpsV2 { + return new Contract( + address, + _abi, + signerOrProvider + ) as MultipleMerkleDistributorPerpsV2; + } } diff --git a/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributor__factory.ts b/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributor__factory.ts index 89ab35e9d6..e1759c2f52 100644 --- a/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributor__factory.ts +++ b/packages/sdk/src/contracts/types/factories/MultipleMerkleDistributor__factory.ts @@ -2,333 +2,340 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; import type { - MultipleMerkleDistributor, - MultipleMerkleDistributorInterface, -} from '../MultipleMerkleDistributor' + MultipleMerkleDistributor, + MultipleMerkleDistributorInterface, +} from "../MultipleMerkleDistributor"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_token', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardEscrow', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'Claimed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'MerkleRootAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32[]', - name: 'merkleProof', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'claim', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32[]', - name: 'merkleProof', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - internalType: 'struct IMultipleMerkleDistributor.Claims[]', - name: 'claims', - type: 'tuple[]', - }, - ], - name: 'claimMultiple', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'distributionEpoch', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'epoch', - type: 'uint256', - }, - ], - name: 'isClaimed', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'merkleRoots', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '_merkleRoot', - type: 'bytes32', - }, - ], - name: 'newMerkleRoot', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardEscrow', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'token', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_token", + type: "address", + }, + { + internalType: "address", + name: "_rewardEscrow", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "Claimed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "MerkleRootAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "merkleProof", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "merkleProof", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + internalType: "struct IMultipleMerkleDistributor.Claims[]", + name: "claims", + type: "tuple[]", + }, + ], + name: "claimMultiple", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "distributionEpoch", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "epoch", + type: "uint256", + }, + ], + name: "isClaimed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "merkleRoots", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_merkleRoot", + type: "bytes32", + }, + ], + name: "newMerkleRoot", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rewardEscrow", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "token", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class MultipleMerkleDistributor__factory { - static readonly abi = _abi - static createInterface(): MultipleMerkleDistributorInterface { - return new utils.Interface(_abi) as MultipleMerkleDistributorInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): MultipleMerkleDistributor { - return new Contract(address, _abi, signerOrProvider) as MultipleMerkleDistributor - } + static readonly abi = _abi; + static createInterface(): MultipleMerkleDistributorInterface { + return new utils.Interface(_abi) as MultipleMerkleDistributorInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): MultipleMerkleDistributor { + return new Contract( + address, + _abi, + signerOrProvider + ) as MultipleMerkleDistributor; + } } diff --git a/packages/sdk/src/contracts/types/factories/PerpsV2MarketData__factory.ts b/packages/sdk/src/contracts/types/factories/PerpsV2MarketData__factory.ts index 2c3e2d57e2..762a6d7fa0 100644 --- a/packages/sdk/src/contracts/types/factories/PerpsV2MarketData__factory.ts +++ b/packages/sdk/src/contracts/types/factories/PerpsV2MarketData__factory.ts @@ -2,1164 +2,1170 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { PerpsV2MarketData, PerpsV2MarketDataInterface } from '../PerpsV2MarketData' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + PerpsV2MarketData, + PerpsV2MarketDataInterface, +} from "../PerpsV2MarketData"; const _abi = [ - { - inputs: [ - { - internalType: 'contract IAddressResolver', - name: '_resolverProxy', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - constant: true, - inputs: [], - name: 'allMarketSummaries', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'asset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'currentFundingRate', - type: 'int256', - }, - { - internalType: 'int256', - name: 'currentFundingVelocity', - type: 'int256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketSummary[]', - name: '', - type: 'tuple[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'allProxiedMarketSummaries', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'asset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'currentFundingRate', - type: 'int256', - }, - { - internalType: 'int256', - name: 'currentFundingVelocity', - type: 'int256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketSummary[]', - name: '', - type: 'tuple[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'globals', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'minInitialMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationFeeRatio', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minKeeperFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxKeeperFee', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FuturesGlobals', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'contract IPerpsV2MarketViews', - name: 'market', - type: 'address', - }, - ], - name: 'marketDetails', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'baseAsset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValue', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketLimits', - name: 'limits', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxFundingVelocity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScale', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FundingParameters', - name: 'fundingParameters', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'long', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'short', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.Sides', - name: 'sides', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketSizeDetails', - name: 'marketSizeDetails', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - internalType: 'struct PerpsV2MarketData.PriceDetails', - name: 'priceDetails', - type: 'tuple', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - ], - name: 'marketDetailsForKey', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'baseAsset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValue', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketLimits', - name: 'limits', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'maxFundingVelocity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScale', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FundingParameters', - name: 'fundingParameters', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'long', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'short', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.Sides', - name: 'sides', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketSizeDetails', - name: 'marketSizeDetails', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - internalType: 'struct PerpsV2MarketData.PriceDetails', - name: 'priceDetails', - type: 'tuple', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address[]', - name: 'markets', - type: 'address[]', - }, - ], - name: 'marketSummaries', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'asset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'currentFundingRate', - type: 'int256', - }, - { - internalType: 'int256', - name: 'currentFundingVelocity', - type: 'int256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketSummary[]', - name: '', - type: 'tuple[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'marketKeys', - type: 'bytes32[]', - }, - ], - name: 'marketSummariesForKeys', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'market', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'asset', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marketSize', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'marketSkew', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'marketDebt', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'currentFundingRate', - type: 'int256', - }, - { - internalType: 'int256', - name: 'currentFundingVelocity', - type: 'int256', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - internalType: 'struct PerpsV2MarketData.FeeRates', - name: 'feeRates', - type: 'tuple', - }, - ], - internalType: 'struct PerpsV2MarketData.MarketSummary[]', - name: '', - type: 'tuple[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - ], - name: 'parameters', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValue', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxFundingVelocity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScale', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'nextPriceConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'delayedOrderConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minDelayTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxDelayTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'offchainDelayedOrderMinAge', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'offchainDelayedOrderMaxAge', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'offchainMarketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'offchainPriceDivergence', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationPremiumMultiplier', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationBufferRatio', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLiquidationDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxPD', - type: 'uint256', - }, - ], - internalType: 'struct IPerpsV2MarketSettings.Parameters', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'contract IPerpsV2MarketViews', - name: 'market', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'positionDetails', - outputs: [ - { - components: [ - { - components: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - internalType: 'struct IPerpsV2MarketBaseTypes.Position', - name: 'position', - type: 'tuple', - }, - { - internalType: 'int256', - name: 'notionalValue', - type: 'int256', - }, - { - internalType: 'int256', - name: 'profitLoss', - type: 'int256', - }, - { - internalType: 'int256', - name: 'accruedFunding', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'remainingMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'accessibleMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationPrice', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'canLiquidatePosition', - type: 'bool', - }, - ], - internalType: 'struct PerpsV2MarketData.PositionData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'positionDetailsForMarketKey', - outputs: [ - { - components: [ - { - components: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - internalType: 'struct IPerpsV2MarketBaseTypes.Position', - name: 'position', - type: 'tuple', - }, - { - internalType: 'int256', - name: 'notionalValue', - type: 'int256', - }, - { - internalType: 'int256', - name: 'profitLoss', - type: 'int256', - }, - { - internalType: 'int256', - name: 'accruedFunding', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'remainingMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'accessibleMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationPrice', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'canLiquidatePosition', - type: 'bool', - }, - ], - internalType: 'struct PerpsV2MarketData.PositionData', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverProxy', - outputs: [ - { - internalType: 'contract IAddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "contract IAddressResolver", + name: "_resolverProxy", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + constant: true, + inputs: [], + name: "allMarketSummaries", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "asset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + internalType: "int256", + name: "currentFundingVelocity", + type: "int256", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + ], + internalType: "struct PerpsV2MarketData.MarketSummary[]", + name: "", + type: "tuple[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "allProxiedMarketSummaries", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "asset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + internalType: "int256", + name: "currentFundingVelocity", + type: "int256", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + ], + internalType: "struct PerpsV2MarketData.MarketSummary[]", + name: "", + type: "tuple[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "globals", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "minInitialMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationFeeRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "minKeeperFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxKeeperFee", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FuturesGlobals", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "contract IPerpsV2MarketViews", + name: "market", + type: "address", + }, + ], + name: "marketDetails", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "baseAsset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValue", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.MarketLimits", + name: "limits", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FundingParameters", + name: "fundingParameters", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "long", + type: "uint256", + }, + { + internalType: "uint256", + name: "short", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.Sides", + name: "sides", + type: "tuple", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + ], + internalType: "struct PerpsV2MarketData.MarketSizeDetails", + name: "marketSizeDetails", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + internalType: "struct PerpsV2MarketData.PriceDetails", + name: "priceDetails", + type: "tuple", + }, + ], + internalType: "struct PerpsV2MarketData.MarketData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + ], + name: "marketDetailsForKey", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "baseAsset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValue", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.MarketLimits", + name: "limits", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FundingParameters", + name: "fundingParameters", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "long", + type: "uint256", + }, + { + internalType: "uint256", + name: "short", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.Sides", + name: "sides", + type: "tuple", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + ], + internalType: "struct PerpsV2MarketData.MarketSizeDetails", + name: "marketSizeDetails", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + internalType: "struct PerpsV2MarketData.PriceDetails", + name: "priceDetails", + type: "tuple", + }, + ], + internalType: "struct PerpsV2MarketData.MarketData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address[]", + name: "markets", + type: "address[]", + }, + ], + name: "marketSummaries", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "asset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + internalType: "int256", + name: "currentFundingVelocity", + type: "int256", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + ], + internalType: "struct PerpsV2MarketData.MarketSummary[]", + name: "", + type: "tuple[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "marketKeys", + type: "bytes32[]", + }, + ], + name: "marketSummariesForKeys", + outputs: [ + { + components: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "bytes32", + name: "asset", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "marketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "marketSkew", + type: "int256", + }, + { + internalType: "uint256", + name: "marketDebt", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + internalType: "int256", + name: "currentFundingVelocity", + type: "int256", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + internalType: "struct PerpsV2MarketData.FeeRates", + name: "feeRates", + type: "tuple", + }, + ], + internalType: "struct PerpsV2MarketData.MarketSummary[]", + name: "", + type: "tuple[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + ], + name: "parameters", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValue", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + { + internalType: "uint256", + name: "nextPriceConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "delayedOrderConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "minDelayTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxDelayTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "offchainDelayedOrderMinAge", + type: "uint256", + }, + { + internalType: "uint256", + name: "offchainDelayedOrderMaxAge", + type: "uint256", + }, + { + internalType: "bytes32", + name: "offchainMarketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "offchainPriceDivergence", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationPremiumMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationBufferRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPD", + type: "uint256", + }, + ], + internalType: "struct IPerpsV2MarketSettings.Parameters", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "contract IPerpsV2MarketViews", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "positionDetails", + outputs: [ + { + components: [ + { + components: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + internalType: "struct IPerpsV2MarketBaseTypes.Position", + name: "position", + type: "tuple", + }, + { + internalType: "int256", + name: "notionalValue", + type: "int256", + }, + { + internalType: "int256", + name: "profitLoss", + type: "int256", + }, + { + internalType: "int256", + name: "accruedFunding", + type: "int256", + }, + { + internalType: "uint256", + name: "remainingMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "accessibleMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationPrice", + type: "uint256", + }, + { + internalType: "bool", + name: "canLiquidatePosition", + type: "bool", + }, + ], + internalType: "struct PerpsV2MarketData.PositionData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "positionDetailsForMarketKey", + outputs: [ + { + components: [ + { + components: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + internalType: "struct IPerpsV2MarketBaseTypes.Position", + name: "position", + type: "tuple", + }, + { + internalType: "int256", + name: "notionalValue", + type: "int256", + }, + { + internalType: "int256", + name: "profitLoss", + type: "int256", + }, + { + internalType: "int256", + name: "accruedFunding", + type: "int256", + }, + { + internalType: "uint256", + name: "remainingMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "accessibleMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationPrice", + type: "uint256", + }, + { + internalType: "bool", + name: "canLiquidatePosition", + type: "bool", + }, + ], + internalType: "struct PerpsV2MarketData.PositionData", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverProxy", + outputs: [ + { + internalType: "contract IAddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class PerpsV2MarketData__factory { - static readonly abi = _abi - static createInterface(): PerpsV2MarketDataInterface { - return new utils.Interface(_abi) as PerpsV2MarketDataInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): PerpsV2MarketData { - return new Contract(address, _abi, signerOrProvider) as PerpsV2MarketData - } + static readonly abi = _abi; + static createInterface(): PerpsV2MarketDataInterface { + return new utils.Interface(_abi) as PerpsV2MarketDataInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PerpsV2MarketData { + return new Contract(address, _abi, signerOrProvider) as PerpsV2MarketData; + } } diff --git a/packages/sdk/src/contracts/types/factories/PerpsV2MarketSettings__factory.ts b/packages/sdk/src/contracts/types/factories/PerpsV2MarketSettings__factory.ts index 2f881d69e2..78f919de23 100644 --- a/packages/sdk/src/contracts/types/factories/PerpsV2MarketSettings__factory.ts +++ b/packages/sdk/src/contracts/types/factories/PerpsV2MarketSettings__factory.ts @@ -2,1658 +2,1665 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; import type { - PerpsV2MarketSettings, - PerpsV2MarketSettingsInterface, -} from '../PerpsV2MarketSettings' + PerpsV2MarketSettings, + PerpsV2MarketSettingsInterface, +} from "../PerpsV2MarketSettings"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'keeperFee', - type: 'uint256', - }, - ], - name: 'KeeperLiquidationFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'bps', - type: 'uint256', - }, - ], - name: 'LiquidationBufferRatioUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'bps', - type: 'uint256', - }, - ], - name: 'LiquidationFeeRatioUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'sUSD', - type: 'uint256', - }, - ], - name: 'MaxKeeperFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'minMargin', - type: 'uint256', - }, - ], - name: 'MinInitialMarginUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'sUSD', - type: 'uint256', - }, - ], - name: 'MinKeeperFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'parameter', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'ParameterUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'parameter', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'value', - type: 'bytes32', - }, - ], - name: 'ParameterUpdatedBytes32', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'delayedOrderConfirmWindow', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'keeperLiquidationFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'liquidationBufferRatio', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidationFeeRatio', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'liquidationPremiumMultiplier', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'makerFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'makerFeeDelayedOrder', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'makerFeeOffchainDelayedOrder', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxDelayTimeDelta', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxFundingVelocity', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'maxKeeperFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxLeverage', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxLiquidationDelta', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxMarketValue', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'maxPD', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'minDelayTimeDelta', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'minInitialMargin', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'minKeeperFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'nextPriceConfirmWindow', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'offchainDelayedOrderMaxAge', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'offchainDelayedOrderMinAge', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'offchainMarketKey', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'offchainPriceDivergence', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'parameters', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValue', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxFundingVelocity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScale', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'nextPriceConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'delayedOrderConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minDelayTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxDelayTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'offchainDelayedOrderMinAge', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'offchainDelayedOrderMaxAge', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'offchainMarketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'offchainPriceDivergence', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationPremiumMultiplier', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationBufferRatio', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLiquidationDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxPD', - type: 'uint256', - }, - ], - internalType: 'struct IPerpsV2MarketSettings.Parameters', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_delayedOrderConfirmWindow', - type: 'uint256', - }, - ], - name: 'setDelayedOrderConfirmWindow', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_keeperFee', - type: 'uint256', - }, - ], - name: 'setKeeperLiquidationFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_ratio', - type: 'uint256', - }, - ], - name: 'setLiquidationBufferRatio', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_ratio', - type: 'uint256', - }, - ], - name: 'setLiquidationFeeRatio', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_liquidationPremiumMultiplier', - type: 'uint256', - }, - ], - name: 'setLiquidationPremiumMultiplier', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_makerFee', - type: 'uint256', - }, - ], - name: 'setMakerFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_makerFeeDelayedOrder', - type: 'uint256', - }, - ], - name: 'setMakerFeeDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - name: 'setMakerFeeOffchainDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxDelayTimeDelta', - type: 'uint256', - }, - ], - name: 'setMaxDelayTimeDelta', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxFundingVelocity', - type: 'uint256', - }, - ], - name: 'setMaxFundingVelocity', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_sUSD', - type: 'uint256', - }, - ], - name: 'setMaxKeeperFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxLeverage', - type: 'uint256', - }, - ], - name: 'setMaxLeverage', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxLiquidationDelta', - type: 'uint256', - }, - ], - name: 'setMaxLiquidationDelta', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxMarketValue', - type: 'uint256', - }, - ], - name: 'setMaxMarketValue', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_maxPD', - type: 'uint256', - }, - ], - name: 'setMaxPD', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_minDelayTimeDelta', - type: 'uint256', - }, - ], - name: 'setMinDelayTimeDelta', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_minMargin', - type: 'uint256', - }, - ], - name: 'setMinInitialMargin', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_sUSD', - type: 'uint256', - }, - ], - name: 'setMinKeeperFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_nextPriceConfirmWindow', - type: 'uint256', - }, - ], - name: 'setNextPriceConfirmWindow', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_offchainDelayedOrderMaxAge', - type: 'uint256', - }, - ], - name: 'setOffchainDelayedOrderMaxAge', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_offchainDelayedOrderMinAge', - type: 'uint256', - }, - ], - name: 'setOffchainDelayedOrderMinAge', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: '_offchainMarketKey', - type: 'bytes32', - }, - ], - name: 'setOffchainMarketKey', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_offchainPriceDivergence', - type: 'uint256', - }, - ], - name: 'setOffchainPriceDivergence', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - components: [ - { - internalType: 'uint256', - name: 'takerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'makerFeeOffchainDelayedOrder', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLeverage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxMarketValue', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxFundingVelocity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'skewScale', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'nextPriceConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'delayedOrderConfirmWindow', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minDelayTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxDelayTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'offchainDelayedOrderMinAge', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'offchainDelayedOrderMaxAge', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'offchainMarketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'offchainPriceDivergence', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationPremiumMultiplier', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liquidationBufferRatio', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLiquidationDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxPD', - type: 'uint256', - }, - ], - internalType: 'struct IPerpsV2MarketSettings.Parameters', - name: '_parameters', - type: 'tuple', - }, - ], - name: 'setParameters', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_skewScale', - type: 'uint256', - }, - ], - name: 'setSkewScale', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_takerFee', - type: 'uint256', - }, - ], - name: 'setTakerFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_takerFeeDelayedOrder', - type: 'uint256', - }, - ], - name: 'setTakerFeeDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_takerFeeOffchainDelayedOrder', - type: 'uint256', - }, - ], - name: 'setTakerFeeOffchainDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'skewScale', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'takerFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'takerFeeDelayedOrder', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'takerFeeOffchainDelayedOrder', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "keeperFee", + type: "uint256", + }, + ], + name: "KeeperLiquidationFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bps", + type: "uint256", + }, + ], + name: "LiquidationBufferRatioUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bps", + type: "uint256", + }, + ], + name: "LiquidationFeeRatioUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "sUSD", + type: "uint256", + }, + ], + name: "MaxKeeperFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "minMargin", + type: "uint256", + }, + ], + name: "MinInitialMarginUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "sUSD", + type: "uint256", + }, + ], + name: "MinKeeperFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "parameter", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "ParameterUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "parameter", + type: "bytes32", + }, + { + indexed: false, + internalType: "bytes32", + name: "value", + type: "bytes32", + }, + ], + name: "ParameterUpdatedBytes32", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "delayedOrderConfirmWindow", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "keeperLiquidationFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "liquidationBufferRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidationFeeRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "liquidationPremiumMultiplier", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "makerFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "makerFeeDelayedOrder", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "makerFeeOffchainDelayedOrder", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxDelayTimeDelta", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxFundingVelocity", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "maxKeeperFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxLeverage", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxLiquidationDelta", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxMarketValue", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxPD", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "minDelayTimeDelta", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "minInitialMargin", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "minKeeperFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "nextPriceConfirmWindow", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "offchainDelayedOrderMaxAge", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "offchainDelayedOrderMinAge", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "offchainMarketKey", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "offchainPriceDivergence", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "parameters", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValue", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + { + internalType: "uint256", + name: "nextPriceConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "delayedOrderConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "minDelayTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxDelayTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "offchainDelayedOrderMinAge", + type: "uint256", + }, + { + internalType: "uint256", + name: "offchainDelayedOrderMaxAge", + type: "uint256", + }, + { + internalType: "bytes32", + name: "offchainMarketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "offchainPriceDivergence", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationPremiumMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationBufferRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPD", + type: "uint256", + }, + ], + internalType: "struct IPerpsV2MarketSettings.Parameters", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_delayedOrderConfirmWindow", + type: "uint256", + }, + ], + name: "setDelayedOrderConfirmWindow", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_keeperFee", + type: "uint256", + }, + ], + name: "setKeeperLiquidationFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_ratio", + type: "uint256", + }, + ], + name: "setLiquidationBufferRatio", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_ratio", + type: "uint256", + }, + ], + name: "setLiquidationFeeRatio", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_liquidationPremiumMultiplier", + type: "uint256", + }, + ], + name: "setLiquidationPremiumMultiplier", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_makerFee", + type: "uint256", + }, + ], + name: "setMakerFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_makerFeeDelayedOrder", + type: "uint256", + }, + ], + name: "setMakerFeeDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_makerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + name: "setMakerFeeOffchainDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxDelayTimeDelta", + type: "uint256", + }, + ], + name: "setMaxDelayTimeDelta", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxFundingVelocity", + type: "uint256", + }, + ], + name: "setMaxFundingVelocity", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_sUSD", + type: "uint256", + }, + ], + name: "setMaxKeeperFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxLeverage", + type: "uint256", + }, + ], + name: "setMaxLeverage", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxLiquidationDelta", + type: "uint256", + }, + ], + name: "setMaxLiquidationDelta", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxMarketValue", + type: "uint256", + }, + ], + name: "setMaxMarketValue", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxPD", + type: "uint256", + }, + ], + name: "setMaxPD", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_minDelayTimeDelta", + type: "uint256", + }, + ], + name: "setMinDelayTimeDelta", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_minMargin", + type: "uint256", + }, + ], + name: "setMinInitialMargin", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_sUSD", + type: "uint256", + }, + ], + name: "setMinKeeperFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_nextPriceConfirmWindow", + type: "uint256", + }, + ], + name: "setNextPriceConfirmWindow", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_offchainDelayedOrderMaxAge", + type: "uint256", + }, + ], + name: "setOffchainDelayedOrderMaxAge", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_offchainDelayedOrderMinAge", + type: "uint256", + }, + ], + name: "setOffchainDelayedOrderMinAge", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "_offchainMarketKey", + type: "bytes32", + }, + ], + name: "setOffchainMarketKey", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_offchainPriceDivergence", + type: "uint256", + }, + ], + name: "setOffchainPriceDivergence", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + components: [ + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "makerFeeOffchainDelayedOrder", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLeverage", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxMarketValue", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + { + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + { + internalType: "uint256", + name: "nextPriceConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "delayedOrderConfirmWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "minDelayTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxDelayTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "offchainDelayedOrderMinAge", + type: "uint256", + }, + { + internalType: "uint256", + name: "offchainDelayedOrderMaxAge", + type: "uint256", + }, + { + internalType: "bytes32", + name: "offchainMarketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "offchainPriceDivergence", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationPremiumMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationBufferRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPD", + type: "uint256", + }, + ], + internalType: "struct IPerpsV2MarketSettings.Parameters", + name: "_parameters", + type: "tuple", + }, + ], + name: "setParameters", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_skewScale", + type: "uint256", + }, + ], + name: "setSkewScale", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_takerFee", + type: "uint256", + }, + ], + name: "setTakerFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_takerFeeDelayedOrder", + type: "uint256", + }, + ], + name: "setTakerFeeDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_takerFeeOffchainDelayedOrder", + type: "uint256", + }, + ], + name: "setTakerFeeOffchainDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "skewScale", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "takerFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "takerFeeDelayedOrder", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "takerFeeOffchainDelayedOrder", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class PerpsV2MarketSettings__factory { - static readonly abi = _abi - static createInterface(): PerpsV2MarketSettingsInterface { - return new utils.Interface(_abi) as PerpsV2MarketSettingsInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): PerpsV2MarketSettings { - return new Contract(address, _abi, signerOrProvider) as PerpsV2MarketSettings - } + static readonly abi = _abi; + static createInterface(): PerpsV2MarketSettingsInterface { + return new utils.Interface(_abi) as PerpsV2MarketSettingsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PerpsV2MarketSettings { + return new Contract( + address, + _abi, + signerOrProvider + ) as PerpsV2MarketSettings; + } } diff --git a/packages/sdk/src/contracts/types/factories/PerpsV2MarketViews__factory.ts b/packages/sdk/src/contracts/types/factories/PerpsV2MarketViews__factory.ts index 7941d38dd3..e4e9388878 100644 --- a/packages/sdk/src/contracts/types/factories/PerpsV2MarketViews__factory.ts +++ b/packages/sdk/src/contracts/types/factories/PerpsV2MarketViews__factory.ts @@ -2,800 +2,806 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { PerpsV2MarketViews, PerpsV2MarketViewsInterface } from '../PerpsV2MarketViews' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + PerpsV2MarketViews, + PerpsV2MarketViewsInterface, +} from "../PerpsV2MarketViews"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_marketState', - type: 'address', - }, - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'accessibleMargin', - outputs: [ - { - internalType: 'uint256', - name: 'marginAccessible', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'accruedFunding', - outputs: [ - { - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'assetPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'baseAsset', - outputs: [ - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'canLiquidate', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'currentFundingRate', - outputs: [ - { - internalType: 'int256', - name: '', - type: 'int256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'currentFundingVelocity', - outputs: [ - { - internalType: 'int256', - name: '', - type: 'int256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - ], - name: 'fillPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'fundingLastRecomputed', - outputs: [ - { - internalType: 'uint32', - name: '', - type: 'uint32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'fundingSequence', - outputs: [ - { - internalType: 'int128', - name: '', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'fundingSequenceLength', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidationFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidationPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketDebt', - outputs: [ - { - internalType: 'uint256', - name: 'debt', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketKey', - outputs: [ - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSize', - outputs: [ - { - internalType: 'uint128', - name: '', - type: 'uint128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSizes', - outputs: [ - { - internalType: 'uint256', - name: 'long', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'short', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSkew', - outputs: [ - { - internalType: 'int128', - name: '', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketState', - outputs: [ - { - internalType: 'contract IPerpsV2MarketState', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'notionalValue', - outputs: [ - { - internalType: 'int256', - name: 'value', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'enum IPerpsV2MarketBaseTypes.OrderType', - name: 'orderType', - type: 'uint8', - }, - ], - name: 'orderFee', - outputs: [ - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'positions', - outputs: [ - { - components: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - internalType: 'struct IPerpsV2MarketBaseTypes.Position', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'tradePrice', - type: 'uint256', - }, - { - internalType: 'enum IPerpsV2MarketBaseTypes.OrderType', - name: 'orderType', - type: 'uint8', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'postTradeDetails', - outputs: [ - { - internalType: 'uint256', - name: 'margin', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'size', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liqPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'enum IPerpsV2MarketBaseTypes.Status', - name: 'status', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'profitLoss', - outputs: [ - { - internalType: 'int256', - name: 'pnl', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'remainingMargin', - outputs: [ - { - internalType: 'uint256', - name: 'marginRemaining', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'unrecordedFunding', - outputs: [ - { - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_marketState", + type: "address", + }, + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "accessibleMargin", + outputs: [ + { + internalType: "uint256", + name: "marginAccessible", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "accruedFunding", + outputs: [ + { + internalType: "int256", + name: "funding", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "assetPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "baseAsset", + outputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "canLiquidate", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "currentFundingRate", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "currentFundingVelocity", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + ], + name: "fillPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "fundingLastRecomputed", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "fundingSequence", + outputs: [ + { + internalType: "int128", + name: "", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "fundingSequenceLength", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidationFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidationPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketDebt", + outputs: [ + { + internalType: "uint256", + name: "debt", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketKey", + outputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSize", + outputs: [ + { + internalType: "uint128", + name: "", + type: "uint128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSizes", + outputs: [ + { + internalType: "uint256", + name: "long", + type: "uint256", + }, + { + internalType: "uint256", + name: "short", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSkew", + outputs: [ + { + internalType: "int128", + name: "", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketState", + outputs: [ + { + internalType: "contract IPerpsV2MarketState", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "notionalValue", + outputs: [ + { + internalType: "int256", + name: "value", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "enum IPerpsV2MarketBaseTypes.OrderType", + name: "orderType", + type: "uint8", + }, + ], + name: "orderFee", + outputs: [ + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "positions", + outputs: [ + { + components: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + internalType: "struct IPerpsV2MarketBaseTypes.Position", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "tradePrice", + type: "uint256", + }, + { + internalType: "enum IPerpsV2MarketBaseTypes.OrderType", + name: "orderType", + type: "uint8", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "postTradeDetails", + outputs: [ + { + internalType: "uint256", + name: "margin", + type: "uint256", + }, + { + internalType: "int256", + name: "size", + type: "int256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "liqPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "enum IPerpsV2MarketBaseTypes.Status", + name: "status", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "profitLoss", + outputs: [ + { + internalType: "int256", + name: "pnl", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "remainingMargin", + outputs: [ + { + internalType: "uint256", + name: "marginRemaining", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "unrecordedFunding", + outputs: [ + { + internalType: "int256", + name: "funding", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class PerpsV2MarketViews__factory { - static readonly abi = _abi - static createInterface(): PerpsV2MarketViewsInterface { - return new utils.Interface(_abi) as PerpsV2MarketViewsInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): PerpsV2MarketViews { - return new Contract(address, _abi, signerOrProvider) as PerpsV2MarketViews - } + static readonly abi = _abi; + static createInterface(): PerpsV2MarketViewsInterface { + return new utils.Interface(_abi) as PerpsV2MarketViewsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PerpsV2MarketViews { + return new Contract(address, _abi, signerOrProvider) as PerpsV2MarketViews; + } } diff --git a/packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts b/packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts index 1c026889a7..c1c7d09c76 100644 --- a/packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts +++ b/packages/sdk/src/contracts/types/factories/PerpsV2Market__factory.ts @@ -2,1432 +2,1435 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { PerpsV2Market, PerpsV2MarketInterface } from '../PerpsV2Market' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { PerpsV2Market, PerpsV2MarketInterface } from "../PerpsV2Market"; const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bool', - name: 'isOffchain', - type: 'bool', - }, - { - indexed: false, - internalType: 'uint256', - name: 'currentRoundId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'targetRoundId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'commitDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'keeperDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'DelayedOrderRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bool', - name: 'isOffchain', - type: 'bool', - }, - { - indexed: false, - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'targetRoundId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'intentionTime', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'executableAtTime', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'commitDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'keeperDeposit', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'DelayedOrderSubmitted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - indexed: false, - internalType: 'int256', - name: 'fundingRate', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'timestamp', - type: 'uint256', - }, - ], - name: 'FundingRecomputed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'int256', - name: 'marginDelta', - type: 'int256', - }, - ], - name: 'MarginTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'baseAsset', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'PerpsTracking', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'id', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'flagger', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'timestamp', - type: 'uint256', - }, - ], - name: 'PositionFlagged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'id', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'liquidator', - type: 'address', - }, - { - indexed: false, - internalType: 'int256', - name: 'size', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'flaggerFee', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'liquidatorFee', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'stakersFee', - type: 'uint256', - }, - ], - name: 'PositionLiquidated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'id', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'margin', - type: 'uint256', - }, - { - indexed: false, - internalType: 'int256', - name: 'size', - type: 'int256', - }, - { - indexed: false, - internalType: 'int256', - name: 'tradeSize', - type: 'int256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'lastPrice', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fundingIndex', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - indexed: false, - internalType: 'int256', - name: 'skew', - type: 'int256', - }, - ], - name: 'PositionModified', - type: 'event', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'accessibleMargin', - outputs: [ - { - internalType: 'uint256', - name: 'marginAccessible', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'accruedFunding', - outputs: [ - { - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'assetPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'baseAsset', - outputs: [ - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'canLiquidate', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'cancelDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'cancelOffchainDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - ], - name: 'closePosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'closePositionWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'currentFundingRate', - outputs: [ - { - internalType: 'int256', - name: 'fundingRate', - type: 'int256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'currentFundingVelocity', - outputs: [ - { - internalType: 'int256', - name: 'fundingVelocity', - type: 'int256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'delayedOrders', - outputs: [ - { - components: [ - { - internalType: 'bool', - name: 'isOffchain', - type: 'bool', - }, - { - internalType: 'int128', - name: 'sizeDelta', - type: 'int128', - }, - { - internalType: 'uint128', - name: 'desiredFillPrice', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'targetRoundId', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'commitDeposit', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'keeperDeposit', - type: 'uint128', - }, - { - internalType: 'uint256', - name: 'executableAtTime', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'intentionTime', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - internalType: 'struct IPerpsV2MarketConsolidated.DelayedOrder', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'executeDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes[]', - name: 'priceUpdateData', - type: 'bytes[]', - }, - ], - name: 'executeOffchainDelayedOrder', - outputs: [], - payable: true, - stateMutability: 'payable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - ], - name: 'fillPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'flagPosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'forceLiquidatePosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'fundingLastRecomputed', - outputs: [ - { - internalType: 'uint32', - name: 'timestamp', - type: 'uint32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'fundingRateLastRecomputed', - outputs: [ - { - internalType: 'int128', - name: 'fundingRate', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'fundingSequence', - outputs: [ - { - internalType: 'int128', - name: 'netFunding', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'fundingSequenceLength', - outputs: [ - { - internalType: 'uint256', - name: 'length', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'isFlagged', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidatePosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidationFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidationPrice', - outputs: [ - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketDebt', - outputs: [ - { - internalType: 'uint256', - name: 'debt', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isInvalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketKey', - outputs: [ - { - internalType: 'bytes32', - name: 'key', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSize', - outputs: [ - { - internalType: 'uint128', - name: 'size', - type: 'uint128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSizes', - outputs: [ - { - internalType: 'uint256', - name: 'long', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'short', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'marketSkew', - outputs: [ - { - internalType: 'int128', - name: 'skew', - type: 'int128', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - ], - name: 'modifyPosition', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'modifyPositionWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'notionalValue', - outputs: [ - { - internalType: 'int256', - name: 'value', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'enum IPerpsV2MarketBaseTypes.OrderType', - name: 'orderType', - type: 'uint8', - }, - ], - name: 'orderFee', - outputs: [ - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'positions', - outputs: [ - { - components: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - internalType: 'struct IPerpsV2MarketConsolidated.Position', - name: '', - type: 'tuple', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'tradePrice', - type: 'uint256', - }, - { - internalType: 'enum IPerpsV2MarketBaseTypes.OrderType', - name: 'orderType', - type: 'uint8', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'postTradeDetails', - outputs: [ - { - internalType: 'uint256', - name: 'margin', - type: 'uint256', - }, - { - internalType: 'int256', - name: 'size', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'liqPrice', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'enum IPerpsV2MarketConsolidated.Status', - name: 'status', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'profitLoss', - outputs: [ - { - internalType: 'int256', - name: 'pnl', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'recomputeFunding', - outputs: [ - { - internalType: 'uint256', - name: 'lastIndex', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'remainingMargin', - outputs: [ - { - internalType: 'uint256', - name: 'marginRemaining', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'desiredTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'submitCloseDelayedOrderWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'submitCloseOffchainDelayedOrderWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'desiredTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - ], - name: 'submitDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'desiredTimeDelta', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'submitDelayedOrderWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - ], - name: 'submitOffchainDelayedOrder', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'submitOffchainDelayedOrderWithTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'int256', - name: 'marginDelta', - type: 'int256', - }, - ], - name: 'transferMargin', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'unrecordedFunding', - outputs: [ - { - internalType: 'int256', - name: 'funding', - type: 'int256', - }, - { - internalType: 'bool', - name: 'invalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'withdrawAllMargin', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "isOffchain", + type: "bool", + }, + { + indexed: false, + internalType: "uint256", + name: "currentRoundId", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "targetRoundId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "commitDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "keeperDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "DelayedOrderRemoved", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "isOffchain", + type: "bool", + }, + { + indexed: false, + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "targetRoundId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "intentionTime", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "executableAtTime", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "commitDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "keeperDeposit", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "DelayedOrderSubmitted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "int256", + name: "funding", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "fundingRate", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "timestamp", + type: "uint256", + }, + ], + name: "FundingRecomputed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "marginDelta", + type: "int256", + }, + ], + name: "MarginTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + indexed: false, + internalType: "bytes32", + name: "baseAsset", + type: "bytes32", + }, + { + indexed: false, + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "PerpsTracking", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "flagger", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "timestamp", + type: "uint256", + }, + ], + name: "PositionFlagged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "liquidator", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "size", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "flaggerFee", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "liquidatorFee", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "stakersFee", + type: "uint256", + }, + ], + name: "PositionLiquidated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "margin", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "size", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "tradeSize", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "lastPrice", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fundingIndex", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "skew", + type: "int256", + }, + ], + name: "PositionModified", + type: "event", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "accessibleMargin", + outputs: [ + { + internalType: "uint256", + name: "marginAccessible", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "accruedFunding", + outputs: [ + { + internalType: "int256", + name: "funding", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "assetPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "baseAsset", + outputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "canLiquidate", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "cancelDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "cancelOffchainDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + ], + name: "closePosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "closePositionWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "currentFundingRate", + outputs: [ + { + internalType: "int256", + name: "fundingRate", + type: "int256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "currentFundingVelocity", + outputs: [ + { + internalType: "int256", + name: "fundingVelocity", + type: "int256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "delayedOrders", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "isOffchain", + type: "bool", + }, + { + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + internalType: "uint128", + name: "desiredFillPrice", + type: "uint128", + }, + { + internalType: "uint128", + name: "targetRoundId", + type: "uint128", + }, + { + internalType: "uint128", + name: "commitDeposit", + type: "uint128", + }, + { + internalType: "uint128", + name: "keeperDeposit", + type: "uint128", + }, + { + internalType: "uint256", + name: "executableAtTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "intentionTime", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + internalType: "struct IPerpsV2MarketConsolidated.DelayedOrder", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "executeDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes[]", + name: "priceUpdateData", + type: "bytes[]", + }, + ], + name: "executeOffchainDelayedOrder", + outputs: [], + payable: true, + stateMutability: "payable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + ], + name: "fillPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "flagPosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "forceLiquidatePosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "fundingLastRecomputed", + outputs: [ + { + internalType: "uint32", + name: "timestamp", + type: "uint32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "fundingRateLastRecomputed", + outputs: [ + { + internalType: "int128", + name: "fundingRate", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "fundingSequence", + outputs: [ + { + internalType: "int128", + name: "netFunding", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "fundingSequenceLength", + outputs: [ + { + internalType: "uint256", + name: "length", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "isFlagged", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidatePosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidationFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidationPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketDebt", + outputs: [ + { + internalType: "uint256", + name: "debt", + type: "uint256", + }, + { + internalType: "bool", + name: "isInvalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketKey", + outputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSize", + outputs: [ + { + internalType: "uint128", + name: "size", + type: "uint128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSizes", + outputs: [ + { + internalType: "uint256", + name: "long", + type: "uint256", + }, + { + internalType: "uint256", + name: "short", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "marketSkew", + outputs: [ + { + internalType: "int128", + name: "skew", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + ], + name: "modifyPosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "modifyPositionWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "notionalValue", + outputs: [ + { + internalType: "int256", + name: "value", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "enum IPerpsV2MarketBaseTypes.OrderType", + name: "orderType", + type: "uint8", + }, + ], + name: "orderFee", + outputs: [ + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "positions", + outputs: [ + { + components: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + internalType: "struct IPerpsV2MarketConsolidated.Position", + name: "", + type: "tuple", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "tradePrice", + type: "uint256", + }, + { + internalType: "enum IPerpsV2MarketBaseTypes.OrderType", + name: "orderType", + type: "uint8", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "postTradeDetails", + outputs: [ + { + internalType: "uint256", + name: "margin", + type: "uint256", + }, + { + internalType: "int256", + name: "size", + type: "int256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "liqPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "enum IPerpsV2MarketConsolidated.Status", + name: "status", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "profitLoss", + outputs: [ + { + internalType: "int256", + name: "pnl", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "recomputeFunding", + outputs: [ + { + internalType: "uint256", + name: "lastIndex", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "remainingMargin", + outputs: [ + { + internalType: "uint256", + name: "marginRemaining", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "desiredTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "submitCloseDelayedOrderWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "submitCloseOffchainDelayedOrderWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "desiredTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + ], + name: "submitDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "desiredTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "submitDelayedOrderWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + ], + name: "submitOffchainDelayedOrder", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "submitOffchainDelayedOrderWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "int256", + name: "marginDelta", + type: "int256", + }, + ], + name: "transferMargin", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "unrecordedFunding", + outputs: [ + { + internalType: "int256", + name: "funding", + type: "int256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "withdrawAllMargin", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class PerpsV2Market__factory { - static readonly abi = _abi - static createInterface(): PerpsV2MarketInterface { - return new utils.Interface(_abi) as PerpsV2MarketInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): PerpsV2Market { - return new Contract(address, _abi, signerOrProvider) as PerpsV2Market - } + static readonly abi = _abi; + static createInterface(): PerpsV2MarketInterface { + return new utils.Interface(_abi) as PerpsV2MarketInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PerpsV2Market { + return new Contract(address, _abi, signerOrProvider) as PerpsV2Market; + } } diff --git a/packages/sdk/src/contracts/types/factories/PerpsV3AccountProxy__factory.ts b/packages/sdk/src/contracts/types/factories/PerpsV3AccountProxy__factory.ts new file mode 100644 index 0000000000..b70c233484 --- /dev/null +++ b/packages/sdk/src/contracts/types/factories/PerpsV3AccountProxy__factory.ts @@ -0,0 +1,832 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + PerpsV3AccountProxy, + PerpsV3AccountProxyInterface, +} from "../PerpsV3AccountProxy"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ImplementationIsSterile", + type: "error", + }, + { + inputs: [], + name: "NoChange", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "contr", + type: "address", + }, + ], + name: "NotAContract", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "NotNominated", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [], + name: "UpgradeSimulationFailed", + type: "error", + }, + { + inputs: [], + name: "ZeroAddress", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "self", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "getImplementation", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newNominatedOwner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "renounceNomination", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + ], + name: "simulateUpgradeTo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + ], + name: "upgradeTo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "AlreadyInitialized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "CannotSelfApprove", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "requestedIndex", + type: "uint256", + }, + { + internalType: "uint256", + name: "length", + type: "uint256", + }, + ], + name: "IndexOverrun", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "InvalidOwner", + type: "error", + }, + { + inputs: [ + { + internalType: "string", + name: "parameter", + type: "string", + }, + { + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "InvalidParameter", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "InvalidTransferRecipient", + type: "error", + }, + { + inputs: [], + name: "OverflowUint256ToUint128", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "TokenAlreadyMinted", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "TokenDoesNotExist", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "holder", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "burn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "tokenName", + type: "string", + }, + { + internalType: "string", + name: "tokenSymbol", + type: "string", + }, + { + internalType: "string", + name: "uri", + type: "string", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "holder", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isInitialized", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeMint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "setAllowance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "uri", + type: "string", + }, + ], + name: "setBaseTokenURI", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "tokenURI", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class PerpsV3AccountProxy__factory { + static readonly abi = _abi; + static createInterface(): PerpsV3AccountProxyInterface { + return new utils.Interface(_abi) as PerpsV3AccountProxyInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PerpsV3AccountProxy { + return new Contract(address, _abi, signerOrProvider) as PerpsV3AccountProxy; + } +} diff --git a/packages/sdk/src/contracts/types/factories/PerpsV3MarketProxy__factory.ts b/packages/sdk/src/contracts/types/factories/PerpsV3MarketProxy__factory.ts new file mode 100644 index 0000000000..efc30739d6 --- /dev/null +++ b/packages/sdk/src/contracts/types/factories/PerpsV3MarketProxy__factory.ts @@ -0,0 +1,3589 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + PerpsV3MarketProxy, + PerpsV3MarketProxyInterface, +} from "../PerpsV3MarketProxy"; + +const _abi = [ + { + inputs: [ + { + internalType: "bytes32", + name: "which", + type: "bytes32", + }, + ], + name: "FeatureUnavailable", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "InvalidAccountId", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + ], + name: "InvalidPermission", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "origin", + type: "address", + }, + ], + name: "OnlyAccountTokenProxy", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + internalType: "address", + name: "target", + type: "address", + }, + ], + name: "PermissionDenied", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "PermissionNotGranted", + type: "error", + }, + { + inputs: [], + name: "PositionOutOfBounds", + type: "error", + }, + { + inputs: [], + name: "ValueAlreadyInSet", + type: "error", + }, + { + inputs: [], + name: "ValueNotInSet", + type: "error", + }, + { + inputs: [], + name: "ZeroAddress", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "AccountCreated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: true, + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "PermissionGranted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: true, + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "PermissionRevoked", + type: "event", + }, + { + inputs: [], + name: "createAccount", + outputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "requestedAccountId", + type: "uint128", + }, + ], + name: "createAccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "getAccountLastInteraction", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "getAccountOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "getAccountPermissions", + outputs: [ + { + components: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "bytes32[]", + name: "permissions", + type: "bytes32[]", + }, + ], + internalType: "struct IAccountModule.AccountPermissions[]", + name: "accountPerms", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAccountTokenAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "grantPermission", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "hasPermission", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "isAuthorized", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "notifyAccountTransfer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + ], + name: "renouncePermission", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "permission", + type: "bytes32", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "revokePermission", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "MismatchAssociatedSystemKind", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "MissingAssociatedSystem", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "kind", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "proxy", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "impl", + type: "address", + }, + ], + name: "AssociatedSystemSet", + type: "event", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "getAssociatedSystem", + outputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + { + internalType: "bytes32", + name: "kind", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "symbol", + type: "string", + }, + { + internalType: "string", + name: "uri", + type: "string", + }, + { + internalType: "address", + name: "impl", + type: "address", + }, + ], + name: "initOrUpgradeNft", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "symbol", + type: "string", + }, + { + internalType: "uint8", + name: "decimals", + type: "uint8", + }, + { + internalType: "address", + name: "impl", + type: "address", + }, + ], + name: "initOrUpgradeToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + internalType: "address", + name: "endpoint", + type: "address", + }, + ], + name: "registerUnmanagedSystem", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ImplementationIsSterile", + type: "error", + }, + { + inputs: [], + name: "NoChange", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "contr", + type: "address", + }, + ], + name: "NotAContract", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "NotNominated", + type: "error", + }, + { + inputs: [], + name: "UpgradeSimulationFailed", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "self", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "getImplementation", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newNominatedOwner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "renounceNomination", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + ], + name: "simulateUpgradeTo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + ], + name: "upgradeTo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "InvalidMarket", + type: "error", + }, + { + inputs: [ + { + internalType: "string", + name: "parameter", + type: "string", + }, + { + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "InvalidParameter", + type: "error", + }, + { + inputs: [], + name: "OverflowInt256ToUint256", + type: "error", + }, + { + inputs: [], + name: "OverflowUint256ToInt256", + type: "error", + }, + { + inputs: [], + name: "OverflowUint256ToUint128", + type: "error", + }, + { + inputs: [], + name: "PerpsMarketNotInitialized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint128", + name: "globalPerpsMarketId", + type: "uint128", + }, + ], + name: "FactoryInitialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "perpsMarketId", + type: "uint128", + }, + { + indexed: false, + internalType: "string", + name: "marketName", + type: "string", + }, + { + indexed: false, + internalType: "string", + name: "marketSymbol", + type: "string", + }, + ], + name: "MarketCreated", + type: "event", + }, + { + inputs: [ + { + internalType: "uint128", + name: "requestedMarketId", + type: "uint128", + }, + { + internalType: "string", + name: "marketName", + type: "string", + }, + { + internalType: "string", + name: "marketSymbol", + type: "string", + }, + ], + name: "createMarket", + outputs: [ + { + internalType: "uint128", + name: "", + type: "uint128", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "initializeFactory", + outputs: [ + { + internalType: "uint128", + name: "", + type: "uint128", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "perpsMarketId", + type: "uint128", + }, + ], + name: "minimumCredit", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "perpsMarketId", + type: "uint128", + }, + ], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "perpsMarketId", + type: "uint128", + }, + ], + name: "reportedDebt", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract ISpotMarketSystem", + name: "spotMarket", + type: "address", + }, + ], + name: "setSpotMarket", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract ISynthetixSystem", + name: "synthetix", + type: "address", + }, + ], + name: "setSynthetix", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "AccountLiquidatable", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "AccountNotFound", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "collateralAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "withdrawAmount", + type: "uint256", + }, + ], + name: "InsufficientCollateral", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "available", + type: "uint256", + }, + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + ], + name: "InsufficientCollateralAvailableForWithdraw", + type: "error", + }, + { + inputs: [ + { + internalType: "int256", + name: "amountDelta", + type: "int256", + }, + ], + name: "InvalidAmountDelta", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "maxAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "collateralAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "depositAmount", + type: "uint256", + }, + ], + name: "MaxCollateralExceeded", + type: "error", + }, + { + inputs: [], + name: "OverflowUint128ToInt128", + type: "error", + }, + { + inputs: [], + name: "PendingOrderExists", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "PriceFeedNotSet", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + ], + name: "SynthNotEnabledForCollateral", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: true, + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + { + indexed: false, + internalType: "int256", + name: "amountDelta", + type: "int256", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "CollateralModified", + type: "event", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "getAvailableMargin", + outputs: [ + { + internalType: "int256", + name: "availableMargin", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + ], + name: "getCollateralAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "getOpenPosition", + outputs: [ + { + internalType: "int256", + name: "totalPnl", + type: "int256", + }, + { + internalType: "int256", + name: "accruedFunding", + type: "int256", + }, + { + internalType: "int128", + name: "positionSize", + type: "int128", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "getRequiredMargins", + outputs: [ + { + internalType: "uint256", + name: "requiredInitialMargin", + type: "uint256", + }, + { + internalType: "uint256", + name: "requiredMaintenanceMargin", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "getWithdrawableMargin", + outputs: [ + { + internalType: "int256", + name: "withdrawableMargin", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + { + internalType: "int256", + name: "amountDelta", + type: "int256", + }, + ], + name: "modifyCollateral", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "totalAccountOpenInterest", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "totalCollateralValue", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "currentFundingRate", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "currentFundingVelocity", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "int128", + name: "orderSize", + type: "int128", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + ], + name: "fillPrice", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "getMarketSummary", + outputs: [ + { + components: [ + { + internalType: "int256", + name: "skew", + type: "int256", + }, + { + internalType: "uint256", + name: "size", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxOpenInterest", + type: "uint256", + }, + { + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + internalType: "int256", + name: "currentFundingVelocity", + type: "int256", + }, + { + internalType: "uint256", + name: "indexPrice", + type: "uint256", + }, + ], + internalType: "struct IPerpsMarketModule.MarketSummary", + name: "summary", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "indexPrice", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "maxOpenInterest", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "metadata", + outputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "symbol", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "size", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "skew", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "fillPrice", + type: "uint256", + }, + ], + name: "AcceptablePriceExceeded", + type: "error", + }, + { + inputs: [ + { + internalType: "int256", + name: "availableMargin", + type: "int256", + }, + { + internalType: "uint256", + name: "minMargin", + type: "uint256", + }, + ], + name: "InsufficientMargin", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "settlementStrategyId", + type: "uint128", + }, + ], + name: "InvalidSettlementStrategy", + type: "error", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "maxMarketSize", + type: "uint256", + }, + { + internalType: "int256", + name: "newSideSize", + type: "int256", + }, + ], + name: "MaxOpenInterestReached", + type: "error", + }, + { + inputs: [], + name: "OverflowInt256ToInt128", + type: "error", + }, + { + inputs: [], + name: "ZeroSizeOrder", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: false, + internalType: "enum SettlementStrategy.Type", + name: "orderType", + type: "uint8", + }, + { + indexed: false, + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + indexed: false, + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "settlementTime", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "expirationTime", + type: "uint256", + }, + { + indexed: true, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "OrderCommitted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + internalType: "uint128", + name: "settlementStrategyId", + type: "uint128", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + internalType: "address", + name: "referrer", + type: "address", + }, + ], + internalType: "struct AsyncOrder.OrderCommitmentRequest", + name: "commitment", + type: "tuple", + }, + ], + name: "commitOrder", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "settlementTime", + type: "uint256", + }, + { + components: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + internalType: "uint128", + name: "settlementStrategyId", + type: "uint128", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + internalType: "address", + name: "referrer", + type: "address", + }, + ], + internalType: "struct AsyncOrder.OrderCommitmentRequest", + name: "request", + type: "tuple", + }, + ], + internalType: "struct AsyncOrder.Data", + name: "retOrder", + type: "tuple", + }, + { + internalType: "uint256", + name: "fees", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + ], + name: "computeOrderFees", + outputs: [ + { + internalType: "uint256", + name: "orderFees", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "getOrder", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "settlementTime", + type: "uint256", + }, + { + components: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + internalType: "uint128", + name: "settlementStrategyId", + type: "uint128", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + internalType: "address", + name: "referrer", + type: "address", + }, + ], + internalType: "struct AsyncOrder.OrderCommitmentRequest", + name: "request", + type: "tuple", + }, + ], + internalType: "struct AsyncOrder.Data", + name: "order", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "leftover", + type: "uint256", + }, + ], + name: "InsufficientMarginError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "string[]", + name: "urls", + type: "string[]", + }, + { + internalType: "bytes", + name: "callData", + type: "bytes", + }, + { + internalType: "bytes4", + name: "callbackFunction", + type: "bytes4", + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes", + }, + ], + name: "OffchainLookup", + type: "error", + }, + { + inputs: [], + name: "OrderNotValid", + type: "error", + }, + { + inputs: [], + name: "OverflowUint256ToUint64", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "deviation", + type: "uint256", + }, + { + internalType: "uint256", + name: "tolerance", + type: "uint256", + }, + ], + name: "PriceDeviationToleranceExceeded", + type: "error", + }, + { + inputs: [ + { + internalType: "enum SettlementStrategy.Type", + name: "strategyType", + type: "uint8", + }, + ], + name: "SettlementStrategyNotFound", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "timestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "settlementTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "settlementExpiration", + type: "uint256", + }, + ], + name: "SettlementWindowExpired", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "timestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "settlementTime", + type: "uint256", + }, + ], + name: "SettlementWindowNotOpen", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "skew", + type: "int256", + }, + { + indexed: false, + internalType: "uint256", + name: "size", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "currentFundingRate", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "currentFundingVelocity", + type: "int256", + }, + ], + name: "MarketUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "fillPrice", + type: "uint256", + }, + { + indexed: false, + internalType: "int256", + name: "pnl", + type: "int256", + }, + { + indexed: false, + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + indexed: false, + internalType: "int128", + name: "newSize", + type: "int128", + }, + { + indexed: false, + internalType: "uint256", + name: "totalFees", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "referralFees", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "collectedFees", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "settlementReward", + type: "uint256", + }, + { + indexed: true, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "settler", + type: "address", + }, + ], + name: "OrderSettled", + type: "event", + }, + { + inputs: [], + name: "PRECISION", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "settle", + outputs: [], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "result", + type: "bytes", + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes", + }, + ], + name: "settlePythOrder", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + indexed: false, + internalType: "bool", + name: "allowAll", + type: "bool", + }, + ], + name: "FeatureFlagAllowAllSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "FeatureFlagAllowlistAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "FeatureFlagAllowlistRemoved", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + indexed: false, + internalType: "address[]", + name: "deniers", + type: "address[]", + }, + ], + name: "FeatureFlagDeniersReset", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + indexed: false, + internalType: "bool", + name: "denyAll", + type: "bool", + }, + ], + name: "FeatureFlagDenyAllSet", + type: "event", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "addToFeatureFlagAllowlist", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + ], + name: "getDeniers", + outputs: [ + { + internalType: "address[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + ], + name: "getFeatureFlagAllowAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + ], + name: "getFeatureFlagAllowlist", + outputs: [ + { + internalType: "address[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + ], + name: "getFeatureFlagDenyAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "isFeatureAllowed", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "removeFromFeatureFlagAllowlist", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + internalType: "address[]", + name: "deniers", + type: "address[]", + }, + ], + name: "setDeniers", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + internalType: "bool", + name: "allowAll", + type: "bool", + }, + ], + name: "setFeatureFlagAllowAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "feature", + type: "bytes32", + }, + { + internalType: "bool", + name: "denyAll", + type: "bool", + }, + ], + name: "setFeatureFlagDenyAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "NotEligibleForLiquidation", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "reward", + type: "uint256", + }, + { + indexed: false, + internalType: "bool", + name: "fullLiquidation", + type: "bool", + }, + ], + name: "AccountLiquidated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "amountLiquidated", + type: "uint256", + }, + { + indexed: false, + internalType: "int128", + name: "currentPositionSize", + type: "int128", + }, + ], + name: "PositionLiquidated", + type: "event", + }, + { + inputs: [ + { + internalType: "uint128", + name: "accountId", + type: "uint128", + }, + ], + name: "liquidate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "liquidateFlagged", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + ], + name: "FundingParametersSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "initialMarginRatioD18", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "maintenanceMarginRatioD18", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "liquidationRewardRatioD18", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "maxLiquidationLimitAccumulationMultiplier", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "maxSecondsInLiquidationWindow", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "minimumPositionMargin", + type: "uint256", + }, + ], + name: "LiquidationParametersSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "lockedOiRatioD18", + type: "uint256", + }, + ], + name: "LockedOiRatioSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "bytes32", + name: "feedId", + type: "bytes32", + }, + ], + name: "MarketPriceDataUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "maxMarketSize", + type: "uint256", + }, + ], + name: "MaxMarketSizeSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "makerFeeRatio", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "takerFeeRatio", + type: "uint256", + }, + ], + name: "OrderFeesSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + components: [ + { + internalType: "enum SettlementStrategy.Type", + name: "strategyType", + type: "uint8", + }, + { + internalType: "uint256", + name: "settlementDelay", + type: "uint256", + }, + { + internalType: "uint256", + name: "settlementWindowDuration", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceWindowDuration", + type: "uint256", + }, + { + internalType: "address", + name: "priceVerificationContract", + type: "address", + }, + { + internalType: "bytes32", + name: "feedId", + type: "bytes32", + }, + { + internalType: "string", + name: "url", + type: "string", + }, + { + internalType: "uint256", + name: "settlementReward", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeviationTolerance", + type: "uint256", + }, + { + internalType: "bool", + name: "disabled", + type: "bool", + }, + ], + indexed: false, + internalType: "struct SettlementStrategy.Data", + name: "strategy", + type: "tuple", + }, + { + indexed: true, + internalType: "uint256", + name: "strategyId", + type: "uint256", + }, + ], + name: "SettlementStrategyAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "strategyId", + type: "uint256", + }, + { + indexed: false, + internalType: "bool", + name: "enabled", + type: "bool", + }, + ], + name: "SettlementStrategyEnabled", + type: "event", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + components: [ + { + internalType: "enum SettlementStrategy.Type", + name: "strategyType", + type: "uint8", + }, + { + internalType: "uint256", + name: "settlementDelay", + type: "uint256", + }, + { + internalType: "uint256", + name: "settlementWindowDuration", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceWindowDuration", + type: "uint256", + }, + { + internalType: "address", + name: "priceVerificationContract", + type: "address", + }, + { + internalType: "bytes32", + name: "feedId", + type: "bytes32", + }, + { + internalType: "string", + name: "url", + type: "string", + }, + { + internalType: "uint256", + name: "settlementReward", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeviationTolerance", + type: "uint256", + }, + { + internalType: "bool", + name: "disabled", + type: "bool", + }, + ], + internalType: "struct SettlementStrategy.Data", + name: "strategy", + type: "tuple", + }, + ], + name: "addSettlementStrategy", + outputs: [ + { + internalType: "uint256", + name: "strategyId", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "getFundingParameters", + outputs: [ + { + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "getLiquidationParameters", + outputs: [ + { + internalType: "uint256", + name: "initialMarginRatioD18", + type: "uint256", + }, + { + internalType: "uint256", + name: "maintenanceMarginRatioD18", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationRewardRatioD18", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationLimitAccumulationMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxSecondsInLiquidationWindow", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "getLockedOiRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "getMaxMarketSize", + outputs: [ + { + internalType: "uint256", + name: "maxMarketSize", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + ], + name: "getOrderFees", + outputs: [ + { + internalType: "uint256", + name: "makerFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFee", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "strategyId", + type: "uint256", + }, + ], + name: "getSettlementStrategy", + outputs: [ + { + components: [ + { + internalType: "enum SettlementStrategy.Type", + name: "strategyType", + type: "uint8", + }, + { + internalType: "uint256", + name: "settlementDelay", + type: "uint256", + }, + { + internalType: "uint256", + name: "settlementWindowDuration", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceWindowDuration", + type: "uint256", + }, + { + internalType: "address", + name: "priceVerificationContract", + type: "address", + }, + { + internalType: "bytes32", + name: "feedId", + type: "bytes32", + }, + { + internalType: "string", + name: "url", + type: "string", + }, + { + internalType: "uint256", + name: "settlementReward", + type: "uint256", + }, + { + internalType: "uint256", + name: "priceDeviationTolerance", + type: "uint256", + }, + { + internalType: "bool", + name: "disabled", + type: "bool", + }, + ], + internalType: "struct SettlementStrategy.Data", + name: "settlementStrategy", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "skewScale", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFundingVelocity", + type: "uint256", + }, + ], + name: "setFundingParameters", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "initialMarginRatioD18", + type: "uint256", + }, + { + internalType: "uint256", + name: "maintenanceMarginRatioD18", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationRewardRatioD18", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationLimitAccumulationMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxSecondsInLiquidationWindow", + type: "uint256", + }, + { + internalType: "uint256", + name: "minimumPositionMargin", + type: "uint256", + }, + ], + name: "setLiquidationParameters", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "lockedOiRatioD18", + type: "uint256", + }, + ], + name: "setLockedOiRatio", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "maxMarketSize", + type: "uint256", + }, + ], + name: "setMaxMarketSize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "makerFeeRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "takerFeeRatio", + type: "uint256", + }, + ], + name: "setOrderFees", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "marketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "strategyId", + type: "uint256", + }, + { + internalType: "bool", + name: "enabled", + type: "bool", + }, + ], + name: "setSettlementStrategyEnabled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "perpsMarketId", + type: "uint128", + }, + { + internalType: "bytes32", + name: "feedId", + type: "bytes32", + }, + ], + name: "updatePriceData", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "invalidFeeCollector", + type: "address", + }, + ], + name: "InvalidFeeCollectorInterface", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "shareRatioD18", + type: "uint256", + }, + ], + name: "InvalidReferrerShareRatio", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "feeCollector", + type: "address", + }, + ], + name: "FeeCollectorSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "minLiquidationRewardUsd", + type: "uint256", + }, + { + indexed: true, + internalType: "uint256", + name: "maxLiquidationRewardUsd", + type: "uint256", + }, + ], + name: "LiquidationRewardGuardsSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + { + indexed: false, + internalType: "uint256", + name: "collateralAmount", + type: "uint256", + }, + ], + name: "MaxCollateralAmountSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "referrer", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "shareRatioD18", + type: "uint256", + }, + ], + name: "ReferrerShareUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint128[]", + name: "newSynthDeductionPriority", + type: "uint128[]", + }, + ], + name: "SynthDeductionPrioritySet", + type: "event", + }, + { + inputs: [], + name: "getFeeCollector", + outputs: [ + { + internalType: "address", + name: "feeCollector", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getLiquidationRewardGuards", + outputs: [ + { + internalType: "uint256", + name: "minLiquidationRewardUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationRewardUsd", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + ], + name: "getMaxCollateralAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "referrer", + type: "address", + }, + ], + name: "getReferrerShare", + outputs: [ + { + internalType: "uint256", + name: "shareRatioD18", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getSynthDeductionPriority", + outputs: [ + { + internalType: "uint128[]", + name: "", + type: "uint128[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "feeCollector", + type: "address", + }, + ], + name: "setFeeCollector", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "minLiquidationRewardUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationRewardUsd", + type: "uint256", + }, + ], + name: "setLiquidationRewardGuards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128", + name: "synthMarketId", + type: "uint128", + }, + { + internalType: "uint256", + name: "collateralAmount", + type: "uint256", + }, + ], + name: "setMaxCollateralAmount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint128[]", + name: "newSynthDeductionPriority", + type: "uint128[]", + }, + ], + name: "setSynthDeductionPriority", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "totalGlobalCollateralValue", + outputs: [ + { + internalType: "uint256", + name: "totalCollateralValue", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "referrer", + type: "address", + }, + { + internalType: "uint256", + name: "shareRatioD18", + type: "uint256", + }, + ], + name: "updateReferrerShare", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class PerpsV3MarketProxy__factory { + static readonly abi = _abi; + static createInterface(): PerpsV3MarketProxyInterface { + return new utils.Interface(_abi) as PerpsV3MarketProxyInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PerpsV3MarketProxy { + return new Contract(address, _abi, signerOrProvider) as PerpsV3MarketProxy; + } +} diff --git a/packages/sdk/src/contracts/types/factories/Pyth__factory.ts b/packages/sdk/src/contracts/types/factories/Pyth__factory.ts index 287d49b9b0..7b5560e72c 100644 --- a/packages/sdk/src/contracts/types/factories/Pyth__factory.ts +++ b/packages/sdk/src/contracts/types/factories/Pyth__factory.ts @@ -2,488 +2,488 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { Pyth, PythInterface } from '../Pyth' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { Pyth, PythInterface } from "../Pyth"; const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint16', - name: 'chainId', - type: 'uint16', - }, - { - indexed: false, - internalType: 'uint64', - name: 'sequenceNumber', - type: 'uint64', - }, - ], - name: 'BatchPriceFeedUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint64', - name: 'publishTime', - type: 'uint64', - }, - { - indexed: false, - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - indexed: false, - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - ], - name: 'PriceFeedUpdate', - type: 'event', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - ], - name: 'getEmaPrice', - outputs: [ - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'price', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'age', - type: 'uint256', - }, - ], - name: 'getEmaPriceNoOlderThan', - outputs: [ - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'price', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - ], - name: 'getEmaPriceUnsafe', - outputs: [ - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'price', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - ], - name: 'getPrice', - outputs: [ - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'price', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'age', - type: 'uint256', - }, - ], - name: 'getPriceNoOlderThan', - outputs: [ - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'price', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - ], - name: 'getPriceUnsafe', - outputs: [ - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'price', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes[]', - name: 'updateData', - type: 'bytes[]', - }, - ], - name: 'getUpdateFee', - outputs: [ - { - internalType: 'uint256', - name: 'feeAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getValidTimePeriod', - outputs: [ - { - internalType: 'uint256', - name: 'validTimePeriod', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes[]', - name: 'updateData', - type: 'bytes[]', - }, - { - internalType: 'bytes32[]', - name: 'priceIds', - type: 'bytes32[]', - }, - { - internalType: 'uint64', - name: 'minPublishTime', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'maxPublishTime', - type: 'uint64', - }, - ], - name: 'parsePriceFeedUpdates', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'price', - type: 'tuple', - }, - { - components: [ - { - internalType: 'int64', - name: 'price', - type: 'int64', - }, - { - internalType: 'uint64', - name: 'conf', - type: 'uint64', - }, - { - internalType: 'int32', - name: 'expo', - type: 'int32', - }, - { - internalType: 'uint256', - name: 'publishTime', - type: 'uint256', - }, - ], - internalType: 'struct PythStructs.Price', - name: 'emaPrice', - type: 'tuple', - }, - ], - internalType: 'struct PythStructs.PriceFeed[]', - name: 'priceFeeds', - type: 'tuple[]', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes[]', - name: 'updateData', - type: 'bytes[]', - }, - ], - name: 'updatePriceFeeds', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes[]', - name: 'updateData', - type: 'bytes[]', - }, - { - internalType: 'bytes32[]', - name: 'priceIds', - type: 'bytes32[]', - }, - { - internalType: 'uint64[]', - name: 'publishTimes', - type: 'uint64[]', - }, - ], - name: 'updatePriceFeedsIfNecessary', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, -] + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint16", + name: "chainId", + type: "uint16", + }, + { + indexed: false, + internalType: "uint64", + name: "sequenceNumber", + type: "uint64", + }, + ], + name: "BatchPriceFeedUpdate", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint64", + name: "publishTime", + type: "uint64", + }, + { + indexed: false, + internalType: "int64", + name: "price", + type: "int64", + }, + { + indexed: false, + internalType: "uint64", + name: "conf", + type: "uint64", + }, + ], + name: "PriceFeedUpdate", + type: "event", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "getEmaPrice", + outputs: [ + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "price", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + internalType: "uint256", + name: "age", + type: "uint256", + }, + ], + name: "getEmaPriceNoOlderThan", + outputs: [ + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "price", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "getEmaPriceUnsafe", + outputs: [ + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "price", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "getPrice", + outputs: [ + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "price", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + internalType: "uint256", + name: "age", + type: "uint256", + }, + ], + name: "getPriceNoOlderThan", + outputs: [ + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "price", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "getPriceUnsafe", + outputs: [ + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "price", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "updateData", + type: "bytes[]", + }, + ], + name: "getUpdateFee", + outputs: [ + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getValidTimePeriod", + outputs: [ + { + internalType: "uint256", + name: "validTimePeriod", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "updateData", + type: "bytes[]", + }, + { + internalType: "bytes32[]", + name: "priceIds", + type: "bytes32[]", + }, + { + internalType: "uint64", + name: "minPublishTime", + type: "uint64", + }, + { + internalType: "uint64", + name: "maxPublishTime", + type: "uint64", + }, + ], + name: "parsePriceFeedUpdates", + outputs: [ + { + components: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "price", + type: "tuple", + }, + { + components: [ + { + internalType: "int64", + name: "price", + type: "int64", + }, + { + internalType: "uint64", + name: "conf", + type: "uint64", + }, + { + internalType: "int32", + name: "expo", + type: "int32", + }, + { + internalType: "uint256", + name: "publishTime", + type: "uint256", + }, + ], + internalType: "struct PythStructs.Price", + name: "emaPrice", + type: "tuple", + }, + ], + internalType: "struct PythStructs.PriceFeed[]", + name: "priceFeeds", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "updateData", + type: "bytes[]", + }, + ], + name: "updatePriceFeeds", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "updateData", + type: "bytes[]", + }, + { + internalType: "bytes32[]", + name: "priceIds", + type: "bytes32[]", + }, + { + internalType: "uint64[]", + name: "publishTimes", + type: "uint64[]", + }, + ], + name: "updatePriceFeedsIfNecessary", + outputs: [], + stateMutability: "payable", + type: "function", + }, +] as const; export class Pyth__factory { - static readonly abi = _abi - static createInterface(): PythInterface { - return new utils.Interface(_abi) as PythInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): Pyth { - return new Contract(address, _abi, signerOrProvider) as Pyth - } + static readonly abi = _abi; + static createInterface(): PythInterface { + return new utils.Interface(_abi) as PythInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): Pyth { + return new Contract(address, _abi, signerOrProvider) as Pyth; + } } diff --git a/packages/sdk/src/contracts/types/factories/ReverseRecords__factory.ts b/packages/sdk/src/contracts/types/factories/ReverseRecords__factory.ts index 9047b44b59..a3621db7f5 100644 --- a/packages/sdk/src/contracts/types/factories/ReverseRecords__factory.ts +++ b/packages/sdk/src/contracts/types/factories/ReverseRecords__factory.ts @@ -2,49 +2,55 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { ReverseRecords, ReverseRecordsInterface } from '../ReverseRecords' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + ReverseRecords, + ReverseRecordsInterface, +} from "../ReverseRecords"; const _abi = [ - { - inputs: [ - { - internalType: 'contract ENS', - name: '_ens', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'addresses', - type: 'address[]', - }, - ], - name: 'getNames', - outputs: [ - { - internalType: 'string[]', - name: 'r', - type: 'string[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "address[]", + name: "addresses", + type: "address[]", + }, + ], + name: "getNames", + outputs: [ + { + internalType: "string[]", + name: "r", + type: "string[]", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class ReverseRecords__factory { - static readonly abi = _abi - static createInterface(): ReverseRecordsInterface { - return new utils.Interface(_abi) as ReverseRecordsInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): ReverseRecords { - return new Contract(address, _abi, signerOrProvider) as ReverseRecords - } + static readonly abi = _abi; + static createInterface(): ReverseRecordsInterface { + return new utils.Interface(_abi) as ReverseRecordsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ReverseRecords { + return new Contract(address, _abi, signerOrProvider) as ReverseRecords; + } } diff --git a/packages/sdk/src/contracts/types/factories/RewardEscrow__factory.ts b/packages/sdk/src/contracts/types/factories/RewardEscrow__factory.ts index 34c0b08799..735698c0ce 100644 --- a/packages/sdk/src/contracts/types/factories/RewardEscrow__factory.ts +++ b/packages/sdk/src/contracts/types/factories/RewardEscrow__factory.ts @@ -2,679 +2,682 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { RewardEscrow, RewardEscrowInterface } from '../RewardEscrow' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { RewardEscrow, RewardEscrowInterface } from "../RewardEscrow"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_kwenta', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'rewardEscrow', - type: 'address', - }, - ], - name: 'StakingRewardsSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'treasuryDAO', - type: 'address', - }, - ], - name: 'TreasuryDAOSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'beneficiary', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Vested', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'beneficiary', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'duration', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'entryID', - type: 'uint256', - }, - ], - name: 'VestingEntryCreated', - type: 'event', - }, - { - inputs: [], - name: 'MAX_DURATION', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'accountVestingEntryIDs', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'quantity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'duration', - type: 'uint256', - }, - ], - name: 'appendVestingEntry', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'beneficiary', - type: 'address', - }, - { - internalType: 'uint256', - name: 'deposit', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'duration', - type: 'uint256', - }, - ], - name: 'createEscrowEntry', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pageSize', - type: 'uint256', - }, - ], - name: 'getAccountVestingEntryIDs', - outputs: [ - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getKwentaAddress', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'entryID', - type: 'uint256', - }, - ], - name: 'getVestingEntry', - outputs: [ - { - internalType: 'uint64', - name: 'endTime', - type: 'uint64', - }, - { - internalType: 'uint256', - name: 'escrowAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'duration', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'entryID', - type: 'uint256', - }, - ], - name: 'getVestingEntryClaimable', - outputs: [ - { - internalType: 'uint256', - name: 'quantity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256[]', - name: 'entryIDs', - type: 'uint256[]', - }, - ], - name: 'getVestingQuantity', - outputs: [ - { - internalType: 'uint256', - name: 'total', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'totalFee', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pageSize', - type: 'uint256', - }, - ], - name: 'getVestingSchedules', - outputs: [ - { - components: [ - { - internalType: 'uint64', - name: 'endTime', - type: 'uint64', - }, - { - internalType: 'uint256', - name: 'escrowAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'entryID', - type: 'uint256', - }, - ], - internalType: 'struct VestingEntries.VestingEntryWithID[]', - name: '', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'nextEntryId', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'numVestingEntries', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_stakingRewards', - type: 'address', - }, - ], - name: 'setStakingRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_treasuryDAO', - type: 'address', - }, - ], - name: 'setTreasuryDAO', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'stakeEscrow', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'stakingRewards', - outputs: [ - { - internalType: 'contract IStakingRewards', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'totalEscrowedAccountBalance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalEscrowedBalance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'totalVestedAccountBalance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'treasuryDAO', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'unstakeEscrow', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: 'entryIDs', - type: 'uint256[]', - }, - ], - name: 'vest', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'vestingSchedules', - outputs: [ - { - internalType: 'uint64', - name: 'endTime', - type: 'uint64', - }, - { - internalType: 'uint256', - name: 'escrowAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'duration', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_kwenta", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "rewardEscrow", + type: "address", + }, + ], + name: "StakingRewardsSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "treasuryDAO", + type: "address", + }, + ], + name: "TreasuryDAOSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "beneficiary", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Vested", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "beneficiary", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "duration", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "entryID", + type: "uint256", + }, + ], + name: "VestingEntryCreated", + type: "event", + }, + { + inputs: [], + name: "MAX_DURATION", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "accountVestingEntryIDs", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "quantity", + type: "uint256", + }, + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + ], + name: "appendVestingEntry", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "beneficiary", + type: "address", + }, + { + internalType: "uint256", + name: "deposit", + type: "uint256", + }, + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + ], + name: "createEscrowEntry", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "pageSize", + type: "uint256", + }, + ], + name: "getAccountVestingEntryIDs", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getKwentaAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "entryID", + type: "uint256", + }, + ], + name: "getVestingEntry", + outputs: [ + { + internalType: "uint64", + name: "endTime", + type: "uint64", + }, + { + internalType: "uint256", + name: "escrowAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "entryID", + type: "uint256", + }, + ], + name: "getVestingEntryClaimable", + outputs: [ + { + internalType: "uint256", + name: "quantity", + type: "uint256", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256[]", + name: "entryIDs", + type: "uint256[]", + }, + ], + name: "getVestingQuantity", + outputs: [ + { + internalType: "uint256", + name: "total", + type: "uint256", + }, + { + internalType: "uint256", + name: "totalFee", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + internalType: "uint256", + name: "pageSize", + type: "uint256", + }, + ], + name: "getVestingSchedules", + outputs: [ + { + components: [ + { + internalType: "uint64", + name: "endTime", + type: "uint64", + }, + { + internalType: "uint256", + name: "escrowAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "entryID", + type: "uint256", + }, + ], + internalType: "struct VestingEntries.VestingEntryWithID[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "nextEntryId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "numVestingEntries", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_stakingRewards", + type: "address", + }, + ], + name: "setStakingRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_treasuryDAO", + type: "address", + }, + ], + name: "setTreasuryDAO", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "stakeEscrow", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "stakingRewards", + outputs: [ + { + internalType: "contract IStakingRewards", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "totalEscrowedAccountBalance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalEscrowedBalance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "totalVestedAccountBalance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "treasuryDAO", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + ], + name: "unstakeEscrow", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256[]", + name: "entryIDs", + type: "uint256[]", + }, + ], + name: "vest", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "vestingSchedules", + outputs: [ + { + internalType: "uint64", + name: "endTime", + type: "uint64", + }, + { + internalType: "uint256", + name: "escrowAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class RewardEscrow__factory { - static readonly abi = _abi - static createInterface(): RewardEscrowInterface { - return new utils.Interface(_abi) as RewardEscrowInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): RewardEscrow { - return new Contract(address, _abi, signerOrProvider) as RewardEscrow - } + static readonly abi = _abi; + static createInterface(): RewardEscrowInterface { + return new utils.Interface(_abi) as RewardEscrowInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): RewardEscrow { + return new Contract(address, _abi, signerOrProvider) as RewardEscrow; + } } diff --git a/packages/sdk/src/contracts/types/factories/SmartMarginAccountFactory__factory.ts b/packages/sdk/src/contracts/types/factories/SmartMarginAccountFactory__factory.ts index 90db1de559..070e290ea7 100644 --- a/packages/sdk/src/contracts/types/factories/SmartMarginAccountFactory__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SmartMarginAccountFactory__factory.ts @@ -2,292 +2,299 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; import type { - SmartMarginAccountFactory, - SmartMarginAccountFactoryInterface, -} from '../SmartMarginAccountFactory' + SmartMarginAccountFactory, + SmartMarginAccountFactoryInterface, +} from "../SmartMarginAccountFactory"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'AccountDoesNotExist', - type: 'error', - }, - { - inputs: [ - { - internalType: 'bytes', - name: 'data', - type: 'bytes', - }, - ], - name: 'AccountFailedToFetchVersion', - type: 'error', - }, - { - inputs: [], - name: 'CannotUpgrade', - type: 'error', - }, - { - inputs: [ - { - internalType: 'bytes', - name: 'data', - type: 'bytes', - }, - ], - name: 'FailedToSetAcountOwner', - type: 'error', - }, - { - inputs: [], - name: 'OnlyAccount', - type: 'error', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'implementation', - type: 'address', - }, - ], - name: 'AccountImplementationUpgraded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'creator', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'version', - type: 'bytes32', - }, - ], - name: 'NewAccount', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: 'accounts', - type: 'address', - }, - ], - name: 'accounts', - outputs: [ - { - internalType: 'bool', - name: 'exist', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'canUpgrade', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_account', - type: 'address', - }, - ], - name: 'getAccountOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'getAccountsOwnedBy', - outputs: [ - { - internalType: 'address[]', - name: '', - type: 'address[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'implementation', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'newAccount', - outputs: [ - { - internalType: 'address payable', - name: 'accountAddress', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'removeUpgradability', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_account', - type: 'address', - }, - { - internalType: 'address', - name: '_newOwner', - type: 'address', - }, - { - internalType: 'address', - name: '_oldOwner', - type: 'address', - }, - ], - name: 'updateAccountOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_implementation', - type: 'address', - }, - ], - name: 'upgradeAccountImplementation', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "AccountDoesNotExist", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "AccountFailedToFetchVersion", + type: "error", + }, + { + inputs: [], + name: "CannotUpgrade", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "FailedToSetAcountOwner", + type: "error", + }, + { + inputs: [], + name: "OnlyAccount", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "AccountImplementationUpgraded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "creator", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "version", + type: "bytes32", + }, + ], + name: "NewAccount", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "accounts", + type: "address", + }, + ], + name: "accounts", + outputs: [ + { + internalType: "bool", + name: "exist", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "canUpgrade", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_account", + type: "address", + }, + ], + name: "getAccountOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "getAccountsOwnedBy", + outputs: [ + { + internalType: "address[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "implementation", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "newAccount", + outputs: [ + { + internalType: "address payable", + name: "accountAddress", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "removeUpgradability", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_account", + type: "address", + }, + { + internalType: "address", + name: "_newOwner", + type: "address", + }, + { + internalType: "address", + name: "_oldOwner", + type: "address", + }, + ], + name: "updateAccountOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_implementation", + type: "address", + }, + ], + name: "upgradeAccountImplementation", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class SmartMarginAccountFactory__factory { - static readonly abi = _abi - static createInterface(): SmartMarginAccountFactoryInterface { - return new utils.Interface(_abi) as SmartMarginAccountFactoryInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SmartMarginAccountFactory { - return new Contract(address, _abi, signerOrProvider) as SmartMarginAccountFactory - } + static readonly abi = _abi; + static createInterface(): SmartMarginAccountFactoryInterface { + return new utils.Interface(_abi) as SmartMarginAccountFactoryInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SmartMarginAccountFactory { + return new Contract( + address, + _abi, + signerOrProvider + ) as SmartMarginAccountFactory; + } } diff --git a/packages/sdk/src/contracts/types/factories/SmartMarginAccount__factory.ts b/packages/sdk/src/contracts/types/factories/SmartMarginAccount__factory.ts index 43a83e00d4..4b12d1022b 100644 --- a/packages/sdk/src/contracts/types/factories/SmartMarginAccount__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SmartMarginAccount__factory.ts @@ -2,618 +2,624 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { SmartMarginAccount, SmartMarginAccountInterface } from '../SmartMarginAccount' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + SmartMarginAccount, + SmartMarginAccountInterface, +} from "../SmartMarginAccount"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_factory', - type: 'address', - }, - { - internalType: 'address', - name: '_events', - type: 'address', - }, - { - internalType: 'address', - name: '_marginAsset', - type: 'address', - }, - { - internalType: 'address', - name: '_futuresMarketManager', - type: 'address', - }, - { - internalType: 'address', - name: '_systemStatus', - type: 'address', - }, - { - internalType: 'address', - name: '_gelato', - type: 'address', - }, - { - internalType: 'address', - name: '_ops', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'EthWithdrawalFailed', - type: 'error', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'available', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'required', - type: 'uint256', - }, - ], - name: 'InsufficientFreeMargin', - type: 'error', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'commandType', - type: 'uint256', - }, - ], - name: 'InvalidCommandType', - type: 'error', - }, - { - inputs: [ - { - internalType: 'address', - name: 'delegateAddress', - type: 'address', - }, - ], - name: 'InvalidDelegateAddress', - type: 'error', - }, - { - inputs: [], - name: 'InvalidPrice', - type: 'error', - }, - { - inputs: [], - name: 'LengthMismatch', - type: 'error', - }, - { - inputs: [], - name: 'OnlyOps', - type: 'error', - }, - { - inputs: [], - name: 'Unauthorized', - type: 'error', - }, - { - inputs: [], - name: 'ZeroSizeDelta', - type: 'error', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'delegate', - type: 'address', - }, - ], - name: 'DelegatedAccountAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'delegate', - type: 'address', - }, - ], - name: 'DelegatedAccountRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - inputs: [], - name: 'ETH', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'GELATO', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'OPS', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'VERSION', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_delegate', - type: 'address', - }, - ], - name: 'addDelegate', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_conditionalOrderId', - type: 'uint256', - }, - ], - name: 'checker', - outputs: [ - { - internalType: 'bool', - name: 'canExec', - type: 'bool', - }, - { - internalType: 'bytes', - name: 'execPayload', - type: 'bytes', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'committedMargin', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'conditionalOrderId', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'delegate', - type: 'address', - }, - ], - name: 'delegates', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'enum IAccount.Command[]', - name: '_commands', - type: 'uint8[]', - }, - { - internalType: 'bytes[]', - name: '_inputs', - type: 'bytes[]', - }, - ], - name: 'execute', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_conditionalOrderId', - type: 'uint256', - }, - ], - name: 'executeConditionalOrder', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'freeMargin', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_conditionalOrderId', - type: 'uint256', - }, - ], - name: 'getConditionalOrder', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - internalType: 'int256', - name: 'marginDelta', - type: 'int256', - }, - { - internalType: 'int256', - name: 'sizeDelta', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'targetPrice', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'gelatoTaskId', - type: 'bytes32', - }, - { - internalType: 'enum IAccount.ConditionalOrderTypes', - name: 'conditionalOrderType', - type: 'uint8', - }, - { - internalType: 'uint256', - name: 'desiredFillPrice', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'reduceOnly', - type: 'bool', - }, - ], - internalType: 'struct IAccount.ConditionalOrder', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'getDelayedOrder', - outputs: [ - { - components: [ - { - internalType: 'bool', - name: 'isOffchain', - type: 'bool', - }, - { - internalType: 'int128', - name: 'sizeDelta', - type: 'int128', - }, - { - internalType: 'uint128', - name: 'desiredFillPrice', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'targetRoundId', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'commitDeposit', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'keeperDeposit', - type: 'uint128', - }, - { - internalType: 'uint256', - name: 'executableAtTime', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'intentionTime', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - internalType: 'struct IPerpsV2MarketConsolidated.DelayedOrder', - name: 'order', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '_marketKey', - type: 'bytes32', - }, - ], - name: 'getPosition', - outputs: [ - { - components: [ - { - internalType: 'uint64', - name: 'id', - type: 'uint64', - }, - { - internalType: 'uint64', - name: 'lastFundingIndex', - type: 'uint64', - }, - { - internalType: 'uint128', - name: 'margin', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastPrice', - type: 'uint128', - }, - { - internalType: 'int128', - name: 'size', - type: 'int128', - }, - ], - internalType: 'struct IPerpsV2MarketConsolidated.Position', - name: 'position', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'isAuth', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'isOwner', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_delegate', - type: 'address', - }, - ], - name: 'removeDelegate', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'setInitialOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - stateMutability: 'payable', - type: 'receive', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_factory", + type: "address", + }, + { + internalType: "address", + name: "_events", + type: "address", + }, + { + internalType: "address", + name: "_marginAsset", + type: "address", + }, + { + internalType: "address", + name: "_futuresMarketManager", + type: "address", + }, + { + internalType: "address", + name: "_systemStatus", + type: "address", + }, + { + internalType: "address", + name: "_gelato", + type: "address", + }, + { + internalType: "address", + name: "_ops", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "EthWithdrawalFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "available", + type: "uint256", + }, + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + ], + name: "InsufficientFreeMargin", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "commandType", + type: "uint256", + }, + ], + name: "InvalidCommandType", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "delegateAddress", + type: "address", + }, + ], + name: "InvalidDelegateAddress", + type: "error", + }, + { + inputs: [], + name: "InvalidPrice", + type: "error", + }, + { + inputs: [], + name: "LengthMismatch", + type: "error", + }, + { + inputs: [], + name: "OnlyOps", + type: "error", + }, + { + inputs: [], + name: "Unauthorized", + type: "error", + }, + { + inputs: [], + name: "ZeroSizeDelta", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "caller", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "delegate", + type: "address", + }, + ], + name: "DelegatedAccountAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "caller", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "delegate", + type: "address", + }, + ], + name: "DelegatedAccountRemoved", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "caller", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + inputs: [], + name: "ETH", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "GELATO", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "OPS", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VERSION", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_delegate", + type: "address", + }, + ], + name: "addDelegate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_conditionalOrderId", + type: "uint256", + }, + ], + name: "checker", + outputs: [ + { + internalType: "bool", + name: "canExec", + type: "bool", + }, + { + internalType: "bytes", + name: "execPayload", + type: "bytes", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "committedMargin", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "conditionalOrderId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "delegate", + type: "address", + }, + ], + name: "delegates", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "enum IAccount.Command[]", + name: "_commands", + type: "uint8[]", + }, + { + internalType: "bytes[]", + name: "_inputs", + type: "bytes[]", + }, + ], + name: "execute", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_conditionalOrderId", + type: "uint256", + }, + ], + name: "executeConditionalOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "freeMargin", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_conditionalOrderId", + type: "uint256", + }, + ], + name: "getConditionalOrder", + outputs: [ + { + components: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + internalType: "int256", + name: "marginDelta", + type: "int256", + }, + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + { + internalType: "uint256", + name: "targetPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "gelatoTaskId", + type: "bytes32", + }, + { + internalType: "enum IAccount.ConditionalOrderTypes", + name: "conditionalOrderType", + type: "uint8", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bool", + name: "reduceOnly", + type: "bool", + }, + ], + internalType: "struct IAccount.ConditionalOrder", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "getDelayedOrder", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "isOffchain", + type: "bool", + }, + { + internalType: "int128", + name: "sizeDelta", + type: "int128", + }, + { + internalType: "uint128", + name: "desiredFillPrice", + type: "uint128", + }, + { + internalType: "uint128", + name: "targetRoundId", + type: "uint128", + }, + { + internalType: "uint128", + name: "commitDeposit", + type: "uint128", + }, + { + internalType: "uint128", + name: "keeperDeposit", + type: "uint128", + }, + { + internalType: "uint256", + name: "executableAtTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "intentionTime", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + internalType: "struct IPerpsV2MarketConsolidated.DelayedOrder", + name: "order", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "getPosition", + outputs: [ + { + components: [ + { + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + internalType: "uint64", + name: "lastFundingIndex", + type: "uint64", + }, + { + internalType: "uint128", + name: "margin", + type: "uint128", + }, + { + internalType: "uint128", + name: "lastPrice", + type: "uint128", + }, + { + internalType: "int128", + name: "size", + type: "int128", + }, + ], + internalType: "struct IPerpsV2MarketConsolidated.Position", + name: "position", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isAuth", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isOwner", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_delegate", + type: "address", + }, + ], + name: "removeDelegate", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "setInitialOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; export class SmartMarginAccount__factory { - static readonly abi = _abi - static createInterface(): SmartMarginAccountInterface { - return new utils.Interface(_abi) as SmartMarginAccountInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SmartMarginAccount { - return new Contract(address, _abi, signerOrProvider) as SmartMarginAccount - } + static readonly abi = _abi; + static createInterface(): SmartMarginAccountInterface { + return new utils.Interface(_abi) as SmartMarginAccountInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SmartMarginAccount { + return new Contract(address, _abi, signerOrProvider) as SmartMarginAccount; + } } diff --git a/packages/sdk/src/contracts/types/factories/StakingRewards__factory.ts b/packages/sdk/src/contracts/types/factories/StakingRewards__factory.ts index 344aa83aac..f83039634d 100644 --- a/packages/sdk/src/contracts/types/factories/StakingRewards__factory.ts +++ b/packages/sdk/src/contracts/types/factories/StakingRewards__factory.ts @@ -2,669 +2,675 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { StakingRewards, StakingRewardsInterface } from '../StakingRewards' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + StakingRewards, + StakingRewardsInterface, +} from "../StakingRewards"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardsDistribution', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardsToken', - type: 'address', - }, - { - internalType: 'address', - name: '_stakingToken', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'PauseChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'token', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Recovered', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'RewardAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'RewardPaid', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newDuration', - type: 'uint256', - }, - ], - name: 'RewardsDurationUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Staked', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Withdrawn', - type: 'event', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'earned', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'exit', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'getReward', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'getRewardForDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'lastPauseTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'lastTimeRewardApplicable', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'lastUpdateTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'notifyRewardAmount', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'paused', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'periodFinish', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'tokenAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenAmount', - type: 'uint256', - }, - ], - name: 'recoverERC20', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rewardPerToken', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rewardPerTokenStored', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rewardRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'rewards', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rewardsDistribution', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rewardsDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rewardsToken', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bool', - name: '_paused', - type: 'bool', - }, - ], - name: 'setPaused', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_rewardsDistribution', - type: 'address', - }, - ], - name: 'setRewardsDistribution', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_rewardsDuration', - type: 'uint256', - }, - ], - name: 'setRewardsDuration', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'stake', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'stakingToken', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'userRewardPerTokenPaid', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'withdraw', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_rewardsDistribution", + type: "address", + }, + { + internalType: "address", + name: "_rewardsToken", + type: "address", + }, + { + internalType: "address", + name: "_stakingToken", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "PauseChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Recovered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "RewardAdded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "RewardPaid", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newDuration", + type: "uint256", + }, + ], + name: "RewardsDurationUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Staked", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Withdrawn", + type: "event", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "earned", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "exit", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "getReward", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getRewardForDuration", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "lastPauseTime", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "lastTimeRewardApplicable", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "lastUpdateTime", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "notifyRewardAmount", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "paused", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "periodFinish", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "tokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenAmount", + type: "uint256", + }, + ], + name: "recoverERC20", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rewardPerToken", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rewardPerTokenStored", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rewardRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "rewards", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rewardsDistribution", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rewardsDuration", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rewardsToken", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "_paused", + type: "bool", + }, + ], + name: "setPaused", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_rewardsDistribution", + type: "address", + }, + ], + name: "setRewardsDistribution", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_rewardsDuration", + type: "uint256", + }, + ], + name: "setRewardsDuration", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "stake", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "stakingToken", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "userRewardPerTokenPaid", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "withdraw", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class StakingRewards__factory { - static readonly abi = _abi - static createInterface(): StakingRewardsInterface { - return new utils.Interface(_abi) as StakingRewardsInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): StakingRewards { - return new Contract(address, _abi, signerOrProvider) as StakingRewards - } + static readonly abi = _abi; + static createInterface(): StakingRewardsInterface { + return new utils.Interface(_abi) as StakingRewardsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): StakingRewards { + return new Contract(address, _abi, signerOrProvider) as StakingRewards; + } } diff --git a/packages/sdk/src/contracts/types/factories/SupplySchedule__factory.ts b/packages/sdk/src/contracts/types/factories/SupplySchedule__factory.ts index 2dc09bcec6..67e0bbae89 100644 --- a/packages/sdk/src/contracts/types/factories/SupplySchedule__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SupplySchedule__factory.ts @@ -2,656 +2,662 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { SupplySchedule, SupplyScheduleInterface } from '../SupplySchedule' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + SupplySchedule, + SupplyScheduleInterface, +} from "../SupplySchedule"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_treasuryDAO', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'KwentaUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newRewardAmount', - type: 'uint256', - }, - ], - name: 'MinterRewardUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'StakingRewardsUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'supplyMinted', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'numberOfWeeksIssued', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'lastMintEvent', - type: 'uint256', - }, - ], - name: 'SupplyMinted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newPercentage', - type: 'uint256', - }, - ], - name: 'TradingRewardsDiversionUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'TradingRewardsUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'treasuryDAO', - type: 'address', - }, - ], - name: 'TreasuryDAOSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newPercentage', - type: 'uint256', - }, - ], - name: 'TreasuryDiversionUpdated', - type: 'event', - }, - { - inputs: [], - name: 'DECAY_RATE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'INITIAL_SUPPLY', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'INITIAL_WEEKLY_SUPPLY', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_MINTER_REWARD', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MINT_BUFFER', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MINT_PERIOD_DURATION', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'SUPPLY_DECAY_END', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'SUPPLY_DECAY_START', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'TERMINAL_SUPPLY_RATE_ANNUAL', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'inflationStartDate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'isMintable', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'kwenta', - outputs: [ - { - internalType: 'contract IKwenta', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lastMintEvent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'mintableSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'minterReward', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IKwenta', - name: '_kwenta', - type: 'address', - }, - ], - name: 'setKwenta', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'setMinterReward', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_stakingRewards', - type: 'address', - }, - ], - name: 'setStakingRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_tradingRewards', - type: 'address', - }, - ], - name: 'setTradingRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_tradingRewardsDiversion', - type: 'uint256', - }, - ], - name: 'setTradingRewardsDiversion', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_treasuryDAO', - type: 'address', - }, - ], - name: 'setTreasuryDAO', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_treasuryDiversion', - type: 'uint256', - }, - ], - name: 'setTreasuryDiversion', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'stakingRewards', - outputs: [ - { - internalType: 'contract IStakingRewards', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'totalSupply', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'numOfWeeks', - type: 'uint256', - }, - ], - name: 'terminalInflationSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'counter', - type: 'uint256', - }, - ], - name: 'tokenDecaySupplyForWeek', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [], - name: 'tradingRewards', - outputs: [ - { - internalType: 'contract IMultipleMerkleDistributor', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'tradingRewardsDiversion', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'treasuryDAO', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'treasuryDiversion', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'weekCounter', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'weeksSinceLastIssuance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_treasuryDAO", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newAddress", + type: "address", + }, + ], + name: "KwentaUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newRewardAmount", + type: "uint256", + }, + ], + name: "MinterRewardUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newAddress", + type: "address", + }, + ], + name: "StakingRewardsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "supplyMinted", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "numberOfWeeksIssued", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "lastMintEvent", + type: "uint256", + }, + ], + name: "SupplyMinted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newPercentage", + type: "uint256", + }, + ], + name: "TradingRewardsDiversionUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newAddress", + type: "address", + }, + ], + name: "TradingRewardsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "treasuryDAO", + type: "address", + }, + ], + name: "TreasuryDAOSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newPercentage", + type: "uint256", + }, + ], + name: "TreasuryDiversionUpdated", + type: "event", + }, + { + inputs: [], + name: "DECAY_RATE", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "INITIAL_SUPPLY", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "INITIAL_WEEKLY_SUPPLY", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_MINTER_REWARD", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MINT_BUFFER", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MINT_PERIOD_DURATION", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "SUPPLY_DECAY_END", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "SUPPLY_DECAY_START", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "TERMINAL_SUPPLY_RATE_ANNUAL", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "inflationStartDate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isMintable", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "kwenta", + outputs: [ + { + internalType: "contract IKwenta", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastMintEvent", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "mintableSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "minterReward", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IKwenta", + name: "_kwenta", + type: "address", + }, + ], + name: "setKwenta", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "setMinterReward", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_stakingRewards", + type: "address", + }, + ], + name: "setStakingRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_tradingRewards", + type: "address", + }, + ], + name: "setTradingRewards", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_tradingRewardsDiversion", + type: "uint256", + }, + ], + name: "setTradingRewardsDiversion", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_treasuryDAO", + type: "address", + }, + ], + name: "setTreasuryDAO", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_treasuryDiversion", + type: "uint256", + }, + ], + name: "setTreasuryDiversion", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "stakingRewards", + outputs: [ + { + internalType: "contract IStakingRewards", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "totalSupply", + type: "uint256", + }, + { + internalType: "uint256", + name: "numOfWeeks", + type: "uint256", + }, + ], + name: "terminalInflationSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "counter", + type: "uint256", + }, + ], + name: "tokenDecaySupplyForWeek", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [], + name: "tradingRewards", + outputs: [ + { + internalType: "contract IMultipleMerkleDistributor", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "tradingRewardsDiversion", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "treasuryDAO", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "treasuryDiversion", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "weekCounter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "weeksSinceLastIssuance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class SupplySchedule__factory { - static readonly abi = _abi - static createInterface(): SupplyScheduleInterface { - return new utils.Interface(_abi) as SupplyScheduleInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SupplySchedule { - return new Contract(address, _abi, signerOrProvider) as SupplySchedule - } + static readonly abi = _abi; + static createInterface(): SupplyScheduleInterface { + return new utils.Interface(_abi) as SupplyScheduleInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SupplySchedule { + return new Contract(address, _abi, signerOrProvider) as SupplySchedule; + } } diff --git a/packages/sdk/src/contracts/types/factories/SynthRedeemer__factory.ts b/packages/sdk/src/contracts/types/factories/SynthRedeemer__factory.ts index 42794bdec5..d33d0b0dad 100644 --- a/packages/sdk/src/contracts/types/factories/SynthRedeemer__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SynthRedeemer__factory.ts @@ -2,319 +2,322 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { SynthRedeemer, SynthRedeemerInterface } from '../SynthRedeemer' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { SynthRedeemer, SynthRedeemerInterface } from "../SynthRedeemer"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'synth', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'rateToRedeem', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'totalSynthSupply', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'supplyInsUSD', - type: 'uint256', - }, - ], - name: 'SynthDeprecated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'synth', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountOfSynth', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountInsUSD', - type: 'uint256', - }, - ], - name: 'SynthRedeemed', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'contract IERC20', - name: 'synthProxy', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: 'balanceInsUSD', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'contract IERC20', - name: 'synthProxy', - type: 'address', - }, - { - internalType: 'uint256', - name: 'rateToRedeem', - type: 'uint256', - }, - ], - name: 'deprecate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'contract IERC20', - name: 'synthProxy', - type: 'address', - }, - ], - name: 'redeem', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'contract IERC20[]', - name: 'synthProxies', - type: 'address[]', - }, - ], - name: 'redeemAll', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'contract IERC20', - name: 'synthProxy', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amountOfSynth', - type: 'uint256', - }, - ], - name: 'redeemPartial', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'redemptions', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'contract IERC20', - name: 'synthProxy', - type: 'address', - }, - ], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: 'supplyInsUSD', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "synth", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "rateToRedeem", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "totalSynthSupply", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "supplyInsUSD", + type: "uint256", + }, + ], + name: "SynthDeprecated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "synth", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountOfSynth", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amountInsUSD", + type: "uint256", + }, + ], + name: "SynthRedeemed", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "contract IERC20", + name: "synthProxy", + type: "address", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balanceInsUSD", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "contract IERC20", + name: "synthProxy", + type: "address", + }, + { + internalType: "uint256", + name: "rateToRedeem", + type: "uint256", + }, + ], + name: "deprecate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "contract IERC20", + name: "synthProxy", + type: "address", + }, + ], + name: "redeem", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "contract IERC20[]", + name: "synthProxies", + type: "address[]", + }, + ], + name: "redeemAll", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "contract IERC20", + name: "synthProxy", + type: "address", + }, + { + internalType: "uint256", + name: "amountOfSynth", + type: "uint256", + }, + ], + name: "redeemPartial", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "redemptions", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "contract IERC20", + name: "synthProxy", + type: "address", + }, + ], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "supplyInsUSD", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class SynthRedeemer__factory { - static readonly abi = _abi - static createInterface(): SynthRedeemerInterface { - return new utils.Interface(_abi) as SynthRedeemerInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SynthRedeemer { - return new Contract(address, _abi, signerOrProvider) as SynthRedeemer - } + static readonly abi = _abi; + static createInterface(): SynthRedeemerInterface { + return new utils.Interface(_abi) as SynthRedeemerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SynthRedeemer { + return new Contract(address, _abi, signerOrProvider) as SynthRedeemer; + } } diff --git a/packages/sdk/src/contracts/types/factories/SynthSwap__factory.ts b/packages/sdk/src/contracts/types/factories/SynthSwap__factory.ts index 646ccc1a5a..ed9e6d6e7f 100644 --- a/packages/sdk/src/contracts/types/factories/SynthSwap__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SynthSwap__factory.ts @@ -2,333 +2,336 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { SynthSwap, SynthSwapInterface } from '../SynthSwap' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { SynthSwap, SynthSwapInterface } from "../SynthSwap"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_sUSD', - type: 'address', - }, - { - internalType: 'address', - name: '_aggregationRouterV4', - type: 'address', - }, - { - internalType: 'address', - name: '_addressResolver', - type: 'address', - }, - { - internalType: 'address', - name: '_volumeRewards', - type: 'address', - }, - { - internalType: 'address', - name: '_treasury', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - name: 'Received', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - name: 'SwapInto', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - name: 'SwapOutOf', - type: 'event', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'rescueFunds', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '_destSynthCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes', - name: '_data', - type: 'bytes', - }, - ], - name: 'swapInto', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '_sourceSynthCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes', - name: '_data', - type: 'bytes', - }, - ], - name: 'swapOutOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '_destSynthCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: '_sourceTokenAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - { - internalType: 'bytes', - name: '_data', - type: 'bytes', - }, - ], - name: 'uniswapSwapInto', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '_sourceSynthCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: '_destTokenAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: '_amountOfSynth', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_expectedAmountOfSUSDFromSwap', - type: 'uint256', - }, - { - internalType: 'bytes', - name: '_data', - type: 'bytes', - }, - ], - name: 'uniswapSwapOutOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - stateMutability: 'payable', - type: 'receive', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_sUSD", + type: "address", + }, + { + internalType: "address", + name: "_aggregationRouterV4", + type: "address", + }, + { + internalType: "address", + name: "_addressResolver", + type: "address", + }, + { + internalType: "address", + name: "_volumeRewards", + type: "address", + }, + { + internalType: "address", + name: "_treasury", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + name: "Received", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + name: "SwapInto", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + name: "SwapOutOf", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IERC20", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "rescueFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_destSynthCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "swapInto", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_sourceSynthCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_sourceAmount", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "swapOutOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_destSynthCurrencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "_sourceTokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "uniswapSwapInto", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "_sourceSynthCurrencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "_destTokenAddress", + type: "address", + }, + { + internalType: "uint256", + name: "_amountOfSynth", + type: "uint256", + }, + { + internalType: "uint256", + name: "_expectedAmountOfSUSDFromSwap", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "uniswapSwapOutOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; export class SynthSwap__factory { - static readonly abi = _abi - static createInterface(): SynthSwapInterface { - return new utils.Interface(_abi) as SynthSwapInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SynthSwap { - return new Contract(address, _abi, signerOrProvider) as SynthSwap - } + static readonly abi = _abi; + static createInterface(): SynthSwapInterface { + return new utils.Interface(_abi) as SynthSwapInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SynthSwap { + return new Contract(address, _abi, signerOrProvider) as SynthSwap; + } } diff --git a/packages/sdk/src/contracts/types/factories/SynthUtil__factory.ts b/packages/sdk/src/contracts/types/factories/SynthUtil__factory.ts index f1ab6eb85c..640e7cf4d0 100644 --- a/packages/sdk/src/contracts/types/factories/SynthUtil__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SynthUtil__factory.ts @@ -2,148 +2,151 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { SynthUtil, SynthUtilInterface } from '../SynthUtil' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { SynthUtil, SynthUtilInterface } from "../SynthUtil"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - constant: true, - inputs: [], - name: 'addressResolverProxy', - outputs: [ - { - internalType: 'contract IAddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'synthsBalances', - outputs: [ - { - internalType: 'bytes32[]', - name: '', - type: 'bytes32[]', - }, - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'synthsRates', - outputs: [ - { - internalType: 'bytes32[]', - name: '', - type: 'bytes32[]', - }, - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'synthsTotalSupplies', - outputs: [ - { - internalType: 'bytes32[]', - name: '', - type: 'bytes32[]', - }, - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'totalSynthsInKey', - outputs: [ - { - internalType: 'uint256', - name: 'total', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + constant: true, + inputs: [], + name: "addressResolverProxy", + outputs: [ + { + internalType: "contract IAddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "synthsBalances", + outputs: [ + { + internalType: "bytes32[]", + name: "", + type: "bytes32[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "synthsRates", + outputs: [ + { + internalType: "bytes32[]", + name: "", + type: "bytes32[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "synthsTotalSupplies", + outputs: [ + { + internalType: "bytes32[]", + name: "", + type: "bytes32[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "totalSynthsInKey", + outputs: [ + { + internalType: "uint256", + name: "total", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class SynthUtil__factory { - static readonly abi = _abi - static createInterface(): SynthUtilInterface { - return new utils.Interface(_abi) as SynthUtilInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SynthUtil { - return new Contract(address, _abi, signerOrProvider) as SynthUtil - } + static readonly abi = _abi; + static createInterface(): SynthUtilInterface { + return new utils.Interface(_abi) as SynthUtilInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SynthUtil { + return new Contract(address, _abi, signerOrProvider) as SynthUtil; + } } diff --git a/packages/sdk/src/contracts/types/factories/Synth__factory.ts b/packages/sdk/src/contracts/types/factories/Synth__factory.ts index e100ace557..7a9411a1c5 100644 --- a/packages/sdk/src/contracts/types/factories/Synth__factory.ts +++ b/packages/sdk/src/contracts/types/factories/Synth__factory.ts @@ -2,812 +2,812 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { Synth, SynthInterface } from '../Synth' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { Synth, SynthInterface } from "../Synth"; const _abi = [ - { - inputs: [ - { - internalType: 'address payable', - name: '_proxy', - type: 'address', - }, - { - internalType: 'contract TokenState', - name: '_tokenState', - type: 'address', - }, - { - internalType: 'string', - name: '_tokenName', - type: 'string', - }, - { - internalType: 'string', - name: '_tokenSymbol', - type: 'string', - }, - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'bytes32', - name: '_currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_totalSupply', - type: 'uint256', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Burned', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Issued', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'proxyAddress', - type: 'address', - }, - ], - name: 'ProxyUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newTokenState', - type: 'address', - }, - ], - name: 'TokenStateUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'DECIMALS', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'FEE_ADDRESS', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burn', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'currencyKey', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'issue', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'messageSender', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'proxy', - outputs: [ - { - internalType: 'contract Proxy', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'setMessageSender', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address payable', - name: '_proxy', - type: 'address', - }, - ], - name: 'setProxy', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'contract TokenState', - name: '_tokenState', - type: 'address', - }, - ], - name: 'setTokenState', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'setTotalSupply', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'tokenState', - outputs: [ - { - internalType: 'contract TokenState', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'transferAndSettle', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'transferFromAndSettle', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'transferableSynths', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address payable", + name: "_proxy", + type: "address", + }, + { + internalType: "contract TokenState", + name: "_tokenState", + type: "address", + }, + { + internalType: "string", + name: "_tokenName", + type: "string", + }, + { + internalType: "string", + name: "_tokenSymbol", + type: "string", + }, + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "bytes32", + name: "_currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_totalSupply", + type: "uint256", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Burned", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Issued", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "proxyAddress", + type: "address", + }, + ], + name: "ProxyUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newTokenState", + type: "address", + }, + ], + name: "TokenStateUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "DECIMALS", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "FEE_ADDRESS", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "burn", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "currencyKey", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "issue", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "messageSender", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "proxy", + outputs: [ + { + internalType: "contract Proxy", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "setMessageSender", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address payable", + name: "_proxy", + type: "address", + }, + ], + name: "setProxy", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "contract TokenState", + name: "_tokenState", + type: "address", + }, + ], + name: "setTokenState", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "setTotalSupply", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "tokenState", + outputs: [ + { + internalType: "contract TokenState", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transferAndSettle", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transferFromAndSettle", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "transferableSynths", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class Synth__factory { - static readonly abi = _abi - static createInterface(): SynthInterface { - return new utils.Interface(_abi) as SynthInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): Synth { - return new Contract(address, _abi, signerOrProvider) as Synth - } + static readonly abi = _abi; + static createInterface(): SynthInterface { + return new utils.Interface(_abi) as SynthInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): Synth { + return new Contract(address, _abi, signerOrProvider) as Synth; + } } diff --git a/packages/sdk/src/contracts/types/factories/Synthetix__factory.ts b/packages/sdk/src/contracts/types/factories/Synthetix__factory.ts index 9c6710db39..8992e24beb 100644 --- a/packages/sdk/src/contracts/types/factories/Synthetix__factory.ts +++ b/packages/sdk/src/contracts/types/factories/Synthetix__factory.ts @@ -2,1908 +2,1911 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { Synthetix, SynthetixInterface } from '../Synthetix' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { Synthetix, SynthetixInterface } from "../Synthetix"; const _abi = [ - { - inputs: [ - { - internalType: 'address payable', - name: '_proxy', - type: 'address', - }, - { - internalType: 'contract TokenState', - name: '_tokenState', - type: 'address', - }, - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'uint256', - name: '_totalSupply', - type: 'uint256', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'snxRedeemed', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountLiquidated', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'liquidator', - type: 'address', - }, - ], - name: 'AccountLiquidated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'fromCurrencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fromAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'toCurrencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'toAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'toAddress', - type: 'address', - }, - ], - name: 'AtomicSynthExchange', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'ExchangeRebate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'ExchangeReclaim', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'toCurrencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'toAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'ExchangeTracking', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'proxyAddress', - type: 'address', - }, - ], - name: 'ProxyUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'fromCurrencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fromAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'toCurrencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'toAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'toAddress', - type: 'address', - }, - ], - name: 'SynthExchange', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newTokenState', - type: 'address', - }, - ], - name: 'TokenStateUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'DECIMALS', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'TOKEN_NAME', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'TOKEN_SYMBOL', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'anySynthOrSNXRateIsInvalid', - outputs: [ - { - internalType: 'bool', - name: 'anyRateInvalid', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'availableCurrencyKeys', - outputs: [ - { - internalType: 'bytes32[]', - name: '', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'availableSynthCount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'availableSynths', - outputs: [ - { - internalType: 'contract ISynth', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'burnSecondary', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burnSynths', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'burnForAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burnSynthsOnBehalf', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'burnSynthsToTarget', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'burnForAddress', - type: 'address', - }, - ], - name: 'burnSynthsToTargetOnBehalf', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'collateral', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: '_issuer', - type: 'address', - }, - ], - name: 'collateralisationRatio', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'debtBalanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'fromCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'fromAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'toCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'toAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'toAddress', - type: 'address', - }, - ], - name: 'emitAtomicSynthExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'emitExchangeRebate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'emitExchangeReclaim', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'toCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'toAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'emitExchangeTracking', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'fromCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'fromAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'toCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'toAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'toAddress', - type: 'address', - }, - ], - name: 'emitSynthExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'exchange', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'minAmount', - type: 'uint256', - }, - ], - name: 'exchangeAtomically', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'exchangeForAddress', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'exchangeOnBehalf', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'exchangeForAddress', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'rewardAddress', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'exchangeOnBehalfWithTracking', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'rewardAddress', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'exchangeWithTracking', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'rewardAddress', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'exchangeWithTrackingForInitiator', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'trackingCode', - type: 'bytes32', - }, - ], - name: 'exchangeWithVirtual', - outputs: [ - { - internalType: 'uint256', - name: 'amountReceived', - type: 'uint256', - }, - { - internalType: 'contract IVirtualSynth', - name: 'vSynth', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'getFirstNonZeroEscrowIndex', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'isWaitingPeriod', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'issueMaxSynths', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'issueForAddress', - type: 'address', - }, - ], - name: 'issueMaxSynthsOnBehalf', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'issueSynths', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'issueForAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'issueSynthsOnBehalf', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'liquidateDelinquentAccount', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'escrowStartIndex', - type: 'uint256', - }, - ], - name: 'liquidateDelinquentAccountEscrowIndex', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'liquidateSelf', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'maxIssuableSynths', - outputs: [ - { - internalType: 'uint256', - name: 'maxIssuable', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'messageSender', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'migrateEscrowBalanceToRewardEscrowV2', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'migrateEscrowContractBalance', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'mint', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'mintSecondary', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'mintSecondaryRewards', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'proxy', - outputs: [ - { - internalType: 'contract Proxy', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'remainingIssuableSynths', - outputs: [ - { - internalType: 'uint256', - name: 'maxIssuable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'alreadyIssued', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'totalSystemDebt', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'sUSD', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'setMessageSender', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address payable', - name: '_proxy', - type: 'address', - }, - ], - name: 'setProxy', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'contract TokenState', - name: '_tokenState', - type: 'address', - }, - ], - name: 'setTokenState', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'settle', - outputs: [ - { - internalType: 'uint256', - name: 'reclaimed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'refunded', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'numEntriesSettled', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'synths', - outputs: [ - { - internalType: 'contract ISynth', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'synthAddress', - type: 'address', - }, - ], - name: 'synthsByAddress', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'tokenState', - outputs: [ - { - internalType: 'contract TokenState', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'totalIssuedSynths', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'totalIssuedSynthsExcludeOtherCollateral', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'transferableSynthetix', - outputs: [ - { - internalType: 'uint256', - name: 'transferable', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address payable", + name: "_proxy", + type: "address", + }, + { + internalType: "contract TokenState", + name: "_tokenState", + type: "address", + }, + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "uint256", + name: "_totalSupply", + type: "uint256", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "snxRedeemed", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amountLiquidated", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "liquidator", + type: "address", + }, + ], + name: "AccountLiquidated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "fromCurrencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "fromAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "toCurrencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "toAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "toAddress", + type: "address", + }, + ], + name: "AtomicSynthExchange", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "ExchangeRebate", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "ExchangeReclaim", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + indexed: false, + internalType: "bytes32", + name: "toCurrencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "toAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "ExchangeTracking", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "proxyAddress", + type: "address", + }, + ], + name: "ProxyUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "fromCurrencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "fromAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "toCurrencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "toAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "toAddress", + type: "address", + }, + ], + name: "SynthExchange", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newTokenState", + type: "address", + }, + ], + name: "TokenStateUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "DECIMALS", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "TOKEN_NAME", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "TOKEN_SYMBOL", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "anySynthOrSNXRateIsInvalid", + outputs: [ + { + internalType: "bool", + name: "anyRateInvalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "availableCurrencyKeys", + outputs: [ + { + internalType: "bytes32[]", + name: "", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "availableSynthCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "availableSynths", + outputs: [ + { + internalType: "contract ISynth", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "burnSecondary", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "burnSynths", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "burnForAddress", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "burnSynthsOnBehalf", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "burnSynthsToTarget", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "burnForAddress", + type: "address", + }, + ], + name: "burnSynthsToTargetOnBehalf", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "collateral", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "_issuer", + type: "address", + }, + ], + name: "collateralisationRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "debtBalanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "fromCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "fromAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "toCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "toAmount", + type: "uint256", + }, + { + internalType: "address", + name: "toAddress", + type: "address", + }, + ], + name: "emitAtomicSynthExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "emitExchangeRebate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "emitExchangeReclaim", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "toCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "toAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "emitExchangeTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bytes32", + name: "fromCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "fromAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "toCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "toAmount", + type: "uint256", + }, + { + internalType: "address", + name: "toAddress", + type: "address", + }, + ], + name: "emitSynthExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "exchange", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + { + internalType: "uint256", + name: "minAmount", + type: "uint256", + }, + ], + name: "exchangeAtomically", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "exchangeForAddress", + type: "address", + }, + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "exchangeOnBehalf", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "exchangeForAddress", + type: "address", + }, + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "rewardAddress", + type: "address", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "exchangeOnBehalfWithTracking", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "rewardAddress", + type: "address", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "exchangeWithTracking", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "rewardAddress", + type: "address", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "exchangeWithTrackingForInitiator", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "exchangeWithVirtual", + outputs: [ + { + internalType: "uint256", + name: "amountReceived", + type: "uint256", + }, + { + internalType: "contract IVirtualSynth", + name: "vSynth", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "getFirstNonZeroEscrowIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "isWaitingPeriod", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "issueMaxSynths", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "issueForAddress", + type: "address", + }, + ], + name: "issueMaxSynthsOnBehalf", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "issueSynths", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "issueForAddress", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "issueSynthsOnBehalf", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "liquidateDelinquentAccount", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "escrowStartIndex", + type: "uint256", + }, + ], + name: "liquidateDelinquentAccountEscrowIndex", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "liquidateSelf", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "maxIssuableSynths", + outputs: [ + { + internalType: "uint256", + name: "maxIssuable", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "messageSender", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "migrateEscrowBalanceToRewardEscrowV2", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "migrateEscrowContractBalance", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "mint", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "mintSecondary", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "mintSecondaryRewards", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "proxy", + outputs: [ + { + internalType: "contract Proxy", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "remainingIssuableSynths", + outputs: [ + { + internalType: "uint256", + name: "maxIssuable", + type: "uint256", + }, + { + internalType: "uint256", + name: "alreadyIssued", + type: "uint256", + }, + { + internalType: "uint256", + name: "totalSystemDebt", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "sUSD", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "setMessageSender", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address payable", + name: "_proxy", + type: "address", + }, + ], + name: "setProxy", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "contract TokenState", + name: "_tokenState", + type: "address", + }, + ], + name: "setTokenState", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "settle", + outputs: [ + { + internalType: "uint256", + name: "reclaimed", + type: "uint256", + }, + { + internalType: "uint256", + name: "refunded", + type: "uint256", + }, + { + internalType: "uint256", + name: "numEntriesSettled", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "synths", + outputs: [ + { + internalType: "contract ISynth", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "synthAddress", + type: "address", + }, + ], + name: "synthsByAddress", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "tokenState", + outputs: [ + { + internalType: "contract TokenState", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "totalIssuedSynths", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "totalIssuedSynthsExcludeOtherCollateral", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "transferableSynthetix", + outputs: [ + { + internalType: "uint256", + name: "transferable", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class Synthetix__factory { - static readonly abi = _abi - static createInterface(): SynthetixInterface { - return new utils.Interface(_abi) as SynthetixInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): Synthetix { - return new Contract(address, _abi, signerOrProvider) as Synthetix - } + static readonly abi = _abi; + static createInterface(): SynthetixInterface { + return new utils.Interface(_abi) as SynthetixInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): Synthetix { + return new Contract(address, _abi, signerOrProvider) as Synthetix; + } } diff --git a/packages/sdk/src/contracts/types/factories/SystemSettings__factory.ts b/packages/sdk/src/contracts/types/factories/SystemSettings__factory.ts index a07b13374d..723fd00b3c 100644 --- a/packages/sdk/src/contracts/types/factories/SystemSettings__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SystemSettings__factory.ts @@ -2,2139 +2,2145 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { SystemSettings, SystemSettingsInterface } from '../SystemSettings' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + SystemSettings, + SystemSettingsInterface, +} from "../SystemSettings"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_resolver', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'flags', - type: 'address', - }, - ], - name: 'AggregatorWarningFlagsUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'synthKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'equivalent', - type: 'address', - }, - ], - name: 'AtomicEquivalentForDexPricingUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'synthKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newExchangeFeeRate', - type: 'uint256', - }, - ], - name: 'AtomicExchangeFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newMaxVolume', - type: 'uint256', - }, - ], - name: 'AtomicMaxVolumePerBlockUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newWindow', - type: 'uint256', - }, - ], - name: 'AtomicTwapWindowUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'synthKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newVolatilityConsiderationWindow', - type: 'uint256', - }, - ], - name: 'AtomicVolatilityConsiderationWindowUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'synthKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newVolatilityUpdateThreshold', - type: 'uint256', - }, - ], - name: 'AtomicVolatilityUpdateThresholdUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'name', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'address', - name: 'destination', - type: 'address', - }, - ], - name: 'CacheUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'collapseFeeRate', - type: 'uint256', - }, - ], - name: 'CollapseFeeRateUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'synthKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'CrossChainSynthTransferEnabledUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'enum MixinSystemSettings.CrossDomainMessageGasLimits', - name: 'gasLimitType', - type: 'uint8', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newLimit', - type: 'uint256', - }, - ], - name: 'CrossDomainMessageGasLimitChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'debtSnapshotStaleTime', - type: 'uint256', - }, - ], - name: 'DebtSnapshotStaleTimeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - ], - name: 'EtherWrapperBurnFeeRateUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'maxETH', - type: 'uint256', - }, - ], - name: 'EtherWrapperMaxETHUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - ], - name: 'EtherWrapperMintFeeRateUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'dynamicFeeRounds', - type: 'uint256', - }, - ], - name: 'ExchangeDynamicFeeRoundsUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'dynamicFeeThreshold', - type: 'uint256', - }, - ], - name: 'ExchangeDynamicFeeThresholdUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'dynamicFeeWeightDecay', - type: 'uint256', - }, - ], - name: 'ExchangeDynamicFeeWeightDecayUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'synthKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newExchangeFeeRate', - type: 'uint256', - }, - ], - name: 'ExchangeFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'maxDynamicFee', - type: 'uint256', - }, - ], - name: 'ExchangeMaxDynamicFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newFeePeriodDuration', - type: 'uint256', - }, - ], - name: 'FeePeriodDurationUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newReward', - type: 'uint256', - }, - ], - name: 'FlagRewardUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'interactionDelay', - type: 'uint256', - }, - ], - name: 'InteractionDelayUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newRatio', - type: 'uint256', - }, - ], - name: 'IssuanceRatioUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newReward', - type: 'uint256', - }, - ], - name: 'LiquidateRewardUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newDelay', - type: 'uint256', - }, - ], - name: 'LiquidationDelayUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newDuration', - type: 'uint256', - }, - ], - name: 'LiquidationEscrowDurationUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newPenalty', - type: 'uint256', - }, - ], - name: 'LiquidationPenaltyUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newRatio', - type: 'uint256', - }, - ], - name: 'LiquidationRatioUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'minimumStakeTime', - type: 'uint256', - }, - ], - name: 'MinimumStakeTimeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'threshold', - type: 'uint256', - }, - ], - name: 'PriceDeviationThresholdUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'synthKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bool', - name: 'enabled', - type: 'bool', - }, - ], - name: 'PureChainlinkPriceForAtomicSwapsEnabledUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'rateStalePeriod', - type: 'uint256', - }, - ], - name: 'RateStalePeriodUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newPenalty', - type: 'uint256', - }, - ], - name: 'SelfLiquidationPenaltyUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newPenalty', - type: 'uint256', - }, - ], - name: 'SnxLiquidationPenaltyUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newTargetThreshold', - type: 'uint256', - }, - ], - name: 'TargetThresholdUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'enabled', - type: 'bool', - }, - ], - name: 'TradingRewardsEnabled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'waitingPeriodSecs', - type: 'uint256', - }, - ], - name: 'WaitingPeriodSecsUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'wrapper', - type: 'address', - }, - { - indexed: false, - internalType: 'int256', - name: 'rate', - type: 'int256', - }, - ], - name: 'WrapperBurnFeeRateUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'wrapper', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'maxTokenAmount', - type: 'uint256', - }, - ], - name: 'WrapperMaxTokenAmountUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'wrapper', - type: 'address', - }, - { - indexed: false, - internalType: 'int256', - name: 'rate', - type: 'int256', - }, - ], - name: 'WrapperMintFeeRateUpdated', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'aggregatorWarningFlags', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'atomicEquivalentForDexPricing', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'atomicExchangeFeeRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'atomicMaxVolumePerBlock', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'atomicTwapWindow', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'atomicVolatilityConsiderationWindow', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'atomicVolatilityUpdateThreshold', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'collateral', - type: 'address', - }, - ], - name: 'collapseFeeRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'crossChainSynthTransferEnabled', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'enum MixinSystemSettings.CrossDomainMessageGasLimits', - name: 'gasLimitType', - type: 'uint8', - }, - ], - name: 'crossDomainMessageGasLimit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'debtSnapshotStaleTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'etherWrapperBurnFeeRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'etherWrapperMaxETH', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'etherWrapperMintFeeRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'exchangeDynamicFeeRounds', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'exchangeDynamicFeeThreshold', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'exchangeDynamicFeeWeightDecay', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'exchangeFeeRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'exchangeMaxDynamicFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'feePeriodDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'flagReward', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'collateral', - type: 'address', - }, - ], - name: 'interactionDelay', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'issuanceRatio', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidateReward', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidationDelay', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidationEscrowDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidationPenalty', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'liquidationRatio', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'minimumStakeTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'priceDeviationThresholdFactor', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'pureChainlinkPriceForAtomicSwapsEnabled', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'rateStalePeriod', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'rebuildCache', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolver', - outputs: [ - { - internalType: 'contract AddressResolver', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'resolverAddressesRequired', - outputs: [ - { - internalType: 'bytes32[]', - name: 'addresses', - type: 'bytes32[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'selfLiquidationPenalty', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_flags', - type: 'address', - }, - ], - name: 'setAggregatorWarningFlags', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_currencyKey', - type: 'bytes32', - }, - { - internalType: 'address', - name: '_equivalent', - type: 'address', - }, - ], - name: 'setAtomicEquivalentForDexPricing', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_exchangeFeeRate', - type: 'uint256', - }, - ], - name: 'setAtomicExchangeFeeRate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_maxVolume', - type: 'uint256', - }, - ], - name: 'setAtomicMaxVolumePerBlock', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_window', - type: 'uint256', - }, - ], - name: 'setAtomicTwapWindow', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_window', - type: 'uint256', - }, - ], - name: 'setAtomicVolatilityConsiderationWindow', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_threshold', - type: 'uint256', - }, - ], - name: 'setAtomicVolatilityUpdateThreshold', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_collateral', - type: 'address', - }, - { - internalType: 'uint256', - name: '_collapseFeeRate', - type: 'uint256', - }, - ], - name: 'setCollapseFeeRate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: '_value', - type: 'uint256', - }, - ], - name: 'setCrossChainSynthTransferEnabled', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'enum MixinSystemSettings.CrossDomainMessageGasLimits', - name: '_gasLimitType', - type: 'uint8', - }, - { - internalType: 'uint256', - name: '_crossDomainMessageGasLimit', - type: 'uint256', - }, - ], - name: 'setCrossDomainMessageGasLimit', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_seconds', - type: 'uint256', - }, - ], - name: 'setDebtSnapshotStaleTime', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_rate', - type: 'uint256', - }, - ], - name: 'setEtherWrapperBurnFeeRate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_maxETH', - type: 'uint256', - }, - ], - name: 'setEtherWrapperMaxETH', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_rate', - type: 'uint256', - }, - ], - name: 'setEtherWrapperMintFeeRate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'rounds', - type: 'uint256', - }, - ], - name: 'setExchangeDynamicFeeRounds', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'threshold', - type: 'uint256', - }, - ], - name: 'setExchangeDynamicFeeThreshold', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'weightDecay', - type: 'uint256', - }, - ], - name: 'setExchangeDynamicFeeWeightDecay', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'synthKeys', - type: 'bytes32[]', - }, - { - internalType: 'uint256[]', - name: 'exchangeFeeRates', - type: 'uint256[]', - }, - ], - name: 'setExchangeFeeRateForSynths', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'maxFee', - type: 'uint256', - }, - ], - name: 'setExchangeMaxDynamicFee', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_feePeriodDuration', - type: 'uint256', - }, - ], - name: 'setFeePeriodDuration', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'setFlagReward', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_collateral', - type: 'address', - }, - { - internalType: 'uint256', - name: '_interactionDelay', - type: 'uint256', - }, - ], - name: 'setInteractionDelay', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'ratio', - type: 'uint256', - }, - ], - name: 'setIssuanceRatio', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'setLiquidateReward', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'time', - type: 'uint256', - }, - ], - name: 'setLiquidationDelay', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'duration', - type: 'uint256', - }, - ], - name: 'setLiquidationEscrowDuration', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'setLiquidationPenalty', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_liquidationRatio', - type: 'uint256', - }, - ], - name: 'setLiquidationRatio', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_seconds', - type: 'uint256', - }, - ], - name: 'setMinimumStakeTime', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_priceDeviationThresholdFactor', - type: 'uint256', - }, - ], - name: 'setPriceDeviationThresholdFactor', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: '_currencyKey', - type: 'bytes32', - }, - { - internalType: 'bool', - name: '_enabled', - type: 'bool', - }, - ], - name: 'setPureChainlinkPriceForAtomicSwapsEnabled', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'period', - type: 'uint256', - }, - ], - name: 'setRateStalePeriod', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'setSelfLiquidationPenalty', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'setSnxLiquidationPenalty', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'percent', - type: 'uint256', - }, - ], - name: 'setTargetThreshold', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bool', - name: '_tradingRewardsEnabled', - type: 'bool', - }, - ], - name: 'setTradingRewardsEnabled', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: '_waitingPeriodSecs', - type: 'uint256', - }, - ], - name: 'setWaitingPeriodSecs', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_wrapper', - type: 'address', - }, - { - internalType: 'int256', - name: '_rate', - type: 'int256', - }, - ], - name: 'setWrapperBurnFeeRate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_wrapper', - type: 'address', - }, - { - internalType: 'uint256', - name: '_maxTokenAmount', - type: 'uint256', - }, - ], - name: 'setWrapperMaxTokenAmount', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_wrapper', - type: 'address', - }, - { - internalType: 'int256', - name: '_rate', - type: 'int256', - }, - ], - name: 'setWrapperMintFeeRate', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'snxLiquidationPenalty', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'targetThreshold', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'tradingRewardsEnabled', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'waitingPeriodSecs', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'wrapper', - type: 'address', - }, - ], - name: 'wrapperBurnFeeRate', - outputs: [ - { - internalType: 'int256', - name: '', - type: 'int256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'wrapper', - type: 'address', - }, - ], - name: 'wrapperMaxTokenAmount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'address', - name: 'wrapper', - type: 'address', - }, - ], - name: 'wrapperMintFeeRate', - outputs: [ - { - internalType: 'int256', - name: '', - type: 'int256', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "address", + name: "_resolver", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "flags", + type: "address", + }, + ], + name: "AggregatorWarningFlagsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "synthKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "equivalent", + type: "address", + }, + ], + name: "AtomicEquivalentForDexPricingUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "synthKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "newExchangeFeeRate", + type: "uint256", + }, + ], + name: "AtomicExchangeFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newMaxVolume", + type: "uint256", + }, + ], + name: "AtomicMaxVolumePerBlockUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newWindow", + type: "uint256", + }, + ], + name: "AtomicTwapWindowUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "synthKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "newVolatilityConsiderationWindow", + type: "uint256", + }, + ], + name: "AtomicVolatilityConsiderationWindowUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "synthKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "newVolatilityUpdateThreshold", + type: "uint256", + }, + ], + name: "AtomicVolatilityUpdateThresholdUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "name", + type: "bytes32", + }, + { + indexed: false, + internalType: "address", + name: "destination", + type: "address", + }, + ], + name: "CacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "collapseFeeRate", + type: "uint256", + }, + ], + name: "CollapseFeeRateUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "synthKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "CrossChainSynthTransferEnabledUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "enum MixinSystemSettings.CrossDomainMessageGasLimits", + name: "gasLimitType", + type: "uint8", + }, + { + indexed: false, + internalType: "uint256", + name: "newLimit", + type: "uint256", + }, + ], + name: "CrossDomainMessageGasLimitChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "debtSnapshotStaleTime", + type: "uint256", + }, + ], + name: "DebtSnapshotStaleTimeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "rate", + type: "uint256", + }, + ], + name: "EtherWrapperBurnFeeRateUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "maxETH", + type: "uint256", + }, + ], + name: "EtherWrapperMaxETHUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "rate", + type: "uint256", + }, + ], + name: "EtherWrapperMintFeeRateUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "dynamicFeeRounds", + type: "uint256", + }, + ], + name: "ExchangeDynamicFeeRoundsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "dynamicFeeThreshold", + type: "uint256", + }, + ], + name: "ExchangeDynamicFeeThresholdUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "dynamicFeeWeightDecay", + type: "uint256", + }, + ], + name: "ExchangeDynamicFeeWeightDecayUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "synthKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "newExchangeFeeRate", + type: "uint256", + }, + ], + name: "ExchangeFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "maxDynamicFee", + type: "uint256", + }, + ], + name: "ExchangeMaxDynamicFeeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newFeePeriodDuration", + type: "uint256", + }, + ], + name: "FeePeriodDurationUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newReward", + type: "uint256", + }, + ], + name: "FlagRewardUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "interactionDelay", + type: "uint256", + }, + ], + name: "InteractionDelayUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newRatio", + type: "uint256", + }, + ], + name: "IssuanceRatioUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newReward", + type: "uint256", + }, + ], + name: "LiquidateRewardUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newDelay", + type: "uint256", + }, + ], + name: "LiquidationDelayUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newDuration", + type: "uint256", + }, + ], + name: "LiquidationEscrowDurationUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newPenalty", + type: "uint256", + }, + ], + name: "LiquidationPenaltyUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newRatio", + type: "uint256", + }, + ], + name: "LiquidationRatioUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "minimumStakeTime", + type: "uint256", + }, + ], + name: "MinimumStakeTimeUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + ], + name: "PriceDeviationThresholdUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "synthKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "bool", + name: "enabled", + type: "bool", + }, + ], + name: "PureChainlinkPriceForAtomicSwapsEnabledUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "rateStalePeriod", + type: "uint256", + }, + ], + name: "RateStalePeriodUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newPenalty", + type: "uint256", + }, + ], + name: "SelfLiquidationPenaltyUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newPenalty", + type: "uint256", + }, + ], + name: "SnxLiquidationPenaltyUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "newTargetThreshold", + type: "uint256", + }, + ], + name: "TargetThresholdUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "enabled", + type: "bool", + }, + ], + name: "TradingRewardsEnabled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "waitingPeriodSecs", + type: "uint256", + }, + ], + name: "WaitingPeriodSecsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "wrapper", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "rate", + type: "int256", + }, + ], + name: "WrapperBurnFeeRateUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "wrapper", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "maxTokenAmount", + type: "uint256", + }, + ], + name: "WrapperMaxTokenAmountUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "wrapper", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "rate", + type: "int256", + }, + ], + name: "WrapperMintFeeRateUpdated", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "aggregatorWarningFlags", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "atomicEquivalentForDexPricing", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "atomicExchangeFeeRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "atomicMaxVolumePerBlock", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "atomicTwapWindow", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "atomicVolatilityConsiderationWindow", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "atomicVolatilityUpdateThreshold", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "collateral", + type: "address", + }, + ], + name: "collapseFeeRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "crossChainSynthTransferEnabled", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "enum MixinSystemSettings.CrossDomainMessageGasLimits", + name: "gasLimitType", + type: "uint8", + }, + ], + name: "crossDomainMessageGasLimit", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "debtSnapshotStaleTime", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "etherWrapperBurnFeeRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "etherWrapperMaxETH", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "etherWrapperMintFeeRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "exchangeDynamicFeeRounds", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "exchangeDynamicFeeThreshold", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "exchangeDynamicFeeWeightDecay", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "exchangeFeeRate", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "exchangeMaxDynamicFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "feePeriodDuration", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "flagReward", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "collateral", + type: "address", + }, + ], + name: "interactionDelay", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isResolverCached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "issuanceRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidateReward", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidationDelay", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidationEscrowDuration", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidationPenalty", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "liquidationRatio", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "minimumStakeTime", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "priceDeviationThresholdFactor", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "pureChainlinkPriceForAtomicSwapsEnabled", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "rateStalePeriod", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "rebuildCache", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolver", + outputs: [ + { + internalType: "contract AddressResolver", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "resolverAddressesRequired", + outputs: [ + { + internalType: "bytes32[]", + name: "addresses", + type: "bytes32[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "selfLiquidationPenalty", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_flags", + type: "address", + }, + ], + name: "setAggregatorWarningFlags", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_currencyKey", + type: "bytes32", + }, + { + internalType: "address", + name: "_equivalent", + type: "address", + }, + ], + name: "setAtomicEquivalentForDexPricing", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_exchangeFeeRate", + type: "uint256", + }, + ], + name: "setAtomicExchangeFeeRate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_maxVolume", + type: "uint256", + }, + ], + name: "setAtomicMaxVolumePerBlock", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_window", + type: "uint256", + }, + ], + name: "setAtomicTwapWindow", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_window", + type: "uint256", + }, + ], + name: "setAtomicVolatilityConsiderationWindow", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_threshold", + type: "uint256", + }, + ], + name: "setAtomicVolatilityUpdateThreshold", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_collateral", + type: "address", + }, + { + internalType: "uint256", + name: "_collapseFeeRate", + type: "uint256", + }, + ], + name: "setCollapseFeeRate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_value", + type: "uint256", + }, + ], + name: "setCrossChainSynthTransferEnabled", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "enum MixinSystemSettings.CrossDomainMessageGasLimits", + name: "_gasLimitType", + type: "uint8", + }, + { + internalType: "uint256", + name: "_crossDomainMessageGasLimit", + type: "uint256", + }, + ], + name: "setCrossDomainMessageGasLimit", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_seconds", + type: "uint256", + }, + ], + name: "setDebtSnapshotStaleTime", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_rate", + type: "uint256", + }, + ], + name: "setEtherWrapperBurnFeeRate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_maxETH", + type: "uint256", + }, + ], + name: "setEtherWrapperMaxETH", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_rate", + type: "uint256", + }, + ], + name: "setEtherWrapperMintFeeRate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "rounds", + type: "uint256", + }, + ], + name: "setExchangeDynamicFeeRounds", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "threshold", + type: "uint256", + }, + ], + name: "setExchangeDynamicFeeThreshold", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "weightDecay", + type: "uint256", + }, + ], + name: "setExchangeDynamicFeeWeightDecay", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "synthKeys", + type: "bytes32[]", + }, + { + internalType: "uint256[]", + name: "exchangeFeeRates", + type: "uint256[]", + }, + ], + name: "setExchangeFeeRateForSynths", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "maxFee", + type: "uint256", + }, + ], + name: "setExchangeMaxDynamicFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_feePeriodDuration", + type: "uint256", + }, + ], + name: "setFeePeriodDuration", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "setFlagReward", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_collateral", + type: "address", + }, + { + internalType: "uint256", + name: "_interactionDelay", + type: "uint256", + }, + ], + name: "setInteractionDelay", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "ratio", + type: "uint256", + }, + ], + name: "setIssuanceRatio", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "reward", + type: "uint256", + }, + ], + name: "setLiquidateReward", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "time", + type: "uint256", + }, + ], + name: "setLiquidationDelay", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + ], + name: "setLiquidationEscrowDuration", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "penalty", + type: "uint256", + }, + ], + name: "setLiquidationPenalty", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_liquidationRatio", + type: "uint256", + }, + ], + name: "setLiquidationRatio", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_seconds", + type: "uint256", + }, + ], + name: "setMinimumStakeTime", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_priceDeviationThresholdFactor", + type: "uint256", + }, + ], + name: "setPriceDeviationThresholdFactor", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_currencyKey", + type: "bytes32", + }, + { + internalType: "bool", + name: "_enabled", + type: "bool", + }, + ], + name: "setPureChainlinkPriceForAtomicSwapsEnabled", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "period", + type: "uint256", + }, + ], + name: "setRateStalePeriod", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "penalty", + type: "uint256", + }, + ], + name: "setSelfLiquidationPenalty", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "penalty", + type: "uint256", + }, + ], + name: "setSnxLiquidationPenalty", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "percent", + type: "uint256", + }, + ], + name: "setTargetThreshold", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "_tradingRewardsEnabled", + type: "bool", + }, + ], + name: "setTradingRewardsEnabled", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_waitingPeriodSecs", + type: "uint256", + }, + ], + name: "setWaitingPeriodSecs", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_wrapper", + type: "address", + }, + { + internalType: "int256", + name: "_rate", + type: "int256", + }, + ], + name: "setWrapperBurnFeeRate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_wrapper", + type: "address", + }, + { + internalType: "uint256", + name: "_maxTokenAmount", + type: "uint256", + }, + ], + name: "setWrapperMaxTokenAmount", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_wrapper", + type: "address", + }, + { + internalType: "int256", + name: "_rate", + type: "int256", + }, + ], + name: "setWrapperMintFeeRate", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "snxLiquidationPenalty", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "targetThreshold", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "tradingRewardsEnabled", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "waitingPeriodSecs", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "wrapper", + type: "address", + }, + ], + name: "wrapperBurnFeeRate", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "wrapper", + type: "address", + }, + ], + name: "wrapperMaxTokenAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "wrapper", + type: "address", + }, + ], + name: "wrapperMintFeeRate", + outputs: [ + { + internalType: "int256", + name: "", + type: "int256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +] as const; export class SystemSettings__factory { - static readonly abi = _abi - static createInterface(): SystemSettingsInterface { - return new utils.Interface(_abi) as SystemSettingsInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SystemSettings { - return new Contract(address, _abi, signerOrProvider) as SystemSettings - } + static readonly abi = _abi; + static createInterface(): SystemSettingsInterface { + return new utils.Interface(_abi) as SystemSettingsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SystemSettings { + return new Contract(address, _abi, signerOrProvider) as SystemSettings; + } } diff --git a/packages/sdk/src/contracts/types/factories/SystemStatus__factory.ts b/packages/sdk/src/contracts/types/factories/SystemStatus__factory.ts index 5c5a07e9b6..55d7c02f4c 100644 --- a/packages/sdk/src/contracts/types/factories/SystemStatus__factory.ts +++ b/packages/sdk/src/contracts/types/factories/SystemStatus__factory.ts @@ -2,1291 +2,1294 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { SystemStatus, SystemStatusInterface } from '../SystemStatus' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { SystemStatus, SystemStatusInterface } from "../SystemStatus"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'section', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'bool', - name: 'canSuspend', - type: 'bool', - }, - { - indexed: false, - internalType: 'bool', - name: 'canResume', - type: 'bool', - }, - ], - name: 'AccessControlUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'ExchangeResumed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'ExchangeSuspended', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'FuturesMarketResumed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'FuturesMarketSuspended', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'FuturesResumed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'FuturesSuspended', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'IssuanceResumed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'IssuanceSuspended', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'SynthExchangeResumed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'SynthExchangeSuspended', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'SynthResumed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'SynthSuspended', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'SystemResumed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'SystemSuspended', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'CONTRACT_NAME', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'SECTION_EXCHANGE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'SECTION_FUTURES', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'SECTION_ISSUANCE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'SECTION_SYNTH', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'SECTION_SYNTH_EXCHANGE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'SECTION_SYSTEM', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'SUSPENSION_REASON_UPGRADE', - outputs: [ - { - internalType: 'uint248', - name: '', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'acceptOwnership', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'accessControl', - outputs: [ - { - internalType: 'bool', - name: 'canSuspend', - type: 'bool', - }, - { - internalType: 'bool', - name: 'canResume', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'exchangeSuspension', - outputs: [ - { - internalType: 'bool', - name: 'suspended', - type: 'bool', - }, - { - internalType: 'uint248', - name: 'reason', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'futuresMarketSuspension', - outputs: [ - { - internalType: 'bool', - name: 'suspended', - type: 'bool', - }, - { - internalType: 'uint248', - name: 'reason', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'futuresSuspension', - outputs: [ - { - internalType: 'bool', - name: 'suspended', - type: 'bool', - }, - { - internalType: 'uint248', - name: 'reason', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'marketKeys', - type: 'bytes32[]', - }, - ], - name: 'getFuturesMarketSuspensions', - outputs: [ - { - internalType: 'bool[]', - name: 'suspensions', - type: 'bool[]', - }, - { - internalType: 'uint256[]', - name: 'reasons', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'synths', - type: 'bytes32[]', - }, - ], - name: 'getSynthExchangeSuspensions', - outputs: [ - { - internalType: 'bool[]', - name: 'exchangeSuspensions', - type: 'bool[]', - }, - { - internalType: 'uint256[]', - name: 'reasons', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32[]', - name: 'synths', - type: 'bytes32[]', - }, - ], - name: 'getSynthSuspensions', - outputs: [ - { - internalType: 'bool[]', - name: 'suspensions', - type: 'bool[]', - }, - { - internalType: 'uint256[]', - name: 'reasons', - type: 'uint256[]', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'isSystemUpgrading', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'issuanceSuspension', - outputs: [ - { - internalType: 'bool', - name: 'suspended', - type: 'bool', - }, - { - internalType: 'uint248', - name: 'reason', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'requireExchangeActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'requireExchangeBetweenSynthsAllowed', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'requireFuturesActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - ], - name: 'requireFuturesMarketActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'requireIssuanceActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'requireSynthActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'requireSynthExchangeActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'sourceCurrencyKey', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'destinationCurrencyKey', - type: 'bytes32', - }, - ], - name: 'requireSynthsActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'requireSystemActive', - outputs: [], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'resumeExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'resumeFutures', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - ], - name: 'resumeFuturesMarket', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'marketKeys', - type: 'bytes32[]', - }, - ], - name: 'resumeFuturesMarkets', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'resumeIssuance', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'resumeSynth', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'resumeSynthExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - ], - name: 'resumeSynths', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - ], - name: 'resumeSynthsExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'resumeSystem', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendFutures', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'marketKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendFuturesMarket', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'marketKeys', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendFuturesMarkets', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendIssuance', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendSynth', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendSynthExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendSynths', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'currencyKeys', - type: 'bytes32[]', - }, - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendSynthsExchange', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'uint256', - name: 'reason', - type: 'uint256', - }, - ], - name: 'suspendSystem', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'synthExchangeSuspension', - outputs: [ - { - internalType: 'bool', - name: 'suspended', - type: 'bool', - }, - { - internalType: 'uint248', - name: 'reason', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: 'currencyKey', - type: 'bytes32', - }, - ], - name: 'synthSuspended', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'synthSuspension', - outputs: [ - { - internalType: 'bool', - name: 'suspended', - type: 'bool', - }, - { - internalType: 'uint248', - name: 'reason', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'systemSuspended', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'systemSuspension', - outputs: [ - { - internalType: 'bool', - name: 'suspended', - type: 'bool', - }, - { - internalType: 'uint248', - name: 'reason', - type: 'uint248', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32', - name: 'section', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'bool', - name: 'canSuspend', - type: 'bool', - }, - { - internalType: 'bool', - name: 'canResume', - type: 'bool', - }, - ], - name: 'updateAccessControl', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { - internalType: 'bytes32[]', - name: 'sections', - type: 'bytes32[]', - }, - { - internalType: 'address[]', - name: 'accounts', - type: 'address[]', - }, - { - internalType: 'bool[]', - name: 'canSuspends', - type: 'bool[]', - }, - { - internalType: 'bool[]', - name: 'canResumes', - type: 'bool[]', - }, - ], - name: 'updateAccessControls', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "section", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "canSuspend", + type: "bool", + }, + { + indexed: false, + internalType: "bool", + name: "canResume", + type: "bool", + }, + ], + name: "AccessControlUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "ExchangeResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "ExchangeSuspended", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "FuturesMarketResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "FuturesMarketSuspended", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "FuturesResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "FuturesSuspended", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "IssuanceResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "IssuanceSuspended", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "SynthExchangeResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "SynthExchangeSuspended", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "SynthResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "SynthSuspended", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "SystemResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "SystemSuspended", + type: "event", + }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "SECTION_EXCHANGE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "SECTION_FUTURES", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "SECTION_ISSUANCE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "SECTION_SYNTH", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "SECTION_SYNTH_EXCHANGE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "SECTION_SYSTEM", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "SUSPENSION_REASON_UPGRADE", + outputs: [ + { + internalType: "uint248", + name: "", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "accessControl", + outputs: [ + { + internalType: "bool", + name: "canSuspend", + type: "bool", + }, + { + internalType: "bool", + name: "canResume", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "exchangeSuspension", + outputs: [ + { + internalType: "bool", + name: "suspended", + type: "bool", + }, + { + internalType: "uint248", + name: "reason", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "futuresMarketSuspension", + outputs: [ + { + internalType: "bool", + name: "suspended", + type: "bool", + }, + { + internalType: "uint248", + name: "reason", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "futuresSuspension", + outputs: [ + { + internalType: "bool", + name: "suspended", + type: "bool", + }, + { + internalType: "uint248", + name: "reason", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "marketKeys", + type: "bytes32[]", + }, + ], + name: "getFuturesMarketSuspensions", + outputs: [ + { + internalType: "bool[]", + name: "suspensions", + type: "bool[]", + }, + { + internalType: "uint256[]", + name: "reasons", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "synths", + type: "bytes32[]", + }, + ], + name: "getSynthExchangeSuspensions", + outputs: [ + { + internalType: "bool[]", + name: "exchangeSuspensions", + type: "bool[]", + }, + { + internalType: "uint256[]", + name: "reasons", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32[]", + name: "synths", + type: "bytes32[]", + }, + ], + name: "getSynthSuspensions", + outputs: [ + { + internalType: "bool[]", + name: "suspensions", + type: "bool[]", + }, + { + internalType: "uint256[]", + name: "reasons", + type: "uint256[]", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isSystemUpgrading", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "issuanceSuspension", + outputs: [ + { + internalType: "bool", + name: "suspended", + type: "bool", + }, + { + internalType: "uint248", + name: "reason", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "requireExchangeActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "requireExchangeBetweenSynthsAllowed", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "requireFuturesActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + ], + name: "requireFuturesMarketActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "requireIssuanceActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "requireSynthActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "requireSynthExchangeActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "sourceCurrencyKey", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "destinationCurrencyKey", + type: "bytes32", + }, + ], + name: "requireSynthsActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "requireSystemActive", + outputs: [], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "resumeExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "resumeFutures", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + ], + name: "resumeFuturesMarket", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "marketKeys", + type: "bytes32[]", + }, + ], + name: "resumeFuturesMarkets", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "resumeIssuance", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "resumeSynth", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "resumeSynthExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + ], + name: "resumeSynths", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + ], + name: "resumeSynthsExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "resumeSystem", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendFutures", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendFuturesMarket", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "marketKeys", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendFuturesMarkets", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendIssuance", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendSynth", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendSynthExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendSynths", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "currencyKeys", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendSynthsExchange", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "reason", + type: "uint256", + }, + ], + name: "suspendSystem", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "synthExchangeSuspension", + outputs: [ + { + internalType: "bool", + name: "suspended", + type: "bool", + }, + { + internalType: "uint248", + name: "reason", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "currencyKey", + type: "bytes32", + }, + ], + name: "synthSuspended", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "synthSuspension", + outputs: [ + { + internalType: "bool", + name: "suspended", + type: "bool", + }, + { + internalType: "uint248", + name: "reason", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "systemSuspended", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "systemSuspension", + outputs: [ + { + internalType: "bool", + name: "suspended", + type: "bool", + }, + { + internalType: "uint248", + name: "reason", + type: "uint248", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "section", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "bool", + name: "canSuspend", + type: "bool", + }, + { + internalType: "bool", + name: "canResume", + type: "bool", + }, + ], + name: "updateAccessControl", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32[]", + name: "sections", + type: "bytes32[]", + }, + { + internalType: "address[]", + name: "accounts", + type: "address[]", + }, + { + internalType: "bool[]", + name: "canSuspends", + type: "bool[]", + }, + { + internalType: "bool[]", + name: "canResumes", + type: "bool[]", + }, + ], + name: "updateAccessControls", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, +] as const; export class SystemStatus__factory { - static readonly abi = _abi - static createInterface(): SystemStatusInterface { - return new utils.Interface(_abi) as SystemStatusInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): SystemStatus { - return new Contract(address, _abi, signerOrProvider) as SystemStatus - } + static readonly abi = _abi; + static createInterface(): SystemStatusInterface { + return new utils.Interface(_abi) as SystemStatusInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SystemStatus { + return new Contract(address, _abi, signerOrProvider) as SystemStatus; + } } diff --git a/packages/sdk/src/contracts/types/factories/VKwentaRedeemer__factory.ts b/packages/sdk/src/contracts/types/factories/VKwentaRedeemer__factory.ts index 3e081462f5..b845b05363 100644 --- a/packages/sdk/src/contracts/types/factories/VKwentaRedeemer__factory.ts +++ b/packages/sdk/src/contracts/types/factories/VKwentaRedeemer__factory.ts @@ -2,87 +2,93 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { VKwentaRedeemer, VKwentaRedeemerInterface } from '../VKwentaRedeemer' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + VKwentaRedeemer, + VKwentaRedeemerInterface, +} from "../VKwentaRedeemer"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_vToken', - type: 'address', - }, - { - internalType: 'address', - name: '_token', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'redeemer', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'redeemedAmount', - type: 'uint256', - }, - ], - name: 'Redeemed', - type: 'event', - }, - { - inputs: [], - name: 'redeem', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'token', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'vToken', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_vToken", + type: "address", + }, + { + internalType: "address", + name: "_token", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "redeemer", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "redeemedAmount", + type: "uint256", + }, + ], + name: "Redeemed", + type: "event", + }, + { + inputs: [], + name: "redeem", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "token", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "vToken", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class VKwentaRedeemer__factory { - static readonly abi = _abi - static createInterface(): VKwentaRedeemerInterface { - return new utils.Interface(_abi) as VKwentaRedeemerInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): VKwentaRedeemer { - return new Contract(address, _abi, signerOrProvider) as VKwentaRedeemer - } + static readonly abi = _abi; + static createInterface(): VKwentaRedeemerInterface { + return new utils.Interface(_abi) as VKwentaRedeemerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): VKwentaRedeemer { + return new Contract(address, _abi, signerOrProvider) as VKwentaRedeemer; + } } diff --git a/packages/sdk/src/contracts/types/factories/VeKwentaRedeemer__factory.ts b/packages/sdk/src/contracts/types/factories/VeKwentaRedeemer__factory.ts index 0f9c40b207..0f70b6c656 100644 --- a/packages/sdk/src/contracts/types/factories/VeKwentaRedeemer__factory.ts +++ b/packages/sdk/src/contracts/types/factories/VeKwentaRedeemer__factory.ts @@ -2,155 +2,161 @@ /* tslint:disable */ /* eslint-disable */ -import { Contract, Signer, utils } from 'ethers' -import type { Provider } from '@ethersproject/providers' -import type { VeKwentaRedeemer, VeKwentaRedeemerInterface } from '../VeKwentaRedeemer' +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + VeKwentaRedeemer, + VeKwentaRedeemerInterface, +} from "../VeKwentaRedeemer"; const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: '_veKwenta', - type: 'address', - }, - { - internalType: 'address', - name: '_kwenta', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardEscrow', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [ - { - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - internalType: 'uint256', - name: 'callerBalance', - type: 'uint256', - }, - ], - name: 'InvalidCallerBalance', - type: 'error', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'contractBalance', - type: 'uint256', - }, - ], - name: 'InvalidContractBalance', - type: 'error', - }, - { - inputs: [ - { - internalType: 'address', - name: 'caller', - type: 'address', - }, - ], - name: 'TransferFailed', - type: 'error', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'redeemer', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'beneficiary', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'redeemedAmount', - type: 'uint256', - }, - ], - name: 'Redeemed', - type: 'event', - }, - { - inputs: [], - name: 'kwenta', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_beneficiary', - type: 'address', - }, - ], - name: 'redeem', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'rewardEscrow', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'veKwenta', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_veKwenta", + type: "address", + }, + { + internalType: "address", + name: "_kwenta", + type: "address", + }, + { + internalType: "address", + name: "_rewardEscrow", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "uint256", + name: "callerBalance", + type: "uint256", + }, + ], + name: "InvalidCallerBalance", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "contractBalance", + type: "uint256", + }, + ], + name: "InvalidContractBalance", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "TransferFailed", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "redeemer", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "beneficiary", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "redeemedAmount", + type: "uint256", + }, + ], + name: "Redeemed", + type: "event", + }, + { + inputs: [], + name: "kwenta", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_beneficiary", + type: "address", + }, + ], + name: "redeem", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "rewardEscrow", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "veKwenta", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; export class VeKwentaRedeemer__factory { - static readonly abi = _abi - static createInterface(): VeKwentaRedeemerInterface { - return new utils.Interface(_abi) as VeKwentaRedeemerInterface - } - static connect(address: string, signerOrProvider: Signer | Provider): VeKwentaRedeemer { - return new Contract(address, _abi, signerOrProvider) as VeKwentaRedeemer - } + static readonly abi = _abi; + static createInterface(): VeKwentaRedeemerInterface { + return new utils.Interface(_abi) as VeKwentaRedeemerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): VeKwentaRedeemer { + return new Contract(address, _abi, signerOrProvider) as VeKwentaRedeemer; + } } diff --git a/packages/sdk/src/contracts/types/factories/index.ts b/packages/sdk/src/contracts/types/factories/index.ts index 88c56ce323..fe646ad3ca 100644 --- a/packages/sdk/src/contracts/types/factories/index.ts +++ b/packages/sdk/src/contracts/types/factories/index.ts @@ -19,6 +19,8 @@ export { PerpsV2Market__factory } from "./PerpsV2Market__factory"; export { PerpsV2MarketData__factory } from "./PerpsV2MarketData__factory"; export { PerpsV2MarketSettings__factory } from "./PerpsV2MarketSettings__factory"; export { PerpsV2MarketViews__factory } from "./PerpsV2MarketViews__factory"; +export { PerpsV3AccountProxy__factory } from "./PerpsV3AccountProxy__factory"; +export { PerpsV3MarketProxy__factory } from "./PerpsV3MarketProxy__factory"; export { Pyth__factory } from "./Pyth__factory"; export { ReverseRecords__factory } from "./ReverseRecords__factory"; export { RewardEscrow__factory } from "./RewardEscrow__factory"; diff --git a/packages/sdk/src/contracts/types/index.ts b/packages/sdk/src/contracts/types/index.ts index b6b8e1c294..ef9023e926 100644 --- a/packages/sdk/src/contracts/types/index.ts +++ b/packages/sdk/src/contracts/types/index.ts @@ -19,6 +19,8 @@ export type { PerpsV2Market } from "./PerpsV2Market"; export type { PerpsV2MarketData } from "./PerpsV2MarketData"; export type { PerpsV2MarketSettings } from "./PerpsV2MarketSettings"; export type { PerpsV2MarketViews } from "./PerpsV2MarketViews"; +export type { PerpsV3AccountProxy } from "./PerpsV3AccountProxy"; +export type { PerpsV3MarketProxy } from "./PerpsV3MarketProxy"; export type { Pyth } from "./Pyth"; export type { ReverseRecords } from "./ReverseRecords"; export type { RewardEscrow } from "./RewardEscrow"; @@ -55,6 +57,8 @@ export { PerpsV2Market__factory } from "./factories/PerpsV2Market__factory"; export { PerpsV2MarketData__factory } from "./factories/PerpsV2MarketData__factory"; export { PerpsV2MarketSettings__factory } from "./factories/PerpsV2MarketSettings__factory"; export { PerpsV2MarketViews__factory } from "./factories/PerpsV2MarketViews__factory"; +export { PerpsV3AccountProxy__factory } from "./factories/PerpsV3AccountProxy__factory"; +export { PerpsV3MarketProxy__factory } from "./factories/PerpsV3MarketProxy__factory"; export { Pyth__factory } from "./factories/Pyth__factory"; export { ReverseRecords__factory } from "./factories/ReverseRecords__factory"; export { RewardEscrow__factory } from "./factories/RewardEscrow__factory"; diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index fa814dc4bc..e39c83cf3c 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -3,6 +3,7 @@ import { ethers } from 'ethers' import Context, { IContext } from './context' import ExchangeService from './services/exchange' import FuturesService from './services/futures' +import PerpsV3 from './services/perpsV3' import KwentaTokenService from './services/kwentaToken' import PricesService from './services/prices' import SynthsService from './services/synths' @@ -15,6 +16,7 @@ export default class KwentaSDK { public exchange: ExchangeService public futures: FuturesService + public perpsV3: PerpsV3 public synths: SynthsService public transactions: TransactionsService public kwentaToken: KwentaTokenService @@ -32,6 +34,7 @@ export default class KwentaSDK { this.kwentaToken = new KwentaTokenService(this) this.stats = new StatsService(this) this.system = new SystemService(this) + this.perpsV3 = new PerpsV3(this) } public setProvider(provider: ethers.providers.Provider) { diff --git a/packages/sdk/src/queries/futures.ts b/packages/sdk/src/queries/futures.ts index d164a5d861..c4ed620901 100644 --- a/packages/sdk/src/queries/futures.ts +++ b/packages/sdk/src/queries/futures.ts @@ -31,7 +31,7 @@ export const queryAccountsFromSubgraph = async ( return response?.crossMarginAccounts.map((cm: { id: string }) => cm.id) || [] } -export const queryCrossMarginAccounts = async ( +export const querySmartMarginAccounts = async ( sdk: KwentaSDK, walletAddress: string ): Promise => { @@ -90,58 +90,16 @@ export const queryTrades = async ( ) } -export const queryPositionHistory = (sdk: KwentaSDK, account: string) => { - return getFuturesPositions( - sdk.futures.futuresGqlEndpoint, - { - where: { - abstractAccount: account, - }, - first: 99999, - orderBy: 'openTimestamp', - orderDirection: 'desc', - }, - { - id: true, - lastTxHash: true, - openTimestamp: true, - closeTimestamp: true, - timestamp: true, - market: true, - marketKey: true, - asset: true, - account: true, - abstractAccount: true, - accountType: true, - isOpen: true, - isLiquidated: true, - trades: true, - totalVolume: true, - size: true, - initialMargin: true, - margin: true, - pnl: true, - feesPaid: true, - netFunding: true, - pnlWithFeesPaid: true, - netTransfers: true, - totalDeposits: true, - fundingIndex: true, - entryPrice: true, - avgEntryPrice: true, - lastPrice: true, - exitPrice: true, - } - ) -} - -export const queryCompletePositionHistory = (sdk: KwentaSDK, account: string) => { +export const queryPositionHistory = ( + sdk: KwentaSDK, + account: string, + accountType: 'eoa' | 'account' +) => { + const accountQuery = accountType === 'eoa' ? { account: account } : { abstractAccount: account } return getFuturesPositions( sdk.futures.futuresGqlEndpoint, { - where: { - account: account, - }, + where: accountQuery, first: 99999, orderBy: 'openTimestamp', orderDirection: 'desc', diff --git a/packages/sdk/src/queries/perpsV3.ts b/packages/sdk/src/queries/perpsV3.ts new file mode 100644 index 0000000000..7e0fbac745 --- /dev/null +++ b/packages/sdk/src/queries/perpsV3.ts @@ -0,0 +1,88 @@ +import request, { gql } from 'graphql-request' + +import KwentaSDK from '..' +import { PerpsV3SubgraphMarket, SettlementSubgraphType } from '../types' + +export const queryPerpsV3Markets = async (sdk: KwentaSDK): Promise => { + const response: any = await request( + sdk.perpsV3.subgraphUrl, + gql` + query { + markets { + id + perpsMarketId + marketOwner + marketName + marketSymbol + feedId + owner + maxFundingVelocity + skewScale + initialMarginFraction + maintenanceMarginFraction + liquidationRewardRatioD18 + maxLiquidationLimitAccumulationMultiplier + lockedOiPercent + makerFee + takerFee + } + } + ` + ) + + return response.markets +} + +export const queryPerpsV3Accounts = async ( + sdk: KwentaSDK, + walletAddress: string +): Promise< + { + id: string + accountId: string + owner: string + }[] +> => { + const response: any = await request( + sdk.perpsV3.subgraphUrl, + gql` + query GetAccounts($owner: String) { + accounts(where: { owner_contains: $owner }) { + id + accountId + owner + } + } + `, + { + owner: walletAddress, + } + ) + + return response.accounts +} + +export const querySettlementStrategies = async ( + sdk: KwentaSDK +): Promise => { + const response: any = await request( + sdk.perpsV3.subgraphUrl, + gql` + query GetSettlementStrategies { + settlementStrategies(orderBy: "marketId", orderDirection: "desc") { + id + marketId + strategyId + strategyType + settlementDelay + settlementWindowDuration + url + settlementReward + priceDeviationTolerance + } + } + ` + ) + + return response.settlementStrategies +} diff --git a/packages/sdk/src/services/exchange.ts b/packages/sdk/src/services/exchange.ts index 3c1c7197f5..43cfa35cdb 100644 --- a/packages/sdk/src/services/exchange.ts +++ b/packages/sdk/src/services/exchange.ts @@ -61,35 +61,41 @@ export default class ExchangeService { return this.sdk.prices.currentPrices.onChain } - public getTxProvider(baseCurrencyKey: string, quoteCurrencyKey: string) { - if (!baseCurrencyKey || !quoteCurrencyKey) return undefined + /** + * @desc - Get the provider to be used for transactions on a currency pair. + * @param fromCurrencyKey The currency key of the source token. + * @param toCurrencyKey The currency key of the destination token. + * @returns Returns one of '1inch', 'synthetix', or 'synthswap'. + */ + public getTxProvider(fromCurrencyKey: string, toCurrencyKey: string) { + if (!toCurrencyKey || !fromCurrencyKey) return undefined if ( - this.synthsMap?.[baseCurrencyKey as SynthSymbol] && - this.synthsMap?.[quoteCurrencyKey as SynthSymbol] + this.synthsMap?.[toCurrencyKey as SynthSymbol] && + this.synthsMap?.[fromCurrencyKey as SynthSymbol] ) return 'synthetix' - if (this.tokensMap[baseCurrencyKey] && this.tokensMap[quoteCurrencyKey]) return '1inch' + if (this.tokensMap[toCurrencyKey] && this.tokensMap[fromCurrencyKey]) return '1inch' return 'synthswap' } public async getTradePrices( txProvider: ReturnType, - quoteCurrencyKey: string, - baseCurrencyKey: string, - quoteAmountWei: Wei, - baseAmountWei: Wei + fromCurrencyKey: string, + toCurrencyKey: string, + fromAmount: Wei, + toAmount: Wei ) { - const coinGeckoPrices = await this.getCoingeckoPrices(quoteCurrencyKey, baseCurrencyKey) + const coinGeckoPrices = await this.getCoingeckoPrices(fromCurrencyKey, toCurrencyKey) const [quotePriceRate, basePriceRate] = await Promise.all( - [quoteCurrencyKey, baseCurrencyKey].map((currencyKey) => + [fromCurrencyKey, toCurrencyKey].map((currencyKey) => this.getPriceRate(currencyKey, txProvider, coinGeckoPrices) ) ) - let quoteTradePrice = quoteAmountWei.mul(quotePriceRate || 0) - let baseTradePrice = baseAmountWei.mul(basePriceRate || 0) + let quoteTradePrice = fromAmount.mul(quotePriceRate || 0) + let baseTradePrice = toAmount.mul(basePriceRate || 0) if (this.sUSDRate) { quoteTradePrice = quoteTradePrice.div(this.sUSDRate) @@ -100,22 +106,16 @@ export default class ExchangeService { } public async getSlippagePercent( - quoteCurrencyKey: string, - baseCurrencyKey: string, - quoteAmountWei: Wei, - baseAmountWei: Wei + fromCurrencyKey: string, + toCurrencyKey: string, + fromAmount: Wei, + toAmount: Wei ) { - const txProvider = this.getTxProvider(baseCurrencyKey, quoteCurrencyKey) + const txProvider = this.getTxProvider(fromCurrencyKey, toCurrencyKey) if (txProvider === '1inch') { const { quoteTradePrice: totalTradePrice, baseTradePrice: estimatedBaseTradePrice } = - await this.getTradePrices( - txProvider, - quoteCurrencyKey, - baseCurrencyKey, - quoteAmountWei, - baseAmountWei - ) + await this.getTradePrices(txProvider, fromCurrencyKey, toCurrencyKey, fromAmount, toAmount) if (totalTradePrice.gt(0) && estimatedBaseTradePrice.gt(0)) { return totalTradePrice.sub(estimatedBaseTradePrice).div(totalTradePrice).neg() @@ -125,17 +125,17 @@ export default class ExchangeService { return undefined } - public async getBaseFeeRate(baseCurrencyKey: string, quoteCurrencyKey: string) { + public async getBaseFeeRate(fromCurrencyKey: string, toCurrencyKey: string) { if (!this.sdk.context.contracts.SystemSettings) { throw new Error(sdkErrors.UNSUPPORTED_NETWORK) } const [sourceCurrencyFeeRate, destinationCurrencyFeeRate] = await Promise.all([ this.sdk.context.contracts.SystemSettings.exchangeFeeRate( - ethers.utils.formatBytes32String(baseCurrencyKey) + ethers.utils.formatBytes32String(toCurrencyKey) ), this.sdk.context.contracts.SystemSettings.exchangeFeeRate( - ethers.utils.formatBytes32String(quoteCurrencyKey) + ethers.utils.formatBytes32String(fromCurrencyKey) ), ]) @@ -144,39 +144,49 @@ export default class ExchangeService { : wei(0) } - public async getExchangeFeeRate(quoteCurrencyKey: string, baseCurrencyKey: string) { + /** + * @desc - Get the fee rate for exchanging between two currencies. + * @param fromCurrencyKey The currency key of the source token. + * @param toCurrencyKey The currency key of the destination token. + * @returns Returns the fee rate. + */ + public async getExchangeFeeRate(fromCurrencyKey: string, toCurrencyKey: string) { if (!this.sdk.context.contracts.Exchanger) { throw new Error(sdkErrors.UNSUPPORTED_NETWORK) } const exchangeFeeRate = await this.sdk.context.contracts.Exchanger.feeRateForExchange( - ethers.utils.formatBytes32String(quoteCurrencyKey), - ethers.utils.formatBytes32String(baseCurrencyKey) + ethers.utils.formatBytes32String(fromCurrencyKey), + ethers.utils.formatBytes32String(toCurrencyKey) ) return wei(exchangeFeeRate) } - public async getRate(baseCurrencyKey: string, quoteCurrencyKey: string) { - const baseCurrencyTokenAddress = this.getTokenAddress(baseCurrencyKey) - const quoteCurrencyTokenAddress = this.getTokenAddress(quoteCurrencyKey) + public async getRate(fromCurrencyKey: string, toCurrencyKey: string) { + const fromTokenAddress = this.getTokenAddress(fromCurrencyKey) + const toTokenAddress = this.getTokenAddress(toCurrencyKey) const [[quoteRate, baseRate], coinGeckoPrices] = await Promise.all([ - this.getPairRates(quoteCurrencyKey, baseCurrencyKey), - this.getCoingeckoPrices(quoteCurrencyKey, baseCurrencyKey), + this.getPairRates(fromCurrencyKey, toCurrencyKey), + this.getCoingeckoPrices(fromCurrencyKey, toCurrencyKey), ]) const base = baseRate.lte(0) - ? this.getCoingeckoPricesForCurrencies(coinGeckoPrices, baseCurrencyTokenAddress) + ? this.getCoingeckoPricesForCurrencies(coinGeckoPrices, toTokenAddress) : baseRate const quote = quoteRate.lte(0) - ? this.getCoingeckoPricesForCurrencies(coinGeckoPrices, quoteCurrencyTokenAddress) + ? this.getCoingeckoPricesForCurrencies(coinGeckoPrices, fromTokenAddress) : quoteRate return base.gt(0) && quote.gt(0) ? quote.div(base) : wei(0) } + /** + * @desc Get the list of whitelisted tokens on 1inch. + * @returns Returns the list of tokens currently whitelisted on 1inch. + */ public async getOneInchTokenList() { const response = await axios.get(this.oneInchApiUrl + 'tokens') @@ -319,16 +329,16 @@ export default class ExchangeService { } public async swapOneInchMeta( - quoteTokenAddress: string, - baseTokenAddress: string, + fromTokenAddress: string, + toTokenAddress: string, amount: string, - quoteDecimals: number + fromTokenDecimals: number ) { const params = await this.getOneInchSwapParams( - quoteTokenAddress, - baseTokenAddress, + fromTokenAddress, + toTokenAddress, amount, - quoteDecimals + fromTokenDecimals ) const { from, to, data, value } = params.tx @@ -342,16 +352,16 @@ export default class ExchangeService { } public async swapOneInch( - quoteTokenAddress: string, - baseTokenAddress: string, + fromTokenAddress: string, + toTokenAddress: string, amount: string, - quoteDecimals: number + fromTokenDecimals: number ) { const params = await this.getOneInchSwapParams( - quoteTokenAddress, - baseTokenAddress, + fromTokenAddress, + toTokenAddress, amount, - quoteDecimals + fromTokenDecimals ) const { from, to, data, value } = params.tx @@ -360,16 +370,16 @@ export default class ExchangeService { } public async swapOneInchGasEstimate( - quoteTokenAddress: string, - baseTokenAddress: string, + fromTokenAddress: string, + toTokenAddress: string, amount: string, - quoteDecimals: number + fromTokenDecimals: number ) { const params = await this.getOneInchSwapParams( - quoteTokenAddress, - baseTokenAddress, + fromTokenAddress, + toTokenAddress, amount, - quoteDecimals + fromTokenDecimals ) return params.tx.gas @@ -402,14 +412,14 @@ export default class ExchangeService { return wei(value) ?? wei(0) } - public async approveSwap(quoteCurrencyKey: string, baseCurrencyKey: string) { - const txProvider = this.getTxProvider(baseCurrencyKey, quoteCurrencyKey) - const quoteCurrencyContract = this.getQuoteCurrencyContract(quoteCurrencyKey) + public async approveSwap(fromCurrencyKey: string, toCurrencyKey: string) { + const txProvider = this.getTxProvider(fromCurrencyKey, toCurrencyKey) + const fromCurrencyContract = this.getCurrencyContract(fromCurrencyKey) const approveAddress = await this.getApproveAddress(txProvider) - if (quoteCurrencyContract) { + if (fromCurrencyContract) { const { hash } = await this.sdk.transactions.createContractTxn( - quoteCurrencyContract, + fromCurrencyContract, 'approve', [approveAddress, ethers.constants.MaxUint256] ) @@ -420,15 +430,15 @@ export default class ExchangeService { return undefined } - public async handleSettle(baseCurrencyKey: string) { + public async handleSettle(toCurrencyKey: string) { if (!this.sdk.context.isL2) { throw new Error(sdkErrors.REQUIRES_L2) } - const numEntries = await this.getNumEntries(baseCurrencyKey) + const numEntries = await this.getNumEntries(toCurrencyKey) if (numEntries > 12) { - const destinationCurrencyKey = ethers.utils.formatBytes32String(baseCurrencyKey) + const destinationCurrencyKey = ethers.utils.formatBytes32String(toCurrencyKey) const { hash } = await this.sdk.transactions.createSynthetixTxn('Exchanger', 'settle', [ this.sdk.context.walletAddress, @@ -444,40 +454,35 @@ export default class ExchangeService { // TODO: Refactor handleExchange public async handleExchange( - quoteCurrencyKey: string, - baseCurrencyKey: string, - quoteAmount: string, - baseAmount: string + fromCurrencyKey: string, + toCurrencyKey: string, + fromAmount: string, + toAmount: string ) { - const txProvider = this.getTxProvider(baseCurrencyKey, quoteCurrencyKey) - const quoteCurrencyTokenAddress = this.getTokenAddress(quoteCurrencyKey) - const baseCurrencyTokenAddress = this.getTokenAddress(baseCurrencyKey) - const quoteDecimals = this.getTokenDecimals(quoteCurrencyKey) + const txProvider = this.getTxProvider(fromCurrencyKey, toCurrencyKey) + const fromTokenAddress = this.getTokenAddress(fromCurrencyKey) + const toTokenAddress = this.getTokenAddress(toCurrencyKey) + const fromTokenDecimals = this.getTokenDecimals(fromCurrencyKey) let tx: ethers.ContractTransaction | null = null if (txProvider === '1inch' && !!this.tokensMap) { - tx = await this.swapOneInch( - quoteCurrencyTokenAddress, - baseCurrencyTokenAddress, - quoteAmount, - quoteDecimals - ) + tx = await this.swapOneInch(fromTokenAddress, toTokenAddress, fromAmount, fromTokenDecimals) } else if (txProvider === 'synthswap') { // @ts-ignore TODO: Fix variable types tx = await this.swapSynthSwap( - this.allTokensMap[quoteCurrencyKey], - this.allTokensMap[baseCurrencyKey], - quoteAmount + this.allTokensMap[fromCurrencyKey], + this.allTokensMap[toCurrencyKey], + fromAmount ) } else { - const isAtomic = this.checkIsAtomic(baseCurrencyKey, quoteCurrencyKey) + const isAtomic = this.checkIsAtomic(fromCurrencyKey, toCurrencyKey) const exchangeParams = this.getExchangeParams( - quoteCurrencyKey, - baseCurrencyKey, - wei(quoteAmount), - wei(baseAmount).mul(wei(1).sub(ATOMIC_EXCHANGE_SLIPPAGE)), + fromCurrencyKey, + toCurrencyKey, + wei(fromAmount), + wei(toAmount).mul(wei(1).sub(ATOMIC_EXCHANGE_SLIPPAGE)), isAtomic ) @@ -501,22 +506,22 @@ export default class ExchangeService { } public async getTransactionFee( - quoteCurrencyKey: string, - baseCurrencyKey: string, - quoteAmount: string, - baseAmount: string + fromCurrencyKey: string, + toCurrencyKey: string, + fromAmount: string, + toAmount: string ) { const gasPrices = await getEthGasPrice(this.sdk.context.networkId, this.sdk.context.provider) - const txProvider = this.getTxProvider(baseCurrencyKey, quoteCurrencyKey) + const txProvider = this.getTxProvider(fromCurrencyKey, toCurrencyKey) const ethPriceRate = this.getExchangeRatesForCurrencies(this.exchangeRates, 'sETH', 'sUSD') const gasPrice = gasPrices.fast if (txProvider === 'synthswap' || txProvider === '1inch') { const gasInfo = await this.getGasEstimateForExchange( txProvider, - quoteCurrencyKey, - baseCurrencyKey, - quoteAmount + fromCurrencyKey, + toCurrencyKey, + fromAmount ) return getTransactionPrice( @@ -530,13 +535,13 @@ export default class ExchangeService { throw new Error(sdkErrors.UNSUPPORTED_NETWORK) } - const isAtomic = this.checkIsAtomic(baseCurrencyKey, quoteCurrencyKey) + const isAtomic = this.checkIsAtomic(fromCurrencyKey, toCurrencyKey) const exchangeParams = this.getExchangeParams( - quoteCurrencyKey, - baseCurrencyKey, - wei(quoteAmount || 0), - wei(baseAmount || 0).mul(wei(1).sub(ATOMIC_EXCHANGE_SLIPPAGE)), + fromCurrencyKey, + toCurrencyKey, + wei(fromAmount || 0), + wei(toAmount || 0).mul(wei(1).sub(ATOMIC_EXCHANGE_SLIPPAGE)), isAtomic ) @@ -565,35 +570,33 @@ export default class ExchangeService { } } - public async getFeeCost(quoteCurrencyKey: string, baseCurrencyKey: string, quoteAmount: string) { - const txProvider = this.getTxProvider(baseCurrencyKey, quoteCurrencyKey) + public async getFeeCost(fromCurrencyKey: string, toCurrencyKey: string, fromAmount: string) { + const txProvider = this.getTxProvider(fromCurrencyKey, toCurrencyKey) - const coinGeckoPrices = await this.getCoingeckoPrices(quoteCurrencyKey, baseCurrencyKey) + const coinGeckoPrices = await this.getCoingeckoPrices(fromCurrencyKey, toCurrencyKey) - const [exchangeFeeRate, quotePriceRate] = await Promise.all([ - this.getExchangeFeeRate(quoteCurrencyKey, baseCurrencyKey), - this.getPriceRate(quoteCurrencyKey, txProvider, coinGeckoPrices), + const [exchangeFeeRate, fromPriceRate] = await Promise.all([ + this.getExchangeFeeRate(fromCurrencyKey, toCurrencyKey), + this.getPriceRate(fromCurrencyKey, txProvider, coinGeckoPrices), ]) - const feeAmountInQuoteCurrency = wei(quoteAmount).mul(exchangeFeeRate) - - return feeAmountInQuoteCurrency.mul(quotePriceRate) + return wei(fromAmount).mul(exchangeFeeRate).mul(fromPriceRate) } public getApproveAddress(txProvider: ReturnType) { return txProvider !== '1inch' ? SYNTH_SWAP_OPTIMISM_ADDRESS : this.getOneInchApproveAddress() } - public async checkAllowance(quoteCurrencyKey: string, baseCurrencyKey: string) { - const txProvider = this.getTxProvider(baseCurrencyKey, quoteCurrencyKey) + public async checkAllowance(fromCurrencyKey: string, toCurrencyKey: string) { + const txProvider = this.getTxProvider(fromCurrencyKey, toCurrencyKey) - const [quoteCurrencyContract, approveAddress] = await Promise.all([ - this.getQuoteCurrencyContract(quoteCurrencyKey), + const [fromCurrencyContract, approveAddress] = await Promise.all([ + this.getCurrencyContract(fromCurrencyKey), this.getApproveAddress(txProvider), ]) - if (!!quoteCurrencyContract) { - const allowance = (await quoteCurrencyContract.allowance( + if (!!fromCurrencyContract) { + const allowance = (await fromCurrencyContract.allowance( this.sdk.context.walletAddress, approveAddress )) as ethers.BigNumber @@ -606,25 +609,25 @@ export default class ExchangeService { return this.allTokensMap?.[currencyKey]?.name } - public async getOneInchQuote(baseCurrencyKey: string, quoteCurrencyKey: string, amount: string) { + public async getOneInchQuote(toCurrencyKey: string, fromCurrencyKey: string, amount: string) { const sUSD = this.tokensMap['sUSD'] - const decimals = this.getTokenDecimals(quoteCurrencyKey) - const quoteTokenAddress = this.getTokenAddress(quoteCurrencyKey) - const baseTokenAddress = this.getTokenAddress(baseCurrencyKey) - const txProvider = this.getTxProvider(baseCurrencyKey, quoteCurrencyKey) + const decimals = this.getTokenDecimals(fromCurrencyKey) + const fromTokenAddress = this.getTokenAddress(fromCurrencyKey) + const toTokenAddress = this.getTokenAddress(toCurrencyKey) + const txProvider = this.getTxProvider(fromCurrencyKey, toCurrencyKey) - const synth = this.tokensMap[quoteCurrencyKey] || this.tokensMap[baseCurrencyKey] + const synth = this.tokensMap[fromCurrencyKey] || this.tokensMap[toCurrencyKey] const synthUsdRate = synth ? this.getPairRates(synth, 'sUSD') : null - if (!quoteCurrencyKey || !baseCurrencyKey || !sUSD || !amount.length || wei(amount).eq(0)) { + if (!fromCurrencyKey || !toCurrencyKey || !sUSD || !amount.length || wei(amount).eq(0)) { return '' } if (txProvider === '1inch') { const estimatedAmount = await this.quoteOneInch( - quoteTokenAddress, - baseTokenAddress, + fromTokenAddress, + toTokenAddress, amount, decimals ) @@ -632,12 +635,12 @@ export default class ExchangeService { return estimatedAmount } - if (this.tokensMap[quoteCurrencyKey]) { + if (this.tokensMap[fromCurrencyKey]) { const usdAmount = wei(amount).div(synthUsdRate) const estimatedAmount = await this.quoteOneInch( sUSD.address, - baseTokenAddress, + toTokenAddress, usdAmount.toString(), decimals ) @@ -645,7 +648,7 @@ export default class ExchangeService { return estimatedAmount } else { const estimatedAmount = await this.quoteOneInch( - quoteTokenAddress, + fromTokenAddress, sUSD.address, amount, decimals @@ -672,7 +675,7 @@ export default class ExchangeService { return wei(0) } } else { - return this.checkIsAtomic(currencyKey, 'sUSD') + return this.checkIsAtomic('sUSD', currencyKey) ? await this.getAtomicRates(currencyKey) : this.getExchangeRatesForCurrencies(this.exchangeRates, currencyKey, 'sUSD') } @@ -724,8 +727,8 @@ export default class ExchangeService { return { balances: cryptoBalances, totalUSDBalance } } - public validCurrencyKeys(quoteCurrencyKey?: string, baseCurrencyKey?: string) { - return [quoteCurrencyKey, baseCurrencyKey].map((currencyKey) => { + public validCurrencyKeys(fromCurrencyKey?: string, toCurrencyKey?: string) { + return [fromCurrencyKey, toCurrencyKey].map((currencyKey) => { return ( !!currencyKey && (!!this.synthsMap[currencyKey as SynthSymbol] || !!this.tokensMap[currencyKey]) @@ -733,10 +736,10 @@ export default class ExchangeService { }) } - public async getCoingeckoPrices(quoteCurrencyKey: string, baseCurrencyKey: string) { - const quoteCurrencyTokenAddress = this.getTokenAddress(quoteCurrencyKey, true).toLowerCase() - const baseCurrencyTokenAddress = this.getTokenAddress(baseCurrencyKey).toLowerCase() - const tokenAddresses = [quoteCurrencyTokenAddress, baseCurrencyTokenAddress] + public async getCoingeckoPrices(fromCurrencyKey: string, toCurrencyKey: string) { + const fromTokenAddress = this.getTokenAddress(fromCurrencyKey, true).toLowerCase() + const toTokenAddress = this.getTokenAddress(toCurrencyKey).toLowerCase() + const tokenAddresses = [fromTokenAddress, toTokenAddress] return this.batchGetCoingeckoPrices(tokenAddresses) } @@ -758,14 +761,14 @@ export default class ExchangeService { } private getExchangeParams( - quoteCurrencyKey: string, - baseCurrencyKey: string, + fromCurrencyKey: string, + toCurrencyKey: string, sourceAmount: Wei, minAmount: Wei, isAtomic: boolean ) { - const sourceCurrencyKey = ethers.utils.formatBytes32String(quoteCurrencyKey) - const destinationCurrencyKey = ethers.utils.formatBytes32String(baseCurrencyKey) + const sourceCurrencyKey = ethers.utils.formatBytes32String(fromCurrencyKey) + const destinationCurrencyKey = ethers.utils.formatBytes32String(toCurrencyKey) const sourceAmountBN = sourceAmount.toBN() if (isAtomic) { @@ -855,12 +858,60 @@ export default class ExchangeService { return queryWalletTrades(this.sdk, this.sdk.context.walletAddress) } - private checkIsAtomic(baseCurrencyKey: string, quoteCurrencyKey: string) { - if (this.sdk.context.isL2 || !baseCurrencyKey || !quoteCurrencyKey) { + /** + * Get token balances for the given wallet address + * @param walletAddress Wallet address + * @returns Token balances for the given wallet address + */ + public async getTokenBalances(walletAddress: string): Promise { + if (!this.sdk.context.isMainnet) return {} + + const filteredTokens: Token[] = [] + const symbols: string[] = [] + const tokensMap: Record = {} + + this.tokenList.forEach((token) => { + if (!FILTERED_TOKENS.includes(token.address.toLowerCase())) { + symbols.push(token.symbol) + tokensMap[token.symbol] = token + filteredTokens.push(token) + } + }) + + const calls = [] + + for (const { address, symbol } of filteredTokens) { + if (symbol === CRYPTO_CURRENCY_MAP.ETH) { + calls.push(this.sdk.context.multicallProvider.getEthBalance(walletAddress)) + } else { + const tokenContract = new EthCallContract(address, erc20Abi) + calls.push(tokenContract.balanceOf(walletAddress)) + } + } + + const data = (await this.sdk.context.multicallProvider.all(calls)) as BigNumber[] + + const tokenBalances: TokenBalances = {} + + data.forEach((value, i) => { + if (value.lte(0)) return + const token = tokensMap[symbols[i]] + + tokenBalances[symbols[i]] = { + balance: wei(value, token.decimals ?? 18), + token, + } + }) + + return tokenBalances + } + + private checkIsAtomic(fromCurrencyKey: string, toCurrencyKey: string) { + if (this.sdk.context.isL2 || !toCurrencyKey || !fromCurrencyKey) { return false } - return [baseCurrencyKey, quoteCurrencyKey].every((currency) => + return [toCurrencyKey, fromCurrencyKey].every((currency) => ATOMIC_EXCHANGES_L1.includes(currency) ) } @@ -869,10 +920,10 @@ export default class ExchangeService { return get(this.allTokensMap, [currencyKey, 'decimals'], undefined) } - private getQuoteCurrencyContract(quoteCurrencyKey: string) { - if (this.allTokensMap[quoteCurrencyKey]) { - const quoteTknAddress = this.getTokenAddress(quoteCurrencyKey, true) - return this.createERC20Contract(quoteTknAddress) + private getCurrencyContract(currencyKey: string) { + if (this.allTokensMap[currencyKey]) { + const tokenAddress = this.getTokenAddress(currencyKey, true) + return this.createERC20Contract(tokenAddress) } return null @@ -883,29 +934,29 @@ export default class ExchangeService { } private getOneInchQuoteSwapParams( - quoteTokenAddress: string, - baseTokenAddress: string, + fromTokenAddress: string, + toTokenAddress: string, amount: string, decimals: number ) { return { - fromTokenAddress: quoteTokenAddress, - toTokenAddress: baseTokenAddress, + fromTokenAddress, + toTokenAddress, amount: wei(amount, decimals).toString(0, true), } } private async getOneInchSwapParams( - quoteTokenAddress: string, - baseTokenAddress: string, + fromTokenAddress: string, + toTokenAddress: string, amount: string, - quoteDecimals: number + fromTokenDecimals: number ) { const params = this.getOneInchQuoteSwapParams( - quoteTokenAddress, - baseTokenAddress, + fromTokenAddress, + toTokenAddress, amount, - quoteDecimals + fromTokenDecimals ) const res = await axios.get(this.oneInchApiUrl + 'swap', { @@ -925,14 +976,14 @@ export default class ExchangeService { } private async quoteOneInch( - quoteTokenAddress: string, - baseTokenAddress: string, + fromTokenAddress: string, + toTokenAddress: string, amount: string, decimals: number ) { const params = this.getOneInchQuoteSwapParams( - quoteTokenAddress, - baseTokenAddress, + fromTokenAddress, + toTokenAddress, amount, decimals ) @@ -956,16 +1007,16 @@ export default class ExchangeService { return this.swapSynthSwap(fromToken, toToken, fromAmount, 'estimate_gas') } - private async getPairRates(quoteCurrencyKey: string, baseCurrencyKey: string) { - return this.checkIsAtomic(baseCurrencyKey, quoteCurrencyKey) + private async getPairRates(fromCurrencyKey: string, toCurrencyKey: string) { + return this.checkIsAtomic(fromCurrencyKey, toCurrencyKey) ? await Promise.all([ - this.getAtomicRates(quoteCurrencyKey), - this.getAtomicRates(baseCurrencyKey), + this.getAtomicRates(fromCurrencyKey), + this.getAtomicRates(toCurrencyKey), ]) : this.getExchangeRatesTupleForCurrencies( this.sdk.prices.currentPrices.onChain, - quoteCurrencyKey, - baseCurrencyKey + fromCurrencyKey, + toCurrencyKey ) } @@ -979,26 +1030,26 @@ export default class ExchangeService { private async getGasEstimateForExchange( txProvider: ReturnType, - quoteCurrencyKey: string, - baseCurrencyKey: string, + fromCurrencyKey: string, + toCurrencyKey: string, quoteAmount: string ) { if (!this.sdk.context.isL2) return null - const quoteCurrencyTokenAddress = this.getTokenAddress(quoteCurrencyKey) - const baseCurrencyTokenAddress = this.getTokenAddress(baseCurrencyKey) - const quoteDecimals = this.getTokenDecimals(quoteCurrencyKey) + const fromTokenAddress = this.getTokenAddress(fromCurrencyKey) + const toTokenAddress = this.getTokenAddress(toCurrencyKey) + const quoteDecimals = this.getTokenDecimals(fromCurrencyKey) if (txProvider === 'synthswap') { const [gasEstimate, metaTx] = await Promise.all([ this.swapSynthSwapGasEstimate( - this.allTokensMap[quoteCurrencyKey], - this.allTokensMap[baseCurrencyKey], + this.allTokensMap[fromCurrencyKey], + this.allTokensMap[toCurrencyKey], quoteAmount ), this.swapSynthSwap( - this.allTokensMap[quoteCurrencyKey], - this.allTokensMap[baseCurrencyKey], + this.allTokensMap[fromCurrencyKey], + this.allTokensMap[toCurrencyKey], quoteAmount, 'meta_tx' ), @@ -1014,18 +1065,8 @@ export default class ExchangeService { return { limit: normalizeGasLimit(Number(gasEstimate)), l1Fee } } else if (txProvider === '1inch') { const [estimate, metaTx] = await Promise.all([ - this.swapOneInchGasEstimate( - quoteCurrencyTokenAddress, - baseCurrencyTokenAddress, - quoteAmount, - quoteDecimals - ), - this.swapOneInchMeta( - quoteCurrencyTokenAddress, - baseCurrencyTokenAddress, - quoteAmount, - quoteDecimals - ), + this.swapOneInchGasEstimate(fromTokenAddress, toTokenAddress, quoteAmount, quoteDecimals), + this.swapOneInchMeta(fromTokenAddress, toTokenAddress, quoteAmount, quoteDecimals), ]) const l1Fee = await this.sdk.transactions.getOptimismLayerOneFees({ @@ -1093,47 +1134,6 @@ export default class ExchangeService { return [baseRate, quoteRate] } - // TODO: This is temporary. - // We should consider either having another service for this - // It does not quite fit into the synths service. - // One idea is to create a "tokens" service that handles everything - // related to 1inch tokens. - - public async getTokenBalances(walletAddress: string): Promise { - if (!this.sdk.context.isMainnet) return {} - const filteredTokens = this.tokenList.filter( - (t) => !FILTERED_TOKENS.includes(t.address.toLowerCase()) - ) - const symbols = filteredTokens.map((token) => token.symbol) - const tokensMap = keyBy(filteredTokens, 'symbol') - const calls = [] - - for (const { address, symbol } of filteredTokens) { - if (symbol === CRYPTO_CURRENCY_MAP.ETH) { - calls.push(this.sdk.context.multicallProvider.getEthBalance(walletAddress)) - } else { - const tokenContract = new EthCallContract(address, erc20Abi) - calls.push(tokenContract.balanceOf(walletAddress)) - } - } - - const data = (await this.sdk.context.multicallProvider.all(calls)) as BigNumber[] - - const tokenBalances: TokenBalances = {} - - data.forEach((value, index) => { - if (value.lte(0)) return - const token = tokensMap[symbols[index]] - - tokenBalances[symbols[index]] = { - balance: wei(value, token.decimals ?? 18), - token, - } - }) - - return tokenBalances - } - private createERC20Contract(tokenAddress: string) { return new ethers.Contract(tokenAddress, erc20Abi, this.sdk.context.provider) } diff --git a/packages/sdk/src/services/futures.ts b/packages/sdk/src/services/futures.ts index 02df39f0b1..aa97fdb93f 100644 --- a/packages/sdk/src/services/futures.ts +++ b/packages/sdk/src/services/futures.ts @@ -19,13 +19,12 @@ import { SmartMarginAccount__factory, PerpsV2Market__factory } from '../contract import { IPerpsV2MarketConsolidated } from '../contracts/types/PerpsV2Market' import { IPerpsV2MarketSettings, PerpsV2MarketData } from '../contracts/types/PerpsV2MarketData' import { - queryCrossMarginAccounts, + querySmartMarginAccounts, querySmartMarginTransfers, queryFuturesTrades, queryIsolatedMarginTransfers, queryPositionHistory, queryTrades, - queryCompletePositionHistory, queryFundingRateHistory, } from '../queries/futures' import { NetworkId, NetworkOverrideOptions } from '../types/common' @@ -33,7 +32,6 @@ import { FundingRateInput, FundingRateResponse, FundingRateUpdate, - FuturesMarket, FuturesMarketAsset, FuturesMarketKey, FuturesVolumes, @@ -46,23 +44,23 @@ import { MarketWithIdleMargin, SmartMarginOrderInputs, ConditionalOrderTypeEnum, - FuturesAccountType, SLTPOrderInputs, + FuturesMarginType, + ConditionalOrder, + PerpsMarketV2, } from '../types/futures' import { PricesMap } from '../types/prices' import { calculateTimestampForPeriod } from '../utils/date' import { - appAdjustedLeverage, calculateFundingRate, calculateVolumes, ConditionalOrderResult, encodeConditionalOrderParams, encodeModidyMarketMarginParams, encodeSubmitOffchainOrderParams, - formatDelayedOrder, + formatV2DelayedOrder, formatPotentialTrade, getFuturesEndpoint, - getMarketName, mapConditionalOrderFromContract, mapFuturesPosition, mapFuturesPositions, @@ -70,14 +68,16 @@ import { marketsForNetwork, MarketKeyByAsset, encodeCloseOffchainOrderParams, + marginTypeToSubgraphType, + formatPerpsV2Market, } from '../utils/futures' import { getFuturesAggregateStats } from '../utils/subgraph' import { getReasonFromCode } from '../utils/synths' export default class FuturesService { private sdk: KwentaSDK - public markets: FuturesMarket[] | undefined - public internalFuturesMarkets: Partial< + private markets: PerpsMarketV2[] | undefined + private internalFuturesMarkets: Partial< Record > = {} @@ -89,6 +89,19 @@ export default class FuturesService { return getFuturesEndpoint(this.sdk.context.networkId) } + /** + * @desc Fetches futures markets + * @param networkOverride - Network override options + * @returns Futures markets array + * @example + * ```ts + * import { KwentaSDK } from '@kwenta/sdk' + * + * const sdk = new KwentaSDK() + * const markets = await sdk.futures.getMarkets() + * console.log(markets) + * ``` + */ public async getMarkets(networkOverride?: NetworkOverrideOptions) { const enabledMarkets = marketsForNetwork( networkOverride?.networkId || this.sdk.context.networkId, @@ -121,17 +134,13 @@ export default class FuturesService { const filteredMarkets = markets.filter((m) => { const marketKey = parseBytes32String(m.key) as FuturesMarketKey - const market = enabledMarkets.find((market) => { - return marketKey === market.key - }) + const market = enabledMarkets.find((market) => marketKey === market.key) return !!market }) - const marketKeys = filteredMarkets.map((m) => { - return m.key - }) + const marketKeys = filteredMarkets.map((m) => m.key) - const parametersCalls = marketKeys.map((key: string) => PerpsV2MarketSettings.parameters(key)) + const parametersCalls = marketKeys.map((key) => PerpsV2MarketSettings.parameters(key)) let marketParameters: IPerpsV2MarketSettings.ParametersStructOutput[] = [] @@ -152,92 +161,36 @@ export default class FuturesService { const { suspensions, reasons } = await SystemStatus.getFuturesMarketSuspensions(marketKeys) - const futuresMarkets = filteredMarkets.map( - ( - { - market, - key, - asset, - currentFundingRate, - currentFundingVelocity, - feeRates, - marketDebt, - marketSkew, - maxLeverage, - marketSize, - price, - }, - i: number - ): FuturesMarket => ({ - market, - marketKey: parseBytes32String(key) as FuturesMarketKey, - marketName: getMarketName(parseBytes32String(asset) as FuturesMarketAsset), - asset: parseBytes32String(asset) as FuturesMarketAsset, - assetHex: asset, - currentFundingRate: wei(currentFundingRate).div(24), - currentFundingVelocity: wei(currentFundingVelocity).div(24 * 24), - feeRates: { - makerFee: wei(feeRates.makerFee), - takerFee: wei(feeRates.takerFee), - makerFeeDelayedOrder: wei(feeRates.makerFeeDelayedOrder), - takerFeeDelayedOrder: wei(feeRates.takerFeeDelayedOrder), - makerFeeOffchainDelayedOrder: wei(feeRates.makerFeeOffchainDelayedOrder), - takerFeeOffchainDelayedOrder: wei(feeRates.takerFeeOffchainDelayedOrder), - }, - openInterest: { - shortPct: wei(marketSize).eq(0) - ? 0 - : wei(marketSize).sub(marketSkew).div('2').div(marketSize).toNumber(), - longPct: wei(marketSize).eq(0) - ? 0 - : wei(marketSize).add(marketSkew).div('2').div(marketSize).toNumber(), - shortUSD: wei(marketSize).eq(0) - ? wei(0) - : wei(marketSize).sub(marketSkew).div('2').mul(price), - longUSD: wei(marketSize).eq(0) - ? wei(0) - : wei(marketSize).add(marketSkew).div('2').mul(price), - long: wei(marketSize).add(marketSkew).div('2'), - short: wei(marketSize).sub(marketSkew).div('2'), - }, - marketDebt: wei(marketDebt), - marketSkew: wei(marketSkew), - contractMaxLeverage: wei(maxLeverage), - appMaxLeverage: appAdjustedLeverage(wei(maxLeverage)), - marketSize: wei(marketSize), - marketLimitUsd: wei(marketParameters[i].maxMarketValue).mul(wei(price)), - marketLimitNative: wei(marketParameters[i].maxMarketValue), - minInitialMargin: wei(minInitialMargin), - keeperDeposit: wei(minKeeperFee), - isSuspended: suspensions[i], - marketClosureReason: getReasonFromCode(reasons[i]) as MarketClosureReason, - settings: { - maxMarketValue: wei(marketParameters[i].maxMarketValue), - skewScale: wei(marketParameters[i].skewScale), - delayedOrderConfirmWindow: wei( - marketParameters[i].delayedOrderConfirmWindow, - 0 - ).toNumber(), - offchainDelayedOrderMinAge: wei( - marketParameters[i].offchainDelayedOrderMinAge, - 0 - ).toNumber(), - offchainDelayedOrderMaxAge: wei( - marketParameters[i].offchainDelayedOrderMaxAge, - 0 - ).toNumber(), - minDelayTimeDelta: wei(marketParameters[i].minDelayTimeDelta, 0).toNumber(), - maxDelayTimeDelta: wei(marketParameters[i].maxDelayTimeDelta, 0).toNumber(), - }, - }) + const futuresMarkets = filteredMarkets.map((m, i) => + formatPerpsV2Market( + m, + marketParameters[i], + { minKeeperFee: wei(minKeeperFee), minInitialMargin: wei(minInitialMargin) }, + suspensions[i], + getReasonFromCode(reasons[i]) as MarketClosureReason + ) ) return futuresMarkets } // TODO: types // TODO: Improve the API for fetching positions + /** + * + * @param address Smart margin or EOA address + * @param futuresMarkets Array of objects with market address, market key, and asset + * @returns Array of futures positions associated with the given address + * @example + * ```ts + * const sdk = new KwentaSDK() + * const markets = await sdk.futures.getMarkets() + * const marketDetails = markets.map((m) => ({ address: m.market, marketKey: m.marketKey, asset: m.asset })) + * const positions = await sdk.futures.getFuturesPositions('0x...', marketDetails) + * console.log(positions) + * ``` + */ public async getFuturesPositions( - address: string, // Cross margin or EOA address + address: string, // Smart margin or EOA address futuresMarkets: { asset: FuturesMarketAsset; marketKey: FuturesMarketKey; address: string }[] ) { const marketDataContract = this.sdk.context.multicallContracts.PerpsV2MarketData @@ -266,19 +219,28 @@ export default class FuturesService { )) as boolean[] // map the positions using the results - const positions = await Promise.all( - positionDetails.map(async (position, ind) => { - const canLiquidate = canLiquidateState[ind] - const marketKey = futuresMarkets[ind].marketKey - const asset = futuresMarkets[ind].asset + const positions = positionDetails.map((position, i) => { + const canLiquidate = canLiquidateState[i] + const { marketKey, asset } = futuresMarkets[i] - return mapFuturesPosition(position, canLiquidate, asset, marketKey) - }) - ) + return mapFuturesPosition(position, canLiquidate, asset, marketKey) + }) return positions } + /** + * @desc Get the funding rate history for a given market + * @param marketAsset Futures market asset + * @param periodLength Period length in seconds + * @returns Funding rate history for the given market + * @example + * ```ts + * const sdk = new KwentaSDK() + * const fundingRateHistory = await sdk.futures.getMarketFundingRatesHistory('ETH') + * console.log(fundingRateHistory) + * ``` + */ public async getMarketFundingRatesHistory( marketAsset: FuturesMarketAsset, periodLength = PERIOD_IN_SECONDS.TWO_WEEKS @@ -287,15 +249,29 @@ export default class FuturesService { return queryFundingRateHistory(this.sdk, marketAsset, minTimestamp) } - public async getAverageFundingRates(markets: FuturesMarket[], prices: PricesMap, period: Period) { + /** + * @desc Get the average funding rates for the given markets + * @param markets Futures markets array + * @param prices Prices map + * @param period Period enum member + * @example + * ```ts + * const sdk = new KwentaSDK() + * const markets = await sdk.futures.getMarkets() + * const prices = + * const fundingRates = await sdk.synths.getAverageFundingRates(markets, prices, Period.ONE_DAY) + * console.log(fundingRates) + * ``` + */ + public async getAverageFundingRates(markets: PerpsMarketV2[], prices: PricesMap, period: Period) { const fundingRateInputs: FundingRateInput[] = markets.map( - ({ asset, market, currentFundingRate }) => { + ({ asset, marketAddress: market, currentFundingRate }) => { const price = prices[asset] return { marketAddress: market, marketKey: MarketKeyByAsset[asset], - price: price, - currentFundingRate: currentFundingRate, + price, + currentFundingRate, } } ) @@ -343,12 +319,10 @@ export default class FuturesService { this.futuresGqlEndpoint, gql` query fundingRateUpdates($minTimestamp: BigInt!) { - ${fundingRateQueries.reduce((acc: string, curr: string) => { - return acc + curr - })} + ${fundingRateQueries.reduce((acc, curr) => acc + curr)} } `, - { minTimestamp: minTimestamp } + { minTimestamp } ) const periodTitle = period === Period.ONE_HOUR ? '1H Funding Rate' : 'Funding Rate' @@ -363,9 +337,9 @@ export default class FuturesService { ] const responseFilt = marketResponses - .filter((value: FundingRateUpdate[]) => value.length > 0) - .map((entry: FundingRateUpdate[]): FundingRateUpdate => entry[0]) - .sort((a: FundingRateUpdate, b: FundingRateUpdate) => a.timestamp - b.timestamp) + .filter((value) => value.length > 0) + .map((entry) => entry[0]) + .sort((a, b) => a.timestamp - b.timestamp) const fundingRate = responseFilt && !!currentFundingRate @@ -384,7 +358,7 @@ export default class FuturesService { const fundingRateResponse: FundingRateResponse = { asset: marketKey, fundingTitle: fundingPeriod, - fundingRate: fundingRate, + fundingRate, } return fundingRateResponse } @@ -393,6 +367,16 @@ export default class FuturesService { return fundingRateResponses.filter((funding): funding is FundingRateResponse => !!funding) } + /** + * @desc Get the daily volumes for all markets + * @returns Object with the daily number of trades and volumes for all markets + * @example + * ```ts + * const sdk = new KwentaSDK() + * const dailyVolumes = await sdk.futures.getDailyVolumes() + * console.log(dailyVolumes) + * ``` + */ public async getDailyVolumes(): Promise { const minTimestamp = Math.floor(calculateTimestampForPeriod(PERIOD_IN_HOURS.ONE_DAY) / 1000) const response = await getFuturesAggregateStats( @@ -420,11 +404,33 @@ export default class FuturesService { return response ? calculateVolumes(response) : {} } - public async getCrossMarginAccounts(walletAddress?: string | null): Promise { + /** + * @desc Get the smart margin accounts associated with a given wallet address + * @param walletAddress Wallet address + * @returns Array of smart margin account addresses + * @example + * ```ts + * const sdk = new KwentaSDK() + * const accounts = await sdk.futures.getSmartMarginAccounts() + * console.log(accounts) + * ``` + */ + public async getSmartMarginAccounts(walletAddress?: string | null): Promise { const address = walletAddress ?? this.sdk.context.walletAddress - return await queryCrossMarginAccounts(this.sdk, address) + return await querySmartMarginAccounts(this.sdk, address) } + /** + * @desc Get isolated margin transfer history for a given wallet address + * @param walletAddress Wallet address + * @returns Array of past isolated margin transfers for the given wallet address + * @example + * ```ts + * const sdk = new KwentaSDK() + * const transfers = await sdk.futures.getIsolatedMarginTransfers() + * console.log(transfers) + * ``` + */ public async getIsolatedMarginTransfers( walletAddress?: string | null ): Promise { @@ -432,24 +438,58 @@ export default class FuturesService { return queryIsolatedMarginTransfers(this.sdk, address) } - public async getCrossMarginTransfers(walletAddress?: string | null): Promise { + /** + * @desc Get smart margin transfer history for a given wallet address + * @param walletAddress Wallet address + * @returns Array of past smart margin transfers for the given wallet address + * @example + * ```ts + * const sdk = new KwentaSDK() + * const transfers = await sdk.futures.getSmartMarginTransfers() + * console.log(transfers) + * ``` + */ + public async getSmartMarginTransfers(walletAddress?: string | null): Promise { const address = walletAddress ?? this.sdk.context.walletAddress return querySmartMarginTransfers(this.sdk, address) } - public async getCrossMarginAccountBalance(crossMarginAddress: string) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + /** + * @desc Get the balance of a smart margin account + * @param smartMarginAddress Smart margin account address + * @returns Balance of the given smart margin account + * @example + * ```ts + * const sdk = new KwentaSDK() + * const balance = await sdk.futures.getSmartMarginAccountBalance('0x...') + * console.log(balance) + * ``` + */ + public async getSmartMarginAccountBalance(smartMarginAddress: string) { + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.provider ) - const freeMargin = await crossMarginAccountContract.freeMargin() + const freeMargin = await smartMarginAccountContract.freeMargin() return wei(freeMargin) } - public async getCrossMarginBalanceInfo(walletAddress: string, crossMarginAddress: string) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + /** + * @desc Get important balances for a given smart margin account and wallet address. + * @param walletAddress Wallet address + * @param smartMarginAddress Smart margin account address + * @returns Free margin and keeper balance (in ETH) for given smart margin address, as well as the wallet balance (in ETH), and sUSD allowance for the given wallet address. + * @example + * ```ts + * const sdk = new KwentaSDK() + * const balanceInfo = await sdk.futures.getSmartMarginBalanceInfo('0x...', '0x...') + * console.log(balanceInfo) + * ``` + */ + public async getSmartMarginBalanceInfo(walletAddress: string, smartMarginAddress: string) { + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.provider ) const { SUSD } = this.sdk.context.contracts @@ -457,10 +497,10 @@ export default class FuturesService { // TODO: EthCall const [freeMargin, keeperEthBal, walletEthBal, allowance] = await Promise.all([ - crossMarginAccountContract.freeMargin(), - this.sdk.context.provider.getBalance(crossMarginAddress), + smartMarginAccountContract.freeMargin(), + this.sdk.context.provider.getBalance(smartMarginAddress), this.sdk.context.provider.getBalance(walletAddress), - SUSD.allowance(walletAddress, crossMarginAccountContract.address), + SUSD.allowance(walletAddress, smartMarginAccountContract.address), ]) return { @@ -471,23 +511,34 @@ export default class FuturesService { } } + /** + * @desc Get the conditional orders created by a given smart margin account + * @param account Smart margin account address + * @returns Array of conditional orders created by the given smart margin account + * @example + * ```ts + * const sdk = new KwentaSDK() + * const orders = await sdk.futures.getConditionalOrders('0x...') + * console.log(orders) + * ``` + */ public async getConditionalOrders(account: string) { - const crossMarginAccountMultiCall = new EthCallContract(account, SmartMarginAccountABI) - const crossMarginAccountContract = SmartMarginAccount__factory.connect( + const smartMarginAccountMultiCall = new EthCallContract(account, SmartMarginAccountABI) + const smartMarginAccountContract = SmartMarginAccount__factory.connect( account, this.sdk.context.provider ) const orders = [] - const orderIdBigNum = await crossMarginAccountContract.conditionalOrderId() + const orderIdBigNum = await smartMarginAccountContract.conditionalOrderId() const orderId = orderIdBigNum.toNumber() // Limit to the latest 500 const start = orderId > ORDERS_FETCH_SIZE ? orderId - ORDERS_FETCH_SIZE : 0 const orderCalls = Array(orderId) .fill(0) - .map((_, i) => crossMarginAccountMultiCall.getConditionalOrder(start + i)) + .map((_, i) => smartMarginAccountMultiCall.getConditionalOrder(start + i)) const contractOrders = (await this.sdk.context.multicallProvider.all( orderCalls )) as ConditionalOrderResult[] @@ -506,24 +557,62 @@ export default class FuturesService { } // Perps V2 read functions + + /** + * @desc Get delayed orders associated with a given wallet address, for a specific market + * @param account Wallet address + * @param marketAddress Array of futures market addresses + * @returns Delayed order for the given market address, associated with the given wallet address + * @example + * ```ts + * const sdk = new KwentaSDK() + * const order = await sdk.futures.getDelayedOrder('0x...', '0x...') + * console.log(order) + * ``` + */ public async getDelayedOrder(account: string, marketAddress: string) { const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.provider) const order = await market.delayedOrders(account) - return formatDelayedOrder(account, marketAddress, order) + return formatV2DelayedOrder(account, marketAddress, order) } + /** + * @desc Get delayed orders associated with a given wallet address + * @param account Wallet address + * @param marketAddresses Array of futures market addresses + * @returns Array of delayed orders for the given market addresses, associated with the given wallet address + */ public async getDelayedOrders(account: string, marketAddresses: string[]) { const marketContracts = marketAddresses.map(getPerpsV2MarketMulticall) const orders = (await this.sdk.context.multicallProvider.all( marketContracts.map((market) => market.delayedOrders(account)) )) as IPerpsV2MarketConsolidated.DelayedOrderStructOutput[] - return orders.map((order, ind) => { - return formatDelayedOrder(account, marketAddresses[ind], order) - }) + + return orders.map((order, i) => formatV2DelayedOrder(account, marketAddresses[i], order)) } - public async getIsolatedTradePreview( + /** + * @desc Generate a trade preview for a potential trade with an isolated margin account. + * @param marketAddress Futures market address + * @param marketKey Futures market key + * @param orderType Order type (market, delayed, delayed offchain) + * @param inputs Object containing size delta, order price, and leverage side + * @returns Object containing details about the potential trade + * @example + * ```ts + * const sdk = new KwentaSDK() + * const preview = await sdk.futures.getIsolatedMarginTradePreview( + * '0x...', + * '0x...', + * FuturesMarketKey.sBTCPERP, + * ContractOrderType.MARKET, + * { sizeDelta: wei(1), price: wei(10000), leverageSide: PositionSide.SHORT } + * ) + * console.log(preview) + * ``` + */ + public async getIsolatedMarginTradePreview( marketAddress: string, marketKey: FuturesMarketKey, orderType: ContractOrderType, @@ -550,8 +639,32 @@ export default class FuturesService { return formatPotentialTrade(details, skewAdjustedPrice, inputs.sizeDelta, inputs.leverageSide) } - public async getCrossMarginTradePreview( - crossMarginAccount: string, + /** + * @desc Generate a trade preview for a potential trade with a smart margin account. + * @param smartMarginAccount Smart margin account address + * @param marketKey Futures market key + * @param marketAddress Futures market address + * @param tradeParams Object containing size delta, margin delta, order price, and leverage side + * @returns Object containing details about the potential trade + * @example + * ```ts + * const sdk = new KwentaSDK() + * const preview = await sdk.futures.getSmartMarginTradePreview( + * '0x...', + * FuturesMarketKey.sBTCPERP, + * '0x...', + * { + * sizeDelta: wei(1), + * marginDelta: wei(1), + * orderPrice: wei(10000), + * leverageSide: PositionSide.SHORT, + * } + * ) + * console.log(preview) + * ``` + */ + public async getSmartMarginTradePreview( + smartMarginAccount: string, marketKey: FuturesMarketKey, marketAddress: string, tradeParams: { @@ -564,7 +677,7 @@ export default class FuturesService { const marketInternal = this.getInternalFuturesMarket(marketAddress, marketKey) const preview = await marketInternal.getTradePreview( - crossMarginAccount, + smartMarginAccount, tradeParams.sizeDelta.toBN(), tradeParams.marginDelta.toBN(), tradeParams.orderPrice.toBN() @@ -584,85 +697,148 @@ export default class FuturesService { ) } - public async getCrossMarginKeeperBalance(account: string) { - const bal = await this.sdk.context.provider.getBalance(account) - return wei(bal) - } - - public async getPositionHistory(walletAddress: string) { - const response = await queryPositionHistory(this.sdk, walletAddress) - return response ? mapFuturesPositions(response) : [] - } - - public async getCompletePositionHistory(walletAddress: string) { - const response = await queryCompletePositionHistory(this.sdk, walletAddress) + /** + * @desc Get futures positions history for a given wallet address or smart margin account + * @param address Wallet address or smart margin account address + * @param addressType Address type (EOA or smart margin account) + * @returns Array of historical futures positions associated with the given address + * @example + * ```ts + * const sdk = new KwentaSDK() + * const positionHistory = await sdk.futures.getPositionHistory('0x...') + * console.log(positionHistory) + * ``` + */ + public async getPositionHistory(address: string, addressType: 'eoa' | 'account' = 'account') { + const response = await queryPositionHistory(this.sdk, address, addressType) return response ? mapFuturesPositions(response) : [] } // TODO: Support pagination + /** + * @desc Get the trade history for a given account on a specific market + * @param marketAsset Market asset + * @param walletAddress Account address + * @param accountType Account type (smart or isolated) + * @param pageLength Number of trades to fetch + * @returns Array of trades for the account on the given market. + * @example + * ```ts + * const sdk = new KwentaSDK() + * const trades = await sdk.futures.getTradesForMarket( + * FuturesMarketAsset.sBTC, + * '0x...', + * FuturesMarginType.SMART_MARGIN + * ) + * console.log(trades) + * ``` + */ public async getTradesForMarket( marketAsset: FuturesMarketAsset, walletAddress: string, - accountType: FuturesAccountType, + accountType: FuturesMarginType, pageLength: number = 16 ) { const response = await queryTrades(this.sdk, { marketAsset, walletAddress, - accountType, + accountType: marginTypeToSubgraphType(accountType), pageLength, }) return response ? mapTrades(response) : [] } + /** + * @desc Get the trade history for a given account + * @param walletAddress Account address + * @param accountType Account type (smart or isolated) + * @param pageLength Number of trades to fetch + * @returns Array of trades for the account on the given market. + * @example + * ```ts + * const sdk = new KwentaSDK() + * const trades = await sdk.futures.getAllTrades('0x...', FuturesMarginType.SMART_MARGIN) + * console.log(trades) + * ``` + */ public async getAllTrades( walletAddress: string, - accountType: FuturesAccountType, + accountType: FuturesMarginType, pageLength: number = 16 ) { const response = await queryTrades(this.sdk, { walletAddress, - accountType, + accountType: marginTypeToSubgraphType(accountType), pageLength, }) return response ? mapTrades(response) : [] } + /** + * @desc Get the idle margin in futures markets + * @param accountOrEoa Wallet address or smart margin account address + * @returns Total idle margin in markets and an array of markets with idle margin + * @example + * ```ts + * const sdk = new KwentaSDK() + * const idleMargin = await sdk.futures.getIdleMargin('0x...') + * console.log(idleMargin) + * ``` + */ public async getIdleMarginInMarkets(accountOrEoa: string) { const markets = this.markets ?? (await this.getMarkets()) - const filteredMarkets = markets.filter((m) => !m.isSuspended) - const marketParams = - filteredMarkets?.map((m) => ({ - asset: m.asset, - marketKey: m.marketKey, - address: m.market, - })) ?? [] + const filteredMarkets: PerpsMarketV2[] = [] + + const marketParams: { + asset: FuturesMarketAsset + marketKey: FuturesMarketKey + address: string + }[] = [] + + markets.forEach((m) => { + if (!m.isSuspended) { + filteredMarkets.push(m) + marketParams.push({ asset: m.asset, marketKey: m.marketKey, address: m.marketAddress }) + } + }) + const positions = await this.getFuturesPositions(accountOrEoa, marketParams) - const positionsWithIdleMargin = positions.filter( - (p) => !p.position?.size.abs().gt(0) && p.remainingMargin.gt(0) - ) - const idleInMarkets = positionsWithIdleMargin.reduce( - (acc, p) => acc.add(p.remainingMargin), - wei(0) - ) - return { - totalIdleInMarkets: idleInMarkets, - marketsWithIdleMargin: positionsWithIdleMargin.reduce((acc, p) => { + + return positions.reduce( + (acc, p) => { + if (p.position?.size.abs().gt(0)) { + acc.totalIdleInMarkets = acc.totalIdleInMarkets.add(p.position.size) + } + const market = filteredMarkets.find((m) => m.marketKey === p.marketKey) if (market) { - acc.push({ - marketAddress: market.market, + acc.marketsWithIdleMargin.push({ + marketAddress: market.marketAddress, marketKey: market.marketKey, position: p, }) } + return acc - }, []), - } + }, + { totalIdleInMarkets: wei(0), marketsWithIdleMargin: [] as MarketWithIdleMargin[] } + ) } + /** + * @desc Get idle margin for given wallet address or smart margin account address + * @param eoa Wallet address + * @param account Smart margin account address + * @returns Total idle margin, idle margin in markets, total wallet balance and the markets with idle margin for the given address(es). + * @example + * ```ts + * const sdk = new KwentaSDK() + * const idleMargin = await sdk.futures.getIdleMargin('0x...') + * console.log(idleMargin) + * ``` + */ public async getIdleMargin(eoa: string, account?: string) { const idleMargin = await this.getIdleMarginInMarkets(account || eoa) @@ -676,12 +852,37 @@ export default class FuturesService { } // This is on an interval of 15 seconds. + /** + * @desc Get futures trades for a given market + * @param marketKey Futures market key + * @param minTs Minimum timestamp + * @param maxTs Maximum timestamp + * @returns Array of trades for the given market + * @example + * ```ts + * const sdk = new KwentaSDK() + * const trades = await sdk.futures.getFuturesTrades(FuturesMarketKey.sBTCPERP, 0, 0) + * console.log(trades) + * ``` + */ public async getFuturesTrades(marketKey: FuturesMarketKey, minTs: number, maxTs: number) { const response = await queryFuturesTrades(this.sdk, marketKey, minTs, maxTs) return response ? mapTrades(response) : null } // TODO: Get delayed order fee + /** + * @desc Get order fee, based on the specified market and given order size + * @param marketAddress Market address + * @param size Size of the order + * @returns Fee for the given order size, based on the specified market + * @example + * ```ts + * const sdk = new KwentaSDK() + * const fee = await sdk.futures.getOrderFee('0x...', wei(1)) + * console.log(fee) + * ``` + */ public async getOrderFee(marketAddress: string, size: Wei) { const marketContract = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) const orderFee = await marketContract.orderFee(size.toBN(), 0) @@ -690,52 +891,77 @@ export default class FuturesService { // Contract mutations - public async approveCrossMarginDeposit( - crossMarginAddress: string, + /** + * @desc Approve a smart margin account deposit + * @param smartMarginAddress Smart margin account address + * @param amount Amount to approve + * @returns ethers.js TransactionResponse object + */ + public async approveSmartMarginDeposit( + smartMarginAddress: string, amount: BigNumber = BigNumber.from(ethers.constants.MaxUint256) ) { if (!this.sdk.context.contracts.SUSD) throw new Error(UNSUPPORTED_NETWORK) return this.sdk.transactions.createContractTxn(this.sdk.context.contracts.SUSD, 'approve', [ - crossMarginAddress, + smartMarginAddress, amount, ]) } - public async depositCrossMarginAccount(crossMarginAddress: string, amount: Wei) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + /** + * @desc Deposit sUSD into a smart margin account + * @param smartMarginAddress Smart margin account address + * @param amount Amount to deposit + * @returns ethers.js TransactionResponse object + */ + public async depositSmartMarginAccount(smartMarginAddress: string, amount: Wei) { + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) - return this.sdk.transactions.createContractTxn(crossMarginAccountContract, 'execute', [ + return this.sdk.transactions.createContractTxn(smartMarginAccountContract, 'execute', [ [AccountExecuteFunctions.ACCOUNT_MODIFY_MARGIN], [defaultAbiCoder.encode(['int256'], [amount.toBN()])], ]) } - public async withdrawCrossMarginAccount(crossMarginAddress: string, amount: Wei) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + /** + * @desc Withdraw sUSD from a smart margin account + * @param smartMarginAddress Smart margin account address + * @param amount Amount to withdraw + * @returns ethers.js TransactionResponse object + */ + public async withdrawSmartMarginAccount(smartMarginAddress: string, amount: Wei) { + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) - const { commands, inputs } = await this.batchIdleMarketMarginSweeps(crossMarginAddress) + const { commands, inputs } = await this.batchIdleMarketMarginSweeps(smartMarginAddress) commands.push(AccountExecuteFunctions.ACCOUNT_MODIFY_MARGIN) inputs.push(defaultAbiCoder.encode(['int256'], [amount.neg().toBN()])) - return this.sdk.transactions.createContractTxn(crossMarginAccountContract, 'execute', [ + return this.sdk.transactions.createContractTxn(smartMarginAccountContract, 'execute', [ commands, inputs, ]) } + /** + * @desc Modify the margin for a specific market in a smart margin account + * @param smartMarginAddress Smart margin account address + * @param marketAddress Market address + * @param marginDelta Amount to modify the margin by (can be positive or negative) + * @returns ethers.js TransactionResponse object + */ public async modifySmartMarginMarketMargin( - crossMarginAddress: string, + smartMarginAddress: string, marketAddress: string, marginDelta: Wei ) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) @@ -743,7 +969,7 @@ export default class FuturesService { const inputs = [] if (marginDelta.gt(0)) { - const freeMargin = await this.getCrossMarginAccountBalance(crossMarginAddress) + const freeMargin = await this.getSmartMarginAccountBalance(smartMarginAddress) if (marginDelta.gt(freeMargin)) { // Margin delta bigger than account balance, // need to pull some from the users wallet or idle margin @@ -751,7 +977,7 @@ export default class FuturesService { commands: sweepCommands, inputs: sweepInputs, idleMargin, - } = await this.batchIdleMarketMarginSweeps(crossMarginAddress) + } = await this.batchIdleMarketMarginSweeps(smartMarginAddress) commands.push(...sweepCommands) inputs.push(...sweepInputs) @@ -771,18 +997,36 @@ export default class FuturesService { commands.push(AccountExecuteFunctions.PERPS_V2_MODIFY_MARGIN) inputs.push(encodeModidyMarketMarginParams(marketAddress, marginDelta)) - return this.sdk.transactions.createContractTxn(crossMarginAccountContract, 'execute', [ + return this.sdk.transactions.createContractTxn(smartMarginAccountContract, 'execute', [ commands, inputs, ]) } + /** + * @desc Modify the position size for a specific market in a smart margin account + * @param smartMarginAddress Smart margin account address + * @param market Object containing the market key and address + * @param sizeDelta Intended size change (positive or negative) + * @param desiredFillPrice Desired fill price + * @param cancelPendingReduceOrders Boolean describing if pending reduce orders should be cancelled + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.modifySmartMarginPositionSize( + * '0x...', + * { key: FuturesMarketKey.sBTCPERP, address: '0x...' }, + * wei(1), + * wei(10000), + * true + * ) + * console.log(txn) + * ``` + */ public async modifySmartMarginPositionSize( - crossMarginAddress: string, - market: { - key: FuturesMarketKey - address: string - }, + smartMarginAddress: string, + market: { key: FuturesMarketKey; address: string }, sizeDelta: Wei, desiredFillPrice: Wei, cancelPendingReduceOrders?: boolean @@ -791,36 +1035,61 @@ export default class FuturesService { const inputs = [] if (cancelPendingReduceOrders) { - const existingOrders = await this.getConditionalOrders(crossMarginAddress) - const existingOrdersForMarket = existingOrders.filter( - (o) => o.marketKey === market.key && o.reduceOnly - ) - // Remove all pending reduce only orders if instructed - existingOrdersForMarket.forEach((o) => { - commands.push(AccountExecuteFunctions.GELATO_CANCEL_CONDITIONAL_ORDER) - inputs.push(defaultAbiCoder.encode(['uint256'], [o.id])) + const existingOrders = await this.getConditionalOrders(smartMarginAddress) + + existingOrders.forEach((o) => { + // Remove all pending reduce only orders if instructed + if (o.marketKey === market.key && o.reduceOnly) { + commands.push(AccountExecuteFunctions.GELATO_CANCEL_CONDITIONAL_ORDER) + inputs.push(defaultAbiCoder.encode(['uint256'], [o.id])) + } }) } - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) commands.push(AccountExecuteFunctions.PERPS_V2_SUBMIT_OFFCHAIN_DELAYED_ORDER) inputs.push(encodeSubmitOffchainOrderParams(market.address, sizeDelta, desiredFillPrice)) - return this.sdk.transactions.createContractTxn(crossMarginAccountContract, 'execute', [ + return this.sdk.transactions.createContractTxn(smartMarginAccountContract, 'execute', [ commands, inputs, ]) } + /** + * @desc Deposit margin for use in an isolated margin market + * @param marketAddress Market address + * @param amount Amount to deposit + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.depositIsolatedMargin('0x...', wei(1)) + * console.log(txn) + * ``` + */ public async depositIsolatedMargin(marketAddress: string, amount: Wei) { const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) const txn = this.sdk.transactions.createContractTxn(market, 'transferMargin', [amount.toBN()]) return txn } + /** + * @desc Withdraw margin from an isolated margin market + * @param marketAddress Market address + * @param amount Amount to withdraw + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.withdrawIsolatedMargin('0x...', wei(1)) + * console.log(txn) + * ``` + */ public async withdrawIsolatedMargin(marketAddress: string, amount: Wei) { const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) const txn = this.sdk.transactions.createContractTxn(market, 'transferMargin', [ @@ -829,11 +1098,35 @@ export default class FuturesService { return txn } + /** + * @desc Close an open position in an isolated margin market + * @param marketAddress Market address + * @param priceImpactDelta Price impact delta + * @returns ethers.js ContractTransaction object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.closeIsolatedPosition('0x...', wei(1)) + * console.log(txn) + * ``` + */ public async closeIsolatedPosition(marketAddress: string, priceImpactDelta: Wei) { const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) return market.closePositionWithTracking(priceImpactDelta.toBN(), KWENTA_TRACKING_CODE) } + /** + * @desc Get idle margin for given wallet address or smart margin account address + * @param eoa Wallet address + * @param account Smart margin account address + * @returns Total idle margin, idle margin in markets, total wallet balance and the markets with idle margin for the given address(es). + * @example + * ```ts + * const sdk = new KwentaSDK() + * const idleMargin = await sdk.futures.getIdleMargin('0x...') + * console.log(idleMargin) + * ``` + */ public async submitIsolatedMarginOrder( marketAddress: string, sizeDelta: Wei, @@ -848,6 +1141,19 @@ export default class FuturesService { ) } + /** + * @desc Cancels a pending/expired delayed order, for the given market and account + * @param marketAddress Market address + * @param account Wallet address + * @param isOffchain Boolean describing if the order is offchain or not + * @returns ethers.js ContractTransaction object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.cancelDelayedOrder('0x...', '0x...', true) + * console.log(txn) + * ``` + */ public async cancelDelayedOrder(marketAddress: string, account: string, isOffchain: boolean) { const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) return isOffchain @@ -855,11 +1161,36 @@ export default class FuturesService { : market.cancelDelayedOrder(account) } + /** + * @desc Executes a pending delayed order, for the given market and account + * @param marketAddress Market address + * @param account Wallet address + * @returns ethers.js ContractTransaction object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.executeDelayedOrder('0x...', '0x...') + * console.log(txn) + * ``` + */ public async executeDelayedOrder(marketAddress: string, account: string) { const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) return market.executeDelayedOrder(account) } + /** + * @desc Executes a pending delayed order, for the given market and account + * @param marketKey Futures market key + * @param marketAddress Market address + * @param account Wallet address + * @returns ethers.js ContractTransaction object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.executeDelayedOffchainOrder(FuturesMarketKey.sETHPERP, '0x...', '0x...') + * console.log(txn) + * ``` + */ public async executeDelayedOffchainOrder( marketKey: FuturesMarketKey, marketAddress: string, @@ -876,7 +1207,17 @@ export default class FuturesService { return market.executeOffchainDelayedOrder(account, priceUpdateData, { value: updateFee }) } - public async createCrossMarginAccount() { + /** + * @desc Creates a smart margin account + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.createSmartMarginAccount() + * console.log(txn) + * ``` + */ + public async createSmartMarginAccount() { if (!this.sdk.context.contracts.SmartMarginAccountFactory) throw new Error(UNSUPPORTED_NETWORK) return this.sdk.transactions.createContractTxn( this.sdk.context.contracts.SmartMarginAccountFactory, @@ -885,21 +1226,30 @@ export default class FuturesService { ) } - public async submitCrossMarginOrder( - market: { - key: FuturesMarketKey - address: string - }, + /** + * @desc Get idle margin for given wallet address or smart margin account address + * @param eoa Wallet address + * @param account Smart margin account address + * @returns Total idle margin, idle margin in markets, total wallet balance and the markets with idle margin for the given address(es). + * @example + * ```ts + * const sdk = new KwentaSDK() + * const idleMargin = await sdk.futures.getIdleMargin('0x...') + * console.log(idleMargin) + * ``` + */ + public async submitSmartMarginOrder( + market: { key: FuturesMarketKey; address: string }, walletAddress: string, - crossMarginAddress: string, + smartMarginAddress: string, order: SmartMarginOrderInputs, options?: { cancelPendingReduceOrders?: boolean cancelExpiredDelayedOrders?: boolean } ) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) const commands = [] @@ -910,8 +1260,10 @@ export default class FuturesService { inputs.push(defaultAbiCoder.encode(['address'], [market.address])) } - const idleMargin = await this.getIdleMargin(walletAddress, crossMarginAddress) - const freeMargin = await this.getCrossMarginAccountBalance(crossMarginAddress) + const [idleMargin, freeMargin] = await Promise.all([ + this.getIdleMargin(walletAddress, smartMarginAddress), + this.getSmartMarginAccountBalance(smartMarginAddress), + ]) // Sweep idle margin from other markets to account if (idleMargin.marketsTotal.gt(0)) { @@ -958,11 +1310,6 @@ export default class FuturesService { } } - const existingOrders = await this.getConditionalOrders(crossMarginAddress) - const existingOrdersForMarket = existingOrders.filter( - (o) => o.marketKey === market.key && o.reduceOnly - ) - if (order.takeProfit || order.stopLoss) { if (order.takeProfit) { commands.push(AccountExecuteFunctions.GELATO_PLACE_CONDITIONAL_ORDER) @@ -997,6 +1344,11 @@ export default class FuturesService { } } + const existingOrders = await this.getConditionalOrders(smartMarginAddress) + const existingOrdersForMarket = existingOrders.filter( + (o) => o.marketKey === market.key && o.reduceOnly + ) + if (options?.cancelPendingReduceOrders) { // Remove all pending reduce only orders if instructed existingOrdersForMarket.forEach((o) => { @@ -1031,100 +1383,166 @@ export default class FuturesService { } return this.sdk.transactions.createContractTxn( - crossMarginAccountContract, + smartMarginAccountContract, 'execute', [commands, inputs], - { - value: order.keeperEthDeposit?.toBN() ?? '0', - } + { value: order.keeperEthDeposit?.toBN() ?? '0' } ) } - public async closeCrossMarginPosition( - market: { - address: string - key: FuturesMarketKey - }, - crossMarginAddress: string, + /** + * @desc Closes a smart margin position + * @param market Object containing market address and key + * @param smartMarginAddress Smart margin account address + * @param desiredFillPrice Desired fill price + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.closeSmartMarginPosition( + * { address: '0x...', key: FuturesMarketKey.sBTCPERP }, + * '0x...', + * wei(10000) + * ) + * console.log(txn) + * ``` + */ + public async closeSmartMarginPosition( + market: { address: string; key: FuturesMarketKey }, + smartMarginAddress: string, desiredFillPrice: Wei ) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) const commands = [] const inputs = [] - const existingOrders = await this.getConditionalOrders(crossMarginAddress) - const existingOrdersForMarket = existingOrders.filter( - (o) => o.marketKey === market.key && o.reduceOnly - ) + const existingOrders = await this.getConditionalOrders(smartMarginAddress) - existingOrdersForMarket.forEach((o) => { - commands.push(AccountExecuteFunctions.GELATO_CANCEL_CONDITIONAL_ORDER) - inputs.push(defaultAbiCoder.encode(['uint256'], [o.id])) + existingOrders.forEach((o) => { + if (o.marketKey === market.key && o.reduceOnly) { + commands.push(AccountExecuteFunctions.GELATO_CANCEL_CONDITIONAL_ORDER) + inputs.push(defaultAbiCoder.encode(['uint256'], [o.id])) + } }) commands.push(AccountExecuteFunctions.PERPS_V2_SUBMIT_CLOSE_OFFCHAIN_DELAYED_ORDER) inputs.push(encodeCloseOffchainOrderParams(market.address, desiredFillPrice)) - return this.sdk.transactions.createContractTxn(crossMarginAccountContract, 'execute', [ + return this.sdk.transactions.createContractTxn(smartMarginAccountContract, 'execute', [ commands, inputs, ]) } - public async cancelConditionalOrder(crossMarginAddress: string, orderId: number) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + /** + * @desc Cancels a conditional order + * @param smartMarginAddress Smart margin account address + * @param orderId Conditional order id + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.cancelConditionalOrder('0x...', 1) + * console.log(txn) + * ``` + */ + public async cancelConditionalOrder(smartMarginAddress: string, orderId: number) { + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) - return this.sdk.transactions.createContractTxn(crossMarginAccountContract, 'execute', [ + return this.sdk.transactions.createContractTxn(smartMarginAccountContract, 'execute', [ [AccountExecuteFunctions.GELATO_CANCEL_CONDITIONAL_ORDER], [defaultAbiCoder.encode(['uint256'], [orderId])], ]) } - public async withdrawAccountKeeperBalance(crossMarginAddress: string, amount: Wei) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + /** + * @desc Withdraws given smarkt margin account's keeper balance + * @param smartMarginAddress Smart margin account address + * @param amount Amount to withdraw + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.withdrawAccountKeeperBalance('0x...', wei(1)) + * console.log(txn) + * ``` + */ + public async withdrawAccountKeeperBalance(smartMarginAddress: string, amount: Wei) { + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) - return this.sdk.transactions.createContractTxn(crossMarginAccountContract, 'execute', [ + + return this.sdk.transactions.createContractTxn(smartMarginAccountContract, 'execute', [ [AccountExecuteFunctions.ACCOUNT_WITHDRAW_ETH], [defaultAbiCoder.encode(['uint256'], [amount.toBN()])], ]) } + /** + * @desc Updates the stop loss and take profit values for a given smart margin account, based on the specified market. + * @param marketKey Market key + * @param smartMarginAddress Smart margin account address + * @param params Object containing the stop loss and take profit values + * @returns ethers.js TransactionResponse object + * @example + * ```ts + * const sdk = new KwentaSDK() + * const txn = await sdk.futures.updateStopLossAndTakeProfit( + * FuturesMarketKey.sBTCPERP, + * '0x...', + * { + * stopLoss: { + * price: wei(10000), + * sizeDelta: wei(1), + * desiredFillPrice: wei(10000), + * isCancelled: false, + * }, + * takeProfit: { + * price: wei(10000), + * sizeDelta: wei(1), + * desiredFillPrice: wei(10000), + * isCancelled: false, + * }, + * keeperEthDeposit: wei(0.1), + * } + * ) + * console.log(txn) + * ``` + */ public async updateStopLossAndTakeProfit( marketKey: FuturesMarketKey, - crossMarginAddress: string, + smartMarginAddress: string, params: SLTPOrderInputs ) { - const crossMarginAccountContract = SmartMarginAccount__factory.connect( - crossMarginAddress, + const smartMarginAccountContract = SmartMarginAccount__factory.connect( + smartMarginAddress, this.sdk.context.signer ) const commands = [] const inputs = [] if (params.takeProfit || params.stopLoss) { - const existingOrders = await this.getConditionalOrders(crossMarginAddress) - const existingOrdersForMarket = existingOrders.filter((o) => o.marketKey === marketKey) - const existingStopLosses = existingOrdersForMarket.filter( - (o) => - o.size.abs().eq(SL_TP_MAX_SIZE) && - o.reduceOnly && - o.orderType === ConditionalOrderTypeEnum.STOP - ) - const existingTakeProfits = existingOrdersForMarket.filter( - (o) => - o.size.abs().eq(SL_TP_MAX_SIZE) && - o.reduceOnly && - o.orderType === ConditionalOrderTypeEnum.LIMIT - ) + const existingOrders = await this.getConditionalOrders(smartMarginAddress) + const existingStopLosses: ConditionalOrder[] = [] + const existingTakeProfits: ConditionalOrder[] = [] + + existingOrders.forEach((o) => { + if (o.marketKey === marketKey && o.size.abs().eq(SL_TP_MAX_SIZE) && o.reduceOnly) { + if (o.orderType === ConditionalOrderTypeEnum.STOP) { + existingStopLosses.push(o) + } else if (o.orderType === ConditionalOrderTypeEnum.LIMIT) { + existingTakeProfits.push(o) + } + } + }) if (params.takeProfit) { if (existingTakeProfits.length) { @@ -1176,16 +1594,27 @@ export default class FuturesService { } return this.sdk.transactions.createContractTxn( - crossMarginAccountContract, + smartMarginAccountContract, 'execute', [commands, inputs], - { - value: params.keeperEthDeposit?.toBN() ?? '0', - } + { value: params.keeperEthDeposit?.toBN() ?? '0' } ) } - public getSkewAdjustedPrice = async (price: Wei, marketAddress: string, marketKey: string) => { + /** + * @desc Adjusts the given price, based on the current market skew. + * @param price Price to adjust + * @param marketAddress Market address + * @param marketKey Market key + * @returns Adjusted price, based on the given market's skew. + * @example + * ```ts + * const sdk = new KwentaSDK() + * const adjustedPrice = await sdk.futures.getSkewAdjustedPrice(wei(10000), '0x...', FuturesMarketKey.sBTCPERP) + * console.log(adjustedPrice) + * ``` + */ + public async getSkewAdjustedPrice(price: Wei, marketAddress: string, marketKey: string) { const marketContract = new EthCallContract(marketAddress, PerpsMarketABI) const { PerpsV2MarketSettings } = this.sdk.context.multicallContracts if (!PerpsV2MarketSettings) throw new Error(UNSUPPORTED_NETWORK) @@ -1222,8 +1651,8 @@ export default class FuturesService { return market } - private async batchIdleMarketMarginSweeps(crossMarginAddress: string) { - const idleMargin = await this.getIdleMarginInMarkets(crossMarginAddress) + private async batchIdleMarketMarginSweeps(smartMarginAddress: string) { + const idleMargin = await this.getIdleMarginInMarkets(smartMarginAddress) const commands: number[] = [] const inputs: string[] = [] // Sweep idle margin from other markets to account diff --git a/packages/sdk/src/services/perpsV3.ts b/packages/sdk/src/services/perpsV3.ts new file mode 100644 index 0000000000..56deae4fa1 --- /dev/null +++ b/packages/sdk/src/services/perpsV3.ts @@ -0,0 +1,593 @@ +import { defaultAbiCoder } from '@ethersproject/abi' +import { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import { formatBytes32String } from '@ethersproject/strings' +import Wei, { wei } from '@synthetixio/wei' +import { Contract as EthCallContract } from 'ethcall' +import { ethers } from 'ethers' + +import KwentaSDK from '..' +import { UNSUPPORTED_NETWORK } from '../common/errors' +import { KWENTA_TRACKING_CODE } from '../constants/futures' +import { Period, PERIOD_IN_SECONDS } from '../constants/period' +import PerpsMarketABI from '../contracts/abis/PerpsV2Market.json' +import { PerpsV2Market__factory } from '../contracts/types' +import { AsyncOrder } from '../contracts/types/PerpsV3MarketProxy' +import { + queryFuturesTrades, + queryIsolatedMarginTransfers, + queryPositionHistory, + queryTrades, + queryFundingRateHistory, +} from '../queries/futures' +import { + FuturesMarket, + FuturesMarketAsset, + FuturesMarketKey, + FuturesVolumes, + MarketClosureReason, + MarginTransfer, + FuturesMarginType, + PerpsV3SettlementStrategy, + PerpsMarketV3, + PerpsV3Position, +} from '../types/futures' +import { PricesMap } from '../types/prices' +import { + appAdjustedLeverage, + mapFuturesPositions, + mapTrades, + getPerpsV3SubgraphUrl, + marginTypeToSubgraphType, + PerpsV3SymbolToMarketKey, + MarketAssetByKey, + mapPerpsV3Position, + sameSide, + formatV3AsyncOrder, + formatSettlementStrategy, +} from '../utils/futures' +import { getReasonFromCode } from '../utils/synths' +import { queryPerpsV3Markets, querySettlementStrategies } from '../queries/perpsV3' +import { weiFromWei } from '../utils' +import { ZERO_ADDRESS } from '../constants' +import { SynthV3Asset } from '../types' +import { + V3_PERPS_ID_TO_V2_MARKET_KEY, + V3PerpsMarketId, + V3SynthMarketId, +} from '../constants/perpsv3' + +export default class PerpsV3Service { + private sdk: KwentaSDK + public markets: FuturesMarket[] | undefined + private settlementStrategies: { + lastUpdated: number + strategies: PerpsV3SettlementStrategy[] + } = { + lastUpdated: 0, + strategies: [], + } + + constructor(sdk: KwentaSDK) { + this.sdk = sdk + } + + get subgraphUrl() { + return getPerpsV3SubgraphUrl(this.sdk.context.networkId) + } + + public async getMarkets() { + const perpsV3Markets = await queryPerpsV3Markets(this.sdk) + // TODO: Combine settlement strategies and markets query + const strategies = await this.getSettlementStrategies() + + const futuresMarkets = perpsV3Markets.reduce( + ( + acc, + { + perpsMarketId, + marketSymbol, + marketName, + maxFundingVelocity, + makerFee, + takerFee, + skewScale, + } + ) => { + const marketKey = PerpsV3SymbolToMarketKey[marketSymbol] + if (!marketKey) return acc + + acc.push({ + version: 3, + marketId: Number(perpsMarketId), + marketKey: marketKey, + marketName: marketName, + settlementStrategies: strategies.filter((s) => s.marketId === Number(perpsMarketId)), + asset: MarketAssetByKey[marketKey], + assetHex: '', // TODO: Probably remove hex + currentFundingRate: wei(0.0001), // TODO: Funding rate + currentFundingVelocity: wei(maxFundingVelocity).div(24 * 24), // TODO: Current not max? + feeRates: { + makerFee: weiFromWei(makerFee || 0), + takerFee: weiFromWei(takerFee || 0), + makerFeeDelayedOrder: weiFromWei(makerFee || 0), + takerFeeDelayedOrder: weiFromWei(takerFee || 0), + makerFeeOffchainDelayedOrder: weiFromWei(makerFee || 0), + takerFeeOffchainDelayedOrder: weiFromWei(takerFee || 0), + }, + openInterest: { + // TODO: Assign open interest + shortPct: 0, + longPct: 0, + shortUSD: wei(0), + longUSD: wei(0), + long: wei(0), + short: wei(0), + }, + marketDebt: wei(0), + marketSkew: wei(0), + contractMaxLeverage: wei(25), // TODO: Assign leverage + appMaxLeverage: appAdjustedLeverage(wei(25)), + marketSize: wei(0), + marketLimitUsd: wei(1000000), // TODO: Assign limits + marketLimitNative: wei(100), + minInitialMargin: wei(50), // TODO: Is this still relevant in v3 + keeperDeposit: wei(4), // TODO: Assign min keeper fee + isSuspended: false, // TODO: Assign suspensions + marketClosureReason: getReasonFromCode(2) as MarketClosureReason, // TODO: Map closure reason + settings: { + maxMarketValue: wei(1000), // TODO: Max market value + skewScale: weiFromWei(skewScale), + delayedOrderConfirmWindow: 20000, // TODO: assign + offchainDelayedOrderMinAge: 20000, // TODO: assign + offchainDelayedOrderMaxAge: 20000, // TODO: assign + minDelayTimeDelta: 100, // TODO: assign + maxDelayTimeDelta: 100, // TODO: assign + }, + }) + return acc + }, + [] + ) + return futuresMarkets + } + + public async getPositions(accountId: number, marketIds: number[]) { + const proxy = this.sdk.context.multicallContracts.perpsV3MarketProxy + + if (!this.sdk.context.isL2 || !proxy) { + throw new Error(UNSUPPORTED_NETWORK) + } + + const positionCalls = marketIds.map((id) => proxy.getOpenPosition(accountId, id)) + + // TODO: Combine these two? + const positionDetails = (await this.sdk.context.multicallProvider.all(positionCalls)) as [ + BigNumber, + BigNumber, + BigNumber + ][] + + // map the positions using the results + const positions = await Promise.all( + positionDetails.reduce((acc, res, i) => { + const pos = mapPerpsV3Position(marketIds[i], ...res) + if (pos) acc.push(pos) + return acc + }, []) + ) + + return positions + } + + public async getMarketFundingRatesHistory( + marketAsset: FuturesMarketAsset, + periodLength = PERIOD_IN_SECONDS.TWO_WEEKS + ) { + const minTimestamp = Math.floor(Date.now() / 1000) - periodLength + return queryFundingRateHistory(this.sdk, marketAsset, minTimestamp) + } + + public async getSettlementStrategies() { + if (this.settlementStrategies.lastUpdated > Date.now() - PERIOD_IN_SECONDS.ONE_HOUR * 1000) { + return this.settlementStrategies.strategies + } + const strategies = await querySettlementStrategies(this.sdk) + const formattedStrats = strategies.map(formatSettlementStrategy) + this.settlementStrategies = { + lastUpdated: Date.now(), + strategies: formattedStrats, + } + return formattedStrats + } + + public async getAverageFundingRates( + _markets: FuturesMarket[], + _prices: PricesMap, + _period: Period + ) { + return [] + // const fundingRateInputs: FundingRateInput[] = markets.map( + // ({ asset, market, currentFundingRate }) => { + // const price = prices[asset] + // return { + // marketAddress: market, + // marketKey: MarketKeyByAsset[asset], + // price: price, + // currentFundingRate: currentFundingRate, + // } + // } + // ) + + // const fundingRateQueries = fundingRateInputs.map(({ marketAddress, marketKey }) => { + // return gql` + // # last before timestamp + // ${marketKey}_first: fundingRateUpdates( + // first: 1 + // where: { market: "${marketAddress}", timestamp_lt: $minTimestamp } + // orderBy: sequenceLength + // orderDirection: desc + // ) { + // timestamp + // funding + // } + + // # first after timestamp + // ${marketKey}_next: fundingRateUpdates( + // first: 1 + // where: { market: "${marketAddress}", timestamp_gt: $minTimestamp } + // orderBy: sequenceLength + // orderDirection: asc + // ) { + // timestamp + // funding + // } + + // # latest update + // ${marketKey}_latest: fundingRateUpdates( + // first: 1 + // where: { market: "${marketAddress}" } + // orderBy: sequenceLength + // orderDirection: desc + // ) { + // timestamp + // funding + // } + // ` + // }) + // const periodLength = PERIOD_IN_SECONDS[period] + // const minTimestamp = Math.floor(Date.now() / 1000) - periodLength + + // const marketFundingResponses: Record = await request( + // this.futuresGqlEndpoint, + // gql` + // query fundingRateUpdates($minTimestamp: BigInt!) { + // ${fundingRateQueries.reduce((acc: string, curr: string) => { + // return acc + curr + // })} + // } + // `, + // { minTimestamp: minTimestamp } + // ) + + // const periodTitle = period === Period.ONE_HOUR ? '1H Funding Rate' : 'Funding Rate' + + // const fundingRateResponses = fundingRateInputs.map( + // ({ marketKey, currentFundingRate, price }) => { + // if (!price) return null + // const marketResponses = [ + // marketFundingResponses[`${marketKey}_first`], + // marketFundingResponses[`${marketKey}_next`], + // marketFundingResponses[`${marketKey}_latest`], + // ] + + // const responseFilt = marketResponses + // .filter((value: FundingRateUpdate[]) => value.length > 0) + // .map((entry: FundingRateUpdate[]): FundingRateUpdate => entry[0]) + // .sort((a: FundingRateUpdate, b: FundingRateUpdate) => a.timestamp - b.timestamp) + + // const fundingRate = + // responseFilt && !!currentFundingRate + // ? calculateFundingRate( + // minTimestamp, + // periodLength, + // responseFilt, + // price, + // currentFundingRate + // ) + // : currentFundingRate ?? null + + // const fundingPeriod = + // responseFilt && !!currentFundingRate ? periodTitle : 'Inst. Funding Rate' + + // const fundingRateResponse: FundingRateResponse = { + // asset: marketKey, + // fundingTitle: fundingPeriod, + // fundingRate: fundingRate, + // } + // return fundingRateResponse + // } + // ) + + // return fundingRateResponses.filter((funding): funding is FundingRateResponse => !!funding) + } + + public async getDailyVolumes(): Promise { + return {} + // const minTimestamp = Math.floor(calculateTimestampForPeriod(PERIOD_IN_HOURS.ONE_DAY) / 1000) + // const response = await getFuturesAggregateStats( + // this.futuresGqlEndpoint, + // { + // first: 999999, + // where: { + // period: `${PERIOD_IN_SECONDS.ONE_HOUR}`, + // timestamp_gte: `${minTimestamp}`, + // }, + // }, + // { + // id: true, + // marketKey: true, + // asset: true, + // volume: true, + // trades: true, + // timestamp: true, + // period: true, + // feesCrossMarginAccounts: true, + // feesKwenta: true, + // feesSynthetix: true, + // } + // ) + // return response ? calculateVolumes(response) : {} + } + + public async getPerpsV3AccountIds(walletAddress?: string | null): Promise { + const accountProxy = this.sdk.context.contracts.perpsV3AccountProxy + const accountMulticall = this.sdk.context.multicallContracts.perpsV3AccountProxy + if (!accountProxy || !accountMulticall) throw new Error(UNSUPPORTED_NETWORK) + if (!walletAddress) return [] + const accountCount = await accountProxy.balanceOf(walletAddress) + const calls = + Number(accountCount) > 0 + ? [...Array(Number(accountCount)).keys()].map((index) => { + return accountMulticall.tokenOfOwnerByIndex(walletAddress, index) + }) + : [] + + const accountIds = (await this.sdk.context.multicallProvider.all(calls)) as BigNumber[] + return accountIds.map((id) => id.toNumber()) + } + + public async getAccountOwner(id: BigNumberish): Promise { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!marketProxy) throw new Error(UNSUPPORTED_NETWORK) + const owner = await marketProxy.getAccountOwner(id) + if (owner === ZERO_ADDRESS) return null + return owner + } + + public async getMarginTransfers(walletAddress?: string | null): Promise { + const address = walletAddress ?? this.sdk.context.walletAddress + return queryIsolatedMarginTransfers(this.sdk, address) + } + + public async getAvailableMargin(accountId: number) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!marketProxy) throw new Error(UNSUPPORTED_NETWORK) + const availableMargin = await marketProxy.getAvailableMargin(accountId) + return wei(availableMargin) + } + + public async getPendingAsyncOrder(accountId: number) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!marketProxy) throw new Error(UNSUPPORTED_NETWORK) + const order = await marketProxy.getOrder(accountId) + return formatV3AsyncOrder(order) + } + + public async getPendingAsyncOrders(accountId: number, marketIds: BigNumberish[]) { + const proxy = this.sdk.context.multicallContracts.perpsV3MarketProxy + if (!proxy) throw new Error(UNSUPPORTED_NETWORK) + + const orders = (await this.sdk.context.multicallProvider.all( + marketIds.map((market) => proxy.getOrder(market, accountId)) + )) as AsyncOrder.DataStructOutput[] + return orders.filter((o) => o.request.sizeDelta.abs().gt(0)).map(formatV3AsyncOrder) + } + + public async getTradePreview( + marketId: V3PerpsMarketId, + size: Wei, + settlementStrategy: PerpsV3SettlementStrategy + ) { + const proxy = this.sdk.context.multicallContracts.perpsV3MarketProxy + const price = this.sdk.prices.getOffchainPrice(V3_PERPS_ID_TO_V2_MARKET_KEY[marketId]) + if (!proxy) throw new Error(UNSUPPORTED_NETWORK) + if (!price) throw new Error('No price for market') + const [fees, skew, fill] = (await this.sdk.context.multicallProvider.all([ + proxy.getOrderFees(marketId), + proxy.skew(marketId), + proxy.fillPrice(marketId, size.toBN(), price.toBN()), + ])) as [{ makerFee: BigNumber; takerFee: BigNumber }, BigNumber, BigNumber] + + const notional = size.mul(price) + const feeSide = sameSide(notional, wei(skew)) ? wei(fees.takerFee) : wei(fees.makerFee) + const fee = notional.mul(feeSide) + const fillPrice = wei(fill) + const settlementFee = wei(settlementStrategy.settlementReward) + + return { + fillPrice, + fee, + settlementFee, + } + } + + public async getPositionHistory(walletAddress: string) { + const response = await queryPositionHistory(this.sdk, walletAddress, 'eoa') + return response ? mapFuturesPositions(response) : [] + } + + // TODO: Support pagination + + public async getTradesForMarket( + marketAsset: FuturesMarketAsset, + walletAddress: string, + accountType: FuturesMarginType, + pageLength: number = 16 + ) { + const response = await queryTrades(this.sdk, { + marketAsset, + walletAddress, + accountType: marginTypeToSubgraphType(accountType), + pageLength, + }) + return response ? mapTrades(response) : [] + } + + public async getAllTrades( + walletAddress: string, + accountType: FuturesMarginType, + pageLength: number = 16 + ) { + const response = await queryTrades(this.sdk, { + walletAddress, + accountType: marginTypeToSubgraphType(accountType), + pageLength, + }) + return response ? mapTrades(response) : [] + } + + // This is on an interval of 15 seconds. + public async getFuturesTrades(marketKey: FuturesMarketKey, minTs: number, maxTs: number) { + const response = await queryFuturesTrades(this.sdk, marketKey, minTs, maxTs) + return response ? mapTrades(response) : null + } + + // TODO: Get delayed order fee + public async getOrderFee(marketAddress: string, size: Wei) { + const marketContract = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) + const orderFee = await marketContract.orderFee(size.toBN(), 0) + return wei(orderFee.fee) + } + + public async getDepositAllowances(walletAddress: string) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + const susdContract = this.sdk.context.contracts.SNXUSD + if (!susdContract || !marketProxy) throw new Error(UNSUPPORTED_NETWORK) + const snxusd = await susdContract.allowance(walletAddress, marketProxy.address) + return { snxusd: wei(snxusd) } + } + + // Contract mutations + + public async approveDeposit( + asset: SynthV3Asset, + amount: BigNumber = BigNumber.from(ethers.constants.MaxUint256) + ) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + const assetContract = this.sdk.context.contracts[asset] + if (!assetContract || !marketProxy) throw new Error(UNSUPPORTED_NETWORK) + return this.sdk.transactions.createContractTxn(assetContract, 'approve', [ + marketProxy.address, + amount, + ]) + } + + public async depositToAccount(accountId: number, synthId: V3SynthMarketId, amount: Wei) { + return this.modifyCollateral(accountId, synthId, amount) + } + + public async withdrawFromAccount(accountId: number, synthId: V3SynthMarketId, amount: Wei) { + return this.modifyCollateral(accountId, synthId, amount.neg()) + } + + public async closePosition(marketAddress: string, priceImpactDelta: Wei) { + const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.signer) + return market.closePositionWithTracking(priceImpactDelta.toBN(), KWENTA_TRACKING_CODE) + } + + public async submitOrder( + marketId: number, + accountId: number, + sizeDelta: Wei, + acceptablePrice: Wei, + settlementStrategyId: number + ) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!marketProxy) throw new Error(UNSUPPORTED_NETWORK) + + const commitment = { + marketId: marketId, + accountId, + sizeDelta: sizeDelta.toBN(), + settlementStrategyId, + acceptablePrice: acceptablePrice.toBN(), + trackingCode: KWENTA_TRACKING_CODE, + } + + return this.sdk.transactions.createContractTxn(marketProxy, 'commitOrder', [commitment]) + } + + public async cancelAsyncOrder(marketId: number, accountId: number) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!marketProxy) throw new Error(UNSUPPORTED_NETWORK) + return this.sdk.transactions.createContractTxn(marketProxy, 'cancelOrder', [ + marketId, + accountId, + ]) + } + + public async executeAsyncOrder(marketKey: FuturesMarketKey, marketId: number, accountId: number) { + const { Pyth } = this.sdk.context.contracts + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!Pyth || !marketProxy) throw new Error(UNSUPPORTED_NETWORK) + + const extraData = defaultAbiCoder.encode(['uint128', 'uint128'], [marketId, accountId]) + + // get price update data + const priceUpdateData = await this.sdk.prices.getPythPriceUpdateData(marketKey) + const updateFee = await Pyth.getUpdateFee(priceUpdateData) + + return this.sdk.transactions.createContractTxn( + marketProxy, + 'settlePythOrder', + [priceUpdateData[0], extraData], + { value: updateFee } + ) + } + + public async createAccount(requestedId?: BigNumberish) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!marketProxy) throw new Error(UNSUPPORTED_NETWORK) + const id = requestedId ?? Date.now() + return this.sdk.transactions.createContractTxn(marketProxy, 'createAccount', [id]) + } + + public getSkewAdjustedPrice = async (price: Wei, marketAddress: string, marketKey: string) => { + const marketContract = new EthCallContract(marketAddress, PerpsMarketABI) + const { PerpsV2MarketSettings } = this.sdk.context.multicallContracts + if (!PerpsV2MarketSettings) throw new Error(UNSUPPORTED_NETWORK) + + const [marketSkew, skewScale] = await this.sdk.context.multicallProvider.all([ + marketContract.marketSkew(), + PerpsV2MarketSettings.skewScale(formatBytes32String(marketKey)), + ]) + + const skewWei = wei(marketSkew) + const scaleWei = wei(skewScale) + + return price.mul(skewWei.div(scaleWei).add(1)) + } + + // private helpers + + private modifyCollateral(accountId: number, synthId: V3SynthMarketId, amount: Wei) { + const marketProxy = this.sdk.context.contracts.perpsV3MarketProxy + if (!marketProxy) throw new Error(UNSUPPORTED_NETWORK) + + return this.sdk.transactions.createContractTxn(marketProxy, 'modifyCollateral', [ + accountId, + synthId, + amount.toBN(), + ]) + } +} diff --git a/packages/sdk/src/services/prices.ts b/packages/sdk/src/services/prices.ts index 899094178f..64dd8f82c5 100644 --- a/packages/sdk/src/services/prices.ts +++ b/packages/sdk/src/services/prices.ts @@ -62,12 +62,32 @@ export default class PricesService { return this.sdk.context.isMainnet ? PYTH_IDS.mainnet : PYTH_IDS.testnet } + /** + * @desc Get offchain price for a given market + * @param marketKey - Futures market key + * @returns Offchain price for specified market + * @example + * ```ts + * const sdk = new KwentaSDK(); + * const price = sdk.prices.getOffchainPrice(FuturesMarketKey.sBTCPERP); + * console.log(price); + * ``` + */ public getOffchainPrice(marketKey: FuturesMarketKey) { const price = this.offChainPrices[MarketAssetByKey[marketKey]] if (!price) throw new Error(`No price data for ${marketKey}`) return price } + /** + * @desc Start polling pyth price updates + * @param intervalTime - Polling interval in milliseconds + * @example + * ```ts + * const sdk = new KwentaSDK(); + * await sdk.prices.startPriceUpdates(10000); + * ``` + */ public async startPriceUpdates(intervalTime: number) { // Poll the onchain prices if (!this.ratesInterval) { @@ -122,11 +142,11 @@ export default class PricesService { const synths = [...synthsRates[0], ...ADDITIONAL_SYNTHS] const rates = [...synthsRates[1], ...ratesForCurrencies] as CurrencyPrice[] - synths.forEach((currencyKeyBytes32, idx: number) => { + synths.forEach((currencyKeyBytes32, i) => { const currencyKey = parseBytes32String(currencyKeyBytes32) const marketAsset = MarketAssetByKey[currencyKey as FuturesMarketKey] - const rate = Number(formatEther(rates[idx])) + const rate = Number(formatEther(rates[i])) const price = wei(rate) synthPrices[currencyKey] = price @@ -175,6 +195,11 @@ export default class PricesService { return (response ? Object.values(response).flat() : []) as SynthPrice[] } + /** + * @desc Get pyth price update data for a given market + * @param marketKey Futures market key + * @returns Pyth price update data + */ public async getPythPriceUpdateData(marketKey: FuturesMarketKey) { const pythIds = MARKETS[marketKey]?.pythIds const pythId = pythIds ? pythIds[this.sdk.context.isMainnet ? 'mainnet' : 'testnet'] : null diff --git a/packages/sdk/src/services/synths.ts b/packages/sdk/src/services/synths.ts index 7da123a0a5..c6357f241d 100644 --- a/packages/sdk/src/services/synths.ts +++ b/packages/sdk/src/services/synths.ts @@ -1,12 +1,12 @@ import { BigNumber } from '@ethersproject/bignumber' import { parseBytes32String } from '@ethersproject/strings' -import { wei } from '@synthetixio/wei' +import Wei, { wei } from '@synthetixio/wei' import { orderBy } from 'lodash' import KwentaSDK from '..' import * as sdkErrors from '../common/errors' import { ZERO_WEI } from '../constants/number' -import { SynthBalance } from '../types/synths' +import { SynthBalance, SynthV3BalancesAndAllowances } from '../types/synths' import { notNill } from '../utils/general' type SynthBalancesTuple = [string[], BigNumber[], BigNumber[]] @@ -18,6 +18,11 @@ export default class SynthsService { this.sdk = sdk } + /** + * @desc Get synth balances for a given wallet address + * @param walletAddress Wallet address + * @returns Synth balances for the given wallet address + */ public async getSynthBalances(walletAddress: string) { if (!this.sdk.context.contracts.SynthUtil) { throw new Error(sdkErrors.UNSUPPORTED_NETWORK) @@ -29,12 +34,12 @@ export default class SynthsService { let totalUSDBalance = wei(0) - currencyKeys.forEach((currencyKeyBytes32, idx) => { - const balance = wei(synthsBalances[idx]) + currencyKeys.forEach((currencyKeyBytes32, i) => { + const balance = wei(synthsBalances[i]) if (balance.gt(0)) { const synthName = parseBytes32String(currencyKeyBytes32) - const usdBalance = wei(synthsUSDBalances[idx]) + const usdBalance = wei(synthsUSDBalances[i]) balancesMap[synthName] = { currencyKey: synthName, balance, usdBalance } @@ -55,4 +60,36 @@ export default class SynthsService { return balances } + + public async getSynthV3Balances(walletAddress: string) { + const { SNXUSD } = this.sdk.context.multicallContracts + + if (!SNXUSD) throw new Error(sdkErrors.UNSUPPORTED_NETWORK) + const [balance] = await this.sdk.context.multicallProvider.all([ + SNXUSD.balanceOf(walletAddress), + ]) + return { SNXUSD: wei(balance) } + } + + public async getSynthV3BalancesAndAllowances( + walletAddress: string, + spenders: string[] + ): Promise { + const { SNXUSD } = this.sdk.context.multicallContracts + + if (!SNXUSD) throw new Error(sdkErrors.UNSUPPORTED_NETWORK) + const [balance, ...allowances] = (await this.sdk.context.multicallProvider.all([ + SNXUSD.balanceOf(walletAddress), + ...spenders.map((s) => SNXUSD.allowance(walletAddress, s)), + ])) as [BigNumber, BigNumber[]] + return { + SNXUSD: { + balance: wei(balance), + allowances: allowances.reduce>((acc, a, i) => { + acc[spenders[i]] = wei(a) + return acc + }, {}), + }, + } + } } diff --git a/packages/sdk/src/types/futures.ts b/packages/sdk/src/types/futures.ts index a037e0e053..8cc89ce58b 100644 --- a/packages/sdk/src/types/futures.ts +++ b/packages/sdk/src/types/futures.ts @@ -17,7 +17,6 @@ export type SynthSuspensionReason = export type MarketClosureReason = SynthSuspensionReason export type FuturesMarket = { - market: string marketKey: FuturesMarketKey marketName: string asset: FuturesMarketAsset @@ -62,6 +61,17 @@ export type FuturesMarket = { } } +export type PerpsMarketV2 = FuturesMarket & { + version: 2 + marketAddress: string +} + +export type PerpsMarketV3 = FuturesMarket & { + version: 3 + marketId: number + settlementStrategies: PerpsV3SettlementStrategy[] +} + export type FundingRateUpdate = { funding: Wei timestamp: number @@ -224,7 +234,11 @@ export enum PositionSide { SHORT = 'short', } -export type FuturesAccountType = 'cross_margin' | 'smart_margin' | 'isolated_margin' +export enum FuturesMarginType { + SMART_MARGIN = 'smart_margin', + CROSS_MARGIN = 'cross_margin', + ISOLATED_MARGIN_LEGACY = 'isolated_margin_legacy', +} export enum ContractOrderType { MARKET = 0, @@ -267,7 +281,7 @@ export type FuturesPositionHistory = { marketKey: FuturesMarketKey account: string abstractAccount: string - accountType: FuturesAccountType + accountType: FuturesMarginType isOpen: boolean isLiquidated: boolean size: T @@ -288,7 +302,7 @@ export type FuturesPositionHistory = { trades: number } -export type FuturesPosition = { +export type PerpsV2Position = { asset: FuturesMarketAsset marketKey: FuturesMarketKey remainingMargin: T @@ -299,6 +313,16 @@ export type FuturesPosition = { takeProfit?: ConditionalOrder } +export type PerpsV3Position = { + marketId: number + side: PositionSide + accruedFunding: T + profitLoss: T + size: T + pnl: T + pnlPct: T +} + export type ModifyPositionOptions = { delayed?: boolean offchain?: boolean @@ -360,6 +384,16 @@ export type DelayedOrder = { side: PositionSide } +export type PerpsV3AsyncOrder = { + accountId: number + marketId: number + sizeDelta: T + settlementTime: number + settlementStrategyId: number + acceptablePrice: T + side: PositionSide +} + export type FuturesPotentialTradeDetails = { marketKey: FuturesMarketKey size: T @@ -378,6 +412,30 @@ export type FuturesPotentialTradeDetails = { exceedsPriceProtection: boolean } +export type SettlementSubgraphType = { + id: string + marketId: string + strategyId: string + strategyType: string + settlementDelay: string + priceDeviationTolerance: string + settlementWindowDuration: string + url: string + settlementReward: string +} + +export type PerpsV3SettlementStrategy = { + id: string + marketId: number + strategyId: number + strategyType: string + settlementDelay: T + settlementWindowDuration: T + url: string + settlementReward: T + priceDeviationTolerance: T +} + // https://github.com/Synthetixio/synthetix/blob/4d2add4f74c68ac4f1106f6e7be4c31d4f1ccc76/contracts/interfaces/IFuturesMarketBaseTypes.sol#L6-L19 export enum PotentialTradeStatus { // Contract status mapping @@ -428,7 +486,7 @@ export type FuturesTrade = { feesPaid: T keeperFeesPaid: T orderType: FuturesOrderTypeDisplay - accountType: FuturesAccountType + accountType: FuturesMarginType fundingAccrued: T } @@ -462,7 +520,7 @@ export type MarginTransfer = { export type MarketWithIdleMargin = { marketAddress: string marketKey: FuturesMarketKey - position: FuturesPosition + position: PerpsV2Position } export type SmartMarginOrderInputs = { @@ -504,3 +562,22 @@ export type SLTPOrderInputs = { isCancelled?: boolean } } + +export type PerpsV3SubgraphMarket = { + id: string + perpsMarketId: string + marketOwner: string + marketName: string + marketSymbol: string + feedId: string + owner: string + maxFundingVelocity: string + skewScale: string + initialMarginFraction: string + maintenanceMarginFraction: string + liquidationRewardRatioD18: string + maxLiquidationLimitAccumulationMultiplier: string + lockedOiPercent: string + makerFee: string + takerFee: string +} diff --git a/packages/sdk/src/types/stats.ts b/packages/sdk/src/types/stats.ts index 885135ccf6..12b28d70d6 100644 --- a/packages/sdk/src/types/stats.ts +++ b/packages/sdk/src/types/stats.ts @@ -30,11 +30,6 @@ export type FuturesCumulativeStats = { averageTradeSize: string } -export enum FuturesAccountTypes { - ISOLATED_MARGIN = 'isolated_margin', - CROSS_MARGIN = 'cross_margin', -} - export type EnsInfo = { [account: string]: string } diff --git a/packages/sdk/src/types/synths.ts b/packages/sdk/src/types/synths.ts index 463e271ce9..313ed88b7e 100644 --- a/packages/sdk/src/types/synths.ts +++ b/packages/sdk/src/types/synths.ts @@ -44,3 +44,15 @@ export type DeprecatedSynthBalance = { balance: Wei usdBalance: Wei } + +export enum SynthV3Asset { + SNXUSD = 'SNXUSD', +} + +export type SynthV3BalancesAndAllowances = Record< + SynthV3Asset, + { + balance: T + allowances: Record + } +> diff --git a/packages/sdk/src/utils/futures.ts b/packages/sdk/src/utils/futures.ts index 0b4a0dfe70..2ddf0c1b5b 100644 --- a/packages/sdk/src/utils/futures.ts +++ b/packages/sdk/src/utils/futures.ts @@ -14,6 +14,7 @@ import { KWENTA_PYTH_SERVER, PUBLIC_PYTH_SERVER, DEFAULT_PRICE_IMPACT_DELTA_PERCENT, + PERPS_V3_SUBGRAPH_URLS, } from '../constants/futures' import { ZERO_WEI } from '../constants/number' import { SECONDS_PER_DAY } from '../constants/period' @@ -30,7 +31,7 @@ import { ConditionalOrder, FuturesOrderType, FuturesOrderTypeDisplay, - FuturesPosition, + PerpsV2Position, FuturesPositionHistory, FuturesPotentialTradeDetails, FuturesTrade, @@ -41,6 +42,13 @@ import { PotentialTradeStatus, MarginTransfer, ConditionalOrderTypeEnum, + FuturesMarginType, + MarketClosureReason, + PerpsV3Position, + PerpsV3AsyncOrder, + PerpsV3SettlementStrategy, + SettlementSubgraphType, + PerpsMarketV2, } from '../types/futures' import { formatCurrency, formatDollars, weiFromWei } from '../utils/number' import { @@ -50,12 +58,20 @@ import { FuturesTradeResult, FuturesMarginTransferResult, CrossMarginAccountTransferResult, + FuturesAccountType, } from '../utils/subgraph' +import { PerpsV2MarketData } from '../contracts/types' +import { IPerpsV2MarketSettings } from '../contracts/types/PerpsV2MarketData' +import { AsyncOrder } from '../contracts/types/PerpsV3MarketProxy' export const getFuturesEndpoint = (networkId: number) => { return FUTURES_ENDPOINTS[networkId] || FUTURES_ENDPOINTS[10] } +export const getPerpsV3SubgraphUrl = (networkId: NetworkId): string => { + return PERPS_V3_SUBGRAPH_URLS[networkId] ?? PERPS_V3_SUBGRAPH_URLS[420] +} + export const getMainEndpoint = (networkId: number) => { return MAIN_ENDPOINTS[networkId] || MAIN_ENDPOINTS[10] } @@ -154,7 +170,7 @@ export const mapFuturesPosition = ( canLiquidatePosition: boolean, asset: FuturesMarketAsset, marketKey: FuturesMarketKey -): FuturesPosition => { +): PerpsV2Position => { const { remainingMargin, accessibleMargin, @@ -201,6 +217,27 @@ export const mapFuturesPosition = ( } } +export const mapPerpsV3Position = ( + marketId: number, + pnl: BigNumber, + funding: BigNumber, + size: BigNumber +): PerpsV3Position | null => { + const pnlWei = wei(pnl) + const pnlPct = wei(0) // TODO: [PERPS_V3] Calculate PNL % + return wei(size).eq(ZERO_WEI) + ? null + : { + marketId, + side: wei(size).gt(ZERO_WEI) ? PositionSide.LONG : PositionSide.SHORT, + accruedFunding: wei(funding), + profitLoss: wei(pnlWei), + size: wei(size).abs(), + pnl: pnlWei, + pnlPct, + } +} + export const mapFuturesPositions = ( futuresPositions: FuturesPositionResult[] ): FuturesPositionHistory[] => { @@ -249,7 +286,7 @@ export const mapFuturesPositions = ( marketKey: parseBytes32String(marketKey) as FuturesMarketKey, account, abstractAccount, - accountType, + accountType: subgraphAccountTypeToMarginType(accountType), isOpen, isLiquidated, size: sizeWei.abs(), @@ -305,7 +342,7 @@ export const unserializePotentialTrade = ( priceImpact: wei(preview.priceImpact), }) -export const formatDelayedOrder = ( +export const formatV2DelayedOrder = ( account: string, marketAddress: string, order: IPerpsV2MarketConsolidated.DelayedOrderStructOutput @@ -337,6 +374,34 @@ export const formatDelayedOrder = ( } } +export const formatV3AsyncOrder = (order: AsyncOrder.DataStructOutput): PerpsV3AsyncOrder => { + const { accountId, marketId, sizeDelta, settlementStrategyId, acceptablePrice } = order.request + + return { + accountId: accountId.toNumber(), + marketId: marketId.toNumber(), + sizeDelta: wei(sizeDelta), + settlementTime: order.settlementTime.toNumber(), + settlementStrategyId: settlementStrategyId.toNumber(), + acceptablePrice: wei(acceptablePrice), + side: wei(sizeDelta).gt(0) ? PositionSide.LONG : PositionSide.SHORT, + } +} + +export const formatSettlementStrategy = ( + strategy: SettlementSubgraphType +): PerpsV3SettlementStrategy => { + return { + ...strategy, + marketId: Number(strategy.marketId), + strategyId: Number(strategy.strategyId), + settlementDelay: wei(strategy.settlementDelay), + settlementWindowDuration: wei(strategy.settlementWindowDuration), + settlementReward: wei(strategy.settlementReward), + priceDeviationTolerance: wei(strategy.priceDeviationTolerance), + } +} + export const formatPotentialTrade = ( preview: PostTradeDetailsResponse, skewAdjustedPrice: Wei, @@ -500,7 +565,7 @@ export const mapTrades = (futuresTrades: FuturesTradeResult[]): FuturesTrade[] = return { asset: parseBytes32String(asset) as FuturesMarketAsset, account, - accountType, + accountType: subgraphAccountTypeToMarginType(accountType), margin: weiFromWei(margin), size: weiFromWei(size), price: weiFromWei(price), @@ -818,4 +883,108 @@ export const AssetDisplayByAsset: Record = { [FuturesMarketAsset.RPL]: 'Rocket Pool', } as const +export const PerpsV3SymbolToMarketKey: Record = { + ETH: FuturesMarketKey.sETHPERP, +} + +export const PerpsV3SymbolToAsset: Record = { + ETH: FuturesMarketAsset.sETH, +} + +export const MarketKeyToPerpsV3Symbol = { + sETHPERP: 'ETH', +} + +export const AssetToPerpsV3Symbol = { + sETH: 'ETH', +} + export const marketOverrides: Partial>> = {} + +// TODO: Update these types on the subgraph + +export const subgraphAccountTypeToMarginType = (type: FuturesAccountType): FuturesMarginType => { + if (type === 'cross_margin' || type === 'smart_margin') return FuturesMarginType.SMART_MARGIN + return FuturesMarginType.ISOLATED_MARGIN_LEGACY +} + +export const marginTypeToSubgraphType = (type: FuturesMarginType): FuturesAccountType => { + if (type === FuturesMarginType.ISOLATED_MARGIN_LEGACY) return 'isolated_margin' + return 'cross_margin' +} + +export const formatPerpsV2Market = ( + { + market, + key, + asset, + currentFundingRate, + currentFundingVelocity, + feeRates, + marketDebt, + marketSkew, + maxLeverage, + marketSize, + price, + }: PerpsV2MarketData.MarketSummaryStructOutput, + marketParameters: IPerpsV2MarketSettings.ParametersStructOutput, + globalSettings: { + minKeeperFee: Wei + minInitialMargin: Wei + }, + isSuspended: boolean, + suspendedReason: MarketClosureReason +): PerpsMarketV2 => ({ + version: 2, + marketAddress: market, + marketKey: parseBytes32String(key) as FuturesMarketKey, + marketName: getMarketName(parseBytes32String(asset) as FuturesMarketAsset), + asset: parseBytes32String(asset) as FuturesMarketAsset, + assetHex: asset, + currentFundingRate: wei(currentFundingRate).div(24), + currentFundingVelocity: wei(currentFundingVelocity).div(24 * 24), + feeRates: { + makerFee: wei(feeRates.makerFee), + takerFee: wei(feeRates.takerFee), + makerFeeDelayedOrder: wei(feeRates.makerFeeDelayedOrder), + takerFeeDelayedOrder: wei(feeRates.takerFeeDelayedOrder), + makerFeeOffchainDelayedOrder: wei(feeRates.makerFeeOffchainDelayedOrder), + takerFeeOffchainDelayedOrder: wei(feeRates.takerFeeOffchainDelayedOrder), + }, + openInterest: { + shortPct: wei(marketSize).eq(0) + ? 0 + : wei(marketSize).sub(marketSkew).div('2').div(marketSize).toNumber(), + longPct: wei(marketSize).eq(0) + ? 0 + : wei(marketSize).add(marketSkew).div('2').div(marketSize).toNumber(), + shortUSD: wei(marketSize).eq(0) ? wei(0) : wei(marketSize).sub(marketSkew).div('2').mul(price), + longUSD: wei(marketSize).eq(0) ? wei(0) : wei(marketSize).add(marketSkew).div('2').mul(price), + long: wei(marketSize).add(marketSkew).div('2'), + short: wei(marketSize).sub(marketSkew).div('2'), + }, + marketDebt: wei(marketDebt), + marketSkew: wei(marketSkew), + contractMaxLeverage: wei(maxLeverage), + appMaxLeverage: appAdjustedLeverage(wei(maxLeverage)), + marketSize: wei(marketSize), + marketLimitUsd: wei(marketParameters.maxMarketValue).mul(wei(price)), + marketLimitNative: wei(marketParameters.maxMarketValue), + minInitialMargin: globalSettings.minInitialMargin, + keeperDeposit: globalSettings.minKeeperFee, + isSuspended: isSuspended, + marketClosureReason: suspendedReason, + settings: { + maxMarketValue: wei(marketParameters.maxMarketValue), + skewScale: wei(marketParameters.skewScale), + delayedOrderConfirmWindow: wei(marketParameters.delayedOrderConfirmWindow, 0).toNumber(), + offchainDelayedOrderMinAge: wei(marketParameters.offchainDelayedOrderMinAge, 0).toNumber(), + offchainDelayedOrderMaxAge: wei(marketParameters.offchainDelayedOrderMaxAge, 0).toNumber(), + minDelayTimeDelta: wei(marketParameters.minDelayTimeDelta, 0).toNumber(), + maxDelayTimeDelta: wei(marketParameters.maxDelayTimeDelta, 0).toNumber(), + }, +}) + +export const sameSide = (a: Wei, b: Wei) => { + return a.gt(wei(0)) === b.gt(wei(0)) +} diff --git a/packages/sdk/typedoc.json b/packages/sdk/typedoc.json new file mode 100644 index 0000000000..7d7d376311 --- /dev/null +++ b/packages/sdk/typedoc.json @@ -0,0 +1,7 @@ +{ + "entryPoints": ["src/index.ts", "src/services/*.ts", "src/types/*.ts", "src/context.ts"], + "out": "docs", + "plugin": ["typedoc-plugin-markdown"], + "excludePrivate": true +} + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e0b51d31ca..a29690d380 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -248,7 +248,7 @@ importers: version: 7.0.27(react-dom@18.2.0)(react@18.2.0) '@storybook/nextjs': specifier: 7.0.27 - version: 7.0.27(@babel/core@7.22.9)(esbuild@0.17.19)(next@13.4.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(webpack@5.88.1) + version: 7.0.27(@babel/core@7.22.9)(esbuild@0.17.19)(next@13.4.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(webpack@5.88.2) '@storybook/react': specifier: 7.0.27 version: 7.0.27(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6) @@ -277,8 +277,8 @@ importers: specifier: ^2.8.13 version: 2.8.13 '@types/jest': - specifier: 27.0.2 - version: 27.0.2 + specifier: ^29.5.3 + version: 29.5.3 '@types/lodash': specifier: 4.14.195 version: 4.14.195 @@ -311,7 +311,7 @@ importers: version: 5.14.9 css-loader: specifier: ^6.8.1 - version: 6.8.1(webpack@5.88.1) + version: 6.8.1(webpack@5.88.2) eslint-config-turbo: specifier: 1.10.11 version: 1.10.11(eslint@8.45.0) @@ -319,20 +319,20 @@ importers: specifier: 1.11.11 version: 1.11.11 jest: - specifier: 28.1.0 - version: 28.1.0(@types/node@14.0.13) + specifier: ^29.6.2 + version: 29.6.2(@types/node@14.0.13) jest-environment-jsdom: - specifier: 28.1.0 - version: 28.1.0 + specifier: ^29.6.2 + version: 29.6.2 jest-preview: specifier: ^0.3.1 version: 0.3.1(postcss@8.4.27) jest-transformer-svg: specifier: ^2.0.1 - version: 2.0.1(jest@28.1.0)(react@18.2.0) + version: 2.0.1(jest@29.6.2)(react@18.2.0) next-router-mock: specifier: 0.9.7 - version: 0.9.7(next@13.4.8)(react@18.2.0) + version: 0.9.7(next@13.4.12)(react@18.2.0) pinst: specifier: 3.0.0 version: 3.0.0 @@ -404,7 +404,7 @@ importers: version: 5.7.2 graphql-request: specifier: ^6.1.0 - version: 6.1.0(graphql@15.8.0) + version: 6.1.0(graphql@16.7.1) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -421,9 +421,18 @@ importers: '@types/lodash': specifier: ^4.14.195 version: 4.14.195 + rimraf: + specifier: ^5.0.1 + version: 5.0.1 typechain: specifier: ^8.2.0 version: 8.2.0(typescript@5.1.3) + typedoc: + specifier: ^0.24.8 + version: 0.24.8(typescript@5.1.3) + typedoc-plugin-markdown: + specifier: ^3.15.3 + version: 3.15.3(typedoc@0.24.8) typescript: specifier: ^5.1.3 version: 5.1.3 @@ -646,6 +655,20 @@ packages: semver: 6.3.1 dev: true + /@babel/helper-compilation-targets@7.22.9(@babel/core@7.22.5): + resolution: {integrity: sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.22.9 + '@babel/core': 7.22.5 + '@babel/helper-validator-option': 7.22.5 + browserslist: 4.21.9 + lru-cache: 5.1.1 + semver: 6.3.1 + dev: true + /@babel/helper-compilation-targets@7.22.9(@babel/core@7.22.9): resolution: {integrity: sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==} engines: {node: '>=6.9.0'} @@ -777,7 +800,7 @@ packages: '@babel/core': ^7.4.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.22.5) + '@babel/helper-compilation-targets': 7.22.9(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 debug: 4.3.4(supports-color@5.5.0) lodash.debounce: 4.0.8 @@ -939,7 +962,7 @@ packages: '@babel/helper-member-expression-to-functions': 7.22.5 '@babel/helper-optimise-call-expression': 7.22.5 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) + '@babel/traverse': 7.22.8 '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color @@ -988,7 +1011,7 @@ packages: dependencies: '@babel/helper-function-name': 7.22.5 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) + '@babel/traverse': 7.22.8 '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color @@ -4984,12 +5007,12 @@ packages: resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} dev: true - /@graphql-typed-document-node/core@3.2.0(graphql@15.8.0): + /@graphql-typed-document-node/core@3.2.0(graphql@16.7.1): resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} peerDependencies: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - graphql: 15.8.0 + graphql: 16.7.1 dev: false /@humanwhocodes/config-array@0.11.10: @@ -5009,6 +5032,18 @@ packages: /@humanwhocodes/object-schema@1.2.1: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + /@isaacs/cliui@8.0.2: + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + dependencies: + string-width: 5.1.2 + string-width-cjs: /string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: /strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: /wrap-ansi@7.0.0 + dev: true + /@istanbuljs/load-nyc-config@1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -5025,114 +5060,115 @@ packages: engines: {node: '>=8'} dev: true - /@jest/console@28.1.3: - resolution: {integrity: sha512-QPAkP5EwKdK/bxIr6C1I4Vs0rm2nHiANzj/Z5X2JQkrZo6IqvC4ldZ9K95tF0HdidhA8Bo6egxSzUFPYKcEXLw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/console@29.6.2: + resolution: {integrity: sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 28.1.3 - '@types/node': 18.15.13 + '@jest/types': 29.6.1 + '@types/node': 14.0.13 chalk: 4.1.2 - jest-message-util: 28.1.3 - jest-util: 28.1.3 + jest-message-util: 29.6.2 + jest-util: 29.6.2 slash: 3.0.0 dev: true - /@jest/core@28.1.3: - resolution: {integrity: sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/core@29.6.2: + resolution: {integrity: sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: node-notifier: optional: true dependencies: - '@jest/console': 28.1.3 - '@jest/reporters': 28.1.3 - '@jest/test-result': 28.1.3 - '@jest/transform': 28.1.3 - '@jest/types': 28.1.3 - '@types/node': 17.0.45 + '@jest/console': 29.6.2 + '@jest/reporters': 29.6.2 + '@jest/test-result': 29.6.2 + '@jest/transform': 29.6.2 + '@jest/types': 29.6.1 + '@types/node': 14.0.13 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.8.0 exit: 0.1.2 graceful-fs: 4.2.11 - jest-changed-files: 28.1.3 - jest-config: 28.1.3(@types/node@17.0.45) - jest-haste-map: 28.1.3 - jest-message-util: 28.1.3 - jest-regex-util: 28.0.2 - jest-resolve: 28.1.3 - jest-resolve-dependencies: 28.1.3 - jest-runner: 28.1.3 - jest-runtime: 28.1.3 - jest-snapshot: 28.1.3 - jest-util: 28.1.3 - jest-validate: 28.1.3 - jest-watcher: 28.1.3 + jest-changed-files: 29.5.0 + jest-config: 29.6.2(@types/node@14.0.13) + jest-haste-map: 29.6.2 + jest-message-util: 29.6.2 + jest-regex-util: 29.4.3 + jest-resolve: 29.6.2 + jest-resolve-dependencies: 29.6.2 + jest-runner: 29.6.2 + jest-runtime: 29.6.2 + jest-snapshot: 29.6.2 + jest-util: 29.6.2 + jest-validate: 29.6.2 + jest-watcher: 29.6.2 micromatch: 4.0.5 - pretty-format: 28.1.3 - rimraf: 3.0.2 + pretty-format: 29.6.2 slash: 3.0.0 strip-ansi: 6.0.1 transitivePeerDependencies: + - babel-plugin-macros - supports-color - ts-node dev: true - /@jest/environment@28.1.3: - resolution: {integrity: sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/environment@29.6.2: + resolution: {integrity: sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/fake-timers': 28.1.3 - '@jest/types': 28.1.3 - '@types/node': 18.15.13 - jest-mock: 28.1.3 + '@jest/fake-timers': 29.6.2 + '@jest/types': 29.6.1 + '@types/node': 14.0.13 + jest-mock: 29.6.2 dev: true - /@jest/expect-utils@28.1.3: - resolution: {integrity: sha512-wvbi9LUrHJLn3NlDW6wF2hvIMtd4JUl2QNVrjq+IBSHirgfrR3o9RnVtxzdEGO2n9JyIWwHnLfby5KzqBGg2YA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/expect-utils@29.6.2: + resolution: {integrity: sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 28.0.2 + jest-get-type: 29.4.3 dev: true - /@jest/expect@28.1.3: - resolution: {integrity: sha512-lzc8CpUbSoE4dqT0U+g1qODQjBRHPpCPXissXD4mS9+sWQdmmpeJ9zSH1rS1HEkrsMN0fb7nKrJ9giAR1d3wBw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/expect@29.6.2: + resolution: {integrity: sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - expect: 28.1.3 - jest-snapshot: 28.1.3 + expect: 29.6.2 + jest-snapshot: 29.6.2 transitivePeerDependencies: - supports-color dev: true - /@jest/fake-timers@28.1.3: - resolution: {integrity: sha512-D/wOkL2POHv52h+ok5Oj/1gOG9HSywdoPtFsRCUmlCILXNn5eIWmcnd3DIiWlJnpGvQtmajqBP95Ei0EimxfLw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/fake-timers@29.6.2: + resolution: {integrity: sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 28.1.3 - '@sinonjs/fake-timers': 9.1.2 - '@types/node': 18.15.13 - jest-message-util: 28.1.3 - jest-mock: 28.1.3 - jest-util: 28.1.3 + '@jest/types': 29.6.1 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 14.0.13 + jest-message-util: 29.6.2 + jest-mock: 29.6.2 + jest-util: 29.6.2 dev: true - /@jest/globals@28.1.3: - resolution: {integrity: sha512-XFU4P4phyryCXu1pbcqMO0GSQcYe1IsalYCDzRNyhetyeyxMcIxa11qPNDpVNLeretItNqEmYYQn1UYz/5x1NA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/globals@29.6.2: + resolution: {integrity: sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 28.1.3 - '@jest/expect': 28.1.3 - '@jest/types': 28.1.3 + '@jest/environment': 29.6.2 + '@jest/expect': 29.6.2 + '@jest/types': 29.6.1 + jest-mock: 29.6.2 transitivePeerDependencies: - supports-color dev: true - /@jest/reporters@28.1.3: - resolution: {integrity: sha512-JuAy7wkxQZVNU/V6g9xKzCGC5LVXx9FDcABKsSXp5MiKPEE2144a/vXTEDoyzjUpZKfVwp08Wqg5A4WfTMAzjg==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/reporters@29.6.2: + resolution: {integrity: sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: @@ -5140,12 +5176,12 @@ packages: optional: true dependencies: '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 28.1.3 - '@jest/test-result': 28.1.3 - '@jest/transform': 28.1.3 - '@jest/types': 28.1.3 + '@jest/console': 29.6.2 + '@jest/test-result': 29.6.2 + '@jest/transform': 29.6.2 + '@jest/types': 29.6.1 '@jridgewell/trace-mapping': 0.3.18 - '@types/node': 18.15.13 + '@types/node': 14.0.13 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -5156,76 +5192,68 @@ packages: istanbul-lib-report: 3.0.0 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.5 - jest-message-util: 28.1.3 - jest-util: 28.1.3 - jest-worker: 28.1.3 + jest-message-util: 29.6.2 + jest-util: 29.6.2 + jest-worker: 29.6.2 slash: 3.0.0 string-length: 4.0.2 strip-ansi: 6.0.1 - terminal-link: 2.1.1 v8-to-istanbul: 9.1.0 transitivePeerDependencies: - supports-color dev: true - /@jest/schemas@28.1.3: - resolution: {integrity: sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - dependencies: - '@sinclair/typebox': 0.24.51 - dev: true - - /@jest/schemas@29.4.3: - resolution: {integrity: sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==} + /@jest/schemas@29.6.0: + resolution: {integrity: sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@sinclair/typebox': 0.25.24 + '@sinclair/typebox': 0.27.8 dev: true - /@jest/source-map@28.1.2: - resolution: {integrity: sha512-cV8Lx3BeStJb8ipPHnqVw/IM2VCMWO3crWZzYodSIkxXnRcXJipCdx1JCK0K5MsJJouZQTH73mzf4vgxRaH9ww==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/source-map@29.6.0: + resolution: {integrity: sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jridgewell/trace-mapping': 0.3.18 callsites: 3.1.0 graceful-fs: 4.2.11 dev: true - /@jest/test-result@28.1.3: - resolution: {integrity: sha512-kZAkxnSE+FqE8YjW8gNuoVkkC9I7S1qmenl8sGcDOLropASP+BkcGKwhXoyqQuGOGeYY0y/ixjrd/iERpEXHNg==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/test-result@29.6.2: + resolution: {integrity: sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 28.1.3 - '@jest/types': 28.1.3 + '@jest/console': 29.6.2 + '@jest/types': 29.6.1 '@types/istanbul-lib-coverage': 2.0.4 collect-v8-coverage: 1.0.1 dev: true - /@jest/test-sequencer@28.1.3: - resolution: {integrity: sha512-NIMPEqqa59MWnDi1kvXXpYbqsfQmSJsIbnd85mdVGkiDfQ9WQQTXOLsvISUfonmnBT+w85WEgneCigEEdHDFxw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/test-sequencer@29.6.2: + resolution: {integrity: sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 28.1.3 + '@jest/test-result': 29.6.2 graceful-fs: 4.2.11 - jest-haste-map: 28.1.3 + jest-haste-map: 29.6.2 slash: 3.0.0 dev: true - /@jest/transform@28.1.3: - resolution: {integrity: sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /@jest/transform@29.5.0: + resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.22.9 - '@jest/types': 28.1.3 + '@jest/types': 29.6.1 '@jridgewell/trace-mapping': 0.3.18 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 - convert-source-map: 1.9.0 + convert-source-map: 2.0.0 fast-json-stable-stringify: 2.1.0 graceful-fs: 4.2.11 - jest-haste-map: 28.1.3 - jest-regex-util: 28.0.2 - jest-util: 28.1.3 + jest-haste-map: 29.6.2 + jest-regex-util: 29.4.3 + jest-util: 29.6.2 micromatch: 4.0.5 pirates: 4.0.6 slash: 3.0.0 @@ -5234,21 +5262,21 @@ packages: - supports-color dev: true - /@jest/transform@29.5.0: - resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==} + /@jest/transform@29.6.2: + resolution: {integrity: sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.22.9 - '@jest/types': 29.5.0 + '@jest/types': 29.6.1 '@jridgewell/trace-mapping': 0.3.18 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 fast-json-stable-stringify: 2.1.0 graceful-fs: 4.2.11 - jest-haste-map: 29.5.0 + jest-haste-map: 29.6.2 jest-regex-util: 29.4.3 - jest-util: 29.5.0 + jest-util: 29.6.2 micromatch: 4.0.5 pirates: 4.0.6 slash: 3.0.0 @@ -5257,23 +5285,11 @@ packages: - supports-color dev: true - /@jest/types@28.1.3: - resolution: {integrity: sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - dependencies: - '@jest/schemas': 28.1.3 - '@types/istanbul-lib-coverage': 2.0.4 - '@types/istanbul-reports': 3.0.1 - '@types/node': 18.15.13 - '@types/yargs': 17.0.24 - chalk: 4.1.2 - dev: true - - /@jest/types@29.5.0: - resolution: {integrity: sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==} + /@jest/types@29.6.1: + resolution: {integrity: sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 29.4.3 + '@jest/schemas': 29.6.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 '@types/node': 14.0.13 @@ -5686,6 +5702,13 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 + /@pkgjs/parseargs@0.11.0: + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + requiresBuild: true + dev: true + optional: true + /@pkgr/utils@2.4.1: resolution: {integrity: sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -6015,12 +6038,8 @@ packages: tslib: 2.6.0 dev: false - /@sinclair/typebox@0.24.51: - resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} - dev: true - - /@sinclair/typebox@0.25.24: - resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true /@sindresorhus/is@0.14.0: @@ -6028,16 +6047,16 @@ packages: engines: {node: '>=6'} dev: true - /@sinonjs/commons@1.8.6: - resolution: {integrity: sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==} + /@sinonjs/commons@3.0.0: + resolution: {integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==} dependencies: type-detect: 4.0.8 dev: true - /@sinonjs/fake-timers@9.1.2: - resolution: {integrity: sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==} + /@sinonjs/fake-timers@10.3.0: + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} dependencies: - '@sinonjs/commons': 1.8.6 + '@sinonjs/commons': 3.0.0 dev: true /@socket.tech/ll-core-v2@0.0.32: @@ -6976,7 +6995,7 @@ packages: resolution: {integrity: sha512-TXJJd5RAKakWx4BtpwvSNdgTDkKM6RkXU8GK34S/LhidQ5Pjz3wcnqb0TxEkfhK/ztbP8nKHqXFwLfa2CYkvQw==} dev: true - /@storybook/nextjs@7.0.27(@babel/core@7.22.9)(esbuild@0.17.19)(next@13.4.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(webpack@5.88.1): + /@storybook/nextjs@7.0.27(@babel/core@7.22.9)(esbuild@0.17.19)(next@13.4.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(webpack@5.88.2): resolution: {integrity: sha512-WsoIPU+ThCIYxjf5p4vyJ/iVIcua0nOR4GI1AD3r+KclgVdBS+Byx69n86GFMXVAeJqn7dfvdIE2Na9FlAPY/A==} engines: {node: '>=16.0.0'} peerDependencies: @@ -7020,28 +7039,28 @@ packages: '@storybook/preview-api': 7.0.27 '@storybook/react': 7.0.27(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6) '@types/node': 16.18.38 - css-loader: 6.8.1(webpack@5.88.1) + css-loader: 6.8.1(webpack@5.88.2) find-up: 5.0.0 fs-extra: 11.1.1 image-size: 1.0.2 loader-utils: 3.2.1 next: 13.4.12(@babel/core@7.22.9)(react-dom@18.2.0)(react@18.2.0) - node-polyfill-webpack-plugin: 2.0.1(webpack@5.88.1) + node-polyfill-webpack-plugin: 2.0.1(webpack@5.88.2) pnp-webpack-plugin: 1.7.0(typescript@5.1.6) postcss: 8.4.27 - postcss-loader: 7.3.3(postcss@8.4.27)(webpack@5.88.1) + postcss-loader: 7.3.3(postcss@8.4.27)(webpack@5.88.2) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) resolve-url-loader: 5.0.0 - sass-loader: 12.6.0(webpack@5.88.1) + sass-loader: 12.6.0(webpack@5.88.2) semver: 7.5.4 - style-loader: 3.3.3(webpack@5.88.1) + style-loader: 3.3.3(webpack@5.88.2) styled-jsx: 5.1.1(@babel/core@7.22.9)(react@18.2.0) ts-dedent: 2.2.0 tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 3.5.2 typescript: 5.1.6 - webpack: 5.88.1(esbuild@0.17.19) + webpack: 5.88.2(esbuild@0.17.19) transitivePeerDependencies: - '@swc/core' - '@types/webpack' @@ -7969,19 +7988,19 @@ packages: '@types/istanbul-lib-report': 3.0.0 dev: true - /@types/jest@27.0.2: - resolution: {integrity: sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA==} + /@types/jest@29.5.3: + resolution: {integrity: sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==} dependencies: - jest-diff: 27.5.1 - pretty-format: 27.5.1 + expect: 29.6.2 + pretty-format: 29.6.2 dev: true - /@types/jsdom@16.2.15: - resolution: {integrity: sha512-nwF87yjBKuX/roqGYerZZM0Nv1pZDMAT5YhOHYeM/72Fic+VEqJh4nyoqoapzJnW3pUlfxPY5FhgsJtM+dRnQQ==} + /@types/jsdom@20.0.1: + resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 18.15.13 - '@types/parse5': 6.0.3 + '@types/node': 14.0.13 '@types/tough-cookie': 4.0.2 + parse5: 7.1.2 dev: true /@types/json-schema@7.0.12: @@ -8043,10 +8062,6 @@ packages: resolution: {integrity: sha512-6sfo1qTulpVbkxECP+AVrHV9OoJqhzCsfTNp5NIG+enM4HyM3HvZCO798WShIXBN0+QtDIcutJCjsVYnQP5rIQ==} dev: true - /@types/node@17.0.45: - resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - dev: true - /@types/node@18.15.13: resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} @@ -8061,10 +8076,6 @@ packages: /@types/parse-json@4.0.0: resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} - /@types/parse5@6.0.3: - resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} - dev: true - /@types/pbkdf2@3.1.0: resolution: {integrity: sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==} dependencies: @@ -8182,7 +8193,7 @@ packages: /@types/testing-library__jest-dom@5.14.9: resolution: {integrity: sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw==} dependencies: - '@types/jest': 27.0.2 + '@types/jest': 29.5.3 dev: true /@types/tough-cookie@4.0.2: @@ -8210,7 +8221,7 @@ packages: /@types/ws@8.5.5: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: - '@types/node': 18.15.13 + '@types/node': 14.0.13 dev: false /@types/yargs-parser@21.0.0: @@ -9163,26 +9174,18 @@ packages: negotiator: 0.6.3 dev: true - /acorn-globals@6.0.0: - resolution: {integrity: sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==} - dependencies: - acorn: 7.4.1 - acorn-walk: 7.2.0 - dev: true - /acorn-globals@7.0.1: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} dependencies: - acorn: 8.9.0 + acorn: 8.10.0 acorn-walk: 8.2.0 - dev: false - /acorn-import-assertions@1.9.0(acorn@8.9.0): + /acorn-import-assertions@1.9.0(acorn@8.10.0): resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} peerDependencies: acorn: ^8 dependencies: - acorn: 8.9.0 + acorn: 8.10.0 dev: true /acorn-jsx@5.3.2(acorn@7.4.1): @@ -9208,7 +9211,6 @@ packages: /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} - dev: false /acorn@7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} @@ -9216,6 +9218,11 @@ packages: hasBin: true dev: true + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} + engines: {node: '>=0.4.0'} + hasBin: true + /acorn@8.9.0: resolution: {integrity: sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==} engines: {node: '>=0.4.0'} @@ -9350,6 +9357,10 @@ packages: engines: {node: '>=12'} dev: true + /ansi-sequence-parser@1.1.0: + resolution: {integrity: sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==} + dev: true + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -9604,17 +9615,17 @@ packages: '@babel/core': 7.22.9 dev: true - /babel-jest@28.1.3(@babel/core@7.22.9): - resolution: {integrity: sha512-epUaPOEWMk3cWX0M/sPvCHHCe9fMFAa/9hXEgKP8nFfNl/jlGkE9ucq9NqkZGXLDduCJYS0UvSlPUwC0S+rH6Q==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /babel-jest@29.6.2(@babel/core@7.22.9): + resolution: {integrity: sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: '@babel/core': 7.22.9 - '@jest/transform': 28.1.3 + '@jest/transform': 29.6.2 '@types/babel__core': 7.20.1 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 28.1.3(@babel/core@7.22.9) + babel-preset-jest: 29.5.0(@babel/core@7.22.9) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -9652,9 +9663,9 @@ packages: - supports-color dev: true - /babel-plugin-jest-hoist@28.1.3: - resolution: {integrity: sha512-Ys3tUKAmfnkRUpPdpa98eYrAR0nV+sSFUZZEGuQ2EbFd1y4SOLtD5QDNHAq+bb9a+bbXvYQC4b+ID/THIMcU6Q==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /babel-plugin-jest-hoist@29.5.0: + resolution: {integrity: sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/template': 7.22.5 '@babel/types': 7.22.5 @@ -9831,14 +9842,14 @@ packages: '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.9) dev: true - /babel-preset-jest@28.1.3(@babel/core@7.22.9): - resolution: {integrity: sha512-L+fupJvlWAHbQfn74coNX3zf60LXMJsezNvvx8eIh7iOR1luJ1poxYgQk1F8PYtNq/6QODDHCqsSnTFSWC491A==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /babel-preset-jest@29.5.0(@babel/core@7.22.9): + resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.22.9 - babel-plugin-jest-hoist: 28.1.3 + babel-plugin-jest-hoist: 29.5.0 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.9) dev: true @@ -10035,10 +10046,6 @@ packages: resolution: {integrity: sha512-nfulgvOR6S4gt9UKCeGJOuSGBPGiFT6oQ/2UBnvTY/5aQ1PnksW72fhZkM30DzoRRv2WpwZf1vHHEr3mtuXIWQ==} dev: true - /browser-process-hrtime@1.0.0: - resolution: {integrity: sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==} - dev: true - /browserify-aes@1.2.0: resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} dependencies: @@ -10095,6 +10102,17 @@ packages: pako: 1.0.11 dev: true + /browserslist@4.21.10: + resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001518 + electron-to-chromium: 1.4.477 + node-releases: 2.0.13 + update-browserslist-db: 1.0.11(browserslist@4.21.10) + dev: true + /browserslist@4.21.9: resolution: {integrity: sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -10252,6 +10270,10 @@ packages: /caniuse-lite@1.0.30001511: resolution: {integrity: sha512-NaWPJawcoedlghN4P7bDNeADD7K+rZaY6V8ZcME7PkEZo/nfOg+lnrUgRWiKbNxcQ4/toFKSxnS4WdbyPZnKkw==} + /caniuse-lite@1.0.30001518: + resolution: {integrity: sha512-rup09/e3I0BKjncL+FesTayKtPrdwKhUufQFd3riFw1hHg8JmIFoInYfB102cFcY/pPgGmdyl/iy+jgiDi2vdA==} + dev: true + /case-sensitive-paths-webpack-plugin@2.4.0: resolution: {integrity: sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==} engines: {node: '>=4'} @@ -10836,6 +10858,23 @@ packages: webpack: 5.88.1(esbuild@0.17.19) dev: true + /css-loader@6.8.1(webpack@5.88.2): + resolution: {integrity: sha512-xDAXtEVGlD0gJ07iclwWVkLoZOpEvAWaSyf6W18S2pOC//K8+qUDIx8IIT3D+HjnmkJPQeesOPv5aiUaJsCM2g==} + engines: {node: '>= 12.13.0'} + peerDependencies: + webpack: ^5.0.0 + dependencies: + icss-utils: 5.1.0(postcss@8.4.27) + postcss: 8.4.27 + postcss-modules-extract-imports: 3.0.0(postcss@8.4.27) + postcss-modules-local-by-default: 4.0.3(postcss@8.4.27) + postcss-modules-scope: 3.0.0(postcss@8.4.27) + postcss-modules-values: 4.0.0(postcss@8.4.27) + postcss-value-parser: 4.2.0 + semver: 7.5.3 + webpack: 5.88.2(esbuild@0.17.19) + dev: true + /css-mediaquery@0.1.2: resolution: {integrity: sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q==} dev: false @@ -11100,6 +11139,15 @@ packages: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true + /dedent@1.5.1: + resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + dev: true + /deep-diff@0.3.8: resolution: {integrity: sha512-yVn6RZmHiGnxRKR9sJb3iVV2XTF1Ghh2DiWRZ3dMnGc43yUdWWF/kX6lQyk3+P84iprfWKU/8zFTrlkvtFm1ug==} dev: false @@ -11286,14 +11334,9 @@ packages: - supports-color dev: true - /diff-sequences@27.5.1: - resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - dev: true - - /diff-sequences@28.1.1: - resolution: {integrity: sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /diff-sequences@29.4.3: + resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true /diffie-hellman@5.0.3: @@ -11472,6 +11515,10 @@ packages: /electron-to-chromium@1.4.449: resolution: {integrity: sha512-TxLRpRUj/107ATefeP8VIUWNOv90xJxZZbCW/eIbSZQiuiFANCx2b7u+GbVc9X4gU+xnbvypNMYVM/WArE1DNQ==} + /electron-to-chromium@1.4.477: + resolution: {integrity: sha512-shUVy6Eawp33dFBFIoYbIwLHrX0IZ857AlH9ug2o4rvbWmpaCUdBpQ5Zw39HRrfzAFm4APJE9V+E2A/WB0YqJw==} + dev: true + /elliptic@6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} dependencies: @@ -11483,8 +11530,8 @@ packages: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - /emittery@0.10.2: - resolution: {integrity: sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==} + /emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} dev: true @@ -12445,15 +12492,16 @@ packages: homedir-polyfill: 1.0.3 dev: true - /expect@28.1.3: - resolution: {integrity: sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /expect@29.6.2: + resolution: {integrity: sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/expect-utils': 28.1.3 - jest-get-type: 28.0.2 - jest-matcher-utils: 28.1.3 - jest-message-util: 28.1.3 - jest-util: 28.1.3 + '@jest/expect-utils': 29.6.2 + '@types/node': 14.0.13 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.6.2 + jest-message-util: 29.6.2 + jest-util: 29.6.2 dev: true /express@4.18.2: @@ -12787,6 +12835,14 @@ packages: signal-exit: 3.0.7 dev: true + /foreground-child@3.1.1: + resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} + engines: {node: '>=14'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 4.0.2 + dev: true + /fork-ts-checker-webpack-plugin@7.3.0(typescript@5.1.6)(webpack@5.88.1): resolution: {integrity: sha512-IN+XTzusCjR5VgntYFgxbxVx3WraPRnKehBFrf00cMSrtUuW9MsG9dhL6MWpY6MkjC3wVwoujfCDgZZCQwbswA==} engines: {node: '>=12.13.0', yarn: '>=1.0.0'} @@ -13037,6 +13093,18 @@ packages: /glob-to-regexp@0.4.1: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} + /glob@10.3.3: + resolution: {integrity: sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + dependencies: + foreground-child: 3.1.1 + jackspeak: 2.2.1 + minimatch: 9.0.3 + minipass: 5.0.0 + path-scurry: 1.10.1 + dev: true + /glob@7.1.7: resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} dependencies: @@ -13188,14 +13256,14 @@ packages: - encoding dev: false - /graphql-request@6.1.0(graphql@15.8.0): + /graphql-request@6.1.0(graphql@16.7.1): resolution: {integrity: sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw==} peerDependencies: graphql: 14 - 16 dependencies: - '@graphql-typed-document-node/core': 3.2.0(graphql@15.8.0) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.7.1) cross-fetch: 3.1.6 - graphql: 15.8.0 + graphql: 16.7.1 transitivePeerDependencies: - encoding dev: false @@ -13205,6 +13273,11 @@ packages: engines: {node: '>= 10.x'} dev: false + /graphql@16.7.1: + resolution: {integrity: sha512-DRYR9tf+UGU0KOsMcKAlXeFfX89UiiIZ0dRU3mR0yJfu6OjZqUcp68NnFLnqQU5RexygFoDy1EW+ccOYcPfmHg==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + dev: false + /gunzip-maybe@1.4.2: resolution: {integrity: sha512-4haO1M4mLO91PW57BMsDFf75UmwoRX0GkdD+Faw+Lr+r/OZrOCS0pIBwOL1xCKQqnQzbNFGgK2V2CpBUPeFNTw==} hasBin: true @@ -13931,11 +14004,6 @@ packages: ws: 8.13.0(bufferutil@4.0.7)(utf-8-validate@5.0.10) dev: false - /istanbul-lib-coverage@3.0.0: - resolution: {integrity: sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==} - engines: {node: '>=8'} - dev: true - /istanbul-lib-coverage@3.2.0: resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} engines: {node: '>=8'} @@ -13958,7 +14026,7 @@ packages: resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} engines: {node: '>=8'} dependencies: - istanbul-lib-coverage: 3.0.0 + istanbul-lib-coverage: 3.2.0 make-dir: 3.1.0 supports-color: 7.2.0 dev: true @@ -13968,7 +14036,7 @@ packages: engines: {node: '>=10'} dependencies: debug: 4.3.4(supports-color@5.5.0) - istanbul-lib-coverage: 3.0.0 + istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: - supports-color @@ -13982,6 +14050,15 @@ packages: istanbul-lib-report: 3.0.0 dev: true + /jackspeak@2.2.1: + resolution: {integrity: sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==} + engines: {node: '>=14'} + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + dev: true + /jake@10.8.7: resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} engines: {node: '>=10'} @@ -14015,44 +14092,46 @@ packages: - utf-8-validate dev: false - /jest-changed-files@28.1.3: - resolution: {integrity: sha512-esaOfUWJXk2nfZt9SPyC8gA1kNfdKLkQWyzsMlqq8msYSlNKfmZxfRgZn4Cd4MGVUF+7v6dBs0d5TOAKa7iIiA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-changed-files@29.5.0: + resolution: {integrity: sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: execa: 5.1.1 p-limit: 3.1.0 dev: true - /jest-circus@28.1.3: - resolution: {integrity: sha512-cZ+eS5zc79MBwt+IhQhiEp0OeBddpc1n8MBo1nMB8A7oPMKEO+Sre+wHaLJexQUj9Ya/8NOBY0RESUgYjB6fow==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-circus@29.6.2: + resolution: {integrity: sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 28.1.3 - '@jest/expect': 28.1.3 - '@jest/test-result': 28.1.3 - '@jest/types': 28.1.3 + '@jest/environment': 29.6.2 + '@jest/expect': 29.6.2 + '@jest/test-result': 29.6.2 + '@jest/types': 29.6.1 '@types/node': 14.0.13 chalk: 4.1.2 co: 4.6.0 - dedent: 0.7.0 + dedent: 1.5.1 is-generator-fn: 2.1.0 - jest-each: 28.1.3 - jest-matcher-utils: 28.1.3 - jest-message-util: 28.1.3 - jest-runtime: 28.1.3 - jest-snapshot: 28.1.3 - jest-util: 28.1.3 + jest-each: 29.6.2 + jest-matcher-utils: 29.6.2 + jest-message-util: 29.6.2 + jest-runtime: 29.6.2 + jest-snapshot: 29.6.2 + jest-util: 29.6.2 p-limit: 3.1.0 - pretty-format: 28.1.3 + pretty-format: 29.6.2 + pure-rand: 6.0.2 slash: 3.0.0 stack-utils: 2.0.6 transitivePeerDependencies: + - babel-plugin-macros - supports-color dev: true - /jest-cli@28.1.3(@types/node@14.0.13): - resolution: {integrity: sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-cli@29.6.2(@types/node@14.0.13): + resolution: {integrity: sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -14060,27 +14139,28 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 28.1.3 - '@jest/test-result': 28.1.3 - '@jest/types': 28.1.3 + '@jest/core': 29.6.2 + '@jest/test-result': 29.6.2 + '@jest/types': 29.6.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 28.1.3(@types/node@14.0.13) - jest-util: 28.1.3 - jest-validate: 28.1.3 + jest-config: 29.6.2(@types/node@14.0.13) + jest-util: 29.6.2 + jest-validate: 29.6.2 prompts: 2.4.2 yargs: 17.7.2 transitivePeerDependencies: - '@types/node' + - babel-plugin-macros - supports-color - ts-node dev: true - /jest-config@28.1.3(@types/node@14.0.13): - resolution: {integrity: sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-config@29.6.2(@types/node@14.0.13): + resolution: {integrity: sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@types/node': '*' ts-node: '>=9.0.0' @@ -14091,230 +14171,163 @@ packages: optional: true dependencies: '@babel/core': 7.22.9 - '@jest/test-sequencer': 28.1.3 - '@jest/types': 28.1.3 + '@jest/test-sequencer': 29.6.2 + '@jest/types': 29.6.1 '@types/node': 14.0.13 - babel-jest: 28.1.3(@babel/core@7.22.9) - chalk: 4.1.2 - ci-info: 3.8.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 28.1.3 - jest-environment-node: 28.1.3 - jest-get-type: 28.0.2 - jest-regex-util: 28.0.2 - jest-resolve: 28.1.3 - jest-runner: 28.1.3 - jest-util: 28.1.3 - jest-validate: 28.1.3 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 28.1.3 - slash: 3.0.0 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-config@28.1.3(@types/node@17.0.45): - resolution: {integrity: sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - dependencies: - '@babel/core': 7.22.9 - '@jest/test-sequencer': 28.1.3 - '@jest/types': 28.1.3 - '@types/node': 17.0.45 - babel-jest: 28.1.3(@babel/core@7.22.9) + babel-jest: 29.6.2(@babel/core@7.22.9) chalk: 4.1.2 ci-info: 3.8.0 deepmerge: 4.3.1 glob: 7.2.3 graceful-fs: 4.2.11 - jest-circus: 28.1.3 - jest-environment-node: 28.1.3 - jest-get-type: 28.0.2 - jest-regex-util: 28.0.2 - jest-resolve: 28.1.3 - jest-runner: 28.1.3 - jest-util: 28.1.3 - jest-validate: 28.1.3 + jest-circus: 29.6.2 + jest-environment-node: 29.6.2 + jest-get-type: 29.4.3 + jest-regex-util: 29.4.3 + jest-resolve: 29.6.2 + jest-runner: 29.6.2 + jest-util: 29.6.2 + jest-validate: 29.6.2 micromatch: 4.0.5 parse-json: 5.2.0 - pretty-format: 28.1.3 + pretty-format: 29.6.2 slash: 3.0.0 strip-json-comments: 3.1.1 transitivePeerDependencies: + - babel-plugin-macros - supports-color dev: true - /jest-diff@27.5.1: - resolution: {integrity: sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - dependencies: - chalk: 4.1.2 - diff-sequences: 27.5.1 - jest-get-type: 27.5.1 - pretty-format: 27.5.1 - dev: true - - /jest-diff@28.1.3: - resolution: {integrity: sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-diff@29.6.2: + resolution: {integrity: sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - diff-sequences: 28.1.1 - jest-get-type: 28.0.2 - pretty-format: 28.1.3 + diff-sequences: 29.4.3 + jest-get-type: 29.4.3 + pretty-format: 29.6.2 dev: true - /jest-docblock@28.1.1: - resolution: {integrity: sha512-3wayBVNiOYx0cwAbl9rwm5kKFP8yHH3d/fkEaL02NPTkDojPtheGB7HZSFY4wzX+DxyrvhXz0KSCVksmCknCuA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-docblock@29.4.3: + resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: detect-newline: 3.1.0 dev: true - /jest-each@28.1.3: - resolution: {integrity: sha512-arT1z4sg2yABU5uogObVPvSlSMQlDA48owx07BDPAiasW0yYpYHYOo4HHLz9q0BVzDVU4hILFjzJw0So9aCL/g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-each@29.6.2: + resolution: {integrity: sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 28.1.3 + '@jest/types': 29.6.1 chalk: 4.1.2 - jest-get-type: 28.0.2 - jest-util: 28.1.3 - pretty-format: 28.1.3 + jest-get-type: 29.4.3 + jest-util: 29.6.2 + pretty-format: 29.6.2 dev: true - /jest-environment-jsdom@28.1.0: - resolution: {integrity: sha512-8n6P4xiDjNVqTWv6W6vJPuQdLx+ZiA3dbYg7YJ+DPzR+9B61K6pMVJrSs2IxfGRG4J7pyAUA5shQ9G0KEun78w==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-environment-jsdom@29.6.2: + resolution: {integrity: sha512-7oa/+266AAEgkzae8i1awNEfTfjwawWKLpiw2XesZmaoVVj9u9t8JOYx18cG29rbPNtkUlZ8V4b5Jb36y/VxoQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true dependencies: - '@jest/environment': 28.1.3 - '@jest/fake-timers': 28.1.3 - '@jest/types': 28.1.3 - '@types/jsdom': 16.2.15 - '@types/node': 16.18.38 - jest-mock: 28.1.3 - jest-util: 28.1.3 - jsdom: 19.0.0 + '@jest/environment': 29.6.2 + '@jest/fake-timers': 29.6.2 + '@jest/types': 29.6.1 + '@types/jsdom': 20.0.1 + '@types/node': 14.0.13 + jest-mock: 29.6.2 + jest-util: 29.6.2 + jsdom: 20.0.3 transitivePeerDependencies: - bufferutil - - canvas - supports-color - utf-8-validate dev: true - /jest-environment-node@28.1.3: - resolution: {integrity: sha512-ugP6XOhEpjAEhGYvp5Xj989ns5cB1K6ZdjBYuS30umT4CQEETaxSiPcZ/E1kFktX4GkrcM4qu07IIlDYX1gp+A==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-environment-node@29.6.2: + resolution: {integrity: sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 28.1.3 - '@jest/fake-timers': 28.1.3 - '@jest/types': 28.1.3 + '@jest/environment': 29.6.2 + '@jest/fake-timers': 29.6.2 + '@jest/types': 29.6.1 '@types/node': 14.0.13 - jest-mock: 28.1.3 - jest-util: 28.1.3 + jest-mock: 29.6.2 + jest-util: 29.6.2 dev: true - /jest-get-type@27.5.1: - resolution: {integrity: sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - dev: true - - /jest-get-type@28.0.2: - resolution: {integrity: sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - dev: true - - /jest-haste-map@28.1.3: - resolution: {integrity: sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - dependencies: - '@jest/types': 28.1.3 - '@types/graceful-fs': 4.1.6 - '@types/node': 18.15.13 - anymatch: 3.1.3 - fb-watchman: 2.0.2 - graceful-fs: 4.2.11 - jest-regex-util: 28.0.2 - jest-util: 28.1.3 - jest-worker: 28.1.3 - micromatch: 4.0.5 - walker: 1.0.8 - optionalDependencies: - fsevents: 2.3.2 + /jest-get-type@29.4.3: + resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-haste-map@29.5.0: - resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==} + /jest-haste-map@29.6.2: + resolution: {integrity: sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 + '@jest/types': 29.6.1 '@types/graceful-fs': 4.1.6 '@types/node': 14.0.13 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 jest-regex-util: 29.4.3 - jest-util: 29.5.0 - jest-worker: 29.5.0 + jest-util: 29.6.2 + jest-worker: 29.6.2 micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: fsevents: 2.3.2 dev: true - /jest-leak-detector@28.1.3: - resolution: {integrity: sha512-WFVJhnQsiKtDEo5lG2mM0v40QWnBM+zMdHHyJs8AWZ7J0QZJS59MsyKeJHWhpBZBH32S48FOVvGyOFT1h0DlqA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-leak-detector@29.6.2: + resolution: {integrity: sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 28.0.2 - pretty-format: 28.1.3 + jest-get-type: 29.4.3 + pretty-format: 29.6.2 dev: true - /jest-matcher-utils@28.1.3: - resolution: {integrity: sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-matcher-utils@29.6.2: + resolution: {integrity: sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - jest-diff: 28.1.3 - jest-get-type: 28.0.2 - pretty-format: 28.1.3 + jest-diff: 29.6.2 + jest-get-type: 29.4.3 + pretty-format: 29.6.2 dev: true - /jest-message-util@28.1.3: - resolution: {integrity: sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-message-util@29.6.2: + resolution: {integrity: sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.22.5 - '@jest/types': 28.1.3 + '@jest/types': 29.6.1 '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.11 micromatch: 4.0.5 - pretty-format: 28.1.3 + pretty-format: 29.6.2 slash: 3.0.0 stack-utils: 2.0.6 dev: true - /jest-mock@28.1.3: - resolution: {integrity: sha512-o3J2jr6dMMWYVH4Lh/NKmDXdosrsJgi4AviS8oXLujcjpCMBb1FMsblDnOXKZKfSiHLxYub1eS0IHuRXsio9eA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-mock@29.6.2: + resolution: {integrity: sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 28.1.3 - '@types/node': 18.15.13 + '@jest/types': 29.6.1 + '@types/node': 14.0.13 + jest-util: 29.6.2 dev: true - /jest-pnp-resolver@1.2.3(jest-resolve@28.1.3): + /jest-pnp-resolver@1.2.3(jest-resolve@29.6.2): resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} peerDependencies: @@ -14323,7 +14336,7 @@ packages: jest-resolve: optional: true dependencies: - jest-resolve: 28.1.3 + jest-resolve: 29.6.2 dev: true /jest-preview@0.3.1(postcss@8.4.27): @@ -14354,158 +14367,138 @@ packages: - utf-8-validate dev: true - /jest-regex-util@28.0.2: - resolution: {integrity: sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - dev: true - /jest-regex-util@29.4.3: resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-resolve-dependencies@28.1.3: - resolution: {integrity: sha512-qa0QO2Q0XzQoNPouMbCc7Bvtsem8eQgVPNkwn9LnS+R2n8DaVDPL/U1gngC0LTl1RYXJU0uJa2BMC2DbTfFrHA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-resolve-dependencies@29.6.2: + resolution: {integrity: sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-regex-util: 28.0.2 - jest-snapshot: 28.1.3 + jest-regex-util: 29.4.3 + jest-snapshot: 29.6.2 transitivePeerDependencies: - supports-color dev: true - /jest-resolve@28.1.3: - resolution: {integrity: sha512-Z1W3tTjE6QaNI90qo/BJpfnvpxtaFTFw5CDgwpyE/Kz8U/06N1Hjf4ia9quUhCh39qIGWF1ZuxFiBiJQwSEYKQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-resolve@29.6.2: + resolution: {integrity: sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 graceful-fs: 4.2.11 - jest-haste-map: 28.1.3 - jest-pnp-resolver: 1.2.3(jest-resolve@28.1.3) - jest-util: 28.1.3 - jest-validate: 28.1.3 + jest-haste-map: 29.6.2 + jest-pnp-resolver: 1.2.3(jest-resolve@29.6.2) + jest-util: 29.6.2 + jest-validate: 29.6.2 resolve: 1.22.2 - resolve.exports: 1.1.1 + resolve.exports: 2.0.2 slash: 3.0.0 dev: true - /jest-runner@28.1.3: - resolution: {integrity: sha512-GkMw4D/0USd62OVO0oEgjn23TM+YJa2U2Wu5zz9xsQB1MxWKDOlrnykPxnMsN0tnJllfLPinHTka61u0QhaxBA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-runner@29.6.2: + resolution: {integrity: sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 28.1.3 - '@jest/environment': 28.1.3 - '@jest/test-result': 28.1.3 - '@jest/transform': 28.1.3 - '@jest/types': 28.1.3 - '@types/node': 18.15.13 + '@jest/console': 29.6.2 + '@jest/environment': 29.6.2 + '@jest/test-result': 29.6.2 + '@jest/transform': 29.6.2 + '@jest/types': 29.6.1 + '@types/node': 14.0.13 chalk: 4.1.2 - emittery: 0.10.2 + emittery: 0.13.1 graceful-fs: 4.2.11 - jest-docblock: 28.1.1 - jest-environment-node: 28.1.3 - jest-haste-map: 28.1.3 - jest-leak-detector: 28.1.3 - jest-message-util: 28.1.3 - jest-resolve: 28.1.3 - jest-runtime: 28.1.3 - jest-util: 28.1.3 - jest-watcher: 28.1.3 - jest-worker: 28.1.3 + jest-docblock: 29.4.3 + jest-environment-node: 29.6.2 + jest-haste-map: 29.6.2 + jest-leak-detector: 29.6.2 + jest-message-util: 29.6.2 + jest-resolve: 29.6.2 + jest-runtime: 29.6.2 + jest-util: 29.6.2 + jest-watcher: 29.6.2 + jest-worker: 29.6.2 p-limit: 3.1.0 source-map-support: 0.5.13 transitivePeerDependencies: - supports-color dev: true - /jest-runtime@28.1.3: - resolution: {integrity: sha512-NU+881ScBQQLc1JHG5eJGU7Ui3kLKrmwCPPtYsJtBykixrM2OhVQlpMmFWJjMyDfdkGgBMNjXCGB/ebzsgNGQw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-runtime@29.6.2: + resolution: {integrity: sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 28.1.3 - '@jest/fake-timers': 28.1.3 - '@jest/globals': 28.1.3 - '@jest/source-map': 28.1.2 - '@jest/test-result': 28.1.3 - '@jest/transform': 28.1.3 - '@jest/types': 28.1.3 + '@jest/environment': 29.6.2 + '@jest/fake-timers': 29.6.2 + '@jest/globals': 29.6.2 + '@jest/source-map': 29.6.0 + '@jest/test-result': 29.6.2 + '@jest/transform': 29.6.2 + '@jest/types': 29.6.1 + '@types/node': 14.0.13 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.1 - execa: 5.1.1 glob: 7.2.3 graceful-fs: 4.2.11 - jest-haste-map: 28.1.3 - jest-message-util: 28.1.3 - jest-mock: 28.1.3 - jest-regex-util: 28.0.2 - jest-resolve: 28.1.3 - jest-snapshot: 28.1.3 - jest-util: 28.1.3 + jest-haste-map: 29.6.2 + jest-message-util: 29.6.2 + jest-mock: 29.6.2 + jest-regex-util: 29.4.3 + jest-resolve: 29.6.2 + jest-snapshot: 29.6.2 + jest-util: 29.6.2 slash: 3.0.0 strip-bom: 4.0.0 transitivePeerDependencies: - supports-color dev: true - /jest-snapshot@28.1.3: - resolution: {integrity: sha512-4lzMgtiNlc3DU/8lZfmqxN3AYD6GGLbl+72rdBpXvcV+whX7mDrREzkPdp2RnmfIiWBg1YbuFSkXduF2JcafJg==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-snapshot@29.6.2: + resolution: {integrity: sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.22.9 - '@babel/generator': 7.22.5 + '@babel/generator': 7.22.9 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.9) '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.9) - '@babel/traverse': 7.22.5(supports-color@5.5.0) '@babel/types': 7.22.5 - '@jest/expect-utils': 28.1.3 - '@jest/transform': 28.1.3 - '@jest/types': 28.1.3 - '@types/babel__traverse': 7.20.1 - '@types/prettier': 2.7.3 + '@jest/expect-utils': 29.6.2 + '@jest/transform': 29.6.2 + '@jest/types': 29.6.1 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.9) chalk: 4.1.2 - expect: 28.1.3 + expect: 29.6.2 graceful-fs: 4.2.11 - jest-diff: 28.1.3 - jest-get-type: 28.0.2 - jest-haste-map: 28.1.3 - jest-matcher-utils: 28.1.3 - jest-message-util: 28.1.3 - jest-util: 28.1.3 + jest-diff: 29.6.2 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.6.2 + jest-message-util: 29.6.2 + jest-util: 29.6.2 natural-compare: 1.4.0 - pretty-format: 28.1.3 + pretty-format: 29.6.2 semver: 7.5.4 transitivePeerDependencies: - supports-color dev: true - /jest-transformer-svg@2.0.1(jest@28.1.0)(react@18.2.0): + /jest-transformer-svg@2.0.1(jest@29.6.2)(react@18.2.0): resolution: {integrity: sha512-L3j70WjfQtAYXjZi/vyKW8A5pcEUnv7mR0cugSyP6Kqee+fjsMzUHs5UPbnLKH+y7lfSpOjXijMbfEcjLqCuaw==} peerDependencies: jest: '>= 28.1.0' react: ^17.0.0 || ^18.0.0 dependencies: - jest: 28.1.0(@types/node@14.0.13) + jest: 29.6.2(@types/node@14.0.13) react: 18.2.0 dev: true - /jest-util@28.1.3: - resolution: {integrity: sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - dependencies: - '@jest/types': 28.1.3 - '@types/node': 18.15.13 - chalk: 4.1.2 - ci-info: 3.8.0 - graceful-fs: 4.2.11 - picomatch: 2.3.1 - dev: true - - /jest-util@29.5.0: - resolution: {integrity: sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==} + /jest-util@29.6.2: + resolution: {integrity: sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 + '@jest/types': 29.6.1 '@types/node': 14.0.13 chalk: 4.1.2 ci-info: 3.8.0 @@ -14513,29 +14506,29 @@ packages: picomatch: 2.3.1 dev: true - /jest-validate@28.1.3: - resolution: {integrity: sha512-SZbOGBWEsaTxBGCOpsRWlXlvNkvTkY0XxRfh7zYmvd8uL5Qzyg0CHAXiXKROflh801quA6+/DsT4ODDthOC/OA==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-validate@29.6.2: + resolution: {integrity: sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 28.1.3 + '@jest/types': 29.6.1 camelcase: 6.3.0 chalk: 4.1.2 - jest-get-type: 28.0.2 + jest-get-type: 29.4.3 leven: 3.1.0 - pretty-format: 28.1.3 + pretty-format: 29.6.2 dev: true - /jest-watcher@28.1.3: - resolution: {integrity: sha512-t4qcqj9hze+jviFPUN3YAtAEeFnr/azITXQEMARf5cMwKY2SMBRnCQTXLixTl20OR6mLh9KLMrgVJgJISym+1g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest-watcher@29.6.2: + resolution: {integrity: sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 28.1.3 - '@jest/types': 28.1.3 - '@types/node': 18.15.13 + '@jest/test-result': 29.6.2 + '@jest/types': 29.6.1 + '@types/node': 14.0.13 ansi-escapes: 4.3.2 chalk: 4.1.2 - emittery: 0.10.2 - jest-util: 28.1.3 + emittery: 0.13.1 + jest-util: 29.6.2 string-length: 4.0.2 dev: true @@ -14548,28 +14541,19 @@ packages: supports-color: 8.1.1 dev: true - /jest-worker@28.1.3: - resolution: {integrity: sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - dependencies: - '@types/node': 14.0.13 - merge-stream: 2.0.0 - supports-color: 8.1.1 - dev: true - - /jest-worker@29.5.0: - resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} + /jest-worker@29.6.2: + resolution: {integrity: sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@types/node': 14.0.13 - jest-util: 29.5.0 + jest-util: 29.6.2 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@28.1.0(@types/node@14.0.13): - resolution: {integrity: sha512-TZR+tHxopPhzw3c3560IJXZWLNHgpcz1Zh0w5A65vynLGNcg/5pZ+VildAd7+XGOu6jd58XMY/HNn0IkZIXVXg==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /jest@29.6.2(@types/node@14.0.13): + resolution: {integrity: sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -14577,11 +14561,13 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 28.1.3 + '@jest/core': 29.6.2 + '@jest/types': 29.6.1 import-local: 3.1.0 - jest-cli: 28.1.3(@types/node@14.0.13) + jest-cli: 29.6.2(@types/node@14.0.13) transitivePeerDependencies: - '@types/node' + - babel-plugin-macros - supports-color - ts-node dev: true @@ -14675,9 +14661,9 @@ packages: - supports-color dev: true - /jsdom@19.0.0: - resolution: {integrity: sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A==} - engines: {node: '>=12'} + /jsdom@20.0.3: + resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} + engines: {node: '>=14'} peerDependencies: canvas: ^2.5.0 peerDependenciesMeta: @@ -14685,8 +14671,8 @@ packages: optional: true dependencies: abab: 2.0.6 - acorn: 8.9.0 - acorn-globals: 6.0.0 + acorn: 8.10.0 + acorn-globals: 7.0.1 cssom: 0.5.0 cssstyle: 2.3.0 data-urls: 3.0.2 @@ -14699,16 +14685,15 @@ packages: https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 nwsapi: 2.2.6 - parse5: 6.0.1 - saxes: 5.0.1 + parse5: 7.1.2 + saxes: 6.0.0 symbol-tree: 3.2.4 tough-cookie: 4.1.3 - w3c-hr-time: 1.0.2 - w3c-xmlserializer: 3.0.0 + w3c-xmlserializer: 4.0.0 webidl-conversions: 7.0.0 whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 - whatwg-url: 10.0.0 + whatwg-url: 11.0.0 ws: 8.13.0(bufferutil@4.0.7)(utf-8-validate@5.0.10) xml-name-validator: 4.0.0 transitivePeerDependencies: @@ -14825,6 +14810,10 @@ packages: engines: {node: '>=6'} hasBin: true + /jsonc-parser@3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + dev: true + /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -15166,6 +15155,11 @@ packages: engines: {node: '>=8'} dev: true + /lru-cache@10.0.0: + resolution: {integrity: sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==} + engines: {node: 14 || >=16.14} + dev: true + /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: @@ -15177,6 +15171,10 @@ packages: dependencies: yallist: 4.0.0 + /lunr@2.3.9: + resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} + dev: true + /lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true @@ -15216,6 +15214,12 @@ packages: react: 18.2.0 dev: true + /marked@4.3.0: + resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} + engines: {node: '>= 12'} + hasBin: true + dev: true + /match-sorter@6.3.1: resolution: {integrity: sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw==} dependencies: @@ -15374,6 +15378,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -15501,7 +15512,7 @@ packages: trouter: 3.2.1 dev: false - /next-router-mock@0.9.7(next@13.4.8)(react@18.2.0): + /next-router-mock@0.9.7(next@13.4.12)(react@18.2.0): resolution: {integrity: sha512-y5ioLCIsdkJKwcoPnrUyocNEJT22RK4wKSg6LO0Q2XkBBvkYprEWy5FiCZt+CA8+qpfxpBlNca76F+glEohbRA==} peerDependencies: next: '>=10.0.0' @@ -15616,7 +15627,7 @@ packages: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true - /node-polyfill-webpack-plugin@2.0.1(webpack@5.88.1): + /node-polyfill-webpack-plugin@2.0.1(webpack@5.88.2): resolution: {integrity: sha512-ZUMiCnZkP1LF0Th2caY6J/eKKoA0TefpoVa68m/LQU1I/mE8rGt4fNYGgNuCcK+aG8P8P43nbeJ2RqJMOL/Y1A==} engines: {node: '>=12'} peerDependencies: @@ -15647,12 +15658,16 @@ packages: url: 0.11.1 util: 0.12.5 vm-browserify: 1.1.2 - webpack: 5.88.1(esbuild@0.17.19) + webpack: 5.88.2(esbuild@0.17.19) dev: true /node-releases@2.0.12: resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} + /node-releases@2.0.13: + resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} + dev: true + /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -15977,15 +15992,10 @@ packages: engines: {node: '>=0.10.0'} dev: true - /parse5@6.0.1: - resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} - dev: true - /parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} dependencies: entities: 4.5.0 - dev: false /parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} @@ -16027,6 +16037,14 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + /path-scurry@1.10.1: + resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + lru-cache: 10.0.0 + minipass: 5.0.0 + dev: true + /path-to-regexp@0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} dev: true @@ -16220,7 +16238,7 @@ packages: yaml: 2.3.1 dev: true - /postcss-loader@7.3.3(postcss@8.4.27)(webpack@5.88.1): + /postcss-loader@7.3.3(postcss@8.4.27)(webpack@5.88.2): resolution: {integrity: sha512-YgO/yhtevGO/vJePCQmTxiaEwER94LABZN0ZMT4A0vsak9TpO+RvKRs7EmJ8peIlB9xfXCsS7M8LjqncsUZ5HA==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -16231,7 +16249,7 @@ packages: jiti: 1.18.2 postcss: 8.4.27 semver: 7.5.4 - webpack: 5.88.1(esbuild@0.17.19) + webpack: 5.88.2(esbuild@0.17.19) dev: true /postcss-modules-extract-imports@3.0.0(postcss@8.4.27): @@ -16349,12 +16367,11 @@ packages: react-is: 17.0.2 dev: true - /pretty-format@28.1.3: - resolution: {integrity: sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + /pretty-format@29.6.2: + resolution: {integrity: sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 28.1.3 - ansi-regex: 5.0.1 + '@jest/schemas': 29.6.0 ansi-styles: 5.2.0 react-is: 18.2.0 dev: true @@ -16480,6 +16497,10 @@ packages: - utf-8-validate dev: true + /pure-rand@6.0.2: + resolution: {integrity: sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==} + dev: true + /qrcode@1.5.0: resolution: {integrity: sha512-9MgRpgVc+/+47dFvQeD6U2s0Z92EsKzcHogtum4QB+UNd025WOJSHvn/hjk9xmzj7Stj95CyUAs31mrjxliEsQ==} engines: {node: '>=10.13.0'} @@ -17410,8 +17431,8 @@ packages: source-map: 0.6.1 dev: true - /resolve.exports@1.1.1: - resolution: {integrity: sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ==} + /resolve.exports@2.0.2: + resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} dev: true @@ -17473,6 +17494,14 @@ packages: dependencies: glob: 7.2.3 + /rimraf@5.0.1: + resolution: {integrity: sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg==} + engines: {node: '>=14'} + hasBin: true + dependencies: + glob: 10.3.3 + dev: true + /ripemd160@2.0.2: resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} dependencies: @@ -17555,7 +17584,7 @@ packages: /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - /sass-loader@12.6.0(webpack@5.88.1): + /sass-loader@12.6.0(webpack@5.88.2): resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==} engines: {node: '>= 12.13.0'} peerDependencies: @@ -17576,14 +17605,7 @@ packages: dependencies: klona: 2.0.6 neo-async: 2.6.2 - webpack: 5.88.1(esbuild@0.17.19) - dev: true - - /saxes@5.0.1: - resolution: {integrity: sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==} - engines: {node: '>=10'} - dependencies: - xmlchars: 2.2.0 + webpack: 5.88.2(esbuild@0.17.19) dev: true /saxes@6.0.0: @@ -17591,7 +17613,6 @@ packages: engines: {node: '>=v12.22.7'} dependencies: xmlchars: 2.2.0 - dev: false /scheduler@0.20.2: resolution: {integrity: sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==} @@ -17775,6 +17796,15 @@ packages: rechoir: 0.6.2 dev: true + /shiki@0.14.3: + resolution: {integrity: sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==} + dependencies: + ansi-sequence-parser: 1.1.0 + jsonc-parser: 3.2.0 + vscode-oniguruma: 1.7.0 + vscode-textmate: 8.0.0 + dev: true + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -17785,6 +17815,11 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + /signal-exit@4.0.2: + resolution: {integrity: sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==} + engines: {node: '>=14'} + dev: true + /simple-update-notifier@1.1.0: resolution: {integrity: sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==} engines: {node: '>=8.10.0'} @@ -18153,6 +18188,15 @@ packages: webpack: 5.88.1(esbuild@0.17.19) dev: true + /style-loader@3.3.3(webpack@5.88.2): + resolution: {integrity: sha512-53BiGLXAcll9maCYtZi2RCQZKa8NQQai5C4horqKyRmHj9H7QmcUyucrH+4KW/gBQbXM2AsB0axoEcFZPlfPcw==} + engines: {node: '>= 12.13.0'} + peerDependencies: + webpack: ^5.0.0 + dependencies: + webpack: 5.88.2(esbuild@0.17.19) + dev: true + /styled-components@5.3.11(@babel/core@7.22.9)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0): resolution: {integrity: sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==} engines: {node: '>=10'} @@ -18235,14 +18279,6 @@ packages: has-flag: 4.0.0 dev: true - /supports-hyperlinks@2.3.0: - resolution: {integrity: sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==} - engines: {node: '>=8'} - dependencies: - has-flag: 4.0.0 - supports-color: 7.2.0 - dev: true - /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -18362,15 +18398,32 @@ packages: unique-string: 2.0.0 dev: true - /terminal-link@2.1.1: - resolution: {integrity: sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==} - engines: {node: '>=8'} + /terser-webpack-plugin@5.3.9(esbuild@0.17.19)(webpack@5.88.1): + resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true dependencies: - ansi-escapes: 4.3.2 - supports-hyperlinks: 2.3.0 + '@jridgewell/trace-mapping': 0.3.18 + esbuild: 0.17.19 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.1 + terser: 5.18.2 + webpack: 5.88.1(esbuild@0.17.19) dev: true - /terser-webpack-plugin@5.3.9(esbuild@0.17.19)(webpack@5.88.1): + /terser-webpack-plugin@5.3.9(esbuild@0.17.19)(webpack@5.88.2): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -18392,7 +18445,7 @@ packages: schema-utils: 3.3.0 serialize-javascript: 6.0.1 terser: 5.18.2 - webpack: 5.88.1(esbuild@0.17.19) + webpack: 5.88.2(esbuild@0.17.19) dev: true /terser@5.18.2: @@ -18401,7 +18454,7 @@ packages: hasBin: true dependencies: '@jridgewell/source-map': 0.3.5 - acorn: 8.9.0 + acorn: 8.10.0 commander: 2.20.3 source-map-support: 0.5.21 dev: true @@ -18742,6 +18795,29 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true + /typedoc-plugin-markdown@3.15.3(typedoc@0.24.8): + resolution: {integrity: sha512-idntFYu3vfaY3eaD+w9DeRd0PmNGqGuNLKihPU9poxFGnATJYGn9dPtEhn2QrTdishFMg7jPXAhos+2T6YCWRQ==} + peerDependencies: + typedoc: '>=0.24.0' + dependencies: + handlebars: 4.7.7 + typedoc: 0.24.8(typescript@5.1.3) + dev: true + + /typedoc@0.24.8(typescript@5.1.3): + resolution: {integrity: sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==} + engines: {node: '>= 14.14'} + hasBin: true + peerDependencies: + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x + dependencies: + lunr: 2.3.9 + marked: 4.3.0 + minimatch: 9.0.3 + shiki: 0.14.3 + typescript: 5.1.3 + dev: true + /typescript@5.1.3: resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} engines: {node: '>=14.17'} @@ -18867,7 +18943,7 @@ packages: /unplugin@0.10.2: resolution: {integrity: sha512-6rk7GUa4ICYjae5PrAllvcDeuT8pA9+j5J5EkxbMFaV+SalHhxZ7X2dohMzu6C3XzsMT+6jwR/+pwPNR3uK9MA==} dependencies: - acorn: 8.9.0 + acorn: 8.10.0 chokidar: 3.5.3 webpack-sources: 3.2.3 webpack-virtual-modules: 0.4.6 @@ -18881,6 +18957,17 @@ packages: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} + /update-browserslist-db@1.0.11(browserslist@4.21.10): + resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.10 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: true + /update-browserslist-db@1.0.11(browserslist@4.21.9): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -19090,18 +19177,12 @@ packages: engines: {node: '>=0.10.0'} dev: false - /w3c-hr-time@1.0.2: - resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} - deprecated: Use your platform's native performance.now() and performance.timeOrigin. - dependencies: - browser-process-hrtime: 1.0.0 + /vscode-oniguruma@1.7.0: + resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} dev: true - /w3c-xmlserializer@3.0.0: - resolution: {integrity: sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==} - engines: {node: '>=12'} - dependencies: - xml-name-validator: 4.0.0 + /vscode-textmate@8.0.0: + resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} dev: true /w3c-xmlserializer@4.0.0: @@ -19109,7 +19190,6 @@ packages: engines: {node: '>=14'} dependencies: xml-name-validator: 4.0.0 - dev: false /wagmi@0.12.18(ethers@5.7.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6): resolution: {integrity: sha512-Ci0cy1R6NXmwVjRF4ukjBdOor7ZH3SDBSXPZetlkm6mey9RJq5yEHEZYdcPgtLWANqRRzFD5TxXtrmZJkhhs3w==} @@ -19251,8 +19331,8 @@ packages: '@webassemblyjs/ast': 1.11.6 '@webassemblyjs/wasm-edit': 1.11.6 '@webassemblyjs/wasm-parser': 1.11.6 - acorn: 8.9.0 - acorn-import-assertions: 1.9.0(acorn@8.9.0) + acorn: 8.10.0 + acorn-import-assertions: 1.9.0(acorn@8.10.0) browserslist: 4.21.9 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 @@ -19276,6 +19356,46 @@ packages: - uglify-js dev: true + /webpack@5.88.2(esbuild@0.17.19): + resolution: {integrity: sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + dependencies: + '@types/eslint-scope': 3.7.4 + '@types/estree': 1.0.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/wasm-edit': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + acorn: 8.10.0 + acorn-import-assertions: 1.9.0(acorn@8.10.0) + browserslist: 4.21.10 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.15.0 + es-module-lexer: 1.3.0 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.9(esbuild@0.17.19)(webpack@5.88.2) + watchpack: 2.4.0 + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + dev: true + /whatwg-encoding@2.0.0: resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} engines: {node: '>=12'} @@ -19286,14 +19406,6 @@ packages: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} - /whatwg-url@10.0.0: - resolution: {integrity: sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==} - engines: {node: '>=12'} - dependencies: - tr46: 3.0.0 - webidl-conversions: 7.0.0 - dev: true - /whatwg-url@11.0.0: resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} engines: {node: '>=12'} @@ -19405,6 +19517,15 @@ packages: strip-ansi: 6.0.1 dev: true + /wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + dev: true + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}