@nktkas/hyperliquid 0.30.0 → 0.30.3
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/README.md +83 -19
- package/esm/bin/cli.js +10 -0
- package/esm/bin/cli.js.map +1 -1
- package/esm/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.d.ts +94 -0
- package/esm/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.js +138 -0
- package/esm/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.js.map +1 -0
- package/esm/src/api/_schemas.d.ts +4 -4
- package/esm/src/api/_schemas.d.ts.map +1 -1
- package/esm/src/api/_schemas.js +8 -4
- package/esm/src/api/_schemas.js.map +1 -1
- package/esm/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
- package/esm/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/_base/_nonce.js +3 -2
- package/esm/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
- package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
- package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/_base/_semaphore.js +34 -47
- package/esm/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
- package/esm/src/api/exchange/_methods/_base/execute.js +3 -3
- package/esm/src/api/exchange/_methods/_base/execute.js.map +1 -1
- package/esm/src/api/exchange/_methods/agentEnableDexAbstraction.d.ts +2 -2
- package/esm/src/api/exchange/_methods/approveAgent.d.ts +24 -13
- package/esm/src/api/exchange/_methods/approveAgent.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/approveAgent.js +21 -3
- package/esm/src/api/exchange/_methods/approveAgent.js.map +1 -1
- package/esm/src/api/exchange/_methods/approveBuilderFee.d.ts +4 -4
- package/esm/src/api/exchange/_methods/batchModify.d.ts +29 -29
- package/esm/src/api/exchange/_methods/borrowLend.d.ts +173 -0
- package/esm/src/api/exchange/_methods/borrowLend.d.ts.map +1 -0
- package/esm/src/api/exchange/_methods/borrowLend.js +75 -0
- package/esm/src/api/exchange/_methods/borrowLend.js.map +1 -0
- package/esm/src/api/exchange/_methods/cDeposit.d.ts +7 -7
- package/esm/src/api/exchange/_methods/cSignerAction.d.ts +2 -2
- package/esm/src/api/exchange/_methods/cValidatorAction.d.ts +11 -11
- package/esm/src/api/exchange/_methods/cWithdraw.d.ts +7 -7
- package/esm/src/api/exchange/_methods/cancel.d.ts +8 -8
- package/esm/src/api/exchange/_methods/cancelByCloid.d.ts +5 -5
- package/esm/src/api/exchange/_methods/claimRewards.d.ts +2 -2
- package/esm/src/api/exchange/_methods/convertToMultiSigUser.d.ts +10 -10
- package/esm/src/api/exchange/_methods/createSubAccount.d.ts +2 -2
- package/esm/src/api/exchange/_methods/createVault.d.ts +8 -8
- package/esm/src/api/exchange/_methods/evmUserModify.d.ts +2 -2
- package/esm/src/api/exchange/_methods/linkStakingUser.d.ts +4 -4
- package/esm/src/api/exchange/_methods/modify.d.ts +19 -19
- package/esm/src/api/exchange/_methods/noop.d.ts +2 -2
- package/esm/src/api/exchange/_methods/order.d.ts +31 -31
- package/esm/src/api/exchange/_methods/order.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/order.js +4 -2
- package/esm/src/api/exchange/_methods/order.js.map +1 -1
- package/esm/src/api/exchange/_methods/perpDeploy.d.ts +53 -53
- package/esm/src/api/exchange/_methods/registerReferrer.d.ts +2 -2
- package/esm/src/api/exchange/_methods/reserveRequestWeight.d.ts +5 -5
- package/esm/src/api/exchange/_methods/scheduleCancel.d.ts +5 -5
- package/esm/src/api/exchange/_methods/sendAsset.d.ts +17 -17
- package/esm/src/api/exchange/_methods/setDisplayName.d.ts +2 -2
- package/esm/src/api/exchange/_methods/setReferrer.d.ts +2 -2
- package/esm/src/api/exchange/_methods/spotDeploy.d.ts +53 -53
- package/esm/src/api/exchange/_methods/spotSend.d.ts +12 -12
- package/esm/src/api/exchange/_methods/spotUser.d.ts +2 -2
- package/esm/src/api/exchange/_methods/subAccountModify.d.ts +2 -2
- package/esm/src/api/exchange/_methods/subAccountSpotTransfer.d.ts +5 -5
- package/esm/src/api/exchange/_methods/subAccountTransfer.d.ts +5 -5
- package/esm/src/api/exchange/_methods/tokenDelegate.d.ts +7 -7
- package/esm/src/api/exchange/_methods/twapCancel.d.ts +8 -8
- package/esm/src/api/exchange/_methods/twapOrder.d.ts +12 -12
- package/esm/src/api/exchange/_methods/updateIsolatedMargin.d.ts +8 -8
- package/esm/src/api/exchange/_methods/updateLeverage.d.ts +8 -8
- package/esm/src/api/exchange/_methods/usdClassTransfer.d.ts +7 -7
- package/esm/src/api/exchange/_methods/usdSend.d.ts +12 -12
- package/esm/src/api/exchange/_methods/userDexAbstraction.d.ts +4 -4
- package/esm/src/api/exchange/_methods/userPortfolioMargin.d.ts +193 -0
- package/esm/src/api/exchange/_methods/userPortfolioMargin.d.ts.map +1 -0
- package/esm/src/api/exchange/_methods/userPortfolioMargin.js +92 -0
- package/esm/src/api/exchange/_methods/userPortfolioMargin.js.map +1 -0
- package/esm/src/api/exchange/_methods/validatorL1Stream.d.ts +5 -5
- package/esm/src/api/exchange/_methods/vaultDistribute.d.ts +5 -5
- package/esm/src/api/exchange/_methods/vaultModify.d.ts +2 -2
- package/esm/src/api/exchange/_methods/vaultTransfer.d.ts +5 -5
- package/esm/src/api/exchange/_methods/withdraw3.d.ts +12 -12
- package/esm/src/api/exchange/client.d.ts +8 -0
- package/esm/src/api/exchange/client.d.ts.map +1 -1
- package/esm/src/api/exchange/client.js +10 -0
- package/esm/src/api/exchange/client.js.map +1 -1
- package/esm/src/api/exchange/mod.d.ts +2 -0
- package/esm/src/api/exchange/mod.d.ts.map +1 -1
- package/esm/src/api/exchange/mod.js +2 -0
- package/esm/src/api/exchange/mod.js.map +1 -1
- package/esm/src/api/info/_methods/_base/commonSchemas.d.ts +43 -43
- package/esm/src/api/info/_methods/activeAssetData.d.ts +6 -6
- package/esm/src/api/info/_methods/activeAssetData.js +2 -2
- package/esm/src/api/info/_methods/activeAssetData.js.map +1 -1
- package/esm/src/api/info/_methods/alignedQuoteTokenInfo.d.ts +5 -5
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.d.ts +71 -0
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.d.ts.map +1 -0
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.js +56 -0
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.js.map +1 -0
- package/esm/src/api/info/_methods/allMids.d.ts +1 -1
- package/esm/src/api/info/_methods/allPerpMetas.d.ts +7 -7
- package/esm/src/api/info/_methods/blockDetails.d.ts +6 -6
- package/esm/src/api/info/_methods/borrowLendReserveState.d.ts +79 -0
- package/esm/src/api/info/_methods/borrowLendReserveState.d.ts.map +1 -0
- package/esm/src/api/info/_methods/borrowLendReserveState.js +76 -0
- package/esm/src/api/info/_methods/borrowLendReserveState.js.map +1 -0
- package/esm/src/api/info/_methods/borrowLendUserState.d.ts +103 -0
- package/esm/src/api/info/_methods/borrowLendUserState.d.ts.map +1 -0
- package/esm/src/api/info/_methods/borrowLendUserState.js +85 -0
- package/esm/src/api/info/_methods/borrowLendUserState.js.map +1 -0
- package/esm/src/api/info/_methods/candleSnapshot.d.ts +10 -10
- package/esm/src/api/info/_methods/clearinghouseState.d.ts +25 -25
- package/esm/src/api/info/_methods/clearinghouseState.js +3 -3
- package/esm/src/api/info/_methods/clearinghouseState.js.map +1 -1
- package/esm/src/api/info/_methods/delegations.d.ts +2 -2
- package/esm/src/api/info/_methods/delegatorHistory.d.ts +4 -4
- package/esm/src/api/info/_methods/delegatorRewards.d.ts +2 -2
- package/esm/src/api/info/_methods/delegatorSummary.d.ts +4 -4
- package/esm/src/api/info/_methods/exchangeStatus.d.ts +1 -1
- package/esm/src/api/info/_methods/extraAgents.d.ts +1 -1
- package/esm/src/api/info/_methods/frontendOpenOrders.d.ts +6 -6
- package/esm/src/api/info/_methods/fundingHistory.d.ts +5 -5
- package/esm/src/api/info/_methods/historicalOrders.d.ts +7 -7
- package/esm/src/api/info/_methods/l2Book.d.ts +7 -7
- package/esm/src/api/info/_methods/marginTable.d.ts +3 -3
- package/esm/src/api/info/_methods/maxMarketOrderNtls.d.ts +1 -1
- package/esm/src/api/info/_methods/maxMarketOrderNtls.d.ts.map +1 -1
- package/esm/src/api/info/_methods/meta.d.ts +7 -7
- package/esm/src/api/info/_methods/metaAndAssetCtxs.d.ts +16 -16
- package/esm/src/api/info/_methods/openOrders.d.ts +5 -5
- package/esm/src/api/info/_methods/orderStatus.d.ts +8 -8
- package/esm/src/api/info/_methods/perpDeployAuctionStatus.d.ts +5 -5
- package/esm/src/api/info/_methods/perpDexLimits.d.ts +4 -4
- package/esm/src/api/info/_methods/perpDexStatus.d.ts +1 -1
- package/esm/src/api/info/_methods/perpDexs.d.ts +6 -2
- package/esm/src/api/info/_methods/perpDexs.d.ts.map +1 -1
- package/esm/src/api/info/_methods/perpDexs.js +3 -1
- package/esm/src/api/info/_methods/perpDexs.js.map +1 -1
- package/esm/src/api/info/_methods/portfolio.d.ts +24 -24
- package/esm/src/api/info/_methods/preTransferCheck.d.ts +1 -1
- package/esm/src/api/info/_methods/predictedFundings.d.ts +3 -3
- package/esm/src/api/info/_methods/recentTrades.d.ts +4 -4
- package/esm/src/api/info/_methods/referral.d.ts +23 -23
- package/esm/src/api/info/_methods/spotClearinghouseState.d.ts +6 -6
- package/esm/src/api/info/_methods/spotDeployState.d.ts +15 -15
- package/esm/src/api/info/_methods/spotMeta.d.ts +43 -7
- package/esm/src/api/info/_methods/spotMeta.d.ts.map +1 -1
- package/esm/src/api/info/_methods/spotMeta.js +16 -0
- package/esm/src/api/info/_methods/spotMeta.js.map +1 -1
- package/esm/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts +52 -14
- package/esm/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts.map +1 -1
- package/esm/src/api/info/_methods/spotPairDeployAuctionStatus.d.ts +5 -5
- package/esm/src/api/info/_methods/subAccounts.d.ts +31 -31
- package/esm/src/api/info/_methods/subAccounts2.d.ts +31 -31
- package/esm/src/api/info/_methods/tokenDetails.d.ts +12 -12
- package/esm/src/api/info/_methods/twapHistory.d.ts +7 -7
- package/esm/src/api/info/_methods/txDetails.d.ts +2 -2
- package/esm/src/api/info/_methods/userBorrowLendInterest.d.ts +73 -0
- package/esm/src/api/info/_methods/userBorrowLendInterest.d.ts.map +1 -0
- package/esm/src/api/info/_methods/userBorrowLendInterest.js +72 -0
- package/esm/src/api/info/_methods/userBorrowLendInterest.js.map +1 -0
- package/esm/src/api/info/_methods/userDetails.d.ts +2 -2
- package/esm/src/api/info/_methods/userFees.d.ts +25 -25
- package/esm/src/api/info/_methods/userFills.d.ts +10 -10
- package/esm/src/api/info/_methods/userFillsByTime.d.ts +12 -12
- package/esm/src/api/info/_methods/userFunding.d.ts +9 -9
- package/esm/src/api/info/_methods/userFunding.js +2 -2
- package/esm/src/api/info/_methods/userFunding.js.map +1 -1
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts +93 -36
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.js +33 -0
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.js.map +1 -1
- package/esm/src/api/info/_methods/userRateLimit.d.ts +4 -4
- package/esm/src/api/info/_methods/userToMultiSigSigners.d.ts +1 -1
- package/esm/src/api/info/_methods/userTwapSliceFills.d.ts +10 -10
- package/esm/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +12 -12
- package/esm/src/api/info/_methods/userVaultEquities.d.ts +2 -2
- package/esm/src/api/info/_methods/validatorL1Votes.d.ts +1 -1
- package/esm/src/api/info/_methods/validatorSummaries.d.ts +9 -9
- package/esm/src/api/info/_methods/vaultDetails.d.ts +36 -36
- package/esm/src/api/info/_methods/vaultSummaries.d.ts +2 -2
- package/esm/src/api/info/_methods/webData2.d.ts +70 -70
- package/esm/src/api/info/client.d.ts +16 -0
- package/esm/src/api/info/client.d.ts.map +1 -1
- package/esm/src/api/info/client.js +20 -0
- package/esm/src/api/info/client.js.map +1 -1
- package/esm/src/api/info/mod.d.ts +4 -0
- package/esm/src/api/info/mod.d.ts.map +1 -1
- package/esm/src/api/info/mod.js +4 -0
- package/esm/src/api/info/mod.js.map +1 -1
- package/esm/src/api/subscription/_methods/activeAssetCtx.d.ts +9 -9
- package/esm/src/api/subscription/_methods/activeAssetData.d.ts +6 -6
- package/esm/src/api/subscription/_methods/activeSpotAssetCtx.d.ts +7 -7
- package/esm/src/api/subscription/_methods/allDexsAssetCtxs.d.ts +9 -9
- package/esm/src/api/subscription/_methods/allDexsClearinghouseState.d.ts +25 -25
- package/esm/src/api/subscription/_methods/allMids.d.ts +1 -1
- package/esm/src/api/subscription/_methods/assetCtxs.d.ts +11 -9
- package/esm/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/assetCtxs.js.map +1 -1
- package/esm/src/api/subscription/_methods/bbo.d.ts +7 -7
- package/esm/src/api/subscription/_methods/candle.d.ts +8 -8
- package/esm/src/api/subscription/_methods/clearinghouseState.d.ts +27 -25
- package/esm/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/clearinghouseState.js +2 -0
- package/esm/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
- package/esm/src/api/subscription/_methods/explorerBlock.d.ts +5 -3
- package/esm/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/explorerBlock.js +2 -0
- package/esm/src/api/subscription/_methods/explorerBlock.js.map +1 -1
- package/esm/src/api/subscription/_methods/explorerTxs.d.ts +4 -2
- package/esm/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/explorerTxs.js +2 -0
- package/esm/src/api/subscription/_methods/explorerTxs.js.map +1 -1
- package/esm/src/api/subscription/_methods/l2Book.d.ts +9 -9
- package/esm/src/api/subscription/_methods/openOrders.d.ts +6 -6
- package/esm/src/api/subscription/_methods/orderUpdates.d.ts +6 -6
- package/esm/src/api/subscription/_methods/spotAssetCtxs.d.ts +7 -7
- package/esm/src/api/subscription/_methods/spotState.d.ts +6 -6
- package/esm/src/api/subscription/_methods/trades.d.ts +4 -4
- package/esm/src/api/subscription/_methods/twapStates.d.ts +11 -6
- package/esm/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/twapStates.js +6 -1
- package/esm/src/api/subscription/_methods/twapStates.js.map +1 -1
- package/esm/src/api/subscription/_methods/userEvents.d.ts +35 -35
- package/esm/src/api/subscription/_methods/userFills.d.ts +10 -10
- package/esm/src/api/subscription/_methods/userFundings.d.ts +5 -5
- package/esm/src/api/subscription/_methods/userHistoricalOrders.d.ts +7 -7
- package/esm/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts +109 -34
- package/esm/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/esm/src/api/subscription/_methods/userTwapHistory.d.ts +7 -7
- package/esm/src/api/subscription/_methods/userTwapSliceFills.d.ts +10 -10
- package/esm/src/api/subscription/_methods/webData2.d.ts +70 -70
- package/esm/src/api/subscription/_methods/webData3.d.ts +4 -4
- package/esm/src/signing/mod.js +1 -1
- package/esm/src/signing/mod.js.map +1 -1
- package/package.json +2 -2
- package/script/bin/cli.js +10 -0
- package/script/bin/cli.js.map +1 -1
- package/script/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.d.ts +94 -0
- package/script/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.js +142 -0
- package/script/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.js.map +1 -0
- package/script/src/api/_schemas.d.ts +4 -4
- package/script/src/api/_schemas.d.ts.map +1 -1
- package/script/src/api/_schemas.js +8 -4
- package/script/src/api/_schemas.js.map +1 -1
- package/script/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
- package/script/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/_base/_nonce.js +4 -3
- package/script/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
- package/script/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
- package/script/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/_base/_semaphore.js +35 -50
- package/script/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
- package/script/src/api/exchange/_methods/_base/execute.js +2 -2
- package/script/src/api/exchange/_methods/_base/execute.js.map +1 -1
- package/script/src/api/exchange/_methods/agentEnableDexAbstraction.d.ts +2 -2
- package/script/src/api/exchange/_methods/approveAgent.d.ts +24 -13
- package/script/src/api/exchange/_methods/approveAgent.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/approveAgent.js +21 -3
- package/script/src/api/exchange/_methods/approveAgent.js.map +1 -1
- package/script/src/api/exchange/_methods/approveBuilderFee.d.ts +4 -4
- package/script/src/api/exchange/_methods/batchModify.d.ts +29 -29
- package/script/src/api/exchange/_methods/borrowLend.d.ts +173 -0
- package/script/src/api/exchange/_methods/borrowLend.d.ts.map +1 -0
- package/script/src/api/exchange/_methods/borrowLend.js +112 -0
- package/script/src/api/exchange/_methods/borrowLend.js.map +1 -0
- package/script/src/api/exchange/_methods/cDeposit.d.ts +7 -7
- package/script/src/api/exchange/_methods/cSignerAction.d.ts +2 -2
- package/script/src/api/exchange/_methods/cValidatorAction.d.ts +11 -11
- package/script/src/api/exchange/_methods/cWithdraw.d.ts +7 -7
- package/script/src/api/exchange/_methods/cancel.d.ts +8 -8
- package/script/src/api/exchange/_methods/cancelByCloid.d.ts +5 -5
- package/script/src/api/exchange/_methods/claimRewards.d.ts +2 -2
- package/script/src/api/exchange/_methods/convertToMultiSigUser.d.ts +10 -10
- package/script/src/api/exchange/_methods/createSubAccount.d.ts +2 -2
- package/script/src/api/exchange/_methods/createVault.d.ts +8 -8
- package/script/src/api/exchange/_methods/evmUserModify.d.ts +2 -2
- package/script/src/api/exchange/_methods/linkStakingUser.d.ts +4 -4
- package/script/src/api/exchange/_methods/modify.d.ts +19 -19
- package/script/src/api/exchange/_methods/noop.d.ts +2 -2
- package/script/src/api/exchange/_methods/order.d.ts +31 -31
- package/script/src/api/exchange/_methods/order.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/order.js +4 -2
- package/script/src/api/exchange/_methods/order.js.map +1 -1
- package/script/src/api/exchange/_methods/perpDeploy.d.ts +53 -53
- package/script/src/api/exchange/_methods/registerReferrer.d.ts +2 -2
- package/script/src/api/exchange/_methods/reserveRequestWeight.d.ts +5 -5
- package/script/src/api/exchange/_methods/scheduleCancel.d.ts +5 -5
- package/script/src/api/exchange/_methods/sendAsset.d.ts +17 -17
- package/script/src/api/exchange/_methods/setDisplayName.d.ts +2 -2
- package/script/src/api/exchange/_methods/setReferrer.d.ts +2 -2
- package/script/src/api/exchange/_methods/spotDeploy.d.ts +53 -53
- package/script/src/api/exchange/_methods/spotSend.d.ts +12 -12
- package/script/src/api/exchange/_methods/spotUser.d.ts +2 -2
- package/script/src/api/exchange/_methods/subAccountModify.d.ts +2 -2
- package/script/src/api/exchange/_methods/subAccountSpotTransfer.d.ts +5 -5
- package/script/src/api/exchange/_methods/subAccountTransfer.d.ts +5 -5
- package/script/src/api/exchange/_methods/tokenDelegate.d.ts +7 -7
- package/script/src/api/exchange/_methods/twapCancel.d.ts +8 -8
- package/script/src/api/exchange/_methods/twapOrder.d.ts +12 -12
- package/script/src/api/exchange/_methods/updateIsolatedMargin.d.ts +8 -8
- package/script/src/api/exchange/_methods/updateLeverage.d.ts +8 -8
- package/script/src/api/exchange/_methods/usdClassTransfer.d.ts +7 -7
- package/script/src/api/exchange/_methods/usdSend.d.ts +12 -12
- package/script/src/api/exchange/_methods/userDexAbstraction.d.ts +4 -4
- package/script/src/api/exchange/_methods/userPortfolioMargin.d.ts +193 -0
- package/script/src/api/exchange/_methods/userPortfolioMargin.d.ts.map +1 -0
- package/script/src/api/exchange/_methods/userPortfolioMargin.js +129 -0
- package/script/src/api/exchange/_methods/userPortfolioMargin.js.map +1 -0
- package/script/src/api/exchange/_methods/validatorL1Stream.d.ts +5 -5
- package/script/src/api/exchange/_methods/vaultDistribute.d.ts +5 -5
- package/script/src/api/exchange/_methods/vaultModify.d.ts +2 -2
- package/script/src/api/exchange/_methods/vaultTransfer.d.ts +5 -5
- package/script/src/api/exchange/_methods/withdraw3.d.ts +12 -12
- package/script/src/api/exchange/client.d.ts +8 -0
- package/script/src/api/exchange/client.d.ts.map +1 -1
- package/script/src/api/exchange/client.js +10 -0
- package/script/src/api/exchange/client.js.map +1 -1
- package/script/src/api/exchange/mod.d.ts +2 -0
- package/script/src/api/exchange/mod.d.ts.map +1 -1
- package/script/src/api/exchange/mod.js +2 -0
- package/script/src/api/exchange/mod.js.map +1 -1
- package/script/src/api/info/_methods/_base/commonSchemas.d.ts +43 -43
- package/script/src/api/info/_methods/activeAssetData.d.ts +6 -6
- package/script/src/api/info/_methods/activeAssetData.js +1 -1
- package/script/src/api/info/_methods/activeAssetData.js.map +1 -1
- package/script/src/api/info/_methods/alignedQuoteTokenInfo.d.ts +5 -5
- package/script/src/api/info/_methods/allBorrowLendReserveStates.d.ts +71 -0
- package/script/src/api/info/_methods/allBorrowLendReserveStates.d.ts.map +1 -0
- package/script/src/api/info/_methods/allBorrowLendReserveStates.js +93 -0
- package/script/src/api/info/_methods/allBorrowLendReserveStates.js.map +1 -0
- package/script/src/api/info/_methods/allMids.d.ts +1 -1
- package/script/src/api/info/_methods/allPerpMetas.d.ts +7 -7
- package/script/src/api/info/_methods/blockDetails.d.ts +6 -6
- package/script/src/api/info/_methods/borrowLendReserveState.d.ts +79 -0
- package/script/src/api/info/_methods/borrowLendReserveState.d.ts.map +1 -0
- package/script/src/api/info/_methods/borrowLendReserveState.js +113 -0
- package/script/src/api/info/_methods/borrowLendReserveState.js.map +1 -0
- package/script/src/api/info/_methods/borrowLendUserState.d.ts +103 -0
- package/script/src/api/info/_methods/borrowLendUserState.d.ts.map +1 -0
- package/script/src/api/info/_methods/borrowLendUserState.js +122 -0
- package/script/src/api/info/_methods/borrowLendUserState.js.map +1 -0
- package/script/src/api/info/_methods/candleSnapshot.d.ts +10 -10
- package/script/src/api/info/_methods/clearinghouseState.d.ts +25 -25
- package/script/src/api/info/_methods/clearinghouseState.js +3 -3
- package/script/src/api/info/_methods/clearinghouseState.js.map +1 -1
- package/script/src/api/info/_methods/delegations.d.ts +2 -2
- package/script/src/api/info/_methods/delegatorHistory.d.ts +4 -4
- package/script/src/api/info/_methods/delegatorRewards.d.ts +2 -2
- package/script/src/api/info/_methods/delegatorSummary.d.ts +4 -4
- package/script/src/api/info/_methods/exchangeStatus.d.ts +1 -1
- package/script/src/api/info/_methods/extraAgents.d.ts +1 -1
- package/script/src/api/info/_methods/frontendOpenOrders.d.ts +6 -6
- package/script/src/api/info/_methods/fundingHistory.d.ts +5 -5
- package/script/src/api/info/_methods/historicalOrders.d.ts +7 -7
- package/script/src/api/info/_methods/l2Book.d.ts +7 -7
- package/script/src/api/info/_methods/marginTable.d.ts +3 -3
- package/script/src/api/info/_methods/maxMarketOrderNtls.d.ts +1 -1
- package/script/src/api/info/_methods/maxMarketOrderNtls.d.ts.map +1 -1
- package/script/src/api/info/_methods/meta.d.ts +7 -7
- package/script/src/api/info/_methods/metaAndAssetCtxs.d.ts +16 -16
- package/script/src/api/info/_methods/openOrders.d.ts +5 -5
- package/script/src/api/info/_methods/orderStatus.d.ts +8 -8
- package/script/src/api/info/_methods/perpDeployAuctionStatus.d.ts +5 -5
- package/script/src/api/info/_methods/perpDexLimits.d.ts +4 -4
- package/script/src/api/info/_methods/perpDexStatus.d.ts +1 -1
- package/script/src/api/info/_methods/perpDexs.d.ts +6 -2
- package/script/src/api/info/_methods/perpDexs.d.ts.map +1 -1
- package/script/src/api/info/_methods/perpDexs.js +3 -1
- package/script/src/api/info/_methods/perpDexs.js.map +1 -1
- package/script/src/api/info/_methods/portfolio.d.ts +24 -24
- package/script/src/api/info/_methods/preTransferCheck.d.ts +1 -1
- package/script/src/api/info/_methods/predictedFundings.d.ts +3 -3
- package/script/src/api/info/_methods/recentTrades.d.ts +4 -4
- package/script/src/api/info/_methods/referral.d.ts +23 -23
- package/script/src/api/info/_methods/spotClearinghouseState.d.ts +6 -6
- package/script/src/api/info/_methods/spotDeployState.d.ts +15 -15
- package/script/src/api/info/_methods/spotMeta.d.ts +43 -7
- package/script/src/api/info/_methods/spotMeta.d.ts.map +1 -1
- package/script/src/api/info/_methods/spotMeta.js +16 -0
- package/script/src/api/info/_methods/spotMeta.js.map +1 -1
- package/script/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts +52 -14
- package/script/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts.map +1 -1
- package/script/src/api/info/_methods/spotPairDeployAuctionStatus.d.ts +5 -5
- package/script/src/api/info/_methods/subAccounts.d.ts +31 -31
- package/script/src/api/info/_methods/subAccounts2.d.ts +31 -31
- package/script/src/api/info/_methods/tokenDetails.d.ts +12 -12
- package/script/src/api/info/_methods/twapHistory.d.ts +7 -7
- package/script/src/api/info/_methods/txDetails.d.ts +2 -2
- package/script/src/api/info/_methods/userBorrowLendInterest.d.ts +73 -0
- package/script/src/api/info/_methods/userBorrowLendInterest.d.ts.map +1 -0
- package/script/src/api/info/_methods/userBorrowLendInterest.js +109 -0
- package/script/src/api/info/_methods/userBorrowLendInterest.js.map +1 -0
- package/script/src/api/info/_methods/userDetails.d.ts +2 -2
- package/script/src/api/info/_methods/userFees.d.ts +25 -25
- package/script/src/api/info/_methods/userFills.d.ts +10 -10
- package/script/src/api/info/_methods/userFillsByTime.d.ts +12 -12
- package/script/src/api/info/_methods/userFunding.d.ts +9 -9
- package/script/src/api/info/_methods/userFunding.js +2 -2
- package/script/src/api/info/_methods/userFunding.js.map +1 -1
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts +93 -36
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.js +33 -0
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.js.map +1 -1
- package/script/src/api/info/_methods/userRateLimit.d.ts +4 -4
- package/script/src/api/info/_methods/userToMultiSigSigners.d.ts +1 -1
- package/script/src/api/info/_methods/userTwapSliceFills.d.ts +10 -10
- package/script/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +12 -12
- package/script/src/api/info/_methods/userVaultEquities.d.ts +2 -2
- package/script/src/api/info/_methods/validatorL1Votes.d.ts +1 -1
- package/script/src/api/info/_methods/validatorSummaries.d.ts +9 -9
- package/script/src/api/info/_methods/vaultDetails.d.ts +36 -36
- package/script/src/api/info/_methods/vaultSummaries.d.ts +2 -2
- package/script/src/api/info/_methods/webData2.d.ts +70 -70
- package/script/src/api/info/client.d.ts +16 -0
- package/script/src/api/info/client.d.ts.map +1 -1
- package/script/src/api/info/client.js +20 -0
- package/script/src/api/info/client.js.map +1 -1
- package/script/src/api/info/mod.d.ts +4 -0
- package/script/src/api/info/mod.d.ts.map +1 -1
- package/script/src/api/info/mod.js +4 -0
- package/script/src/api/info/mod.js.map +1 -1
- package/script/src/api/subscription/_methods/activeAssetCtx.d.ts +9 -9
- package/script/src/api/subscription/_methods/activeAssetData.d.ts +6 -6
- package/script/src/api/subscription/_methods/activeSpotAssetCtx.d.ts +7 -7
- package/script/src/api/subscription/_methods/allDexsAssetCtxs.d.ts +9 -9
- package/script/src/api/subscription/_methods/allDexsClearinghouseState.d.ts +25 -25
- package/script/src/api/subscription/_methods/allMids.d.ts +1 -1
- package/script/src/api/subscription/_methods/assetCtxs.d.ts +11 -9
- package/script/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/assetCtxs.js.map +1 -1
- package/script/src/api/subscription/_methods/bbo.d.ts +7 -7
- package/script/src/api/subscription/_methods/candle.d.ts +8 -8
- package/script/src/api/subscription/_methods/clearinghouseState.d.ts +27 -25
- package/script/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/clearinghouseState.js +2 -0
- package/script/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
- package/script/src/api/subscription/_methods/explorerBlock.d.ts +5 -3
- package/script/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/explorerBlock.js +2 -0
- package/script/src/api/subscription/_methods/explorerBlock.js.map +1 -1
- package/script/src/api/subscription/_methods/explorerTxs.d.ts +4 -2
- package/script/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/explorerTxs.js +2 -0
- package/script/src/api/subscription/_methods/explorerTxs.js.map +1 -1
- package/script/src/api/subscription/_methods/l2Book.d.ts +9 -9
- package/script/src/api/subscription/_methods/openOrders.d.ts +6 -6
- package/script/src/api/subscription/_methods/orderUpdates.d.ts +6 -6
- package/script/src/api/subscription/_methods/spotAssetCtxs.d.ts +7 -7
- package/script/src/api/subscription/_methods/spotState.d.ts +6 -6
- package/script/src/api/subscription/_methods/trades.d.ts +4 -4
- package/script/src/api/subscription/_methods/twapStates.d.ts +11 -6
- package/script/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/twapStates.js +6 -1
- package/script/src/api/subscription/_methods/twapStates.js.map +1 -1
- package/script/src/api/subscription/_methods/userEvents.d.ts +35 -35
- package/script/src/api/subscription/_methods/userFills.d.ts +10 -10
- package/script/src/api/subscription/_methods/userFundings.d.ts +5 -5
- package/script/src/api/subscription/_methods/userHistoricalOrders.d.ts +7 -7
- package/script/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts +109 -34
- package/script/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/script/src/api/subscription/_methods/userTwapHistory.d.ts +7 -7
- package/script/src/api/subscription/_methods/userTwapSliceFills.d.ts +10 -10
- package/script/src/api/subscription/_methods/webData2.d.ts +70 -70
- package/script/src/api/subscription/_methods/webData3.d.ts +4 -4
- package/script/src/signing/mod.js +2 -2
- package/script/src/signing/mod.js.map +1 -1
- package/src/bin/cli.ts +10 -0
- package/src/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.ts +147 -0
- package/src/src/api/_schemas.ts +4 -0
- package/src/src/api/exchange/_methods/_base/_nonce.ts +3 -2
- package/src/src/api/exchange/_methods/_base/_semaphore.ts +34 -59
- package/src/src/api/exchange/_methods/_base/execute.ts +3 -3
- package/src/src/api/exchange/_methods/approveAgent.ts +25 -5
- package/src/src/api/exchange/_methods/borrowLend.ts +133 -0
- package/src/src/api/exchange/_methods/order.ts +5 -3
- package/src/src/api/exchange/_methods/userPortfolioMargin.ts +156 -0
- package/src/src/api/exchange/client.ts +34 -0
- package/src/src/api/exchange/mod.ts +2 -0
- package/src/src/api/info/_methods/activeAssetData.ts +2 -2
- package/src/src/api/info/_methods/allBorrowLendReserveStates.ts +82 -0
- package/src/src/api/info/_methods/borrowLendReserveState.ts +131 -0
- package/src/src/api/info/_methods/borrowLendUserState.ts +144 -0
- package/src/src/api/info/_methods/clearinghouseState.ts +3 -3
- package/src/src/api/info/_methods/perpDexs.ts +6 -1
- package/src/src/api/info/_methods/spotMeta.ts +41 -0
- package/src/src/api/info/_methods/userBorrowLendInterest.ts +122 -0
- package/src/src/api/info/_methods/userFunding.ts +2 -2
- package/src/src/api/info/_methods/userNonFundingLedgerUpdates.ts +69 -0
- package/src/src/api/info/client.ts +60 -0
- package/src/src/api/info/mod.ts +4 -0
- package/src/src/api/subscription/_methods/assetCtxs.ts +2 -0
- package/src/src/api/subscription/_methods/clearinghouseState.ts +2 -0
- package/src/src/api/subscription/_methods/explorerBlock.ts +2 -0
- package/src/src/api/subscription/_methods/explorerTxs.ts +2 -0
- package/src/src/api/subscription/_methods/twapStates.ts +9 -1
- package/src/src/signing/mod.ts +1 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -292
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -46
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -295
- package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -62
- package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
- package/src/deps/jsr.io/@std/msgpack/1.0.3/decode.ts +0 -391
- package/src/deps/jsr.io/@std/msgpack/1.0.3/mod.ts +0 -47
|
@@ -13,11 +13,11 @@ export declare const UsdClassTransferRequest: v.SchemaWithPipe<readonly [v.Objec
|
|
|
13
13
|
/** HyperLiquid network type. */
|
|
14
14
|
readonly hyperliquidChain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.PicklistSchema<["Mainnet", "Testnet"], undefined>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>;
|
|
15
15
|
/** Amount to transfer (1 = $1). */
|
|
16
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to transfer (1 = $1).">]>;
|
|
16
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to transfer (1 = $1).">]>;
|
|
17
17
|
/** `true` for Spot to Perp, `false` for Perp to Spot. */
|
|
18
18
|
readonly toPerp: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "`true` for Spot to Perp, `false` for Perp to Spot.">]>;
|
|
19
19
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
20
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
20
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
21
21
|
}, undefined>, v.DescriptionAction<{
|
|
22
22
|
type: "usdClassTransfer";
|
|
23
23
|
signatureChainId: `0x${string}`;
|
|
@@ -27,7 +27,7 @@ export declare const UsdClassTransferRequest: v.SchemaWithPipe<readonly [v.Objec
|
|
|
27
27
|
nonce: number;
|
|
28
28
|
}, "Action to perform.">]>;
|
|
29
29
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
30
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
30
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
31
31
|
/** ECDSA signature components. */
|
|
32
32
|
readonly signature: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
33
33
|
readonly r: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>, v.DescriptionAction<`0x${string}`, "First 32-byte component.">]>;
|
|
@@ -102,11 +102,11 @@ declare const UsdClassTransferParameters: Omit<v.ObjectSchema<{
|
|
|
102
102
|
/** HyperLiquid network type. */
|
|
103
103
|
readonly hyperliquidChain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.PicklistSchema<["Mainnet", "Testnet"], undefined>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>;
|
|
104
104
|
/** Amount to transfer (1 = $1). */
|
|
105
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to transfer (1 = $1).">]>;
|
|
105
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to transfer (1 = $1).">]>;
|
|
106
106
|
/** `true` for Spot to Perp, `false` for Perp to Spot. */
|
|
107
107
|
readonly toPerp: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "`true` for Spot to Perp, `false` for Perp to Spot.">]>;
|
|
108
108
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
109
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
109
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
110
110
|
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
111
111
|
readonly entries: Omit<{
|
|
112
112
|
/** Type of action. */
|
|
@@ -116,11 +116,11 @@ declare const UsdClassTransferParameters: Omit<v.ObjectSchema<{
|
|
|
116
116
|
/** HyperLiquid network type. */
|
|
117
117
|
readonly hyperliquidChain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.PicklistSchema<["Mainnet", "Testnet"], undefined>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>;
|
|
118
118
|
/** Amount to transfer (1 = $1). */
|
|
119
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to transfer (1 = $1).">]>;
|
|
119
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to transfer (1 = $1).">]>;
|
|
120
120
|
/** `true` for Spot to Perp, `false` for Perp to Spot. */
|
|
121
121
|
readonly toPerp: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "`true` for Spot to Perp, `false` for Perp to Spot.">]>;
|
|
122
122
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
123
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
123
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
124
124
|
}, "type" | "nonce" | "signatureChainId" | "hyperliquidChain">;
|
|
125
125
|
readonly "~standard": v.StandardProps<{
|
|
126
126
|
amount: string | number;
|
|
@@ -15,9 +15,9 @@ export declare const UsdSendRequest: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
15
15
|
/** Destination address. */
|
|
16
16
|
readonly destination: 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}`, "Destination address.">]>;
|
|
17
17
|
/** Amount to send (1 = $1). */
|
|
18
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to send (1 = $1).">]>;
|
|
18
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to send (1 = $1).">]>;
|
|
19
19
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
20
|
-
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
20
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
21
21
|
}, undefined>, v.DescriptionAction<{
|
|
22
22
|
type: "usdSend";
|
|
23
23
|
signatureChainId: `0x${string}`;
|
|
@@ -27,7 +27,7 @@ export declare const UsdSendRequest: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
27
27
|
time: number;
|
|
28
28
|
}, "Action to perform.">]>;
|
|
29
29
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
30
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
30
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
31
31
|
/** ECDSA signature components. */
|
|
32
32
|
readonly signature: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
33
33
|
readonly r: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>, v.DescriptionAction<`0x${string}`, "First 32-byte component.">]>;
|
|
@@ -104,9 +104,9 @@ declare const UsdSendParameters: Omit<v.ObjectSchema<{
|
|
|
104
104
|
/** Destination address. */
|
|
105
105
|
readonly destination: 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}`, "Destination address.">]>;
|
|
106
106
|
/** Amount to send (1 = $1). */
|
|
107
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to send (1 = $1).">]>;
|
|
107
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to send (1 = $1).">]>;
|
|
108
108
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
109
|
-
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
109
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
110
110
|
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
111
111
|
readonly entries: Omit<{
|
|
112
112
|
/** Type of action. */
|
|
@@ -118,29 +118,29 @@ declare const UsdSendParameters: Omit<v.ObjectSchema<{
|
|
|
118
118
|
/** Destination address. */
|
|
119
119
|
readonly destination: 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}`, "Destination address.">]>;
|
|
120
120
|
/** Amount to send (1 = $1). */
|
|
121
|
-
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to send (1 = $1).">]>;
|
|
121
|
+
readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Amount to send (1 = $1).">]>;
|
|
122
122
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
123
|
-
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
123
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
124
124
|
}, "type" | "time" | "signatureChainId" | "hyperliquidChain">;
|
|
125
125
|
readonly "~standard": v.StandardProps<{
|
|
126
|
-
destination: string;
|
|
127
126
|
amount: string | number;
|
|
127
|
+
destination: string;
|
|
128
128
|
}, {
|
|
129
|
-
destination: `0x${string}`;
|
|
130
129
|
amount: string;
|
|
130
|
+
destination: `0x${string}`;
|
|
131
131
|
}>;
|
|
132
132
|
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
133
|
-
destination: `0x${string}`;
|
|
134
133
|
amount: string;
|
|
134
|
+
destination: `0x${string}`;
|
|
135
135
|
}, v.StringIssue | v.ObjectIssue | v.NumberIssue | v.UnionIssue<v.StringIssue | v.NumberIssue> | v.ToStringIssue<string | number> | v.RegexIssue<string> | v.LengthIssue<`0x${string}`, 42>>;
|
|
136
136
|
readonly "~types"?: {
|
|
137
137
|
readonly input: {
|
|
138
|
-
destination: string;
|
|
139
138
|
amount: string | number;
|
|
139
|
+
destination: string;
|
|
140
140
|
};
|
|
141
141
|
readonly output: {
|
|
142
|
-
destination: `0x${string}`;
|
|
143
142
|
amount: string;
|
|
143
|
+
destination: `0x${string}`;
|
|
144
144
|
};
|
|
145
145
|
readonly issue: v.StringIssue | v.ObjectIssue | v.NumberIssue | v.UnionIssue<v.StringIssue | v.NumberIssue> | v.ToStringIssue<string | number> | v.RegexIssue<string> | v.LengthIssue<`0x${string}`, 42>;
|
|
146
146
|
} | undefined;
|
|
@@ -17,7 +17,7 @@ export declare const UserDexAbstractionRequest: v.SchemaWithPipe<readonly [v.Obj
|
|
|
17
17
|
/** Whether to enable or disable HIP-3 DEX abstraction. */
|
|
18
18
|
readonly enabled: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether to enable or disable HIP-3 DEX abstraction.">]>;
|
|
19
19
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
20
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
20
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
21
21
|
}, undefined>, v.DescriptionAction<{
|
|
22
22
|
type: "userDexAbstraction";
|
|
23
23
|
signatureChainId: `0x${string}`;
|
|
@@ -27,7 +27,7 @@ export declare const UserDexAbstractionRequest: v.SchemaWithPipe<readonly [v.Obj
|
|
|
27
27
|
nonce: number;
|
|
28
28
|
}, "Action to perform.">]>;
|
|
29
29
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
30
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
30
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
31
31
|
/** ECDSA signature components. */
|
|
32
32
|
readonly signature: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
33
33
|
readonly r: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>, v.DescriptionAction<`0x${string}`, "First 32-byte component.">]>;
|
|
@@ -106,7 +106,7 @@ declare const UserDexAbstractionParameters: Omit<v.ObjectSchema<{
|
|
|
106
106
|
/** Whether to enable or disable HIP-3 DEX abstraction. */
|
|
107
107
|
readonly enabled: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether to enable or disable HIP-3 DEX abstraction.">]>;
|
|
108
108
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
109
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
109
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
110
110
|
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
111
111
|
readonly entries: Omit<{
|
|
112
112
|
/** Type of action. */
|
|
@@ -120,7 +120,7 @@ declare const UserDexAbstractionParameters: Omit<v.ObjectSchema<{
|
|
|
120
120
|
/** Whether to enable or disable HIP-3 DEX abstraction. */
|
|
121
121
|
readonly enabled: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether to enable or disable HIP-3 DEX abstraction.">]>;
|
|
122
122
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
123
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
123
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
124
124
|
}, "type" | "nonce" | "signatureChainId" | "hyperliquidChain">;
|
|
125
125
|
readonly "~standard": v.StandardProps<{
|
|
126
126
|
user: string;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/**
|
|
3
|
+
* Enable/disable user portfolio margin.
|
|
4
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/portfolio-margin
|
|
5
|
+
*/
|
|
6
|
+
export declare const UserPortfolioMarginRequest: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
7
|
+
/** Action to perform. */
|
|
8
|
+
readonly action: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
9
|
+
/** Type of action. */
|
|
10
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"userPortfolioMargin", undefined>, v.DescriptionAction<"userPortfolioMargin", "Type of action.">]>;
|
|
11
|
+
/** Chain ID in hex format for EIP-712 signing. */
|
|
12
|
+
readonly signatureChainId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.DescriptionAction<`0x${string}`, "Chain ID in hex format for EIP-712 signing.">]>;
|
|
13
|
+
/** HyperLiquid network type. */
|
|
14
|
+
readonly hyperliquidChain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.PicklistSchema<["Mainnet", "Testnet"], undefined>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>;
|
|
15
|
+
/** User address. */
|
|
16
|
+
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.">]>;
|
|
17
|
+
/** Whether to enable or disable user portfolio margin. */
|
|
18
|
+
readonly enabled: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether to enable or disable user portfolio margin.">]>;
|
|
19
|
+
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
20
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
21
|
+
}, undefined>, v.DescriptionAction<{
|
|
22
|
+
type: "userPortfolioMargin";
|
|
23
|
+
signatureChainId: `0x${string}`;
|
|
24
|
+
hyperliquidChain: "Testnet" | "Mainnet";
|
|
25
|
+
user: `0x${string}`;
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
nonce: number;
|
|
28
|
+
}, "Action to perform.">]>;
|
|
29
|
+
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
30
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
31
|
+
/** ECDSA signature components. */
|
|
32
|
+
readonly signature: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
33
|
+
readonly r: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>, v.DescriptionAction<`0x${string}`, "First 32-byte component.">]>;
|
|
34
|
+
readonly s: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>, v.DescriptionAction<`0x${string}`, "Second 32-byte component.">]>;
|
|
35
|
+
readonly v: v.SchemaWithPipe<readonly [v.PicklistSchema<[27, 28], undefined>, v.DescriptionAction<27 | 28, "Recovery identifier.">]>;
|
|
36
|
+
}, undefined>, v.DescriptionAction<{
|
|
37
|
+
r: `0x${string}`;
|
|
38
|
+
s: `0x${string}`;
|
|
39
|
+
v: 27 | 28;
|
|
40
|
+
}, "ECDSA signature components.">]>, v.DescriptionAction<{
|
|
41
|
+
r: `0x${string}`;
|
|
42
|
+
s: `0x${string}`;
|
|
43
|
+
v: 27 | 28;
|
|
44
|
+
}, "ECDSA signature components.">]>;
|
|
45
|
+
}, undefined>, v.DescriptionAction<{
|
|
46
|
+
action: {
|
|
47
|
+
type: "userPortfolioMargin";
|
|
48
|
+
signatureChainId: `0x${string}`;
|
|
49
|
+
hyperliquidChain: "Testnet" | "Mainnet";
|
|
50
|
+
user: `0x${string}`;
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
nonce: number;
|
|
53
|
+
};
|
|
54
|
+
nonce: number;
|
|
55
|
+
signature: {
|
|
56
|
+
r: `0x${string}`;
|
|
57
|
+
s: `0x${string}`;
|
|
58
|
+
v: 27 | 28;
|
|
59
|
+
};
|
|
60
|
+
}, "Enable/disable user portfolio margin.">]>;
|
|
61
|
+
export type UserPortfolioMarginRequest = v.InferOutput<typeof UserPortfolioMarginRequest>;
|
|
62
|
+
/**
|
|
63
|
+
* Successful response without specific data or error response.
|
|
64
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/portfolio-margin
|
|
65
|
+
*/
|
|
66
|
+
export declare const UserPortfolioMarginResponse: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
67
|
+
readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"ok", undefined>, v.DescriptionAction<"ok", "Successful status.">]>;
|
|
68
|
+
readonly response: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
69
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"default", undefined>, v.DescriptionAction<"default", "Type of response.">]>;
|
|
70
|
+
}, undefined>, v.DescriptionAction<{
|
|
71
|
+
type: "default";
|
|
72
|
+
}, "Response details.">]>;
|
|
73
|
+
}, undefined>, v.DescriptionAction<{
|
|
74
|
+
status: "ok";
|
|
75
|
+
response: {
|
|
76
|
+
type: "default";
|
|
77
|
+
};
|
|
78
|
+
}, "Successful response without specific data.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
79
|
+
readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"err", undefined>, v.DescriptionAction<"err", "Error status.">]>;
|
|
80
|
+
readonly response: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Error message.">]>;
|
|
81
|
+
}, undefined>, v.DescriptionAction<{
|
|
82
|
+
status: "err";
|
|
83
|
+
response: string;
|
|
84
|
+
}, "Error response for failed operations.">]>], undefined>, v.DescriptionAction<{
|
|
85
|
+
status: "err";
|
|
86
|
+
response: string;
|
|
87
|
+
} | {
|
|
88
|
+
status: "ok";
|
|
89
|
+
response: {
|
|
90
|
+
type: "default";
|
|
91
|
+
};
|
|
92
|
+
}, "Successful response without specific data or error response.">]>;
|
|
93
|
+
export type UserPortfolioMarginResponse = v.InferOutput<typeof UserPortfolioMarginResponse>;
|
|
94
|
+
import { type ExchangeConfig, type ExtractRequestOptions } from "./_base/execute.js";
|
|
95
|
+
import type { ExcludeErrorResponse } from "./_base/errors.js";
|
|
96
|
+
/** Schema for user-provided action parameters (excludes system fields). */
|
|
97
|
+
declare const UserPortfolioMarginParameters: Omit<v.ObjectSchema<{
|
|
98
|
+
/** Type of action. */
|
|
99
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"userPortfolioMargin", undefined>, v.DescriptionAction<"userPortfolioMargin", "Type of action.">]>;
|
|
100
|
+
/** Chain ID in hex format for EIP-712 signing. */
|
|
101
|
+
readonly signatureChainId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.DescriptionAction<`0x${string}`, "Chain ID in hex format for EIP-712 signing.">]>;
|
|
102
|
+
/** HyperLiquid network type. */
|
|
103
|
+
readonly hyperliquidChain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.PicklistSchema<["Mainnet", "Testnet"], undefined>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>;
|
|
104
|
+
/** User address. */
|
|
105
|
+
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.">]>;
|
|
106
|
+
/** Whether to enable or disable user portfolio margin. */
|
|
107
|
+
readonly enabled: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether to enable or disable user portfolio margin.">]>;
|
|
108
|
+
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
109
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
110
|
+
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
111
|
+
readonly entries: Omit<{
|
|
112
|
+
/** Type of action. */
|
|
113
|
+
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"userPortfolioMargin", undefined>, v.DescriptionAction<"userPortfolioMargin", "Type of action.">]>;
|
|
114
|
+
/** Chain ID in hex format for EIP-712 signing. */
|
|
115
|
+
readonly signatureChainId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.DescriptionAction<`0x${string}`, "Chain ID in hex format for EIP-712 signing.">]>;
|
|
116
|
+
/** HyperLiquid network type. */
|
|
117
|
+
readonly hyperliquidChain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.PicklistSchema<["Mainnet", "Testnet"], undefined>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>;
|
|
118
|
+
/** User address. */
|
|
119
|
+
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.">]>;
|
|
120
|
+
/** Whether to enable or disable user portfolio margin. */
|
|
121
|
+
readonly enabled: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether to enable or disable user portfolio margin.">]>;
|
|
122
|
+
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
123
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
124
|
+
}, "type" | "nonce" | "signatureChainId" | "hyperliquidChain">;
|
|
125
|
+
readonly "~standard": v.StandardProps<{
|
|
126
|
+
user: string;
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
}, {
|
|
129
|
+
user: `0x${string}`;
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
}>;
|
|
132
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
133
|
+
user: `0x${string}`;
|
|
134
|
+
enabled: boolean;
|
|
135
|
+
}, v.StringIssue | v.ObjectIssue | v.RegexIssue<string> | v.LengthIssue<`0x${string}`, 42> | v.BooleanIssue>;
|
|
136
|
+
readonly "~types"?: {
|
|
137
|
+
readonly input: {
|
|
138
|
+
user: string;
|
|
139
|
+
enabled: boolean;
|
|
140
|
+
};
|
|
141
|
+
readonly output: {
|
|
142
|
+
user: `0x${string}`;
|
|
143
|
+
enabled: boolean;
|
|
144
|
+
};
|
|
145
|
+
readonly issue: v.StringIssue | v.ObjectIssue | v.RegexIssue<string> | v.LengthIssue<`0x${string}`, 42> | v.BooleanIssue;
|
|
146
|
+
} | undefined;
|
|
147
|
+
};
|
|
148
|
+
/** Action parameters for the {@linkcode userPortfolioMargin} function. */
|
|
149
|
+
export type UserPortfolioMarginParameters = v.InferInput<typeof UserPortfolioMarginParameters>;
|
|
150
|
+
/** Request options for the {@linkcode userPortfolioMargin} function. */
|
|
151
|
+
export type UserPortfolioMarginOptions = ExtractRequestOptions<v.InferInput<typeof UserPortfolioMarginRequest>>;
|
|
152
|
+
/** Successful variant of {@linkcode UserPortfolioMarginResponse} without errors. */
|
|
153
|
+
export type UserPortfolioMarginSuccessResponse = ExcludeErrorResponse<UserPortfolioMarginResponse>;
|
|
154
|
+
/** EIP-712 types for the {@linkcode UserPortfolioMargin} function. */
|
|
155
|
+
export declare const UserPortfolioMarginTypes: {
|
|
156
|
+
"HyperliquidTransaction:UserPortfolioMargin": {
|
|
157
|
+
name: string;
|
|
158
|
+
type: string;
|
|
159
|
+
}[];
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Enable/disable user portfolio margin.
|
|
163
|
+
*
|
|
164
|
+
* @param config - General configuration for Exchange API requests.
|
|
165
|
+
* @param params - Parameters specific to the API request.
|
|
166
|
+
* @param opts - Request execution options.
|
|
167
|
+
*
|
|
168
|
+
* @returns Successful response without specific data.
|
|
169
|
+
*
|
|
170
|
+
* @throws {ValiError} When the request parameters fail validation (before sending).
|
|
171
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
172
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { HttpTransport } from "@nktkas/hyperliquid";
|
|
177
|
+
* import { userPortfolioMargin } from "@nktkas/hyperliquid/api/exchange";
|
|
178
|
+
* import { privateKeyToAccount } from "npm:viem/accounts";
|
|
179
|
+
*
|
|
180
|
+
* const wallet = privateKeyToAccount("0x..."); // viem or ethers
|
|
181
|
+
* const transport = new HttpTransport(); // or `WebSocketTransport`
|
|
182
|
+
*
|
|
183
|
+
* await userPortfolioMargin(
|
|
184
|
+
* { transport, wallet },
|
|
185
|
+
* { user: "0x...", enabled: true },
|
|
186
|
+
* );
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/portfolio-margin
|
|
190
|
+
*/
|
|
191
|
+
export declare function userPortfolioMargin(config: ExchangeConfig, params: UserPortfolioMarginParameters, opts?: UserPortfolioMarginOptions): Promise<UserPortfolioMarginSuccessResponse>;
|
|
192
|
+
export {};
|
|
193
|
+
//# sourceMappingURL=userPortfolioMargin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userPortfolioMargin.d.ts","sourceRoot":"","sources":["../../../../../src/src/api/exchange/_methods/userPortfolioMargin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAS7B;;;GAGG;AACH,eAAO,MAAM,0BAA0B;IAGjC,yBAAyB;;QAGrB,sBAAsB;;QAKtB,kDAAkD;;QAKlD,gCAAgC;;QAKhC,oBAAoB;;QAKpB,0DAA0D;;QAK1D,8DAA8D;;;;;;;;;;IAQlE,8DAA8D;;IAK9D,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAQpC,CAAC;AACL,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE1F;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;oEAKpC,CAAC;AACL,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAM5F,OAAO,EAAE,KAAK,cAAc,EAA2B,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,2EAA2E;AAC3E,QAAA,MAAM,6BAA6B;IArEzB,sBAAsB;;IAKtB,kDAAkD;;IAKlD,gCAAgC;;IAKhC,oBAAoB;;IAKpB,0DAA0D;;IAK1D,8DAA8D;;;;QAzB9D,sBAAsB;;QAKtB,kDAAkD;;QAKlD,gCAAgC;;QAKhC,oBAAoB;;QAKpB,0DAA0D;;QAK1D,8DAA8D;;;;;;;;;;;;;;;;;;;;;;;;;CAiDpE,CAAC;AACL,0EAA0E;AAC1E,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE/F,wEAAwE;AACxE,MAAM,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC;AAEhH,oFAAoF;AACpF,MAAM,MAAM,kCAAkC,GAAG,oBAAoB,CAAC,2BAA2B,CAAC,CAAC;AAEnG,sEAAsE;AACtE,eAAO,MAAM,wBAAwB;;;;;CAOpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,6BAA6B,EACrC,IAAI,CAAC,EAAE,0BAA0B,GAChC,OAAO,CAAC,kCAAkC,CAAC,CAQ7C"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.UserPortfolioMarginTypes = exports.UserPortfolioMarginResponse = exports.UserPortfolioMarginRequest = void 0;
|
|
37
|
+
exports.userPortfolioMargin = userPortfolioMargin;
|
|
38
|
+
const v = __importStar(require("valibot"));
|
|
39
|
+
// ============================================================
|
|
40
|
+
// API Schemas
|
|
41
|
+
// ============================================================
|
|
42
|
+
const _schemas_js_1 = require("../../_schemas.js");
|
|
43
|
+
const commonSchemas_js_1 = require("./_base/commonSchemas.js");
|
|
44
|
+
/**
|
|
45
|
+
* Enable/disable user portfolio margin.
|
|
46
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/portfolio-margin
|
|
47
|
+
*/
|
|
48
|
+
exports.UserPortfolioMarginRequest = (() => {
|
|
49
|
+
return v.pipe(v.object({
|
|
50
|
+
/** Action to perform. */
|
|
51
|
+
action: v.pipe(v.object({
|
|
52
|
+
/** Type of action. */
|
|
53
|
+
type: v.pipe(v.literal("userPortfolioMargin"), v.description("Type of action.")),
|
|
54
|
+
/** Chain ID in hex format for EIP-712 signing. */
|
|
55
|
+
signatureChainId: v.pipe(_schemas_js_1.Hex, v.description("Chain ID in hex format for EIP-712 signing.")),
|
|
56
|
+
/** HyperLiquid network type. */
|
|
57
|
+
hyperliquidChain: v.pipe(commonSchemas_js_1.HyperliquidChainSchema, v.description("HyperLiquid network type.")),
|
|
58
|
+
/** User address. */
|
|
59
|
+
user: v.pipe(_schemas_js_1.Address, v.description("User address.")),
|
|
60
|
+
/** Whether to enable or disable user portfolio margin. */
|
|
61
|
+
enabled: v.pipe(v.boolean(), v.description("Whether to enable or disable user portfolio margin.")),
|
|
62
|
+
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
63
|
+
nonce: v.pipe(_schemas_js_1.UnsignedInteger, v.description("Nonce (timestamp in ms) used to prevent replay attacks.")),
|
|
64
|
+
}), v.description("Action to perform.")),
|
|
65
|
+
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
66
|
+
nonce: v.pipe(_schemas_js_1.UnsignedInteger, v.description("Nonce (timestamp in ms) used to prevent replay attacks.")),
|
|
67
|
+
/** ECDSA signature components. */
|
|
68
|
+
signature: v.pipe(commonSchemas_js_1.SignatureSchema, v.description("ECDSA signature components.")),
|
|
69
|
+
}), v.description("Enable/disable user portfolio margin."));
|
|
70
|
+
})();
|
|
71
|
+
/**
|
|
72
|
+
* Successful response without specific data or error response.
|
|
73
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/portfolio-margin
|
|
74
|
+
*/
|
|
75
|
+
exports.UserPortfolioMarginResponse = (() => {
|
|
76
|
+
return v.pipe(v.union([commonSchemas_js_1.SuccessResponse, commonSchemas_js_1.ErrorResponse]), v.description("Successful response without specific data or error response."));
|
|
77
|
+
})();
|
|
78
|
+
// ============================================================
|
|
79
|
+
// Execution Logic
|
|
80
|
+
// ============================================================
|
|
81
|
+
const execute_js_1 = require("./_base/execute.js");
|
|
82
|
+
/** Schema for user-provided action parameters (excludes system fields). */
|
|
83
|
+
const UserPortfolioMarginParameters = /* @__PURE__ */ (() => {
|
|
84
|
+
return v.omit(v.object(exports.UserPortfolioMarginRequest.entries.action.entries), ["type", "signatureChainId", "hyperliquidChain", "nonce"]);
|
|
85
|
+
})();
|
|
86
|
+
/** EIP-712 types for the {@linkcode UserPortfolioMargin} function. */
|
|
87
|
+
exports.UserPortfolioMarginTypes = {
|
|
88
|
+
"HyperliquidTransaction:UserPortfolioMargin": [
|
|
89
|
+
{ name: "hyperliquidChain", type: "string" },
|
|
90
|
+
{ name: "user", type: "address" },
|
|
91
|
+
{ name: "enabled", type: "bool" },
|
|
92
|
+
{ name: "nonce", type: "uint64" },
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Enable/disable user portfolio margin.
|
|
97
|
+
*
|
|
98
|
+
* @param config - General configuration for Exchange API requests.
|
|
99
|
+
* @param params - Parameters specific to the API request.
|
|
100
|
+
* @param opts - Request execution options.
|
|
101
|
+
*
|
|
102
|
+
* @returns Successful response without specific data.
|
|
103
|
+
*
|
|
104
|
+
* @throws {ValiError} When the request parameters fail validation (before sending).
|
|
105
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
106
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* import { HttpTransport } from "@nktkas/hyperliquid";
|
|
111
|
+
* import { userPortfolioMargin } from "@nktkas/hyperliquid/api/exchange";
|
|
112
|
+
* import { privateKeyToAccount } from "npm:viem/accounts";
|
|
113
|
+
*
|
|
114
|
+
* const wallet = privateKeyToAccount("0x..."); // viem or ethers
|
|
115
|
+
* const transport = new HttpTransport(); // or `WebSocketTransport`
|
|
116
|
+
*
|
|
117
|
+
* await userPortfolioMargin(
|
|
118
|
+
* { transport, wallet },
|
|
119
|
+
* { user: "0x...", enabled: true },
|
|
120
|
+
* );
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/portfolio-margin
|
|
124
|
+
*/
|
|
125
|
+
function userPortfolioMargin(config, params, opts) {
|
|
126
|
+
const action = v.parse(UserPortfolioMarginParameters, params);
|
|
127
|
+
return (0, execute_js_1.executeUserSignedAction)(config, { type: "userPortfolioMargin", ...action }, exports.UserPortfolioMarginTypes, opts);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=userPortfolioMargin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userPortfolioMargin.js","sourceRoot":"","sources":["../../../../../src/src/api/exchange/_methods/userPortfolioMargin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+IA,kDAYC;AA3JD,2CAA6B;AAE7B,+DAA+D;AAC/D,cAAc;AACd,+DAA+D;AAE/D,mDAAkE;AAClE,+DAAmH;AAEnH;;;GAGG;AACU,QAAA,0BAA0B,GAAmB,CAAC,GAAG,EAAE;IAC9D,OAAO,CAAC,CAAC,IAAI,CACX,CAAC,CAAC,MAAM,CAAC;QACP,yBAAyB;QACzB,MAAM,EAAE,CAAC,CAAC,IAAI,CACZ,CAAC,CAAC,MAAM,CAAC;YACP,sBAAsB;YACtB,IAAI,EAAE,CAAC,CAAC,IAAI,CACV,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAChC,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CACjC;YACD,kDAAkD;YAClD,gBAAgB,EAAE,CAAC,CAAC,IAAI,CACtB,iBAAG,EACH,CAAC,CAAC,WAAW,CAAC,6CAA6C,CAAC,CAC7D;YACD,gCAAgC;YAChC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CACtB,yCAAsB,EACtB,CAAC,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAC3C;YACD,oBAAoB;YACpB,IAAI,EAAE,CAAC,CAAC,IAAI,CACV,qBAAO,EACP,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAC/B;YACD,0DAA0D;YAC1D,OAAO,EAAE,CAAC,CAAC,IAAI,CACb,CAAC,CAAC,OAAO,EAAE,EACX,CAAC,CAAC,WAAW,CAAC,qDAAqD,CAAC,CACrE;YACD,8DAA8D;YAC9D,KAAK,EAAE,CAAC,CAAC,IAAI,CACX,6BAAe,EACf,CAAC,CAAC,WAAW,CAAC,yDAAyD,CAAC,CACzE;SACF,CAAC,EACF,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,CACpC;QACD,8DAA8D;QAC9D,KAAK,EAAE,CAAC,CAAC,IAAI,CACX,6BAAe,EACf,CAAC,CAAC,WAAW,CAAC,yDAAyD,CAAC,CACzE;QACD,kCAAkC;QAClC,SAAS,EAAE,CAAC,CAAC,IAAI,CACf,kCAAe,EACf,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAC7C;KACF,CAAC,EACF,CAAC,CAAC,WAAW,CAAC,uCAAuC,CAAC,CACvD,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAGL;;;GAGG;AACU,QAAA,2BAA2B,GAAmB,CAAC,GAAG,EAAE;IAC/D,OAAO,CAAC,CAAC,IAAI,CACX,CAAC,CAAC,KAAK,CAAC,CAAC,kCAAe,EAAE,gCAAa,CAAC,CAAC,EACzC,CAAC,CAAC,WAAW,CAAC,8DAA8D,CAAC,CAC9E,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAGL,+DAA+D;AAC/D,kBAAkB;AAClB,+DAA+D;AAE/D,mDAA8G;AAG9G,2EAA2E;AAC3E,MAAM,6BAA6B,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE;IAC1D,OAAO,CAAC,CAAC,IAAI,CACX,CAAC,CAAC,MAAM,CAAC,kCAA0B,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAC3D,CAAC,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAC1D,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAUL,sEAAsE;AACzD,QAAA,wBAAwB,GAAG;IACtC,4CAA4C,EAAE;QAC5C,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5C,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;QACjC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;QACjC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;KAClC;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,mBAAmB,CACjC,MAAsB,EACtB,MAAqC,EACrC,IAAiC;IAEjC,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,IAAA,oCAAuB,EAC5B,MAAM,EACN,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,MAAM,EAAE,EAC1C,gCAAwB,EACxB,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -9,13 +9,13 @@ export declare const ValidatorL1StreamRequest: v.SchemaWithPipe<readonly [v.Obje
|
|
|
9
9
|
/** Type of action. */
|
|
10
10
|
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"validatorL1Stream", undefined>, v.DescriptionAction<"validatorL1Stream", "Type of action.">]>;
|
|
11
11
|
/** Risk-free rate as a decimal string (e.g., "0.05" for 5%). */
|
|
12
|
-
readonly riskFreeRate: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Risk-free rate as a decimal string (e.g., \"0.05\" for 5%).">]>;
|
|
12
|
+
readonly riskFreeRate: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Risk-free rate as a decimal string (e.g., \"0.05\" for 5%).">]>;
|
|
13
13
|
}, undefined>, v.DescriptionAction<{
|
|
14
14
|
type: "validatorL1Stream";
|
|
15
15
|
riskFreeRate: string;
|
|
16
16
|
}, "Action to perform.">]>;
|
|
17
17
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
18
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
18
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
19
19
|
/** ECDSA signature components. */
|
|
20
20
|
readonly signature: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
21
21
|
readonly r: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>, v.DescriptionAction<`0x${string}`, "First 32-byte component.">]>;
|
|
@@ -31,7 +31,7 @@ export declare const ValidatorL1StreamRequest: v.SchemaWithPipe<readonly [v.Obje
|
|
|
31
31
|
v: 27 | 28;
|
|
32
32
|
}, "ECDSA signature components.">]>;
|
|
33
33
|
/** Expiration time of the action. */
|
|
34
|
-
readonly expiresAfter: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Expiration time of the action.">]>;
|
|
34
|
+
readonly expiresAfter: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Expiration time of the action.">]>;
|
|
35
35
|
}, undefined>, v.DescriptionAction<{
|
|
36
36
|
action: {
|
|
37
37
|
type: "validatorL1Stream";
|
|
@@ -85,13 +85,13 @@ declare const ValidatorL1StreamParameters: Omit<v.ObjectSchema<{
|
|
|
85
85
|
/** Type of action. */
|
|
86
86
|
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"validatorL1Stream", undefined>, v.DescriptionAction<"validatorL1Stream", "Type of action.">]>;
|
|
87
87
|
/** Risk-free rate as a decimal string (e.g., "0.05" for 5%). */
|
|
88
|
-
readonly riskFreeRate: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Risk-free rate as a decimal string (e.g., \"0.05\" for 5%).">]>;
|
|
88
|
+
readonly riskFreeRate: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Risk-free rate as a decimal string (e.g., \"0.05\" for 5%).">]>;
|
|
89
89
|
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
90
90
|
readonly entries: Omit<{
|
|
91
91
|
/** Type of action. */
|
|
92
92
|
readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"validatorL1Stream", undefined>, v.DescriptionAction<"validatorL1Stream", "Type of action.">]>;
|
|
93
93
|
/** Risk-free rate as a decimal string (e.g., "0.05" for 5%). */
|
|
94
|
-
readonly riskFreeRate: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Risk-free rate as a decimal string (e.g., \"0.05\" for 5%).">]>;
|
|
94
|
+
readonly riskFreeRate: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToStringAction<string | number, undefined>, v.StringSchema<undefined>, v.TransformAction<string, string>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "Risk-free rate as a decimal string (e.g., \"0.05\" for 5%).">]>;
|
|
95
95
|
}, "type">;
|
|
96
96
|
readonly "~standard": v.StandardProps<{
|
|
97
97
|
riskFreeRate: string | number;
|
|
@@ -11,14 +11,14 @@ export declare const VaultDistributeRequest: v.SchemaWithPipe<readonly [v.Object
|
|
|
11
11
|
* Amount to distribute (float * 1e6).
|
|
12
12
|
* Set to 0 to close the vault.
|
|
13
13
|
*/
|
|
14
|
-
readonly usd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, string>]>;
|
|
14
|
+
readonly usd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, string>]>;
|
|
15
15
|
}, undefined>, v.DescriptionAction<{
|
|
16
16
|
type: "vaultDistribute";
|
|
17
17
|
vaultAddress: `0x${string}`;
|
|
18
18
|
usd: number;
|
|
19
19
|
}, "Action to perform.">]>;
|
|
20
20
|
/** Nonce (timestamp in ms) used to prevent replay attacks. */
|
|
21
|
-
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
21
|
+
readonly nonce: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>;
|
|
22
22
|
/** ECDSA signature components. */
|
|
23
23
|
readonly signature: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
24
24
|
readonly r: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>, v.DescriptionAction<`0x${string}`, "First 32-byte component.">]>;
|
|
@@ -34,7 +34,7 @@ export declare const VaultDistributeRequest: v.SchemaWithPipe<readonly [v.Object
|
|
|
34
34
|
v: 27 | 28;
|
|
35
35
|
}, "ECDSA signature components.">]>;
|
|
36
36
|
/** Expiration time of the action. */
|
|
37
|
-
readonly expiresAfter: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Expiration time of the action.">]>;
|
|
37
|
+
readonly expiresAfter: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Expiration time of the action.">]>;
|
|
38
38
|
}, undefined>, v.DescriptionAction<{
|
|
39
39
|
action: {
|
|
40
40
|
type: "vaultDistribute";
|
|
@@ -91,7 +91,7 @@ declare const VaultDistributeParameters: Omit<v.ObjectSchema<{
|
|
|
91
91
|
* Amount to distribute (float * 1e6).
|
|
92
92
|
* Set to 0 to close the vault.
|
|
93
93
|
*/
|
|
94
|
-
readonly usd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, string>]>;
|
|
94
|
+
readonly usd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, string>]>;
|
|
95
95
|
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
96
96
|
readonly entries: Omit<{
|
|
97
97
|
/** Type of action. */
|
|
@@ -102,7 +102,7 @@ declare const VaultDistributeParameters: Omit<v.ObjectSchema<{
|
|
|
102
102
|
* Amount to distribute (float * 1e6).
|
|
103
103
|
* Set to 0 to close the vault.
|
|
104
104
|
*/
|
|
105
|
-
readonly usd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, string>]>;
|
|
105
|
+
readonly usd: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToNumberAction<string | number, undefined>, v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, string>]>;
|
|
106
106
|
}, "type">;
|
|
107
107
|
readonly "~standard": v.StandardProps<{
|
|
108
108
|
vaultAddress: string;
|