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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coin.d.ts","sourceRoot":"","sources":["../../../../src/external/nojo/framework/coin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAiB,MAAM,QAAQ,CAAA;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAStC,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAEjD;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,QAAQ,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,SAAS,4BAA2B;IACpD,MAAM,CAAC,QAAQ,CAAC,cAAc,KAAI;IAElC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;IAEvB,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;gBAEhB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB;IAMpD,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,WAAW;IAO1E,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,WAAW;IAa9D,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW;IAI1F,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW;WAUhD,KAAK,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;CAclF;AASD,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,WAEhC;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,QAAQ,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,qBAAa,IAAI;IACf,MAAM,CAAC,QAAQ,CAAC,SAAS,qBAAoB;IAC7C,MAAM,CAAC,QAAQ,CAAC,cAAc,KAAI;IAElC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;IAEvB,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;gBAEb,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU;IAM7C,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAOnE,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAYvD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI;IAInF,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,aAAa;WAUlC,KAAK,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB3E"}
|
|
@@ -1,144 +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.Coin = exports.isCoin = exports.TreasuryCap = exports.isTreasuryCap = void 0;
|
|
13
|
-
const balance_1 = require("./balance");
|
|
14
|
-
const type_1 = require("./type");
|
|
15
|
-
const bcs_1 = require("./bcs");
|
|
16
|
-
const object_1 = require("./object");
|
|
17
|
-
/* ================================= TreasuryCap ================================= */
|
|
18
|
-
bcs_1.bcs.registerStructType(['0x2::coin::TreasuryCap', 'T'], {
|
|
19
|
-
id: '0x2::object::UID',
|
|
20
|
-
totalSupply: '0x2::balance::Supply<T>',
|
|
21
|
-
});
|
|
22
|
-
function isTreasuryCap(type) {
|
|
23
|
-
return type === '0x2::coin::TreasuryCap';
|
|
24
|
-
}
|
|
25
|
-
exports.isTreasuryCap = isTreasuryCap;
|
|
26
|
-
class TreasuryCap {
|
|
27
|
-
constructor(typeArg, fields) {
|
|
28
|
-
this.$typeArg = typeArg;
|
|
29
|
-
this.id = fields.id;
|
|
30
|
-
this.totalSupply = fields.totalSupply;
|
|
31
|
-
}
|
|
32
|
-
static fromFields(typeArg, fields) {
|
|
33
|
-
return new TreasuryCap(typeArg, {
|
|
34
|
-
id: object_1.UID.fromFields(fields.id).id.bytes,
|
|
35
|
-
totalSupply: balance_1.Supply.fromFields(typeArg, fields.total_supply),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
static fromFieldsWithTypes(item) {
|
|
39
|
-
if (!isTreasuryCap(item.type)) {
|
|
40
|
-
throw new Error(`not a TreasuryCap type`);
|
|
41
|
-
}
|
|
42
|
-
const { typeArgs } = (0, type_1.parseTypeName)(item.type);
|
|
43
|
-
return new TreasuryCap(typeArgs[0], {
|
|
44
|
-
id: item.fields.id.id,
|
|
45
|
-
totalSupply: balance_1.Supply.fromFieldsWithTypes(item.fields.total_supply),
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
static fromBcs(typeArg, data, encoding) {
|
|
49
|
-
return TreasuryCap.fromFields(typeArg, bcs_1.bcs.de('0x2::coin::TreasuryCap', data, encoding));
|
|
50
|
-
}
|
|
51
|
-
static fromSuiParsedData(content) {
|
|
52
|
-
if (content.dataType !== 'moveObject') {
|
|
53
|
-
throw new Error(`not an object`);
|
|
54
|
-
}
|
|
55
|
-
if (!isTreasuryCap(content.type)) {
|
|
56
|
-
throw new Error(`object at "${content.fields.id}" is not a TreasuryCap`);
|
|
57
|
-
}
|
|
58
|
-
return TreasuryCap.fromFieldsWithTypes(content);
|
|
59
|
-
}
|
|
60
|
-
static fetch(provider, id) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
const res = yield provider.getObject({
|
|
63
|
-
id,
|
|
64
|
-
options: {
|
|
65
|
-
showBcs: true,
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
if (res.error) {
|
|
69
|
-
throw new Error(`error fetching TreasuryCap object at id ${id}: ${res.error}`);
|
|
70
|
-
}
|
|
71
|
-
const { typeArgs } = (0, type_1.parseTypeName)(res.data.type);
|
|
72
|
-
return TreasuryCap.fromBcs(typeArgs[0], res.data.bcs.bcsBytes, 'base64');
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.TreasuryCap = TreasuryCap;
|
|
77
|
-
TreasuryCap.$typeName = '0x2::coin::TreasuryCap';
|
|
78
|
-
TreasuryCap.$numTypeParams = 1;
|
|
79
|
-
/* ==================================== Coin ===================================== */
|
|
80
|
-
bcs_1.bcs.registerStructType(['0x2::coin::Coin', 'T'], {
|
|
81
|
-
id: '0x2::object::UID',
|
|
82
|
-
balance: '0x2::balance::Balance<T>',
|
|
83
|
-
});
|
|
84
|
-
function isCoin(type) {
|
|
85
|
-
return type.startsWith('0x2::coin::Coin<');
|
|
86
|
-
}
|
|
87
|
-
exports.isCoin = isCoin;
|
|
88
|
-
class Coin {
|
|
89
|
-
constructor(typeArg, fields) {
|
|
90
|
-
this.$typeArg = typeArg;
|
|
91
|
-
this.id = fields.id;
|
|
92
|
-
this.balance = fields.balance;
|
|
93
|
-
}
|
|
94
|
-
static fromFields(typeArg, fields) {
|
|
95
|
-
return new Coin(typeArg, {
|
|
96
|
-
id: object_1.UID.fromFields(fields.id).id.bytes,
|
|
97
|
-
balance: balance_1.Balance.fromFields(typeArg, fields.balance),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
static fromFieldsWithTypes(item) {
|
|
101
|
-
if (!isCoin(item.type)) {
|
|
102
|
-
throw new Error(`not a Coin type`);
|
|
103
|
-
}
|
|
104
|
-
const { typeArgs } = (0, type_1.parseTypeName)(item.type);
|
|
105
|
-
return new Coin(typeArgs[0], {
|
|
106
|
-
id: item.fields.id,
|
|
107
|
-
balance: balance_1.Balance.fromFieldsWithTypes(typeArgs[0], item.fields.balance),
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
static fromBcs(typeArg, data, encoding) {
|
|
111
|
-
return Coin.fromFields(typeArg, bcs_1.bcs.de(['0x2::coin::Coin', typeArg], data, encoding));
|
|
112
|
-
}
|
|
113
|
-
static fromSuiParsedData(content) {
|
|
114
|
-
if (content.dataType !== 'moveObject') {
|
|
115
|
-
throw new Error(`not an object`);
|
|
116
|
-
}
|
|
117
|
-
if (!isCoin(content.type)) {
|
|
118
|
-
throw new Error(`object at "${content.fields.id}" is not a Coin`);
|
|
119
|
-
}
|
|
120
|
-
return Coin.fromFieldsWithTypes(content);
|
|
121
|
-
}
|
|
122
|
-
static fetch(provider, id) {
|
|
123
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
const res = yield provider.getObject({
|
|
125
|
-
id,
|
|
126
|
-
options: {
|
|
127
|
-
showBcs: true,
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
if (res.error) {
|
|
131
|
-
throw new Error(`error fetching Coin object at id "${id}": ${res.error.tag}`);
|
|
132
|
-
}
|
|
133
|
-
if (res.data.bcs.dataType !== 'moveObject' ||
|
|
134
|
-
!isCoin(res.data.bcs && 'type' in res.data.bcs ? res.data.bcs.type : '')) {
|
|
135
|
-
throw new Error(`object at id "${id}" is not a Coin`);
|
|
136
|
-
}
|
|
137
|
-
const { typeArgs } = (0, type_1.parseTypeName)(res.data.bcs && 'type' in res.data.bcs ? res.data.bcs.type : '');
|
|
138
|
-
return Coin.fromBcs(typeArgs[0], res.data.bcs.bcsBytes, 'base64');
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
exports.Coin = Coin;
|
|
143
|
-
Coin.$typeName = '0x2::coin::Coin';
|
|
144
|
-
Coin.$numTypeParams = 1;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { JsonRpcProvider, ObjectId, SuiParsedData } from '@mysten/sui.js';
|
|
2
|
-
import { Type } from './type';
|
|
3
|
-
import { Encoding } from '@mysten/bcs';
|
|
4
|
-
import { FieldsWithTypes } from './util';
|
|
5
|
-
export declare function isField(type: Type): boolean;
|
|
6
|
-
export interface FieldFields<Name, Value> {
|
|
7
|
-
id: ObjectId;
|
|
8
|
-
name: Name;
|
|
9
|
-
value: Value;
|
|
10
|
-
}
|
|
11
|
-
export declare class Field<Name, Value> {
|
|
12
|
-
static readonly $typeName = "0x2::dynamic_field::Field";
|
|
13
|
-
static readonly $numTypeParams = 2;
|
|
14
|
-
readonly $typeArgs: [Type, Type];
|
|
15
|
-
readonly id: ObjectId;
|
|
16
|
-
readonly name: Name;
|
|
17
|
-
readonly value: Value;
|
|
18
|
-
constructor(typeArgs: [Type, Type], fields: FieldFields<Name, Value>);
|
|
19
|
-
static fromFields<Name, Value>(typeArgs: [Type, Type], fields: Record<string, any>): Field<Name, Value>;
|
|
20
|
-
static fromFieldsWithTypes<Name, Value>(item: FieldsWithTypes): Field<Name, Value>;
|
|
21
|
-
static fromBcs<Name, Value>(typeArgs: [Type, Type], data: Uint8Array | string, encoding?: Encoding): Field<Name, Value>;
|
|
22
|
-
static fromSuiParsedData<Name, Value>(content: SuiParsedData): Field<unknown, unknown>;
|
|
23
|
-
static fetch<Name, Value>(provider: JsonRpcProvider, id: ObjectId): Promise<Field<Name, Value>>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=dynamic-field.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-field.d.ts","sourceRoot":"","sources":["../../../../src/external/nojo/framework/dynamic-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,IAAI,EAAiB,MAAM,QAAQ,CAAA;AAI5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AASxC,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,WAEjC;AAED,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,KAAK;IACtC,EAAE,EAAE,QAAQ,CAAA;IACZ,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,KAAK,CAAA;CACb;AAED,qBAAa,KAAK,CAAC,IAAI,EAAE,KAAK;IAC5B,MAAM,CAAC,QAAQ,CAAC,SAAS,+BAA8B;IACvD,MAAM,CAAC,QAAQ,CAAC,cAAc,KAAI;IAElC,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAEhC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;gBAET,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC;IAOpE,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1B,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;IAUrB,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;IAelF,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EACtB,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,QAAQ,CAAC,EAAE,QAAQ,GAClB,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;IAOrB,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa;WAU/C,KAAK,CAAC,IAAI,EAAE,KAAK,EAC5B,QAAQ,EAAE,eAAe,EACzB,EAAE,EAAE,QAAQ,GACX,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;CAuB/B"}
|
|
@@ -1,89 +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.Field = exports.isField = void 0;
|
|
13
|
-
const type_1 = require("./type");
|
|
14
|
-
const bcs_1 = require("./bcs");
|
|
15
|
-
const object_1 = require("./object");
|
|
16
|
-
const loader_1 = require("./loader");
|
|
17
|
-
const init_1 = require("../init");
|
|
18
|
-
bcs_1.bcs.registerStructType(['0x2::dynamic_field::Field', 'Name', 'Value'], {
|
|
19
|
-
id: '0x2::object::UID',
|
|
20
|
-
name: 'Name',
|
|
21
|
-
value: 'Value',
|
|
22
|
-
});
|
|
23
|
-
function isField(type) {
|
|
24
|
-
return type.startsWith('0x2::dynamic_field::Field<');
|
|
25
|
-
}
|
|
26
|
-
exports.isField = isField;
|
|
27
|
-
class Field {
|
|
28
|
-
constructor(typeArgs, fields) {
|
|
29
|
-
this.$typeArgs = typeArgs;
|
|
30
|
-
this.id = fields.id;
|
|
31
|
-
this.name = fields.name;
|
|
32
|
-
this.value = fields.value;
|
|
33
|
-
}
|
|
34
|
-
static fromFields(typeArgs, fields) {
|
|
35
|
-
(0, init_1.initLoaderIfNeeded)();
|
|
36
|
-
return new Field(typeArgs, {
|
|
37
|
-
id: object_1.UID.fromFields(fields.id).id.bytes,
|
|
38
|
-
name: loader_1.structClassLoader.fromFields(typeArgs[0], fields.name),
|
|
39
|
-
value: loader_1.structClassLoader.fromFields(typeArgs[1], fields.value),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
static fromFieldsWithTypes(item) {
|
|
43
|
-
(0, init_1.initLoaderIfNeeded)();
|
|
44
|
-
if (!isField(item.type)) {
|
|
45
|
-
throw new Error(`not a Field type`);
|
|
46
|
-
}
|
|
47
|
-
const { typeArgs } = (0, type_1.parseTypeName)(item.type);
|
|
48
|
-
return new Field(typeArgs, {
|
|
49
|
-
id: item.fields.id,
|
|
50
|
-
name: loader_1.structClassLoader.fromFieldsWithTypes(typeArgs[0], item.fields.name),
|
|
51
|
-
value: loader_1.structClassLoader.fromFieldsWithTypes(typeArgs[1], item.fields.value),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
static fromBcs(typeArgs, data, encoding) {
|
|
55
|
-
return Field.fromFields(typeArgs, bcs_1.bcs.de(['0x2::dynamic_field::Field', ...typeArgs], data, encoding));
|
|
56
|
-
}
|
|
57
|
-
static fromSuiParsedData(content) {
|
|
58
|
-
if (content.dataType !== 'moveObject') {
|
|
59
|
-
throw new Error(`not an object`);
|
|
60
|
-
}
|
|
61
|
-
if (!isField(content.type)) {
|
|
62
|
-
throw new Error(`object at "${content.fields.id}" is not a Field`);
|
|
63
|
-
}
|
|
64
|
-
return Field.fromFieldsWithTypes(content);
|
|
65
|
-
}
|
|
66
|
-
static fetch(provider, id) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
const res = yield provider.getObject({
|
|
69
|
-
id,
|
|
70
|
-
options: {
|
|
71
|
-
showBcs: true,
|
|
72
|
-
showContent: true,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
if (res.error) {
|
|
76
|
-
throw new Error(`error fetching Field object at id "${id}": ${res.error.tag}`);
|
|
77
|
-
}
|
|
78
|
-
if (res.data.bcs.dataType !== 'moveObject' ||
|
|
79
|
-
!isField(res.data.bcs && 'type' in res.data.bcs ? res.data.bcs.type : '')) {
|
|
80
|
-
throw new Error(`object at id "${id}" is not a Field`);
|
|
81
|
-
}
|
|
82
|
-
const { typeArgs } = (0, type_1.parseTypeName)(res.data.bcs && 'type' in res.data.bcs ? res.data.bcs.type : '');
|
|
83
|
-
return Field.fromBcs(typeArgs, res.data.bcs.bcsBytes, 'base64');
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.Field = Field;
|
|
88
|
-
Field.$typeName = '0x2::dynamic_field::Field';
|
|
89
|
-
Field.$numTypeParams = 2;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/external/nojo/framework/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAQ5C,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,QAOxD"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.registerClasses = void 0;
|
|
27
|
-
const balance = __importStar(require("./balance"));
|
|
28
|
-
const coin = __importStar(require("./coin"));
|
|
29
|
-
const dynamicField = __importStar(require("./dynamic-field"));
|
|
30
|
-
const object = __importStar(require("./object"));
|
|
31
|
-
const table = __importStar(require("./table"));
|
|
32
|
-
const typeName = __importStar(require("./type-name"));
|
|
33
|
-
function registerClasses(loader) {
|
|
34
|
-
loader.register(balance.Balance);
|
|
35
|
-
loader.register(coin.Coin, coin.TreasuryCap);
|
|
36
|
-
loader.register(dynamicField.Field);
|
|
37
|
-
loader.register(object.ID, object.UID);
|
|
38
|
-
loader.register(table.Table);
|
|
39
|
-
loader.register(typeName.TypeName);
|
|
40
|
-
}
|
|
41
|
-
exports.registerClasses = registerClasses;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Type } from './type';
|
|
2
|
-
import { FieldsWithTypes } from './util';
|
|
3
|
-
export type PrimitiveValue = string | number | boolean | bigint;
|
|
4
|
-
export declare class StructClassLoader {
|
|
5
|
-
#private;
|
|
6
|
-
private map;
|
|
7
|
-
register(...classes: any): void;
|
|
8
|
-
fromFields(type: Type, value: Record<string, any> | PrimitiveValue): any;
|
|
9
|
-
fromFieldsWithTypes(type: Type, value: FieldsWithTypes | PrimitiveValue): any;
|
|
10
|
-
}
|
|
11
|
-
export declare const structClassLoader: StructClassLoader;
|
|
12
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/external/nojo/framework/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAExC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAE/D,qBAAa,iBAAiB;;IAC5B,OAAO,CAAC,GAAG,CAOE;IAEb,QAAQ,CAAC,GAAG,OAAO,EAAE,GAAG;IAmCxB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,cAAc;IAqBlE,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,GAAG,cAAc;CA0CxE;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAA"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _StructClassLoader_instances, _StructClassLoader_handlePrimitiveValue;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.structClassLoader = exports.StructClassLoader = void 0;
|
|
10
|
-
const type_1 = require("./type");
|
|
11
|
-
class StructClassLoader {
|
|
12
|
-
constructor() {
|
|
13
|
-
_StructClassLoader_instances.add(this);
|
|
14
|
-
this.map = new Map();
|
|
15
|
-
}
|
|
16
|
-
register(...classes) {
|
|
17
|
-
for (const cls of classes) {
|
|
18
|
-
if ('$typeName' in cls === false ||
|
|
19
|
-
'$numTypeParams' in cls === false ||
|
|
20
|
-
'fromFields' in cls === false ||
|
|
21
|
-
'fromFieldsWithTypes' in cls === false) {
|
|
22
|
-
throw new Error(`class ${cls.name} is not a valid struct class`);
|
|
23
|
-
}
|
|
24
|
-
const typeName = cls.$typeName;
|
|
25
|
-
const numTypeParams = cls.$numTypeParams;
|
|
26
|
-
this.map.set(typeName, {
|
|
27
|
-
numTypeParams,
|
|
28
|
-
fromFields: (fields, typeArgs = []) => {
|
|
29
|
-
if (typeArgs.length !== numTypeParams) {
|
|
30
|
-
throw new Error(`expected ${numTypeParams} type args, got ${typeArgs.length}`);
|
|
31
|
-
}
|
|
32
|
-
if (numTypeParams === 0) {
|
|
33
|
-
return cls.fromFields(fields);
|
|
34
|
-
}
|
|
35
|
-
else if (numTypeParams === 1) {
|
|
36
|
-
return cls.fromFields(typeArgs[0], fields);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return cls.fromFields(typeArgs, fields);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
fromFieldsWithTypes: (item) => {
|
|
43
|
-
return cls.fromFieldsWithTypes(item);
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
fromFields(type, value) {
|
|
49
|
-
const ret = __classPrivateFieldGet(this, _StructClassLoader_instances, "m", _StructClassLoader_handlePrimitiveValue).call(this, type, value, this.fromFields.bind(this));
|
|
50
|
-
if (ret !== undefined) {
|
|
51
|
-
return ret;
|
|
52
|
-
}
|
|
53
|
-
value = value; // type hint
|
|
54
|
-
const { typeName, typeArgs } = (0, type_1.parseTypeName)(type);
|
|
55
|
-
const loader = this.map.get(typeName);
|
|
56
|
-
if (!loader) {
|
|
57
|
-
throw new Error(`no loader registered for type ${typeName}`);
|
|
58
|
-
}
|
|
59
|
-
if (loader.numTypeParams !== typeArgs.length) {
|
|
60
|
-
throw new Error(`expected ${loader.numTypeParams} type args, got ${typeArgs.length}`);
|
|
61
|
-
}
|
|
62
|
-
return loader.fromFields(value, typeArgs);
|
|
63
|
-
}
|
|
64
|
-
fromFieldsWithTypes(type, value) {
|
|
65
|
-
const ret = __classPrivateFieldGet(this, _StructClassLoader_instances, "m", _StructClassLoader_handlePrimitiveValue).call(this, type, value, this.fromFieldsWithTypes.bind(this));
|
|
66
|
-
if (ret !== undefined) {
|
|
67
|
-
return ret;
|
|
68
|
-
}
|
|
69
|
-
value = value; // type hint
|
|
70
|
-
type = type.split('<')[0];
|
|
71
|
-
const loader = this.map.get(type);
|
|
72
|
-
if (!loader) {
|
|
73
|
-
throw new Error(`no loader registered for type ${type}`);
|
|
74
|
-
}
|
|
75
|
-
return loader.fromFieldsWithTypes(value);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.StructClassLoader = StructClassLoader;
|
|
79
|
-
_StructClassLoader_instances = new WeakSet(), _StructClassLoader_handlePrimitiveValue = function _StructClassLoader_handlePrimitiveValue(type, value, vecCb) {
|
|
80
|
-
const { typeName, typeArgs } = (0, type_1.parseTypeName)(type);
|
|
81
|
-
switch (typeName) {
|
|
82
|
-
case 'bool':
|
|
83
|
-
return value;
|
|
84
|
-
case 'u8':
|
|
85
|
-
case 'u16':
|
|
86
|
-
case 'u32':
|
|
87
|
-
return value;
|
|
88
|
-
case 'u64':
|
|
89
|
-
case 'u128':
|
|
90
|
-
case 'u256':
|
|
91
|
-
return BigInt(value);
|
|
92
|
-
case 'address':
|
|
93
|
-
return value;
|
|
94
|
-
case 'signer':
|
|
95
|
-
return value;
|
|
96
|
-
case 'vector':
|
|
97
|
-
value = value;
|
|
98
|
-
return value.map((item) => vecCb(typeArgs[0], item));
|
|
99
|
-
default:
|
|
100
|
-
return undefined;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
exports.structClassLoader = new StructClassLoader();
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { TypeName as BcsTypeName, Encoding } from '@mysten/bcs';
|
|
2
|
-
import { ObjectId } from '@mysten/sui.js';
|
|
3
|
-
import { Type } from './type';
|
|
4
|
-
import { FieldsWithTypes } from './util';
|
|
5
|
-
export declare const ID_BCS_TYPE_NAME: BcsTypeName;
|
|
6
|
-
export declare function isID(type: Type): boolean;
|
|
7
|
-
export interface IDFields {
|
|
8
|
-
bytes: ObjectId;
|
|
9
|
-
}
|
|
10
|
-
export declare class ID {
|
|
11
|
-
static readonly $typeName = "0x2::object::ID";
|
|
12
|
-
static readonly $numTypeParams = 0;
|
|
13
|
-
readonly bytes: ObjectId;
|
|
14
|
-
constructor(fields: IDFields);
|
|
15
|
-
static fromFields(fields: Record<string, any>): ID;
|
|
16
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): ID;
|
|
17
|
-
static fromBcs(data: Uint8Array | string, encoding?: Encoding): ID;
|
|
18
|
-
}
|
|
19
|
-
export declare const UID_BCS_TYPE_NAME: BcsTypeName;
|
|
20
|
-
export declare function isUID(type: Type): boolean;
|
|
21
|
-
export interface UIDFields {
|
|
22
|
-
id: ID;
|
|
23
|
-
}
|
|
24
|
-
export declare class UID {
|
|
25
|
-
static readonly $typeName = "0x2::object::UID";
|
|
26
|
-
static readonly $numTypeParams = 0;
|
|
27
|
-
readonly id: ID;
|
|
28
|
-
constructor(fields: UIDFields);
|
|
29
|
-
static fromFields(fields: Record<string, any>): UID;
|
|
30
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): UID;
|
|
31
|
-
static fromBcs(data: Uint8Array | string, encoding?: Encoding): UID;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=object.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../src/external/nojo/framework/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,IAAI,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAIxC,eAAO,MAAM,gBAAgB,EAAE,WAA+B,CAAA;AAM9D,wBAAgB,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAExC;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,QAAQ,CAAA;CAChB;AAED,qBAAa,EAAE;IACb,MAAM,CAAC,QAAQ,CAAC,SAAS,qBAAoB;IAC7C,MAAM,CAAC,QAAQ,CAAC,cAAc,KAAI;IAElC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;gBAEZ,MAAM,EAAE,QAAQ;IAI5B,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM7C,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,EAAE;IAgBrD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,EAAE;CAGnE;AAED,eAAO,MAAM,iBAAiB,EAAE,WAAgC,CAAA;AAMhE,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAEzC;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,EAAE,CAAA;CACP;AAID,qBAAa,GAAG;IACd,MAAM,CAAC,QAAQ,CAAC,SAAS,sBAAqB;IAC9C,MAAM,CAAC,QAAQ,CAAC,cAAc,KAAI;IAElC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAA;gBAEH,MAAM,EAAE,SAAS;IAI7B,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM7C,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,GAAG;IAiBtD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;CAM9D"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UID = exports.isUID = exports.UID_BCS_TYPE_NAME = exports.ID = exports.isID = exports.ID_BCS_TYPE_NAME = void 0;
|
|
4
|
-
const bcs_1 = require("@mysten/bcs");
|
|
5
|
-
const sui_js_1 = require("@mysten/sui.js");
|
|
6
|
-
const bcs_2 = require("./bcs");
|
|
7
|
-
/* ===================================== ID ===================================== */
|
|
8
|
-
exports.ID_BCS_TYPE_NAME = '0x2::object::ID';
|
|
9
|
-
bcs_2.bcs.registerStructType(exports.ID_BCS_TYPE_NAME, {
|
|
10
|
-
bytes: bcs_1.BCS.ADDRESS,
|
|
11
|
-
});
|
|
12
|
-
function isID(type) {
|
|
13
|
-
return type === '0x2::object::ID';
|
|
14
|
-
}
|
|
15
|
-
exports.isID = isID;
|
|
16
|
-
class ID {
|
|
17
|
-
constructor(fields) {
|
|
18
|
-
this.bytes = fields.bytes;
|
|
19
|
-
}
|
|
20
|
-
static fromFields(fields) {
|
|
21
|
-
return new ID({
|
|
22
|
-
bytes: (0, sui_js_1.normalizeSuiAddress)(fields.bytes), // we normalize because this field is of `address` type
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
static fromFieldsWithTypes(item) {
|
|
26
|
-
/* special casing in the rpc response means that the type field is not present */
|
|
27
|
-
/*
|
|
28
|
-
if (!isID(item.type)) {
|
|
29
|
-
throw new Error(`not an ID type`)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return new ID({
|
|
33
|
-
bytes: item.fields.bytes,
|
|
34
|
-
})
|
|
35
|
-
*/
|
|
36
|
-
return new ID({
|
|
37
|
-
bytes: item,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
static fromBcs(data, encoding) {
|
|
41
|
-
return ID.fromFields(bcs_2.bcs.de(exports.ID_BCS_TYPE_NAME, data, encoding));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.ID = ID;
|
|
45
|
-
ID.$typeName = '0x2::object::ID';
|
|
46
|
-
ID.$numTypeParams = 0;
|
|
47
|
-
exports.UID_BCS_TYPE_NAME = '0x2::object::UID';
|
|
48
|
-
bcs_2.bcs.registerStructType(exports.UID_BCS_TYPE_NAME, {
|
|
49
|
-
id: '0x2::object::ID',
|
|
50
|
-
});
|
|
51
|
-
function isUID(type) {
|
|
52
|
-
return type === '0x2::object::UID';
|
|
53
|
-
}
|
|
54
|
-
exports.isUID = isUID;
|
|
55
|
-
/* ===================================== UID ===================================== */
|
|
56
|
-
class UID {
|
|
57
|
-
constructor(fields) {
|
|
58
|
-
this.id = fields.id;
|
|
59
|
-
}
|
|
60
|
-
static fromFields(fields) {
|
|
61
|
-
return new UID({
|
|
62
|
-
id: ID.fromFields(fields.id),
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
static fromFieldsWithTypes(item) {
|
|
66
|
-
/* special casing in the rpc response means that the type field is not present */
|
|
67
|
-
/*
|
|
68
|
-
if (!isUID(item.type)) {
|
|
69
|
-
throw new Error(`not a UID type`)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return new UID({
|
|
73
|
-
id: ID.fromFieldsWithTypes(item.fields.id),
|
|
74
|
-
})
|
|
75
|
-
*/
|
|
76
|
-
return new UID({
|
|
77
|
-
id: ID.fromFieldsWithTypes(item.id),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
static fromBcs(data, encoding) {
|
|
81
|
-
const dec = bcs_2.bcs.de(exports.UID_BCS_TYPE_NAME, data, encoding);
|
|
82
|
-
return new UID({
|
|
83
|
-
id: ID.fromBcs(dec.id),
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.UID = UID;
|
|
88
|
-
UID.$typeName = '0x2::object::UID';
|
|
89
|
-
UID.$numTypeParams = 0;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JsonRpcProvider, ObjectId, SuiParsedData } from '@mysten/sui.js';
|
|
2
|
-
import { Type } from './type';
|
|
3
|
-
import { Encoding } from '@mysten/bcs';
|
|
4
|
-
import { FieldsWithTypes } from './util';
|
|
5
|
-
export declare function isTable(type: Type): boolean;
|
|
6
|
-
export interface TableFields {
|
|
7
|
-
id: ObjectId;
|
|
8
|
-
size: bigint;
|
|
9
|
-
}
|
|
10
|
-
export declare class Table {
|
|
11
|
-
static readonly $typeName = "0x2::table::Table<K, V>";
|
|
12
|
-
static readonly $numTypeParams = 2;
|
|
13
|
-
readonly $typeArgs: [Type, Type];
|
|
14
|
-
readonly id: ObjectId;
|
|
15
|
-
readonly size: bigint;
|
|
16
|
-
constructor(typeArgs: [Type, Type], fields: TableFields);
|
|
17
|
-
static fromFields(typeArgs: [Type, Type], fields: Record<string, any>): Table;
|
|
18
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): Table;
|
|
19
|
-
static fromBcs(typeArgs: [Type, Type], data: Uint8Array | string, encoding?: Encoding): Table;
|
|
20
|
-
static fromSuiParsedData(content: SuiParsedData): Table;
|
|
21
|
-
static fetch(provider: JsonRpcProvider, id: ObjectId): Promise<Table>;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/external/nojo/framework/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAuB,MAAM,gBAAgB,CAAA;AAC9F,OAAO,EAAE,IAAI,EAAiB,MAAM,QAAQ,CAAA;AAE5C,OAAO,EAAO,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAUxC,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE3C;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,QAAQ,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qBAAa,KAAK;IAChB,MAAM,CAAC,QAAQ,CAAC,SAAS,6BAA4B;IACrD,MAAM,CAAC,QAAQ,CAAC,cAAc,KAAI;IAElC,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAEhC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;gBAET,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW;IAMvD,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK;IAO7E,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,KAAK;IAaxD,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAIrF,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,KAAK;WAU1C,KAAK,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC;CAsB5E"}
|