@drift-labs/sdk-browser 2.163.0-beta.12 → 2.163.0-beta.13
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/VERSION +1 -1
- package/bun.lock +26 -13
- package/lib/browser/accounts/fetch.d.ts +9 -0
- package/lib/browser/accounts/fetch.js +14 -1
- package/lib/browser/addresses/pda.d.ts +1 -1
- package/lib/browser/addresses/pda.js +2 -2
- package/lib/browser/adminClient.d.ts +1 -1
- package/lib/browser/adminClient.js +2 -2
- package/lib/browser/bankrun/bankrunConnection.d.ts +1 -1
- package/lib/browser/bankrun/bankrunConnection.js +1 -1
- package/lib/browser/clock/clockSubscriber.js +1 -1
- package/lib/browser/config.d.ts +1 -1
- package/lib/browser/constants/numericConstants.d.ts +1 -1
- package/lib/browser/constants/numericConstants.js +1 -1
- package/lib/browser/constants/spotMarkets.d.ts +1 -1
- package/lib/browser/constants/spotMarkets.js +1 -1
- package/lib/browser/core/DriftCore.d.ts +224 -0
- package/lib/browser/core/DriftCore.js +138 -0
- package/lib/browser/core/index.d.ts +12 -0
- package/lib/browser/core/index.js +28 -0
- package/lib/browser/core/instructions/deposit.d.ts +19 -0
- package/lib/browser/core/instructions/deposit.js +19 -0
- package/lib/browser/core/instructions/fill.d.ts +13 -0
- package/lib/browser/core/instructions/fill.js +17 -0
- package/lib/browser/core/instructions/funding.d.ts +9 -0
- package/lib/browser/core/instructions/funding.js +13 -0
- package/lib/browser/core/instructions/liquidation.d.ts +15 -0
- package/lib/browser/core/instructions/liquidation.js +17 -0
- package/lib/browser/core/instructions/orders.d.ts +22 -0
- package/lib/browser/core/instructions/orders.js +27 -0
- package/lib/browser/core/instructions/perpOrders.d.ts +78 -0
- package/lib/browser/core/instructions/perpOrders.js +99 -0
- package/lib/browser/core/instructions/settlement.d.ts +11 -0
- package/lib/browser/core/instructions/settlement.js +15 -0
- package/lib/browser/core/instructions/trigger.d.ts +11 -0
- package/lib/browser/core/instructions/trigger.js +15 -0
- package/lib/browser/core/instructions/withdraw.d.ts +20 -0
- package/lib/browser/core/instructions/withdraw.js +20 -0
- package/lib/browser/core/remainingAccounts.d.ts +27 -0
- package/lib/browser/core/remainingAccounts.js +122 -0
- package/lib/browser/core/signedMsg.d.ts +17 -0
- package/lib/browser/core/signedMsg.js +39 -0
- package/lib/browser/decode/customCoder.d.ts +1 -1
- package/lib/browser/decode/customCoder.js +1 -1
- package/lib/browser/decode/user.js +1 -1
- package/lib/browser/dlob/DLOB.d.ts +1 -1
- package/lib/browser/dlob/DLOB.js +1 -1
- package/lib/browser/dlob/DLOBNode.d.ts +1 -1
- package/lib/browser/dlob/DLOBNode.js +1 -1
- package/lib/browser/dlob/DLOBSubscriber.d.ts +1 -1
- package/lib/browser/dlob/NodeList.d.ts +1 -1
- package/lib/browser/dlob/orderBookLevels.d.ts +1 -1
- package/lib/browser/dlob/orderBookLevels.js +1 -1
- package/lib/browser/driftClient.d.ts +17 -24
- package/lib/browser/driftClient.js +192 -291
- package/lib/browser/driftClientConfig.d.ts +1 -1
- package/lib/browser/events/eventSubscriber.d.ts +1 -1
- package/lib/browser/events/fetchLogs.d.ts +1 -1
- package/lib/browser/events/parse.d.ts +1 -1
- package/lib/browser/factory/bigNum.d.ts +1 -1
- package/lib/browser/factory/bigNum.js +1 -1
- package/lib/browser/factory/oracleClient.js +1 -1
- package/lib/browser/index.d.ts +2 -1
- package/lib/browser/index.js +2 -1
- package/lib/browser/indicative-quotes/indicativeQuotesSender.d.ts +1 -1
- package/lib/browser/isomorphic/anchor.browser.d.ts +24 -0
- package/lib/browser/isomorphic/anchor.browser.js +60 -0
- package/lib/browser/isomorphic/anchor.d.ts +24 -0
- package/lib/browser/isomorphic/anchor.js +60 -0
- package/lib/browser/isomorphic/anchor29.browser.d.ts +12 -0
- package/lib/browser/isomorphic/anchor29.browser.js +48 -0
- package/lib/browser/isomorphic/anchor29.d.ts +12 -0
- package/lib/browser/isomorphic/anchor29.js +48 -0
- package/lib/browser/jupiter/jupiterClient.d.ts +1 -1
- package/lib/browser/marginCalculation.d.ts +1 -1
- package/lib/browser/marinade/index.d.ts +1 -1
- package/lib/browser/marinade/index.js +2 -2
- package/lib/browser/math/amm.d.ts +1 -1
- package/lib/browser/math/amm.js +1 -1
- package/lib/browser/math/auction.d.ts +1 -1
- package/lib/browser/math/auction.js +1 -1
- package/lib/browser/math/conversion.d.ts +1 -1
- package/lib/browser/math/conversion.js +1 -1
- package/lib/browser/math/exchangeStatus.js +1 -1
- package/lib/browser/math/fuel.d.ts +1 -1
- package/lib/browser/math/fuel.js +1 -1
- package/lib/browser/math/funding.d.ts +1 -1
- package/lib/browser/math/funding.js +1 -1
- package/lib/browser/math/insurance.d.ts +1 -1
- package/lib/browser/math/insurance.js +1 -1
- package/lib/browser/math/liquidation.d.ts +1 -1
- package/lib/browser/math/liquidation.js +1 -1
- package/lib/browser/math/margin.d.ts +1 -1
- package/lib/browser/math/margin.js +1 -1
- package/lib/browser/math/market.d.ts +1 -1
- package/lib/browser/math/market.js +1 -1
- package/lib/browser/math/oracles.d.ts +1 -1
- package/lib/browser/math/oracles.js +1 -1
- package/lib/browser/math/orders.d.ts +1 -1
- package/lib/browser/math/orders.js +1 -1
- package/lib/browser/math/position.d.ts +1 -1
- package/lib/browser/math/position.js +1 -1
- package/lib/browser/math/protectedMakerParams.js +1 -1
- package/lib/browser/math/repeg.d.ts +1 -1
- package/lib/browser/math/repeg.js +1 -1
- package/lib/browser/math/spotBalance.d.ts +1 -1
- package/lib/browser/math/spotBalance.js +1 -1
- package/lib/browser/math/spotMarket.d.ts +1 -1
- package/lib/browser/math/spotMarket.js +1 -1
- package/lib/browser/math/spotPosition.d.ts +1 -1
- package/lib/browser/math/spotPosition.js +1 -1
- package/lib/browser/math/state.d.ts +1 -1
- package/lib/browser/math/state.js +1 -1
- package/lib/browser/math/superStake.d.ts +1 -1
- package/lib/browser/math/superStake.js +1 -1
- package/lib/browser/math/trade.d.ts +1 -1
- package/lib/browser/math/trade.js +1 -1
- package/lib/browser/math/utils.d.ts +1 -1
- package/lib/browser/math/utils.js +1 -1
- package/lib/browser/memcmp.js +8 -8
- package/lib/browser/openbook/openbookV2Subscriber.d.ts +1 -1
- package/lib/browser/openbook/openbookV2Subscriber.js +3 -3
- package/lib/browser/oracles/pythClient.d.ts +1 -1
- package/lib/browser/oracles/pythClient.js +1 -1
- package/lib/browser/oracles/pythLazerClient.d.ts +1 -1
- package/lib/browser/oracles/pythLazerClient.js +1 -1
- package/lib/browser/oracles/quoteAssetOracleClient.js +1 -1
- package/lib/browser/oracles/strictOraclePrice.d.ts +1 -1
- package/lib/browser/oracles/strictOraclePrice.js +1 -1
- package/lib/browser/oracles/types.d.ts +1 -1
- package/lib/browser/oracles/utils.d.ts +1 -1
- package/lib/browser/orderParams.d.ts +1 -1
- package/lib/browser/orderSubscriber/OrderSubscriber.js +1 -1
- package/lib/browser/phoenix/phoenixSubscriber.d.ts +1 -1
- package/lib/browser/phoenix/phoenixSubscriber.js +1 -1
- package/lib/browser/pyth/types.d.ts +1 -1
- package/lib/browser/serum/serumSubscriber.d.ts +1 -1
- package/lib/browser/serum/serumSubscriber.js +1 -1
- package/lib/browser/slot/SlothashSubscriber.js +6 -3
- package/lib/browser/swap/UnifiedSwapClient.d.ts +1 -1
- package/lib/browser/titan/titanClient.d.ts +1 -1
- package/lib/browser/tokenFaucet.d.ts +3 -3
- package/lib/browser/tokenFaucet.js +4 -4
- package/lib/browser/types.d.ts +1 -1
- package/lib/browser/user.d.ts +1 -1
- package/lib/browser/user.js +1 -1
- package/lib/browser/userMap/referrerMap.js +7 -4
- package/lib/browser/userStats.d.ts +1 -1
- package/lib/browser/userStats.js +1 -1
- package/lib/node/accounts/fetch.d.ts +9 -0
- package/lib/node/accounts/fetch.d.ts.map +1 -1
- package/lib/node/accounts/fetch.js +14 -1
- package/lib/node/addresses/pda.d.ts +1 -1
- package/lib/node/addresses/pda.d.ts.map +1 -1
- package/lib/node/addresses/pda.js +2 -2
- package/lib/node/adminClient.d.ts +1 -1
- package/lib/node/adminClient.d.ts.map +1 -1
- package/lib/node/adminClient.js +2 -2
- package/lib/node/bankrun/bankrunConnection.d.ts +1 -1
- package/lib/node/bankrun/bankrunConnection.d.ts.map +1 -1
- package/lib/node/bankrun/bankrunConnection.js +1 -1
- package/lib/node/clock/clockSubscriber.js +1 -1
- package/lib/node/config.d.ts +1 -1
- package/lib/node/config.d.ts.map +1 -1
- package/lib/node/constants/numericConstants.d.ts +1 -1
- package/lib/node/constants/numericConstants.d.ts.map +1 -1
- package/lib/node/constants/numericConstants.js +1 -1
- package/lib/node/constants/spotMarkets.d.ts +1 -1
- package/lib/node/constants/spotMarkets.d.ts.map +1 -1
- package/lib/node/constants/spotMarkets.js +1 -1
- package/lib/node/core/DriftCore.d.ts +225 -0
- package/lib/node/core/DriftCore.d.ts.map +1 -0
- package/lib/node/core/DriftCore.js +138 -0
- package/lib/node/core/index.d.ts +13 -0
- package/lib/node/core/index.d.ts.map +1 -0
- package/lib/node/core/index.js +28 -0
- package/lib/node/core/instructions/deposit.d.ts +20 -0
- package/lib/node/core/instructions/deposit.d.ts.map +1 -0
- package/lib/node/core/instructions/deposit.js +19 -0
- package/lib/node/core/instructions/fill.d.ts +14 -0
- package/lib/node/core/instructions/fill.d.ts.map +1 -0
- package/lib/node/core/instructions/fill.js +17 -0
- package/lib/node/core/instructions/funding.d.ts +10 -0
- package/lib/node/core/instructions/funding.d.ts.map +1 -0
- package/lib/node/core/instructions/funding.js +13 -0
- package/lib/node/core/instructions/liquidation.d.ts +16 -0
- package/lib/node/core/instructions/liquidation.d.ts.map +1 -0
- package/lib/node/core/instructions/liquidation.js +17 -0
- package/lib/node/core/instructions/orders.d.ts +23 -0
- package/lib/node/core/instructions/orders.d.ts.map +1 -0
- package/lib/node/core/instructions/orders.js +27 -0
- package/lib/node/core/instructions/perpOrders.d.ts +79 -0
- package/lib/node/core/instructions/perpOrders.d.ts.map +1 -0
- package/lib/node/core/instructions/perpOrders.js +99 -0
- package/lib/node/core/instructions/settlement.d.ts +12 -0
- package/lib/node/core/instructions/settlement.d.ts.map +1 -0
- package/lib/node/core/instructions/settlement.js +15 -0
- package/lib/node/core/instructions/trigger.d.ts +12 -0
- package/lib/node/core/instructions/trigger.d.ts.map +1 -0
- package/lib/node/core/instructions/trigger.js +15 -0
- package/lib/node/core/instructions/withdraw.d.ts +21 -0
- package/lib/node/core/instructions/withdraw.d.ts.map +1 -0
- package/lib/node/core/instructions/withdraw.js +20 -0
- package/lib/node/core/remainingAccounts.d.ts +28 -0
- package/lib/node/core/remainingAccounts.d.ts.map +1 -0
- package/lib/node/core/remainingAccounts.js +122 -0
- package/lib/node/core/signedMsg.d.ts +18 -0
- package/lib/node/core/signedMsg.d.ts.map +1 -0
- package/lib/node/core/signedMsg.js +39 -0
- package/lib/node/decode/customCoder.d.ts +1 -1
- package/lib/node/decode/customCoder.d.ts.map +1 -1
- package/lib/node/decode/customCoder.js +1 -1
- package/lib/node/decode/user.js +1 -1
- package/lib/node/dlob/DLOB.d.ts +1 -1
- package/lib/node/dlob/DLOB.d.ts.map +1 -1
- package/lib/node/dlob/DLOB.js +1 -1
- package/lib/node/dlob/DLOBNode.d.ts +1 -1
- package/lib/node/dlob/DLOBNode.d.ts.map +1 -1
- package/lib/node/dlob/DLOBNode.js +1 -1
- package/lib/node/dlob/DLOBSubscriber.d.ts +1 -1
- package/lib/node/dlob/DLOBSubscriber.d.ts.map +1 -1
- package/lib/node/dlob/NodeList.d.ts +1 -1
- package/lib/node/dlob/NodeList.d.ts.map +1 -1
- package/lib/node/dlob/orderBookLevels.d.ts +1 -1
- package/lib/node/dlob/orderBookLevels.d.ts.map +1 -1
- package/lib/node/dlob/orderBookLevels.js +1 -1
- package/lib/node/driftClient.d.ts +17 -24
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +192 -291
- package/lib/node/driftClientConfig.d.ts +1 -1
- package/lib/node/driftClientConfig.d.ts.map +1 -1
- package/lib/node/events/eventSubscriber.d.ts +1 -1
- package/lib/node/events/eventSubscriber.d.ts.map +1 -1
- package/lib/node/events/fetchLogs.d.ts +1 -1
- package/lib/node/events/fetchLogs.d.ts.map +1 -1
- package/lib/node/events/parse.d.ts +1 -1
- package/lib/node/events/parse.d.ts.map +1 -1
- package/lib/node/factory/bigNum.d.ts +1 -1
- package/lib/node/factory/bigNum.d.ts.map +1 -1
- package/lib/node/factory/bigNum.js +1 -1
- package/lib/node/factory/oracleClient.js +1 -1
- package/lib/node/index.d.ts +2 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +2 -1
- package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts +1 -1
- package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts.map +1 -1
- package/lib/node/isomorphic/anchor.browser.d.ts +25 -0
- package/lib/node/isomorphic/anchor.browser.d.ts.map +1 -0
- package/lib/node/isomorphic/anchor.browser.js +60 -0
- package/lib/node/isomorphic/anchor.d.ts +25 -0
- package/lib/node/isomorphic/anchor.d.ts.map +1 -0
- package/lib/node/isomorphic/anchor.js +60 -0
- package/lib/node/isomorphic/anchor.node.d.ts.map +1 -0
- package/lib/node/isomorphic/anchor29.browser.d.ts +13 -0
- package/lib/node/isomorphic/anchor29.browser.d.ts.map +1 -0
- package/lib/node/isomorphic/anchor29.browser.js +48 -0
- package/lib/node/isomorphic/anchor29.d.ts +13 -0
- package/lib/node/isomorphic/anchor29.d.ts.map +1 -0
- package/lib/node/isomorphic/anchor29.js +48 -0
- package/lib/node/isomorphic/anchor29.node.d.ts.map +1 -0
- package/lib/node/jupiter/jupiterClient.d.ts +1 -1
- package/lib/node/jupiter/jupiterClient.d.ts.map +1 -1
- package/lib/node/marginCalculation.d.ts +1 -1
- package/lib/node/marginCalculation.d.ts.map +1 -1
- package/lib/node/marinade/index.d.ts +1 -1
- package/lib/node/marinade/index.d.ts.map +1 -1
- package/lib/node/marinade/index.js +2 -2
- package/lib/node/math/amm.d.ts +1 -1
- package/lib/node/math/amm.d.ts.map +1 -1
- package/lib/node/math/amm.js +1 -1
- package/lib/node/math/auction.d.ts +1 -1
- package/lib/node/math/auction.d.ts.map +1 -1
- package/lib/node/math/auction.js +1 -1
- package/lib/node/math/conversion.d.ts +1 -1
- package/lib/node/math/conversion.d.ts.map +1 -1
- package/lib/node/math/conversion.js +1 -1
- package/lib/node/math/exchangeStatus.js +1 -1
- package/lib/node/math/fuel.d.ts +1 -1
- package/lib/node/math/fuel.d.ts.map +1 -1
- package/lib/node/math/fuel.js +1 -1
- package/lib/node/math/funding.d.ts +1 -1
- package/lib/node/math/funding.d.ts.map +1 -1
- package/lib/node/math/funding.js +1 -1
- package/lib/node/math/insurance.d.ts +1 -1
- package/lib/node/math/insurance.d.ts.map +1 -1
- package/lib/node/math/insurance.js +1 -1
- package/lib/node/math/liquidation.d.ts +1 -1
- package/lib/node/math/liquidation.d.ts.map +1 -1
- package/lib/node/math/liquidation.js +1 -1
- package/lib/node/math/margin.d.ts +1 -1
- package/lib/node/math/margin.d.ts.map +1 -1
- package/lib/node/math/margin.js +1 -1
- package/lib/node/math/market.d.ts +1 -1
- package/lib/node/math/market.d.ts.map +1 -1
- package/lib/node/math/market.js +1 -1
- package/lib/node/math/oracles.d.ts +1 -1
- package/lib/node/math/oracles.d.ts.map +1 -1
- package/lib/node/math/oracles.js +1 -1
- package/lib/node/math/orders.d.ts +1 -1
- package/lib/node/math/orders.d.ts.map +1 -1
- package/lib/node/math/orders.js +1 -1
- package/lib/node/math/position.d.ts +1 -1
- package/lib/node/math/position.d.ts.map +1 -1
- package/lib/node/math/position.js +1 -1
- package/lib/node/math/protectedMakerParams.js +1 -1
- package/lib/node/math/repeg.d.ts +1 -1
- package/lib/node/math/repeg.d.ts.map +1 -1
- package/lib/node/math/repeg.js +1 -1
- package/lib/node/math/spotBalance.d.ts +1 -1
- package/lib/node/math/spotBalance.d.ts.map +1 -1
- package/lib/node/math/spotBalance.js +1 -1
- package/lib/node/math/spotMarket.d.ts +1 -1
- package/lib/node/math/spotMarket.d.ts.map +1 -1
- package/lib/node/math/spotMarket.js +1 -1
- package/lib/node/math/spotPosition.d.ts +1 -1
- package/lib/node/math/spotPosition.d.ts.map +1 -1
- package/lib/node/math/spotPosition.js +1 -1
- package/lib/node/math/state.d.ts +1 -1
- package/lib/node/math/state.d.ts.map +1 -1
- package/lib/node/math/state.js +1 -1
- package/lib/node/math/superStake.d.ts +1 -1
- package/lib/node/math/superStake.d.ts.map +1 -1
- package/lib/node/math/superStake.js +1 -1
- package/lib/node/math/trade.d.ts +1 -1
- package/lib/node/math/trade.d.ts.map +1 -1
- package/lib/node/math/trade.js +1 -1
- package/lib/node/math/utils.d.ts +1 -1
- package/lib/node/math/utils.d.ts.map +1 -1
- package/lib/node/math/utils.js +1 -1
- package/lib/node/memcmp.js +8 -8
- package/lib/node/openbook/openbookV2Subscriber.d.ts +1 -1
- package/lib/node/openbook/openbookV2Subscriber.d.ts.map +1 -1
- package/lib/node/openbook/openbookV2Subscriber.js +3 -3
- package/lib/node/oracles/pythClient.d.ts +1 -1
- package/lib/node/oracles/pythClient.d.ts.map +1 -1
- package/lib/node/oracles/pythClient.js +1 -1
- package/lib/node/oracles/pythLazerClient.d.ts +1 -1
- package/lib/node/oracles/pythLazerClient.d.ts.map +1 -1
- package/lib/node/oracles/pythLazerClient.js +1 -1
- package/lib/node/oracles/quoteAssetOracleClient.js +1 -1
- package/lib/node/oracles/strictOraclePrice.d.ts +1 -1
- package/lib/node/oracles/strictOraclePrice.d.ts.map +1 -1
- package/lib/node/oracles/strictOraclePrice.js +1 -1
- package/lib/node/oracles/types.d.ts +1 -1
- package/lib/node/oracles/types.d.ts.map +1 -1
- package/lib/node/oracles/utils.d.ts +1 -1
- package/lib/node/oracles/utils.d.ts.map +1 -1
- package/lib/node/orderParams.d.ts +1 -1
- package/lib/node/orderParams.d.ts.map +1 -1
- package/lib/node/orderSubscriber/OrderSubscriber.js +1 -1
- package/lib/node/phoenix/phoenixSubscriber.d.ts +1 -1
- package/lib/node/phoenix/phoenixSubscriber.d.ts.map +1 -1
- package/lib/node/phoenix/phoenixSubscriber.js +1 -1
- package/lib/node/pyth/types.d.ts +1 -1
- package/lib/node/pyth/types.d.ts.map +1 -1
- package/lib/node/serum/serumSubscriber.d.ts +1 -1
- package/lib/node/serum/serumSubscriber.d.ts.map +1 -1
- package/lib/node/serum/serumSubscriber.js +1 -1
- package/lib/node/slot/SlothashSubscriber.js +6 -3
- package/lib/node/swap/UnifiedSwapClient.d.ts +1 -1
- package/lib/node/swap/UnifiedSwapClient.d.ts.map +1 -1
- package/lib/node/titan/titanClient.d.ts +1 -1
- package/lib/node/titan/titanClient.d.ts.map +1 -1
- package/lib/node/tokenFaucet.d.ts +3 -3
- package/lib/node/tokenFaucet.d.ts.map +1 -1
- package/lib/node/tokenFaucet.js +4 -4
- package/lib/node/types.d.ts +1 -1
- package/lib/node/types.d.ts.map +1 -1
- package/lib/node/user.d.ts +1 -1
- package/lib/node/user.d.ts.map +1 -1
- package/lib/node/user.js +1 -1
- package/lib/node/userMap/referrerMap.js +7 -4
- package/lib/node/userStats.d.ts +1 -1
- package/lib/node/userStats.d.ts.map +1 -1
- package/lib/node/userStats.js +1 -1
- package/package.json +4 -2
- package/scripts/postbuild.js +1 -1
- package/src/accounts/fetch.ts +27 -0
- package/src/accounts/webSocketAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketAccountSubscriberV2.ts +1 -1
- package/src/accounts/webSocketProgramAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketProgramAccountSubscriberV2.ts +1 -1
- package/src/accounts/webSocketProgramAccountsSubscriberV2.ts +1 -1
- package/src/addresses/pda.ts +2 -2
- package/src/adminClient.ts +2 -2
- package/src/bankrun/bankrunConnection.ts +1 -1
- package/src/clock/clockSubscriber.ts +1 -1
- package/src/config.ts +1 -1
- package/src/constants/numericConstants.ts +1 -1
- package/src/constants/spotMarkets.ts +1 -1
- package/src/core/DriftCore.ts +326 -0
- package/src/core/index.ts +12 -0
- package/src/core/instructions/deposit.ts +42 -0
- package/src/core/instructions/fill.ts +34 -0
- package/src/core/instructions/funding.ts +21 -0
- package/src/core/instructions/liquidation.ts +37 -0
- package/src/core/instructions/orders.ts +56 -0
- package/src/core/instructions/perpOrders.ts +192 -0
- package/src/core/instructions/settlement.ts +26 -0
- package/src/core/instructions/trigger.ts +26 -0
- package/src/core/instructions/withdraw.ts +44 -0
- package/src/core/remainingAccounts.ts +276 -0
- package/src/core/signedMsg.ts +71 -0
- package/src/decode/customCoder.ts +1 -1
- package/src/decode/user.ts +1 -1
- package/src/dlob/DLOB.ts +1 -1
- package/src/dlob/DLOBNode.ts +1 -1
- package/src/dlob/DLOBSubscriber.ts +1 -1
- package/src/dlob/NodeList.ts +1 -1
- package/src/dlob/orderBookLevels.ts +1 -1
- package/src/driftClient.ts +207 -402
- package/src/driftClientConfig.ts +1 -1
- package/src/events/eventSubscriber.ts +1 -1
- package/src/events/fetchLogs.ts +1 -1
- package/src/events/parse.ts +1 -1
- package/src/factory/bigNum.ts +1 -1
- package/src/factory/oracleClient.ts +1 -1
- package/src/index.ts +2 -1
- package/src/indicative-quotes/indicativeQuotesSender.ts +1 -1
- package/src/isomorphic/anchor.browser.ts +44 -0
- package/src/isomorphic/anchor.node.ts +1 -0
- package/src/isomorphic/anchor.ts +1 -0
- package/src/isomorphic/anchor29.browser.ts +24 -0
- package/src/isomorphic/anchor29.node.ts +1 -0
- package/src/isomorphic/anchor29.ts +1 -0
- package/src/jupiter/jupiterClient.ts +1 -1
- package/src/marginCalculation.ts +1 -1
- package/src/marinade/index.ts +1 -1
- package/src/math/amm.ts +1 -1
- package/src/math/auction.ts +1 -1
- package/src/math/conversion.ts +1 -1
- package/src/math/exchangeStatus.ts +1 -1
- package/src/math/fuel.ts +1 -1
- package/src/math/funding.ts +1 -1
- package/src/math/insurance.ts +1 -1
- package/src/math/liquidation.ts +1 -1
- package/src/math/margin.ts +1 -1
- package/src/math/market.ts +1 -1
- package/src/math/oracles.ts +1 -1
- package/src/math/orders.ts +1 -1
- package/src/math/position.ts +1 -1
- package/src/math/protectedMakerParams.ts +1 -1
- package/src/math/repeg.ts +1 -1
- package/src/math/spotBalance.ts +1 -1
- package/src/math/spotMarket.ts +1 -1
- package/src/math/spotPosition.ts +1 -1
- package/src/math/state.ts +1 -1
- package/src/math/superStake.ts +1 -1
- package/src/math/trade.ts +1 -1
- package/src/math/utils.ts +1 -1
- package/src/memcmp.ts +1 -1
- package/src/openbook/openbookV2Subscriber.ts +7 -1
- package/src/oracles/pythClient.ts +1 -1
- package/src/oracles/pythLazerClient.ts +1 -1
- package/src/oracles/quoteAssetOracleClient.ts +1 -1
- package/src/oracles/strictOraclePrice.ts +1 -1
- package/src/oracles/types.ts +1 -1
- package/src/oracles/utils.ts +1 -1
- package/src/orderParams.ts +1 -1
- package/src/orderSubscriber/OrderSubscriber.ts +1 -1
- package/src/phoenix/phoenixSubscriber.ts +1 -1
- package/src/pyth/types.ts +1 -1
- package/src/serum/serumSubscriber.ts +1 -1
- package/src/slot/SlothashSubscriber.ts +2 -2
- package/src/swap/UnifiedSwapClient.ts +1 -1
- package/src/titan/titanClient.ts +1 -1
- package/src/tokenFaucet.ts +3 -3
- package/src/types.ts +1 -1
- package/src/user.ts +1 -1
- package/src/userMap/referrerMap.ts +1 -1
- package/src/userMap/userMap.ts +1 -1
- package/src/userStats.ts +1 -1
- package/tests/DriftCore/decode.test.ts +16 -0
- package/tests/DriftCore/fill_trigger.test.ts +73 -0
- package/tests/DriftCore/instructions.test.ts +46 -0
- package/tests/DriftCore/pdas.test.ts +29 -0
- package/tests/DriftCore/perp_orders.test.ts +205 -0
- package/tests/DriftCore/remainingAccounts.test.ts +70 -0
- package/tests/DriftCore/settlement_liquidation.test.ts +69 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeSignedMsgOrderParamsMessage = exports.encodeSignedMsgOrderParamsMessage = void 0;
|
|
4
|
+
const sha256_1 = require("@noble/hashes/sha256");
|
|
5
|
+
function encodeSignedMsgOrderParamsMessage(args) {
|
|
6
|
+
const { coderTypes, delegateSigner } = args;
|
|
7
|
+
const orderParamsMessage = { ...args.orderParamsMessage };
|
|
8
|
+
if (orderParamsMessage.maxMarginRatio === undefined) {
|
|
9
|
+
orderParamsMessage.maxMarginRatio = null;
|
|
10
|
+
}
|
|
11
|
+
if (orderParamsMessage.isolatedPositionDeposit === undefined) {
|
|
12
|
+
orderParamsMessage.isolatedPositionDeposit = null;
|
|
13
|
+
}
|
|
14
|
+
const anchorIxName = delegateSigner
|
|
15
|
+
? 'global' + ':' + 'SignedMsgOrderParamsDelegateMessage'
|
|
16
|
+
: 'global' + ':' + 'SignedMsgOrderParamsMessage';
|
|
17
|
+
const prefix = Buffer.from((0, sha256_1.sha256)(anchorIxName).slice(0, 8));
|
|
18
|
+
const withBuilderDefaults = {
|
|
19
|
+
...orderParamsMessage,
|
|
20
|
+
builderIdx: orderParamsMessage.builderIdx !== undefined
|
|
21
|
+
? orderParamsMessage.builderIdx
|
|
22
|
+
: null,
|
|
23
|
+
builderFeeTenthBps: orderParamsMessage.builderFeeTenthBps !== undefined
|
|
24
|
+
? orderParamsMessage.builderFeeTenthBps
|
|
25
|
+
: null,
|
|
26
|
+
};
|
|
27
|
+
const body = delegateSigner
|
|
28
|
+
? coderTypes.encode('signedMsgOrderParamsDelegateMessage', withBuilderDefaults)
|
|
29
|
+
: coderTypes.encode('signedMsgOrderParamsMessage', withBuilderDefaults);
|
|
30
|
+
return Buffer.concat([prefix, body]);
|
|
31
|
+
}
|
|
32
|
+
exports.encodeSignedMsgOrderParamsMessage = encodeSignedMsgOrderParamsMessage;
|
|
33
|
+
function decodeSignedMsgOrderParamsMessage(args) {
|
|
34
|
+
const decodeStr = args.delegateSigner
|
|
35
|
+
? 'signedMsgOrderParamsDelegateMessage'
|
|
36
|
+
: 'signedMsgOrderParamsMessage';
|
|
37
|
+
return args.coderTypes.decode(decodeStr, Buffer.concat([args.encodedMessage.slice(8), Buffer.alloc(128)]));
|
|
38
|
+
}
|
|
39
|
+
exports.decodeSignedMsgOrderParamsMessage = decodeSignedMsgOrderParamsMessage;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { Buffer } from 'buffer';
|
|
4
|
-
import { Idl, BorshEventCoder, BorshInstructionCoder } from '
|
|
4
|
+
import { Idl, BorshEventCoder, BorshInstructionCoder } from '../isomorphic/anchor';
|
|
5
5
|
export declare class CustomBorshCoder<A extends string = string, _T extends string = string> {
|
|
6
6
|
readonly idl: Idl;
|
|
7
7
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CustomBorshAccountsCoder = exports.CustomBorshCoder = void 0;
|
|
4
4
|
const buffer_1 = require("buffer");
|
|
5
|
-
const anchor_1 = require("
|
|
5
|
+
const anchor_1 = require("../isomorphic/anchor");
|
|
6
6
|
class CustomBorshCoder {
|
|
7
7
|
constructor(idl) {
|
|
8
8
|
const baseCoder = new anchor_1.BorshCoder(idl);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decodeUser = void 0;
|
|
4
|
-
const anchor_1 = require("
|
|
4
|
+
const anchor_1 = require("../isomorphic/anchor");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
const web3_js_1 = require("@solana/web3.js");
|
|
7
7
|
const numericConstants_1 = require("../constants/numericConstants");
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* `orderBookLevels.ts` — aggregated L2/L3 book level construction for quoting
|
|
13
13
|
*/
|
|
14
14
|
import { NodeList } from './NodeList';
|
|
15
|
-
import { BN } from '
|
|
15
|
+
import { BN } from '../isomorphic/anchor';
|
|
16
16
|
import { DLOBNode, DLOBNodeType, TriggerOrderNode } from './DLOBNode';
|
|
17
17
|
import { DriftClient } from '../driftClient';
|
|
18
18
|
import { MarketType, MarketTypeStr, Order, PerpMarketAccount, PositionDirection, SpotMarketAccount, StateAccount } from '../types';
|
package/lib/browser/dlob/DLOB.js
CHANGED
|
@@ -14,7 +14,7 @@ exports.DLOB = void 0;
|
|
|
14
14
|
* `orderBookLevels.ts` — aggregated L2/L3 book level construction for quoting
|
|
15
15
|
*/
|
|
16
16
|
const NodeList_1 = require("./NodeList");
|
|
17
|
-
const anchor_1 = require("
|
|
17
|
+
const anchor_1 = require("../isomorphic/anchor");
|
|
18
18
|
const numericConstants_1 = require("../constants/numericConstants");
|
|
19
19
|
const userName_1 = require("../userName");
|
|
20
20
|
const orders_1 = require("../math/orders");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
|
-
import { BN } from '
|
|
2
|
+
import { BN } from '../isomorphic/anchor';
|
|
3
3
|
import { MarketTypeStr, Order, ProtectedMakerParams } from '../types';
|
|
4
4
|
import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
|
|
5
5
|
export interface DLOBNode {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNode = exports.SignedMsgOrderNode = exports.TriggerOrderNode = exports.MarketOrderNode = exports.FloatingLimitOrderNode = exports.RestingLimitOrderNode = exports.TakingLimitOrderNode = exports.OrderNode = void 0;
|
|
4
|
-
const anchor_1 = require("
|
|
4
|
+
const anchor_1 = require("../isomorphic/anchor");
|
|
5
5
|
const numericConstants_1 = require("../constants/numericConstants");
|
|
6
6
|
const orders_1 = require("../math/orders");
|
|
7
7
|
const types_1 = require("../types");
|
|
@@ -7,7 +7,7 @@ import { DLOBSource, DLOBSubscriberEvents, DLOBSubscriptionConfig, ProtectMakerP
|
|
|
7
7
|
import { DriftClient } from '../driftClient';
|
|
8
8
|
import { MarketType } from '../types';
|
|
9
9
|
import { L2OrderBook, L2OrderBookGenerator, L3OrderBook } from './orderBookLevels';
|
|
10
|
-
import { BN } from '
|
|
10
|
+
import { BN } from '../isomorphic/anchor';
|
|
11
11
|
export declare class DLOBSubscriber {
|
|
12
12
|
driftClient: DriftClient;
|
|
13
13
|
dlobSource: DLOBSource;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
import { MarketTypeStr, Order, ProtectedMakerParams } from '../types';
|
|
3
3
|
import { DLOBNode, DLOBNodeMap } from './DLOBNode';
|
|
4
|
-
import { BN } from '
|
|
4
|
+
import { BN } from '../isomorphic/anchor';
|
|
5
5
|
export type SortDirection = 'asc' | 'desc';
|
|
6
6
|
export declare function getOrderSignature(orderId: number, userAccount: string): string;
|
|
7
7
|
export interface DLOBNodeGenerator {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
|
-
import { BN } from '
|
|
2
|
+
import { BN } from '../isomorphic/anchor';
|
|
3
3
|
import { DLOBNode } from './DLOBNode';
|
|
4
4
|
import { PerpMarketAccount } from '../types';
|
|
5
5
|
import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uncrossL2 = exports.groupL2 = exports.getVammL2Generator = exports.createL2Levels = exports.mergeL2LevelGenerators = exports.getL2GeneratorFromDLOBNodes = exports.MAJORS_TOP_OF_BOOK_QUOTE_AMOUNTS = exports.DEFAULT_TOP_OF_BOOK_QUOTE_AMOUNTS = void 0;
|
|
4
|
-
const anchor_1 = require("
|
|
4
|
+
const anchor_1 = require("../isomorphic/anchor");
|
|
5
5
|
const numericConstants_1 = require("../constants/numericConstants");
|
|
6
6
|
const amm_1 = require("../math/amm");
|
|
7
7
|
const exchangeStatus_1 = require("../math/exchangeStatus");
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Instruction → on-chain handler mapping: see ARCHITECTURE.md § SDK↔Instruction Mapping.
|
|
18
18
|
*/
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
19
|
+
import { AnchorProvider, BN } from './isomorphic/anchor';
|
|
20
|
+
import type { ProgramAccount } from '@coral-xyz/anchor';
|
|
21
21
|
import { DriftClientMetricsEvents, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, ScaleOrderParams, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SignedMsgOrderParamsMessage, TxParams, UserAccount, UserStatsAccount, ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, PostOnlyParams, LPPoolAccount, ConstituentAccount, ConstituentTargetBaseAccount, AmmCache } from './types';
|
|
22
22
|
import { AccountMeta, AddressLookupTableAccount, BlockhashWithExpiryBlockHeight, ConfirmOptions, Connection, Keypair, PublicKey, Signer, Transaction, TransactionInstruction, TransactionSignature, TransactionVersion, VersionedTransaction } from '@solana/web3.js';
|
|
23
23
|
import { TokenFaucet } from './tokenFaucet';
|
|
@@ -46,14 +46,7 @@ import { UnifiedSwapClient } from './swap/UnifiedSwapClient';
|
|
|
46
46
|
* @deprecated Use UnifiedSwapClient class instead
|
|
47
47
|
*/
|
|
48
48
|
export type SwapClient = TitanClient | JupiterClient;
|
|
49
|
-
type RemainingAccountParams =
|
|
50
|
-
userAccounts: UserAccount[];
|
|
51
|
-
writablePerpMarketIndexes?: number[];
|
|
52
|
-
writableSpotMarketIndexes?: number[];
|
|
53
|
-
readablePerpMarketIndex?: number | number[];
|
|
54
|
-
readableSpotMarketIndexes?: number[];
|
|
55
|
-
useMarketLastSlotCache?: boolean;
|
|
56
|
-
};
|
|
49
|
+
type RemainingAccountParams = import('./core/remainingAccounts').RemainingAccountParams;
|
|
57
50
|
/**
|
|
58
51
|
* # DriftClient
|
|
59
52
|
* This class is the main way to interact with Drift Protocol. It allows you to subscribe to the various accounts where the Market's state is stored, as well as: opening positions, liquidating, settling funding, depositing & withdrawing, and more.
|
|
@@ -279,12 +272,12 @@ export declare class DriftClient {
|
|
|
279
272
|
reduceOnly: boolean;
|
|
280
273
|
subAccountId: number;
|
|
281
274
|
}[]): Promise<TransactionSignature>;
|
|
282
|
-
getUpdateUserReduceOnlyIx(reduceOnly: boolean, subAccountId: number): Promise<
|
|
275
|
+
getUpdateUserReduceOnlyIx(reduceOnly: boolean, subAccountId: number): Promise<TransactionInstruction>;
|
|
283
276
|
updateUserPoolId(updates: {
|
|
284
277
|
poolId: number;
|
|
285
278
|
subAccountId: number;
|
|
286
279
|
}[]): Promise<TransactionSignature>;
|
|
287
|
-
getUpdateUserPoolIdIx(poolId: number, subAccountId: number): Promise<
|
|
280
|
+
getUpdateUserPoolIdIx(poolId: number, subAccountId: number): Promise<TransactionInstruction>;
|
|
288
281
|
fetchAllUserAccounts(includeIdle?: boolean): Promise<ProgramAccount<UserAccount>[]>;
|
|
289
282
|
getUserAccountsForDelegate(delegate: PublicKey): Promise<UserAccount[]>;
|
|
290
283
|
getUserAccountsAndAddressesForAuthority(authority: PublicKey): Promise<ProgramAccount<UserAccount>[]>;
|
|
@@ -292,9 +285,9 @@ export declare class DriftClient {
|
|
|
292
285
|
getReferredUserStatsAccountsByReferrer(referrer: PublicKey): Promise<UserStatsAccount[]>;
|
|
293
286
|
getReferrerNameAccountsForAuthority(authority: PublicKey): Promise<ReferrerNameAccount[]>;
|
|
294
287
|
deleteUser(subAccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
295
|
-
getUserDeletionIx(userAccountPublicKey: PublicKey): Promise<
|
|
288
|
+
getUserDeletionIx(userAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
|
|
296
289
|
forceDeleteUser(userAccountPublicKey: PublicKey, userAccount: UserAccount, txParams?: TxParams): Promise<TransactionSignature>;
|
|
297
|
-
getForceDeleteUserIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<
|
|
290
|
+
getForceDeleteUserIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionInstruction>;
|
|
298
291
|
deleteSignedMsgUserOrders(txParams?: TxParams): Promise<TransactionSignature>;
|
|
299
292
|
getSignedMsgUserOrdersDeletionIx(authority: PublicKey): Promise<any>;
|
|
300
293
|
/**
|
|
@@ -307,7 +300,7 @@ export declare class DriftClient {
|
|
|
307
300
|
*/
|
|
308
301
|
isSignedMsgUserOrdersAccountInitialized(authority: PublicKey): Promise<boolean>;
|
|
309
302
|
reclaimRent(subAccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
310
|
-
getReclaimRentIx(userAccountPublicKey: PublicKey): Promise<
|
|
303
|
+
getReclaimRentIx(userAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
|
|
311
304
|
getUser(subAccountId?: number, authority?: PublicKey): User;
|
|
312
305
|
hasUser(subAccountId?: number, authority?: PublicKey): boolean;
|
|
313
306
|
getUsers(): User[];
|
|
@@ -376,8 +369,8 @@ export declare class DriftClient {
|
|
|
376
369
|
* @param useNative
|
|
377
370
|
* @param tokenProgram
|
|
378
371
|
*/
|
|
379
|
-
getAssociatedTokenAccount(marketIndex: number, useNative?: boolean, tokenProgram?:
|
|
380
|
-
createAssociatedTokenAccountIdempotentInstruction(account: PublicKey, payer: PublicKey, owner: PublicKey, mint: PublicKey, tokenProgram?:
|
|
372
|
+
getAssociatedTokenAccount(marketIndex: number, useNative?: boolean, tokenProgram?: PublicKey, authority?: PublicKey, allowOwnerOffCurve?: boolean): Promise<PublicKey>;
|
|
373
|
+
createAssociatedTokenAccountIdempotentInstruction(account: PublicKey, payer: PublicKey, owner: PublicKey, mint: PublicKey, tokenProgram?: PublicKey): TransactionInstruction;
|
|
381
374
|
getDepositTxnIx(amount: BN, marketIndex: number, associatedTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, overrides?: {
|
|
382
375
|
authority?: PublicKey;
|
|
383
376
|
}): Promise<TransactionInstruction[]>;
|
|
@@ -412,7 +405,7 @@ export declare class DriftClient {
|
|
|
412
405
|
getWrappedSolAccountCreationIxs(amount: BN, includeRent?: boolean, overrides?: {
|
|
413
406
|
authority?: PublicKey;
|
|
414
407
|
}): Promise<{
|
|
415
|
-
ixs:
|
|
408
|
+
ixs: TransactionInstruction[];
|
|
416
409
|
/** @deprecated - this array is always going to be empty, in the current implementation */
|
|
417
410
|
signers: Signer[];
|
|
418
411
|
pubkey: PublicKey;
|
|
@@ -422,7 +415,7 @@ export declare class DriftClient {
|
|
|
422
415
|
isTransferHook(spotMarketAccount: SpotMarketAccount): boolean;
|
|
423
416
|
addTokenMintToRemainingAccounts(spotMarketAccount: SpotMarketAccount, remainingAccounts: AccountMeta[]): void;
|
|
424
417
|
addExtraAccountMetasToRemainingAccounts(mint: PublicKey, remainingAccounts: AccountMeta[]): Promise<void>;
|
|
425
|
-
getAssociatedTokenAccountCreationIx(tokenMintAddress: PublicKey, associatedTokenAddress: PublicKey, tokenProgram: PublicKey):
|
|
418
|
+
getAssociatedTokenAccountCreationIx(tokenMintAddress: PublicKey, associatedTokenAddress: PublicKey, tokenProgram: PublicKey): TransactionInstruction;
|
|
426
419
|
createInitializeUserAccountAndDepositCollateralIxs(amount: BN, userTokenAccount: PublicKey, marketIndex?: number, subAccountId?: number, name?: string, fromSubAccountId?: number, referrerInfo?: ReferrerInfo, donateAmount?: BN, customMaxMarginRatio?: number, poolId?: number, overrides?: {
|
|
427
420
|
/**
|
|
428
421
|
* Optional external wallet to deposit from. If provided, the deposit will be made
|
|
@@ -580,7 +573,7 @@ export declare class DriftClient {
|
|
|
580
573
|
}, placeOrderParams: OrderParams[], txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
581
574
|
placeOrders(params: OrderParams[], txParams?: TxParams, subAccountId?: number, optionalIxs?: TransactionInstruction[], isolatedPositionDepositAmount?: BN): Promise<TransactionSignature>;
|
|
582
575
|
preparePlaceOrdersTx(params: OrderParams[], txParams?: TxParams, subAccountId?: number, optionalIxs?: TransactionInstruction[], isolatedPositionDepositAmount?: BN): Promise<{
|
|
583
|
-
placeOrdersTx:
|
|
576
|
+
placeOrdersTx: Transaction | VersionedTransaction;
|
|
584
577
|
}>;
|
|
585
578
|
getPlaceOrdersIx(params: OptionalOrderParams[], subAccountId?: number, overrides?: {
|
|
586
579
|
authority?: PublicKey;
|
|
@@ -595,7 +588,7 @@ export declare class DriftClient {
|
|
|
595
588
|
*/
|
|
596
589
|
placeScaleOrders(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
597
590
|
preparePlaceScaleOrdersTx(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<{
|
|
598
|
-
placeScaleOrdersTx:
|
|
591
|
+
placeScaleOrdersTx: Transaction | VersionedTransaction;
|
|
599
592
|
}>;
|
|
600
593
|
getPlaceScaleOrdersIx(params: ScaleOrderParams, subAccountId?: number): Promise<TransactionInstruction>;
|
|
601
594
|
fillPerpOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams, fillerSubAccountId?: number, fillerAuthority?: PublicKey, hasBuilderFee?: boolean): Promise<TransactionSignature>;
|
|
@@ -1248,12 +1241,12 @@ export declare class DriftClient {
|
|
|
1248
1241
|
sendTransaction(tx: Transaction | VersionedTransaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions, preSigned?: boolean): Promise<TxSigAndSlot>;
|
|
1249
1242
|
buildTransaction(instructions: TransactionInstruction | TransactionInstruction[], txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean, recentBlockhash?: BlockhashWithExpiryBlockHeight, optionalIxs?: TransactionInstruction[]): Promise<Transaction | VersionedTransaction>;
|
|
1250
1243
|
buildBulkTransactions(instructions: (TransactionInstruction | TransactionInstruction[])[], txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean): Promise<(Transaction | VersionedTransaction)[]>;
|
|
1251
|
-
buildTransactionsMap(instructionsMap: Record<string, TransactionInstruction | TransactionInstruction[]>, txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean): Promise<MappedRecord<Record<string,
|
|
1244
|
+
buildTransactionsMap(instructionsMap: Record<string, TransactionInstruction | TransactionInstruction[]>, txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean): Promise<MappedRecord<Record<string, TransactionInstruction | TransactionInstruction[]>, Transaction | VersionedTransaction>>;
|
|
1252
1245
|
buildAndSignTransactionsMap(instructionsMap: Record<string, TransactionInstruction | TransactionInstruction[]>, txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean): Promise<{
|
|
1253
|
-
signedTxMap: Record<string,
|
|
1246
|
+
signedTxMap: Record<string, Transaction>;
|
|
1254
1247
|
signedTxData: SignedTxData[];
|
|
1255
1248
|
} | {
|
|
1256
|
-
signedTxMap: MappedRecord<Record<string,
|
|
1249
|
+
signedTxMap: MappedRecord<Record<string, TransactionInstruction | TransactionInstruction[]>, Transaction | VersionedTransaction>;
|
|
1257
1250
|
signedTxData: SignedTxData[];
|
|
1258
1251
|
}>;
|
|
1259
1252
|
isOrderIncreasingPosition(orderParams: OptionalOrderParams, subAccountId: number): boolean;
|