@nktkas/hyperliquid 0.25.6 → 0.25.8
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/CONTRIBUTING.md +26 -19
- package/README.md +106 -9
- package/esm/bin/cli.js +1 -0
- package/esm/bin/cli.js.map +1 -1
- package/esm/src/api/_common_schemas.d.ts +19 -0
- package/esm/src/api/_common_schemas.d.ts.map +1 -1
- package/esm/src/api/_common_schemas.js +15 -0
- package/esm/src/api/_common_schemas.js.map +1 -1
- package/esm/src/api/exchange/_base/_execute.d.ts +6 -7
- package/esm/src/api/exchange/_base/_execute.d.ts.map +1 -1
- package/esm/src/api/exchange/_base/_execute.js +67 -43
- package/esm/src/api/exchange/_base/_execute.js.map +1 -1
- package/esm/src/api/exchange/_base/_types.d.ts +0 -7
- package/esm/src/api/exchange/_base/_types.d.ts.map +1 -1
- package/esm/src/api/exchange/_base/mod.d.ts +0 -2
- package/esm/src/api/exchange/_base/mod.d.ts.map +1 -1
- package/esm/src/api/exchange/_base/mod.js +0 -2
- package/esm/src/api/exchange/_base/mod.js.map +1 -1
- package/esm/src/api/exchange/agentEnableDexAbstraction.d.ts.map +1 -1
- package/esm/src/api/exchange/agentEnableDexAbstraction.js +14 -7
- package/esm/src/api/exchange/agentEnableDexAbstraction.js.map +1 -1
- package/esm/src/api/exchange/approveAgent.d.ts.map +1 -1
- package/esm/src/api/exchange/approveAgent.js +16 -8
- package/esm/src/api/exchange/approveAgent.js.map +1 -1
- package/esm/src/api/exchange/approveBuilderFee.d.ts.map +1 -1
- package/esm/src/api/exchange/approveBuilderFee.js +16 -8
- package/esm/src/api/exchange/approveBuilderFee.js.map +1 -1
- package/esm/src/api/exchange/batchModify.d.ts.map +1 -1
- package/esm/src/api/exchange/batchModify.js +16 -10
- package/esm/src/api/exchange/batchModify.js.map +1 -1
- package/esm/src/api/exchange/cDeposit.d.ts.map +1 -1
- package/esm/src/api/exchange/cDeposit.js +16 -8
- package/esm/src/api/exchange/cDeposit.js.map +1 -1
- package/esm/src/api/exchange/cSignerAction.d.ts.map +1 -1
- package/esm/src/api/exchange/cSignerAction.js +15 -8
- package/esm/src/api/exchange/cSignerAction.js.map +1 -1
- package/esm/src/api/exchange/cValidatorAction.d.ts.map +1 -1
- package/esm/src/api/exchange/cValidatorAction.js +15 -8
- package/esm/src/api/exchange/cValidatorAction.js.map +1 -1
- package/esm/src/api/exchange/cWithdraw.d.ts.map +1 -1
- package/esm/src/api/exchange/cWithdraw.js +16 -8
- package/esm/src/api/exchange/cWithdraw.js.map +1 -1
- package/esm/src/api/exchange/cancel.d.ts.map +1 -1
- package/esm/src/api/exchange/cancel.js +16 -10
- package/esm/src/api/exchange/cancel.js.map +1 -1
- package/esm/src/api/exchange/cancelByCloid.d.ts.map +1 -1
- package/esm/src/api/exchange/cancelByCloid.js +16 -10
- package/esm/src/api/exchange/cancelByCloid.js.map +1 -1
- package/esm/src/api/exchange/claimRewards.d.ts.map +1 -1
- package/esm/src/api/exchange/claimRewards.js +14 -7
- package/esm/src/api/exchange/claimRewards.js.map +1 -1
- package/esm/src/api/exchange/convertToMultiSigUser.d.ts.map +1 -1
- package/esm/src/api/exchange/convertToMultiSigUser.js +16 -8
- package/esm/src/api/exchange/convertToMultiSigUser.js.map +1 -1
- package/esm/src/api/exchange/createSubAccount.d.ts.map +1 -1
- package/esm/src/api/exchange/createSubAccount.js +15 -8
- package/esm/src/api/exchange/createSubAccount.js.map +1 -1
- package/esm/src/api/exchange/createVault.d.ts.map +1 -1
- package/esm/src/api/exchange/createVault.js +15 -8
- package/esm/src/api/exchange/createVault.js.map +1 -1
- package/esm/src/api/exchange/evmUserModify.d.ts +1 -1
- package/esm/src/api/exchange/evmUserModify.d.ts.map +1 -1
- package/esm/src/api/exchange/evmUserModify.js +16 -9
- package/esm/src/api/exchange/evmUserModify.js.map +1 -1
- package/esm/src/api/exchange/linkStakingUser.d.ts +112 -0
- package/esm/src/api/exchange/linkStakingUser.d.ts.map +1 -0
- package/esm/src/api/exchange/linkStakingUser.js +99 -0
- package/esm/src/api/exchange/linkStakingUser.js.map +1 -0
- package/esm/src/api/exchange/modify.d.ts.map +1 -1
- package/esm/src/api/exchange/modify.js +16 -10
- package/esm/src/api/exchange/modify.js.map +1 -1
- package/esm/src/api/exchange/multiSig.d.ts.map +1 -1
- package/esm/src/api/exchange/multiSig.js +17 -16
- package/esm/src/api/exchange/multiSig.js.map +1 -1
- package/esm/src/api/exchange/noop.d.ts.map +1 -1
- package/esm/src/api/exchange/noop.js +14 -7
- package/esm/src/api/exchange/noop.js.map +1 -1
- package/esm/src/api/exchange/order.d.ts.map +1 -1
- package/esm/src/api/exchange/order.js +16 -10
- package/esm/src/api/exchange/order.js.map +1 -1
- package/esm/src/api/exchange/perpDeploy.d.ts.map +1 -1
- package/esm/src/api/exchange/perpDeploy.js +15 -8
- package/esm/src/api/exchange/perpDeploy.js.map +1 -1
- package/esm/src/api/exchange/registerReferrer.d.ts.map +1 -1
- package/esm/src/api/exchange/registerReferrer.js +15 -8
- package/esm/src/api/exchange/registerReferrer.js.map +1 -1
- package/esm/src/api/exchange/reserveRequestWeight.d.ts.map +1 -1
- package/esm/src/api/exchange/reserveRequestWeight.js +15 -8
- package/esm/src/api/exchange/reserveRequestWeight.js.map +1 -1
- package/esm/src/api/exchange/scheduleCancel.js +16 -10
- package/esm/src/api/exchange/scheduleCancel.js.map +1 -1
- package/esm/src/api/exchange/sendAsset.d.ts.map +1 -1
- package/esm/src/api/exchange/sendAsset.js +16 -8
- package/esm/src/api/exchange/sendAsset.js.map +1 -1
- package/esm/src/api/exchange/setDisplayName.d.ts.map +1 -1
- package/esm/src/api/exchange/setDisplayName.js +15 -8
- package/esm/src/api/exchange/setDisplayName.js.map +1 -1
- package/esm/src/api/exchange/setReferrer.d.ts.map +1 -1
- package/esm/src/api/exchange/setReferrer.js +15 -8
- package/esm/src/api/exchange/setReferrer.js.map +1 -1
- package/esm/src/api/exchange/spotDeploy.d.ts.map +1 -1
- package/esm/src/api/exchange/spotDeploy.js +15 -8
- package/esm/src/api/exchange/spotDeploy.js.map +1 -1
- package/esm/src/api/exchange/spotSend.d.ts.map +1 -1
- package/esm/src/api/exchange/spotSend.js +16 -8
- package/esm/src/api/exchange/spotSend.js.map +1 -1
- package/esm/src/api/exchange/spotUser.d.ts.map +1 -1
- package/esm/src/api/exchange/spotUser.js +15 -8
- package/esm/src/api/exchange/spotUser.js.map +1 -1
- package/esm/src/api/exchange/subAccountModify.d.ts.map +1 -1
- package/esm/src/api/exchange/subAccountModify.js +15 -8
- package/esm/src/api/exchange/subAccountModify.js.map +1 -1
- package/esm/src/api/exchange/subAccountSpotTransfer.d.ts.map +1 -1
- package/esm/src/api/exchange/subAccountSpotTransfer.js +15 -8
- package/esm/src/api/exchange/subAccountSpotTransfer.js.map +1 -1
- package/esm/src/api/exchange/subAccountTransfer.d.ts.map +1 -1
- package/esm/src/api/exchange/subAccountTransfer.js +15 -8
- package/esm/src/api/exchange/subAccountTransfer.js.map +1 -1
- package/esm/src/api/exchange/tokenDelegate.d.ts.map +1 -1
- package/esm/src/api/exchange/tokenDelegate.js +16 -8
- package/esm/src/api/exchange/tokenDelegate.js.map +1 -1
- package/esm/src/api/exchange/twapCancel.d.ts.map +1 -1
- package/esm/src/api/exchange/twapCancel.js +16 -10
- package/esm/src/api/exchange/twapCancel.js.map +1 -1
- package/esm/src/api/exchange/twapOrder.d.ts.map +1 -1
- package/esm/src/api/exchange/twapOrder.js +16 -10
- package/esm/src/api/exchange/twapOrder.js.map +1 -1
- package/esm/src/api/exchange/updateIsolatedMargin.d.ts.map +1 -1
- package/esm/src/api/exchange/updateIsolatedMargin.js +16 -10
- package/esm/src/api/exchange/updateIsolatedMargin.js.map +1 -1
- package/esm/src/api/exchange/updateLeverage.d.ts.map +1 -1
- package/esm/src/api/exchange/updateLeverage.js +16 -10
- package/esm/src/api/exchange/updateLeverage.js.map +1 -1
- package/esm/src/api/exchange/usdClassTransfer.d.ts.map +1 -1
- package/esm/src/api/exchange/usdClassTransfer.js +16 -8
- package/esm/src/api/exchange/usdClassTransfer.js.map +1 -1
- package/esm/src/api/exchange/usdSend.d.ts.map +1 -1
- package/esm/src/api/exchange/usdSend.js +16 -8
- package/esm/src/api/exchange/usdSend.js.map +1 -1
- package/esm/src/api/exchange/userDexAbstraction.d.ts.map +1 -1
- package/esm/src/api/exchange/userDexAbstraction.js +16 -8
- package/esm/src/api/exchange/userDexAbstraction.js.map +1 -1
- package/esm/src/api/exchange/vaultDistribute.d.ts.map +1 -1
- package/esm/src/api/exchange/vaultDistribute.js +15 -8
- package/esm/src/api/exchange/vaultDistribute.js.map +1 -1
- package/esm/src/api/exchange/vaultModify.d.ts.map +1 -1
- package/esm/src/api/exchange/vaultModify.js +15 -8
- package/esm/src/api/exchange/vaultModify.js.map +1 -1
- package/esm/src/api/exchange/vaultTransfer.d.ts.map +1 -1
- package/esm/src/api/exchange/vaultTransfer.js +15 -8
- package/esm/src/api/exchange/vaultTransfer.js.map +1 -1
- package/esm/src/api/exchange/withdraw3.d.ts.map +1 -1
- package/esm/src/api/exchange/withdraw3.js +16 -8
- package/esm/src/api/exchange/withdraw3.js.map +1 -1
- package/esm/src/api/exchange/~client.d.ts +31 -3
- package/esm/src/api/exchange/~client.d.ts.map +1 -1
- package/esm/src/api/exchange/~client.js +27 -4
- package/esm/src/api/exchange/~client.js.map +1 -1
- package/esm/src/api/exchange/~mod.d.ts +1 -0
- package/esm/src/api/exchange/~mod.d.ts.map +1 -1
- package/esm/src/api/exchange/~mod.js +1 -0
- package/esm/src/api/exchange/~mod.js.map +1 -1
- package/esm/src/api/info/allPerpMetas.d.ts +5 -0
- package/esm/src/api/info/allPerpMetas.d.ts.map +1 -1
- package/esm/src/api/info/meta.d.ts +5 -0
- package/esm/src/api/info/meta.d.ts.map +1 -1
- package/esm/src/api/info/meta.js +2 -0
- package/esm/src/api/info/meta.js.map +1 -1
- package/esm/src/api/info/metaAndAssetCtxs.d.ts +5 -0
- package/esm/src/api/info/metaAndAssetCtxs.d.ts.map +1 -1
- package/esm/src/api/info/perpDexs.d.ts +4 -0
- package/esm/src/api/info/perpDexs.d.ts.map +1 -1
- package/esm/src/api/info/perpDexs.js +5 -0
- package/esm/src/api/info/perpDexs.js.map +1 -1
- package/esm/src/api/info/spotClearinghouseState.d.ts +0 -5
- package/esm/src/api/info/spotClearinghouseState.d.ts.map +1 -1
- package/esm/src/api/info/spotClearinghouseState.js +2 -14
- package/esm/src/api/info/spotClearinghouseState.js.map +1 -1
- package/esm/src/api/info/userFees.d.ts +27 -2
- package/esm/src/api/info/userFees.d.ts.map +1 -1
- package/esm/src/api/info/userFees.js +29 -1
- package/esm/src/api/info/userFees.js.map +1 -1
- package/esm/src/api/info/webData2.d.ts +152 -23
- package/esm/src/api/info/webData2.d.ts.map +1 -1
- package/esm/src/api/info/webData2.js +3 -54
- package/esm/src/api/info/webData2.js.map +1 -1
- package/esm/src/api/info/~client.d.ts +11 -3
- package/esm/src/api/info/~client.d.ts.map +1 -1
- package/esm/src/api/subscription/spotState.d.ts +91 -0
- package/esm/src/api/subscription/spotState.d.ts.map +1 -0
- package/esm/src/api/subscription/spotState.js +58 -0
- package/esm/src/api/subscription/spotState.js.map +1 -0
- package/esm/src/api/subscription/webData2.d.ts +9 -4
- package/esm/src/api/subscription/webData2.d.ts.map +1 -1
- package/esm/src/api/subscription/webData2.js +1 -1
- package/esm/src/api/subscription/webData2.js.map +1 -1
- package/esm/src/api/subscription/webData3.d.ts +541 -0
- package/esm/src/api/subscription/webData3.d.ts.map +1 -0
- package/esm/src/api/subscription/webData3.js +94 -0
- package/esm/src/api/subscription/webData3.js.map +1 -0
- package/esm/src/api/subscription/~client.d.ts +44 -0
- package/esm/src/api/subscription/~client.d.ts.map +1 -1
- package/esm/src/api/subscription/~client.js +46 -0
- package/esm/src/api/subscription/~client.js.map +1 -1
- package/esm/src/api/subscription/~mod.d.ts +2 -0
- package/esm/src/api/subscription/~mod.d.ts.map +1 -1
- package/esm/src/api/subscription/~mod.js +2 -0
- package/esm/src/api/subscription/~mod.js.map +1 -1
- package/esm/src/signing/_signTypedData.d.ts +1 -1
- package/esm/src/signing/_signTypedData.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData.js +1 -1
- package/esm/src/signing/_signTypedData.js.map +1 -1
- package/esm/src/utils/{_minimalEIP712Signer.d.ts → _eip712.d.ts} +16 -1
- package/esm/src/utils/_eip712.d.ts.map +1 -0
- package/esm/src/utils/{_minimalEIP712Signer.js → _eip712.js} +14 -11
- package/esm/src/utils/_eip712.js.map +1 -0
- package/esm/src/utils/_format.d.ts +28 -0
- package/esm/src/utils/_format.d.ts.map +1 -0
- package/esm/src/utils/_format.js +157 -0
- package/esm/src/utils/_format.js.map +1 -0
- package/esm/src/utils/_recover.d.ts +89 -0
- package/esm/src/utils/_recover.d.ts.map +1 -0
- package/esm/src/utils/_recover.js +119 -0
- package/esm/src/utils/_recover.js.map +1 -0
- package/esm/src/utils/_symbolConverter.d.ts +13 -0
- package/esm/src/utils/_symbolConverter.d.ts.map +1 -1
- package/esm/src/utils/_symbolConverter.js +17 -0
- package/esm/src/utils/_symbolConverter.js.map +1 -1
- package/esm/src/utils/mod.d.ts +2 -0
- package/esm/src/utils/mod.d.ts.map +1 -1
- package/esm/src/utils/mod.js +2 -0
- package/esm/src/utils/mod.js.map +1 -1
- package/package.json +3 -2
- package/script/bin/cli.js +1 -0
- package/script/bin/cli.js.map +1 -1
- package/script/src/api/_common_schemas.d.ts +19 -0
- package/script/src/api/_common_schemas.d.ts.map +1 -1
- package/script/src/api/_common_schemas.js +16 -1
- package/script/src/api/_common_schemas.js.map +1 -1
- package/script/src/api/exchange/_base/_execute.d.ts +6 -7
- package/script/src/api/exchange/_base/_execute.d.ts.map +1 -1
- package/script/src/api/exchange/_base/_execute.js +67 -43
- package/script/src/api/exchange/_base/_execute.js.map +1 -1
- package/script/src/api/exchange/_base/_types.d.ts +0 -7
- package/script/src/api/exchange/_base/_types.d.ts.map +1 -1
- package/script/src/api/exchange/_base/mod.d.ts +0 -2
- package/script/src/api/exchange/_base/mod.d.ts.map +1 -1
- package/script/src/api/exchange/_base/mod.js +0 -2
- package/script/src/api/exchange/_base/mod.js.map +1 -1
- package/script/src/api/exchange/agentEnableDexAbstraction.d.ts.map +1 -1
- package/script/src/api/exchange/agentEnableDexAbstraction.js +14 -7
- package/script/src/api/exchange/agentEnableDexAbstraction.js.map +1 -1
- package/script/src/api/exchange/approveAgent.d.ts.map +1 -1
- package/script/src/api/exchange/approveAgent.js +15 -7
- package/script/src/api/exchange/approveAgent.js.map +1 -1
- package/script/src/api/exchange/approveBuilderFee.d.ts.map +1 -1
- package/script/src/api/exchange/approveBuilderFee.js +15 -7
- package/script/src/api/exchange/approveBuilderFee.js.map +1 -1
- package/script/src/api/exchange/batchModify.d.ts.map +1 -1
- package/script/src/api/exchange/batchModify.js +16 -10
- package/script/src/api/exchange/batchModify.js.map +1 -1
- package/script/src/api/exchange/cDeposit.d.ts.map +1 -1
- package/script/src/api/exchange/cDeposit.js +15 -7
- package/script/src/api/exchange/cDeposit.js.map +1 -1
- package/script/src/api/exchange/cSignerAction.d.ts.map +1 -1
- package/script/src/api/exchange/cSignerAction.js +15 -8
- package/script/src/api/exchange/cSignerAction.js.map +1 -1
- package/script/src/api/exchange/cValidatorAction.d.ts.map +1 -1
- package/script/src/api/exchange/cValidatorAction.js +15 -8
- package/script/src/api/exchange/cValidatorAction.js.map +1 -1
- package/script/src/api/exchange/cWithdraw.d.ts.map +1 -1
- package/script/src/api/exchange/cWithdraw.js +15 -7
- package/script/src/api/exchange/cWithdraw.js.map +1 -1
- package/script/src/api/exchange/cancel.d.ts.map +1 -1
- package/script/src/api/exchange/cancel.js +16 -10
- package/script/src/api/exchange/cancel.js.map +1 -1
- package/script/src/api/exchange/cancelByCloid.d.ts.map +1 -1
- package/script/src/api/exchange/cancelByCloid.js +16 -10
- package/script/src/api/exchange/cancelByCloid.js.map +1 -1
- package/script/src/api/exchange/claimRewards.d.ts.map +1 -1
- package/script/src/api/exchange/claimRewards.js +14 -7
- package/script/src/api/exchange/claimRewards.js.map +1 -1
- package/script/src/api/exchange/convertToMultiSigUser.d.ts.map +1 -1
- package/script/src/api/exchange/convertToMultiSigUser.js +15 -7
- package/script/src/api/exchange/convertToMultiSigUser.js.map +1 -1
- package/script/src/api/exchange/createSubAccount.d.ts.map +1 -1
- package/script/src/api/exchange/createSubAccount.js +15 -8
- package/script/src/api/exchange/createSubAccount.js.map +1 -1
- package/script/src/api/exchange/createVault.d.ts.map +1 -1
- package/script/src/api/exchange/createVault.js +15 -8
- package/script/src/api/exchange/createVault.js.map +1 -1
- package/script/src/api/exchange/evmUserModify.d.ts +1 -1
- package/script/src/api/exchange/evmUserModify.d.ts.map +1 -1
- package/script/src/api/exchange/evmUserModify.js +16 -9
- package/script/src/api/exchange/evmUserModify.js.map +1 -1
- package/script/src/api/exchange/linkStakingUser.d.ts +112 -0
- package/script/src/api/exchange/linkStakingUser.d.ts.map +1 -0
- package/script/src/api/exchange/linkStakingUser.js +136 -0
- package/script/src/api/exchange/linkStakingUser.js.map +1 -0
- package/script/src/api/exchange/modify.d.ts.map +1 -1
- package/script/src/api/exchange/modify.js +16 -10
- package/script/src/api/exchange/modify.js.map +1 -1
- package/script/src/api/exchange/multiSig.d.ts.map +1 -1
- package/script/src/api/exchange/multiSig.js +17 -16
- package/script/src/api/exchange/multiSig.js.map +1 -1
- package/script/src/api/exchange/noop.d.ts.map +1 -1
- package/script/src/api/exchange/noop.js +14 -7
- package/script/src/api/exchange/noop.js.map +1 -1
- package/script/src/api/exchange/order.d.ts.map +1 -1
- package/script/src/api/exchange/order.js +16 -10
- package/script/src/api/exchange/order.js.map +1 -1
- package/script/src/api/exchange/perpDeploy.d.ts.map +1 -1
- package/script/src/api/exchange/perpDeploy.js +15 -8
- package/script/src/api/exchange/perpDeploy.js.map +1 -1
- package/script/src/api/exchange/registerReferrer.d.ts.map +1 -1
- package/script/src/api/exchange/registerReferrer.js +15 -8
- package/script/src/api/exchange/registerReferrer.js.map +1 -1
- package/script/src/api/exchange/reserveRequestWeight.d.ts.map +1 -1
- package/script/src/api/exchange/reserveRequestWeight.js +15 -8
- package/script/src/api/exchange/reserveRequestWeight.js.map +1 -1
- package/script/src/api/exchange/scheduleCancel.js +16 -10
- package/script/src/api/exchange/scheduleCancel.js.map +1 -1
- package/script/src/api/exchange/sendAsset.d.ts.map +1 -1
- package/script/src/api/exchange/sendAsset.js +15 -7
- package/script/src/api/exchange/sendAsset.js.map +1 -1
- package/script/src/api/exchange/setDisplayName.d.ts.map +1 -1
- package/script/src/api/exchange/setDisplayName.js +15 -8
- package/script/src/api/exchange/setDisplayName.js.map +1 -1
- package/script/src/api/exchange/setReferrer.d.ts.map +1 -1
- package/script/src/api/exchange/setReferrer.js +15 -8
- package/script/src/api/exchange/setReferrer.js.map +1 -1
- package/script/src/api/exchange/spotDeploy.d.ts.map +1 -1
- package/script/src/api/exchange/spotDeploy.js +15 -8
- package/script/src/api/exchange/spotDeploy.js.map +1 -1
- package/script/src/api/exchange/spotSend.d.ts.map +1 -1
- package/script/src/api/exchange/spotSend.js +15 -7
- package/script/src/api/exchange/spotSend.js.map +1 -1
- package/script/src/api/exchange/spotUser.d.ts.map +1 -1
- package/script/src/api/exchange/spotUser.js +15 -8
- package/script/src/api/exchange/spotUser.js.map +1 -1
- package/script/src/api/exchange/subAccountModify.d.ts.map +1 -1
- package/script/src/api/exchange/subAccountModify.js +15 -8
- package/script/src/api/exchange/subAccountModify.js.map +1 -1
- package/script/src/api/exchange/subAccountSpotTransfer.d.ts.map +1 -1
- package/script/src/api/exchange/subAccountSpotTransfer.js +15 -8
- package/script/src/api/exchange/subAccountSpotTransfer.js.map +1 -1
- package/script/src/api/exchange/subAccountTransfer.d.ts.map +1 -1
- package/script/src/api/exchange/subAccountTransfer.js +15 -8
- package/script/src/api/exchange/subAccountTransfer.js.map +1 -1
- package/script/src/api/exchange/tokenDelegate.d.ts.map +1 -1
- package/script/src/api/exchange/tokenDelegate.js +15 -7
- package/script/src/api/exchange/tokenDelegate.js.map +1 -1
- package/script/src/api/exchange/twapCancel.d.ts.map +1 -1
- package/script/src/api/exchange/twapCancel.js +16 -10
- package/script/src/api/exchange/twapCancel.js.map +1 -1
- package/script/src/api/exchange/twapOrder.d.ts.map +1 -1
- package/script/src/api/exchange/twapOrder.js +16 -10
- package/script/src/api/exchange/twapOrder.js.map +1 -1
- package/script/src/api/exchange/updateIsolatedMargin.d.ts.map +1 -1
- package/script/src/api/exchange/updateIsolatedMargin.js +16 -10
- package/script/src/api/exchange/updateIsolatedMargin.js.map +1 -1
- package/script/src/api/exchange/updateLeverage.d.ts.map +1 -1
- package/script/src/api/exchange/updateLeverage.js +16 -10
- package/script/src/api/exchange/updateLeverage.js.map +1 -1
- package/script/src/api/exchange/usdClassTransfer.d.ts.map +1 -1
- package/script/src/api/exchange/usdClassTransfer.js +15 -7
- package/script/src/api/exchange/usdClassTransfer.js.map +1 -1
- package/script/src/api/exchange/usdSend.d.ts.map +1 -1
- package/script/src/api/exchange/usdSend.js +15 -7
- package/script/src/api/exchange/usdSend.js.map +1 -1
- package/script/src/api/exchange/userDexAbstraction.d.ts.map +1 -1
- package/script/src/api/exchange/userDexAbstraction.js +15 -7
- package/script/src/api/exchange/userDexAbstraction.js.map +1 -1
- package/script/src/api/exchange/vaultDistribute.d.ts.map +1 -1
- package/script/src/api/exchange/vaultDistribute.js +15 -8
- package/script/src/api/exchange/vaultDistribute.js.map +1 -1
- package/script/src/api/exchange/vaultModify.d.ts.map +1 -1
- package/script/src/api/exchange/vaultModify.js +15 -8
- package/script/src/api/exchange/vaultModify.js.map +1 -1
- package/script/src/api/exchange/vaultTransfer.d.ts.map +1 -1
- package/script/src/api/exchange/vaultTransfer.js +15 -8
- package/script/src/api/exchange/vaultTransfer.js.map +1 -1
- package/script/src/api/exchange/withdraw3.d.ts.map +1 -1
- package/script/src/api/exchange/withdraw3.js +15 -7
- package/script/src/api/exchange/withdraw3.js.map +1 -1
- package/script/src/api/exchange/~client.d.ts +31 -3
- package/script/src/api/exchange/~client.d.ts.map +1 -1
- package/script/src/api/exchange/~client.js +29 -6
- package/script/src/api/exchange/~client.js.map +1 -1
- package/script/src/api/exchange/~mod.d.ts +1 -0
- package/script/src/api/exchange/~mod.d.ts.map +1 -1
- package/script/src/api/exchange/~mod.js +1 -0
- package/script/src/api/exchange/~mod.js.map +1 -1
- package/script/src/api/info/allPerpMetas.d.ts +5 -0
- package/script/src/api/info/allPerpMetas.d.ts.map +1 -1
- package/script/src/api/info/meta.d.ts +5 -0
- package/script/src/api/info/meta.d.ts.map +1 -1
- package/script/src/api/info/meta.js +2 -0
- package/script/src/api/info/meta.js.map +1 -1
- package/script/src/api/info/metaAndAssetCtxs.d.ts +5 -0
- package/script/src/api/info/metaAndAssetCtxs.d.ts.map +1 -1
- package/script/src/api/info/perpDexs.d.ts +4 -0
- package/script/src/api/info/perpDexs.d.ts.map +1 -1
- package/script/src/api/info/perpDexs.js +5 -0
- package/script/src/api/info/perpDexs.js.map +1 -1
- package/script/src/api/info/spotClearinghouseState.d.ts +0 -5
- package/script/src/api/info/spotClearinghouseState.d.ts.map +1 -1
- package/script/src/api/info/spotClearinghouseState.js +2 -14
- package/script/src/api/info/spotClearinghouseState.js.map +1 -1
- package/script/src/api/info/userFees.d.ts +27 -2
- package/script/src/api/info/userFees.d.ts.map +1 -1
- package/script/src/api/info/userFees.js +29 -1
- package/script/src/api/info/userFees.js.map +1 -1
- package/script/src/api/info/webData2.d.ts +152 -23
- package/script/src/api/info/webData2.d.ts.map +1 -1
- package/script/src/api/info/webData2.js +2 -53
- package/script/src/api/info/webData2.js.map +1 -1
- package/script/src/api/info/~client.d.ts +11 -3
- package/script/src/api/info/~client.d.ts.map +1 -1
- package/script/src/api/subscription/spotState.d.ts +91 -0
- package/script/src/api/subscription/spotState.d.ts.map +1 -0
- package/script/src/api/subscription/spotState.js +95 -0
- package/script/src/api/subscription/spotState.js.map +1 -0
- package/script/src/api/subscription/webData2.d.ts +9 -4
- package/script/src/api/subscription/webData2.d.ts.map +1 -1
- package/script/src/api/subscription/webData2.js +1 -1
- package/script/src/api/subscription/webData2.js.map +1 -1
- package/script/src/api/subscription/webData3.d.ts +541 -0
- package/script/src/api/subscription/webData3.d.ts.map +1 -0
- package/script/src/api/subscription/webData3.js +131 -0
- package/script/src/api/subscription/webData3.js.map +1 -0
- package/script/src/api/subscription/~client.d.ts +44 -0
- package/script/src/api/subscription/~client.d.ts.map +1 -1
- package/script/src/api/subscription/~client.js +46 -0
- package/script/src/api/subscription/~client.js.map +1 -1
- package/script/src/api/subscription/~mod.d.ts +2 -0
- package/script/src/api/subscription/~mod.d.ts.map +1 -1
- package/script/src/api/subscription/~mod.js +2 -0
- package/script/src/api/subscription/~mod.js.map +1 -1
- package/script/src/signing/_signTypedData.d.ts +1 -1
- package/script/src/signing/_signTypedData.d.ts.map +1 -1
- package/script/src/signing/_signTypedData.js +1 -1
- package/script/src/signing/_signTypedData.js.map +1 -1
- package/script/src/utils/{_minimalEIP712Signer.d.ts → _eip712.d.ts} +16 -1
- package/script/src/utils/_eip712.d.ts.map +1 -0
- package/script/src/utils/{_minimalEIP712Signer.js → _eip712.js} +14 -9
- package/script/src/utils/_eip712.js.map +1 -0
- package/script/src/utils/_format.d.ts +28 -0
- package/script/src/utils/_format.d.ts.map +1 -0
- package/script/src/utils/_format.js +161 -0
- package/script/src/utils/_format.js.map +1 -0
- package/script/src/utils/_recover.d.ts +89 -0
- package/script/src/utils/_recover.d.ts.map +1 -0
- package/script/src/utils/_recover.js +156 -0
- package/script/src/utils/_recover.js.map +1 -0
- package/script/src/utils/_symbolConverter.d.ts +13 -0
- package/script/src/utils/_symbolConverter.d.ts.map +1 -1
- package/script/src/utils/_symbolConverter.js +17 -0
- package/script/src/utils/_symbolConverter.js.map +1 -1
- package/script/src/utils/mod.d.ts +2 -0
- package/script/src/utils/mod.d.ts.map +1 -1
- package/script/src/utils/mod.js +2 -0
- package/script/src/utils/mod.js.map +1 -1
- package/src/bin/cli.ts +1 -0
- package/src/src/api/_common_schemas.ts +34 -0
- package/src/src/api/exchange/_base/_execute.ts +73 -49
- package/src/src/api/exchange/_base/_types.ts +0 -7
- package/src/src/api/exchange/_base/mod.ts +0 -2
- package/src/src/api/exchange/agentEnableDexAbstraction.ts +14 -9
- package/src/src/api/exchange/approveAgent.ts +15 -12
- package/src/src/api/exchange/approveBuilderFee.ts +15 -12
- package/src/src/api/exchange/batchModify.ts +16 -13
- package/src/src/api/exchange/cDeposit.ts +15 -12
- package/src/src/api/exchange/cSignerAction.ts +15 -10
- package/src/src/api/exchange/cValidatorAction.ts +15 -10
- package/src/src/api/exchange/cWithdraw.ts +15 -12
- package/src/src/api/exchange/cancel.ts +16 -13
- package/src/src/api/exchange/cancelByCloid.ts +16 -13
- package/src/src/api/exchange/claimRewards.ts +14 -9
- package/src/src/api/exchange/convertToMultiSigUser.ts +15 -12
- package/src/src/api/exchange/createSubAccount.ts +15 -10
- package/src/src/api/exchange/createVault.ts +15 -10
- package/src/src/api/exchange/evmUserModify.ts +16 -11
- package/src/src/api/exchange/linkStakingUser.ts +157 -0
- package/src/src/api/exchange/modify.ts +16 -13
- package/src/src/api/exchange/multiSig.ts +17 -23
- package/src/src/api/exchange/noop.ts +14 -9
- package/src/src/api/exchange/order.ts +16 -13
- package/src/src/api/exchange/perpDeploy.ts +15 -10
- package/src/src/api/exchange/registerReferrer.ts +15 -10
- package/src/src/api/exchange/reserveRequestWeight.ts +15 -10
- package/src/src/api/exchange/scheduleCancel.ts +16 -13
- package/src/src/api/exchange/sendAsset.ts +15 -12
- package/src/src/api/exchange/setDisplayName.ts +15 -10
- package/src/src/api/exchange/setReferrer.ts +15 -10
- package/src/src/api/exchange/spotDeploy.ts +15 -10
- package/src/src/api/exchange/spotSend.ts +15 -12
- package/src/src/api/exchange/spotUser.ts +15 -10
- package/src/src/api/exchange/subAccountModify.ts +15 -10
- package/src/src/api/exchange/subAccountSpotTransfer.ts +15 -10
- package/src/src/api/exchange/subAccountTransfer.ts +15 -10
- package/src/src/api/exchange/tokenDelegate.ts +15 -12
- package/src/src/api/exchange/twapCancel.ts +16 -13
- package/src/src/api/exchange/twapOrder.ts +16 -13
- package/src/src/api/exchange/updateIsolatedMargin.ts +16 -13
- package/src/src/api/exchange/updateLeverage.ts +16 -13
- package/src/src/api/exchange/usdClassTransfer.ts +15 -12
- package/src/src/api/exchange/usdSend.ts +15 -12
- package/src/src/api/exchange/userDexAbstraction.ts +15 -12
- package/src/src/api/exchange/vaultDistribute.ts +15 -10
- package/src/src/api/exchange/vaultModify.ts +15 -10
- package/src/src/api/exchange/vaultTransfer.ts +15 -10
- package/src/src/api/exchange/withdraw3.ts +15 -12
- package/src/src/api/exchange/~client.ts +30 -5
- package/src/src/api/exchange/~mod.ts +1 -0
- package/src/src/api/info/meta.ts +7 -0
- package/src/src/api/info/perpDexs.ts +10 -0
- package/src/src/api/info/spotClearinghouseState.ts +3 -33
- package/src/src/api/info/userFees.ts +46 -1
- package/src/src/api/info/webData2.ts +3 -104
- package/src/src/api/subscription/spotState.ts +96 -0
- package/src/src/api/subscription/webData2.ts +1 -1
- package/src/src/api/subscription/webData3.ts +179 -0
- package/src/src/api/subscription/~client.ts +50 -0
- package/src/src/api/subscription/~mod.ts +2 -0
- package/src/src/signing/_signTypedData.ts +1 -1
- package/src/src/utils/{_minimalEIP712Signer.ts → _eip712.ts} +22 -29
- package/src/src/utils/_format.ts +173 -0
- package/src/src/utils/_recover.ts +178 -0
- package/src/src/utils/_symbolConverter.ts +18 -0
- package/src/src/utils/mod.ts +2 -0
- package/esm/src/api/exchange/_base/_sequential.d.ts +0 -30
- package/esm/src/api/exchange/_base/_sequential.d.ts.map +0 -1
- package/esm/src/api/exchange/_base/_sequential.js +0 -69
- package/esm/src/api/exchange/_base/_sequential.js.map +0 -1
- package/esm/src/utils/_minimalEIP712Signer.d.ts.map +0 -1
- package/esm/src/utils/_minimalEIP712Signer.js.map +0 -1
- package/script/src/api/exchange/_base/_sequential.d.ts +0 -30
- package/script/src/api/exchange/_base/_sequential.d.ts.map +0 -1
- package/script/src/api/exchange/_base/_sequential.js +0 -72
- package/script/src/api/exchange/_base/_sequential.js.map +0 -1
- package/script/src/utils/_minimalEIP712Signer.d.ts.map +0 -1
- package/script/src/utils/_minimalEIP712Signer.js.map +0 -1
- package/src/src/api/exchange/_base/_sequential.ts +0 -82
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { type DeepImmutable } from "../_base.js";
|
|
3
|
+
import type { SubscriptionRequestConfig } from "./_types.js";
|
|
4
|
+
import type { Subscription } from "../../transport/base.js";
|
|
5
|
+
/** Subscription to comprehensive user and market data events. */
|
|
6
|
+
export declare const WebData3Request: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
7
|
+
/** Type of subscription. */
|
|
8
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"webData3", undefined>, v.DescriptionAction<"webData3", "Type of subscription.">]>;
|
|
9
|
+
/** User address. */
|
|
10
|
+
readonly user: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "User address.">]>;
|
|
11
|
+
}, undefined>, v.DescriptionAction<{
|
|
12
|
+
type: "webData3";
|
|
13
|
+
user: `0x${string}`;
|
|
14
|
+
}, "Subscription to comprehensive user and market data events.">]>;
|
|
15
|
+
export type WebData3Request = v.InferOutput<typeof WebData3Request>;
|
|
16
|
+
/** Event of comprehensive user and market data. */
|
|
17
|
+
export declare const WebData3Event: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
18
|
+
/** User state information. */
|
|
19
|
+
readonly userState: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
20
|
+
/** Agent address if one exists. */
|
|
21
|
+
readonly agentAddress: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, undefined>, v.DescriptionAction<`0x${string}` | null, "Agent address if one exists.">]>;
|
|
22
|
+
/** Timestamp until which the agent is valid. */
|
|
23
|
+
readonly agentValidUntil: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Timestamp until which the agent is valid.">]>;
|
|
24
|
+
/** Cumulative ledger value. */
|
|
25
|
+
readonly cumLedger: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Cumulative ledger value.">]>;
|
|
26
|
+
/** Server timestamp (in ms since epoch). */
|
|
27
|
+
readonly serverTime: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Server timestamp (in ms since epoch).">]>;
|
|
28
|
+
/** Whether this account is a vault. */
|
|
29
|
+
readonly isVault: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether this account is a vault.">]>;
|
|
30
|
+
/** User address. */
|
|
31
|
+
readonly user: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "User address.">]>;
|
|
32
|
+
/** Whether the user has opted out of spot dusting. */
|
|
33
|
+
readonly optOutOfSpotDusting: v.SchemaWithPipe<readonly [v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>, v.DescriptionAction<true | undefined, "Whether the user has opted out of spot dusting.">]>;
|
|
34
|
+
/** Whether DEX abstraction is enabled. */
|
|
35
|
+
readonly dexAbstractionEnabled: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, v.DescriptionAction<boolean | undefined, "Whether DEX abstraction is enabled.">]>;
|
|
36
|
+
}, undefined>, v.DescriptionAction<{
|
|
37
|
+
agentAddress: `0x${string}` | null;
|
|
38
|
+
agentValidUntil: number | null;
|
|
39
|
+
cumLedger: string;
|
|
40
|
+
serverTime: number;
|
|
41
|
+
isVault: boolean;
|
|
42
|
+
user: `0x${string}`;
|
|
43
|
+
optOutOfSpotDusting?: true | undefined;
|
|
44
|
+
dexAbstractionEnabled?: boolean | undefined;
|
|
45
|
+
}, "User state information.">]>;
|
|
46
|
+
/** Array of perpetual DEX states. */
|
|
47
|
+
readonly perpDexStates: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
48
|
+
/** Account summary for perpetual trading. */
|
|
49
|
+
readonly clearinghouseState: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
50
|
+
readonly marginSummary: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
51
|
+
readonly accountValue: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total account value.">]>;
|
|
52
|
+
readonly totalNtlPos: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total notional position value.">]>;
|
|
53
|
+
readonly totalRawUsd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total raw USD value.">]>;
|
|
54
|
+
readonly totalMarginUsed: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total margin used.">]>;
|
|
55
|
+
}, undefined>, v.DescriptionAction<{
|
|
56
|
+
accountValue: string;
|
|
57
|
+
totalNtlPos: string;
|
|
58
|
+
totalRawUsd: string;
|
|
59
|
+
totalMarginUsed: string;
|
|
60
|
+
}, "Margin summary details.">]>;
|
|
61
|
+
readonly crossMarginSummary: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
62
|
+
readonly accountValue: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total account value.">]>;
|
|
63
|
+
readonly totalNtlPos: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total notional position value.">]>;
|
|
64
|
+
readonly totalRawUsd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total raw USD value.">]>;
|
|
65
|
+
readonly totalMarginUsed: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total margin used.">]>;
|
|
66
|
+
}, undefined>, v.DescriptionAction<{
|
|
67
|
+
accountValue: string;
|
|
68
|
+
totalNtlPos: string;
|
|
69
|
+
totalRawUsd: string;
|
|
70
|
+
totalMarginUsed: string;
|
|
71
|
+
}, "Cross-margin summary details.">]>;
|
|
72
|
+
readonly crossMaintenanceMarginUsed: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Maintenance margin used for cross-margin positions.">]>;
|
|
73
|
+
readonly withdrawable: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount available for withdrawal.">]>;
|
|
74
|
+
readonly assetPositions: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
75
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"oneWay", undefined>, v.DescriptionAction<"oneWay", "Position type.">]>;
|
|
76
|
+
readonly position: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
77
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
78
|
+
readonly szi: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Signed position size.">]>;
|
|
79
|
+
readonly leverage: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.ObjectSchema<{
|
|
80
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"isolated", undefined>, v.DescriptionAction<"isolated", "Leverage type.">]>;
|
|
81
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.MinValueAction<number, 1, undefined>, v.DescriptionAction<number, "Leverage value used.">]>;
|
|
82
|
+
readonly rawUsd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of USD used (1 = $1).">]>;
|
|
83
|
+
}, undefined>, v.ObjectSchema<{
|
|
84
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"cross", undefined>, v.DescriptionAction<"cross", "Leverage type.">]>;
|
|
85
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.MinValueAction<number, 1, undefined>, v.DescriptionAction<number, "Leverage value used.">]>;
|
|
86
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
87
|
+
type: "isolated";
|
|
88
|
+
value: number;
|
|
89
|
+
rawUsd: string;
|
|
90
|
+
} | {
|
|
91
|
+
type: "cross";
|
|
92
|
+
value: number;
|
|
93
|
+
}, "Leverage details.">]>;
|
|
94
|
+
readonly entryPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Average entry price.">]>;
|
|
95
|
+
readonly positionValue: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Position value.">]>;
|
|
96
|
+
readonly unrealizedPnl: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Unrealized profit and loss.">]>;
|
|
97
|
+
readonly returnOnEquity: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Return on equity.">]>;
|
|
98
|
+
readonly liquidationPx: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, undefined>, v.DescriptionAction<string | null, "Liquidation price.">]>;
|
|
99
|
+
readonly marginUsed: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Margin used.">]>;
|
|
100
|
+
readonly maxLeverage: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.MinValueAction<number, 1, undefined>, v.DescriptionAction<number, "Maximum allowed leverage.">]>;
|
|
101
|
+
readonly cumFunding: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
102
|
+
readonly allTime: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total funding paid or received since account opening.">]>;
|
|
103
|
+
readonly sinceOpen: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Funding accumulated since the position was opened.">]>;
|
|
104
|
+
readonly sinceChange: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Funding accumulated since the last change in position size.">]>;
|
|
105
|
+
}, undefined>, v.DescriptionAction<{
|
|
106
|
+
allTime: string;
|
|
107
|
+
sinceOpen: string;
|
|
108
|
+
sinceChange: string;
|
|
109
|
+
}, "Cumulative funding details.">]>;
|
|
110
|
+
}, undefined>, v.DescriptionAction<{
|
|
111
|
+
coin: string;
|
|
112
|
+
szi: string;
|
|
113
|
+
leverage: {
|
|
114
|
+
type: "isolated";
|
|
115
|
+
value: number;
|
|
116
|
+
rawUsd: string;
|
|
117
|
+
} | {
|
|
118
|
+
type: "cross";
|
|
119
|
+
value: number;
|
|
120
|
+
};
|
|
121
|
+
entryPx: string;
|
|
122
|
+
positionValue: string;
|
|
123
|
+
unrealizedPnl: string;
|
|
124
|
+
returnOnEquity: string;
|
|
125
|
+
liquidationPx: string | null;
|
|
126
|
+
marginUsed: string;
|
|
127
|
+
maxLeverage: number;
|
|
128
|
+
cumFunding: {
|
|
129
|
+
allTime: string;
|
|
130
|
+
sinceOpen: string;
|
|
131
|
+
sinceChange: string;
|
|
132
|
+
};
|
|
133
|
+
}, "Position details.">]>;
|
|
134
|
+
}, undefined>, v.DescriptionAction<{
|
|
135
|
+
type: "oneWay";
|
|
136
|
+
position: {
|
|
137
|
+
coin: string;
|
|
138
|
+
szi: string;
|
|
139
|
+
leverage: {
|
|
140
|
+
type: "isolated";
|
|
141
|
+
value: number;
|
|
142
|
+
rawUsd: string;
|
|
143
|
+
} | {
|
|
144
|
+
type: "cross";
|
|
145
|
+
value: number;
|
|
146
|
+
};
|
|
147
|
+
entryPx: string;
|
|
148
|
+
positionValue: string;
|
|
149
|
+
unrealizedPnl: string;
|
|
150
|
+
returnOnEquity: string;
|
|
151
|
+
liquidationPx: string | null;
|
|
152
|
+
marginUsed: string;
|
|
153
|
+
maxLeverage: number;
|
|
154
|
+
cumFunding: {
|
|
155
|
+
allTime: string;
|
|
156
|
+
sinceOpen: string;
|
|
157
|
+
sinceChange: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
}, "Position for a specific asset.">]>, undefined>, v.DescriptionAction<{
|
|
161
|
+
type: "oneWay";
|
|
162
|
+
position: {
|
|
163
|
+
coin: string;
|
|
164
|
+
szi: string;
|
|
165
|
+
leverage: {
|
|
166
|
+
type: "isolated";
|
|
167
|
+
value: number;
|
|
168
|
+
rawUsd: string;
|
|
169
|
+
} | {
|
|
170
|
+
type: "cross";
|
|
171
|
+
value: number;
|
|
172
|
+
};
|
|
173
|
+
entryPx: string;
|
|
174
|
+
positionValue: string;
|
|
175
|
+
unrealizedPnl: string;
|
|
176
|
+
returnOnEquity: string;
|
|
177
|
+
liquidationPx: string | null;
|
|
178
|
+
marginUsed: string;
|
|
179
|
+
maxLeverage: number;
|
|
180
|
+
cumFunding: {
|
|
181
|
+
allTime: string;
|
|
182
|
+
sinceOpen: string;
|
|
183
|
+
sinceChange: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
}[], "Array of asset positions.">]>;
|
|
187
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when data was retrieved (in ms since epoch).">]>;
|
|
188
|
+
}, undefined>, v.DescriptionAction<{
|
|
189
|
+
marginSummary: {
|
|
190
|
+
accountValue: string;
|
|
191
|
+
totalNtlPos: string;
|
|
192
|
+
totalRawUsd: string;
|
|
193
|
+
totalMarginUsed: string;
|
|
194
|
+
};
|
|
195
|
+
crossMarginSummary: {
|
|
196
|
+
accountValue: string;
|
|
197
|
+
totalNtlPos: string;
|
|
198
|
+
totalRawUsd: string;
|
|
199
|
+
totalMarginUsed: string;
|
|
200
|
+
};
|
|
201
|
+
crossMaintenanceMarginUsed: string;
|
|
202
|
+
withdrawable: string;
|
|
203
|
+
assetPositions: {
|
|
204
|
+
type: "oneWay";
|
|
205
|
+
position: {
|
|
206
|
+
coin: string;
|
|
207
|
+
szi: string;
|
|
208
|
+
leverage: {
|
|
209
|
+
type: "isolated";
|
|
210
|
+
value: number;
|
|
211
|
+
rawUsd: string;
|
|
212
|
+
} | {
|
|
213
|
+
type: "cross";
|
|
214
|
+
value: number;
|
|
215
|
+
};
|
|
216
|
+
entryPx: string;
|
|
217
|
+
positionValue: string;
|
|
218
|
+
unrealizedPnl: string;
|
|
219
|
+
returnOnEquity: string;
|
|
220
|
+
liquidationPx: string | null;
|
|
221
|
+
marginUsed: string;
|
|
222
|
+
maxLeverage: number;
|
|
223
|
+
cumFunding: {
|
|
224
|
+
allTime: string;
|
|
225
|
+
sinceOpen: string;
|
|
226
|
+
sinceChange: string;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
}[];
|
|
230
|
+
time: number;
|
|
231
|
+
}, "Account summary for perpetual trading.">]>;
|
|
232
|
+
/** Total equity in vaults. */
|
|
233
|
+
readonly totalVaultEquity: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total equity in vaults.">]>;
|
|
234
|
+
/** Array of user open orders with frontend information. */
|
|
235
|
+
readonly openOrders: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
236
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
237
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
238
|
+
readonly limitPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Limit price.">]>;
|
|
239
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
240
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
241
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the order was placed (in ms since epoch).">]>;
|
|
242
|
+
readonly origSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Original size at order placement.">]>;
|
|
243
|
+
readonly triggerCondition: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Condition for triggering the order.">]>;
|
|
244
|
+
readonly isTrigger: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a trigger order.">]>;
|
|
245
|
+
readonly triggerPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Trigger price.">]>;
|
|
246
|
+
readonly children: v.SchemaWithPipe<readonly [v.ArraySchema<v.LazySchema<any>, undefined>, v.DescriptionAction<any[], "Child orders associated with this order.">]>;
|
|
247
|
+
readonly isPositionTpsl: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a position TP/SL order.">]>;
|
|
248
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates whether the order is reduce-only.">]>;
|
|
249
|
+
readonly orderType: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Market", undefined>, v.LiteralSchema<"Limit", undefined>, v.LiteralSchema<"Stop Market", undefined>, v.LiteralSchema<"Stop Limit", undefined>, v.LiteralSchema<"Take Profit Market", undefined>, v.LiteralSchema<"Take Profit Limit", undefined>], undefined>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", string>]>;
|
|
250
|
+
readonly tif: v.NullableSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Gtc", undefined>, v.LiteralSchema<"Ioc", undefined>, v.LiteralSchema<"Alo", undefined>, v.LiteralSchema<"FrontendMarket", undefined>, v.LiteralSchema<"LiquidationMarket", undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket", string>]>, undefined>;
|
|
251
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, undefined>, v.DescriptionAction<`0x${string}` | null, "Client Order ID.">]>;
|
|
252
|
+
}, undefined>, v.DescriptionAction<{
|
|
253
|
+
coin: string;
|
|
254
|
+
side: "B" | "A";
|
|
255
|
+
limitPx: string;
|
|
256
|
+
sz: string;
|
|
257
|
+
oid: number;
|
|
258
|
+
timestamp: number;
|
|
259
|
+
origSz: string;
|
|
260
|
+
triggerCondition: string;
|
|
261
|
+
isTrigger: boolean;
|
|
262
|
+
triggerPx: string;
|
|
263
|
+
children: any[];
|
|
264
|
+
isPositionTpsl: boolean;
|
|
265
|
+
reduceOnly: boolean;
|
|
266
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
267
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
268
|
+
cloid: `0x${string}` | null;
|
|
269
|
+
}, "Open order with additional display information.">]>, undefined>, undefined>, v.DescriptionAction<{
|
|
270
|
+
coin: string;
|
|
271
|
+
side: "B" | "A";
|
|
272
|
+
limitPx: string;
|
|
273
|
+
sz: string;
|
|
274
|
+
oid: number;
|
|
275
|
+
timestamp: number;
|
|
276
|
+
origSz: string;
|
|
277
|
+
triggerCondition: string;
|
|
278
|
+
isTrigger: boolean;
|
|
279
|
+
triggerPx: string;
|
|
280
|
+
children: any[];
|
|
281
|
+
isPositionTpsl: boolean;
|
|
282
|
+
reduceOnly: boolean;
|
|
283
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
284
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
285
|
+
cloid: `0x${string}` | null;
|
|
286
|
+
}[] | undefined, "User open orders with frontend information.">]>;
|
|
287
|
+
/** Context for each perpetual asset. */
|
|
288
|
+
readonly assetCtxs: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
289
|
+
readonly prevDayPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Previous day's closing price.">]>;
|
|
290
|
+
readonly dayNtlVlm: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Daily notional volume.">]>;
|
|
291
|
+
readonly markPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Mark price.">]>;
|
|
292
|
+
readonly midPx: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, undefined>, v.DescriptionAction<string | null, "Mid price.">]>;
|
|
293
|
+
readonly funding: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Funding rate.">]>;
|
|
294
|
+
readonly openInterest: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total open interest.">]>;
|
|
295
|
+
readonly premium: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, undefined>, v.DescriptionAction<string | null, "Premium price.">]>;
|
|
296
|
+
readonly oraclePx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Oracle price.">]>;
|
|
297
|
+
readonly impactPxs: v.SchemaWithPipe<readonly [v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, v.DescriptionAction<string[] | null, "Array of impact prices.">]>;
|
|
298
|
+
readonly dayBaseVlm: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, string>, v.TrimAction, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Daily volume in base currency.">]>;
|
|
299
|
+
}, undefined>, v.DescriptionAction<{
|
|
300
|
+
prevDayPx: string;
|
|
301
|
+
dayNtlVlm: string;
|
|
302
|
+
markPx: string;
|
|
303
|
+
midPx: string | null;
|
|
304
|
+
funding: string;
|
|
305
|
+
openInterest: string;
|
|
306
|
+
premium: string | null;
|
|
307
|
+
oraclePx: string;
|
|
308
|
+
impactPxs: string[] | null;
|
|
309
|
+
dayBaseVlm: string;
|
|
310
|
+
}, "Context for a specific perpetual asset.">]>, undefined>, v.DescriptionAction<{
|
|
311
|
+
prevDayPx: string;
|
|
312
|
+
dayNtlVlm: string;
|
|
313
|
+
markPx: string;
|
|
314
|
+
midPx: string | null;
|
|
315
|
+
funding: string;
|
|
316
|
+
openInterest: string;
|
|
317
|
+
premium: string | null;
|
|
318
|
+
oraclePx: string;
|
|
319
|
+
impactPxs: string[] | null;
|
|
320
|
+
dayBaseVlm: string;
|
|
321
|
+
}[], "Array of contexts for each perpetual asset.">]>;
|
|
322
|
+
/** Assets currently at their open interest cap. */
|
|
323
|
+
readonly perpsAtOpenInterestCap: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, v.DescriptionAction<string[] | undefined, "Assets currently at their open interest cap.">]>;
|
|
324
|
+
/** Array of leading vaults. */
|
|
325
|
+
readonly leadingVaults: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
326
|
+
/** Address of the vault. */
|
|
327
|
+
readonly address: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the vault.">]>;
|
|
328
|
+
/** Name of the vault. */
|
|
329
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Name of the vault.">]>;
|
|
330
|
+
}, undefined>, v.DescriptionAction<{
|
|
331
|
+
address: `0x${string}`;
|
|
332
|
+
name: string;
|
|
333
|
+
}, "Vault that a user is leading.">]>, undefined>, undefined>, v.DescriptionAction<{
|
|
334
|
+
address: `0x${string}`;
|
|
335
|
+
name: string;
|
|
336
|
+
}[] | undefined, "Array of leading vaults.">]>;
|
|
337
|
+
}, undefined>, undefined>, v.DescriptionAction<{
|
|
338
|
+
clearinghouseState: {
|
|
339
|
+
marginSummary: {
|
|
340
|
+
accountValue: string;
|
|
341
|
+
totalNtlPos: string;
|
|
342
|
+
totalRawUsd: string;
|
|
343
|
+
totalMarginUsed: string;
|
|
344
|
+
};
|
|
345
|
+
crossMarginSummary: {
|
|
346
|
+
accountValue: string;
|
|
347
|
+
totalNtlPos: string;
|
|
348
|
+
totalRawUsd: string;
|
|
349
|
+
totalMarginUsed: string;
|
|
350
|
+
};
|
|
351
|
+
crossMaintenanceMarginUsed: string;
|
|
352
|
+
withdrawable: string;
|
|
353
|
+
assetPositions: {
|
|
354
|
+
type: "oneWay";
|
|
355
|
+
position: {
|
|
356
|
+
coin: string;
|
|
357
|
+
szi: string;
|
|
358
|
+
leverage: {
|
|
359
|
+
type: "isolated";
|
|
360
|
+
value: number;
|
|
361
|
+
rawUsd: string;
|
|
362
|
+
} | {
|
|
363
|
+
type: "cross";
|
|
364
|
+
value: number;
|
|
365
|
+
};
|
|
366
|
+
entryPx: string;
|
|
367
|
+
positionValue: string;
|
|
368
|
+
unrealizedPnl: string;
|
|
369
|
+
returnOnEquity: string;
|
|
370
|
+
liquidationPx: string | null;
|
|
371
|
+
marginUsed: string;
|
|
372
|
+
maxLeverage: number;
|
|
373
|
+
cumFunding: {
|
|
374
|
+
allTime: string;
|
|
375
|
+
sinceOpen: string;
|
|
376
|
+
sinceChange: string;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
}[];
|
|
380
|
+
time: number;
|
|
381
|
+
};
|
|
382
|
+
totalVaultEquity: string;
|
|
383
|
+
openOrders?: {
|
|
384
|
+
coin: string;
|
|
385
|
+
side: "B" | "A";
|
|
386
|
+
limitPx: string;
|
|
387
|
+
sz: string;
|
|
388
|
+
oid: number;
|
|
389
|
+
timestamp: number;
|
|
390
|
+
origSz: string;
|
|
391
|
+
triggerCondition: string;
|
|
392
|
+
isTrigger: boolean;
|
|
393
|
+
triggerPx: string;
|
|
394
|
+
children: any[];
|
|
395
|
+
isPositionTpsl: boolean;
|
|
396
|
+
reduceOnly: boolean;
|
|
397
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
398
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
399
|
+
cloid: `0x${string}` | null;
|
|
400
|
+
}[] | undefined;
|
|
401
|
+
assetCtxs: {
|
|
402
|
+
prevDayPx: string;
|
|
403
|
+
dayNtlVlm: string;
|
|
404
|
+
markPx: string;
|
|
405
|
+
midPx: string | null;
|
|
406
|
+
funding: string;
|
|
407
|
+
openInterest: string;
|
|
408
|
+
premium: string | null;
|
|
409
|
+
oraclePx: string;
|
|
410
|
+
impactPxs: string[] | null;
|
|
411
|
+
dayBaseVlm: string;
|
|
412
|
+
}[];
|
|
413
|
+
perpsAtOpenInterestCap?: string[] | undefined;
|
|
414
|
+
leadingVaults?: {
|
|
415
|
+
address: `0x${string}`;
|
|
416
|
+
name: string;
|
|
417
|
+
}[] | undefined;
|
|
418
|
+
}[], "Array of perpetual DEX states.">]>;
|
|
419
|
+
}, undefined>, v.DescriptionAction<{
|
|
420
|
+
userState: {
|
|
421
|
+
agentAddress: `0x${string}` | null;
|
|
422
|
+
agentValidUntil: number | null;
|
|
423
|
+
cumLedger: string;
|
|
424
|
+
serverTime: number;
|
|
425
|
+
isVault: boolean;
|
|
426
|
+
user: `0x${string}`;
|
|
427
|
+
optOutOfSpotDusting?: true | undefined;
|
|
428
|
+
dexAbstractionEnabled?: boolean | undefined;
|
|
429
|
+
};
|
|
430
|
+
perpDexStates: {
|
|
431
|
+
clearinghouseState: {
|
|
432
|
+
marginSummary: {
|
|
433
|
+
accountValue: string;
|
|
434
|
+
totalNtlPos: string;
|
|
435
|
+
totalRawUsd: string;
|
|
436
|
+
totalMarginUsed: string;
|
|
437
|
+
};
|
|
438
|
+
crossMarginSummary: {
|
|
439
|
+
accountValue: string;
|
|
440
|
+
totalNtlPos: string;
|
|
441
|
+
totalRawUsd: string;
|
|
442
|
+
totalMarginUsed: string;
|
|
443
|
+
};
|
|
444
|
+
crossMaintenanceMarginUsed: string;
|
|
445
|
+
withdrawable: string;
|
|
446
|
+
assetPositions: {
|
|
447
|
+
type: "oneWay";
|
|
448
|
+
position: {
|
|
449
|
+
coin: string;
|
|
450
|
+
szi: string;
|
|
451
|
+
leverage: {
|
|
452
|
+
type: "isolated";
|
|
453
|
+
value: number;
|
|
454
|
+
rawUsd: string;
|
|
455
|
+
} | {
|
|
456
|
+
type: "cross";
|
|
457
|
+
value: number;
|
|
458
|
+
};
|
|
459
|
+
entryPx: string;
|
|
460
|
+
positionValue: string;
|
|
461
|
+
unrealizedPnl: string;
|
|
462
|
+
returnOnEquity: string;
|
|
463
|
+
liquidationPx: string | null;
|
|
464
|
+
marginUsed: string;
|
|
465
|
+
maxLeverage: number;
|
|
466
|
+
cumFunding: {
|
|
467
|
+
allTime: string;
|
|
468
|
+
sinceOpen: string;
|
|
469
|
+
sinceChange: string;
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
}[];
|
|
473
|
+
time: number;
|
|
474
|
+
};
|
|
475
|
+
totalVaultEquity: string;
|
|
476
|
+
openOrders?: {
|
|
477
|
+
coin: string;
|
|
478
|
+
side: "B" | "A";
|
|
479
|
+
limitPx: string;
|
|
480
|
+
sz: string;
|
|
481
|
+
oid: number;
|
|
482
|
+
timestamp: number;
|
|
483
|
+
origSz: string;
|
|
484
|
+
triggerCondition: string;
|
|
485
|
+
isTrigger: boolean;
|
|
486
|
+
triggerPx: string;
|
|
487
|
+
children: any[];
|
|
488
|
+
isPositionTpsl: boolean;
|
|
489
|
+
reduceOnly: boolean;
|
|
490
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
491
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
492
|
+
cloid: `0x${string}` | null;
|
|
493
|
+
}[] | undefined;
|
|
494
|
+
assetCtxs: {
|
|
495
|
+
prevDayPx: string;
|
|
496
|
+
dayNtlVlm: string;
|
|
497
|
+
markPx: string;
|
|
498
|
+
midPx: string | null;
|
|
499
|
+
funding: string;
|
|
500
|
+
openInterest: string;
|
|
501
|
+
premium: string | null;
|
|
502
|
+
oraclePx: string;
|
|
503
|
+
impactPxs: string[] | null;
|
|
504
|
+
dayBaseVlm: string;
|
|
505
|
+
}[];
|
|
506
|
+
perpsAtOpenInterestCap?: string[] | undefined;
|
|
507
|
+
leadingVaults?: {
|
|
508
|
+
address: `0x${string}`;
|
|
509
|
+
name: string;
|
|
510
|
+
}[] | undefined;
|
|
511
|
+
}[];
|
|
512
|
+
}, "Comprehensive user and market data.">]>;
|
|
513
|
+
export type WebData3Event = v.InferOutput<typeof WebData3Event>;
|
|
514
|
+
/** Request parameters for the {@linkcode webData3} function. */
|
|
515
|
+
export type WebData3Parameters = Omit<v.InferInput<typeof WebData3Request>, "type">;
|
|
516
|
+
/**
|
|
517
|
+
* Subscribe to comprehensive user and market data updates.
|
|
518
|
+
* @param config - General configuration for Subscription API subscriptions.
|
|
519
|
+
* @param params - Parameters specific to the API subscription.
|
|
520
|
+
* @param listener - A callback function to be called when the event is received.
|
|
521
|
+
* @returns A request-promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
522
|
+
*
|
|
523
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
524
|
+
*
|
|
525
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
526
|
+
* @example
|
|
527
|
+
* ```ts
|
|
528
|
+
* import { WebSocketTransport } from "@nktkas/hyperliquid";
|
|
529
|
+
* import { webData3 } from "@nktkas/hyperliquid/api/subscription";
|
|
530
|
+
*
|
|
531
|
+
* const transport = new WebSocketTransport();
|
|
532
|
+
*
|
|
533
|
+
* const sub = await webData3(
|
|
534
|
+
* { transport },
|
|
535
|
+
* { user: "0x..." },
|
|
536
|
+
* (data) => console.log(data),
|
|
537
|
+
* );
|
|
538
|
+
* ```
|
|
539
|
+
*/
|
|
540
|
+
export declare function webData3(config: SubscriptionRequestConfig, params: DeepImmutable<WebData3Parameters>, listener: (data: WebData3Event) => void): Promise<Subscription>;
|
|
541
|
+
//# sourceMappingURL=webData3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webData3.d.ts","sourceRoot":"","sources":["../../../../src/src/api/subscription/webData3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAW,KAAK,aAAa,EAA4C,MAAM,aAAa,CAAC;AACpG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAQ5D,iEAAiE;AACjE,eAAO,MAAM,eAAe;IAGtB,4BAA4B;;IAK5B,oBAAoB;;;;;kEAQtB,CAAC;AACL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpE,mDAAmD;AACnD,eAAO,MAAM,aAAa;IAGpB,8BAA8B;;QAG1B,mCAAmC;;QAKnC,gDAAgD;;QAKhD,+BAA+B;;QAK/B,4CAA4C;;QAK5C,uCAAuC;;QAKvC,oBAAoB;;QAKpB,sDAAsD;;QAKtD,0CAA0C;;;;;;;;;;;;IAQ9C,qCAAqC;;QAI/B,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAE7C,8BAA8B;;QAK9B,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAK3D,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAExC,mDAAmD;;QAKnD,+BAA+B;;YAOrB,4BAA4B;;YAK5B,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAmB3C,CAAC;AACL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC;AAIhE,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,EAAE,MAAM,CAAC,CAAC;AAEpF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,yBAAyB,EACjC,MAAM,EAAE,aAAa,CAAC,kBAAkB,CAAC,EACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,GACtC,OAAO,CAAC,YAAY,CAAC,CAOvB"}
|