aftermath-ts-sdk 1.3.28 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16828 -5
- package/dist/index.js +22695 -19
- package/dist/index.js.map +1 -0
- package/package.json +69 -60
- package/dist/general/apiHelpers/dynamicFieldsApiHelpers.d.ts +0 -41
- package/dist/general/apiHelpers/dynamicFieldsApiHelpers.d.ts.map +0 -1
- package/dist/general/apiHelpers/dynamicFieldsApiHelpers.js +0 -110
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts +0 -43
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts.map +0 -1
- package/dist/general/apiHelpers/eventsApiHelpers.js +0 -170
- package/dist/general/apiHelpers/inspectionsApiHelpers.d.ts +0 -28
- package/dist/general/apiHelpers/inspectionsApiHelpers.d.ts.map +0 -1
- package/dist/general/apiHelpers/inspectionsApiHelpers.js +0 -58
- package/dist/general/apiHelpers/objectsApiHelpers.d.ts +0 -77
- package/dist/general/apiHelpers/objectsApiHelpers.d.ts.map +0 -1
- package/dist/general/apiHelpers/objectsApiHelpers.js +0 -197
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts +0 -50
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts.map +0 -1
- package/dist/general/apiHelpers/transactionsApiHelpers.js +0 -256
- package/dist/general/dynamicGas/dynamicGas.d.ts +0 -48
- package/dist/general/dynamicGas/dynamicGas.d.ts.map +0 -1
- package/dist/general/dynamicGas/dynamicGas.js +0 -69
- package/dist/general/dynamicGas/dynamicGasTypes.d.ts +0 -37
- package/dist/general/dynamicGas/dynamicGasTypes.d.ts.map +0 -1
- package/dist/general/dynamicGas/dynamicGasTypes.js +0 -2
- package/dist/general/nfts/nftsApi.d.ts +0 -35
- package/dist/general/nfts/nftsApi.d.ts.map +0 -1
- package/dist/general/nfts/nftsApi.js +0 -124
- package/dist/general/nfts/nftsApiCasting.d.ts +0 -11
- package/dist/general/nfts/nftsApiCasting.d.ts.map +0 -1
- package/dist/general/nfts/nftsApiCasting.js +0 -115
- package/dist/general/nfts/nftsTypes.d.ts +0 -31
- package/dist/general/nfts/nftsTypes.d.ts.map +0 -1
- package/dist/general/nfts/nftsTypes.js +0 -2
- package/dist/general/priceFeeds/priceFeeds.d.ts +0 -3
- package/dist/general/priceFeeds/priceFeeds.d.ts.map +0 -1
- package/dist/general/priceFeeds/priceFeeds.js +0 -26
- package/dist/general/priceFeeds/priceFeedsApi.d.ts +0 -3
- package/dist/general/priceFeeds/priceFeedsApi.d.ts.map +0 -1
- package/dist/general/priceFeeds/priceFeedsApi.js +0 -33
- package/dist/general/priceFeeds/priceFeedsTypes.d.ts +0 -3
- package/dist/general/priceFeeds/priceFeedsTypes.d.ts.map +0 -1
- package/dist/general/priceFeeds/priceFeedsTypes.js +0 -7
- package/dist/general/prices/coinGeckoTypes.d.ts +0 -16
- package/dist/general/prices/coinGeckoTypes.d.ts.map +0 -1
- package/dist/general/prices/coinGeckoTypes.js +0 -2
- package/dist/general/prices/prices.d.ts +0 -92
- package/dist/general/prices/prices.d.ts.map +0 -1
- package/dist/general/prices/prices.js +0 -124
- package/dist/general/providers/aftermath.d.ts +0 -200
- package/dist/general/providers/aftermath.d.ts.map +0 -1
- package/dist/general/providers/aftermath.js +0 -258
- package/dist/general/providers/aftermathApi.d.ts +0 -197
- package/dist/general/providers/aftermathApi.d.ts.map +0 -1
- package/dist/general/providers/aftermathApi.js +0 -255
- package/dist/general/providers/index.d.ts +0 -3
- package/dist/general/providers/index.d.ts.map +0 -1
- package/dist/general/providers/index.js +0 -18
- package/dist/general/types/castingTypes.d.ts +0 -51
- package/dist/general/types/castingTypes.d.ts.map +0 -1
- package/dist/general/types/castingTypes.js +0 -8
- package/dist/general/types/configTypes.d.ts +0 -187
- package/dist/general/types/configTypes.d.ts.map +0 -1
- package/dist/general/types/configTypes.js +0 -2
- package/dist/general/types/generalTypes.d.ts +0 -349
- package/dist/general/types/generalTypes.d.ts.map +0 -1
- package/dist/general/types/generalTypes.js +0 -2
- package/dist/general/types/index.d.ts +0 -7
- package/dist/general/types/index.d.ts.map +0 -1
- package/dist/general/types/index.js +0 -22
- package/dist/general/types/moveErrorsInterface.d.ts +0 -6
- package/dist/general/types/moveErrorsInterface.d.ts.map +0 -1
- package/dist/general/types/moveErrorsInterface.js +0 -2
- package/dist/general/types/suiTypes.d.ts +0 -2
- package/dist/general/types/suiTypes.d.ts.map +0 -1
- package/dist/general/types/suiTypes.js +0 -5
- package/dist/general/utils/caller.d.ts +0 -58
- package/dist/general/utils/caller.d.ts.map +0 -1
- package/dist/general/utils/caller.js +0 -231
- package/dist/general/utils/casting.d.ts +0 -212
- package/dist/general/utils/casting.d.ts.map +0 -1
- package/dist/general/utils/casting.js +0 -273
- package/dist/general/utils/fixedUtils.d.ts +0 -109
- package/dist/general/utils/fixedUtils.d.ts.map +0 -1
- package/dist/general/utils/fixedUtils.js +0 -100
- package/dist/general/utils/helpers.d.ts +0 -408
- package/dist/general/utils/helpers.d.ts.map +0 -1
- package/dist/general/utils/helpers.js +0 -725
- package/dist/general/utils/iFixedUtils.d.ts +0 -78
- package/dist/general/utils/iFixedUtils.d.ts.map +0 -1
- package/dist/general/utils/iFixedUtils.js +0 -109
- package/dist/general/utils/index.d.ts +0 -3
- package/dist/general/utils/index.d.ts.map +0 -1
- package/dist/general/utils/index.js +0 -18
- package/dist/general/wallet/wallet.d.ts +0 -89
- package/dist/general/wallet/wallet.d.ts.map +0 -1
- package/dist/general/wallet/wallet.js +0 -120
- package/dist/general/wallet/walletApi.d.ts +0 -20
- package/dist/general/wallet/walletApi.d.ts.map +0 -1
- package/dist/general/wallet/walletApi.js +0 -66
- package/dist/index.d.ts.map +0 -1
- package/dist/packages/auth/auth.d.ts +0 -135
- package/dist/packages/auth/auth.d.ts.map +0 -1
- package/dist/packages/auth/auth.js +0 -289
- package/dist/packages/auth/authTypes.d.ts +0 -102
- package/dist/packages/auth/authTypes.d.ts.map +0 -1
- package/dist/packages/auth/authTypes.js +0 -2
- package/dist/packages/auth/index.d.ts +0 -2
- package/dist/packages/auth/index.d.ts.map +0 -1
- package/dist/packages/auth/index.js +0 -17
- package/dist/packages/coin/api/coinApi.d.ts +0 -33
- package/dist/packages/coin/api/coinApi.d.ts.map +0 -1
- package/dist/packages/coin/api/coinApi.js +0 -167
- package/dist/packages/coin/coin.d.ts +0 -320
- package/dist/packages/coin/coin.d.ts.map +0 -1
- package/dist/packages/coin/coin.js +0 -467
- package/dist/packages/coin/coinTypes.d.ts +0 -139
- package/dist/packages/coin/coinTypes.d.ts.map +0 -1
- package/dist/packages/coin/coinTypes.js +0 -2
- package/dist/packages/coin/index.d.ts +0 -2
- package/dist/packages/coin/index.d.ts.map +0 -1
- package/dist/packages/coin/index.js +0 -17
- package/dist/packages/dca/api/dcaApi.d.ts +0 -26
- package/dist/packages/dca/api/dcaApi.d.ts.map +0 -1
- package/dist/packages/dca/api/dcaApi.js +0 -60
- package/dist/packages/dca/dca.d.ts +0 -174
- package/dist/packages/dca/dca.d.ts.map +0 -1
- package/dist/packages/dca/dca.js +0 -230
- package/dist/packages/dca/dcaTypes.d.ts +0 -319
- package/dist/packages/dca/dcaTypes.d.ts.map +0 -1
- package/dist/packages/dca/dcaTypes.js +0 -2
- package/dist/packages/dca/index.d.ts +0 -2
- package/dist/packages/dca/index.d.ts.map +0 -1
- package/dist/packages/dca/index.js +0 -17
- package/dist/packages/farms/api/farmsApi.d.ts +0 -996
- package/dist/packages/farms/api/farmsApi.d.ts.map +0 -1
- package/dist/packages/farms/api/farmsApi.js +0 -1826
- package/dist/packages/farms/api/farmsApiCasting.d.ts +0 -39
- package/dist/packages/farms/api/farmsApiCasting.d.ts.map +0 -1
- package/dist/packages/farms/api/farmsApiCasting.js +0 -427
- package/dist/packages/farms/api/farmsApiCastingTypes.d.ts +0 -235
- package/dist/packages/farms/api/farmsApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/farms/api/farmsApiCastingTypes.js +0 -2
- package/dist/packages/farms/farms.d.ts +0 -221
- package/dist/packages/farms/farms.d.ts.map +0 -1
- package/dist/packages/farms/farms.js +0 -302
- package/dist/packages/farms/farmsStakedPosition.d.ts +0 -229
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +0 -1
- package/dist/packages/farms/farmsStakedPosition.js +0 -473
- package/dist/packages/farms/farmsStakingPool.d.ts +0 -285
- package/dist/packages/farms/farmsStakingPool.d.ts.map +0 -1
- package/dist/packages/farms/farmsStakingPool.js +0 -488
- package/dist/packages/farms/farmsTypes.d.ts +0 -571
- package/dist/packages/farms/farmsTypes.d.ts.map +0 -1
- package/dist/packages/farms/farmsTypes.js +0 -49
- package/dist/packages/farms/index.d.ts +0 -4
- package/dist/packages/farms/index.d.ts.map +0 -1
- package/dist/packages/farms/index.js +0 -19
- package/dist/packages/faucet/api/faucetApi.d.ts +0 -37
- package/dist/packages/faucet/api/faucetApi.d.ts.map +0 -1
- package/dist/packages/faucet/api/faucetApi.js +0 -145
- package/dist/packages/faucet/api/faucetApiCasting.d.ts +0 -7
- package/dist/packages/faucet/api/faucetApiCasting.d.ts.map +0 -1
- package/dist/packages/faucet/api/faucetApiCasting.js +0 -33
- package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts +0 -10
- package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/faucet/api/faucetApiCastingTypes.js +0 -2
- package/dist/packages/faucet/faucet.d.ts +0 -16
- package/dist/packages/faucet/faucet.d.ts.map +0 -1
- package/dist/packages/faucet/faucet.js +0 -64
- package/dist/packages/faucet/faucetTypes.d.ts +0 -20
- package/dist/packages/faucet/faucetTypes.d.ts.map +0 -1
- package/dist/packages/faucet/faucetTypes.js +0 -2
- package/dist/packages/faucet/index.d.ts +0 -2
- package/dist/packages/faucet/index.d.ts.map +0 -1
- package/dist/packages/faucet/index.js +0 -17
- package/dist/packages/index.d.ts +0 -14
- package/dist/packages/index.d.ts.map +0 -1
- package/dist/packages/index.js +0 -29
- package/dist/packages/leveragedStaking/api/leveragedStakingApi.d.ts +0 -202
- package/dist/packages/leveragedStaking/api/leveragedStakingApi.d.ts.map +0 -1
- package/dist/packages/leveragedStaking/api/leveragedStakingApi.js +0 -1104
- package/dist/packages/leveragedStaking/api/leveragedStakingApiCasting.d.ts +0 -12
- package/dist/packages/leveragedStaking/api/leveragedStakingApiCasting.d.ts.map +0 -1
- package/dist/packages/leveragedStaking/api/leveragedStakingApiCasting.js +0 -69
- package/dist/packages/leveragedStaking/api/leveragedStakingApiCastingTypes.d.ts +0 -39
- package/dist/packages/leveragedStaking/api/leveragedStakingApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/leveragedStaking/api/leveragedStakingApiCastingTypes.js +0 -2
- package/dist/packages/leveragedStaking/index.d.ts +0 -2
- package/dist/packages/leveragedStaking/index.d.ts.map +0 -1
- package/dist/packages/leveragedStaking/index.js +0 -17
- package/dist/packages/leveragedStaking/leveragedStaking.d.ts +0 -68
- package/dist/packages/leveragedStaking/leveragedStaking.d.ts.map +0 -1
- package/dist/packages/leveragedStaking/leveragedStaking.js +0 -154
- package/dist/packages/leveragedStaking/leveragedStakingTypes.d.ts +0 -48
- package/dist/packages/leveragedStaking/leveragedStakingTypes.d.ts.map +0 -1
- package/dist/packages/leveragedStaking/leveragedStakingTypes.js +0 -16
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts +0 -12
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts.map +0 -1
- package/dist/packages/limitOrders/api/limitOrdersApi.js +0 -25
- package/dist/packages/limitOrders/index.d.ts +0 -2
- package/dist/packages/limitOrders/index.d.ts.map +0 -1
- package/dist/packages/limitOrders/index.js +0 -17
- package/dist/packages/limitOrders/limitOrders.d.ts +0 -143
- package/dist/packages/limitOrders/limitOrders.d.ts.map +0 -1
- package/dist/packages/limitOrders/limitOrders.js +0 -190
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts +0 -211
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts.map +0 -1
- package/dist/packages/limitOrders/limitOrdersTypes.js +0 -2
- package/dist/packages/multisig/api/multisigApi.d.ts +0 -10
- package/dist/packages/multisig/api/multisigApi.d.ts.map +0 -1
- package/dist/packages/multisig/api/multisigApi.js +0 -39
- package/dist/packages/multisig/index.d.ts +0 -2
- package/dist/packages/multisig/index.d.ts.map +0 -1
- package/dist/packages/multisig/index.js +0 -17
- package/dist/packages/multisig/multisig.d.ts +0 -46
- package/dist/packages/multisig/multisig.d.ts.map +0 -1
- package/dist/packages/multisig/multisig.js +0 -65
- package/dist/packages/multisig/multisigTypes.d.ts +0 -26
- package/dist/packages/multisig/multisigTypes.d.ts.map +0 -1
- package/dist/packages/multisig/multisigTypes.js +0 -2
- package/dist/packages/nftAmm/api/nftAmmApi.d.ts +0 -93
- package/dist/packages/nftAmm/api/nftAmmApi.d.ts.map +0 -1
- package/dist/packages/nftAmm/api/nftAmmApi.js +0 -250
- package/dist/packages/nftAmm/api/nftAmmApiCasting.d.ts +0 -6
- package/dist/packages/nftAmm/api/nftAmmApiCasting.d.ts.map +0 -1
- package/dist/packages/nftAmm/api/nftAmmApiCasting.js +0 -43
- package/dist/packages/nftAmm/api/nftAmmApiCastingTypes.d.ts +0 -10
- package/dist/packages/nftAmm/api/nftAmmApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/nftAmm/api/nftAmmApiCastingTypes.js +0 -2
- package/dist/packages/nftAmm/index.d.ts +0 -2
- package/dist/packages/nftAmm/index.d.ts.map +0 -1
- package/dist/packages/nftAmm/index.js +0 -17
- package/dist/packages/nftAmm/nftAmm.d.ts +0 -18
- package/dist/packages/nftAmm/nftAmm.d.ts.map +0 -1
- package/dist/packages/nftAmm/nftAmm.js +0 -73
- package/dist/packages/nftAmm/nftAmmMarket.d.ts +0 -54
- package/dist/packages/nftAmm/nftAmmMarket.d.ts.map +0 -1
- package/dist/packages/nftAmm/nftAmmMarket.js +0 -154
- package/dist/packages/nftAmm/nftAmmTypes.d.ts +0 -51
- package/dist/packages/nftAmm/nftAmmTypes.d.ts.map +0 -1
- package/dist/packages/nftAmm/nftAmmTypes.js +0 -2
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts +0 -44
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +0 -1
- package/dist/packages/perpetuals/api/perpetualsApi.js +0 -1420
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts +0 -27
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts.map +0 -1
- package/dist/packages/perpetuals/api/perpetualsApiCasting.js +0 -463
- package/dist/packages/perpetuals/index.d.ts +0 -5
- package/dist/packages/perpetuals/index.d.ts.map +0 -1
- package/dist/packages/perpetuals/index.js +0 -20
- package/dist/packages/perpetuals/perpetuals.d.ts +0 -860
- package/dist/packages/perpetuals/perpetuals.d.ts.map +0 -1
- package/dist/packages/perpetuals/perpetuals.js +0 -1102
- package/dist/packages/perpetuals/perpetualsAccount.d.ts +0 -780
- package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +0 -1
- package/dist/packages/perpetuals/perpetualsAccount.js +0 -1406
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts +0 -170
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts.map +0 -1
- package/dist/packages/perpetuals/perpetualsCastingTypes.js +0 -2
- package/dist/packages/perpetuals/perpetualsMarket.d.ts +0 -360
- package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +0 -1
- package/dist/packages/perpetuals/perpetualsMarket.js +0 -475
- package/dist/packages/perpetuals/perpetualsTypes.d.ts +0 -2968
- package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +0 -1
- package/dist/packages/perpetuals/perpetualsTypes.js +0 -165
- package/dist/packages/perpetuals/perpetualsVault.d.ts +0 -438
- package/dist/packages/perpetuals/perpetualsVault.d.ts.map +0 -1
- package/dist/packages/perpetuals/perpetualsVault.js +0 -601
- package/dist/packages/perpetuals/utils/index.d.ts +0 -2
- package/dist/packages/perpetuals/utils/index.d.ts.map +0 -1
- package/dist/packages/perpetuals/utils/index.js +0 -17
- package/dist/packages/perpetuals/utils/perpetualsOrderUtils.d.ts +0 -12
- package/dist/packages/perpetuals/utils/perpetualsOrderUtils.d.ts.map +0 -1
- package/dist/packages/perpetuals/utils/perpetualsOrderUtils.js +0 -60
- package/dist/packages/pools/api/poolsApi.d.ts +0 -342
- package/dist/packages/pools/api/poolsApi.d.ts.map +0 -1
- package/dist/packages/pools/api/poolsApi.js +0 -857
- package/dist/packages/pools/api/poolsApiCasting.d.ts +0 -13
- package/dist/packages/pools/api/poolsApiCasting.d.ts.map +0 -1
- package/dist/packages/pools/api/poolsApiCasting.js +0 -91
- package/dist/packages/pools/api/poolsApiCastingTypes.d.ts +0 -64
- package/dist/packages/pools/api/poolsApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/pools/api/poolsApiCastingTypes.js +0 -2
- package/dist/packages/pools/index.d.ts +0 -3
- package/dist/packages/pools/index.d.ts.map +0 -1
- package/dist/packages/pools/index.js +0 -18
- package/dist/packages/pools/pool.d.ts +0 -459
- package/dist/packages/pools/pool.d.ts.map +0 -1
- package/dist/packages/pools/pool.js +0 -647
- package/dist/packages/pools/pools.d.ts +0 -405
- package/dist/packages/pools/pools.d.ts.map +0 -1
- package/dist/packages/pools/pools.js +0 -533
- package/dist/packages/pools/poolsTypes.d.ts +0 -469
- package/dist/packages/pools/poolsTypes.d.ts.map +0 -1
- package/dist/packages/pools/poolsTypes.js +0 -2
- package/dist/packages/pools/utils/cmmmCalculations.d.ts +0 -42
- package/dist/packages/pools/utils/cmmmCalculations.d.ts.map +0 -1
- package/dist/packages/pools/utils/cmmmCalculations.js +0 -1380
- package/dist/packages/referralVault/api/referralVaultApi.d.ts +0 -39
- package/dist/packages/referralVault/api/referralVaultApi.d.ts.map +0 -1
- package/dist/packages/referralVault/api/referralVaultApi.js +0 -125
- package/dist/packages/referralVault/index.d.ts +0 -2
- package/dist/packages/referralVault/index.d.ts.map +0 -1
- package/dist/packages/referralVault/index.js +0 -17
- package/dist/packages/referralVault/referralVault.d.ts +0 -47
- package/dist/packages/referralVault/referralVault.d.ts.map +0 -1
- package/dist/packages/referralVault/referralVault.js +0 -71
- package/dist/packages/referralVault/referralVaultTypes.d.ts +0 -2
- package/dist/packages/referralVault/referralVaultTypes.d.ts.map +0 -1
- package/dist/packages/referralVault/referralVaultTypes.js +0 -2
- package/dist/packages/referrals/index.d.ts +0 -2
- package/dist/packages/referrals/index.d.ts.map +0 -1
- package/dist/packages/referrals/index.js +0 -17
- package/dist/packages/referrals/referrals.d.ts +0 -27
- package/dist/packages/referrals/referrals.d.ts.map +0 -1
- package/dist/packages/referrals/referrals.js +0 -95
- package/dist/packages/referrals/referralsTypes.d.ts +0 -166
- package/dist/packages/referrals/referralsTypes.d.ts.map +0 -1
- package/dist/packages/referrals/referralsTypes.js +0 -2
- package/dist/packages/rewards/index.d.ts +0 -2
- package/dist/packages/rewards/index.d.ts.map +0 -1
- package/dist/packages/rewards/index.js +0 -17
- package/dist/packages/rewards/rewards.d.ts +0 -21
- package/dist/packages/rewards/rewards.d.ts.map +0 -1
- package/dist/packages/rewards/rewards.js +0 -65
- package/dist/packages/rewards/rewardsTypes.d.ts +0 -169
- package/dist/packages/rewards/rewardsTypes.d.ts.map +0 -1
- package/dist/packages/rewards/rewardsTypes.js +0 -2
- package/dist/packages/router/api/routerApi.d.ts +0 -35
- package/dist/packages/router/api/routerApi.d.ts.map +0 -1
- package/dist/packages/router/api/routerApi.js +0 -88
- package/dist/packages/router/api/routerApiCasting.d.ts +0 -6
- package/dist/packages/router/api/routerApiCasting.d.ts.map +0 -1
- package/dist/packages/router/api/routerApiCasting.js +0 -22
- package/dist/packages/router/api/routerApiCastingTypes.d.ts +0 -12
- package/dist/packages/router/api/routerApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/router/api/routerApiCastingTypes.js +0 -2
- package/dist/packages/router/index.d.ts +0 -2
- package/dist/packages/router/index.d.ts.map +0 -1
- package/dist/packages/router/index.js +0 -17
- package/dist/packages/router/router.d.ts +0 -224
- package/dist/packages/router/router.d.ts.map +0 -1
- package/dist/packages/router/router.js +0 -283
- package/dist/packages/router/routerTypes.d.ts +0 -300
- package/dist/packages/router/routerTypes.d.ts.map +0 -1
- package/dist/packages/router/routerTypes.js +0 -2
- package/dist/packages/staking/api/stakingApi.d.ts +0 -129
- package/dist/packages/staking/api/stakingApi.d.ts.map +0 -1
- package/dist/packages/staking/api/stakingApi.js +0 -487
- package/dist/packages/staking/api/stakingApiCasting.d.ts +0 -11
- package/dist/packages/staking/api/stakingApiCasting.d.ts.map +0 -1
- package/dist/packages/staking/api/stakingApiCasting.js +0 -87
- package/dist/packages/staking/api/stakingApiCastingTypes.d.ts +0 -97
- package/dist/packages/staking/api/stakingApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/staking/api/stakingApiCastingTypes.js +0 -2
- package/dist/packages/staking/index.d.ts +0 -2
- package/dist/packages/staking/index.d.ts.map +0 -1
- package/dist/packages/staking/index.js +0 -17
- package/dist/packages/staking/staking.d.ts +0 -385
- package/dist/packages/staking/staking.d.ts.map +0 -1
- package/dist/packages/staking/staking.js +0 -501
- package/dist/packages/staking/stakingTypes.d.ts +0 -575
- package/dist/packages/staking/stakingTypes.d.ts.map +0 -1
- package/dist/packages/staking/stakingTypes.js +0 -45
- package/dist/packages/sui/api/suiApi.d.ts +0 -21
- package/dist/packages/sui/api/suiApi.d.ts.map +0 -1
- package/dist/packages/sui/api/suiApi.js +0 -46
- package/dist/packages/sui/index.d.ts +0 -2
- package/dist/packages/sui/index.d.ts.map +0 -1
- package/dist/packages/sui/index.js +0 -17
- package/dist/packages/sui/sui.d.ts +0 -53
- package/dist/packages/sui/sui.d.ts.map +0 -1
- package/dist/packages/sui/sui.js +0 -77
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts +0 -204
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts.map +0 -1
- package/dist/packages/suiFrens/api/suiFrensApi.js +0 -756
- package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts +0 -21
- package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts.map +0 -1
- package/dist/packages/suiFrens/api/suiFrensApiCasting.js +0 -181
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts +0 -77
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.js +0 -2
- package/dist/packages/suiFrens/index.d.ts +0 -4
- package/dist/packages/suiFrens/index.d.ts.map +0 -1
- package/dist/packages/suiFrens/index.js +0 -19
- package/dist/packages/suiFrens/stakedSuiFren.d.ts +0 -31
- package/dist/packages/suiFrens/stakedSuiFren.d.ts.map +0 -1
- package/dist/packages/suiFrens/stakedSuiFren.js +0 -90
- package/dist/packages/suiFrens/suiFren.d.ts +0 -32
- package/dist/packages/suiFrens/suiFren.d.ts.map +0 -1
- package/dist/packages/suiFrens/suiFren.js +0 -150
- package/dist/packages/suiFrens/suiFrens.d.ts +0 -56
- package/dist/packages/suiFrens/suiFrens.d.ts.map +0 -1
- package/dist/packages/suiFrens/suiFrens.js +0 -218
- package/dist/packages/suiFrens/suiFrensTypes.d.ts +0 -148
- package/dist/packages/suiFrens/suiFrensTypes.d.ts.map +0 -1
- package/dist/packages/suiFrens/suiFrensTypes.js +0 -8
- package/dist/packages/userData/index.d.ts +0 -2
- package/dist/packages/userData/index.d.ts.map +0 -1
- package/dist/packages/userData/index.js +0 -17
- package/dist/packages/userData/userData.d.ts +0 -89
- package/dist/packages/userData/userData.d.ts.map +0 -1
- package/dist/packages/userData/userData.js +0 -119
- package/dist/packages/userData/userDataTypes.d.ts +0 -29
- package/dist/packages/userData/userDataTypes.d.ts.map +0 -1
- package/dist/packages/userData/userDataTypes.js +0 -2
- package/dist/types.d.ts +0 -15
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -31
|
@@ -1,780 +0,0 @@
|
|
|
1
|
-
import { Caller } from "../../general/utils/caller";
|
|
2
|
-
import { ApiPerpetualsPreviewPlaceOrderResponse, Balance, PerpetualsAccountCap, PerpetualsAccountObject, PerpetualsMarketId, PerpetualsOrderId, PerpetualsPosition, SdkPerpetualsPlaceLimitOrderInputs, SdkPerpetualsPlaceMarketOrderInputs, SuiAddress, ObjectId, ApiPerpetualsAccountCollateralHistoryResponse, ApiPerpetualsAccountOrderHistoryResponse, PerpetualsAccountId, ApiPerpetualsAccountCollateralHistoryBody, ApiPerpetualsAccountOrderHistoryBody, ApiPerpetualsPreviewCancelOrdersResponse, CallerConfig, SdkPerpetualsCancelOrdersPreviewInputs, PerpetualsStopOrderData, SdkPerpetualsPlaceStopOrdersInputs, ApiPerpetualsEditStopOrdersBody, SdkPerpetualsPlaceSlTpOrdersInputs, ApiPerpetualsWithdrawCollateralResponse, SdkPerpetualsPlaceMarketOrderPreviewInputs, SdkPerpetualsPlaceLimitOrderPreviewInputs, ApiTransactionResponse, ApiPerpetualsAccountMarginHistoryBody, PerpetualsPartialVaultCap, ApiPerpetualsAccountMarginHistoryResponse, ApiPerpetualsStopOrderDatasResponse, PerpetualsOrderData } from "../../types";
|
|
3
|
-
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
4
|
-
import { AftermathApi } from "../../general/providers";
|
|
5
|
-
/**
|
|
6
|
-
* Note on “refreshing” account state:
|
|
7
|
-
*
|
|
8
|
-
* This class is a thin wrapper around a snapshot of {@link PerpetualsAccountObject}
|
|
9
|
-
* that is typically fetched via {@link Perpetuals.getAccount}. The transaction builders
|
|
10
|
-
* use the current snapshot to derive fields like `hasPosition` and to construct
|
|
11
|
-
* SL/TP helpers that depend on the position side.
|
|
12
|
-
*
|
|
13
|
-
* If your app is long-lived, you may want to periodically re-fetch the account
|
|
14
|
-
* (and recreate this wrapper) to avoid stale local position/order state. For example:
|
|
15
|
-
* - After placing/canceling orders
|
|
16
|
-
* - After fills/liquidations/funding settlements
|
|
17
|
-
* - After switching markets or wallets
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* High-level wrapper around a single Perpetuals account or vault account.
|
|
21
|
-
*
|
|
22
|
-
* This class encapsulates:
|
|
23
|
-
*
|
|
24
|
-
* - Transaction builders for:
|
|
25
|
-
* - Collateral actions (deposit, withdraw, allocate, deallocate, transfer)
|
|
26
|
-
* - Orders (market/limit, cancel, stop orders, SL/TP, set leverage)
|
|
27
|
-
* - Read-only account helpers:
|
|
28
|
-
* - Stop-order message signing
|
|
29
|
-
* - Order & stop-order metadata
|
|
30
|
-
* - Collateral & trade history
|
|
31
|
-
* - Convenience helpers to:
|
|
32
|
-
* - Fetch and categorize SL/TP stop orders
|
|
33
|
-
* - Resolve account/vault identifiers and owner addresses
|
|
34
|
-
*
|
|
35
|
-
* You typically do not construct `PerpetualsAccount` directly. Instead, use
|
|
36
|
-
* {@link Perpetuals.getAccount} or {@link Perpetuals.getAccounts}, which
|
|
37
|
-
* fetch all required on-chain data and wrap it for you:
|
|
38
|
-
*
|
|
39
|
-
* ```ts
|
|
40
|
-
* const afSdk = new Aftermath("MAINNET");
|
|
41
|
-
* await afSdk.init();
|
|
42
|
-
*
|
|
43
|
-
* const perps = afSdk.Perpetuals();
|
|
44
|
-
* const [accountCap] = await perps.getOwnedAccountCaps({
|
|
45
|
-
* walletAddress: "0x...",
|
|
46
|
-
* });
|
|
47
|
-
*
|
|
48
|
-
* const account = await perps.getAccount({ accountCap });
|
|
49
|
-
*
|
|
50
|
-
* // Build a deposit transaction
|
|
51
|
-
* const depositTx = await account.getDepositCollateralTx({
|
|
52
|
-
* depositAmount: BigInt("1000000000"),
|
|
53
|
-
* });
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
export declare class PerpetualsAccount extends Caller {
|
|
57
|
-
readonly account: PerpetualsAccountObject;
|
|
58
|
-
readonly accountCap: PerpetualsAccountCap | PerpetualsPartialVaultCap;
|
|
59
|
-
readonly Provider?: AftermathApi | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* If this account is backed by a vault, this holds the vault object ID.
|
|
62
|
-
* Otherwise, `undefined` for "direct" user accounts.
|
|
63
|
-
*
|
|
64
|
-
* This is used primarily to route requests to either:
|
|
65
|
-
* - `/perpetuals/account/...` endpoints, or
|
|
66
|
-
* - `/perpetuals/vault/...` endpoints.
|
|
67
|
-
*/
|
|
68
|
-
private readonly vaultId;
|
|
69
|
-
/**
|
|
70
|
-
* Create a new {@link PerpetualsAccount} wrapper.
|
|
71
|
-
*
|
|
72
|
-
* @param account - Raw account object with positions and equity data.
|
|
73
|
-
* @param accountCap - Account cap or partial vault cap object containing
|
|
74
|
-
* ownership and collateral metadata.
|
|
75
|
-
* @param config - Optional {@link CallerConfig} (network, auth, etc.).
|
|
76
|
-
* @param Provider - Optional shared {@link AftermathApi} provider instance
|
|
77
|
-
* used to derive serialized transaction kinds (`txKind`) from
|
|
78
|
-
* {@link Transaction} objects.
|
|
79
|
-
*/
|
|
80
|
-
constructor(account: PerpetualsAccountObject, accountCap: PerpetualsAccountCap | PerpetualsPartialVaultCap, config?: CallerConfig, Provider?: AftermathApi | undefined);
|
|
81
|
-
/**
|
|
82
|
-
* Build a `deposit-collateral` transaction for this account.
|
|
83
|
-
*
|
|
84
|
-
* For non-vault accounts, this endpoint constructs a transaction that:
|
|
85
|
-
* - Optionally extends an existing {@link Transaction}, and
|
|
86
|
-
* - Deposits collateral into the Perpetuals account.
|
|
87
|
-
*
|
|
88
|
-
* **Note:** Vault accounts are currently not supported and will throw.
|
|
89
|
-
*
|
|
90
|
-
* @param inputs.tx - Optional existing transaction to extend. If omitted,
|
|
91
|
-
* a new {@link Transaction} is created under the hood.
|
|
92
|
-
* @param inputs.isSponsoredTx - Optional flag indicating whether the
|
|
93
|
-
* transaction is gas-sponsored.
|
|
94
|
-
* @param inputs.depositAmount - Amount of collateral to deposit, if paying
|
|
95
|
-
* directly from the wallet.
|
|
96
|
-
* @param inputs.depositCoinArg - Transaction object argument referencing a
|
|
97
|
-
* coin to deposit (mutually exclusive with `depositAmount`).
|
|
98
|
-
*
|
|
99
|
-
* @returns Transaction response containing a `tx`.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```ts
|
|
103
|
-
* const { tx } = await account.getDepositCollateralTx({
|
|
104
|
-
* depositAmount: BigInt("1000000000"),
|
|
105
|
-
* });
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
108
|
-
getDepositCollateralTx(inputs: {
|
|
109
|
-
tx?: Transaction;
|
|
110
|
-
isSponsoredTx?: boolean;
|
|
111
|
-
} & ({
|
|
112
|
-
depositAmount: Balance;
|
|
113
|
-
} | {
|
|
114
|
-
depositCoinArg: TransactionObjectArgument;
|
|
115
|
-
})): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
116
|
-
tx: Transaction;
|
|
117
|
-
}>;
|
|
118
|
-
/**
|
|
119
|
-
* Build a `withdraw-collateral` transaction for this account.
|
|
120
|
-
*
|
|
121
|
-
* For non-vault accounts, this endpoint constructs a transaction to:
|
|
122
|
-
* - Withdraw collateral from the Perpetuals account, and
|
|
123
|
-
* - Optionally transfer it to a `recipientAddress` (otherwise coin is left
|
|
124
|
-
* as a transaction argument).
|
|
125
|
-
*
|
|
126
|
-
* **Note:** Vault accounts are currently not supported and will throw.
|
|
127
|
-
*
|
|
128
|
-
* @param inputs.withdrawAmount - Amount of collateral to withdraw.
|
|
129
|
-
* @param inputs.recipientAddress - Optional address to receive the withdrawn
|
|
130
|
-
* coins directly.
|
|
131
|
-
* @param inputs.tx - Optional transaction to extend (defaults to new `Transaction()`).
|
|
132
|
-
*
|
|
133
|
-
* @returns A response containing `tx` and the `coinOutArg` where the
|
|
134
|
-
* withdrawn coins end up if `recipientAddress` is not used.
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* ```ts
|
|
138
|
-
* const { tx, coinOutArg } = await account.getWithdrawCollateralTx({
|
|
139
|
-
* withdrawAmount: BigInt("1000000000"),
|
|
140
|
-
* });
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
getWithdrawCollateralTx(inputs: {
|
|
144
|
-
withdrawAmount: Balance;
|
|
145
|
-
recipientAddress?: SuiAddress;
|
|
146
|
-
tx?: Transaction;
|
|
147
|
-
}): Promise<Omit<ApiPerpetualsWithdrawCollateralResponse, "txKind"> & {
|
|
148
|
-
tx: Transaction;
|
|
149
|
-
}>;
|
|
150
|
-
/**
|
|
151
|
-
* Build an `allocate-collateral` transaction, moving collateral from this
|
|
152
|
-
* account into a specific market (clearing house).
|
|
153
|
-
*
|
|
154
|
-
* Works for both account-backed and vault-backed accounts.
|
|
155
|
-
*
|
|
156
|
-
* @param inputs.marketId - Market to allocate collateral to.
|
|
157
|
-
* @param inputs.allocateAmount - Amount of collateral to allocate.
|
|
158
|
-
* @param inputs.tx - Optional transaction to extend.
|
|
159
|
-
*
|
|
160
|
-
* @returns Transaction response containing a `tx`.
|
|
161
|
-
*/
|
|
162
|
-
getAllocateCollateralTx(inputs: {
|
|
163
|
-
marketId: PerpetualsMarketId;
|
|
164
|
-
allocateAmount: Balance;
|
|
165
|
-
tx?: Transaction;
|
|
166
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
167
|
-
tx: Transaction;
|
|
168
|
-
}>;
|
|
169
|
-
/**
|
|
170
|
-
* Build a `deallocate-collateral` transaction, moving collateral from a
|
|
171
|
-
* specific market back to this account.
|
|
172
|
-
*
|
|
173
|
-
* Works for both account-backed and vault-backed accounts.
|
|
174
|
-
*
|
|
175
|
-
* @param inputs.marketId - Market to deallocate collateral from.
|
|
176
|
-
* @param inputs.deallocateAmount - Amount of collateral to deallocate.
|
|
177
|
-
* @param inputs.tx - Optional transaction to extend.
|
|
178
|
-
*
|
|
179
|
-
* @returns Transaction response containing a `tx`.
|
|
180
|
-
*/
|
|
181
|
-
getDeallocateCollateralTx(inputs: {
|
|
182
|
-
marketId: PerpetualsMarketId;
|
|
183
|
-
deallocateAmount: Balance;
|
|
184
|
-
tx?: Transaction;
|
|
185
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
186
|
-
tx: Transaction;
|
|
187
|
-
}>;
|
|
188
|
-
/**
|
|
189
|
-
* Build a `transfer-collateral` transaction between two Perpetuals accounts.
|
|
190
|
-
*
|
|
191
|
-
* Only supported for direct accounts, **not** vault-backed accounts.
|
|
192
|
-
*
|
|
193
|
-
* @param inputs.transferAmount - Amount of collateral to transfer.
|
|
194
|
-
* @param inputs.toAccountId - Destination account ID.
|
|
195
|
-
* @param inputs.tx - Optional transaction to extend.
|
|
196
|
-
*
|
|
197
|
-
* @returns Transaction response containing a `tx`.
|
|
198
|
-
*/
|
|
199
|
-
getTransferCollateralTx(inputs: {
|
|
200
|
-
transferAmount: Balance;
|
|
201
|
-
toAccountId: PerpetualsAccountId;
|
|
202
|
-
toAccountCapId?: ObjectId;
|
|
203
|
-
tx?: Transaction;
|
|
204
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
205
|
-
tx: Transaction;
|
|
206
|
-
}>;
|
|
207
|
-
/**
|
|
208
|
-
* Build a `place-market-order` transaction for this account.
|
|
209
|
-
*
|
|
210
|
-
* This is the primary entrypoint for opening/closing positions via market orders.
|
|
211
|
-
* It automatically:
|
|
212
|
-
* - Injects the account/vault identity into the payload.
|
|
213
|
-
* - Derives `hasPosition` based on the current account state for the given market.
|
|
214
|
-
* - Optionally attaches SL/TP stop orders via the `slTp` input.
|
|
215
|
-
*
|
|
216
|
-
* Important behavioral notes:
|
|
217
|
-
* - `hasPosition` is derived from the local {@link PerpetualsAccountObject} snapshot.
|
|
218
|
-
* If the snapshot is stale, consider re-fetching the account first.
|
|
219
|
-
* - For vault-backed accounts, the API routes to `/perpetuals/vault/...` and uses
|
|
220
|
-
* `vaultId` as the identity discriminator. For direct accounts, it uses `accountId`.
|
|
221
|
-
*
|
|
222
|
-
* @param inputs - See {@link SdkPerpetualsPlaceMarketOrderInputs} for details.
|
|
223
|
-
* Notably:
|
|
224
|
-
* - `marketId`, `side`, `size`, `collateralChange`, `reduceOnly`
|
|
225
|
-
* - Optional `leverage`
|
|
226
|
-
* - Optional `slTp` params
|
|
227
|
-
* - Optional `tx` to extend
|
|
228
|
-
*
|
|
229
|
-
* @returns Transaction response containing `tx`.
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* ```ts
|
|
233
|
-
* const { tx } = await account.getPlaceMarketOrderTx({
|
|
234
|
-
* marketId: "0x...",
|
|
235
|
-
* side: PerpetualsOrderSide.Bid,
|
|
236
|
-
* size: BigInt("1000000000"),
|
|
237
|
-
* collateralChange: 10,
|
|
238
|
-
* reduceOnly: false,
|
|
239
|
-
* });
|
|
240
|
-
* ```
|
|
241
|
-
*/
|
|
242
|
-
getPlaceMarketOrderTx(inputs: SdkPerpetualsPlaceMarketOrderInputs): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
243
|
-
tx: Transaction;
|
|
244
|
-
}>;
|
|
245
|
-
/**
|
|
246
|
-
* Build a `place-limit-order` transaction for this account.
|
|
247
|
-
*
|
|
248
|
-
* Similar to {@link getPlaceMarketOrderTx}, but uses limit order semantics:
|
|
249
|
-
* - Requires `price` and `orderType`.
|
|
250
|
-
* - Supports reduce-only flags, expiry, optional leverage, and SL/TP stop orders.
|
|
251
|
-
*
|
|
252
|
-
* Notes:
|
|
253
|
-
* - `hasPosition` is derived from local account state; refresh the account if needed.
|
|
254
|
-
* - This method does not validate tick/lot sizing locally; the API/on-chain
|
|
255
|
-
* will enforce market constraints.
|
|
256
|
-
*
|
|
257
|
-
* @param inputs - See {@link SdkPerpetualsPlaceLimitOrderInputs}.
|
|
258
|
-
*
|
|
259
|
-
* @returns Transaction response containing `tx`.
|
|
260
|
-
*/
|
|
261
|
-
getPlaceLimitOrderTx(inputs: SdkPerpetualsPlaceLimitOrderInputs): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
262
|
-
tx: Transaction;
|
|
263
|
-
}>;
|
|
264
|
-
/**
|
|
265
|
-
* Build a `cancel-orders` transaction for this account.
|
|
266
|
-
*
|
|
267
|
-
* Each market in `marketIdsToData` supplies:
|
|
268
|
-
* - `orderIds`: the orders to cancel in that market
|
|
269
|
-
* - `collateralChange`: collateral adjustment to apply alongside cancellation
|
|
270
|
-
* - `leverage`: leverage context used for estimating/validating constraints server-side
|
|
271
|
-
*
|
|
272
|
-
* Notes:
|
|
273
|
-
* - Cancels are applied per market; some markets may succeed while others fail
|
|
274
|
-
* depending on API/on-chain validation (returned as a transaction failure at execution).
|
|
275
|
-
* - If you need to understand the effect prior to building a tx, use
|
|
276
|
-
* {@link getCancelOrdersPreview}.
|
|
277
|
-
*
|
|
278
|
-
* @param inputs.tx - Optional transaction to extend.
|
|
279
|
-
* @param inputs.marketIdsToData - Mapping from market IDs to cancel payloads.
|
|
280
|
-
*
|
|
281
|
-
* @returns Transaction response containing `tx`.
|
|
282
|
-
*/
|
|
283
|
-
getCancelOrdersTx(inputs: {
|
|
284
|
-
tx?: Transaction;
|
|
285
|
-
marketIdsToData: Record<PerpetualsMarketId, {
|
|
286
|
-
orderIds: PerpetualsOrderId[];
|
|
287
|
-
collateralChange: number;
|
|
288
|
-
}>;
|
|
289
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
290
|
-
tx: Transaction;
|
|
291
|
-
}>;
|
|
292
|
-
/**
|
|
293
|
-
* Build a `cancel-stop-orders` transaction for this account.
|
|
294
|
-
*
|
|
295
|
-
* This cancels stop-order *objects/tickets* by their object IDs. These IDs are
|
|
296
|
-
* returned by stop-order query endpoints (see {@link getStopOrderDatas}).
|
|
297
|
-
*
|
|
298
|
-
* @param inputs.tx - Optional transaction to extend.
|
|
299
|
-
* @param inputs.stopOrderIds - Array of stop-order ticket IDs to cancel.
|
|
300
|
-
*
|
|
301
|
-
* @returns Transaction response containing `tx`.
|
|
302
|
-
*/
|
|
303
|
-
getCancelStopOrdersTx(inputs: {
|
|
304
|
-
tx?: Transaction;
|
|
305
|
-
stopOrderIds: ObjectId[];
|
|
306
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
307
|
-
tx: Transaction;
|
|
308
|
-
}>;
|
|
309
|
-
/**
|
|
310
|
-
* Build a `place-stop-orders` transaction for this account.
|
|
311
|
-
*
|
|
312
|
-
* This allows placing one or more stop orders in a single transaction,
|
|
313
|
-
* optionally with a dedicated gas coin and a sponsored gas flag.
|
|
314
|
-
*
|
|
315
|
-
* Typical usage:
|
|
316
|
-
* - Construct stop order payload(s) client-side
|
|
317
|
-
* - Call this method to build a transaction kind
|
|
318
|
-
* - Sign/execute the transaction via Sui
|
|
319
|
-
*
|
|
320
|
-
* @param inputs - See {@link SdkPerpetualsPlaceStopOrdersInputs}.
|
|
321
|
-
*
|
|
322
|
-
* @returns Transaction response containing `tx`.
|
|
323
|
-
*/
|
|
324
|
-
getPlaceStopOrdersTx(inputs: SdkPerpetualsPlaceStopOrdersInputs): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
325
|
-
tx: Transaction;
|
|
326
|
-
}>;
|
|
327
|
-
/**
|
|
328
|
-
* Build a `place-sl-tp-orders` transaction for this account.
|
|
329
|
-
*
|
|
330
|
-
* This helper constructs SL/TP stop orders for an **existing** position
|
|
331
|
-
* in a given market. If the account has no position for `marketId`, this
|
|
332
|
-
* throws an error.
|
|
333
|
-
*
|
|
334
|
-
* Implementation details:
|
|
335
|
-
* - Determines the current position side from the account snapshot.
|
|
336
|
-
* - Sets `positionSide` for the API so SL/TP orders are bound to closing logic
|
|
337
|
-
* (i.e. they should trigger on the opposite side of the open position).
|
|
338
|
-
*
|
|
339
|
-
* @param inputs - See {@link SdkPerpetualsPlaceSlTpOrdersInputs}.
|
|
340
|
-
*
|
|
341
|
-
* @returns Transaction response containing `tx`.
|
|
342
|
-
*/
|
|
343
|
-
getPlaceSlTpOrdersTx(inputs: SdkPerpetualsPlaceSlTpOrdersInputs): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
344
|
-
tx: Transaction;
|
|
345
|
-
}>;
|
|
346
|
-
/**
|
|
347
|
-
* Build an `edit-stop-orders` transaction for this account.
|
|
348
|
-
*
|
|
349
|
-
* This endpoint lets you update existing stop orders in batch.
|
|
350
|
-
*
|
|
351
|
-
* Notes:
|
|
352
|
-
* - You must provide the full updated stop-order objects (including object IDs).
|
|
353
|
-
* - This is typically used to adjust trigger prices, sizes, expiries, or the
|
|
354
|
-
* embedded limit-order parameters.
|
|
355
|
-
*
|
|
356
|
-
* @param inputs.stopOrders - Full updated stop-order payloads to apply.
|
|
357
|
-
* @param inputs.tx - Optional transaction to extend.
|
|
358
|
-
*
|
|
359
|
-
* @returns Transaction response containing `tx`.
|
|
360
|
-
*/
|
|
361
|
-
getEditStopOrdersTx(inputs: Omit<ApiPerpetualsEditStopOrdersBody, "txKind" | "accountObjectId"> & {
|
|
362
|
-
tx?: Transaction;
|
|
363
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
364
|
-
tx: Transaction;
|
|
365
|
-
}>;
|
|
366
|
-
/**
|
|
367
|
-
* Build a `set-leverage` transaction for a given market.
|
|
368
|
-
*
|
|
369
|
-
* This updates the effective leverage for the position (or potential position)
|
|
370
|
-
* in `marketId`, and optionally adjusts collateral in tandem.
|
|
371
|
-
*
|
|
372
|
-
* Notes:
|
|
373
|
-
* - Leverage changes may be constrained by protocol risk limits and current
|
|
374
|
-
* position state.
|
|
375
|
-
* - If you want to understand the effect first, use {@link getSetLeveragePreview}.
|
|
376
|
-
*
|
|
377
|
-
* @param inputs.tx - Optional transaction to extend.
|
|
378
|
-
* @param inputs.leverage - Target leverage value.
|
|
379
|
-
* @param inputs.collateralChange - Net collateral change to apply alongside
|
|
380
|
-
* the leverage update.
|
|
381
|
-
* @param inputs.marketId - Market whose leverage to adjust.
|
|
382
|
-
*
|
|
383
|
-
* @returns Transaction response containing `tx`.
|
|
384
|
-
*/
|
|
385
|
-
getSetLeverageTx(inputs: {
|
|
386
|
-
tx?: Transaction;
|
|
387
|
-
leverage: number;
|
|
388
|
-
collateralChange: number;
|
|
389
|
-
marketId: PerpetualsMarketId;
|
|
390
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
391
|
-
tx: Transaction;
|
|
392
|
-
}>;
|
|
393
|
-
/**
|
|
394
|
-
* Build a deterministic message payload to sign when querying stop orders
|
|
395
|
-
* from the backend.
|
|
396
|
-
*
|
|
397
|
-
* This payload is intended to be signed off-chain and then submitted to
|
|
398
|
-
* `getStopOrderDatas` as a proof of account ownership.
|
|
399
|
-
*
|
|
400
|
-
* Important:
|
|
401
|
-
* - The returned payload is *not* a Sui transaction; it is an off-chain
|
|
402
|
-
* “authentication” message.
|
|
403
|
-
* - The backend expects `account_id` to be a decimal string. This code
|
|
404
|
-
* normalizes the bigint `accountId` by stripping the trailing `n`.
|
|
405
|
-
*
|
|
406
|
-
* @param inputs.marketIds - Optional list of market IDs to scope the query.
|
|
407
|
-
*
|
|
408
|
-
* @returns An object describing the action and account/market IDs, suitable
|
|
409
|
-
* for message signing.
|
|
410
|
-
*
|
|
411
|
-
* @example
|
|
412
|
-
* ```ts
|
|
413
|
-
* const message = account.getStopOrdersMessageToSign({ marketIds: ["0x..."] });
|
|
414
|
-
* const { signature } = await wallet.signMessage({
|
|
415
|
-
* message: new TextEncoder().encode(JSON.stringify(message)),
|
|
416
|
-
* });
|
|
417
|
-
* ```
|
|
418
|
-
*/
|
|
419
|
-
getStopOrdersMessageToSign(inputs?: {
|
|
420
|
-
marketIds: PerpetualsMarketId[];
|
|
421
|
-
}): {
|
|
422
|
-
action: string;
|
|
423
|
-
account_id: string;
|
|
424
|
-
clearing_house_ids: string[];
|
|
425
|
-
};
|
|
426
|
-
/**
|
|
427
|
-
* Preview the effects of placing a market order (without building a tx).
|
|
428
|
-
*
|
|
429
|
-
* This is a read-only API call that runs the protocol’s pricing / margin /
|
|
430
|
-
* slippage logic against the current market state and your account/vault context.
|
|
431
|
-
*
|
|
432
|
-
* @param inputs - See {@link SdkPerpetualsPlaceMarketOrderPreviewInputs}.
|
|
433
|
-
* @param abortSignal - Optional `AbortSignal` to cancel the request.
|
|
434
|
-
*
|
|
435
|
-
* @returns Either an error message or a preview including:
|
|
436
|
-
* - `updatedPosition`
|
|
437
|
-
* - `priceSlippage`, `percentSlippage`
|
|
438
|
-
* - `filledSize`, `filledSizeUsd`
|
|
439
|
-
* - `postedSize`, `postedSizeUsd`
|
|
440
|
-
* - `collateralChange`
|
|
441
|
-
* - `executionPrice`
|
|
442
|
-
*/
|
|
443
|
-
getPlaceMarketOrderPreview(inputs: SdkPerpetualsPlaceMarketOrderPreviewInputs, abortSignal?: AbortSignal): Promise<ApiPerpetualsPreviewPlaceOrderResponse>;
|
|
444
|
-
/**
|
|
445
|
-
* Preview the effects of placing a limit order (without building a tx).
|
|
446
|
-
*
|
|
447
|
-
* The preview simulates:
|
|
448
|
-
* - How much size would execute immediately vs post to the book
|
|
449
|
-
* - Expected slippage and execution price
|
|
450
|
-
* - Resulting position and margin impact
|
|
451
|
-
*
|
|
452
|
-
* @param inputs - See {@link SdkPerpetualsPlaceLimitOrderPreviewInputs}.
|
|
453
|
-
* @param abortSignal - Optional `AbortSignal` to cancel the request.
|
|
454
|
-
*
|
|
455
|
-
* @returns Either an error message or a preview object similar to
|
|
456
|
-
* {@link getPlaceMarketOrderPreview}.
|
|
457
|
-
*/
|
|
458
|
-
getPlaceLimitOrderPreview(inputs: SdkPerpetualsPlaceLimitOrderPreviewInputs, abortSignal?: AbortSignal): Promise<ApiPerpetualsPreviewPlaceOrderResponse>;
|
|
459
|
-
/**
|
|
460
|
-
* Preview the effects of canceling orders across one or more markets.
|
|
461
|
-
*
|
|
462
|
-
* This is commonly used to:
|
|
463
|
-
* - Validate that cancels are allowed under current margin constraints
|
|
464
|
-
* - Estimate how collateral/margin would change after canceling (and applying
|
|
465
|
-
* the associated `collateralChange` values)
|
|
466
|
-
*
|
|
467
|
-
* If `marketIdsToData` is empty, this returns a trivial preview with:
|
|
468
|
-
* - `marketIdsToData: {}`
|
|
469
|
-
*
|
|
470
|
-
* @param inputs - See {@link SdkPerpetualsCancelOrdersPreviewInputs}.
|
|
471
|
-
* @param abortSignal - Optional `AbortSignal` to cancel the request.
|
|
472
|
-
*
|
|
473
|
-
* @returns Either:
|
|
474
|
-
* - `{ marketIdsToData }`, or
|
|
475
|
-
* - `{ error }`.
|
|
476
|
-
*/
|
|
477
|
-
getCancelOrdersPreview(inputs: SdkPerpetualsCancelOrdersPreviewInputs, abortSignal?: AbortSignal): Promise<ApiPerpetualsPreviewCancelOrdersResponse>;
|
|
478
|
-
/**
|
|
479
|
-
* Preview the effects of setting leverage for a given market.
|
|
480
|
-
*
|
|
481
|
-
* The preview returns:
|
|
482
|
-
* - The position after the leverage change (`updatedPosition`)
|
|
483
|
-
* - The collateral delta required/produced (`collateralChange`)
|
|
484
|
-
*
|
|
485
|
-
* @param inputs.marketId - Market whose leverage you want to adjust.
|
|
486
|
-
* @param inputs.leverage - Target leverage value.
|
|
487
|
-
* @param abortSignal - Optional `AbortSignal` to cancel the request.
|
|
488
|
-
*
|
|
489
|
-
* @returns Either:
|
|
490
|
-
* - `{ updatedPosition, collateralChange }`, or
|
|
491
|
-
* - `{ error }`.
|
|
492
|
-
*/
|
|
493
|
-
getSetLeveragePreview(inputs: {
|
|
494
|
-
marketId: PerpetualsMarketId;
|
|
495
|
-
leverage: number;
|
|
496
|
-
}, abortSignal?: AbortSignal): Promise<{
|
|
497
|
-
updatedPosition: PerpetualsPosition;
|
|
498
|
-
collateralChange: number;
|
|
499
|
-
} | {
|
|
500
|
-
error: string;
|
|
501
|
-
}>;
|
|
502
|
-
/**
|
|
503
|
-
* Preview the effects of allocating/deallocating collateral for the position in
|
|
504
|
-
* a given market.
|
|
505
|
-
*
|
|
506
|
-
* Semantics:
|
|
507
|
-
* - Positive `collateralChange` previews allocation (moving collateral into the market).
|
|
508
|
-
* - Negative `collateralChange` previews deallocation (moving collateral out of the market).
|
|
509
|
-
*
|
|
510
|
-
* @param inputs.marketId - Market of whose position you want to allocate/deallocate
|
|
511
|
-
* collateral to/from.
|
|
512
|
-
* @param inputs.collateralChange - The target collateral change (a positive number
|
|
513
|
-
* for allocating collateral, negative for deallocating collateral).
|
|
514
|
-
* @param abortSignal - Optional `AbortSignal` to cancel the request.
|
|
515
|
-
*
|
|
516
|
-
* @returns Either:
|
|
517
|
-
* - `{ updatedPosition, collateralChange }`, or
|
|
518
|
-
* - `{ error }`.
|
|
519
|
-
*/
|
|
520
|
-
getEditCollateralPreview(inputs: {
|
|
521
|
-
marketId: PerpetualsMarketId;
|
|
522
|
-
collateralChange: Balance;
|
|
523
|
-
}, abortSignal?: AbortSignal): Promise<{
|
|
524
|
-
updatedPosition: PerpetualsPosition;
|
|
525
|
-
collateralChange: number;
|
|
526
|
-
} | {
|
|
527
|
-
error: string;
|
|
528
|
-
}>;
|
|
529
|
-
/**
|
|
530
|
-
* Fetch stop-order ticket data for this account, using an off-chain signed
|
|
531
|
-
* payload.
|
|
532
|
-
*
|
|
533
|
-
* Typical flow:
|
|
534
|
-
* 1) Call {@link getStopOrdersMessageToSign} to construct a deterministic payload
|
|
535
|
-
* 2) Sign the payload with the wallet
|
|
536
|
-
* 3) Provide the signed payload to this method to fetch stop order data
|
|
537
|
-
*
|
|
538
|
-
* @param inputs.bytes - Serialized message that was signed (e.g. JSON string).
|
|
539
|
-
* @param inputs.signature - Signature over `bytes`.
|
|
540
|
-
* @param inputs.marketIds - Optional subset of markets to filter results by.
|
|
541
|
-
*
|
|
542
|
-
* @returns {@link ApiPerpetualsStopOrderDatasResponse} containing `stopOrderDatas`.
|
|
543
|
-
*/
|
|
544
|
-
getStopOrderDatas(inputs: {
|
|
545
|
-
bytes: string;
|
|
546
|
-
signature: string;
|
|
547
|
-
marketIds?: PerpetualsMarketId[];
|
|
548
|
-
}): Promise<ApiPerpetualsStopOrderDatasResponse>;
|
|
549
|
-
/**
|
|
550
|
-
* Fetch paginated collateral-change history for this account, including
|
|
551
|
-
* deposits, withdrawals, funding settlements, liquidations, etc.
|
|
552
|
-
*
|
|
553
|
-
* Pagination:
|
|
554
|
-
* - Use `beforeTimestampCursor` to fetch older entries.
|
|
555
|
-
* - The API returns a `nextBeforeTimestampCursor` to continue pagination.
|
|
556
|
-
*
|
|
557
|
-
* @param inputs.beforeTimestampCursor - Optional cursor for pagination.
|
|
558
|
-
* @param inputs.limit - Optional limit per page.
|
|
559
|
-
*
|
|
560
|
-
* @returns {@link ApiPerpetualsAccountCollateralHistoryResponse} containing
|
|
561
|
-
* an array of changes and a `nextBeforeTimestampCursor`.
|
|
562
|
-
*/
|
|
563
|
-
getCollateralHistory(inputs: Omit<ApiPerpetualsAccountCollateralHistoryBody, "accountId">): Promise<ApiPerpetualsAccountCollateralHistoryResponse>;
|
|
564
|
-
/**
|
|
565
|
-
* Fetch paginated order history for this account.
|
|
566
|
-
*
|
|
567
|
-
* This endpoint is distinct from {@link getOrderDatas}:
|
|
568
|
-
* - `getOrderDatas` resolves current/pending orders based on the snapshot.
|
|
569
|
-
* - `getOrderHistory` returns historical order events (fills, cancels, etc.)
|
|
570
|
-
* over time with cursor-based pagination.
|
|
571
|
-
*
|
|
572
|
-
* @param inputs.beforeTimestampCursor - Optional cursor for pagination.
|
|
573
|
-
* @param inputs.limit - Optional limit per page.
|
|
574
|
-
*
|
|
575
|
-
* @returns {@link ApiPerpetualsAccountOrderHistoryResponse} containing a list of
|
|
576
|
-
* orders and a `nextBeforeTimestampCursor`.
|
|
577
|
-
*/
|
|
578
|
-
getOrderHistory(inputs: Omit<ApiPerpetualsAccountOrderHistoryBody, "accountId">): Promise<ApiPerpetualsAccountOrderHistoryResponse>;
|
|
579
|
-
/**
|
|
580
|
-
* Fetch historical margin snapshots for this account over a time range.
|
|
581
|
-
*
|
|
582
|
-
* This endpoint returns time-series margin data suitable for charting UI
|
|
583
|
-
* such as equity and available collateral over time.
|
|
584
|
-
*
|
|
585
|
-
* Notes:
|
|
586
|
-
* - This is an account-level view (aggregated across markets).
|
|
587
|
-
*
|
|
588
|
-
* @param inputs - {@link ApiPerpetualsAccountMarginHistoryBody} without `accountId`.
|
|
589
|
-
* @returns {@link ApiPerpetualsAccountMarginHistoryResponse} containing `marginHistoryDatas`.
|
|
590
|
-
*/
|
|
591
|
-
getMarginHistory(inputs: Omit<ApiPerpetualsAccountMarginHistoryBody, "accountId">): Promise<ApiPerpetualsAccountMarginHistoryResponse>;
|
|
592
|
-
/**
|
|
593
|
-
* Build a transaction that grants an Agent Wallet (assistant permissions) for this perpetuals account.
|
|
594
|
-
*
|
|
595
|
-
* The returned transaction must be signed and submitted by the **account admin** wallet.
|
|
596
|
-
* After execution, `recipientAddress` can execute supported trading actions on behalf of this account.
|
|
597
|
-
*
|
|
598
|
-
* Agent wallets can perform all supported actions **except**:
|
|
599
|
-
* - withdrawing collateral, and
|
|
600
|
-
* - granting or revoking other agent wallets.
|
|
601
|
-
*
|
|
602
|
-
* @param inputs.recipientAddress Wallet address to receive agent permissions.
|
|
603
|
-
* @param inputs.tx Optional existing {@link Transaction} to append to. If omitted, a new Transaction is used.
|
|
604
|
-
* @throws If this instance represents a vault account (agent wallets are account-only).
|
|
605
|
-
*/
|
|
606
|
-
getGrantAgentWalletTx(inputs: {
|
|
607
|
-
recipientAddress: SuiAddress;
|
|
608
|
-
tx?: Transaction;
|
|
609
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
610
|
-
tx: Transaction;
|
|
611
|
-
}>;
|
|
612
|
-
/**
|
|
613
|
-
* Build a transaction that revokes an Agent Wallet (assistant capability) from this perpetuals account.
|
|
614
|
-
*
|
|
615
|
-
* The returned transaction must be signed and submitted by the **account admin** wallet.
|
|
616
|
-
* After execution, the revoked wallet immediately loses its delegated permissions.
|
|
617
|
-
*
|
|
618
|
-
* @param inputs.accountCapId Object ID of the assistant capability to revoke.
|
|
619
|
-
* @param inputs.tx Optional existing {@link Transaction} to append to. If omitted, a new Transaction is used.
|
|
620
|
-
* @throws If this instance represents a vault account (agent wallets are account-only).
|
|
621
|
-
*/
|
|
622
|
-
getRevokeAgentWalletTx(inputs: {
|
|
623
|
-
accountCapId: ObjectId;
|
|
624
|
-
tx?: Transaction;
|
|
625
|
-
}): Promise<Omit<ApiTransactionResponse, "txKind"> & {
|
|
626
|
-
tx: Transaction;
|
|
627
|
-
}>;
|
|
628
|
-
/**
|
|
629
|
-
* Find the current position for a given market ID, if any.
|
|
630
|
-
*
|
|
631
|
-
* @param inputs.marketId - Market ID to search for.
|
|
632
|
-
* @returns {@link PerpetualsPosition} if found, otherwise `undefined`.
|
|
633
|
-
*/
|
|
634
|
-
positionForMarketId(inputs: {
|
|
635
|
-
marketId: PerpetualsMarketId;
|
|
636
|
-
}): PerpetualsPosition | undefined;
|
|
637
|
-
/**
|
|
638
|
-
* Filter a list of stop orders to only include non-SL/TP orders.
|
|
639
|
-
*
|
|
640
|
-
* A stop order is considered SL/TP if it appears in the combined set of
|
|
641
|
-
* SL/TP orders across **all** markets (see {@link slTpStopOrderDatas}).
|
|
642
|
-
*
|
|
643
|
-
* Note:
|
|
644
|
-
* - This implementation uses JSON string equality to compare objects.
|
|
645
|
-
* This is pragmatic but assumes stable field ordering and identical shapes.
|
|
646
|
-
*
|
|
647
|
-
* @param inputs.stopOrderDatas - Full array of stop-order ticket data.
|
|
648
|
-
* @returns An array of non-SL/TP stop orders, or `undefined` if none exist.
|
|
649
|
-
*/
|
|
650
|
-
nonSlTpStopOrderDatas(inputs: {
|
|
651
|
-
stopOrderDatas: PerpetualsStopOrderData[];
|
|
652
|
-
}): PerpetualsStopOrderData[] | undefined;
|
|
653
|
-
/**
|
|
654
|
-
* Extract all SL/TP-style stop orders across **all** markets for this
|
|
655
|
-
* account.
|
|
656
|
-
*
|
|
657
|
-
* SL/TP orders are stop orders which:
|
|
658
|
-
* - Have an `slTp` payload, and
|
|
659
|
-
* - Target the opposite side of the current position.
|
|
660
|
-
*
|
|
661
|
-
* This combines:
|
|
662
|
-
* - "Full" SL/TP orders (size >= `i64MaxBigInt`)
|
|
663
|
-
* - "Partial" SL/TP orders (size < `i64MaxBigInt`)
|
|
664
|
-
*
|
|
665
|
-
* The "full vs partial" distinction is a protocol convention: some systems
|
|
666
|
-
* encode “close entire position” using a sentinel max size.
|
|
667
|
-
*
|
|
668
|
-
* @param inputs.stopOrderDatas - Full list of stop-order tickets.
|
|
669
|
-
* @returns Array of SL/TP stop orders, or `undefined` if none exist.
|
|
670
|
-
*/
|
|
671
|
-
slTpStopOrderDatas(inputs: {
|
|
672
|
-
stopOrderDatas: PerpetualsStopOrderData[];
|
|
673
|
-
}): PerpetualsStopOrderData[] | undefined;
|
|
674
|
-
/**
|
|
675
|
-
* Filter stop orders for a single market to only include non-SL/TP orders.
|
|
676
|
-
*
|
|
677
|
-
* Uses {@link slTpStopOrderDatasForPosition} under the hood.
|
|
678
|
-
*
|
|
679
|
-
* @param inputs.marketId - Market ID to filter for.
|
|
680
|
-
* @param inputs.stopOrderDatas - Full list of stop orders.
|
|
681
|
-
* @returns Non-SL/TP stop orders for the given market, or `undefined` if none exist.
|
|
682
|
-
*/
|
|
683
|
-
nonSlTpStopOrderDatasForPosition(inputs: {
|
|
684
|
-
marketId: PerpetualsMarketId;
|
|
685
|
-
stopOrderDatas: PerpetualsStopOrderData[];
|
|
686
|
-
}): PerpetualsStopOrderData[] | undefined;
|
|
687
|
-
/**
|
|
688
|
-
* Categorize stop orders for a specific market into:
|
|
689
|
-
* - A "full" SL/TP order (size >= `i64MaxBigInt`) if any.
|
|
690
|
-
* - A set of "partial" SL/TP orders (size < `i64MaxBigInt`).
|
|
691
|
-
*
|
|
692
|
-
* SL/TP stop orders are defined as:
|
|
693
|
-
* - Market ID matches the input market.
|
|
694
|
-
* - `slTp` field is present.
|
|
695
|
-
* - Order side is opposite of the position side.
|
|
696
|
-
* - At least a `stopLossIndexPrice` or `takeProfitIndexPrice` is set.
|
|
697
|
-
*
|
|
698
|
-
* Notes on matching:
|
|
699
|
-
* - The side comparison uses the current position side derived from the account snapshot.
|
|
700
|
-
* - If `baseAssetAmount === 0` (no effective position), the method returns no SL/TP orders.
|
|
701
|
-
*
|
|
702
|
-
* @param inputs.marketId - Market to categorize stop orders for.
|
|
703
|
-
* @param inputs.stopOrderDatas - Full list of stop orders.
|
|
704
|
-
*
|
|
705
|
-
* @returns Object containing:
|
|
706
|
-
* - `fullSlTpOrder` (if any)
|
|
707
|
-
* - `partialSlTpOrders` (if any, otherwise `undefined`)
|
|
708
|
-
*/
|
|
709
|
-
slTpStopOrderDatasForPosition(inputs: {
|
|
710
|
-
marketId: PerpetualsMarketId;
|
|
711
|
-
stopOrderDatas: PerpetualsStopOrderData[];
|
|
712
|
-
}): {
|
|
713
|
-
fullSlTpOrder: PerpetualsStopOrderData | undefined;
|
|
714
|
-
partialSlTpOrders: PerpetualsStopOrderData[] | undefined;
|
|
715
|
-
};
|
|
716
|
-
slTpStopOrderDatasForLimitOrder(inputs: {
|
|
717
|
-
stopOrderDatas: PerpetualsStopOrderData[];
|
|
718
|
-
limitOrderId: PerpetualsOrderId;
|
|
719
|
-
}): {
|
|
720
|
-
fullSlTpOrder: PerpetualsStopOrderData | undefined;
|
|
721
|
-
partialSlTpOrders: PerpetualsStopOrderData[] | undefined;
|
|
722
|
-
};
|
|
723
|
-
orderDatas(): PerpetualsOrderData[];
|
|
724
|
-
/**
|
|
725
|
-
* Convenience accessor for the account's available collateral (in coin units).
|
|
726
|
-
*
|
|
727
|
-
* This is the amount of collateral not currently locked/allocated across markets,
|
|
728
|
-
* as represented by the backend response.
|
|
729
|
-
*
|
|
730
|
-
* @returns Available collateral as a `number`.
|
|
731
|
-
*/
|
|
732
|
-
collateral(): number;
|
|
733
|
-
/**
|
|
734
|
-
* Check whether this {@link PerpetualsAccount} is vault-backed.
|
|
735
|
-
*
|
|
736
|
-
* @returns `true` if the underlying `accountCap` is a vault cap; otherwise `false`.
|
|
737
|
-
*/
|
|
738
|
-
isVault(): boolean;
|
|
739
|
-
/**
|
|
740
|
-
* Resolve the owner wallet address of this account or vault.
|
|
741
|
-
*
|
|
742
|
-
* - For direct accounts, returns the cap's `walletAddress` field.
|
|
743
|
-
* - For vault-backed accounts, returns the vault cap's `ownerAddress`.
|
|
744
|
-
*
|
|
745
|
-
* Naming note:
|
|
746
|
-
* - Some types use `walletAddress` for direct ownership. For vault-backed accounts
|
|
747
|
-
* the analogous field is `ownerAddress`.
|
|
748
|
-
*
|
|
749
|
-
* @returns Owner wallet {@link SuiAddress}.
|
|
750
|
-
*/
|
|
751
|
-
ownerAddress(): SuiAddress;
|
|
752
|
-
/**
|
|
753
|
-
* Get the underlying account object ID.
|
|
754
|
-
*
|
|
755
|
-
* This is the on-chain object that holds the account's state and positions.
|
|
756
|
-
*
|
|
757
|
-
* @returns {@link ObjectId} of the account object.
|
|
758
|
-
*/
|
|
759
|
-
accountObjectId(): ObjectId;
|
|
760
|
-
/**
|
|
761
|
-
* Get the numeric perpetuals account ID.
|
|
762
|
-
*
|
|
763
|
-
* This is the protocol-level identifier (bigint-derived) used across API calls.
|
|
764
|
-
*
|
|
765
|
-
* @returns {@link PerpetualsAccountId} for this account.
|
|
766
|
-
*/
|
|
767
|
-
accountId(): PerpetualsAccountId;
|
|
768
|
-
/**
|
|
769
|
-
* Get the account cap object ID, if this is a direct account.
|
|
770
|
-
*
|
|
771
|
-
* Direct accounts are controlled via an on-chain “cap” object. Vault-backed
|
|
772
|
-
* accounts are controlled via vault caps and do not expose a direct account-cap ID.
|
|
773
|
-
*
|
|
774
|
-
* @throws If called for a vault-backed account.
|
|
775
|
-
*
|
|
776
|
-
* @returns {@link ObjectId} of the account cap.
|
|
777
|
-
*/
|
|
778
|
-
accountCapId(): ObjectId;
|
|
779
|
-
}
|
|
780
|
-
//# sourceMappingURL=perpetualsAccount.d.ts.map
|