@drift-labs/common 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Config.d.ts +26 -0
- package/lib/Config.js +29 -0
- package/lib/Config.js.map +1 -0
- package/lib/EnvironmentConstants.d.ts +40 -0
- package/lib/EnvironmentConstants.js +64 -0
- package/lib/EnvironmentConstants.js.map +1 -0
- package/lib/actions/actionHelpers/accountDeletionHelpers.d.ts +16 -0
- package/lib/actions/actionHelpers/accountDeletionHelpers.js +151 -0
- package/lib/actions/actionHelpers/accountDeletionHelpers.js.map +1 -0
- package/lib/actions/actionHelpers/actionHelpers.d.ts +13 -0
- package/lib/actions/actionHelpers/actionHelpers.js +8 -0
- package/lib/actions/actionHelpers/actionHelpers.js.map +1 -0
- package/lib/chartConstants.d.ts +2 -0
- package/lib/chartConstants.js +14 -0
- package/lib/chartConstants.js.map +1 -0
- package/lib/clients/candleClient.d.ts +74 -0
- package/lib/clients/candleClient.js +364 -0
- package/lib/clients/candleClient.js.map +1 -0
- package/lib/clients/dataApiWsClient.d.ts +33 -0
- package/lib/clients/dataApiWsClient.js +118 -0
- package/lib/clients/dataApiWsClient.js.map +1 -0
- package/lib/clients/index.d.ts +1 -0
- package/lib/clients/index.js +19 -0
- package/lib/clients/index.js.map +1 -0
- package/lib/clients/marketDataFeed.d.ts +42 -0
- package/lib/clients/marketDataFeed.js +422 -0
- package/lib/clients/marketDataFeed.js.map +1 -0
- package/lib/clients/redisClient.d.ts +89 -0
- package/lib/clients/redisClient.js +647 -0
- package/lib/clients/redisClient.js.map +1 -0
- package/lib/clients/swiftClient.d.ts +57 -0
- package/lib/clients/swiftClient.js +289 -0
- package/lib/clients/swiftClient.js.map +1 -0
- package/lib/clients/tvFeed.d.ts +63 -0
- package/lib/clients/tvFeed.js +351 -0
- package/lib/clients/tvFeed.js.map +1 -0
- package/lib/common-ui-utils/commonUiUtils.d.ts +211 -0
- package/lib/common-ui-utils/commonUiUtils.js +624 -0
- package/lib/common-ui-utils/commonUiUtils.js.map +1 -0
- package/lib/common-ui-utils/index.d.ts +6 -0
- package/lib/common-ui-utils/index.js +23 -0
- package/lib/common-ui-utils/index.js.map +1 -0
- package/lib/common-ui-utils/market.d.ts +27 -0
- package/lib/common-ui-utils/market.js +80 -0
- package/lib/common-ui-utils/market.js.map +1 -0
- package/lib/common-ui-utils/order.d.ts +11 -0
- package/lib/common-ui-utils/order.js +161 -0
- package/lib/common-ui-utils/order.js.map +1 -0
- package/lib/common-ui-utils/settings/settings.d.ts +51 -0
- package/lib/common-ui-utils/settings/settings.js +84 -0
- package/lib/common-ui-utils/settings/settings.js.map +1 -0
- package/lib/common-ui-utils/trading.d.ts +56 -0
- package/lib/common-ui-utils/trading.js +200 -0
- package/lib/common-ui-utils/trading.js.map +1 -0
- package/lib/common-ui-utils/user.d.ts +13 -0
- package/lib/common-ui-utils/user.js +124 -0
- package/lib/common-ui-utils/user.js.map +1 -0
- package/lib/constants/autogenerated/driftErrors.json +1787 -0
- package/lib/constants/autogenerated/jup-v4-error-codes.json +67 -0
- package/lib/constants/autogenerated/jup-v6-error-codes.json +115 -0
- package/lib/constants/dev.d.ts +15 -0
- package/lib/constants/dev.js +19 -0
- package/lib/constants/dev.js.map +1 -0
- package/lib/constants/geoblockList.d.ts +4 -0
- package/lib/constants/geoblockList.js +32 -0
- package/lib/constants/geoblockList.js.map +1 -0
- package/lib/constants/index.d.ts +9 -0
- package/lib/constants/index.js +26 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/constants/markets.d.ts +1 -0
- package/lib/constants/markets.js +5 -0
- package/lib/constants/markets.js.map +1 -0
- package/lib/constants/misc.d.ts +23 -0
- package/lib/constants/misc.js +27 -0
- package/lib/constants/misc.js.map +1 -0
- package/lib/constants/orders.d.ts +12 -0
- package/lib/constants/orders.js +79 -0
- package/lib/constants/orders.js.map +1 -0
- package/lib/constants/pools.d.ts +5 -0
- package/lib/constants/pools.js +9 -0
- package/lib/constants/pools.js.map +1 -0
- package/lib/constants/predictionMarket.d.ts +3 -0
- package/lib/constants/predictionMarket.js +7 -0
- package/lib/constants/predictionMarket.js.map +1 -0
- package/lib/constants/superstake.d.ts +22 -0
- package/lib/constants/superstake.js +45 -0
- package/lib/constants/superstake.js.map +1 -0
- package/lib/constants/trade.d.ts +2 -0
- package/lib/constants/trade.js +9 -0
- package/lib/constants/trade.js.map +1 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftL2OrderbookManager.d.ts +68 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftL2OrderbookManager.js +146 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftL2OrderbookManager.js.map +1 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/index.d.ts +204 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/index.js +530 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/index.js.map +1 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/types.d.ts +90 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/types.js +3 -0
- package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/types.js.map +1 -0
- package/lib/drift/Drift/clients/AuthorityDrift/SubscriptionManager.d.ts +139 -0
- package/lib/drift/Drift/clients/AuthorityDrift/SubscriptionManager.js +287 -0
- package/lib/drift/Drift/clients/AuthorityDrift/SubscriptionManager.js.map +1 -0
- package/lib/drift/Drift/clients/AuthorityDrift/index.d.ts +242 -0
- package/lib/drift/Drift/clients/AuthorityDrift/index.js +503 -0
- package/lib/drift/Drift/clients/AuthorityDrift/index.js.map +1 -0
- package/lib/drift/Drift/clients/CentralServerDrift.d.ts +91 -0
- package/lib/drift/Drift/clients/CentralServerDrift.js +326 -0
- package/lib/drift/Drift/clients/CentralServerDrift.js.map +1 -0
- package/lib/drift/Drift/clients/index.d.ts +3 -0
- package/lib/drift/Drift/clients/index.js +20 -0
- package/lib/drift/Drift/clients/index.js.map +1 -0
- package/lib/drift/Drift/constants/blockchain.d.ts +24 -0
- package/lib/drift/Drift/constants/blockchain.js +32 -0
- package/lib/drift/Drift/constants/blockchain.js.map +1 -0
- package/lib/drift/Drift/constants/errors.d.ts +6 -0
- package/lib/drift/Drift/constants/errors.js +14 -0
- package/lib/drift/Drift/constants/errors.js.map +1 -0
- package/lib/drift/Drift/constants/index.d.ts +3 -0
- package/lib/drift/Drift/constants/index.js +20 -0
- package/lib/drift/Drift/constants/index.js.map +1 -0
- package/lib/drift/Drift/constants/orderbook.d.ts +7 -0
- package/lib/drift/Drift/constants/orderbook.js +10 -0
- package/lib/drift/Drift/constants/orderbook.js.map +1 -0
- package/lib/drift/Drift/data/PollingDlob.d.ts +154 -0
- package/lib/drift/Drift/data/PollingDlob.js +387 -0
- package/lib/drift/Drift/data/PollingDlob.js.map +1 -0
- package/lib/drift/Drift/data/index.d.ts +1 -0
- package/lib/drift/Drift/data/index.js +18 -0
- package/lib/drift/Drift/data/index.js.map +1 -0
- package/lib/drift/Drift/index.d.ts +4 -0
- package/lib/drift/Drift/index.js +21 -0
- package/lib/drift/Drift/index.js.map +1 -0
- package/lib/drift/Drift/stores/MarkPriceCache.d.ts +27 -0
- package/lib/drift/Drift/stores/MarkPriceCache.js +59 -0
- package/lib/drift/Drift/stores/MarkPriceCache.js.map +1 -0
- package/lib/drift/Drift/stores/OraclePriceCache.d.ts +21 -0
- package/lib/drift/Drift/stores/OraclePriceCache.js +57 -0
- package/lib/drift/Drift/stores/OraclePriceCache.js.map +1 -0
- package/lib/drift/Drift/stores/UserAccountCache.d.ts +49 -0
- package/lib/drift/Drift/stores/UserAccountCache.js +107 -0
- package/lib/drift/Drift/stores/UserAccountCache.js.map +1 -0
- package/lib/drift/Drift/stores/index.d.ts +3 -0
- package/lib/drift/Drift/stores/index.js +20 -0
- package/lib/drift/Drift/stores/index.js.map +1 -0
- package/lib/drift/base/actions/index.d.ts +4 -0
- package/lib/drift/base/actions/index.js +21 -0
- package/lib/drift/base/actions/index.js.map +1 -0
- package/lib/drift/base/actions/perp/index.d.ts +2 -0
- package/lib/drift/base/actions/perp/index.js +19 -0
- package/lib/drift/base/actions/perp/index.js.map +1 -0
- package/lib/drift/base/actions/perp/settleFunding.d.ts +25 -0
- package/lib/drift/base/actions/perp/settleFunding.js +41 -0
- package/lib/drift/base/actions/perp/settleFunding.js.map +1 -0
- package/lib/drift/base/actions/perp/settlePnl.d.ts +35 -0
- package/lib/drift/base/actions/perp/settlePnl.js +44 -0
- package/lib/drift/base/actions/perp/settlePnl.js.map +1 -0
- package/lib/drift/base/actions/spot/borrow.d.ts +1 -0
- package/lib/drift/base/actions/spot/borrow.js +8 -0
- package/lib/drift/base/actions/spot/borrow.js.map +1 -0
- package/lib/drift/base/actions/spot/deposit.d.ts +40 -0
- package/lib/drift/base/actions/spot/deposit.js +82 -0
- package/lib/drift/base/actions/spot/deposit.js.map +1 -0
- package/lib/drift/base/actions/spot/index.d.ts +3 -0
- package/lib/drift/base/actions/spot/index.js +20 -0
- package/lib/drift/base/actions/spot/index.js.map +1 -0
- package/lib/drift/base/actions/spot/withdraw.d.ts +16 -0
- package/lib/drift/base/actions/spot/withdraw.js +39 -0
- package/lib/drift/base/actions/spot/withdraw.js.map +1 -0
- package/lib/drift/base/actions/trade/cancelOrder.d.ts +47 -0
- package/lib/drift/base/actions/trade/cancelOrder.js +55 -0
- package/lib/drift/base/actions/trade/cancelOrder.js.map +1 -0
- package/lib/drift/base/actions/trade/editOrder.d.ts +55 -0
- package/lib/drift/base/actions/trade/editOrder.js +35 -0
- package/lib/drift/base/actions/trade/editOrder.js.map +1 -0
- package/lib/drift/base/actions/trade/index.d.ts +4 -0
- package/lib/drift/base/actions/trade/index.js +21 -0
- package/lib/drift/base/actions/trade/index.js.map +1 -0
- package/lib/drift/base/actions/trade/openPerpOrder/index.d.ts +3 -0
- package/lib/drift/base/actions/trade/openPerpOrder/index.js +20 -0
- package/lib/drift/base/actions/trade/openPerpOrder/index.js.map +1 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openPerpMarketOrder/index.d.ts +84 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openPerpMarketOrder/index.js +293 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openPerpMarketOrder/index.js.map +1 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openPerpNonMarketOrder/index.d.ts +19 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openPerpNonMarketOrder/index.js +161 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openPerpNonMarketOrder/index.js.map +1 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openSwiftOrder/index.d.ts +166 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openSwiftOrder/index.js +156 -0
- package/lib/drift/base/actions/trade/openPerpOrder/openSwiftOrder/index.js.map +1 -0
- package/lib/drift/base/actions/trade/swap.d.ts +62 -0
- package/lib/drift/base/actions/trade/swap.js +60 -0
- package/lib/drift/base/actions/trade/swap.js.map +1 -0
- package/lib/drift/base/actions/user/create.d.ts +75 -0
- package/lib/drift/base/actions/user/create.js +104 -0
- package/lib/drift/base/actions/user/create.js.map +1 -0
- package/lib/drift/base/actions/user/delete.d.ts +47 -0
- package/lib/drift/base/actions/user/delete.js +39 -0
- package/lib/drift/base/actions/user/delete.js.map +1 -0
- package/lib/drift/base/actions/user/index.d.ts +1 -0
- package/lib/drift/base/actions/user/index.js +18 -0
- package/lib/drift/base/actions/user/index.js.map +1 -0
- package/lib/drift/base/constants/accountNames.d.ts +1 -0
- package/lib/drift/base/constants/accountNames.js +13 -0
- package/lib/drift/base/constants/accountNames.js.map +1 -0
- package/lib/drift/base/details/index.d.ts +2 -0
- package/lib/drift/base/details/index.js +19 -0
- package/lib/drift/base/details/index.js.map +1 -0
- package/lib/drift/base/details/market/funding.d.ts +9 -0
- package/lib/drift/base/details/market/funding.js +50 -0
- package/lib/drift/base/details/market/funding.js.map +1 -0
- package/lib/drift/base/details/market/index.d.ts +2 -0
- package/lib/drift/base/details/market/index.js +19 -0
- package/lib/drift/base/details/market/index.js.map +1 -0
- package/lib/drift/base/details/market/openInterest.d.ts +5 -0
- package/lib/drift/base/details/market/openInterest.js +12 -0
- package/lib/drift/base/details/market/openInterest.js.map +1 -0
- package/lib/drift/base/details/user/balances.d.ts +40 -0
- package/lib/drift/base/details/user/balances.js +39 -0
- package/lib/drift/base/details/user/balances.js.map +1 -0
- package/lib/drift/base/details/user/index.d.ts +4 -0
- package/lib/drift/base/details/user/index.js +21 -0
- package/lib/drift/base/details/user/index.js.map +1 -0
- package/lib/drift/base/details/user/marginInfo.d.ts +29 -0
- package/lib/drift/base/details/user/marginInfo.js +49 -0
- package/lib/drift/base/details/user/marginInfo.js.map +1 -0
- package/lib/drift/base/details/user/orders.d.ts +3 -0
- package/lib/drift/base/details/user/orders.js +11 -0
- package/lib/drift/base/details/user/orders.js.map +1 -0
- package/lib/drift/base/details/user/positions.d.ts +70 -0
- package/lib/drift/base/details/user/positions.js +146 -0
- package/lib/drift/base/details/user/positions.js.map +1 -0
- package/lib/drift/cli.d.ts +25 -0
- package/lib/drift/cli.js +900 -0
- package/lib/drift/cli.js.map +1 -0
- package/lib/drift/constants/apiUrls.d.ts +27 -0
- package/lib/drift/constants/apiUrls.js +31 -0
- package/lib/drift/constants/apiUrls.js.map +1 -0
- package/lib/drift/example.d.ts +19 -0
- package/lib/drift/example.js +249 -0
- package/lib/drift/example.js.map +1 -0
- package/lib/drift/index.d.ts +3 -0
- package/lib/drift/index.js +20 -0
- package/lib/drift/index.js.map +1 -0
- package/lib/drift/utils/auctionParamsResponseMapper.d.ts +45 -0
- package/lib/drift/utils/auctionParamsResponseMapper.js +148 -0
- package/lib/drift/utils/auctionParamsResponseMapper.js.map +1 -0
- package/lib/drift/utils/funding.d.ts +2 -0
- package/lib/drift/utils/funding.js +9 -0
- package/lib/drift/utils/funding.js.map +1 -0
- package/lib/drift/utils/index.d.ts +3 -0
- package/lib/drift/utils/index.js +23 -0
- package/lib/drift/utils/index.js.map +1 -0
- package/lib/drift/utils/orderParams.d.ts +48 -0
- package/lib/drift/utils/orderParams.js +140 -0
- package/lib/drift/utils/orderParams.js.map +1 -0
- package/lib/index.d.ts +45 -0
- package/lib/index.js +68 -0
- package/lib/index.js.map +1 -0
- package/lib/serializableTypes.d.ts +961 -0
- package/lib/serializableTypes.js +3887 -0
- package/lib/serializableTypes.js.map +1 -0
- package/lib/types/MarketId.d.ts +26 -0
- package/lib/types/MarketId.js +64 -0
- package/lib/types/MarketId.js.map +1 -0
- package/lib/types/Superstake.d.ts +7 -0
- package/lib/types/Superstake.js +3 -0
- package/lib/types/Superstake.js.map +1 -0
- package/lib/types/UIEnv.d.ts +26 -0
- package/lib/types/UIEnv.js +49 -0
- package/lib/types/UIEnv.js.map +1 -0
- package/lib/types/UIMarket.d.ts +94 -0
- package/lib/types/UIMarket.js +224 -0
- package/lib/types/UIMarket.js.map +1 -0
- package/lib/types/candles.d.ts +4 -0
- package/lib/types/candles.js +9 -0
- package/lib/types/candles.js.map +1 -0
- package/lib/types/dataServer.d.ts +53 -0
- package/lib/types/dataServer.js +3 -0
- package/lib/types/dataServer.js.map +1 -0
- package/lib/types/historyServer.d.ts +38 -0
- package/lib/types/historyServer.js +11 -0
- package/lib/types/historyServer.js.map +1 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/index.js +29 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/leaderboard.d.ts +80 -0
- package/lib/types/leaderboard.js +11 -0
- package/lib/types/leaderboard.js.map +1 -0
- package/lib/types/remote-configs.d.ts +61 -0
- package/lib/types/remote-configs.js +3 -0
- package/lib/types/remote-configs.js.map +1 -0
- package/lib/types/trade.d.ts +18 -0
- package/lib/types/trade.js +3 -0
- package/lib/types/trade.js.map +1 -0
- package/lib/types/user.d.ts +40 -0
- package/lib/types/user.js +3 -0
- package/lib/types/user.js.map +1 -0
- package/lib/types/utility.d.ts +15 -0
- package/lib/types/utility.js +3 -0
- package/lib/types/utility.js.map +1 -0
- package/lib/utils/CircularBuffers/CircularBuffer.d.ts +22 -0
- package/lib/utils/CircularBuffers/CircularBuffer.js +73 -0
- package/lib/utils/CircularBuffers/CircularBuffer.js.map +1 -0
- package/lib/utils/CircularBuffers/UniqueCircularBuffer.d.ts +19 -0
- package/lib/utils/CircularBuffers/UniqueCircularBuffer.js +78 -0
- package/lib/utils/CircularBuffers/UniqueCircularBuffer.js.map +1 -0
- package/lib/utils/CircularBuffers/index.d.ts +2 -0
- package/lib/utils/CircularBuffers/index.js +19 -0
- package/lib/utils/CircularBuffers/index.js.map +1 -0
- package/lib/utils/MultiplexWebSocket.d.ts +95 -0
- package/lib/utils/MultiplexWebSocket.js +416 -0
- package/lib/utils/MultiplexWebSocket.js.map +1 -0
- package/lib/utils/NumLib.d.ts +106 -0
- package/lib/utils/NumLib.js +300 -0
- package/lib/utils/NumLib.js.map +1 -0
- package/lib/utils/SharedInterval.d.ts +21 -0
- package/lib/utils/SharedInterval.js +47 -0
- package/lib/utils/SharedInterval.js.map +1 -0
- package/lib/utils/SlotBasedResultValidator.d.ts +9 -0
- package/lib/utils/SlotBasedResultValidator.js +27 -0
- package/lib/utils/SlotBasedResultValidator.js.map +1 -0
- package/lib/utils/Stopwatch.d.ts +15 -0
- package/lib/utils/Stopwatch.js +31 -0
- package/lib/utils/Stopwatch.js.map +1 -0
- package/lib/utils/StrictEventEmitter.d.ts +15 -0
- package/lib/utils/StrictEventEmitter.js +55 -0
- package/lib/utils/StrictEventEmitter.js.map +1 -0
- package/lib/utils/WalletConnectionState.d.ts +31 -0
- package/lib/utils/WalletConnectionState.js +83 -0
- package/lib/utils/WalletConnectionState.js.map +1 -0
- package/lib/utils/assert.d.ts +1 -0
- package/lib/utils/assert.js +10 -0
- package/lib/utils/assert.js.map +1 -0
- package/lib/utils/candles/Candle.d.ts +94 -0
- package/lib/utils/candles/Candle.js +580 -0
- package/lib/utils/candles/Candle.js.map +1 -0
- package/lib/utils/candles/types.d.ts +8 -0
- package/lib/utils/candles/types.js +3 -0
- package/lib/utils/candles/types.js.map +1 -0
- package/lib/utils/dlob-server/DlobServerWebsocketUtils.d.ts +57 -0
- package/lib/utils/dlob-server/DlobServerWebsocketUtils.js +137 -0
- package/lib/utils/dlob-server/DlobServerWebsocketUtils.js.map +1 -0
- package/lib/utils/driftEvents.d.ts +10 -0
- package/lib/utils/driftEvents.js +123 -0
- package/lib/utils/driftEvents.js.map +1 -0
- package/lib/utils/equalityChecks.d.ts +12 -0
- package/lib/utils/equalityChecks.js +71 -0
- package/lib/utils/equalityChecks.js.map +1 -0
- package/lib/utils/featureFlags.d.ts +3 -0
- package/lib/utils/featureFlags.js +7 -0
- package/lib/utils/featureFlags.js.map +1 -0
- package/lib/utils/geoblock/index.d.ts +4 -0
- package/lib/utils/geoblock/index.js +20 -0
- package/lib/utils/geoblock/index.js.map +1 -0
- package/lib/utils/index.d.ts +181 -0
- package/lib/utils/index.js +608 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/insuranceFund.d.ts +15 -0
- package/lib/utils/insuranceFund.js +84 -0
- package/lib/utils/insuranceFund.js.map +1 -0
- package/lib/utils/logger.d.ts +5 -0
- package/lib/utils/logger.js +53 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/math.d.ts +10 -0
- package/lib/utils/math.js +89 -0
- package/lib/utils/math.js.map +1 -0
- package/lib/utils/orderbook/index.d.ts +65 -0
- package/lib/utils/orderbook/index.js +80 -0
- package/lib/utils/orderbook/index.js.map +1 -0
- package/lib/utils/pollingSequenceGuard.d.ts +9 -0
- package/lib/utils/pollingSequenceGuard.js +24 -0
- package/lib/utils/pollingSequenceGuard.js.map +1 -0
- package/lib/utils/priority-fees/PriorityFeeCalculator.d.ts +24 -0
- package/lib/utils/priority-fees/PriorityFeeCalculator.js +53 -0
- package/lib/utils/priority-fees/PriorityFeeCalculator.js.map +1 -0
- package/lib/utils/priority-fees/PriorityFeeStrategies.d.ts +5 -0
- package/lib/utils/priority-fees/PriorityFeeStrategies.js +43 -0
- package/lib/utils/priority-fees/PriorityFeeStrategies.js.map +1 -0
- package/lib/utils/priority-fees/index.d.ts +2 -0
- package/lib/utils/priority-fees/index.js +19 -0
- package/lib/utils/priority-fees/index.js.map +1 -0
- package/lib/utils/priorityFees.d.ts +14 -0
- package/lib/utils/priorityFees.js +68 -0
- package/lib/utils/priorityFees.js.map +1 -0
- package/lib/utils/rpcLatency.d.ts +7 -0
- package/lib/utils/rpcLatency.js +49 -0
- package/lib/utils/rpcLatency.js.map +1 -0
- package/lib/utils/rxjs.d.ts +11 -0
- package/lib/utils/rxjs.js +24 -0
- package/lib/utils/rxjs.js.map +1 -0
- package/lib/utils/s3Buckets.d.ts +43 -0
- package/lib/utils/s3Buckets.js +108 -0
- package/lib/utils/s3Buckets.js.map +1 -0
- package/lib/utils/superstake.d.ts +86 -0
- package/lib/utils/superstake.js +224 -0
- package/lib/utils/superstake.js.map +1 -0
- package/lib/utils/token.d.ts +16 -0
- package/lib/utils/token.js +44 -0
- package/lib/utils/token.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,961 @@
|
|
|
1
|
+
import { BigNum, BN, CandleResolution, CurveRecord, DepositExplanation, DepositRecord, Event, FundingPaymentRecord, FundingRateRecord, InsuranceFundRecord, InsuranceFundStakeRecord, LiquidateBorrowForPerpPnlRecord, LiquidatePerpPnlForDepositRecord, LiquidatePerpRecord, LiquidateSpotRecord, LiquidationRecord, LiquidationType, LPAction, LPRecord, MarketType, NewUserRecord, Order, OrderAction, OrderActionExplanation, OrderStatus, OrderTriggerCondition, OrderType, PerpBankruptcyRecord, PositionDirection, PublicKey, SettlePnlExplanation, SettlePnlRecord, SpotBalanceType, SpotBankruptcyRecord, SpotInterestRecord, StakeAction, SwapRecord, WrappedEvent } from '@drift-labs/sdk';
|
|
2
|
+
import { JsonObject } from 'cerializr';
|
|
3
|
+
import { AccountSnapshot, LeaderboardResult, LeaderBoardResultRow, PnlHistoryDataPoint, PnlSnapshotOrderOption, RollingPnlData, SnapshotEpochResolution, UIAccountSnapshot, UserPerpPositionSnapshot, UserSnapshotRecord, UserSpotPositionSnapshot } from './types/leaderboard';
|
|
4
|
+
export type OrderRecordEvent = WrappedEvent<'OrderRecord'>;
|
|
5
|
+
export declare class SerializableOrder implements Order {
|
|
6
|
+
status: OrderStatus;
|
|
7
|
+
orderType: OrderType;
|
|
8
|
+
ts: BN;
|
|
9
|
+
orderId: number;
|
|
10
|
+
userOrderId: number;
|
|
11
|
+
marketIndex: number;
|
|
12
|
+
price: BN;
|
|
13
|
+
baseAssetAmount: BN;
|
|
14
|
+
baseAssetAmountFilled: BN;
|
|
15
|
+
quoteAssetAmount: BN;
|
|
16
|
+
quoteAssetAmountFilled: BN;
|
|
17
|
+
direction: PositionDirection;
|
|
18
|
+
reduceOnly: boolean;
|
|
19
|
+
triggerPrice: BN;
|
|
20
|
+
triggerCondition: OrderTriggerCondition;
|
|
21
|
+
postOnly: boolean;
|
|
22
|
+
immediateOrCancel: boolean;
|
|
23
|
+
oraclePriceOffset: number;
|
|
24
|
+
auctionStartPrice: BN;
|
|
25
|
+
auctionEndPrice: BN;
|
|
26
|
+
existingPositionDirection: OrderStatus;
|
|
27
|
+
slot: BN;
|
|
28
|
+
auctionDuration: number;
|
|
29
|
+
marketType: MarketType;
|
|
30
|
+
maxTs: BN;
|
|
31
|
+
bitFlags: number;
|
|
32
|
+
postedSlotTail: number;
|
|
33
|
+
}
|
|
34
|
+
export declare class UISerializableOrder extends SerializableOrder {
|
|
35
|
+
price: BigNum;
|
|
36
|
+
baseAssetAmount: BigNum;
|
|
37
|
+
baseAssetAmountFilled: BigNum;
|
|
38
|
+
quoteAssetAmount: BigNum;
|
|
39
|
+
quoteAssetAmountFilled: BigNum;
|
|
40
|
+
triggerPrice: BigNum;
|
|
41
|
+
oraclePriceOffset: BigNum;
|
|
42
|
+
auctionStartPrice: BigNum;
|
|
43
|
+
auctionEndPrice: BigNum;
|
|
44
|
+
static onDeserialized(data: JsonObject, instance: UISerializableOrder): void;
|
|
45
|
+
}
|
|
46
|
+
export declare class SerializableOrderRecord implements OrderRecordEvent {
|
|
47
|
+
eventType: 'OrderRecord';
|
|
48
|
+
txSig: string;
|
|
49
|
+
txSigIndex: number;
|
|
50
|
+
slot: number;
|
|
51
|
+
ts: BN;
|
|
52
|
+
user: PublicKey;
|
|
53
|
+
order: Order;
|
|
54
|
+
static onDeserialized(data: JsonObject, instance: SerializableOrderRecord): void;
|
|
55
|
+
static onSerialized(json: JsonObject): void;
|
|
56
|
+
}
|
|
57
|
+
export declare class UISerializableOrderRecord extends SerializableOrderRecord {
|
|
58
|
+
order: UISerializableOrder;
|
|
59
|
+
static onDeserialized(data: JsonObject, instance: UISerializableOrderRecord): void;
|
|
60
|
+
static onSerialized(json: JsonObject): void;
|
|
61
|
+
}
|
|
62
|
+
export declare class SerializableOrderActionRecord implements WrappedEvent<'OrderActionRecord'> {
|
|
63
|
+
eventType: 'OrderActionRecord';
|
|
64
|
+
txSig: string;
|
|
65
|
+
slot: number;
|
|
66
|
+
txSigIndex: number;
|
|
67
|
+
ts: BN;
|
|
68
|
+
action: OrderAction;
|
|
69
|
+
actionExplanation: OrderActionExplanation;
|
|
70
|
+
marketIndex: number;
|
|
71
|
+
marketType: MarketType;
|
|
72
|
+
filler: PublicKey | null;
|
|
73
|
+
fillerReward: BN | null;
|
|
74
|
+
fillRecordId: BN | null;
|
|
75
|
+
baseAssetAmountFilled: BN | null;
|
|
76
|
+
quoteAssetAmountFilled: BN | null;
|
|
77
|
+
takerFee: BN | null;
|
|
78
|
+
makerRebate: BN | null;
|
|
79
|
+
referrerReward: number | null;
|
|
80
|
+
quoteAssetAmountSurplus: BN | null;
|
|
81
|
+
taker: PublicKey | null;
|
|
82
|
+
takerOrderId: number | null;
|
|
83
|
+
takerOrderDirection: PositionDirection | null;
|
|
84
|
+
takerOrderBaseAssetAmount: BN | null;
|
|
85
|
+
takerOrderCumulativeBaseAssetAmountFilled: BN | null;
|
|
86
|
+
takerOrderCumulativeQuoteAssetAmountFilled: BN | null;
|
|
87
|
+
maker: PublicKey | null;
|
|
88
|
+
makerOrderId: number | null;
|
|
89
|
+
makerOrderDirection: PositionDirection | null;
|
|
90
|
+
makerOrderBaseAssetAmount: BN | null;
|
|
91
|
+
makerOrderCumulativeBaseAssetAmountFilled: BN | null;
|
|
92
|
+
makerOrderCumulativeQuoteAssetAmountFilled: BN | null;
|
|
93
|
+
oraclePrice: BN;
|
|
94
|
+
makerFee: BN;
|
|
95
|
+
spotFulfillmentMethodFee: BN | null;
|
|
96
|
+
bitFlags: number;
|
|
97
|
+
takerExistingQuoteEntryAmount: BN | null;
|
|
98
|
+
takerExistingBaseAssetAmount: BN | null;
|
|
99
|
+
makerExistingQuoteEntryAmount: BN | null;
|
|
100
|
+
makerExistingBaseAssetAmount: BN | null;
|
|
101
|
+
static onDeserialized(data: JsonObject, instance: SerializableOrderActionRecord): void;
|
|
102
|
+
static onSerialized(json: JsonObject): void;
|
|
103
|
+
}
|
|
104
|
+
export declare class UISerializableOrderActionRecord extends SerializableOrderActionRecord {
|
|
105
|
+
fillerReward: BigNum | null;
|
|
106
|
+
baseAssetAmountFilled: BigNum | null;
|
|
107
|
+
quoteAssetAmountFilled: BigNum | null;
|
|
108
|
+
takerFee: BigNum | null;
|
|
109
|
+
makerRebate: BigNum | null;
|
|
110
|
+
referrerReward: number | null;
|
|
111
|
+
quoteAssetAmountSurplus: BigNum | null;
|
|
112
|
+
takerOrderBaseAssetAmount: BigNum | null;
|
|
113
|
+
takerOrderCumulativeBaseAssetAmountFilled: BigNum | null;
|
|
114
|
+
takerOrderCumulativeQuoteAssetAmountFilled: BigNum | null;
|
|
115
|
+
makerOrderBaseAssetAmount: BigNum | null;
|
|
116
|
+
makerOrderCumulativeBaseAssetAmountFilled: BigNum | null;
|
|
117
|
+
makerOrderCumulativeQuoteAssetAmountFilled: BigNum | null;
|
|
118
|
+
oraclePrice: BigNum;
|
|
119
|
+
makerFee: BigNum | null;
|
|
120
|
+
spotFulfillmentMethodFee: BigNum | null;
|
|
121
|
+
takerExistingQuoteEntryAmount: BigNum | null;
|
|
122
|
+
takerExistingBaseAssetAmount: BigNum | null;
|
|
123
|
+
makerExistingQuoteEntryAmount: BigNum | null;
|
|
124
|
+
makerExistingBaseAssetAmount: BigNum | null;
|
|
125
|
+
static onDeserialized(data: JsonObject, instance: UISerializableOrderActionRecord): void;
|
|
126
|
+
static onSerialized(json: JsonObject): void;
|
|
127
|
+
}
|
|
128
|
+
export declare class UISerializableOrderRecordV2 {
|
|
129
|
+
ts: BN;
|
|
130
|
+
txSig: string;
|
|
131
|
+
txSigIndex: number;
|
|
132
|
+
slot: number;
|
|
133
|
+
user: PublicKey;
|
|
134
|
+
orderType: OrderType;
|
|
135
|
+
marketType: MarketType;
|
|
136
|
+
orderId: number;
|
|
137
|
+
userOrderId: number;
|
|
138
|
+
marketIndex: number;
|
|
139
|
+
price: BigNum;
|
|
140
|
+
baseAssetAmount: BigNum;
|
|
141
|
+
quoteAssetAmount: BigNum;
|
|
142
|
+
baseAssetAmountFilled: BigNum;
|
|
143
|
+
quoteAssetAmountFilled: BigNum;
|
|
144
|
+
direction: PositionDirection;
|
|
145
|
+
reduceOnly: boolean;
|
|
146
|
+
triggerPrice: BigNum;
|
|
147
|
+
triggerCondition: OrderTriggerCondition;
|
|
148
|
+
existingPositionDirection: PositionDirection;
|
|
149
|
+
postOnly: boolean;
|
|
150
|
+
immediateOrCancel: boolean;
|
|
151
|
+
oraclePriceOffset: BigNum;
|
|
152
|
+
auctionDuration: number;
|
|
153
|
+
auctionStartPrice: BigNum;
|
|
154
|
+
auctionEndPrice: BigNum;
|
|
155
|
+
maxTs: BN;
|
|
156
|
+
symbol: string;
|
|
157
|
+
lastUpdatedTs: BN;
|
|
158
|
+
lastActionExplanation: OrderActionExplanation;
|
|
159
|
+
lastActionStatus: string;
|
|
160
|
+
status: string;
|
|
161
|
+
static onDeserialized(data: JsonObject, instance: UISerializableOrderRecordV2): void;
|
|
162
|
+
}
|
|
163
|
+
export declare class UISerializableOrderActionRecordBase {
|
|
164
|
+
ts: BN;
|
|
165
|
+
txSig: string;
|
|
166
|
+
txSigIndex: number;
|
|
167
|
+
slot: number;
|
|
168
|
+
marketIndex: number;
|
|
169
|
+
marketType: MarketType;
|
|
170
|
+
fillerReward: BigNum;
|
|
171
|
+
baseAssetAmountFilled: BigNum;
|
|
172
|
+
quoteAssetAmountFilled: BigNum;
|
|
173
|
+
takerFee: BigNum;
|
|
174
|
+
makerRebate: BigNum;
|
|
175
|
+
referrerReward: number;
|
|
176
|
+
quoteAssetAmountSurplus: BigNum;
|
|
177
|
+
takerOrderBaseAssetAmount: BigNum;
|
|
178
|
+
takerOrderCumulativeBaseAssetAmountFilled: BigNum;
|
|
179
|
+
takerOrderCumulativeQuoteAssetAmountFilled: BigNum;
|
|
180
|
+
makerOrderBaseAssetAmount: BigNum;
|
|
181
|
+
makerOrderCumulativeBaseAssetAmountFilled: BigNum;
|
|
182
|
+
makerOrderCumulativeQuoteAssetAmountFilled: BigNum;
|
|
183
|
+
oraclePrice: BigNum;
|
|
184
|
+
makerFee: BigNum;
|
|
185
|
+
action: OrderAction;
|
|
186
|
+
actionExplanation: OrderActionExplanation;
|
|
187
|
+
filler: PublicKey;
|
|
188
|
+
fillRecordId: BN;
|
|
189
|
+
taker: PublicKey;
|
|
190
|
+
takerOrderId: number;
|
|
191
|
+
takerOrderDirection: PositionDirection;
|
|
192
|
+
maker: PublicKey;
|
|
193
|
+
makerOrderId: number;
|
|
194
|
+
makerOrderDirection: PositionDirection;
|
|
195
|
+
spotFulfillmentMethodFee: BigNum;
|
|
196
|
+
user: PublicKey;
|
|
197
|
+
symbol: string;
|
|
198
|
+
bitFlags: number;
|
|
199
|
+
takerExistingQuoteEntryAmount: BigNum | null;
|
|
200
|
+
takerExistingBaseAssetAmount: BigNum | null;
|
|
201
|
+
makerExistingQuoteEntryAmount: BigNum | null;
|
|
202
|
+
makerExistingBaseAssetAmount: BigNum | null;
|
|
203
|
+
}
|
|
204
|
+
export declare class UISerializableOrderActionRecordV2 extends UISerializableOrderActionRecordBase {
|
|
205
|
+
eventType: 'OrderActionRecord';
|
|
206
|
+
static onDeserialized(data: JsonObject, instance: UISerializableOrderActionRecordV2): void;
|
|
207
|
+
static onSerialized(json: JsonObject): void;
|
|
208
|
+
}
|
|
209
|
+
export declare class UISerializablePositionHistoryRecord extends UISerializableOrderActionRecordBase {
|
|
210
|
+
eventType: 'PositionHistoryRecord';
|
|
211
|
+
baseClosedForPnl: BigNum;
|
|
212
|
+
userFee: BigNum;
|
|
213
|
+
userExistingQuoteEntryAmount: BigNum;
|
|
214
|
+
userExistingBaseAssetAmount: BigNum;
|
|
215
|
+
static onDeserialized(data: JsonObject, instance: UISerializablePositionHistoryRecord): void;
|
|
216
|
+
static onSerialized(json: JsonObject): void;
|
|
217
|
+
}
|
|
218
|
+
export type DepositRecordEvent = Event<DepositRecord>;
|
|
219
|
+
export declare class SerializableDepositRecord implements DepositRecordEvent {
|
|
220
|
+
id: number;
|
|
221
|
+
txSig: string;
|
|
222
|
+
txSigIndex: number;
|
|
223
|
+
slot: number;
|
|
224
|
+
ts: BN;
|
|
225
|
+
depositRecordId: BN;
|
|
226
|
+
userAuthority: PublicKey;
|
|
227
|
+
user: PublicKey;
|
|
228
|
+
direction: {
|
|
229
|
+
deposit?: any;
|
|
230
|
+
withdraw?: any;
|
|
231
|
+
};
|
|
232
|
+
marketIndex: number;
|
|
233
|
+
amount: BN;
|
|
234
|
+
oraclePrice: BN;
|
|
235
|
+
marketDepositBalance: BN;
|
|
236
|
+
marketWithdrawBalance: BN;
|
|
237
|
+
marketCumulativeDepositInterest: BN;
|
|
238
|
+
marketCumulativeBorrowInterest: BN;
|
|
239
|
+
transferUser?: PublicKey;
|
|
240
|
+
totalDepositsAfter: BN;
|
|
241
|
+
totalWithdrawsAfter: BN;
|
|
242
|
+
explanation: DepositExplanation;
|
|
243
|
+
}
|
|
244
|
+
export declare class UISerializableDepositRecord extends SerializableDepositRecord {
|
|
245
|
+
amount: BigNum;
|
|
246
|
+
oraclePrice: BigNum;
|
|
247
|
+
marketDepositBalance: BigNum;
|
|
248
|
+
marketWithdrawBalance: BigNum;
|
|
249
|
+
marketCumulativeDepositInterest: BigNum;
|
|
250
|
+
marketCumulativeBorrowInterest: BigNum;
|
|
251
|
+
totalDepositsAfter: BigNum;
|
|
252
|
+
totalWithdrawsAfter: BigNum;
|
|
253
|
+
static onDeserialized(data: JsonObject, instance: UISerializableDepositRecord): void;
|
|
254
|
+
}
|
|
255
|
+
export type SpotInterestRecordEvent = Event<SpotInterestRecord>;
|
|
256
|
+
export declare class SerializableSpotInterestRecord implements SpotInterestRecordEvent {
|
|
257
|
+
id: number;
|
|
258
|
+
txSig: string;
|
|
259
|
+
txSigIndex: number;
|
|
260
|
+
slot: number;
|
|
261
|
+
ts: BN;
|
|
262
|
+
marketIndex: number;
|
|
263
|
+
depositBalance: BN;
|
|
264
|
+
cumulativeDepositInterest: BN;
|
|
265
|
+
borrowBalance: BN;
|
|
266
|
+
cumulativeBorrowInterest: BN;
|
|
267
|
+
optimalUtilization: number;
|
|
268
|
+
optimalBorrowRate: number;
|
|
269
|
+
maxBorrowRate: number;
|
|
270
|
+
}
|
|
271
|
+
export type CurveRecordEvent = Event<CurveRecord>;
|
|
272
|
+
export declare class SerializableCurveRecord implements CurveRecordEvent {
|
|
273
|
+
id: number;
|
|
274
|
+
txSig: string;
|
|
275
|
+
txSigIndex: number;
|
|
276
|
+
slot: number;
|
|
277
|
+
ts: BN;
|
|
278
|
+
recordId: BN;
|
|
279
|
+
marketIndex: number;
|
|
280
|
+
pegMultiplierBefore: BN;
|
|
281
|
+
baseAssetReserveBefore: BN;
|
|
282
|
+
quoteAssetReserveBefore: BN;
|
|
283
|
+
sqrtKBefore: BN;
|
|
284
|
+
pegMultiplierAfter: BN;
|
|
285
|
+
baseAssetReserveAfter: BN;
|
|
286
|
+
quoteAssetReserveAfter: BN;
|
|
287
|
+
sqrtKAfter: BN;
|
|
288
|
+
baseAssetAmountLong: BN;
|
|
289
|
+
baseAssetAmountShort: BN;
|
|
290
|
+
baseAssetAmountWithAmm: BN;
|
|
291
|
+
totalFee: BN;
|
|
292
|
+
totalFeeMinusDistributions: BN;
|
|
293
|
+
adjustmentCost: BN;
|
|
294
|
+
numberOfUsers: BN;
|
|
295
|
+
oraclePrice: BN;
|
|
296
|
+
fillRecord: BN;
|
|
297
|
+
}
|
|
298
|
+
export type SettlePnlRecordEvent = Event<SettlePnlRecord>;
|
|
299
|
+
export declare class SerializableSettlePnlRecord implements SettlePnlRecordEvent {
|
|
300
|
+
id: number;
|
|
301
|
+
txSig: string;
|
|
302
|
+
txSigIndex: number;
|
|
303
|
+
slot: number;
|
|
304
|
+
user: PublicKey;
|
|
305
|
+
ts: BN;
|
|
306
|
+
marketIndex: number;
|
|
307
|
+
pnl: BN;
|
|
308
|
+
baseAssetAmount: BN;
|
|
309
|
+
quoteAssetAmountAfter: BN;
|
|
310
|
+
quoteEntryAmount: BN;
|
|
311
|
+
settlePrice: BN;
|
|
312
|
+
oraclePrice: BN;
|
|
313
|
+
explanation: SettlePnlExplanation;
|
|
314
|
+
}
|
|
315
|
+
export declare class UISerializableSettlePnlRecord extends SerializableSettlePnlRecord {
|
|
316
|
+
pnl: BigNum;
|
|
317
|
+
baseAssetAmount: BigNum;
|
|
318
|
+
quoteAssetAmountAfter: BigNum;
|
|
319
|
+
quoteEntryAmount: BigNum;
|
|
320
|
+
settlePrice: BigNum;
|
|
321
|
+
oraclePrice: BigNum;
|
|
322
|
+
}
|
|
323
|
+
export type FundingRateRecordEvent = Event<FundingRateRecord>;
|
|
324
|
+
export declare class SerializableFundingRateRecord implements FundingRateRecordEvent {
|
|
325
|
+
txSig: string;
|
|
326
|
+
slot: number;
|
|
327
|
+
ts: BN;
|
|
328
|
+
recordId: BN;
|
|
329
|
+
marketIndex: number;
|
|
330
|
+
fundingRate: BN;
|
|
331
|
+
cumulativeFundingRateLong: BN;
|
|
332
|
+
cumulativeFundingRateShort: BN;
|
|
333
|
+
oraclePriceTwap: BN;
|
|
334
|
+
markPriceTwap: BN;
|
|
335
|
+
fundingRateLong: BN;
|
|
336
|
+
fundingRateShort: BN;
|
|
337
|
+
periodRevenue: BN;
|
|
338
|
+
baseAssetAmountWithAmm: BN;
|
|
339
|
+
baseAssetAmountWithUnsettledLp: BN;
|
|
340
|
+
}
|
|
341
|
+
export declare class UISerializableFundingRateRecord extends SerializableFundingRateRecord {
|
|
342
|
+
fundingRate: BigNum;
|
|
343
|
+
cumulativeFundingRateLong: BigNum;
|
|
344
|
+
cumulativeFundingRateShort: BigNum;
|
|
345
|
+
oraclePriceTwap: BigNum;
|
|
346
|
+
markPriceTwap: BigNum;
|
|
347
|
+
fundingRateLong: BigNum;
|
|
348
|
+
fundingRateShort: BigNum;
|
|
349
|
+
periodRevenue: BigNum;
|
|
350
|
+
baseAssetAmountWithAmm: BigNum;
|
|
351
|
+
baseAssetAmountWithUnsettledLp: BigNum;
|
|
352
|
+
}
|
|
353
|
+
export type FundingPaymentRecordEvent = Event<FundingPaymentRecord>;
|
|
354
|
+
export declare class SerializableFundingPaymentRecord implements FundingPaymentRecordEvent {
|
|
355
|
+
id: number;
|
|
356
|
+
txSig: string;
|
|
357
|
+
txSigIndex: number;
|
|
358
|
+
slot: number;
|
|
359
|
+
ts: BN;
|
|
360
|
+
userAuthority: PublicKey;
|
|
361
|
+
user: PublicKey;
|
|
362
|
+
marketIndex: number;
|
|
363
|
+
fundingPayment: BN;
|
|
364
|
+
baseAssetAmount: BN;
|
|
365
|
+
userLastCumulativeFunding: BN;
|
|
366
|
+
ammCumulativeFundingLong: BN;
|
|
367
|
+
ammCumulativeFundingShort: BN;
|
|
368
|
+
}
|
|
369
|
+
export declare class UISerializableFundingPaymentRecord extends SerializableFundingPaymentRecord {
|
|
370
|
+
fundingPayment: BigNum;
|
|
371
|
+
baseAssetAmount: BigNum;
|
|
372
|
+
userLastCumulativeFunding: BigNum;
|
|
373
|
+
ammCumulativeFundingLong: BigNum;
|
|
374
|
+
ammCumulativeFundingShort: BigNum;
|
|
375
|
+
}
|
|
376
|
+
export declare class SerializableLiquidatePerpRecord implements LiquidatePerpRecord {
|
|
377
|
+
marketIndex: number;
|
|
378
|
+
orderIds: BN[];
|
|
379
|
+
oraclePrice: BN;
|
|
380
|
+
baseAssetAmount: BN;
|
|
381
|
+
quoteAssetAmount: BN;
|
|
382
|
+
userPnl: BN;
|
|
383
|
+
liquidatorPnl: BN;
|
|
384
|
+
canceledOrdersFee: BN;
|
|
385
|
+
userOrderId: BN;
|
|
386
|
+
liquidatorOrderId: BN;
|
|
387
|
+
fillRecordId: BN;
|
|
388
|
+
lpShares: BN;
|
|
389
|
+
liquidatorFee: BN;
|
|
390
|
+
ifFee: BN;
|
|
391
|
+
}
|
|
392
|
+
export declare class UISerializableLiquidatePerpRecord extends SerializableLiquidatePerpRecord {
|
|
393
|
+
oraclePrice: BigNum;
|
|
394
|
+
baseAssetAmount: BigNum;
|
|
395
|
+
quoteAssetAmount: BigNum;
|
|
396
|
+
userPnl: BigNum;
|
|
397
|
+
liquidatorPnl: BigNum;
|
|
398
|
+
canceledOrdersFee: BigNum;
|
|
399
|
+
lpShares: BigNum;
|
|
400
|
+
liquidatorFee: BigNum;
|
|
401
|
+
ifFee: BigNum;
|
|
402
|
+
}
|
|
403
|
+
export declare class SerializableLiquidateSpotRecord implements LiquidateSpotRecord {
|
|
404
|
+
assetMarketIndex: number;
|
|
405
|
+
assetPrice: BN;
|
|
406
|
+
assetTransfer: BN;
|
|
407
|
+
liabilityMarketIndex: number;
|
|
408
|
+
liabilityPrice: BN;
|
|
409
|
+
liabilityTransfer: BN;
|
|
410
|
+
ifFee: BN;
|
|
411
|
+
}
|
|
412
|
+
export declare class UISerializableLiquidateSpotRecord extends SerializableLiquidateSpotRecord {
|
|
413
|
+
assetPrice: BigNum;
|
|
414
|
+
assetTransfer: BigNum;
|
|
415
|
+
liabilityPrice: BigNum;
|
|
416
|
+
liabilityTransfer: BigNum;
|
|
417
|
+
static onDeserialized(data: JsonObject, instance: UISerializableLiquidateSpotRecord): void;
|
|
418
|
+
}
|
|
419
|
+
export declare class SerializableLiquidateBorrowForPerpPnlRecord implements LiquidateBorrowForPerpPnlRecord {
|
|
420
|
+
marketOraclePrice: BN;
|
|
421
|
+
pnlTransfer: BN;
|
|
422
|
+
liabilityMarketIndex: number;
|
|
423
|
+
liabilityPrice: BN;
|
|
424
|
+
liabilityTransfer: BN;
|
|
425
|
+
perpMarketIndex: number;
|
|
426
|
+
}
|
|
427
|
+
export declare class UISerializableLiquidateBorrowForPerpPnlRecord extends SerializableLiquidateBorrowForPerpPnlRecord {
|
|
428
|
+
marketOraclePrice: BigNum;
|
|
429
|
+
pnlTransfer: BigNum;
|
|
430
|
+
liabilityPrice: BigNum;
|
|
431
|
+
liabilityTransfer: BigNum;
|
|
432
|
+
static onDeserialized(data: JsonObject, instance: UISerializableLiquidateBorrowForPerpPnlRecord): void;
|
|
433
|
+
}
|
|
434
|
+
export declare class SerializableLiquidatePerpPnlForDepositRecord implements LiquidatePerpPnlForDepositRecord {
|
|
435
|
+
marketOraclePrice: BN;
|
|
436
|
+
pnlTransfer: BN;
|
|
437
|
+
assetMarketIndex: number;
|
|
438
|
+
assetPrice: BN;
|
|
439
|
+
assetTransfer: BN;
|
|
440
|
+
perpMarketIndex: number;
|
|
441
|
+
}
|
|
442
|
+
export declare class UISerializableLiquidatePerpPnlForDepositRecord extends SerializableLiquidatePerpPnlForDepositRecord {
|
|
443
|
+
marketOraclePrice: BigNum;
|
|
444
|
+
pnlTransfer: BigNum;
|
|
445
|
+
assetPrice: BigNum;
|
|
446
|
+
assetTransfer: BigNum;
|
|
447
|
+
static onDeserialized(data: JsonObject, instance: UISerializableLiquidatePerpPnlForDepositRecord): void;
|
|
448
|
+
}
|
|
449
|
+
export type LiquidationRecordEvent = Event<LiquidationRecord>;
|
|
450
|
+
export declare class SerializablePerpBankrupcyRecord implements PerpBankruptcyRecord {
|
|
451
|
+
marketIndex: number;
|
|
452
|
+
pnl: BN;
|
|
453
|
+
cumulativeFundingRateDelta: BN;
|
|
454
|
+
ifPayment: BN;
|
|
455
|
+
clawbackUser: PublicKey;
|
|
456
|
+
clawbackUserPayment: BN;
|
|
457
|
+
}
|
|
458
|
+
export declare class UISerializablePerpBankrupcyRecord extends SerializablePerpBankrupcyRecord {
|
|
459
|
+
pnl: BigNum;
|
|
460
|
+
cumulativeFundingRateDelta: BigNum;
|
|
461
|
+
ifPayment: BigNum;
|
|
462
|
+
clawbackUserPayment: BN;
|
|
463
|
+
}
|
|
464
|
+
export declare class SerializableSpotBankruptcyRecord implements SpotBankruptcyRecord {
|
|
465
|
+
marketIndex: number;
|
|
466
|
+
borrowAmount: BN;
|
|
467
|
+
cumulativeDepositInterestDelta: BN;
|
|
468
|
+
ifPayment: BN;
|
|
469
|
+
}
|
|
470
|
+
export declare class UISerializableSpotBankruptcyRecord extends SerializableSpotBankruptcyRecord {
|
|
471
|
+
borrowAmount: BigNum;
|
|
472
|
+
cumulativeDepositInterestDelta: BigNum;
|
|
473
|
+
ifPayment: BigNum;
|
|
474
|
+
static onDeserialized(data: JsonObject, instance: UISerializableSpotBankruptcyRecord): void;
|
|
475
|
+
}
|
|
476
|
+
export declare class SerializableLiquidationRecord implements LiquidationRecordEvent {
|
|
477
|
+
liquidationId: number;
|
|
478
|
+
txSig: string;
|
|
479
|
+
txSigIndex: number;
|
|
480
|
+
slot: number;
|
|
481
|
+
ts: BN;
|
|
482
|
+
user: PublicKey;
|
|
483
|
+
liquidator: PublicKey;
|
|
484
|
+
totalCollateral: BN;
|
|
485
|
+
liquidationType: LiquidationType;
|
|
486
|
+
marginRequirement: BN;
|
|
487
|
+
liquidatePerp: LiquidatePerpRecord;
|
|
488
|
+
liquidateSpot: LiquidateSpotRecord;
|
|
489
|
+
liquidateBorrowForPerpPnl: LiquidateBorrowForPerpPnlRecord;
|
|
490
|
+
liquidatePerpPnlForDeposit: LiquidatePerpPnlForDepositRecord;
|
|
491
|
+
perpBankruptcy: PerpBankruptcyRecord;
|
|
492
|
+
spotBankruptcy: SpotBankruptcyRecord;
|
|
493
|
+
canceledOrderIds: BN[];
|
|
494
|
+
marginFreed: BN;
|
|
495
|
+
bankrupt: boolean;
|
|
496
|
+
}
|
|
497
|
+
export declare class UISerializableLiquidationRecord extends SerializableLiquidationRecord {
|
|
498
|
+
marginRequirement: BigNum;
|
|
499
|
+
totalCollateral: BigNum;
|
|
500
|
+
liquidatePerp: UISerializableLiquidatePerpRecord;
|
|
501
|
+
liquidateSpot: UISerializableLiquidateSpotRecord;
|
|
502
|
+
liquidateBorrowForPerpPnl: UISerializableLiquidateBorrowForPerpPnlRecord;
|
|
503
|
+
liquidatePerpPnlForDeposit: UISerializableLiquidatePerpPnlForDepositRecord;
|
|
504
|
+
}
|
|
505
|
+
export declare class UISerializableLiquidationRecordV2 {
|
|
506
|
+
ts: BN;
|
|
507
|
+
txSig: string;
|
|
508
|
+
txSigIndex: number;
|
|
509
|
+
slot: number;
|
|
510
|
+
liquidationType: LiquidationType;
|
|
511
|
+
user: PublicKey;
|
|
512
|
+
liquidator: PublicKey;
|
|
513
|
+
marginRequirement: BigNum;
|
|
514
|
+
totalCollateral: BigNum;
|
|
515
|
+
marginFreed: BN;
|
|
516
|
+
liquidationId: number;
|
|
517
|
+
bankrupt: boolean;
|
|
518
|
+
canceledOrderIds: BN[];
|
|
519
|
+
liquidatePerp_marketIndex: number;
|
|
520
|
+
liquidatePerp_oraclePrice: BigNum;
|
|
521
|
+
liquidatePerp_baseAssetAmount: BigNum;
|
|
522
|
+
liquidatePerp_quoteAssetAmount: BigNum;
|
|
523
|
+
liquidatePerp_lpShares: BigNum;
|
|
524
|
+
liquidatePerp_fillRecordId: BN;
|
|
525
|
+
liquidatePerp_userOrderId: BN;
|
|
526
|
+
liquidatePerp_liquidatorOrderId: BN;
|
|
527
|
+
liquidatePerp_liquidatorFee: BigNum;
|
|
528
|
+
liquidatePerp_ifFee: BigNum;
|
|
529
|
+
liquidateSpot_assetMarketIndex: number;
|
|
530
|
+
liquidateSpot_assetPrice: BigNum;
|
|
531
|
+
liquidateSpot_assetTransfer: BigNum;
|
|
532
|
+
liquidateSpot_liabilityMarketIndex: number;
|
|
533
|
+
liquidateSpot_liabilityPrice: BigNum;
|
|
534
|
+
liquidateSpot_liabilityTransfer: BigNum;
|
|
535
|
+
liquidateSpot_ifFee: BigNum;
|
|
536
|
+
liquidateBorrowForPerpPnl_perpMarketIndex: number;
|
|
537
|
+
liquidateBorrowForPerpPnl_marketOraclePrice: BigNum;
|
|
538
|
+
liquidateBorrowForPerpPnl_pnlTransfer: BigNum;
|
|
539
|
+
liquidateBorrowForPerpPnl_liabilityMarketIndex: number;
|
|
540
|
+
liquidateBorrowForPerpPnl_liabilityPrice: BigNum;
|
|
541
|
+
liquidateBorrowForPerpPnl_liabilityTransfer: BigNum;
|
|
542
|
+
liquidatePerpPnlForDeposit_perpMarketIndex: number;
|
|
543
|
+
liquidatePerpPnlForDeposit_marketOraclePrice: BigNum;
|
|
544
|
+
liquidatePerpPnlForDeposit_pnlTransfer: BigNum;
|
|
545
|
+
liquidatePerpPnlForDeposit_assetMarketIndex: number;
|
|
546
|
+
liquidatePerpPnlForDeposit_assetPrice: BigNum;
|
|
547
|
+
liquidatePerpPnlForDeposit_assetTransfer: BigNum;
|
|
548
|
+
perpBankruptcy_marketIndex: number;
|
|
549
|
+
perpBankruptcy_pnl: BigNum;
|
|
550
|
+
perpBankruptcy_ifPayment: BigNum;
|
|
551
|
+
perpBankruptcy_clawbackUser: PublicKey;
|
|
552
|
+
perpBankruptcy_clawbackUserPayment: BigNum;
|
|
553
|
+
perpBankruptcy_cumulativeFundingRateDelta: BigNum;
|
|
554
|
+
spotBankruptcy_marketIndex: number;
|
|
555
|
+
spotBankruptcy_borrowAmount: BigNum;
|
|
556
|
+
spotBankruptcy_ifPayment: BigNum;
|
|
557
|
+
spotBankruptcy_cumulativeDepositInterestDelta: BigNum;
|
|
558
|
+
static onDeserialized(data: JsonObject, instance: UISerializableLiquidationRecordV2): void;
|
|
559
|
+
}
|
|
560
|
+
declare class SerializableUserPerpPositionSnapshot implements UserPerpPositionSnapshot {
|
|
561
|
+
lpShares: BN;
|
|
562
|
+
quoteAssetAmount: BN;
|
|
563
|
+
baseAssetAmount: BN;
|
|
564
|
+
marketIndex: number;
|
|
565
|
+
}
|
|
566
|
+
declare class SerializableUserSpotPositionSnapshot implements UserSpotPositionSnapshot {
|
|
567
|
+
tokenValue: BN;
|
|
568
|
+
tokenAmount: BN;
|
|
569
|
+
cumulativeDeposits: BN;
|
|
570
|
+
balanceInterestDelta: BN;
|
|
571
|
+
marketIndex: number;
|
|
572
|
+
type: SpotBalanceType;
|
|
573
|
+
}
|
|
574
|
+
export declare class SerializableUserSnapshotRecord implements UserSnapshotRecord {
|
|
575
|
+
programId: PublicKey;
|
|
576
|
+
authority: PublicKey;
|
|
577
|
+
user: PublicKey;
|
|
578
|
+
epochTs: number;
|
|
579
|
+
ts: number;
|
|
580
|
+
perpPositionUpnl: BN;
|
|
581
|
+
totalAccountValue: BN;
|
|
582
|
+
cumulativeDepositQuoteValue: BN;
|
|
583
|
+
cumulativeWithdrawalQuoteValue: BN;
|
|
584
|
+
cumulativeSettledPerpPnl: BN;
|
|
585
|
+
cumulativeReferralReward: BN;
|
|
586
|
+
cumulativeReferralVolume: BN;
|
|
587
|
+
cumulativeReferralCount: number;
|
|
588
|
+
}
|
|
589
|
+
export declare class UISerializableUserSnapshotRecord extends SerializableUserSnapshotRecord {
|
|
590
|
+
perpPositionUpnl: BigNum;
|
|
591
|
+
totalAccountValue: BigNum;
|
|
592
|
+
cumulativeDepositQuoteValue: BigNum;
|
|
593
|
+
cumulativeWithdrawalQuoteValue: BigNum;
|
|
594
|
+
cumulativeSettledPerpPnl: BigNum;
|
|
595
|
+
cumulativeReferralReward: BigNum;
|
|
596
|
+
cumulativeReferralVolume: BigNum;
|
|
597
|
+
}
|
|
598
|
+
export declare class SerializableCandle {
|
|
599
|
+
fillOpen: BN;
|
|
600
|
+
fillClose: BN;
|
|
601
|
+
fillHigh: BN;
|
|
602
|
+
fillLow: BN;
|
|
603
|
+
oracleOpen: BN;
|
|
604
|
+
oracleClose: BN;
|
|
605
|
+
oracleHigh: BN;
|
|
606
|
+
oracleLow: BN;
|
|
607
|
+
quoteVolume: BN;
|
|
608
|
+
baseVolume: BN;
|
|
609
|
+
start: BN;
|
|
610
|
+
resolution: CandleResolution;
|
|
611
|
+
}
|
|
612
|
+
export declare class UISerializableCandle extends SerializableCandle {
|
|
613
|
+
fillOpen: BigNum;
|
|
614
|
+
fillClose: BigNum;
|
|
615
|
+
fillHigh: BigNum;
|
|
616
|
+
fillLow: BigNum;
|
|
617
|
+
oracleOpen: BigNum;
|
|
618
|
+
oracleClose: BigNum;
|
|
619
|
+
oracleHigh: BigNum;
|
|
620
|
+
oracleLow: BigNum;
|
|
621
|
+
quoteVolume: BigNum;
|
|
622
|
+
baseVolume: BigNum;
|
|
623
|
+
resolution: CandleResolution;
|
|
624
|
+
}
|
|
625
|
+
export declare class SerializableRollingPnlData implements RollingPnlData {
|
|
626
|
+
spotPnlQuote: BN;
|
|
627
|
+
spotPnlPct: BN;
|
|
628
|
+
perpPnlQuote: BN;
|
|
629
|
+
perpPnlPct: BN;
|
|
630
|
+
totalPnlQuote: BN;
|
|
631
|
+
totalPnlPct: BN;
|
|
632
|
+
}
|
|
633
|
+
export declare class SerializableAllTimePnlData extends SerializableRollingPnlData {
|
|
634
|
+
epochTs: number;
|
|
635
|
+
spotPnlQuote: BN;
|
|
636
|
+
spotPnlPct: BN;
|
|
637
|
+
perpPnlQuote: BN;
|
|
638
|
+
perpPnlPct: BN;
|
|
639
|
+
totalPnlQuote: BN;
|
|
640
|
+
totalPnlPct: BN;
|
|
641
|
+
}
|
|
642
|
+
export declare class UISerializableRollingPnlData extends SerializableRollingPnlData {
|
|
643
|
+
spotPnlQuote: BigNum;
|
|
644
|
+
spotPnlPct: BigNum;
|
|
645
|
+
perpPnlQuote: BigNum;
|
|
646
|
+
perpPnlPct: BigNum;
|
|
647
|
+
totalPnlQuote: BigNum;
|
|
648
|
+
totalPnlPct: BigNum;
|
|
649
|
+
}
|
|
650
|
+
export declare class UISerializableAllTimePnlData extends UISerializableRollingPnlData {
|
|
651
|
+
spotPnlQuote: BigNum;
|
|
652
|
+
spotPnlPct: BigNum;
|
|
653
|
+
perpPnlQuote: BigNum;
|
|
654
|
+
perpPnlPct: BigNum;
|
|
655
|
+
totalPnlQuote: BigNum;
|
|
656
|
+
totalPnlPct: BigNum;
|
|
657
|
+
epochTs: number;
|
|
658
|
+
}
|
|
659
|
+
export declare class UIMatchedOrderRecordAndAction {
|
|
660
|
+
orderRecord: UISerializableOrderRecord;
|
|
661
|
+
actionRecord: UISerializableOrderActionRecord;
|
|
662
|
+
}
|
|
663
|
+
declare class SerializablePnlDataPoint implements PnlHistoryDataPoint {
|
|
664
|
+
ts: number;
|
|
665
|
+
val: number;
|
|
666
|
+
}
|
|
667
|
+
declare class SerializableLeaderBoardResultRow implements LeaderBoardResultRow {
|
|
668
|
+
user: PublicKey;
|
|
669
|
+
authority: PublicKey;
|
|
670
|
+
resolution: SnapshotEpochResolution;
|
|
671
|
+
rollingValue: number;
|
|
672
|
+
subaccountId: number;
|
|
673
|
+
pnlHistoryPoints: SerializablePnlDataPoint[];
|
|
674
|
+
}
|
|
675
|
+
export declare class SerializableLeaderboardResult implements LeaderboardResult {
|
|
676
|
+
lastUpdateTs: number;
|
|
677
|
+
ordering: PnlSnapshotOrderOption;
|
|
678
|
+
results: SerializableLeaderBoardResultRow[];
|
|
679
|
+
}
|
|
680
|
+
declare class UISerializableLeaderBoardResultRow extends SerializableLeaderBoardResultRow {
|
|
681
|
+
}
|
|
682
|
+
export declare class UISerializableLeaderboardResult extends SerializableLeaderboardResult {
|
|
683
|
+
results: UISerializableLeaderBoardResultRow[];
|
|
684
|
+
}
|
|
685
|
+
export declare class SerializableNewUserRecord implements NewUserRecord {
|
|
686
|
+
txSig: string;
|
|
687
|
+
slot: number;
|
|
688
|
+
ts: BN;
|
|
689
|
+
userAuthority: PublicKey;
|
|
690
|
+
user: PublicKey;
|
|
691
|
+
userId: number;
|
|
692
|
+
name: number[];
|
|
693
|
+
referrer: PublicKey;
|
|
694
|
+
subAccountId: number;
|
|
695
|
+
}
|
|
696
|
+
export declare class SerializableAccountSnapshot implements AccountSnapshot {
|
|
697
|
+
authority: PublicKey;
|
|
698
|
+
user: PublicKey;
|
|
699
|
+
epochTs: number;
|
|
700
|
+
totalAccountValue: BN;
|
|
701
|
+
cumulativeDepositQuoteValue: BN;
|
|
702
|
+
cumulativeWithdrawalQuoteValue: BN;
|
|
703
|
+
allTimeTotalPnlPct: BN;
|
|
704
|
+
allTimeTotalPnl: BN;
|
|
705
|
+
cumulativeReferralReward: BN;
|
|
706
|
+
cumulativeReferralVolume: BN;
|
|
707
|
+
cumulativeReferralCount: number;
|
|
708
|
+
cumulativeSettledPerpPnl: BN;
|
|
709
|
+
}
|
|
710
|
+
export declare class UISerializableAccountSnapshot implements UIAccountSnapshot {
|
|
711
|
+
authority: PublicKey;
|
|
712
|
+
user: PublicKey;
|
|
713
|
+
epochTs: number;
|
|
714
|
+
totalAccountValue: BigNum;
|
|
715
|
+
cumulativeDepositQuoteValue: BigNum;
|
|
716
|
+
cumulativeWithdrawalQuoteValue: BigNum;
|
|
717
|
+
allTimeTotalPnlPct: BigNum;
|
|
718
|
+
allTimeTotalPnl: BigNum;
|
|
719
|
+
cumulativeReferralReward: BigNum;
|
|
720
|
+
cumulativeReferralVolume: BigNum;
|
|
721
|
+
cumulativeSettledPerpPnl: BigNum;
|
|
722
|
+
cumulativeReferralCount: number;
|
|
723
|
+
}
|
|
724
|
+
export declare class SerializableDlobOrder {
|
|
725
|
+
user: string;
|
|
726
|
+
order: UISerializableOrder;
|
|
727
|
+
}
|
|
728
|
+
export declare class SerializableDlobOracleInfo {
|
|
729
|
+
marketIndex: number;
|
|
730
|
+
price: BigNum;
|
|
731
|
+
slot: BN;
|
|
732
|
+
confidence: BN;
|
|
733
|
+
hasSufficientNumberOfDataPoints: boolean;
|
|
734
|
+
twap: BN;
|
|
735
|
+
twapConfidence: BN;
|
|
736
|
+
maxPrice?: BN;
|
|
737
|
+
}
|
|
738
|
+
export declare class SerializableDLOBState {
|
|
739
|
+
slot: number;
|
|
740
|
+
oracles: SerializableDlobOracleInfo[];
|
|
741
|
+
orders: SerializableDlobOrder[];
|
|
742
|
+
}
|
|
743
|
+
export declare class CompetitionResultEntry {
|
|
744
|
+
wallet: PublicKey;
|
|
745
|
+
value: number;
|
|
746
|
+
rank: number;
|
|
747
|
+
metadata?: any;
|
|
748
|
+
}
|
|
749
|
+
export declare class CompetitionResult {
|
|
750
|
+
competitionName: string;
|
|
751
|
+
lastUpdate: string;
|
|
752
|
+
lastUpdateTs: number;
|
|
753
|
+
startTs: number;
|
|
754
|
+
endTs: number;
|
|
755
|
+
results: CompetitionResultEntry[];
|
|
756
|
+
requestedAuthorityResult?: CompetitionResultEntry;
|
|
757
|
+
}
|
|
758
|
+
export type InsuranceFundRecordEvent = Event<InsuranceFundRecord>;
|
|
759
|
+
export declare class SerializableInsuranceFundRecord implements InsuranceFundRecordEvent {
|
|
760
|
+
ts: BN;
|
|
761
|
+
txSig: string;
|
|
762
|
+
txSigIndex: number;
|
|
763
|
+
slot: number;
|
|
764
|
+
spotMarketIndex: number;
|
|
765
|
+
perpMarketIndex: number;
|
|
766
|
+
userIfFactor: number;
|
|
767
|
+
totalIfFactor: number;
|
|
768
|
+
vaultAmountBefore: BN;
|
|
769
|
+
insuranceVaultAmountBefore: BN;
|
|
770
|
+
totalIfSharesBefore: BN;
|
|
771
|
+
totalIfSharesAfter: BN;
|
|
772
|
+
amount: BN;
|
|
773
|
+
}
|
|
774
|
+
export declare class UISerializableInsuranceFundRecord extends SerializableInsuranceFundRecord {
|
|
775
|
+
vaultAmountBefore: BigNum;
|
|
776
|
+
insuranceVaultAmountBefore: BigNum;
|
|
777
|
+
totalIfSharesBefore: BigNum;
|
|
778
|
+
totalIfSharesAfter: BigNum;
|
|
779
|
+
amount: BigNum;
|
|
780
|
+
static onDeserialized(_data: JsonObject, instance: UISerializableInsuranceFundRecord): void;
|
|
781
|
+
}
|
|
782
|
+
export type InsuranceFundStakeRecordEvent = Event<InsuranceFundStakeRecord>;
|
|
783
|
+
export declare class SerializableInsuranceFundStakeRecord implements InsuranceFundStakeRecordEvent {
|
|
784
|
+
ts: BN;
|
|
785
|
+
txSig: string;
|
|
786
|
+
txSigIndex: number;
|
|
787
|
+
slot: number;
|
|
788
|
+
userAuthority: PublicKey;
|
|
789
|
+
action: StakeAction;
|
|
790
|
+
amount: BN;
|
|
791
|
+
marketIndex: number;
|
|
792
|
+
insuranceVaultAmountBefore: BN;
|
|
793
|
+
ifSharesBefore: BN;
|
|
794
|
+
userIfSharesBefore: BN;
|
|
795
|
+
totalIfSharesBefore: BN;
|
|
796
|
+
ifSharesAfter: BN;
|
|
797
|
+
userIfSharesAfter: BN;
|
|
798
|
+
totalIfSharesAfter: BN;
|
|
799
|
+
}
|
|
800
|
+
export declare class UISerializableInsuranceFundStakeRecord extends SerializableInsuranceFundStakeRecord {
|
|
801
|
+
amount: BigNum;
|
|
802
|
+
insuranceVaultAmountBefore: BigNum;
|
|
803
|
+
ifSharesBefore: BigNum;
|
|
804
|
+
userIfSharesBefore: BigNum;
|
|
805
|
+
totalIfSharesBefore: BigNum;
|
|
806
|
+
ifSharesAfter: BigNum;
|
|
807
|
+
userIfSharesAfter: BigNum;
|
|
808
|
+
totalIfSharesAfter: BigNum;
|
|
809
|
+
static onDeserialized(data: JsonObject, instance: UISerializableInsuranceFundStakeRecord): void;
|
|
810
|
+
}
|
|
811
|
+
export type LPRecordEvent = Event<LPRecord>;
|
|
812
|
+
export declare class SerializableLPRecord implements LPRecordEvent {
|
|
813
|
+
ts: BN;
|
|
814
|
+
txSig: string;
|
|
815
|
+
txSigIndex: number;
|
|
816
|
+
slot: number;
|
|
817
|
+
user: PublicKey;
|
|
818
|
+
action: LPAction;
|
|
819
|
+
nShares: BN;
|
|
820
|
+
marketIndex: number;
|
|
821
|
+
deltaBaseAssetAmount: BN;
|
|
822
|
+
deltaQuoteAssetAmount: BN;
|
|
823
|
+
pnl: BN;
|
|
824
|
+
}
|
|
825
|
+
export declare class UISerializableLPRecord extends SerializableLPRecord {
|
|
826
|
+
nShares: BigNum;
|
|
827
|
+
deltaBaseAssetAmount: BigNum;
|
|
828
|
+
deltaQuoteAssetAmount: BigNum;
|
|
829
|
+
pnl: BigNum;
|
|
830
|
+
}
|
|
831
|
+
export type SwapRecordEvent = Event<SwapRecord>;
|
|
832
|
+
export declare class SerializableSwapRecord implements SwapRecordEvent {
|
|
833
|
+
id: number;
|
|
834
|
+
txSig: string;
|
|
835
|
+
txSigIndex: number;
|
|
836
|
+
slot: number;
|
|
837
|
+
ts: BN;
|
|
838
|
+
user: PublicKey;
|
|
839
|
+
amountOut: BN;
|
|
840
|
+
amountIn: BN;
|
|
841
|
+
outMarketIndex: number;
|
|
842
|
+
inMarketIndex: number;
|
|
843
|
+
outOraclePrice: BN;
|
|
844
|
+
inOraclePrice: BN;
|
|
845
|
+
fee: BN;
|
|
846
|
+
}
|
|
847
|
+
export declare class UISerializableSwapRecord extends SerializableSwapRecord {
|
|
848
|
+
amountOut: BigNum;
|
|
849
|
+
amountIn: BigNum;
|
|
850
|
+
outOraclePrice: BigNum;
|
|
851
|
+
inOraclePrice: BigNum;
|
|
852
|
+
fee: BigNum;
|
|
853
|
+
static onDeserialized(_data: JsonObject, instance: UISerializableSwapRecord): void;
|
|
854
|
+
}
|
|
855
|
+
export declare function transformDataApiOrderRecordToUISerializableOrderRecord(v2Record: JsonObject): UISerializableOrderRecord;
|
|
856
|
+
export declare function transformDataApiOrderRecordToSerializableOrderRecord(v2Record: JsonObject): SerializableOrderRecord;
|
|
857
|
+
export declare function transformDataApiOrderActionRecordToUISerializableOrderActionRecord(v2Record: JsonObject): UISerializableOrderActionRecord;
|
|
858
|
+
export declare function transformDataApiPositionHistoryRecordToUISerializablePositionHistoryRecord(v2Record: JsonObject): UISerializablePositionHistoryRecord;
|
|
859
|
+
export declare function transformDataApiOrderActionRecordToSerializableOrderActionRecord(v2Record: JsonObject): SerializableOrderActionRecord;
|
|
860
|
+
export declare const Serializer: {
|
|
861
|
+
Serialize: {
|
|
862
|
+
Order: (cls: any) => JsonObject;
|
|
863
|
+
OrderRecord: (cls: any) => JsonObject;
|
|
864
|
+
Deposit: (cls: any) => JsonObject;
|
|
865
|
+
UIDeposit: (cls: any) => JsonObject;
|
|
866
|
+
FundingRate: (cls: any) => JsonObject;
|
|
867
|
+
UIFundingRate: (cls: any) => JsonObject;
|
|
868
|
+
FundingPayment: (cls: any) => JsonObject;
|
|
869
|
+
UIFundingPayment: (cls: any) => JsonObject;
|
|
870
|
+
Liquidation: (cls: any) => JsonObject;
|
|
871
|
+
UILiquidation: (cls: any) => JsonObject;
|
|
872
|
+
UILiquidationV2: (cls: any) => JsonObject;
|
|
873
|
+
SettlePnl: (cls: any) => JsonObject;
|
|
874
|
+
UISettlePnl: (cls: any) => JsonObject;
|
|
875
|
+
UIOrderRecord: (cls: any) => JsonObject;
|
|
876
|
+
UIOrderRecordV2: (cls: any) => JsonObject;
|
|
877
|
+
UIOrderActionRecordV2: (cls: any) => JsonObject;
|
|
878
|
+
SpotInterestRecord: (cls: any) => JsonObject;
|
|
879
|
+
CurveRecord: (cls: any) => JsonObject;
|
|
880
|
+
Candle: (cls: any) => JsonObject;
|
|
881
|
+
UICandle: (cls: any) => JsonObject;
|
|
882
|
+
UIOrderActionRecord: (cls: any) => JsonObject;
|
|
883
|
+
UIMatchedOrderAction: (cls: any) => JsonObject;
|
|
884
|
+
OrderActionRecord: (cls: any) => JsonObject;
|
|
885
|
+
UserSnapshot: (cls: any) => JsonObject;
|
|
886
|
+
UIUserSnapshot: (cls: any) => JsonObject;
|
|
887
|
+
UserSnapshotPerpPositions: (cls: any) => JsonObject;
|
|
888
|
+
UserSnapshotSpotPositions: (cls: any) => JsonObject;
|
|
889
|
+
LeaderboardResult: (cls: any) => JsonObject;
|
|
890
|
+
AccountSnapshotHistory: (cls: any) => JsonObject;
|
|
891
|
+
NewUser: (cls: any) => JsonObject;
|
|
892
|
+
DLOBState: (cls: any) => JsonObject;
|
|
893
|
+
CompetitionResult: (cls: any) => JsonObject;
|
|
894
|
+
CompetitionResultEntry: (cls: any) => JsonObject;
|
|
895
|
+
InsuranceFundRecord: (cls: any) => JsonObject;
|
|
896
|
+
UIInsuranceFundRecord: (cls: any) => JsonObject;
|
|
897
|
+
InsuranceFundStakeRecord: (cls: any) => JsonObject;
|
|
898
|
+
UIInsuranceFundStakeRecord: (cls: any) => JsonObject;
|
|
899
|
+
AllTimePnlData: (cls: any) => JsonObject;
|
|
900
|
+
UIAllTimePnlData: (cls: any) => JsonObject;
|
|
901
|
+
LPRecord: (cls: any) => JsonObject;
|
|
902
|
+
UILPRecord: (cls: any) => JsonObject;
|
|
903
|
+
SwapRecord: (cls: any) => JsonObject;
|
|
904
|
+
UISwapRecord: (cls: any) => JsonObject;
|
|
905
|
+
};
|
|
906
|
+
Deserialize: {
|
|
907
|
+
Order: (cls: JsonObject) => Order;
|
|
908
|
+
OrderRecord: (cls: JsonObject) => OrderRecordEvent;
|
|
909
|
+
UIOrder: (cls: JsonObject) => UISerializableOrder;
|
|
910
|
+
UIOrderRecord: (cls: JsonObject) => UISerializableOrderRecord;
|
|
911
|
+
UIOrderRecordV2: (cls: JsonObject) => UISerializableOrderRecordV2;
|
|
912
|
+
DataApiOrderRecord: (cls: JsonObject) => SerializableOrderRecord;
|
|
913
|
+
DataApiUIOrderRecord: (cls: JsonObject) => UISerializableOrderRecord;
|
|
914
|
+
UIOrderActionRecordV2: (cls: JsonObject) => UISerializableOrderActionRecordV2;
|
|
915
|
+
DataApiOrderActionRecord: (cls: JsonObject) => SerializableOrderActionRecord;
|
|
916
|
+
DataApiUIOrderActionRecord: (cls: JsonObject) => UISerializableOrderActionRecord;
|
|
917
|
+
DataApiUISerializablePositionHistoryRecord: (cls: JsonObject) => UISerializablePositionHistoryRecord;
|
|
918
|
+
Deposit: (cls: JsonObject) => DepositRecordEvent;
|
|
919
|
+
UIDeposit: (cls: JsonObject) => UISerializableDepositRecord;
|
|
920
|
+
FundingRate: (cls: JsonObject) => FundingRateRecordEvent;
|
|
921
|
+
UIFundingRate: (cls: JsonObject) => UISerializableFundingRateRecord;
|
|
922
|
+
FundingPayment: (cls: JsonObject) => FundingPaymentRecordEvent;
|
|
923
|
+
UIFundingPayment: (cls: JsonObject) => UISerializableFundingPaymentRecord;
|
|
924
|
+
Liquidation: (cls: JsonObject) => LiquidationRecordEvent;
|
|
925
|
+
UILiquidation: (cls: JsonObject) => UISerializableLiquidationRecord;
|
|
926
|
+
UILiquidationV2: (cls: JsonObject) => UISerializableLiquidationRecordV2;
|
|
927
|
+
SettlePnl: (cls: JsonObject) => SettlePnlRecordEvent;
|
|
928
|
+
SpotInterest: (cls: JsonObject) => SpotInterestRecordEvent;
|
|
929
|
+
CurveRecord: (cls: JsonObject) => SerializableCurveRecord;
|
|
930
|
+
UISettlePnl: (cls: JsonObject) => UISerializableSettlePnlRecord;
|
|
931
|
+
Candle: (cls: JsonObject) => SerializableCandle;
|
|
932
|
+
UICandle: (cls: JsonObject) => UISerializableCandle;
|
|
933
|
+
OrderActionRecord: (cls: JsonObject) => SerializableOrderActionRecord;
|
|
934
|
+
UIOrderActionRecord: (cls: JsonObject) => UISerializableOrderActionRecord;
|
|
935
|
+
UIMatchedOrderAction: (cls: JsonObject) => UIMatchedOrderRecordAndAction;
|
|
936
|
+
UserSnapshot: (cls: JsonObject) => SerializableUserSnapshotRecord;
|
|
937
|
+
UIUserSnapshot: (cls: JsonObject) => UISerializableUserSnapshotRecord;
|
|
938
|
+
UserSnapshotPerpPositions: (cls: JsonObject) => SerializableUserPerpPositionSnapshot;
|
|
939
|
+
UserSnapshotSpotPositions: (cls: JsonObject) => SerializableUserSpotPositionSnapshot;
|
|
940
|
+
LeaderboardResult: (cls: JsonObject) => SerializableLeaderboardResult;
|
|
941
|
+
UISerializableLeaderboardResult: (cls: JsonObject) => UISerializableLeaderboardResult;
|
|
942
|
+
UIAccountSnapshotHistory: (cls: JsonObject) => UISerializableAccountSnapshot;
|
|
943
|
+
NewUser: (cls: JsonObject) => SerializableNewUserRecord;
|
|
944
|
+
DLOBState: (cls: JsonObject) => SerializableDLOBState;
|
|
945
|
+
CompetitionResult: (cls: JsonObject) => CompetitionResult;
|
|
946
|
+
CompetitionResultEntry: (cls: JsonObject) => CompetitionResultEntry;
|
|
947
|
+
InsuranceFundRecord: (cls: JsonObject) => InsuranceFundRecordEvent;
|
|
948
|
+
UIInsuranceFundRecord: (cls: JsonObject) => UISerializableInsuranceFundRecord;
|
|
949
|
+
InsuranceFundStakeRecord: (cls: JsonObject) => InsuranceFundStakeRecordEvent;
|
|
950
|
+
UIInsuranceFundStakeRecord: (cls: JsonObject) => UISerializableInsuranceFundStakeRecord;
|
|
951
|
+
AllTimePnlData: (cls: JsonObject) => SerializableAllTimePnlData;
|
|
952
|
+
UIAllTimePnlData: (cls: JsonObject) => UISerializableAllTimePnlData;
|
|
953
|
+
LPRecord: (cls: JsonObject) => LPRecordEvent;
|
|
954
|
+
UILPRecord: (cls: JsonObject) => UISerializableLPRecord;
|
|
955
|
+
SwapRecord: (cls: JsonObject) => SwapRecordEvent;
|
|
956
|
+
UISwapRecord: (cls: JsonObject) => UISerializableSwapRecord;
|
|
957
|
+
};
|
|
958
|
+
setDeserializeFromSnakeCase: () => void;
|
|
959
|
+
setSerializeFromSnakeCase: () => void;
|
|
960
|
+
};
|
|
961
|
+
export {};
|