@katanaperps/katana-perps-sdk 0.0.0-placeholder
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/.nvmrc +1 -0
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/abis/ERC20.json +288 -0
- package/dist/abis/EarningsEscrow.json +468 -0
- package/dist/abis/Exchange_v1.json +3644 -0
- package/dist/abis/IOFT.json +447 -0
- package/dist/bridge/config.d.ts +262 -0
- package/dist/bridge/config.d.ts.map +1 -0
- package/dist/bridge/config.js +221 -0
- package/dist/bridge/deposit.d.ts +107 -0
- package/dist/bridge/deposit.d.ts.map +1 -0
- package/dist/bridge/deposit.js +284 -0
- package/dist/bridge/index.d.ts +5 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +7 -0
- package/dist/bridge/utils.d.ts +140 -0
- package/dist/bridge/utils.d.ts.map +1 -0
- package/dist/bridge/utils.js +66 -0
- package/dist/bridge/withdraw.d.ts +42 -0
- package/dist/bridge/withdraw.d.ts.map +1 -0
- package/dist/bridge/withdraw.js +86 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +6 -0
- package/dist/client/orderBook/index.d.ts +2 -0
- package/dist/client/orderBook/index.d.ts.map +1 -0
- package/dist/client/orderBook/index.js +4 -0
- package/dist/client/orderBook/realTime.d.ts +180 -0
- package/dist/client/orderBook/realTime.d.ts.map +1 -0
- package/dist/client/orderBook/realTime.js +344 -0
- package/dist/client/orderBook/utils.d.ts +15 -0
- package/dist/client/orderBook/utils.d.ts.map +1 -0
- package/dist/client/orderBook/utils.js +77 -0
- package/dist/client/rest/authenticated.d.ts +1199 -0
- package/dist/client/rest/authenticated.d.ts.map +1 -0
- package/dist/client/rest/authenticated.js +1311 -0
- package/dist/client/rest/index.d.ts +3 -0
- package/dist/client/rest/index.d.ts.map +1 -0
- package/dist/client/rest/index.js +5 -0
- package/dist/client/rest/public.d.ts +436 -0
- package/dist/client/rest/public.d.ts.map +1 -0
- package/dist/client/rest/public.js +502 -0
- package/dist/client/webSocket/guards.d.ts +15 -0
- package/dist/client/webSocket/guards.d.ts.map +1 -0
- package/dist/client/webSocket/guards.js +37 -0
- package/dist/client/webSocket/index.d.ts +632 -0
- package/dist/client/webSocket/index.d.ts.map +1 -0
- package/dist/client/webSocket/index.js +1048 -0
- package/dist/client/webSocket/transform.d.ts +3 -0
- package/dist/client/webSocket/transform.d.ts.map +1 -0
- package/dist/client/webSocket/transform.js +244 -0
- package/dist/constants.d.ts +34 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +38 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/orderbook/apiConversions.d.ts +8 -0
- package/dist/orderbook/apiConversions.d.ts.map +1 -0
- package/dist/orderbook/apiConversions.js +100 -0
- package/dist/orderbook/demo.d.ts +2 -0
- package/dist/orderbook/demo.d.ts.map +1 -0
- package/dist/orderbook/demo.js +68 -0
- package/dist/orderbook/index.d.ts +3 -0
- package/dist/orderbook/index.d.ts.map +1 -0
- package/dist/orderbook/index.js +5 -0
- package/dist/orderbook/quantities.d.ts +112 -0
- package/dist/orderbook/quantities.d.ts.map +1 -0
- package/dist/orderbook/quantities.js +257 -0
- package/dist/orderbook/utils.d.ts +8 -0
- package/dist/orderbook/utils.d.ts.map +1 -0
- package/dist/orderbook/utils.js +28 -0
- package/dist/pipmath.d.ts +21 -0
- package/dist/pipmath.d.ts.map +1 -0
- package/dist/pipmath.js +110 -0
- package/dist/signatures.d.ts +37 -0
- package/dist/signatures.d.ts.map +1 -0
- package/dist/signatures.js +450 -0
- package/dist/tests/orderbook/quantities/calculateInitialMarginFractionWithOverride.test.d.ts +2 -0
- package/dist/tests/orderbook/quantities/calculateInitialMarginFractionWithOverride.test.d.ts.map +1 -0
- package/dist/tests/orderbook/quantities/calculateInitialMarginFractionWithOverride.test.js +49 -0
- package/dist/tests/orderbook/quantities/calculateMaximumInitialMarginFractionOverride.test.d.ts +2 -0
- package/dist/tests/orderbook/quantities/calculateMaximumInitialMarginFractionOverride.test.d.ts.map +1 -0
- package/dist/tests/orderbook/quantities/calculateMaximumInitialMarginFractionOverride.test.js +122 -0
- package/dist/tests/orderbook/quantities/determineMaximumReduceOnlyQuantityAvailableAtPriceLevel.test.d.ts +2 -0
- package/dist/tests/orderbook/quantities/determineMaximumReduceOnlyQuantityAvailableAtPriceLevel.test.d.ts.map +1 -0
- package/dist/tests/orderbook/quantities/determineMaximumReduceOnlyQuantityAvailableAtPriceLevel.test.js +138 -0
- package/dist/tests/orderbook/quantities.test.d.ts +2 -0
- package/dist/tests/orderbook/quantities.test.d.ts.map +1 -0
- package/dist/tests/orderbook/quantities.test.js +310 -0
- package/dist/tests/testHelpers.d.ts +2 -0
- package/dist/tests/testHelpers.d.ts.map +1 -0
- package/dist/tests/testHelpers.js +16 -0
- package/dist/tests/utils/deriveBaseURL.test.d.ts +2 -0
- package/dist/tests/utils/deriveBaseURL.test.d.ts.map +1 -0
- package/dist/tests/utils/deriveBaseURL.test.js +46 -0
- package/dist/typechain-types/ERC20.d.ts +170 -0
- package/dist/typechain-types/ERC20.d.ts.map +1 -0
- package/dist/typechain-types/ERC20.js +2 -0
- package/dist/typechain-types/EarningsEscrow.d.ts +210 -0
- package/dist/typechain-types/EarningsEscrow.d.ts.map +1 -0
- package/dist/typechain-types/EarningsEscrow.js +2 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter.d.ts +253 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter.d.ts.map +1 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter.js +2 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v2.d.ts +338 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v2.d.ts.map +1 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v2.js +2 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v3.d.ts +413 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v3.d.ts.map +1 -0
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v3.js +2 -0
- package/dist/typechain-types/Exchange_v1.d.ts +2172 -0
- package/dist/typechain-types/Exchange_v1.d.ts.map +1 -0
- package/dist/typechain-types/Exchange_v1.js +2 -0
- package/dist/typechain-types/Exchange_v2.d.ts +2148 -0
- package/dist/typechain-types/Exchange_v2.d.ts.map +1 -0
- package/dist/typechain-types/Exchange_v2.js +2 -0
- package/dist/typechain-types/FixedIncomeVaultProviderStateAggregator_v1.d.ts +148 -0
- package/dist/typechain-types/FixedIncomeVaultProviderStateAggregator_v1.d.ts.map +1 -0
- package/dist/typechain-types/FixedIncomeVaultProviderStateAggregator_v1.js +2 -0
- package/dist/typechain-types/FixedIncomeVaultProvider_v1.d.ts +1204 -0
- package/dist/typechain-types/FixedIncomeVaultProvider_v1.d.ts.map +1 -0
- package/dist/typechain-types/FixedIncomeVaultProvider_v1.js +2 -0
- package/dist/typechain-types/IOFT.d.ts +247 -0
- package/dist/typechain-types/IOFT.d.ts.map +1 -0
- package/dist/typechain-types/IOFT.js +2 -0
- package/dist/typechain-types/IRewardVault.d.ts +649 -0
- package/dist/typechain-types/IRewardVault.d.ts.map +1 -0
- package/dist/typechain-types/IRewardVault.js +2 -0
- package/dist/typechain-types/KumaOFTAdapterUSDC.d.ts +638 -0
- package/dist/typechain-types/KumaOFTAdapterUSDC.d.ts.map +1 -0
- package/dist/typechain-types/KumaOFTAdapterUSDC.js +2 -0
- package/dist/typechain-types/KumaOFTUSDC.d.ts +756 -0
- package/dist/typechain-types/KumaOFTUSDC.d.ts.map +1 -0
- package/dist/typechain-types/KumaOFTUSDC.js +2 -0
- package/dist/typechain-types/KumaStargateForwarder_v1.d.ts +252 -0
- package/dist/typechain-types/KumaStargateForwarder_v1.d.ts.map +1 -0
- package/dist/typechain-types/KumaStargateForwarder_v1.js +2 -0
- package/dist/typechain-types/KumaStargateForwarder_v2.d.ts +252 -0
- package/dist/typechain-types/KumaStargateForwarder_v2.d.ts.map +1 -0
- package/dist/typechain-types/KumaStargateForwarder_v2.js +2 -0
- package/dist/typechain-types/ProfitShareVaultProvider_v1.d.ts +1095 -0
- package/dist/typechain-types/ProfitShareVaultProvider_v1.d.ts.map +1 -0
- package/dist/typechain-types/ProfitShareVaultProvider_v1.js +2 -0
- package/dist/typechain-types/StargatePoolUSDC.d.ts +956 -0
- package/dist/typechain-types/StargatePoolUSDC.d.ts.map +1 -0
- package/dist/typechain-types/StargatePoolUSDC.js +2 -0
- package/dist/typechain-types/common.d.ts +51 -0
- package/dist/typechain-types/common.d.ts.map +1 -0
- package/dist/typechain-types/common.js +2 -0
- package/dist/typechain-types/factories/ERC20__factory.d.ts +226 -0
- package/dist/typechain-types/factories/ERC20__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/ERC20__factory.js +305 -0
- package/dist/typechain-types/factories/EarningsEscrow__factory.d.ts +370 -0
- package/dist/typechain-types/factories/EarningsEscrow__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/EarningsEscrow__factory.js +485 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter__factory.d.ts +359 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter__factory.js +471 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v2__factory.d.ts +419 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v2__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v2__factory.js +545 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v3__factory.d.ts +546 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v3__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v3__factory.js +710 -0
- package/dist/typechain-types/factories/Exchange_v1__factory.d.ts +2852 -0
- package/dist/typechain-types/factories/Exchange_v1__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/Exchange_v1__factory.js +3661 -0
- package/dist/typechain-types/factories/Exchange_v2__factory.d.ts +2832 -0
- package/dist/typechain-types/factories/Exchange_v2__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/Exchange_v2__factory.js +3636 -0
- package/dist/typechain-types/factories/FixedIncomeVaultProviderStateAggregator_v1__factory.d.ts +180 -0
- package/dist/typechain-types/factories/FixedIncomeVaultProviderStateAggregator_v1__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/FixedIncomeVaultProviderStateAggregator_v1__factory.js +246 -0
- package/dist/typechain-types/factories/FixedIncomeVaultProvider_v1__factory.d.ts +2092 -0
- package/dist/typechain-types/factories/FixedIncomeVaultProvider_v1__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/FixedIncomeVaultProvider_v1__factory.js +2702 -0
- package/dist/typechain-types/factories/IOFT__factory.d.ts +352 -0
- package/dist/typechain-types/factories/IOFT__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/IOFT__factory.js +464 -0
- package/dist/typechain-types/factories/IRewardVault__factory.d.ts +1019 -0
- package/dist/typechain-types/factories/IRewardVault__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/IRewardVault__factory.js +1311 -0
- package/dist/typechain-types/factories/KumaOFTAdapterUSDC__factory.d.ts +996 -0
- package/dist/typechain-types/factories/KumaOFTAdapterUSDC__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/KumaOFTAdapterUSDC__factory.js +1306 -0
- package/dist/typechain-types/factories/KumaOFTUSDC__factory.d.ts +1234 -0
- package/dist/typechain-types/factories/KumaOFTUSDC__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/KumaOFTUSDC__factory.js +1619 -0
- package/dist/typechain-types/factories/KumaStargateForwarder_v1__factory.d.ts +354 -0
- package/dist/typechain-types/factories/KumaStargateForwarder_v1__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/KumaStargateForwarder_v1__factory.js +464 -0
- package/dist/typechain-types/factories/KumaStargateForwarder_v2__factory.d.ts +370 -0
- package/dist/typechain-types/factories/KumaStargateForwarder_v2__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/KumaStargateForwarder_v2__factory.js +486 -0
- package/dist/typechain-types/factories/ProfitShareVaultProvider_v1__factory.d.ts +1914 -0
- package/dist/typechain-types/factories/ProfitShareVaultProvider_v1__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/ProfitShareVaultProvider_v1__factory.js +2475 -0
- package/dist/typechain-types/factories/StargatePoolUSDC__factory.d.ts +1557 -0
- package/dist/typechain-types/factories/StargatePoolUSDC__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/StargatePoolUSDC__factory.js +2019 -0
- package/dist/typechain-types/factories/index.d.ts +5 -0
- package/dist/typechain-types/factories/index.d.ts.map +1 -0
- package/dist/typechain-types/factories/index.js +13 -0
- package/dist/typechain-types/index.d.ts +10 -0
- package/dist/typechain-types/index.d.ts.map +1 -0
- package/dist/typechain-types/index.js +15 -0
- package/dist/types/delegatedKeys.d.ts +44 -0
- package/dist/types/delegatedKeys.d.ts.map +1 -0
- package/dist/types/delegatedKeys.js +2 -0
- package/dist/types/enums/index.d.ts +4 -0
- package/dist/types/enums/index.d.ts.map +1 -0
- package/dist/types/enums/index.js +6 -0
- package/dist/types/enums/request.d.ts +980 -0
- package/dist/types/enums/request.d.ts.map +1 -0
- package/dist/types/enums/request.js +906 -0
- package/dist/types/enums/response.d.ts +329 -0
- package/dist/types/enums/response.d.ts.map +1 -0
- package/dist/types/enums/response.js +296 -0
- package/dist/types/enums/signature.d.ts +118 -0
- package/dist/types/enums/signature.d.ts.map +1 -0
- package/dist/types/enums/signature.js +131 -0
- package/dist/types/errors.d.ts +5 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +2 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/orderBook.d.ts +72 -0
- package/dist/types/orderBook.d.ts.map +1 -0
- package/dist/types/orderBook.js +2 -0
- package/dist/types/rest/common/common.d.ts +118 -0
- package/dist/types/rest/common/common.d.ts.map +1 -0
- package/dist/types/rest/common/common.js +2 -0
- package/dist/types/rest/common/guards.d.ts +8 -0
- package/dist/types/rest/common/guards.d.ts.map +1 -0
- package/dist/types/rest/common/guards.js +14 -0
- package/dist/types/rest/endpoints/AssociateWallet.d.ts +40 -0
- package/dist/types/rest/endpoints/AssociateWallet.d.ts.map +1 -0
- package/dist/types/rest/endpoints/AssociateWallet.js +2 -0
- package/dist/types/rest/endpoints/CancelOrders.d.ts +134 -0
- package/dist/types/rest/endpoints/CancelOrders.d.ts.map +1 -0
- package/dist/types/rest/endpoints/CancelOrders.js +2 -0
- package/dist/types/rest/endpoints/CreateOrder.d.ts +401 -0
- package/dist/types/rest/endpoints/CreateOrder.d.ts.map +1 -0
- package/dist/types/rest/endpoints/CreateOrder.js +2 -0
- package/dist/types/rest/endpoints/GetAuthenticationToken.d.ts +39 -0
- package/dist/types/rest/endpoints/GetAuthenticationToken.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetAuthenticationToken.js +2 -0
- package/dist/types/rest/endpoints/GetCandles.d.ts +115 -0
- package/dist/types/rest/endpoints/GetCandles.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetCandles.js +2 -0
- package/dist/types/rest/endpoints/GetDeposits.d.ts +109 -0
- package/dist/types/rest/endpoints/GetDeposits.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetDeposits.js +2 -0
- package/dist/types/rest/endpoints/GetExchange.d.ts +78 -0
- package/dist/types/rest/endpoints/GetExchange.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetExchange.js +9 -0
- package/dist/types/rest/endpoints/GetFills.d.ts +178 -0
- package/dist/types/rest/endpoints/GetFills.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetFills.js +2 -0
- package/dist/types/rest/endpoints/GetFundingPayments.d.ts +52 -0
- package/dist/types/rest/endpoints/GetFundingPayments.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetFundingPayments.js +2 -0
- package/dist/types/rest/endpoints/GetFundingRates.d.ts +34 -0
- package/dist/types/rest/endpoints/GetFundingRates.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetFundingRates.js +2 -0
- package/dist/types/rest/endpoints/GetGasFees.d.ts +23 -0
- package/dist/types/rest/endpoints/GetGasFees.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetGasFees.js +2 -0
- package/dist/types/rest/endpoints/GetHistoricalPnL.d.ts +39 -0
- package/dist/types/rest/endpoints/GetHistoricalPnL.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetHistoricalPnL.js +2 -0
- package/dist/types/rest/endpoints/GetInitialMarginFractionOverride.d.ts +31 -0
- package/dist/types/rest/endpoints/GetInitialMarginFractionOverride.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetInitialMarginFractionOverride.js +2 -0
- package/dist/types/rest/endpoints/GetLiquidations.d.ts +52 -0
- package/dist/types/rest/endpoints/GetLiquidations.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetLiquidations.js +2 -0
- package/dist/types/rest/endpoints/GetMarketMakerRewardsEpochs.d.ts +534 -0
- package/dist/types/rest/endpoints/GetMarketMakerRewardsEpochs.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetMarketMakerRewardsEpochs.js +2 -0
- package/dist/types/rest/endpoints/GetMarkets.d.ts +161 -0
- package/dist/types/rest/endpoints/GetMarkets.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetMarkets.js +2 -0
- package/dist/types/rest/endpoints/GetOrderBook.d.ts +176 -0
- package/dist/types/rest/endpoints/GetOrderBook.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetOrderBook.js +2 -0
- package/dist/types/rest/endpoints/GetOrders.d.ts +188 -0
- package/dist/types/rest/endpoints/GetOrders.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetOrders.js +2 -0
- package/dist/types/rest/endpoints/GetPing.d.ts +8 -0
- package/dist/types/rest/endpoints/GetPing.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetPing.js +2 -0
- package/dist/types/rest/endpoints/GetPositions.d.ts +104 -0
- package/dist/types/rest/endpoints/GetPositions.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetPositions.js +2 -0
- package/dist/types/rest/endpoints/GetTickers.d.ts +129 -0
- package/dist/types/rest/endpoints/GetTickers.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetTickers.js +2 -0
- package/dist/types/rest/endpoints/GetTime.d.ts +14 -0
- package/dist/types/rest/endpoints/GetTime.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetTime.js +2 -0
- package/dist/types/rest/endpoints/GetTrades.d.ts +62 -0
- package/dist/types/rest/endpoints/GetTrades.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetTrades.js +2 -0
- package/dist/types/rest/endpoints/GetWallets.d.ts +121 -0
- package/dist/types/rest/endpoints/GetWallets.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetWallets.js +2 -0
- package/dist/types/rest/endpoints/GetWithdrawals.d.ts +98 -0
- package/dist/types/rest/endpoints/GetWithdrawals.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetWithdrawals.js +2 -0
- package/dist/types/rest/endpoints/GetWithdrawalsFromManagedAccount.d.ts +98 -0
- package/dist/types/rest/endpoints/GetWithdrawalsFromManagedAccount.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetWithdrawalsFromManagedAccount.js +2 -0
- package/dist/types/rest/endpoints/Payouts.d.ts +199 -0
- package/dist/types/rest/endpoints/Payouts.d.ts.map +1 -0
- package/dist/types/rest/endpoints/Payouts.js +2 -0
- package/dist/types/rest/endpoints/SetInitialMarginFractionOverride.d.ts +83 -0
- package/dist/types/rest/endpoints/SetInitialMarginFractionOverride.d.ts.map +1 -0
- package/dist/types/rest/endpoints/SetInitialMarginFractionOverride.js +2 -0
- package/dist/types/rest/endpoints/WithdrawFunds.d.ts +144 -0
- package/dist/types/rest/endpoints/WithdrawFunds.d.ts.map +1 -0
- package/dist/types/rest/endpoints/WithdrawFunds.js +2 -0
- package/dist/types/rest/endpoints/WithdrawFundsFromManagedAccountByQuantity.d.ts +161 -0
- package/dist/types/rest/endpoints/WithdrawFundsFromManagedAccountByQuantity.d.ts.map +1 -0
- package/dist/types/rest/endpoints/WithdrawFundsFromManagedAccountByQuantity.js +2 -0
- package/dist/types/rest/endpoints/WithdrawFundsFromManagedAccountByShares.d.ts +160 -0
- package/dist/types/rest/endpoints/WithdrawFundsFromManagedAccountByShares.d.ts.map +1 -0
- package/dist/types/rest/endpoints/WithdrawFundsFromManagedAccountByShares.js +2 -0
- package/dist/types/rest/endpoints/index.d.ts +33 -0
- package/dist/types/rest/endpoints/index.d.ts.map +1 -0
- package/dist/types/rest/endpoints/index.js +35 -0
- package/dist/types/rest/endpoints/internal.d.ts +329 -0
- package/dist/types/rest/endpoints/internal.d.ts.map +1 -0
- package/dist/types/rest/endpoints/internal.js +14 -0
- package/dist/types/rest/index.d.ts +4 -0
- package/dist/types/rest/index.d.ts.map +1 -0
- package/dist/types/rest/index.js +6 -0
- package/dist/types/swaps.d.ts +11 -0
- package/dist/types/swaps.d.ts.map +1 -0
- package/dist/types/swaps.js +2 -0
- package/dist/types/utils.d.ts +67 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +3 -0
- package/dist/types/webSocket/base.d.ts +83 -0
- package/dist/types/webSocket/base.d.ts.map +1 -0
- package/dist/types/webSocket/base.js +2 -0
- package/dist/types/webSocket/constants.d.ts +41 -0
- package/dist/types/webSocket/constants.d.ts.map +1 -0
- package/dist/types/webSocket/constants.js +54 -0
- package/dist/types/webSocket/index.d.ts +6 -0
- package/dist/types/webSocket/index.d.ts.map +1 -0
- package/dist/types/webSocket/index.js +8 -0
- package/dist/types/webSocket/options.d.ts +276 -0
- package/dist/types/webSocket/options.d.ts.map +1 -0
- package/dist/types/webSocket/options.js +2 -0
- package/dist/types/webSocket/request/index.d.ts +3 -0
- package/dist/types/webSocket/request/index.d.ts.map +1 -0
- package/dist/types/webSocket/request/index.js +5 -0
- package/dist/types/webSocket/request/request.d.ts +137 -0
- package/dist/types/webSocket/request/request.d.ts.map +1 -0
- package/dist/types/webSocket/request/request.js +2 -0
- package/dist/types/webSocket/request/subscriptions.d.ts +498 -0
- package/dist/types/webSocket/request/subscriptions.d.ts.map +1 -0
- package/dist/types/webSocket/request/subscriptions.js +2 -0
- package/dist/types/webSocket/response/candles.d.ts +138 -0
- package/dist/types/webSocket/response/candles.d.ts.map +1 -0
- package/dist/types/webSocket/response/candles.js +2 -0
- package/dist/types/webSocket/response/deposits.d.ts +80 -0
- package/dist/types/webSocket/response/deposits.d.ts.map +1 -0
- package/dist/types/webSocket/response/deposits.js +2 -0
- package/dist/types/webSocket/response/fundingPayments.d.ts +78 -0
- package/dist/types/webSocket/response/fundingPayments.d.ts.map +1 -0
- package/dist/types/webSocket/response/fundingPayments.js +2 -0
- package/dist/types/webSocket/response/index.d.ts +13 -0
- package/dist/types/webSocket/response/index.d.ts.map +1 -0
- package/dist/types/webSocket/response/index.js +15 -0
- package/dist/types/webSocket/response/liquidations.d.ts +78 -0
- package/dist/types/webSocket/response/liquidations.d.ts.map +1 -0
- package/dist/types/webSocket/response/liquidations.js +2 -0
- package/dist/types/webSocket/response/orderbook.d.ts +214 -0
- package/dist/types/webSocket/response/orderbook.d.ts.map +1 -0
- package/dist/types/webSocket/response/orderbook.js +2 -0
- package/dist/types/webSocket/response/orders.d.ts +355 -0
- package/dist/types/webSocket/response/orders.d.ts.map +1 -0
- package/dist/types/webSocket/response/orders.js +2 -0
- package/dist/types/webSocket/response/ordersFill.d.ts +138 -0
- package/dist/types/webSocket/response/ordersFill.d.ts.map +1 -0
- package/dist/types/webSocket/response/ordersFill.js +2 -0
- package/dist/types/webSocket/response/positions.d.ts +120 -0
- package/dist/types/webSocket/response/positions.d.ts.map +1 -0
- package/dist/types/webSocket/response/positions.js +2 -0
- package/dist/types/webSocket/response/tickers.d.ts +131 -0
- package/dist/types/webSocket/response/tickers.d.ts.map +1 -0
- package/dist/types/webSocket/response/tickers.js +2 -0
- package/dist/types/webSocket/response/trades.d.ts +90 -0
- package/dist/types/webSocket/response/trades.d.ts.map +1 -0
- package/dist/types/webSocket/response/trades.js +2 -0
- package/dist/types/webSocket/response/webclient/base.d.ts +24 -0
- package/dist/types/webSocket/response/webclient/base.d.ts.map +1 -0
- package/dist/types/webSocket/response/webclient/base.js +2 -0
- package/dist/types/webSocket/response/webclient/events/exchangeStatus.d.ts +31 -0
- package/dist/types/webSocket/response/webclient/events/exchangeStatus.d.ts.map +1 -0
- package/dist/types/webSocket/response/webclient/events/exchangeStatus.js +2 -0
- package/dist/types/webSocket/response/webclient/events/index.d.ts +4 -0
- package/dist/types/webSocket/response/webclient/events/index.d.ts.map +1 -0
- package/dist/types/webSocket/response/webclient/events/index.js +6 -0
- package/dist/types/webSocket/response/webclient/events/reloadBanners.d.ts +17 -0
- package/dist/types/webSocket/response/webclient/events/reloadBanners.d.ts.map +1 -0
- package/dist/types/webSocket/response/webclient/events/reloadBanners.js +2 -0
- package/dist/types/webSocket/response/webclient/events/transactionSettled.d.ts +76 -0
- package/dist/types/webSocket/response/webclient/events/transactionSettled.d.ts.map +1 -0
- package/dist/types/webSocket/response/webclient/events/transactionSettled.js +2 -0
- package/dist/types/webSocket/response/webclient/index.d.ts +3 -0
- package/dist/types/webSocket/response/webclient/index.d.ts.map +1 -0
- package/dist/types/webSocket/response/webclient/index.js +5 -0
- package/dist/types/webSocket/response/webclient/webclient.d.ts +13 -0
- package/dist/types/webSocket/response/webclient/webclient.d.ts.map +1 -0
- package/dist/types/webSocket/response/webclient/webclient.js +2 -0
- package/dist/types/webSocket/response/withdrawals.d.ts +83 -0
- package/dist/types/webSocket/response/withdrawals.d.ts.map +1 -0
- package/dist/types/webSocket/response/withdrawals.js +2 -0
- package/dist/utils.d.ts +63 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +136 -0
- package/package.json +200 -0
|
@@ -0,0 +1,980 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Can be used to easily provide the {@link _types.RestRequestGetCandles.interval interval} parameter
|
|
3
|
+
* in a get candles request.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import { RestPublicClient } from '@katanaperps/katana-perps-sdk';
|
|
8
|
+
*
|
|
9
|
+
* const publicClient = new RestPublicClient();
|
|
10
|
+
*
|
|
11
|
+
* const candles = await publicClient.getCandles({
|
|
12
|
+
* // always has an up-to-date enumeration of valid intervals
|
|
13
|
+
* // handled by the server.
|
|
14
|
+
* interval: CandleInterval.ONE_HOUR,
|
|
15
|
+
* market: 'ETH-USD',
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* <br />
|
|
20
|
+
*
|
|
21
|
+
* ---
|
|
22
|
+
*
|
|
23
|
+
* @see client {@link _types.RestPublicClient.getCandles RestPublicClient.getCandles}
|
|
24
|
+
* @see request {@link _types.RestRequestGetCandles RestRequestGetCandles}
|
|
25
|
+
* @see related {@link _types.KatanaPerpsCandle KatanaPerpsCandle}
|
|
26
|
+
*
|
|
27
|
+
* @category Enums - Request Parameters
|
|
28
|
+
* @category KatanaPerps - Get Candles
|
|
29
|
+
* @enum
|
|
30
|
+
*/
|
|
31
|
+
export declare const CandleInterval: Readonly<{
|
|
32
|
+
/**
|
|
33
|
+
* - Receives candles at an interval of 1 minute.
|
|
34
|
+
*/
|
|
35
|
+
readonly ONE_MINUTE: "1m";
|
|
36
|
+
/**
|
|
37
|
+
* - Receives candles at an interval of 5 minutes.
|
|
38
|
+
*/
|
|
39
|
+
readonly FIVE_MINUTES: "5m";
|
|
40
|
+
/**
|
|
41
|
+
* - Receives candles at an interval of 15 minutes.
|
|
42
|
+
*/
|
|
43
|
+
readonly FIFTEEN_MINUTES: "15m";
|
|
44
|
+
/**
|
|
45
|
+
* - Receives candles at an interval of 30 minutes.
|
|
46
|
+
*/
|
|
47
|
+
readonly THIRTY_MINUTES: "30m";
|
|
48
|
+
/**
|
|
49
|
+
* - Receives candles at an interval of 1 hour.
|
|
50
|
+
*/
|
|
51
|
+
readonly ONE_HOUR: "1h";
|
|
52
|
+
/**
|
|
53
|
+
* - Receives candles at an interval of 6 hours.
|
|
54
|
+
*/
|
|
55
|
+
readonly FOUR_HOURS: "4h";
|
|
56
|
+
/**
|
|
57
|
+
* - Receives candles at an interval of 1 day.
|
|
58
|
+
*/
|
|
59
|
+
readonly ONE_DAY: "1d";
|
|
60
|
+
}>;
|
|
61
|
+
export type CandleInterval = (typeof CandleInterval)[keyof typeof CandleInterval];
|
|
62
|
+
/**
|
|
63
|
+
* Time in force policies specify the behavior of a {@link _types.KatanaPerpsOrder limit order} upon execution.
|
|
64
|
+
*
|
|
65
|
+
* @see docs [Katana Perps API Documentation: Time in Force Explained](https://api-docs-v1-perps.katana.network/#time-in-force)
|
|
66
|
+
* @see request {@link _types.RestRequestOrderBase.timeInForce RestRequestOrder.timeInForce}
|
|
67
|
+
* > This enum is most useful when calling the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder}
|
|
68
|
+
* method to provide inline completion and documentation for the `timeInForce` parameter.
|
|
69
|
+
* @see related {@link _types.KatanaPerpsOrder KatanaPerpsOrder}
|
|
70
|
+
* > The `KatanaPerpsOrder` interface provides the shape for orders and are returned whenever an order is created or queried.
|
|
71
|
+
*
|
|
72
|
+
* @category Enums - Request Parameters
|
|
73
|
+
* @category KatanaPerps - Create Order
|
|
74
|
+
* @enum
|
|
75
|
+
*/
|
|
76
|
+
export declare const TimeInForce: Readonly<{
|
|
77
|
+
/**
|
|
78
|
+
* **Good Till Canceled (gtc)**
|
|
79
|
+
*
|
|
80
|
+
* - The `gtc` time in force policy keeps a limit order open until it is either filled or manually canceled by the trader.
|
|
81
|
+
* - This is the default behavior for limit orders if the {@link _types.RestRequestOrderBase.timeInForce timeInForce}
|
|
82
|
+
* parameter is not provided.
|
|
83
|
+
*
|
|
84
|
+
* ---
|
|
85
|
+
*
|
|
86
|
+
* **Characteristics:**
|
|
87
|
+
* - **Persistence**: A `gtc` order remains active on the order book until it is executed or canceled.
|
|
88
|
+
* - **Default Option**: If you do not specify a time in force, `gtc` is assumed.
|
|
89
|
+
*
|
|
90
|
+
* ---
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* import { TimeInForce, OrderType } from '@katanaperps/katana-perps-sdk';
|
|
95
|
+
*
|
|
96
|
+
* authenticatedClient.createOrder({
|
|
97
|
+
* type: OrderType.limit,
|
|
98
|
+
* timeInForce: TimeInForce.gtc,
|
|
99
|
+
* // ... other limit order parameters
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* @see docs [Katana Perps API Documentation: Time in Force Explained](https://api-docs-v1-perps.katana.network/#time-in-force)
|
|
104
|
+
*/
|
|
105
|
+
readonly gtc: "gtc";
|
|
106
|
+
/**
|
|
107
|
+
* **Good Til Crossing (gtx)**
|
|
108
|
+
*
|
|
109
|
+
* - The `gtx` time in force policy ensures that a limit order will only execute if it does not immediately match with an existing order.
|
|
110
|
+
* - This policy is used to guarantee that an order will only add liquidity to the market and not take liquidity away.
|
|
111
|
+
* - Applicable to all limit orders, `gtx` is particularly useful for traders who wish to avoid paying taker fees.
|
|
112
|
+
*
|
|
113
|
+
* ---
|
|
114
|
+
*
|
|
115
|
+
* **Characteristics:**
|
|
116
|
+
* - **Post-Only**: A `gtx` order is rejected if it would immediately match with an existing order upon submission.
|
|
117
|
+
* - **Liquidity Addition**: Ensures the order contributes liquidity, qualifying it for potential maker fee rebates.
|
|
118
|
+
*
|
|
119
|
+
* ---
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* import { TimeInForce, OrderType } from '@katanaperps/katana-perps-sdk';
|
|
124
|
+
*
|
|
125
|
+
* authenticatedClient.createOrder({
|
|
126
|
+
* type: OrderType.limit,
|
|
127
|
+
* timeInForce: TimeInForce.gtx,
|
|
128
|
+
* // ... other limit order parameters
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @see docs [Katana Perps API Documentation: Time in Force Explained](https://api-docs-v1-perps.katana.network/#time-in-force)
|
|
133
|
+
*/
|
|
134
|
+
readonly gtx: "gtx";
|
|
135
|
+
/**
|
|
136
|
+
* **Immediate Or Cancel (ioc)**
|
|
137
|
+
*
|
|
138
|
+
* - An `ioc` time in force policy is used for limit orders that should be executed immediately.
|
|
139
|
+
* - Any portion of the order that cannot be filled right away is canceled, ensuring no part of the order remains on the order book.
|
|
140
|
+
* - This policy is ideal for traders who prioritize speed of execution over full order fulfillment.
|
|
141
|
+
*
|
|
142
|
+
* ---
|
|
143
|
+
*
|
|
144
|
+
* **Characteristics:**
|
|
145
|
+
* - **Immediate Execution**: An `ioc` order attempts to fill immediately upon placement.
|
|
146
|
+
* - **Partial Fulfillment**: If the full order cannot be executed, the unfilled portion is immediately canceled.
|
|
147
|
+
* - **No Resting Orders**: `ioc` orders do not become resting orders on the book, preventing any residual market impact.
|
|
148
|
+
*
|
|
149
|
+
* ---
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* import { TimeInForce, OrderType } from '@katanaperps/katana-perps-sdk';
|
|
154
|
+
*
|
|
155
|
+
* authenticatedClient.createOrder({
|
|
156
|
+
* type: OrderType.limit,
|
|
157
|
+
* timeInForce: TimeInForce.ioc,
|
|
158
|
+
* // ... other limit order parameters
|
|
159
|
+
* });
|
|
160
|
+
* ```
|
|
161
|
+
*
|
|
162
|
+
* @see docs [Katana Perps API Documentation: Time in Force Explained](https://api-docs-v1-perps.katana.network/#time-in-force)
|
|
163
|
+
*/
|
|
164
|
+
readonly ioc: "ioc";
|
|
165
|
+
/**
|
|
166
|
+
* **Fill Or Kill (fok)**
|
|
167
|
+
*
|
|
168
|
+
* - The `fok` time in force policy requires that a limit order be filled in its entirety immediately upon placement or not at all.
|
|
169
|
+
* - This policy is used by traders who need a guarantee that their order will be executed as a single transaction at a known price.
|
|
170
|
+
* - `fok` orders are particularly useful for large orders that could be subject to price slippage if executed in smaller increments.
|
|
171
|
+
* - `fok` orders must specify the {@link SelfTradePrevention.cn | SelfTradePrevention.cn} (Cancel Newest)
|
|
172
|
+
* {@link _types.RestRequestOrderBase.selfTradePrevention selfTradePrevention} policy.
|
|
173
|
+
*
|
|
174
|
+
* ---
|
|
175
|
+
*
|
|
176
|
+
* **Characteristics:**
|
|
177
|
+
* - **All-or-Nothing**: A `fok` order must be completely filled with a single transaction or it is entirely canceled.
|
|
178
|
+
* - **Price Certainty**: Ensures that the order will execute at a single price point, providing full cost transparency.
|
|
179
|
+
* - **No Partial Fills**: Eliminates the possibility of partial order execution, which can be critical for certain trading strategies.
|
|
180
|
+
*
|
|
181
|
+
* ---
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* import { TimeInForce, OrderType } from '@katanaperps/katana-perps-sdk';
|
|
186
|
+
*
|
|
187
|
+
* authenticatedClient.createOrder({
|
|
188
|
+
* type: OrderType.limit,
|
|
189
|
+
* timeInForce: TimeInForce.fok,
|
|
190
|
+
* // ... other limit order parameters
|
|
191
|
+
* });
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* @see docs [Katana Perps API Documentation: Time in Force Explained](https://api-docs-v1-perps.katana.network/#time-in-force)
|
|
195
|
+
* @see enum {@link SelfTradePrevention}
|
|
196
|
+
* > `fok` time in force policy requires that the {@link _types.RestRequestOrderBase.selfTradePrevention selfTradePrevention}
|
|
197
|
+
* parameter is set to {@link SelfTradePrevention.cn} (Cancel Newest)
|
|
198
|
+
*/
|
|
199
|
+
readonly fok: "fok";
|
|
200
|
+
}>;
|
|
201
|
+
export type TimeInForce = (typeof TimeInForce)[keyof typeof TimeInForce];
|
|
202
|
+
/**
|
|
203
|
+
* Can be used as a convenience when specifying your orders to benefit from
|
|
204
|
+
* inline documentation and auto-complete.
|
|
205
|
+
*
|
|
206
|
+
* @see docs [API Documentation: Order Types](https://api-docs-v1-perps.katana.network/#order-types)
|
|
207
|
+
* @see request {@link _types.RestRequestOrderBase.type RestRequestOrder.type}
|
|
208
|
+
* @see related {@link _types.KatanaPerpsOrder KatanaPerpsOrder}
|
|
209
|
+
*
|
|
210
|
+
* @category Enums - Request Parameters
|
|
211
|
+
* @category KatanaPerps - Create Order
|
|
212
|
+
* @enum
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* const order = { type: OrderType.limit, ...rest }
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
export declare const OrderType: Readonly<{
|
|
220
|
+
/**
|
|
221
|
+
* A market order is an order to buy or sell a specified quantity of an asset at the best available current price.
|
|
222
|
+
*
|
|
223
|
+
* ---
|
|
224
|
+
*
|
|
225
|
+
* **Characteristics:**
|
|
226
|
+
* - A market order requires specifying the {@link _types.RestRequestOrderBase.quantity quantity} in base terms
|
|
227
|
+
* to be traded
|
|
228
|
+
* - **For market `buy` orders:**
|
|
229
|
+
* - The trade executes immediately for the specified `quantity` at the current best available sell price.
|
|
230
|
+
* - **For market `sell` orders:**
|
|
231
|
+
* - The trade executes immediately for the specified `quantity` at the current best available buy price.
|
|
232
|
+
* - Market orders prioritize speed of execution over price and are filled using the best available prices
|
|
233
|
+
* until the order `quantity` is met.
|
|
234
|
+
* - Since market orders are filled immediately, they always remove liquidity from the order book and are
|
|
235
|
+
* subject to taker fees.
|
|
236
|
+
* - Market orders do not enter the order book as they do not have a price specified and are executed at
|
|
237
|
+
* the current market rate.
|
|
238
|
+
*
|
|
239
|
+
* ---
|
|
240
|
+
*
|
|
241
|
+
* @see request {@link _types.RestRequestOrderTypeMarket RestRequestOrderTypeMarket}
|
|
242
|
+
* > The interface that provides the necessary request parameters to create a `market` order when calling
|
|
243
|
+
* the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder} method.
|
|
244
|
+
*/
|
|
245
|
+
readonly market: "market";
|
|
246
|
+
/**
|
|
247
|
+
* A limit order is an order to buy or sell a specified quantity of an asset at a price that is equal to or
|
|
248
|
+
* more favorable than a given threshold.
|
|
249
|
+
*
|
|
250
|
+
* ---
|
|
251
|
+
*
|
|
252
|
+
* **Characteristics:**
|
|
253
|
+
* - A limit order requires specifying the {@link _types.RestRequestOrderBase.quantity quantity}
|
|
254
|
+
* to be traded (in base terms) and the limit {@link _types.RestRequestOrderBase.price price}
|
|
255
|
+
* (in quote terms).
|
|
256
|
+
* - **For limit `buy` orders:**
|
|
257
|
+
* - The trade executes up to the specified `quantity`, provided the market price is at or below the provided limit `price`.
|
|
258
|
+
* - **For limit `sell` orders:**
|
|
259
|
+
* - The trade executes up to the specified `quantity`, provided the market price is at or above the limit `price`.
|
|
260
|
+
* - Limit orders that are priced to **cross the existing spread** execute immediately and remove liquidity from the order book
|
|
261
|
+
* - *(i.e. buy orders priced above the current lowest sell price, or sell orders priced below the current highest buy price)*
|
|
262
|
+
* - Any unfilled portion of a limit order enters the order book, adhering to the specified
|
|
263
|
+
* {@link _types.RestRequestOrderBase.timeInForce timeInForce} constraints and the maker trade minimum requirements as detailed
|
|
264
|
+
* in [Katana Perps API Documentation - Minimums](https://api-docs-v1-perps.katana.network/#minimums).
|
|
265
|
+
*
|
|
266
|
+
* ---
|
|
267
|
+
*
|
|
268
|
+
* @see request {@link _types.RestRequestOrderTypeLimit RestRequestOrderTypeLimit}
|
|
269
|
+
* > The interface that provides the necessary request parameters to create a `limit` order when calling
|
|
270
|
+
* the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder} method.
|
|
271
|
+
* @see enum {@link _types.TimeInForce TimeInForce}
|
|
272
|
+
* > An enum which can be used when defining the {@link _types.RestRequestOrderBase.timeInForce timeInForce}
|
|
273
|
+
* request parameter.
|
|
274
|
+
*/
|
|
275
|
+
readonly limit: "limit";
|
|
276
|
+
/**
|
|
277
|
+
* A stop-loss market order is an order to `buy` or `sell` a specified quantity of an asset when
|
|
278
|
+
* its price moves past a particular point, ensuring a higher probability of achieving a predetermined
|
|
279
|
+
* entry or exit price, limiting the traders loss or locking in a profit. Once the stop price is reached,
|
|
280
|
+
* the stop-loss order becomes a market order.
|
|
281
|
+
*
|
|
282
|
+
* ---
|
|
283
|
+
*
|
|
284
|
+
* **Characteristics:**
|
|
285
|
+
* - A `stopLossMarket` order requires specifying the following request parameters:
|
|
286
|
+
* - {@link _types.RestRequestOrderBase.quantity quantity} to be traded (in base terms)
|
|
287
|
+
* - the stop {@link _types.RestRequestOrderBase.triggerPrice triggerPrice} (in quote terms)
|
|
288
|
+
* - {@link _types.RestRequestOrderBase.triggerType triggerType} (enum: {@link _types.TriggerType TriggerType})
|
|
289
|
+
* which determines the price type for the provided `triggerPrice`.
|
|
290
|
+
* - **Activation:**
|
|
291
|
+
* - The order is not active and will not execute until the market price reaches the
|
|
292
|
+
* specified trigger price.
|
|
293
|
+
* - **Execution:**
|
|
294
|
+
* - Once activated, it executes as a market order at the current best available price.
|
|
295
|
+
* - **Purpose:**
|
|
296
|
+
* - This type of order is used to limit losses or protect profits in a position.
|
|
297
|
+
* - `stopLossMarket` orders are subject to slippage in fast-moving market conditions.
|
|
298
|
+
* - These orders do not guarantee an execution at or near the trigger price.
|
|
299
|
+
*
|
|
300
|
+
* ---
|
|
301
|
+
*
|
|
302
|
+
* @see request {@link _types.RestRequestOrderTypeStopLossMarket RestRequestOrderTypeStopLossMarket}
|
|
303
|
+
* > The interface that provides the necessary request parameters to create a `stopLossMarket` order when calling
|
|
304
|
+
* the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder} method, including trigger price and type.
|
|
305
|
+
* @see enum {@link _types.TriggerType TriggerType}
|
|
306
|
+
* > An enum that should be used when providing the {@link _types.RestRequestOrderBase.triggerType triggerType} parameter
|
|
307
|
+
* to provide inline IDE completion and documentation.
|
|
308
|
+
*/
|
|
309
|
+
readonly stopLossMarket: "stopLossMarket";
|
|
310
|
+
/**
|
|
311
|
+
* A `stopLossLimit` order is an order to `buy` or `sell` a specified quantity of an asset at a specified limit price,
|
|
312
|
+
* only after the asset's price has reached a specified stop price.
|
|
313
|
+
*
|
|
314
|
+
* - When the stop price is reached, the stop-loss order becomes a limit order to buy or sell at the limit price or better.
|
|
315
|
+
*
|
|
316
|
+
* ---
|
|
317
|
+
*
|
|
318
|
+
* **Characteristics:**
|
|
319
|
+
* - A `stopLossLimit` order requires specifying the following request parameters:
|
|
320
|
+
* - {@link _types.RestRequestOrderBase.quantity quantity} to be traded (in base terms)
|
|
321
|
+
* - the stop {@link _types.RestRequestOrderBase.triggerPrice triggerPrice}
|
|
322
|
+
* (in quote terms) at which the order is triggered
|
|
323
|
+
* - and the limit {@link _types.RestRequestOrderBase.price price} at which the order
|
|
324
|
+
* should execute.
|
|
325
|
+
* - {@link _types.RestRequestOrderBase.triggerType triggerType} (enum: {@link _types.TriggerType TriggerType})
|
|
326
|
+
* which determines the price type for the provided `triggerPrice`
|
|
327
|
+
* - **Activation:**
|
|
328
|
+
* - The order is not active and will not execute until the market price reaches the specified trigger price.
|
|
329
|
+
* - **Execution:**
|
|
330
|
+
* - Once activated, it becomes a limit order that will only execute at the specified limit price or better.
|
|
331
|
+
* - **Purpose:**
|
|
332
|
+
* - This type of order is used to limit losses or protect profits in a position while providing control over the price at which the order fills.
|
|
333
|
+
* - Stop-loss limit orders provide precision in execution price but are not guaranteed to execute if the market does not reach the limit price.
|
|
334
|
+
* - These orders can help prevent slippage by setting a specific limit price at which the order can execute.
|
|
335
|
+
*
|
|
336
|
+
* ---
|
|
337
|
+
*
|
|
338
|
+
* @see request {@link _types.RestRequestOrderTypeStopLossLimit RestRequestOrderTypeStopLossLimit}
|
|
339
|
+
* > The interface that provides the necessary request parameters to create a `stopLossLimit` order when calling
|
|
340
|
+
* the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder} method, including trigger price, type, and limit price.
|
|
341
|
+
* @see enum {@link _types.TriggerType TriggerType}
|
|
342
|
+
* > An enum that should be used when providing the {@link _types.RestRequestOrderBase.triggerType triggerType} parameter
|
|
343
|
+
* to provide inline IDE completion and documentation.
|
|
344
|
+
*/
|
|
345
|
+
readonly stopLossLimit: "stopLossLimit";
|
|
346
|
+
/**
|
|
347
|
+
* A `takeProfitMarket` order is an order to sell or buy a specified quantity of an asset when its price reaches a specified
|
|
348
|
+
* profit target, ensuring a profit can be realized. Once the take-profit price is reached, the take-profit order becomes a market order.
|
|
349
|
+
*
|
|
350
|
+
* ---
|
|
351
|
+
*
|
|
352
|
+
* **Characteristics:**
|
|
353
|
+
* - A `takeProfitMarket` order requires specifying the following request parameters:
|
|
354
|
+
* - {@link _types.RestRequestOrderBase.quantity quantity} to be traded (in base terms)
|
|
355
|
+
* - the take-profit {@link _types.RestRequestOrderBase.triggerPrice triggerPrice}
|
|
356
|
+
* (in quote terms) at which the order is triggered.
|
|
357
|
+
* - {@link _types.RestRequestOrderBase.triggerType triggerType} (enum: {@link _types.TriggerType TriggerType})
|
|
358
|
+
* which determines the price type for the provided `triggerPrice`
|
|
359
|
+
* - **Activation:**
|
|
360
|
+
* - The order is not active and will not execute until the market price reaches the specified trigger price.
|
|
361
|
+
* - **Execution:**
|
|
362
|
+
* - Once activated, it executes as a market order at the current best available price.
|
|
363
|
+
* - **Purpose:**
|
|
364
|
+
* - This type of order is used to lock in profits when the asset's price reaches a level that satisfies the trader's profit target.
|
|
365
|
+
* - `takeProfitMarket` orders are subject to slippage in fast-moving market conditions.
|
|
366
|
+
* - These orders do not guarantee an execution at or near the trigger price.
|
|
367
|
+
*
|
|
368
|
+
* ---
|
|
369
|
+
*
|
|
370
|
+
* @see request {@link _types.RestRequestOrderTypeTakeProfitMarket RestRequestOrderTypeTakeProfitMarket}
|
|
371
|
+
* > The interface that provides the necessary request parameters to create a `takeProfitMarket` order when calling
|
|
372
|
+
* the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder} method, including trigger price and type.
|
|
373
|
+
* @see enum {@link _types.TriggerType TriggerType}
|
|
374
|
+
* > An enum that should be used when providing the {@link _types.RestRequestOrderBase.triggerType triggerType} parameter
|
|
375
|
+
* to provide inline IDE completion and documentation.
|
|
376
|
+
*/
|
|
377
|
+
readonly takeProfitMarket: "takeProfitMarket";
|
|
378
|
+
/**
|
|
379
|
+
* A take-profit limit order is an order to sell or buy a specified quantity of an asset at a specified limit price,
|
|
380
|
+
* only after the asset's price has reached a specified profit target. When the take-profit price is reached, the take-profit order
|
|
381
|
+
* becomes a limit order to sell or buy at the limit price or better.
|
|
382
|
+
*
|
|
383
|
+
* ---
|
|
384
|
+
*
|
|
385
|
+
* **Characteristics:**
|
|
386
|
+
* - A take-profit limit order requires specifying the {@link _types.RestRequestOrderBase.quantity quantity}
|
|
387
|
+
* to be traded (in base terms), the take-profit {@link _types.RestRequestOrderBase.triggerPrice triggerPrice}
|
|
388
|
+
* (in quote terms) at which the order is triggered, and the limit {@link _types.RestRequestOrderBase.price price}
|
|
389
|
+
* at which the order should execute.
|
|
390
|
+
* - Additionally, the {@link _types.RestRequestOrderBase.triggerType triggerType} must be specified,
|
|
391
|
+
* indicating the price type for the trigger price (e.g., "last" or "index").
|
|
392
|
+
* - **Activation:**
|
|
393
|
+
* - The order is not active and will not execute until the market price reaches the specified trigger price.
|
|
394
|
+
* - **Execution:**
|
|
395
|
+
* - Once activated, it becomes a limit order that will only execute at the specified limit price or better.
|
|
396
|
+
* - **Purpose:**
|
|
397
|
+
* - This type of order is used to lock in profits when the asset's price reaches a level that satisfies the trader's profit target,
|
|
398
|
+
* while providing control over the price at which the order fills.
|
|
399
|
+
* - Take-profit limit orders provide precision in execution price but are not guaranteed to execute if the market does not reach the limit price.
|
|
400
|
+
* - These orders can help prevent slippage by setting a specific limit price at which the order can execute.
|
|
401
|
+
*
|
|
402
|
+
* ---
|
|
403
|
+
*
|
|
404
|
+
* @see request {@link _types.RestRequestOrderTypeTakeProfitLimit RestRequestOrderTypeTakeProfitLimit}
|
|
405
|
+
* > The interface that provides the necessary request parameters to create a `takeProfitLimit` order when calling
|
|
406
|
+
* the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder} method, including trigger price, type, and limit price.
|
|
407
|
+
* @see enum {@link _types.TriggerType TriggerType}
|
|
408
|
+
* > An enum that should be used when providing the {@link _types.RestRequestOrderBase.triggerType triggerType} parameter
|
|
409
|
+
* to provide inline IDE completion and documentation.
|
|
410
|
+
*/
|
|
411
|
+
readonly takeProfitLimit: "takeProfitLimit";
|
|
412
|
+
/**
|
|
413
|
+
* A `trailingStopMarket` order is an order that allows you to sell or buy at the market price once your asset has moved
|
|
414
|
+
* unfavorably by a specified distance (the trailing amount) from its peak price achieved after order placement.
|
|
415
|
+
*
|
|
416
|
+
* - It's designed to protect gains by enabling a trade to remain open and continue to profit as long as the price is moving
|
|
417
|
+
* in the favorable direction, but closes the trade if the price changes direction by a specified trailing amount.
|
|
418
|
+
*
|
|
419
|
+
* ---
|
|
420
|
+
*
|
|
421
|
+
* **Characteristics:**
|
|
422
|
+
* - A `trailingStopMarket` order requires specifying the following request parameters:
|
|
423
|
+
* - {@link _types.RestRequestOrderBase.quantity quantity} to be traded (in base terms)
|
|
424
|
+
* - the activation {@link _types.RestRequestOrderBase.triggerPrice triggerPrice}
|
|
425
|
+
* (in quote terms) at which the order is triggered.
|
|
426
|
+
* - {@link _types.RestRequestOrderBase.triggerType triggerType} (enum: {@link _types.TriggerType TriggerType})
|
|
427
|
+
* which determines the price type for the provided `triggerPrice`
|
|
428
|
+
* - (Coming Soon: `callbackRate`%, `conditionalOrderId` for added flexibility options)
|
|
429
|
+
* - **Activation:**
|
|
430
|
+
* - The order is active immediately upon placement, but the trigger price is dynamic and trails
|
|
431
|
+
* the peak price by the specified trailing amount.
|
|
432
|
+
* - **Execution:**
|
|
433
|
+
* - If the asset's price moves unfavorably by the trailing amount from its peak price, the order
|
|
434
|
+
* becomes a market order and executes at the current best available price.
|
|
435
|
+
* - **Purpose:**
|
|
436
|
+
* - This type of order is used to secure profits while maintaining a position that could potentially
|
|
437
|
+
* benefit from further price movement.
|
|
438
|
+
* - `trailingStopMarket` orders are subject to slippage in fast-moving market conditions.
|
|
439
|
+
* - These orders do not guarantee an execution at or near the trigger price once activated.
|
|
440
|
+
*
|
|
441
|
+
* ---
|
|
442
|
+
*
|
|
443
|
+
* @see request {@link _types.RestRequestOrderTypeTrailingStopMarket RestRequestOrderTypeTrailingStopMarket}
|
|
444
|
+
* > The interface that provides the necessary request parameters to create a `trailingStopMarket` order when calling
|
|
445
|
+
* the {@link _types.RestAuthenticatedClient.createOrder RestAuthenticatedClient.createOrder} method, including trailing amount and trigger type.
|
|
446
|
+
* @see enum {@link _types.TriggerType TriggerType}
|
|
447
|
+
* > An enum that should be used when providing the {@link _types.RestRequestOrderBase.triggerType triggerType} parameter
|
|
448
|
+
* to provide inline IDE completion and documentation.
|
|
449
|
+
*/
|
|
450
|
+
readonly trailingStopMarket: "trailingStopMarket";
|
|
451
|
+
}>;
|
|
452
|
+
export type OrderType = (typeof OrderType)[keyof typeof OrderType];
|
|
453
|
+
/**
|
|
454
|
+
* @internal
|
|
455
|
+
*/
|
|
456
|
+
export declare const OrderSubType: Readonly<{
|
|
457
|
+
conditional: "conditional";
|
|
458
|
+
}>;
|
|
459
|
+
/**
|
|
460
|
+
* @internal
|
|
461
|
+
*/
|
|
462
|
+
export type OrderSubType = (typeof OrderSubType)[keyof typeof OrderSubType];
|
|
463
|
+
/**
|
|
464
|
+
* @see request {@link _types.RestRequestOrderBase.side RestRequestOrder.side}
|
|
465
|
+
* @see related {@link _types.KatanaPerpsOrder KatanaPerpsOrder Interface}
|
|
466
|
+
* @see related {@link _types.KatanaPerpsFill KatanaPerpsFill Interface}
|
|
467
|
+
*
|
|
468
|
+
* @category Enums - Request Parameters
|
|
469
|
+
* @category KatanaPerps - Create Order
|
|
470
|
+
* @enum
|
|
471
|
+
*/
|
|
472
|
+
export declare const OrderSide: Readonly<{
|
|
473
|
+
readonly buy: "buy";
|
|
474
|
+
readonly sell: "sell";
|
|
475
|
+
}>;
|
|
476
|
+
export type OrderSide = (typeof OrderSide)[keyof typeof OrderSide];
|
|
477
|
+
/**
|
|
478
|
+
* Provides all available self-trade prevention policies in a way that provides inline documentation,
|
|
479
|
+
* auto-completion, and linking for easy type/code navigation.
|
|
480
|
+
*
|
|
481
|
+
* @see docs [API Documentation: Self-Trade Prevention](https://api-docs-v1-perps.katana.network/#self-trade-prevention)
|
|
482
|
+
* @see request {@link _types.RestRequestOrderBase.selfTradePrevention RestRequestOrder.selfTradePrevention}
|
|
483
|
+
* @see related {@link _types.KatanaPerpsOrder KatanaPerpsOrder}
|
|
484
|
+
*
|
|
485
|
+
* @category Enums - Request Parameters
|
|
486
|
+
* @category KatanaPerps - Create Order
|
|
487
|
+
* @enum
|
|
488
|
+
*/
|
|
489
|
+
export declare const SelfTradePrevention: Readonly<{
|
|
490
|
+
/**
|
|
491
|
+
* ### Decrement And Cancel (dc)
|
|
492
|
+
*
|
|
493
|
+
* - When two orders from the same user cross, the smaller order will
|
|
494
|
+
* be canceled and the larger order size will be decremented by the smaller order size.
|
|
495
|
+
* - If the two orders are the same size, both will be canceled.
|
|
496
|
+
*/
|
|
497
|
+
readonly dc: "dc";
|
|
498
|
+
/**
|
|
499
|
+
* ### Cancel Oldest (co)
|
|
500
|
+
*
|
|
501
|
+
* - Cancel the older (maker) order in full
|
|
502
|
+
*/
|
|
503
|
+
readonly co: "co";
|
|
504
|
+
/**
|
|
505
|
+
* ### Cancel Newest (cn)
|
|
506
|
+
*
|
|
507
|
+
* - Cancel the newer, taker order and leave the older, resting order on the
|
|
508
|
+
* order book.
|
|
509
|
+
* - This is the only valid option when {@link TimeInForce timeInForce} is set to {@link TimeInForce.fok TimeInForce.fok (Fill Or Kill)}
|
|
510
|
+
*/
|
|
511
|
+
readonly cn: "cn";
|
|
512
|
+
/**
|
|
513
|
+
* ### Cancel Both (cb)
|
|
514
|
+
*
|
|
515
|
+
* - Cancel both orders
|
|
516
|
+
*/
|
|
517
|
+
readonly cb: "cb";
|
|
518
|
+
}>;
|
|
519
|
+
export type SelfTradePrevention = (typeof SelfTradePrevention)[keyof typeof SelfTradePrevention];
|
|
520
|
+
/**
|
|
521
|
+
* The available payout programs to use for the payout program endpoints.
|
|
522
|
+
*
|
|
523
|
+
* @category Enums - Request Parameters
|
|
524
|
+
* @category KatanaPerps - Get Payouts
|
|
525
|
+
* @category KatanaPerps - Authorize Payout
|
|
526
|
+
* @enum
|
|
527
|
+
*/
|
|
528
|
+
export declare const PayoutProgram: Readonly<{
|
|
529
|
+
/**
|
|
530
|
+
* The rewards programs for points.
|
|
531
|
+
*/
|
|
532
|
+
readonly pointsRewards: "pointsRewards";
|
|
533
|
+
/**
|
|
534
|
+
* The rewards program for qualified Market Makers.
|
|
535
|
+
*/
|
|
536
|
+
readonly marketMakerRewards: "marketMakerRewards";
|
|
537
|
+
/**
|
|
538
|
+
* The rewards program for referrals.
|
|
539
|
+
*/
|
|
540
|
+
readonly referralRewards: "referralRewards";
|
|
541
|
+
/**
|
|
542
|
+
* The synthetic farms program
|
|
543
|
+
*/
|
|
544
|
+
readonly syntheticFarms: "syntheticFarms";
|
|
545
|
+
/**
|
|
546
|
+
* The trading competition program.
|
|
547
|
+
*/
|
|
548
|
+
readonly tradingCompetitions: "tradingCompetitions";
|
|
549
|
+
/**
|
|
550
|
+
* The Katana Perps Trading Rewards program.
|
|
551
|
+
*/
|
|
552
|
+
readonly tradingRewardsV2: "tradingRewardsV2";
|
|
553
|
+
}>;
|
|
554
|
+
export type PayoutProgram = (typeof PayoutProgram)[keyof typeof PayoutProgram];
|
|
555
|
+
/**
|
|
556
|
+
* Supported Bridge Targets
|
|
557
|
+
*
|
|
558
|
+
* @enum
|
|
559
|
+
*/
|
|
560
|
+
export declare const BridgeTarget: {
|
|
561
|
+
readonly KATANA_KATANA: "katana.katana";
|
|
562
|
+
readonly LAYERZERO_BERACHAIN: "stargate.berachain";
|
|
563
|
+
readonly STARGATE_ARBITRUM: "stargate.arbitrum";
|
|
564
|
+
readonly STARGATE_AURORA: "stargate.aurora";
|
|
565
|
+
readonly STARGATE_AVALANCHE: "stargate.avalanche";
|
|
566
|
+
readonly STARGATE_BASE: "stargate.base";
|
|
567
|
+
readonly STARGATE_BNB: "stargate.bnb";
|
|
568
|
+
readonly STARGATE_ETHEREUM: "stargate.ethereum";
|
|
569
|
+
readonly STARGATE_OPTIMISM: "stargate.optimism";
|
|
570
|
+
readonly STARGATE_RARI: "stargate.rari";
|
|
571
|
+
readonly STARGATE_SCROLL: "stargate.scroll";
|
|
572
|
+
readonly STARGATE_TAIKO: "stargate.taiko";
|
|
573
|
+
};
|
|
574
|
+
export type BridgeTarget = (typeof BridgeTarget)[keyof typeof BridgeTarget];
|
|
575
|
+
/**
|
|
576
|
+
* @internal
|
|
577
|
+
*
|
|
578
|
+
* All possible values for deposit bridgeSource.
|
|
579
|
+
*
|
|
580
|
+
* @enum
|
|
581
|
+
*/
|
|
582
|
+
export declare const DepositSource: {
|
|
583
|
+
readonly KATANA_REFERRAL_REWARD: "katana.referralReward";
|
|
584
|
+
readonly KATANA_WALLET_BANKROLL: "katana.walletBankroll";
|
|
585
|
+
readonly KATANA_KATANA: "katana.katana";
|
|
586
|
+
readonly LAYERZERO_BERACHAIN: "stargate.berachain";
|
|
587
|
+
readonly STARGATE_ARBITRUM: "stargate.arbitrum";
|
|
588
|
+
readonly STARGATE_AURORA: "stargate.aurora";
|
|
589
|
+
readonly STARGATE_AVALANCHE: "stargate.avalanche";
|
|
590
|
+
readonly STARGATE_BASE: "stargate.base";
|
|
591
|
+
readonly STARGATE_BNB: "stargate.bnb";
|
|
592
|
+
readonly STARGATE_ETHEREUM: "stargate.ethereum";
|
|
593
|
+
readonly STARGATE_OPTIMISM: "stargate.optimism";
|
|
594
|
+
readonly STARGATE_RARI: "stargate.rari";
|
|
595
|
+
readonly STARGATE_SCROLL: "stargate.scroll";
|
|
596
|
+
readonly STARGATE_TAIKO: "stargate.taiko";
|
|
597
|
+
};
|
|
598
|
+
export type DepositSource = (typeof DepositSource)[keyof typeof DepositSource];
|
|
599
|
+
/**
|
|
600
|
+
* An enumeration providing all possible events that the {@link OrderBookRealTimeClient} can emit.
|
|
601
|
+
*
|
|
602
|
+
* @enum
|
|
603
|
+
*
|
|
604
|
+
* @category Enums - Request Parameters
|
|
605
|
+
*/
|
|
606
|
+
export declare const OrderBookRealTimeClientEvent: {
|
|
607
|
+
/**
|
|
608
|
+
* Emitted when the client is ready to receive messages.
|
|
609
|
+
*/
|
|
610
|
+
readonly ready: "ready";
|
|
611
|
+
/**
|
|
612
|
+
* Emitted when the client connects to the WebSocket server.
|
|
613
|
+
*/
|
|
614
|
+
readonly connected: "connected";
|
|
615
|
+
/**
|
|
616
|
+
* Emitted when the client disconnects from the WebSocket server.
|
|
617
|
+
*/
|
|
618
|
+
readonly disconnected: "disconnected";
|
|
619
|
+
/**
|
|
620
|
+
* Emitted when the client receives an error from the WebSocket server.
|
|
621
|
+
*
|
|
622
|
+
* - Includes an {@link Error} argument with more details about the error
|
|
623
|
+
* that occurred.
|
|
624
|
+
*/
|
|
625
|
+
readonly error: "error";
|
|
626
|
+
/**
|
|
627
|
+
* Emitted when the orderbook requires a sync from the REST API due to
|
|
628
|
+
* thrashing or an unexpected sequence number.
|
|
629
|
+
*/
|
|
630
|
+
readonly sync: "sync";
|
|
631
|
+
/**
|
|
632
|
+
* Emitted when the client receives a message from the WebSocket server.
|
|
633
|
+
*
|
|
634
|
+
* - Includes the market string as an argument made to the handler
|
|
635
|
+
* so that the appropriate request can be made to
|
|
636
|
+
* {@link OrderBookRealTimeClient.getOrderBookL1}
|
|
637
|
+
*/
|
|
638
|
+
readonly l1: "l1";
|
|
639
|
+
/**
|
|
640
|
+
* Emitted when the client receives a message from the WebSocket server.
|
|
641
|
+
*
|
|
642
|
+
* - Includes the market string as an argument made to the handler
|
|
643
|
+
* so that the appropriate request can be made to
|
|
644
|
+
* {@link OrderBookRealTimeClient.getOrderBookL2}
|
|
645
|
+
*/
|
|
646
|
+
readonly l2: "l2";
|
|
647
|
+
};
|
|
648
|
+
export type OrderBookRealTimeClientEvent = (typeof OrderBookRealTimeClientEvent)[keyof typeof OrderBookRealTimeClientEvent];
|
|
649
|
+
/**
|
|
650
|
+
* All possible WebSocket Subscription Names that require authenticated
|
|
651
|
+
* WebSocket connections.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```typescript
|
|
655
|
+
* import {
|
|
656
|
+
* WebSocketClient,
|
|
657
|
+
* SubscriptionNameAuthenticated
|
|
658
|
+
* } from '@katanaperps/katana-perps-sdk';
|
|
659
|
+
*
|
|
660
|
+
* const client = new WebSocketClient({
|
|
661
|
+
* auth: {
|
|
662
|
+
* apiKey: '...',
|
|
663
|
+
* apiSecret: '...',
|
|
664
|
+
* wallet: '0x...'
|
|
665
|
+
* }
|
|
666
|
+
* })
|
|
667
|
+
*
|
|
668
|
+
* client.onMessage(message => {
|
|
669
|
+
* console.log('Received WebSocket Message: ', message)
|
|
670
|
+
* })
|
|
671
|
+
*
|
|
672
|
+
* await client.subscribeAuthenticated([
|
|
673
|
+
* { name: SubscriptionNameAuthenticated.positions },
|
|
674
|
+
* { name: SubscriptionNameAuthenticated.orders },
|
|
675
|
+
* ])
|
|
676
|
+
* ```
|
|
677
|
+
*
|
|
678
|
+
* <br />
|
|
679
|
+
*
|
|
680
|
+
* ---
|
|
681
|
+
*
|
|
682
|
+
* @see request {@link _types.WebSocketClient.subscribeAuthenticated WebSocketClient.subscribeAuthenticated}
|
|
683
|
+
* @see related {@link SubscriptionNamePublic}
|
|
684
|
+
*
|
|
685
|
+
* @category Enums - Request Parameters
|
|
686
|
+
* @category WebSocket - Subscribe
|
|
687
|
+
* @enum
|
|
688
|
+
*/
|
|
689
|
+
export declare const SubscriptionNameAuthenticated: {
|
|
690
|
+
/**
|
|
691
|
+
* **Subscription Update Events:**
|
|
692
|
+
*
|
|
693
|
+
* - Receives {@link _types.KatanaPerpsDepositEvent KatanaPerpsDepositEvent} WebSocket updates via
|
|
694
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
695
|
+
* - `event.data` will match {@link _types.KatanaPerpsDepositEventData KatanaPerpsDepositEventData}
|
|
696
|
+
*/
|
|
697
|
+
readonly deposits: "deposits";
|
|
698
|
+
/**
|
|
699
|
+
* **Subscription Update Events:**
|
|
700
|
+
*
|
|
701
|
+
* - Receives {@link _types.KatanaPerpsFundingPaymentEvent KatanaPerpsFundingPaymentEvent} WebSocket updates via
|
|
702
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
703
|
+
* - `event.data` will match {@link _types.KatanaPerpsFundingPaymentEventData KatanaPerpsFundingPaymentEventData}
|
|
704
|
+
*/
|
|
705
|
+
readonly fundingPayments: "fundingPayments";
|
|
706
|
+
/**
|
|
707
|
+
* **Subscription Update Events:**
|
|
708
|
+
*
|
|
709
|
+
* - Receives {@link _types.KatanaPerpsOrderEvent KatanaPerpsOrderEvent} WebSocket updates via
|
|
710
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
711
|
+
* - `event.data` will match {@link _types.KatanaPerpsOrderEventData KatanaPerpsOrderEventData}
|
|
712
|
+
*/
|
|
713
|
+
readonly orders: "orders";
|
|
714
|
+
/**
|
|
715
|
+
* **Subscription Update Events:**
|
|
716
|
+
*
|
|
717
|
+
* - Receives {@link _types.KatanaPerpsPositionEvent KatanaPerpsPositionEvent} WebSocket updates via
|
|
718
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
719
|
+
* - `event.data` will match {@link _types.KatanaPerpsPositionEventData KatanaPerpsPositionEventData}
|
|
720
|
+
*/
|
|
721
|
+
readonly positions: "positions";
|
|
722
|
+
/**
|
|
723
|
+
* **Subscription Update Events:**
|
|
724
|
+
*
|
|
725
|
+
* - Receives {@link _types.KatanaPerpsWithdrawalEvent KatanaPerpsWithdrawalEvent} WebSocket updates via
|
|
726
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
727
|
+
* - `event.data` will match {@link _types.KatanaPerpsWithdrawalEventData KatanaPerpsWithdrawalEventData}
|
|
728
|
+
*/
|
|
729
|
+
readonly withdrawals: "withdrawals";
|
|
730
|
+
/**
|
|
731
|
+
* @internal
|
|
732
|
+
*/
|
|
733
|
+
readonly webclient: "webclient";
|
|
734
|
+
};
|
|
735
|
+
export type SubscriptionNameAuthenticated = (typeof SubscriptionNameAuthenticated)[keyof typeof SubscriptionNameAuthenticated];
|
|
736
|
+
/**
|
|
737
|
+
* All possible WebSocket Subscription Names that require authenticated
|
|
738
|
+
* WebSocket connections.
|
|
739
|
+
*
|
|
740
|
+
* @example
|
|
741
|
+
* ```typescript
|
|
742
|
+
* import {
|
|
743
|
+
* WebSocketClient,
|
|
744
|
+
* SubscriptionNamePublic,
|
|
745
|
+
* CandleInterval
|
|
746
|
+
* } from '@katanaperps/katana-perps-sdk';
|
|
747
|
+
*
|
|
748
|
+
* const client = new WebSocketClient();
|
|
749
|
+
*
|
|
750
|
+
* client.onMessage(message => {
|
|
751
|
+
* console.log('Received WebSocket Message: ', message)
|
|
752
|
+
* })
|
|
753
|
+
*
|
|
754
|
+
* await client.subscribePublic([
|
|
755
|
+
* // will inherit markets from the markets array
|
|
756
|
+
* { name: SubscriptionNamePublic.tickers },
|
|
757
|
+
* ], ['ETH-USD'])
|
|
758
|
+
* ```
|
|
759
|
+
*
|
|
760
|
+
* <br />
|
|
761
|
+
*
|
|
762
|
+
* ---
|
|
763
|
+
*
|
|
764
|
+
* @see request {@link _types.WebSocketClient.subscribePublic WebSocketClient.subscribePublic}
|
|
765
|
+
* @see related {@link SubscriptionNameAuthenticated}
|
|
766
|
+
*
|
|
767
|
+
* @category Enums - Request Parameters
|
|
768
|
+
* @category WebSocket - Subscribe
|
|
769
|
+
* @enum
|
|
770
|
+
*/
|
|
771
|
+
export declare const SubscriptionNamePublic: Readonly<{
|
|
772
|
+
/**
|
|
773
|
+
* **Subscribe Requirements:**
|
|
774
|
+
*
|
|
775
|
+
* - Requires a `markets` array to subscribe to.
|
|
776
|
+
*
|
|
777
|
+
* **Subscription Update Events:**
|
|
778
|
+
*
|
|
779
|
+
* - Receives {@link _types.KatanaPerpsTickerEvent KatanaPerpsTickerEvent} WebSocket updates via the
|
|
780
|
+
* {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
781
|
+
* - `event.data` will match {@link _types.KatanaPerpsTickerEventData KatanaPerpsTickerEventData}
|
|
782
|
+
*/
|
|
783
|
+
readonly tickers: "tickers";
|
|
784
|
+
/**
|
|
785
|
+
* **Subscribe Requirements:**
|
|
786
|
+
*
|
|
787
|
+
* - Requires a `markets` array to subscribe to.
|
|
788
|
+
*
|
|
789
|
+
* **Subscription Update Events:**
|
|
790
|
+
*
|
|
791
|
+
* - Receives {@link _types.KatanaPerpsTradeEvent KatanaPerpsTradeEvent} WebSocket updates via the
|
|
792
|
+
* {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
793
|
+
* - `event.data` will match {@link _types.KatanaPerpsTradeEventData KatanaPerpsTradeEventData}
|
|
794
|
+
*/
|
|
795
|
+
readonly trades: "trades";
|
|
796
|
+
/**
|
|
797
|
+
* **Subscribe Requirements:**
|
|
798
|
+
*
|
|
799
|
+
* - Requires a `markets` array to subscribe to.
|
|
800
|
+
*
|
|
801
|
+
* **Subscription Update Events:**
|
|
802
|
+
*
|
|
803
|
+
* - Receives {@link _types.KatanaPerpsLiquidationEvent KatanaPerpsLiquidationEvent} WebSocket updates via the
|
|
804
|
+
* {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
805
|
+
* - `event.data` will match {@link _types.KatanaPerpsLiquidationEventData KatanaPerpsLiquidationEventData}
|
|
806
|
+
*/
|
|
807
|
+
readonly liquidations: "liquidations";
|
|
808
|
+
/**
|
|
809
|
+
* **Subscribe Requirements:**
|
|
810
|
+
*
|
|
811
|
+
* - Requires a `markets` array to subscribe to.
|
|
812
|
+
* - Requires a {@link _types.CandleInterval CandleInterval} property
|
|
813
|
+
*
|
|
814
|
+
* **Subscription Update Events:**
|
|
815
|
+
*
|
|
816
|
+
* - Receives {@link _types.KatanaPerpsCandleEvent KatanaPerpsCandleEvent} WebSocket updates via the
|
|
817
|
+
* {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
818
|
+
* - `event.data` will match {@link _types.KatanaPerpsCandleEventData KatanaPerpsCandleEventData}
|
|
819
|
+
*/
|
|
820
|
+
readonly candles: "candles";
|
|
821
|
+
/**
|
|
822
|
+
* **Subscribe Requirements:**
|
|
823
|
+
*
|
|
824
|
+
* - Requires a `markets` array to subscribe to.
|
|
825
|
+
*
|
|
826
|
+
* **Subscription Update Events:**
|
|
827
|
+
*
|
|
828
|
+
* - Receives {@link _types.KatanaPerpsOrderBookLevel1Event KatanaPerpsOrderBookLevel1Event} WebSocket updates via
|
|
829
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
830
|
+
* - `event.data` will match {@link _types.KatanaPerpsOrderBookLevel1EventData KatanaPerpsOrderBookLevel1EventData}
|
|
831
|
+
*/
|
|
832
|
+
readonly l1orderbook: "l1orderbook";
|
|
833
|
+
/**
|
|
834
|
+
* **Subscribe Requirements:**
|
|
835
|
+
*
|
|
836
|
+
* - Requires a `markets` array to subscribe to.
|
|
837
|
+
*
|
|
838
|
+
* **Subscription Update Events:**
|
|
839
|
+
*
|
|
840
|
+
* - Receives {@link _types.KatanaPerpsOrderBookLevel2Event KatanaPerpsOrderBookLevel2Event} WebSocket updates via
|
|
841
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
842
|
+
* - `event.data` will match {@link _types.KatanaPerpsOrderBookLevel2EventData KatanaPerpsOrderBookLevel2EventData}
|
|
843
|
+
*/
|
|
844
|
+
readonly l2orderbook: "l2orderbook";
|
|
845
|
+
/**
|
|
846
|
+
* @internal
|
|
847
|
+
*/
|
|
848
|
+
readonly webclient: "webclient";
|
|
849
|
+
}>;
|
|
850
|
+
export type SubscriptionNamePublic = (typeof SubscriptionNamePublic)[keyof typeof SubscriptionNamePublic];
|
|
851
|
+
/**
|
|
852
|
+
* A combination of {@link SubscriptionNameAuthenticated} and {@link SubscriptionNamePublic}
|
|
853
|
+
* provided as a convenience.
|
|
854
|
+
*
|
|
855
|
+
* - Generally using the separated enums is useful as it makes it obvious which subscriptions
|
|
856
|
+
* are accepted by the {@link _types.WebSocketClient.subscribeAuthenticated WebSocketClient.subscribeAuthenticated}
|
|
857
|
+
* and {@link _types.WebSocketClient.subscribePublic WebSocketClient.subscribePublic} methods.
|
|
858
|
+
*
|
|
859
|
+
* @see related {@link SubscriptionNameAuthenticated}
|
|
860
|
+
* @see related {@link SubscriptionNamePublic}
|
|
861
|
+
*
|
|
862
|
+
* @category Enums - Request Parameters
|
|
863
|
+
* @category WebSocket - Subscribe
|
|
864
|
+
* @enum
|
|
865
|
+
*/
|
|
866
|
+
export declare const SubscriptionName: {
|
|
867
|
+
/**
|
|
868
|
+
* **Subscription Update Events:**
|
|
869
|
+
*
|
|
870
|
+
* - Receives {@link _types.KatanaPerpsDepositEvent KatanaPerpsDepositEvent} WebSocket updates via
|
|
871
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
872
|
+
* - `event.data` will match {@link _types.KatanaPerpsDepositEventData KatanaPerpsDepositEventData}
|
|
873
|
+
*/
|
|
874
|
+
readonly deposits: "deposits";
|
|
875
|
+
/**
|
|
876
|
+
* **Subscription Update Events:**
|
|
877
|
+
*
|
|
878
|
+
* - Receives {@link _types.KatanaPerpsFundingPaymentEvent KatanaPerpsFundingPaymentEvent} WebSocket updates via
|
|
879
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
880
|
+
* - `event.data` will match {@link _types.KatanaPerpsFundingPaymentEventData KatanaPerpsFundingPaymentEventData}
|
|
881
|
+
*/
|
|
882
|
+
readonly fundingPayments: "fundingPayments";
|
|
883
|
+
/**
|
|
884
|
+
* **Subscription Update Events:**
|
|
885
|
+
*
|
|
886
|
+
* - Receives {@link _types.KatanaPerpsOrderEvent KatanaPerpsOrderEvent} WebSocket updates via
|
|
887
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
888
|
+
* - `event.data` will match {@link _types.KatanaPerpsOrderEventData KatanaPerpsOrderEventData}
|
|
889
|
+
*/
|
|
890
|
+
readonly orders: "orders";
|
|
891
|
+
/**
|
|
892
|
+
* **Subscription Update Events:**
|
|
893
|
+
*
|
|
894
|
+
* - Receives {@link _types.KatanaPerpsPositionEvent KatanaPerpsPositionEvent} WebSocket updates via
|
|
895
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
896
|
+
* - `event.data` will match {@link _types.KatanaPerpsPositionEventData KatanaPerpsPositionEventData}
|
|
897
|
+
*/
|
|
898
|
+
readonly positions: "positions";
|
|
899
|
+
/**
|
|
900
|
+
* **Subscription Update Events:**
|
|
901
|
+
*
|
|
902
|
+
* - Receives {@link _types.KatanaPerpsWithdrawalEvent KatanaPerpsWithdrawalEvent} WebSocket updates via
|
|
903
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
904
|
+
* - `event.data` will match {@link _types.KatanaPerpsWithdrawalEventData KatanaPerpsWithdrawalEventData}
|
|
905
|
+
*/
|
|
906
|
+
readonly withdrawals: "withdrawals";
|
|
907
|
+
/**
|
|
908
|
+
* @internal
|
|
909
|
+
*/
|
|
910
|
+
readonly webclient: "webclient";
|
|
911
|
+
readonly tickers: "tickers";
|
|
912
|
+
readonly trades: "trades";
|
|
913
|
+
readonly liquidations: "liquidations";
|
|
914
|
+
readonly candles: "candles";
|
|
915
|
+
readonly l1orderbook: "l1orderbook";
|
|
916
|
+
readonly l2orderbook: "l2orderbook";
|
|
917
|
+
};
|
|
918
|
+
export type SubscriptionName = (typeof SubscriptionName)[keyof typeof SubscriptionName];
|
|
919
|
+
/**
|
|
920
|
+
* @internal
|
|
921
|
+
*
|
|
922
|
+
* Available WebSocket Request Methods
|
|
923
|
+
*
|
|
924
|
+
* @enum
|
|
925
|
+
*/
|
|
926
|
+
export declare const WebSocketRequestMethod: Readonly<{
|
|
927
|
+
/**
|
|
928
|
+
* Creates a new subscription or subscriptions
|
|
929
|
+
*
|
|
930
|
+
* **Subscription Update Events:**
|
|
931
|
+
*
|
|
932
|
+
* - Receives a {@link _types.KatanaPerpsSubscriptionsListEvent KatanaPerpsSubscriptionsListEvent} WebSocket response via
|
|
933
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler listing all active
|
|
934
|
+
* subscriptions.
|
|
935
|
+
* - Begins receiving {@link _types.KatanaPerpsSubscriptionEvent KatanaPerpsSubscriptionEvent}'s for all subscribed
|
|
936
|
+
* subscriptions via the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler.
|
|
937
|
+
*/
|
|
938
|
+
readonly subscribe: "subscribe";
|
|
939
|
+
/**
|
|
940
|
+
* Unsubscribes from a subscription or subscriptions
|
|
941
|
+
*
|
|
942
|
+
* **Subscription Update Events:**
|
|
943
|
+
*
|
|
944
|
+
* - Receives a {@link _types.KatanaPerpsSubscriptionsListEvent KatanaPerpsSubscriptionsListEvent} WebSocket response via
|
|
945
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler listing all active
|
|
946
|
+
* subscriptions..
|
|
947
|
+
*/
|
|
948
|
+
readonly unsubscribe: "unsubscribe";
|
|
949
|
+
/**
|
|
950
|
+
* List all active subscriptions
|
|
951
|
+
*
|
|
952
|
+
* **Subscription Update Events:**
|
|
953
|
+
*
|
|
954
|
+
* - Receives a {@link _types.KatanaPerpsSubscriptionsListEvent KatanaPerpsSubscriptionsListEvent} WebSocket response via
|
|
955
|
+
* the {@link _types.WebSocketClient.onMessage WebSocketClient.onMessage} handler listing all active
|
|
956
|
+
* subscriptions.
|
|
957
|
+
*/
|
|
958
|
+
readonly subscriptions: "subscriptions";
|
|
959
|
+
/**
|
|
960
|
+
* Ping the server to check if the connection is still alive
|
|
961
|
+
* and to maintain the connection (indicate we are still active).
|
|
962
|
+
*
|
|
963
|
+
* A `pong` is dispatched automatically from the server.
|
|
964
|
+
*/
|
|
965
|
+
readonly ping: "ping";
|
|
966
|
+
/**
|
|
967
|
+
* @internal
|
|
968
|
+
*
|
|
969
|
+
* **WARNING:***
|
|
970
|
+
*
|
|
971
|
+
* This uses a propietary internal mechanism that is automatically handled by
|
|
972
|
+
* most WebSocket libraries.
|
|
973
|
+
*
|
|
974
|
+
* It is here for internal use and attempting to make a request of this value
|
|
975
|
+
* will result in a runtime error.
|
|
976
|
+
*/
|
|
977
|
+
readonly pong: "pong";
|
|
978
|
+
}>;
|
|
979
|
+
export type WebSocketRequestMethod = (typeof WebSocketRequestMethod)[keyof typeof WebSocketRequestMethod];
|
|
980
|
+
//# sourceMappingURL=request.d.ts.map
|