aftermath-ts-sdk 0.0.162 → 0.0.164
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/general/api/dynamicFieldsApiHelpers.d.ts +29 -6
- package/dist/general/api/dynamicFieldsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/dynamicFieldsApiHelpers.js +31 -31
- package/dist/general/api/eventsApiHelpers.d.ts +23 -8
- package/dist/general/api/eventsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/eventsApiHelpers.js +38 -33
- package/dist/general/api/inspectionsApiHelpers.js +9 -9
- package/dist/general/api/objectsApiHelpers.d.ts +150 -110
- package/dist/general/api/objectsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/objectsApiHelpers.js +32 -27
- package/dist/general/api/rpcApiHelpers.js +9 -9
- package/dist/general/api/transactionsApiHelpers.d.ts +9 -4
- package/dist/general/api/transactionsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/transactionsApiHelpers.js +28 -19
- package/dist/general/historicalData/historicalData.js +6 -6
- package/dist/general/historicalData/historicalDataApi.js +6 -6
- package/dist/general/historicalData/historicalDataApiInterface.d.ts +2 -1
- package/dist/general/historicalData/historicalDataApiInterface.d.ts.map +1 -1
- package/dist/general/prices/coingecko/coinGeckoApiHelpers.js +24 -24
- package/dist/general/prices/coingecko/coinGeckoPricesApi.js +15 -15
- package/dist/general/prices/placeholder/placeholderPricesApi.d.ts.map +1 -1
- package/dist/general/prices/placeholder/placeholderPricesApi.js +40 -33
- package/dist/general/prices/prices.js +6 -6
- package/dist/general/prices/pyth/pythPricesApi.js +12 -12
- package/dist/general/prices/pyth/pythPricesApiHelpers.js +12 -12
- package/dist/general/providers/aftermath.d.ts +4 -2
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +22 -20
- package/dist/general/providers/aftermathApi.d.ts +4 -2
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +34 -32
- package/dist/general/types/configTypes.d.ts +94 -14
- package/dist/general/types/configTypes.d.ts.map +1 -1
- package/dist/general/types/generalTypes.d.ts +12 -1
- package/dist/general/types/generalTypes.d.ts.map +1 -1
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/caller.js +11 -9
- package/dist/general/utils/casting.d.ts +4 -4
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +22 -22
- package/dist/general/utils/fixed.d.ts +5 -0
- package/dist/general/utils/fixed.d.ts.map +1 -1
- package/dist/general/utils/fixed.js +4 -0
- package/dist/general/utils/helpers.js +21 -21
- package/dist/general/wallet/wallet.js +6 -6
- package/dist/general/wallet/walletApi.js +12 -12
- package/dist/packages/capys/capy.d.ts +4 -4
- package/dist/packages/capys/capy.d.ts.map +1 -1
- package/dist/packages/capys/capy.js +15 -15
- package/dist/packages/coin/api/coinApi.d.ts +18 -5
- package/dist/packages/coin/api/coinApi.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.js +109 -15
- package/dist/packages/coin/coin.d.ts +4 -5
- package/dist/packages/coin/coin.d.ts.map +1 -1
- package/dist/packages/coin/coin.js +28 -28
- package/dist/packages/coin/coinTypes.d.ts +4 -0
- package/dist/packages/coin/coinTypes.d.ts.map +1 -1
- package/dist/packages/{referralVault/api/referralVaultApiHelpers.d.ts → external/baySwap/baySwapApi.d.ts} +49 -77
- package/dist/packages/external/baySwap/baySwapApi.d.ts.map +1 -0
- package/dist/packages/external/baySwap/baySwapApi.js +176 -0
- package/dist/packages/external/baySwap/baySwapTypes.d.ts +29 -0
- package/dist/packages/external/baySwap/baySwapTypes.d.ts.map +1 -0
- package/dist/packages/external/baySwap/baySwapTypes.js +15 -0
- package/dist/packages/external/{deepBook/deepBookApiHelper.d.ts → blueMove/blueMoveApi.d.ts} +42 -87
- package/dist/packages/external/blueMove/blueMoveApi.d.ts.map +1 -0
- package/dist/packages/external/blueMove/blueMoveApi.js +249 -0
- package/dist/packages/external/blueMove/blueMoveTypes.d.ts +87 -0
- package/dist/packages/external/blueMove/blueMoveTypes.d.ts.map +1 -0
- package/dist/packages/external/blueMove/blueMoveTypes.js +13 -0
- package/dist/packages/external/cetus/cetusApi.d.ts +240 -11
- package/dist/packages/external/cetus/cetusApi.d.ts.map +1 -1
- package/dist/packages/external/cetus/cetusApi.js +295 -28
- package/dist/packages/external/deepBook/deepBookApi.d.ts +406 -5
- package/dist/packages/external/deepBook/deepBookApi.d.ts.map +1 -1
- package/dist/packages/external/deepBook/deepBookApi.js +332 -35
- package/dist/packages/external/deepBook/deepBookTypes.d.ts +4 -6
- package/dist/packages/external/deepBook/deepBookTypes.d.ts.map +1 -1
- package/dist/packages/external/deepBook/deepBookTypes.js +2 -2
- package/dist/packages/{faucet/api/faucetApiHelpers.d.ts → external/interest/interestApi.d.ts} +45 -19
- package/dist/packages/external/interest/interestApi.d.ts.map +1 -0
- package/dist/packages/external/interest/interestApi.js +178 -0
- package/dist/packages/external/interest/interestTypes.d.ts +37 -0
- package/dist/packages/external/interest/interestTypes.d.ts.map +1 -0
- package/dist/packages/external/interest/interestTypes.js +12 -0
- package/dist/packages/external/kriya/kriyaApi.d.ts +148 -0
- package/dist/packages/external/kriya/kriyaApi.d.ts.map +1 -0
- package/dist/packages/external/kriya/kriyaApi.js +191 -0
- package/dist/packages/external/kriya/kriyaTypes.d.ts +59 -0
- package/dist/packages/external/kriya/kriyaTypes.d.ts.map +1 -0
- package/dist/packages/external/kriya/kriyaTypes.js +16 -0
- package/dist/packages/external/suiswap/suiswapApi.d.ts +145 -0
- package/dist/packages/external/suiswap/suiswapApi.d.ts.map +1 -0
- package/dist/packages/external/suiswap/suiswapApi.js +197 -0
- package/dist/packages/external/suiswap/suiswapTypes.d.ts +75 -0
- package/dist/packages/external/suiswap/suiswapTypes.d.ts.map +1 -0
- package/dist/packages/external/suiswap/suiswapTypes.js +10 -0
- package/dist/packages/external/turbos/turbosApi.d.ts +206 -8
- package/dist/packages/external/turbos/turbosApi.d.ts.map +1 -1
- package/dist/packages/external/turbos/turbosApi.js +471 -27
- package/dist/packages/farms/farmsStakedPosition.d.ts +20 -0
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -0
- package/dist/packages/farms/farmsStakedPosition.js +63 -0
- package/dist/packages/farms/farmsStakingPool.d.ts +9 -0
- package/dist/packages/farms/farmsStakingPool.d.ts.map +1 -0
- package/dist/packages/farms/farmsStakingPool.js +20 -0
- package/dist/packages/farms/farmsTypes.d.ts +37 -0
- package/dist/packages/farms/farmsTypes.d.ts.map +1 -0
- package/dist/packages/farms/index.d.ts +3 -0
- package/dist/packages/farms/index.d.ts.map +1 -0
- package/dist/packages/{capys → farms}/index.js +2 -3
- package/dist/packages/faucet/api/faucetApi.d.ts +117 -8
- package/dist/packages/faucet/api/faucetApi.d.ts.map +1 -1
- package/dist/packages/faucet/api/faucetApi.js +112 -27
- package/dist/packages/faucet/api/faucetApiCasting.js +3 -3
- package/dist/packages/faucet/faucet.js +15 -15
- package/dist/packages/index.d.ts +3 -1
- package/dist/packages/index.d.ts.map +1 -1
- package/dist/packages/index.js +3 -1
- package/dist/packages/nftAmm/api/nftAmmApi.d.ts +168 -16
- package/dist/packages/nftAmm/api/nftAmmApi.d.ts.map +1 -1
- package/dist/packages/nftAmm/api/nftAmmApi.js +227 -33
- package/dist/packages/nftAmm/api/nftAmmApiCasting.js +12 -12
- package/dist/packages/nftAmm/nftAmm.js +12 -12
- package/dist/packages/nftAmm/nftAmmMarket.js +15 -15
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts +650 -0
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +1 -0
- package/dist/packages/perpetuals/api/perpetualsApi.js +387 -0
- package/dist/packages/perpetuals/api/perpetualsCasting.d.ts +22 -0
- package/dist/packages/perpetuals/api/perpetualsCasting.d.ts.map +1 -0
- package/dist/packages/perpetuals/api/perpetualsCasting.js +201 -0
- package/dist/packages/perpetuals/index.d.ts +4 -0
- package/dist/packages/perpetuals/index.d.ts.map +1 -0
- package/dist/{external/nojo → packages/perpetuals}/index.js +3 -5
- package/dist/packages/perpetuals/perpetuals.d.ts +17 -0
- package/dist/packages/perpetuals/perpetuals.d.ts.map +1 -0
- package/dist/packages/perpetuals/perpetuals.js +50 -0
- package/dist/packages/perpetuals/perpetualsAccount.d.ts +22 -0
- package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +1 -0
- package/dist/packages/perpetuals/perpetualsAccount.js +65 -0
- package/dist/packages/perpetuals/perpetualsMarket.d.ts +20 -0
- package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +1 -0
- package/dist/packages/perpetuals/perpetualsMarket.js +52 -0
- package/dist/packages/perpetuals/perpetualsTypes.d.ts +184 -0
- package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/comparators.d.ts +4 -0
- package/dist/packages/perpetuals/utils/comparators.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/comparators.js +25 -0
- package/dist/packages/perpetuals/utils/critBitTreeUtils.d.ts +7 -0
- package/dist/packages/perpetuals/utils/critBitTreeUtils.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/critBitTreeUtils.js +40 -0
- package/dist/packages/perpetuals/utils/helpers.d.ts +5 -0
- package/dist/packages/perpetuals/utils/helpers.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/helpers.js +9 -0
- package/dist/packages/perpetuals/utils/index.d.ts +4 -0
- package/dist/packages/perpetuals/utils/index.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/index.js +19 -0
- package/dist/packages/pools/api/poolsApi.d.ts +261 -35
- package/dist/packages/pools/api/poolsApi.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApi.js +621 -130
- package/dist/packages/pools/api/poolsApiCasting.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApiCasting.js +10 -7
- package/dist/packages/pools/api/poolsApiCastingTypes.d.ts +4 -1
- package/dist/packages/pools/api/poolsApiCastingTypes.d.ts.map +1 -1
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +22 -19
- package/dist/packages/pools/pools.js +34 -34
- package/dist/packages/pools/poolsTypes.d.ts +9 -1
- package/dist/packages/pools/poolsTypes.d.ts.map +1 -1
- package/dist/packages/pools/utils/cmmmCalculations.d.ts.map +1 -1
- package/dist/packages/pools/utils/cmmmCalculations.js +81 -77
- package/dist/packages/referralVault/api/referralVaultApi.d.ts +166 -4
- package/dist/packages/referralVault/api/referralVaultApi.d.ts.map +1 -1
- package/dist/packages/referralVault/api/referralVaultApi.js +80 -14
- package/dist/packages/referralVault/referralVault.js +9 -9
- package/dist/packages/router/api/routerApi.d.ts +14 -5
- package/dist/packages/router/api/routerApi.d.ts.map +1 -1
- package/dist/packages/router/api/routerApi.js +40 -25
- package/dist/packages/router/api/routerApiCasting.d.ts +6 -0
- package/dist/packages/router/api/routerApiCasting.d.ts.map +1 -0
- package/dist/packages/router/api/routerApiCasting.js +22 -0
- package/dist/packages/router/api/routerApiCastingTypes.d.ts +11 -0
- package/dist/packages/router/api/routerApiCastingTypes.d.ts.map +1 -0
- package/dist/packages/router/api/routerApiHelpers.js +30 -30
- package/dist/packages/router/api/routerAsyncApiHelpers.js +18 -18
- package/dist/packages/router/api/routerSynchronousApiHelpers.d.ts +88 -3
- package/dist/packages/router/api/routerSynchronousApiHelpers.d.ts.map +1 -1
- package/dist/packages/router/api/routerSynchronousApiHelpers.js +125 -28
- package/dist/packages/router/router.d.ts +2 -1
- package/dist/packages/router/router.d.ts.map +1 -1
- package/dist/packages/router/router.js +23 -15
- package/dist/packages/router/routerTypes.d.ts +19 -5
- package/dist/packages/router/routerTypes.d.ts.map +1 -1
- package/dist/packages/router/routerTypes.js +5 -1
- package/dist/packages/router/utils/async/routerAsyncApiInterface.d.ts +1 -8
- package/dist/packages/router/utils/async/routerAsyncApiInterface.d.ts.map +1 -1
- package/dist/packages/router/utils/async/routerAsyncGraph.js +15 -15
- package/dist/packages/router/utils/synchronous/interfaces/routerPoolInterface.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/interfaces/routerPoolInterface.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/interfaces/routerPoolInterface.js +30 -14
- package/dist/packages/router/utils/synchronous/routerGraph.js +36 -36
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.js +18 -16
- package/dist/packages/router/utils/synchronous/routerPools/baySwapRouterPool.d.ts +102 -0
- package/dist/packages/router/utils/synchronous/routerPools/baySwapRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/baySwapRouterPool.js +217 -0
- package/dist/packages/router/utils/synchronous/routerPools/blueMoveRouterPool.d.ts +102 -0
- package/dist/packages/router/utils/synchronous/routerPools/blueMoveRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/blueMoveRouterPool.js +221 -0
- package/dist/packages/router/utils/synchronous/routerPools/cetusRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/cetusRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/cetusRouterPool.js +11 -11
- package/dist/packages/router/utils/synchronous/routerPools/deepBookRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/deepBookRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/deepBookRouterPool.js +16 -16
- package/dist/packages/router/utils/synchronous/routerPools/interestRouterPool.d.ts +96 -0
- package/dist/packages/router/utils/synchronous/routerPools/interestRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/interestRouterPool.js +174 -0
- package/dist/packages/router/utils/synchronous/routerPools/kriyaRouterPool.d.ts +102 -0
- package/dist/packages/router/utils/synchronous/routerPools/kriyaRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/kriyaRouterPool.js +216 -0
- package/dist/packages/router/utils/synchronous/routerPools/{nojoRouterPool.d.ts → suiswapRouterPool.d.ts} +35 -14
- package/dist/packages/router/utils/synchronous/routerPools/suiswapRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/suiswapRouterPool.js +217 -0
- package/dist/packages/router/utils/synchronous/routerPools/turbosRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/turbosRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/turbosRouterPool.js +11 -11
- package/dist/packages/staking/api/stakingApi.d.ts +173 -10
- package/dist/packages/staking/api/stakingApi.d.ts.map +1 -1
- package/dist/packages/staking/api/stakingApi.js +373 -32
- package/dist/packages/staking/api/stakingApiCasting.d.ts.map +1 -1
- package/dist/packages/staking/api/stakingApiCasting.js +6 -6
- package/dist/packages/staking/staking.js +18 -18
- package/dist/packages/sui/api/suiApi.d.ts +0 -2
- package/dist/packages/sui/api/suiApi.d.ts.map +1 -1
- package/dist/packages/sui/api/suiApi.js +9 -9
- package/dist/packages/sui/sui.js +9 -9
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts +80 -0
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts.map +1 -0
- package/dist/packages/suiFrens/api/suiFrensApi.js +564 -0
- package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts +13 -0
- package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts.map +1 -0
- package/dist/packages/suiFrens/api/suiFrensApiCasting.js +108 -0
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts +51 -0
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts.map +1 -0
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.js +2 -0
- package/dist/packages/suiFrens/index.d.ts +4 -0
- package/dist/packages/suiFrens/index.d.ts.map +1 -0
- package/dist/packages/suiFrens/index.js +19 -0
- package/dist/packages/suiFrens/stakedSuiFrenReceipt.d.ts +13 -0
- package/dist/packages/suiFrens/stakedSuiFrenReceipt.d.ts.map +1 -0
- package/dist/packages/{capys/stakedCapyReceipt.js → suiFrens/stakedSuiFrenReceipt.js} +21 -21
- package/dist/packages/suiFrens/suiFren.d.ts +10 -0
- package/dist/packages/suiFrens/suiFren.d.ts.map +1 -0
- package/dist/packages/suiFrens/suiFren.js +39 -0
- package/dist/packages/suiFrens/suiFrens.d.ts +32 -0
- package/dist/packages/suiFrens/suiFrens.d.ts.map +1 -0
- package/dist/packages/suiFrens/suiFrens.js +143 -0
- package/dist/packages/suiFrens/suiFrensTypes.d.ts +89 -0
- package/dist/packages/suiFrens/suiFrensTypes.d.ts.map +1 -0
- package/dist/packages/suiFrens/suiFrensTypes.js +2 -0
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -2
- package/package.json +12 -5
- package/dist/external/nojo/amm/index.d.ts +0 -2
- package/dist/external/nojo/amm/index.d.ts.map +0 -1
- package/dist/external/nojo/amm/index.js +0 -4
- package/dist/external/nojo/amm/init.d.ts +0 -3
- package/dist/external/nojo/amm/init.d.ts.map +0 -1
- package/dist/external/nojo/amm/init.js +0 -31
- package/dist/external/nojo/amm/pool/errors.d.ts +0 -41
- package/dist/external/nojo/amm/pool/errors.d.ts.map +0 -1
- package/dist/external/nojo/amm/pool/errors.js +0 -75
- package/dist/external/nojo/amm/pool/functions.d.ts +0 -356
- package/dist/external/nojo/amm/pool/functions.d.ts.map +0 -1
- package/dist/external/nojo/amm/pool/functions.js +0 -173
- package/dist/external/nojo/amm/pool/structs.d.ts +0 -94
- package/dist/external/nojo/amm/pool/structs.d.ts.map +0 -1
- package/dist/external/nojo/amm/pool/structs.js +0 -278
- package/dist/external/nojo/amm/util/functions.d.ts +0 -359
- package/dist/external/nojo/amm/util/functions.d.ts.map +0 -1
- package/dist/external/nojo/amm/util/functions.js +0 -198
- package/dist/external/nojo/framework/balance.d.ts +0 -19
- package/dist/external/nojo/framework/balance.d.ts.map +0 -1
- package/dist/external/nojo/framework/balance.js +0 -44
- package/dist/external/nojo/framework/bcs.d.ts +0 -3
- package/dist/external/nojo/framework/bcs.d.ts.map +0 -1
- package/dist/external/nojo/framework/bcs.js +0 -5
- package/dist/external/nojo/framework/coin.d.ts +0 -42
- package/dist/external/nojo/framework/coin.d.ts.map +0 -1
- package/dist/external/nojo/framework/coin.js +0 -144
- package/dist/external/nojo/framework/dynamic-field.d.ts +0 -25
- package/dist/external/nojo/framework/dynamic-field.d.ts.map +0 -1
- package/dist/external/nojo/framework/dynamic-field.js +0 -89
- package/dist/external/nojo/framework/init.d.ts +0 -3
- package/dist/external/nojo/framework/init.d.ts.map +0 -1
- package/dist/external/nojo/framework/init.js +0 -41
- package/dist/external/nojo/framework/loader.d.ts +0 -12
- package/dist/external/nojo/framework/loader.d.ts.map +0 -1
- package/dist/external/nojo/framework/loader.js +0 -103
- package/dist/external/nojo/framework/object.d.ts +0 -33
- package/dist/external/nojo/framework/object.d.ts.map +0 -1
- package/dist/external/nojo/framework/object.js +0 -89
- package/dist/external/nojo/framework/table.d.ts +0 -23
- package/dist/external/nojo/framework/table.d.ts.map +0 -1
- package/dist/external/nojo/framework/table.js +0 -83
- package/dist/external/nojo/framework/type-name.d.ts +0 -15
- package/dist/external/nojo/framework/type-name.d.ts.map +0 -1
- package/dist/external/nojo/framework/type-name.js +0 -34
- package/dist/external/nojo/framework/type.d.ts +0 -24
- package/dist/external/nojo/framework/type.d.ts.map +0 -1
- package/dist/external/nojo/framework/type.js +0 -120
- package/dist/external/nojo/framework/util.d.ts +0 -31
- package/dist/external/nojo/framework/util.d.ts.map +0 -1
- package/dist/external/nojo/framework/util.js +0 -49
- package/dist/external/nojo/index.d.ts +0 -6
- package/dist/external/nojo/index.d.ts.map +0 -1
- package/dist/external/nojo/init.d.ts +0 -2
- package/dist/external/nojo/init.d.ts.map +0 -1
- package/dist/external/nojo/init.js +0 -39
- package/dist/packages/capys/api/capysApi.d.ts +0 -37
- package/dist/packages/capys/api/capysApi.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApi.js +0 -200
- package/dist/packages/capys/api/capysApiCasting.d.ts +0 -13
- package/dist/packages/capys/api/capysApiCasting.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApiCasting.js +0 -108
- package/dist/packages/capys/api/capysApiCastingTypes.d.ts +0 -51
- package/dist/packages/capys/api/capysApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApiHelpers.d.ts +0 -48
- package/dist/packages/capys/api/capysApiHelpers.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApiHelpers.js +0 -386
- package/dist/packages/capys/capys.d.ts +0 -32
- package/dist/packages/capys/capys.d.ts.map +0 -1
- package/dist/packages/capys/capys.js +0 -151
- package/dist/packages/capys/capysTypes.d.ts +0 -89
- package/dist/packages/capys/capysTypes.d.ts.map +0 -1
- package/dist/packages/capys/index.d.ts +0 -4
- package/dist/packages/capys/index.d.ts.map +0 -1
- package/dist/packages/capys/stakedCapyReceipt.d.ts +0 -14
- package/dist/packages/capys/stakedCapyReceipt.d.ts.map +0 -1
- package/dist/packages/coin/api/coinApiHelpers.d.ts +0 -23
- package/dist/packages/coin/api/coinApiHelpers.d.ts.map +0 -1
- package/dist/packages/coin/api/coinApiHelpers.js +0 -203
- package/dist/packages/external/cetus/cetusApiHelpers.d.ts +0 -247
- package/dist/packages/external/cetus/cetusApiHelpers.d.ts.map +0 -1
- package/dist/packages/external/cetus/cetusApiHelpers.js +0 -303
- package/dist/packages/external/deepBook/deepBookApiHelper.d.ts.map +0 -1
- package/dist/packages/external/deepBook/deepBookApiHelper.js +0 -193
- package/dist/packages/external/nojo/nojoAmmApi.d.ts +0 -24
- package/dist/packages/external/nojo/nojoAmmApi.d.ts.map +0 -1
- package/dist/packages/external/nojo/nojoAmmApi.js +0 -86
- package/dist/packages/external/nojo/nojoAmmApiHelpers.d.ts +0 -14
- package/dist/packages/external/nojo/nojoAmmApiHelpers.d.ts.map +0 -1
- package/dist/packages/external/nojo/nojoAmmApiHelpers.js +0 -69
- package/dist/packages/external/nojo/nojoAmmTypes.d.ts +0 -9
- package/dist/packages/external/nojo/nojoAmmTypes.d.ts.map +0 -1
- package/dist/packages/external/nojo/nojoAmmTypes.js +0 -7
- package/dist/packages/external/turbos/turbosApiHelpers.d.ts +0 -205
- package/dist/packages/external/turbos/turbosApiHelpers.d.ts.map +0 -1
- package/dist/packages/external/turbos/turbosApiHelpers.js +0 -325
- package/dist/packages/faucet/api/faucetApiHelpers.d.ts.map +0 -1
- package/dist/packages/faucet/api/faucetApiHelpers.js +0 -90
- package/dist/packages/nftAmm/api/nftAmmApiHelpers.d.ts +0 -193
- package/dist/packages/nftAmm/api/nftAmmApiHelpers.d.ts.map +0 -1
- package/dist/packages/nftAmm/api/nftAmmApiHelpers.js +0 -238
- package/dist/packages/pools/api/poolsApiHelpers.d.ts +0 -204
- package/dist/packages/pools/api/poolsApiHelpers.d.ts.map +0 -1
- package/dist/packages/pools/api/poolsApiHelpers.js +0 -523
- package/dist/packages/referralVault/api/referralVaultApiHelpers.d.ts.map +0 -1
- package/dist/packages/referralVault/api/referralVaultApiHelpers.js +0 -86
- package/dist/packages/router/utils/synchronous/routerPools/nojoRouterPool.d.ts.map +0 -1
- package/dist/packages/router/utils/synchronous/routerPools/nojoRouterPool.js +0 -99
- package/dist/packages/staking/api/stakingApiHelpers.d.ts +0 -212
- package/dist/packages/staking/api/stakingApiHelpers.d.ts.map +0 -1
- package/dist/packages/staking/api/stakingApiHelpers.js +0 -400
- package/dist/packages/sui/api/suiApiCasting.d.ts +0 -3
- package/dist/packages/sui/api/suiApiCasting.d.ts.map +0 -1
- package/dist/packages/sui/api/suiApiCasting.js +0 -6
- package/dist/packages/sui/api/suiApiCastingTypes.d.ts +0 -2
- package/dist/packages/sui/api/suiApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/sui/api/suiApiHelpers.d.ts +0 -6
- package/dist/packages/sui/api/suiApiHelpers.d.ts.map +0 -1
- package/dist/packages/sui/api/suiApiHelpers.js +0 -13
- /package/dist/packages/{capys/api/capysApiCastingTypes.js → farms/farmsTypes.js} +0 -0
- /package/dist/packages/{capys/capysTypes.js → perpetuals/perpetualsTypes.js} +0 -0
- /package/dist/packages/{sui/api/suiApiCastingTypes.js → router/api/routerApiCastingTypes.js} +0 -0
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CapysApi = void 0;
|
|
13
|
-
const capysApiCasting_1 = require("./capysApiCasting");
|
|
14
|
-
const capysApiHelpers_1 = require("./capysApiHelpers");
|
|
15
|
-
const coin_1 = require("../../coin/coin");
|
|
16
|
-
const helpers_1 = require("../../../general/utils/helpers");
|
|
17
|
-
const capys_1 = require("../capys");
|
|
18
|
-
class CapysApi {
|
|
19
|
-
/////////////////////////////////////////////////////////////////////
|
|
20
|
-
//// Constructor
|
|
21
|
-
/////////////////////////////////////////////////////////////////////
|
|
22
|
-
constructor(Provider) {
|
|
23
|
-
this.Provider = Provider;
|
|
24
|
-
/////////////////////////////////////////////////////////////////////
|
|
25
|
-
//// Public Methods
|
|
26
|
-
/////////////////////////////////////////////////////////////////////
|
|
27
|
-
/////////////////////////////////////////////////////////////////////
|
|
28
|
-
//// Inspections
|
|
29
|
-
/////////////////////////////////////////////////////////////////////
|
|
30
|
-
this.fetchStakedCapyFeesEarned = (stakedCapyReceiptObjectId) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const [capyFeesEarnedIndividual, capyFeesEarnedGlobal] = yield Promise.all([
|
|
32
|
-
this.Helpers.fetchStakedCapyFeesEarnedIndividual(stakedCapyReceiptObjectId),
|
|
33
|
-
this.Helpers.fetchStakedCapyFeesEarnedGlobal(),
|
|
34
|
-
]);
|
|
35
|
-
return {
|
|
36
|
-
individualFees: capyFeesEarnedIndividual,
|
|
37
|
-
globalFees: capyFeesEarnedGlobal,
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
this.fetchIsCapyPackageOnChain = () => this.Provider.Objects().fetchDoesObjectExist(this.Helpers.addresses.packages.capy);
|
|
41
|
-
this.fetchCapysStakedInCapyVaultWithAttributes = (attributes, limit, cursor, limitStepSize = 256) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a;
|
|
43
|
-
const isComplete = (capys) => {
|
|
44
|
-
return (this.Helpers.filterCapysWithAttributes(capys, attributes)
|
|
45
|
-
.length >= limit);
|
|
46
|
-
};
|
|
47
|
-
const capysWithCursor = yield this.Provider.DynamicFields().fetchDynamicFieldsUntil(this.fetchCapysStakedInCapyVault, isComplete, cursor, limitStepSize);
|
|
48
|
-
const filteredCapys = this.Helpers.filterCapysWithAttributes(capysWithCursor.dynamicFieldObjects, attributes);
|
|
49
|
-
const resizedCapysWithCursor = {
|
|
50
|
-
nextCursor: ((_a = capysWithCursor.nextCursor) !== null && _a !== void 0 ? _a : limit < filteredCapys.length)
|
|
51
|
-
? filteredCapys[limit].objectId
|
|
52
|
-
: capysWithCursor.nextCursor,
|
|
53
|
-
dynamicFieldObjects: filteredCapys.slice(0, limit),
|
|
54
|
-
};
|
|
55
|
-
return resizedCapysWithCursor;
|
|
56
|
-
});
|
|
57
|
-
/////////////////////////////////////////////////////////////////////
|
|
58
|
-
//// Events
|
|
59
|
-
/////////////////////////////////////////////////////////////////////
|
|
60
|
-
this.fetchCapyBornEvents = (cursor, limit) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return yield this.Provider.Events().fetchCastEventsWithCursor({
|
|
62
|
-
MoveEventType: this.Helpers.eventTypes.capyBorn,
|
|
63
|
-
}, capysApiCasting_1.CapysApiCasting.capyBornEventFromOnChain, cursor, limit);
|
|
64
|
-
});
|
|
65
|
-
this.fetchBreedCapysEvents = (cursor, limit) => __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
return yield this.Provider.Events().fetchCastEventsWithCursor({
|
|
67
|
-
MoveEventType: this.Helpers.eventTypes.breedCapys,
|
|
68
|
-
}, capysApiCasting_1.CapysApiCasting.breedCapysEventFromOnChain, cursor, limit);
|
|
69
|
-
});
|
|
70
|
-
this.fetchStakeCapyEvents = (cursor, limit) => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
return yield this.Provider.Events().fetchCastEventsWithCursor({
|
|
72
|
-
MoveEventType: this.Helpers.eventTypes.stakeCapy,
|
|
73
|
-
}, capysApiCasting_1.CapysApiCasting.stakeCapyEventFromOnChain, cursor, limit);
|
|
74
|
-
});
|
|
75
|
-
this.fetchUnstakeCapyEvents = (cursor, limit) => __awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
return yield this.Provider.Events().fetchCastEventsWithCursor({
|
|
77
|
-
MoveEventType: this.Helpers.eventTypes.unstakeCapy,
|
|
78
|
-
}, capysApiCasting_1.CapysApiCasting.unstakeCapyEventFromOnChain, cursor, limit);
|
|
79
|
-
});
|
|
80
|
-
/////////////////////////////////////////////////////////////////////
|
|
81
|
-
//// Objects
|
|
82
|
-
/////////////////////////////////////////////////////////////////////
|
|
83
|
-
/////////////////////////////////////////////////////////////////////
|
|
84
|
-
//// Capy Objects
|
|
85
|
-
/////////////////////////////////////////////////////////////////////
|
|
86
|
-
this.fetchCapys = (capyIds) => __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
return this.Provider.Objects().fetchCastObjectBatch(capyIds, capysApiCasting_1.CapysApiCasting.capyObjectFromSuiObjectResponse);
|
|
88
|
-
});
|
|
89
|
-
this.fetchCapysOwnedByAddress = (walletAddress) => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
return yield this.Provider.Objects().fetchCastObjectsOwnedByAddressOfType(walletAddress, this.Helpers.objectTypes.capyObjectType, capysApiCasting_1.CapysApiCasting.capyObjectFromSuiObjectResponse);
|
|
91
|
-
});
|
|
92
|
-
this.fetchStakedCapys = (capyIds) => __awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
return this.Provider.Objects().fetchCastObjectBatch(capyIds, capysApiCasting_1.CapysApiCasting.capyObjectFromSuiObjectResponse);
|
|
94
|
-
});
|
|
95
|
-
this.fetchStakedCapysOwnedByAddress = (walletAddress) => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
// i. obtain all owned StakingReceipt
|
|
97
|
-
const capyIdsStakedByAddress = (yield this.fetchStakedCapyReceiptOwnedByAddress(walletAddress)).map((capyStakingReceipt) => capyStakingReceipt.capyId);
|
|
98
|
-
// ii. obtain a Capy object from each Capy ObjectId
|
|
99
|
-
const stakedCapys = yield this.fetchStakedCapys(capyIdsStakedByAddress);
|
|
100
|
-
return stakedCapys;
|
|
101
|
-
});
|
|
102
|
-
this.fetchCapyVault = (capyVaultId) => __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
return this.Provider.Objects().fetchCastObject(capyVaultId, capysApiCasting_1.CapysApiCasting.capyVaultObjectFromSuiObjectResponse);
|
|
104
|
-
});
|
|
105
|
-
this.fetchCapysStakedInCapyVault = (cursor, limit) => __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
const capyVaultId = this.Helpers.addresses.objects.capyVault;
|
|
107
|
-
const capyType = this.Helpers.objectTypes.capyObjectType;
|
|
108
|
-
return yield this.Provider.DynamicFields().fetchCastDynamicFieldsOfTypeWithCursor(capyVaultId, this.fetchCapys, capyType, cursor, limit);
|
|
109
|
-
});
|
|
110
|
-
/////////////////////////////////////////////////////////////////////
|
|
111
|
-
//// Staked Capy Receipt Objects
|
|
112
|
-
/////////////////////////////////////////////////////////////////////
|
|
113
|
-
this.fetchStakedCapyReceipt = (capyStakingReceipt) => __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
return this.Provider.Objects().fetchCastObject(capyStakingReceipt, capysApiCasting_1.CapysApiCasting.stakedCapyReceiptObjectFromSuiObjectResponse);
|
|
115
|
-
});
|
|
116
|
-
this.fetchStakedCapyReceipts = (capyStakingReceipts) => __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
return this.Provider.Objects().fetchCastObjectBatch(capyStakingReceipts, capysApiCasting_1.CapysApiCasting.stakedCapyReceiptObjectFromSuiObjectResponse);
|
|
118
|
-
});
|
|
119
|
-
this.fetchStakedCapyReceiptOwnedByAddress = (walletAddress) => __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
return yield this.Provider.Objects().fetchCastObjectsOwnedByAddressOfType(walletAddress, this.Helpers.objectTypes.stakedCapyReceiptObjectType, capysApiCasting_1.CapysApiCasting.stakedCapyReceiptObjectFromSuiObjectResponse);
|
|
121
|
-
});
|
|
122
|
-
this.fetchStakedCapyReceiptWithCapysOwnedByAddress = (walletAddress) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
-
// i. obtain all owned StakingReceipt
|
|
124
|
-
const stakingReceipts = yield this.fetchStakedCapyReceiptOwnedByAddress(walletAddress);
|
|
125
|
-
// ii. obtain all Capy Object Ids
|
|
126
|
-
const capyIdsStakedByAddress = stakingReceipts.map((capyStakingReceipt) => capyStakingReceipt.capyId);
|
|
127
|
-
// iii. obtain a Capy object from each Capy ObjectId
|
|
128
|
-
let indexStakedCapys = {};
|
|
129
|
-
(yield this.fetchStakedCapys(capyIdsStakedByAddress)).forEach((stakedCapy) => {
|
|
130
|
-
indexStakedCapys[stakedCapy.objectId] = stakedCapy;
|
|
131
|
-
});
|
|
132
|
-
// iv. construct a StakingReceiptWithCapy object from each StakingReceipt <> Capy pair
|
|
133
|
-
const capyStakingReceiptsWithCapy = stakingReceipts.map((stakingReceipt) => {
|
|
134
|
-
return {
|
|
135
|
-
objectId: stakingReceipt.objectId,
|
|
136
|
-
capy: indexStakedCapys[stakingReceipt.capyId],
|
|
137
|
-
unlockEpoch: stakingReceipt.unlockEpoch,
|
|
138
|
-
};
|
|
139
|
-
});
|
|
140
|
-
return capyStakingReceiptsWithCapy;
|
|
141
|
-
});
|
|
142
|
-
/////////////////////////////////////////////////////////////////////
|
|
143
|
-
//// Transactions
|
|
144
|
-
/////////////////////////////////////////////////////////////////////
|
|
145
|
-
/////////////////////////////////////////////////////////////////////
|
|
146
|
-
//// Capy Staking
|
|
147
|
-
/////////////////////////////////////////////////////////////////////
|
|
148
|
-
this.fetchStakeCapyTransaction = (capyId) => this.Provider.Transactions().fetchSetGasBudgetAndSerializeTransaction(this.Helpers.capyStakeCapyTransaction(capyId));
|
|
149
|
-
this.fetchUnstakeCapyTransaction = (stakingReceiptId) => this.Provider.Transactions().fetchSetGasBudgetAndSerializeTransaction(this.Helpers.capyUnstakeCapyTransaction(stakingReceiptId));
|
|
150
|
-
this.fetchWithdrawStakedCapyFeesTransaction = (stakingReceiptId) => this.Provider.Transactions().fetchSetGasBudgetAndSerializeTransaction(this.Helpers.capyWithdrawFeesTransaction(stakingReceiptId));
|
|
151
|
-
this.fetchWithdrawStakedCapyFeesAmountTransaction = (stakingReceiptId, amount) => this.Provider.Transactions().fetchSetGasBudgetAndSerializeTransaction(this.Helpers.capyWithdrawFeesAmountTransaction(stakingReceiptId, amount));
|
|
152
|
-
this.fetchCapyTransferTransaction = (stakingReceiptId, recipient) => this.Provider.Transactions().fetchSetGasBudgetAndSerializeTransaction(this.Helpers.capyTransferTransaction(stakingReceiptId, recipient));
|
|
153
|
-
/////////////////////////////////////////////////////////////////////
|
|
154
|
-
//// Capy Breeding
|
|
155
|
-
/////////////////////////////////////////////////////////////////////
|
|
156
|
-
this.fetchBreedCapysTransaction = (walletAddress, parentOneId, parentTwoId) => __awaiter(this, void 0, void 0, function* () {
|
|
157
|
-
const [parentOneIsOwned, parentTwoIsOwned] = yield Promise.all([
|
|
158
|
-
this.Provider.Objects().fetchIsObjectOwnedByAddress(parentOneId, walletAddress),
|
|
159
|
-
this.Provider.Objects().fetchIsObjectOwnedByAddress(parentTwoId, walletAddress),
|
|
160
|
-
]);
|
|
161
|
-
const transaction = yield this.Helpers.fetchCapyBuildBreedTransaction(walletAddress, parentOneId, parentOneIsOwned, parentTwoId, parentTwoIsOwned);
|
|
162
|
-
return this.Provider.Transactions().fetchSetGasBudgetAndSerializeTransaction(transaction);
|
|
163
|
-
});
|
|
164
|
-
/////////////////////////////////////////////////////////////////////
|
|
165
|
-
//// Stats
|
|
166
|
-
/////////////////////////////////////////////////////////////////////
|
|
167
|
-
// TODO: make this function not exported from sdk (only internal use)
|
|
168
|
-
// NOTE: this calculation will be incorrect if feeCoinType is different for each fee
|
|
169
|
-
this.calcCapyBreedingFees = (breedCapyEvents, feeCoinDecimals, feeCoinPrice) => {
|
|
170
|
-
const breedingFeesInFeeCoin = helpers_1.Helpers.sum(breedCapyEvents.map((event) => coin_1.Coin.balanceWithDecimals(event.feeCoinWithBalance.balance, feeCoinDecimals)));
|
|
171
|
-
const breedingFeesUsd = feeCoinPrice * breedingFeesInFeeCoin;
|
|
172
|
-
return {
|
|
173
|
-
amount: breedingFeesInFeeCoin,
|
|
174
|
-
amountUsd: breedingFeesUsd,
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
this.fetchCapyStats = () => __awaiter(this, void 0, void 0, function* () {
|
|
178
|
-
const breedCapyEventsWithinTime = yield this.Provider.Events().fetchEventsWithinTime(this.fetchBreedCapysEvents, "hour", 24);
|
|
179
|
-
const feeCoin = breedCapyEventsWithinTime.length === 0
|
|
180
|
-
? capys_1.Capys.constants.breedingFees.coinType
|
|
181
|
-
: breedCapyEventsWithinTime[0].feeCoinWithBalance.coin;
|
|
182
|
-
const feeCoinDecimals = (yield this.Provider.Coin().fetchCoinMetadata(feeCoin)).decimals;
|
|
183
|
-
const feeCoinPrice = yield this.Provider.Prices().fetchPrice(feeCoin);
|
|
184
|
-
const breedingFeesDaily = this.calcCapyBreedingFees(breedCapyEventsWithinTime, feeCoinDecimals, feeCoinPrice);
|
|
185
|
-
const capyVault = yield this.fetchCapyVault(this.Helpers.addresses.objects.capyVault);
|
|
186
|
-
const { bredCapys, stakedCapys, breedingFeesGlobal } = yield this.Helpers.fetchCapyVaultStats(capyVault, feeCoinDecimals, feeCoinPrice);
|
|
187
|
-
return {
|
|
188
|
-
bredCapys,
|
|
189
|
-
stakedCapys,
|
|
190
|
-
breedingFeeCoin: feeCoin,
|
|
191
|
-
breedingFeesGlobal,
|
|
192
|
-
breedingFeesDaily,
|
|
193
|
-
breedingVolumeDaily: breedCapyEventsWithinTime.length,
|
|
194
|
-
};
|
|
195
|
-
});
|
|
196
|
-
this.Provider = Provider;
|
|
197
|
-
this.Helpers = new capysApiHelpers_1.CapysApiHelpers(Provider);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
exports.CapysApi = CapysApi;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SuiObjectResponse } from "@mysten/sui.js";
|
|
2
|
-
import { BreedCapysEvent, CapyBornEvent, CapyObject, CapyVaultObject, StakeCapyEvent, StakedCapyReceiptObject, UnstakeCapyEvent } from "../capysTypes";
|
|
3
|
-
import { BreedCapyEventOnChain as BreedCapysEventOnChain, CapyBornEventOnChain, StakeCapyEventOnChain, UnstakeCapyEventOnChain } from "./capysApiCastingTypes";
|
|
4
|
-
export declare class CapysApiCasting {
|
|
5
|
-
static capyObjectFromSuiObjectResponse: (data: SuiObjectResponse) => CapyObject;
|
|
6
|
-
static stakedCapyReceiptObjectFromSuiObjectResponse: (data: SuiObjectResponse) => StakedCapyReceiptObject;
|
|
7
|
-
static capyVaultObjectFromSuiObjectResponse: (data: SuiObjectResponse) => CapyVaultObject;
|
|
8
|
-
static capyBornEventFromOnChain: (eventOnChain: CapyBornEventOnChain) => CapyBornEvent;
|
|
9
|
-
static breedCapysEventFromOnChain: (eventOnChain: BreedCapysEventOnChain) => BreedCapysEvent;
|
|
10
|
-
static stakeCapyEventFromOnChain: (eventOnChain: StakeCapyEventOnChain) => StakeCapyEvent;
|
|
11
|
-
static unstakeCapyEventFromOnChain: (eventOnChain: UnstakeCapyEventOnChain) => UnstakeCapyEvent;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=capysApiCasting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capysApiCasting.d.ts","sourceRoot":"","sources":["../../../../src/packages/capys/api/capysApiCasting.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,eAAe,EACf,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,qBAAqB,IAAI,sBAAsB,EAC/C,oBAAoB,EAGpB,qBAAqB,EAErB,uBAAuB,EACvB,MAAM,wBAAwB,CAAC;AAGhC,qBAAa,eAAe;IAK3B,OAAc,+BAA+B,SACtC,iBAAiB,KACrB,UAAU,CAgBX;IAEF,OAAc,4CAA4C,SACnD,iBAAiB,KACrB,uBAAuB,CASxB;IAgBF,OAAc,oCAAoC,SAC3C,iBAAiB,KACrB,eAAe,CAShB;IAMF,OAAc,wBAAwB,0CAEnC,aAAa,CAWd;IAEF,OAAc,0BAA0B,4CAErC,eAAe,CAehB;IAEF,OAAc,yBAAyB,2CAEpC,cAAc,CAWf;IAEF,OAAc,2BAA2B,6CAEtC,gBAAgB,CASjB;CACF"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CapysApiCasting = void 0;
|
|
4
|
-
const sui_js_1 = require("@mysten/sui.js");
|
|
5
|
-
const capys_1 = require("../capys");
|
|
6
|
-
class CapysApiCasting {
|
|
7
|
-
}
|
|
8
|
-
exports.CapysApiCasting = CapysApiCasting;
|
|
9
|
-
/////////////////////////////////////////////////////////////////////
|
|
10
|
-
//// Objects
|
|
11
|
-
/////////////////////////////////////////////////////////////////////
|
|
12
|
-
CapysApiCasting.capyObjectFromSuiObjectResponse = (data) => {
|
|
13
|
-
const capyObjectFields = (0, sui_js_1.getObjectFields)(data);
|
|
14
|
-
return {
|
|
15
|
-
objectId: (0, sui_js_1.getObjectId)(data),
|
|
16
|
-
fields: {
|
|
17
|
-
gen: capyObjectFields.gen,
|
|
18
|
-
url: capyObjectFields.url,
|
|
19
|
-
link: capyObjectFields.link,
|
|
20
|
-
genes: capyObjectFields.genes.fields,
|
|
21
|
-
devGenes: capyObjectFields.dev_genes.fields,
|
|
22
|
-
itemCount: capyObjectFields.item_count,
|
|
23
|
-
attributes: capyObjectFields.attributes.map((attr) => attr.fields),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
CapysApiCasting.stakedCapyReceiptObjectFromSuiObjectResponse = (data) => {
|
|
28
|
-
const objectFields = (0, sui_js_1.getObjectFields)(data);
|
|
29
|
-
return {
|
|
30
|
-
objectId: (0, sui_js_1.getObjectId)(data),
|
|
31
|
-
capyId: objectFields.capy_id,
|
|
32
|
-
unlockEpoch: objectFields.unlock_epoch.fields,
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
// public static stakedCapyReceiptWithCapyObjectFromSuiObjectResponse = async (
|
|
36
|
-
// data: SuiObjectResponse
|
|
37
|
-
// ): Promise<StakedCapyReceiptWithCapyObject> => {
|
|
38
|
-
// const objectFields = getObjectFields(data) as StakedCapyReceiptFieldsOnChain;
|
|
39
|
-
// return {
|
|
40
|
-
// objectId: getObjectId(data),
|
|
41
|
-
// capy: this.capyObjectFromSuiObjectResponse(
|
|
42
|
-
// await provider.getObject(objectFields.capy_id)
|
|
43
|
-
// ),
|
|
44
|
-
// unlockEpoch: objectFields.unlock_epoch.fields,
|
|
45
|
-
// };
|
|
46
|
-
// };
|
|
47
|
-
CapysApiCasting.capyVaultObjectFromSuiObjectResponse = (data) => {
|
|
48
|
-
const objectFields = (0, sui_js_1.getObjectFields)(data);
|
|
49
|
-
return {
|
|
50
|
-
objectId: (0, sui_js_1.getObjectId)(data),
|
|
51
|
-
bredCapys: BigInt(objectFields.bred_capys),
|
|
52
|
-
stakedCapys: BigInt(objectFields.staked_capys),
|
|
53
|
-
globalFees: BigInt(objectFields.global_fees),
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
/////////////////////////////////////////////////////////////////////
|
|
57
|
-
//// Events
|
|
58
|
-
/////////////////////////////////////////////////////////////////////
|
|
59
|
-
CapysApiCasting.capyBornEventFromOnChain = (eventOnChain) => {
|
|
60
|
-
const fields = eventOnChain.parsedJson;
|
|
61
|
-
return {
|
|
62
|
-
breeder: fields.bred_by,
|
|
63
|
-
capyParentOneId: fields.parent_one,
|
|
64
|
-
capyParentTwoId: fields.parent_two,
|
|
65
|
-
capyChildId: fields.id,
|
|
66
|
-
timestamp: eventOnChain.timestampMs,
|
|
67
|
-
txnDigest: eventOnChain.id.txDigest,
|
|
68
|
-
type: eventOnChain.type,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
CapysApiCasting.breedCapysEventFromOnChain = (eventOnChain) => {
|
|
72
|
-
const fields = eventOnChain.parsedJson;
|
|
73
|
-
return {
|
|
74
|
-
breeder: eventOnChain.sender,
|
|
75
|
-
capyParentOneId: fields.parentOneId,
|
|
76
|
-
capyParentTwoId: fields.parentTwoId,
|
|
77
|
-
capyChildId: fields.id,
|
|
78
|
-
feeCoinWithBalance: {
|
|
79
|
-
coin: capys_1.Capys.constants.breedingFees.coinType,
|
|
80
|
-
balance: BigInt(fields.fee),
|
|
81
|
-
},
|
|
82
|
-
timestamp: eventOnChain.timestampMs,
|
|
83
|
-
txnDigest: eventOnChain.id.txDigest,
|
|
84
|
-
type: eventOnChain.type,
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
CapysApiCasting.stakeCapyEventFromOnChain = (eventOnChain) => {
|
|
88
|
-
const fields = eventOnChain.parsedJson;
|
|
89
|
-
return {
|
|
90
|
-
staker: fields.issuer,
|
|
91
|
-
capyId: fields.capy_id,
|
|
92
|
-
// TODO: generalize casting of event types with passing of
|
|
93
|
-
// timestamp and txnDigest (create wrapper)
|
|
94
|
-
timestamp: eventOnChain.timestampMs,
|
|
95
|
-
txnDigest: eventOnChain.id.txDigest,
|
|
96
|
-
type: eventOnChain.type,
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
CapysApiCasting.unstakeCapyEventFromOnChain = (eventOnChain) => {
|
|
100
|
-
const fields = eventOnChain.parsedJson;
|
|
101
|
-
return {
|
|
102
|
-
unstaker: fields.issuer,
|
|
103
|
-
capyId: fields.capy_id,
|
|
104
|
-
timestamp: eventOnChain.timestampMs,
|
|
105
|
-
txnDigest: eventOnChain.id.txDigest,
|
|
106
|
-
type: eventOnChain.type,
|
|
107
|
-
};
|
|
108
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ObjectId, SuiAddress } from "@mysten/sui.js";
|
|
2
|
-
import { AnyObjectType, BigIntAsString, CapyAttribute, CapyGenes, EpochTimeLock, Url } from "../../../types";
|
|
3
|
-
import { EventOnChain } from "../../../general/types/castingTypes";
|
|
4
|
-
export interface StakedCapyReceiptFieldsOnChain {
|
|
5
|
-
capy_id: ObjectId;
|
|
6
|
-
unlock_epoch: {
|
|
7
|
-
fields: EpochTimeLock;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export interface CapyVaultFieldsOnChain {
|
|
11
|
-
bred_capys: BigIntAsString;
|
|
12
|
-
staked_capys: BigIntAsString;
|
|
13
|
-
global_fees: BigIntAsString;
|
|
14
|
-
}
|
|
15
|
-
export interface CapyFieldsOnChain {
|
|
16
|
-
genes: {
|
|
17
|
-
fields: CapyGenes;
|
|
18
|
-
};
|
|
19
|
-
dev_genes: {
|
|
20
|
-
fields: CapyGenes;
|
|
21
|
-
};
|
|
22
|
-
attributes: {
|
|
23
|
-
type: AnyObjectType;
|
|
24
|
-
fields: CapyAttribute;
|
|
25
|
-
}[];
|
|
26
|
-
item_count: number;
|
|
27
|
-
url: Url;
|
|
28
|
-
link: Url;
|
|
29
|
-
gen: number;
|
|
30
|
-
}
|
|
31
|
-
export type CapyBornEventOnChain = EventOnChain<{
|
|
32
|
-
bred_by: SuiAddress;
|
|
33
|
-
id: ObjectId;
|
|
34
|
-
parent_one: ObjectId;
|
|
35
|
-
parent_two: ObjectId;
|
|
36
|
-
}>;
|
|
37
|
-
export type BreedCapyEventOnChain = EventOnChain<{
|
|
38
|
-
id: ObjectId;
|
|
39
|
-
parentOneId: ObjectId;
|
|
40
|
-
parentTwoId: ObjectId;
|
|
41
|
-
fee: BigIntAsString;
|
|
42
|
-
}>;
|
|
43
|
-
export type StakeCapyEventOnChain = EventOnChain<{
|
|
44
|
-
issuer: SuiAddress;
|
|
45
|
-
capy_id: ObjectId;
|
|
46
|
-
}>;
|
|
47
|
-
export type UnstakeCapyEventOnChain = EventOnChain<{
|
|
48
|
-
issuer: SuiAddress;
|
|
49
|
-
capy_id: ObjectId;
|
|
50
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=capysApiCastingTypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capysApiCastingTypes.d.ts","sourceRoot":"","sources":["../../../../src/packages/capys/api/capysApiCastingTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACN,aAAa,EACb,cAAc,EACd,aAAa,EACb,SAAS,EACT,aAAa,EACb,GAAG,EACH,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAMnE,MAAM,WAAW,8BAA8B;IAC9C,OAAO,EAAE,QAAQ,CAAC;IAClB,YAAY,EAAE;QACb,MAAM,EAAE,aAAa,CAAC;KACtB,CAAC;CACF;AAED,MAAM,WAAW,sBAAsB;IACtC,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,cAAc,CAAC;IAC7B,WAAW,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE;QACN,MAAM,EAAE,SAAS,CAAC;KAClB,CAAC;IACF,SAAS,EAAE;QACV,MAAM,EAAE,SAAS,CAAC;KAClB,CAAC;IACF,UAAU,EAAE;QACX,IAAI,EAAE,aAAa,CAAC;QACpB,MAAM,EAAE,aAAa,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,GAAG,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;CACZ;AAMD,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC;IAC/C,OAAO,EAAE,UAAU,CAAC;IACpB,EAAE,EAAE,QAAQ,CAAC;IACb,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC;IAChD,EAAE,EAAE,QAAQ,CAAC;IACb,WAAW,EAAE,QAAQ,CAAC;IACtB,WAAW,EAAE,QAAQ,CAAC;IACtB,GAAG,EAAE,cAAc,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC;IAChD,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,QAAQ,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC;IAClD,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,QAAQ,CAAC;CAClB,CAAC,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ObjectId, SuiAddress, SuiObjectInfo, TransactionArgument, TransactionBlock } from "@mysten/sui.js";
|
|
2
|
-
import { AftermathApi } from "../../../general/providers/aftermathApi";
|
|
3
|
-
import { AmountInCoinAndUsd, AnyObjectType, Balance, CapyAttribute, CapyObject, CapyVaultObject, CapysAddresses, CoinDecimal } from "../../../types";
|
|
4
|
-
export declare class CapysApiHelpers {
|
|
5
|
-
private readonly Provider;
|
|
6
|
-
private static readonly constants;
|
|
7
|
-
readonly addresses: CapysAddresses;
|
|
8
|
-
readonly objectTypes: {
|
|
9
|
-
capyObjectType: AnyObjectType;
|
|
10
|
-
stakedCapyReceiptObjectType: AnyObjectType;
|
|
11
|
-
};
|
|
12
|
-
readonly eventTypes: {
|
|
13
|
-
capyBorn: AnyObjectType;
|
|
14
|
-
breedCapys: AnyObjectType;
|
|
15
|
-
stakeCapy: AnyObjectType;
|
|
16
|
-
unstakeCapy: AnyObjectType;
|
|
17
|
-
};
|
|
18
|
-
constructor(Provider: AftermathApi);
|
|
19
|
-
capyFeesEarnedIndividualDevInspectTransaction: (stakingReceiptId: ObjectId) => TransactionBlock;
|
|
20
|
-
capyFeesEarnedGlobalDevInspectTransaction: () => TransactionBlock;
|
|
21
|
-
addStakeBreedAndKeepCommandToTransaction: (tx: TransactionBlock, coinId: ObjectId | TransactionArgument, parentOneId: ObjectId, parentTwoId: ObjectId) => TransactionBlock;
|
|
22
|
-
addStakeBreedWithStakedAndKeepCommandToTransaction: (tx: TransactionBlock, coinId: ObjectId | TransactionArgument, parentOneId: ObjectId, parentTwoId: ObjectId) => TransactionBlock;
|
|
23
|
-
addStakeBreedStakedWithStakedAndKeepCommandToTransaction: (tx: TransactionBlock, coinId: ObjectId, parentOneId: ObjectId, parentTwoId: ObjectId) => TransactionBlock;
|
|
24
|
-
capyStakeCapyTransaction: (capyId: ObjectId) => TransactionBlock;
|
|
25
|
-
capyUnstakeCapyTransaction: (stakingReceiptId: ObjectId) => TransactionBlock;
|
|
26
|
-
capyTransferTransaction: (stakingReceiptId: ObjectId, recipient: SuiAddress) => TransactionBlock;
|
|
27
|
-
capyWithdrawFeesTransaction: (stakingReceiptId: ObjectId) => TransactionBlock;
|
|
28
|
-
capyWithdrawFeesAmountTransaction: (stakingReceiptId: ObjectId, amount: Balance) => TransactionBlock;
|
|
29
|
-
fetchCapyBuildBreedTransaction: (walletAddress: SuiAddress, parentOneId: ObjectId, parentOneIsOwned: boolean, parentTwoId: ObjectId, parentTwoIsOwned: boolean) => Promise<TransactionBlock>;
|
|
30
|
-
fetchBuildBreedWithStakedAndKeepTransaction: (walletAddress: SuiAddress, parentOneId: ObjectId, parentTwoId: ObjectId) => Promise<TransactionBlock>;
|
|
31
|
-
fetchBuildBreedStakedWithStakedAndKeepTransaction: (walletAddress: SuiAddress, parentOneId: ObjectId, parentTwoId: ObjectId) => Promise<TransactionBlock>;
|
|
32
|
-
fetchBuildBreedAndKeepTransaction: (walletAddress: SuiAddress, parentOneId: ObjectId, parentTwoId: ObjectId) => Promise<TransactionBlock>;
|
|
33
|
-
fetchStakedCapyFeesEarnedIndividual: (stakingReceiptId: ObjectId) => Promise<bigint>;
|
|
34
|
-
fetchStakedCapyFeesEarnedGlobal: () => Promise<bigint>;
|
|
35
|
-
fetchCapyVaultStats: (capyVault: CapyVaultObject, feeCoinDecimals: CoinDecimal, feeCoinPrice: number) => Promise<{
|
|
36
|
-
bredCapys: bigint;
|
|
37
|
-
stakedCapys: bigint;
|
|
38
|
-
breedingFeesGlobal: AmountInCoinAndUsd;
|
|
39
|
-
}>;
|
|
40
|
-
filterCapysWithAttributes: (capys: CapyObject[], attributes: CapyAttribute[]) => CapyObject[];
|
|
41
|
-
isStakedCapyReceiptObjectType: (suiObjectInfo: SuiObjectInfo) => boolean;
|
|
42
|
-
isCapyObjectType: (suiObjectInfo: SuiObjectInfo) => boolean;
|
|
43
|
-
private capyBornEventType;
|
|
44
|
-
private breedCapysEventType;
|
|
45
|
-
private stakeCapyEventType;
|
|
46
|
-
private unstakeCapyEventType;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=capysApiHelpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capysApiHelpers.d.ts","sourceRoot":"","sources":["../../../../src/packages/capys/api/capysApiHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,OAAO,EACP,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,MAAM,gBAAgB,CAAC;AAMxB,qBAAa,eAAe;IAwFf,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAnFrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CA6D/B;IAMF,SAAgB,SAAS,EAAE,cAAc,CAAC;IAC1C,SAAgB,WAAW,EAAE;QAC5B,cAAc,EAAE,aAAa,CAAC;QAC9B,2BAA2B,EAAE,aAAa,CAAC;KAC3C,CAAC;IACF,SAAgB,UAAU,EAAE;QAC3B,QAAQ,EAAE,aAAa,CAAC;QACxB,UAAU,EAAE,aAAa,CAAC;QAC1B,SAAS,EAAE,aAAa,CAAC;QACzB,WAAW,EAAE,aAAa,CAAC;KAC3B,CAAC;gBAM2B,QAAQ,EAAE,YAAY;IA2B5C,6CAA6C,qBACjC,QAAQ,KACxB,gBAAgB,CAoBjB;IAEK,yCAAyC,QAAO,gBAAgB,CAgBrE;IAUK,wCAAwC,OAC1C,gBAAgB,UACZ,QAAQ,GAAG,mBAAmB,eACzB,QAAQ,eACR,QAAQ,KACnB,gBAAgB,CAqBjB;IAEK,kDAAkD,OACpD,gBAAgB,UACZ,QAAQ,GAAG,mBAAmB,eACzB,QAAQ,eACR,QAAQ,KACnB,gBAAgB,CAqBjB;IAEK,wDAAwD,OAC1D,gBAAgB,UACZ,QAAQ,eACH,QAAQ,eACR,QAAQ,KACnB,gBAAgB,CAqBjB;IAMK,wBAAwB,WAAY,QAAQ,KAAG,gBAAgB,CAmBpE;IAEK,0BAA0B,qBACd,QAAQ,KACxB,gBAAgB,CAqBjB;IAEK,uBAAuB,qBACX,QAAQ,aACf,UAAU,KACnB,gBAAgB,CAoBjB;IAMK,2BAA2B,qBACf,QAAQ,KACxB,gBAAgB,CAmBjB;IAEK,iCAAiC,qBACrB,QAAQ,UAClB,OAAO,KACb,gBAAgB,CAoBjB;IAUK,8BAA8B,kBACrB,UAAU,eACZ,QAAQ,oBACH,OAAO,eACZ,QAAQ,oBACH,OAAO,KACvB,QAAQ,gBAAgB,CAAC,CA8B1B;IAEK,2CAA2C,kBAClC,UAAU,eACZ,QAAQ,eACR,QAAQ,KACnB,QAAQ,gBAAgB,CAAC,CAwB1B;IAEK,iDAAiD,kBACxC,UAAU,eACZ,QAAQ,eACR,QAAQ,KACnB,QAAQ,gBAAgB,CAAC,CAwB1B;IAEK,iCAAiC,kBACxB,UAAU,eACZ,QAAQ,eACR,QAAQ,KACnB,QAAQ,gBAAgB,CAAC,CAuB1B;IAUK,mCAAmC,qBACvB,QAAQ,qBASzB;IAEK,+BAA+B,wBAKpC;IAMK,mBAAmB,cACd,eAAe,mBACT,WAAW,gBACd,MAAM;;;;OAiBnB;IAMK,yBAAyB,UACxB,UAAU,EAAE,cACP,aAAa,EAAE,kBAUzB;IAMI,6BAA6B,kBACpB,aAAa,KAC1B,OAAO,CAC2D;IAE9D,gBAAgB,kBAAmB,aAAa,KAAG,OAAO,CACT;IAUxD,OAAO,CAAC,iBAAiB,CAKtB;IAEH,OAAO,CAAC,mBAAmB,CAKxB;IAEH,OAAO,CAAC,kBAAkB,CAKvB;IAEH,OAAO,CAAC,oBAAoB,CAKzB;CACH"}
|