carbon-js-sdk 0.7.13 → 0.7.16
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/lib/CarbonSDK.d.ts +2 -5
- package/lib/CarbonSDK.js +11 -44
- package/lib/clients/CarbonQueryClient.d.ts +6 -2
- package/lib/clients/CarbonQueryClient.js +62 -58
- package/lib/clients/GasFee.d.ts +6 -6
- package/lib/clients/GasFee.js +10 -17
- package/lib/clients/InsightsQueryClient.d.ts +0 -10
- package/lib/clients/InsightsQueryClient.js +0 -34
- package/lib/clients/TokenClient.d.ts +0 -1
- package/lib/clients/TokenClient.js +19 -14
- package/lib/codec/Switcheo/carbon/book/book.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/book/book.js +18 -18
- package/lib/codec/Switcheo/carbon/book/event.d.ts +21 -2
- package/lib/codec/Switcheo/carbon/book/event.js +109 -27
- package/lib/codec/Switcheo/carbon/book/export.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/book/export.js +3 -1
- package/lib/codec/Switcheo/carbon/book/legacy.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/book/legacy.js +9 -9
- package/lib/codec/Switcheo/carbon/book/query.d.ts +15 -9
- package/lib/codec/Switcheo/carbon/book/query.js +45 -33
- package/lib/codec/Switcheo/carbon/broker/amm.d.ts +4 -6
- package/lib/codec/Switcheo/carbon/broker/amm.js +61 -75
- package/lib/codec/Switcheo/carbon/broker/candlestick.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/broker/candlestick.js +9 -9
- package/lib/codec/Switcheo/carbon/broker/event.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/broker/event.js +18 -18
- package/lib/codec/Switcheo/carbon/broker/query.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/query.js +27 -27
- package/lib/codec/Switcheo/carbon/broker/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/broker/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/ccm/export.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/ccm/export.js +8 -3
- package/lib/codec/Switcheo/carbon/ccm/genesis.d.ts +9 -3
- package/lib/codec/Switcheo/carbon/ccm/genesis.js +6 -6
- package/lib/codec/Switcheo/carbon/ccm/{ccm.d.ts → params.d.ts} +11 -0
- package/lib/codec/Switcheo/carbon/ccm/params.js +107 -0
- package/lib/codec/Switcheo/carbon/ccm/query.d.ts +32 -2
- package/lib/codec/Switcheo/carbon/ccm/query.js +88 -1
- package/lib/codec/Switcheo/carbon/ccm/tx.d.ts +42 -0
- package/lib/codec/Switcheo/carbon/ccm/tx.js +103 -1
- package/lib/codec/Switcheo/carbon/cdp/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/cdp/export.js +7 -4
- package/lib/codec/Switcheo/carbon/cdp/params.d.ts +35 -5
- package/lib/codec/Switcheo/carbon/cdp/params.js +196 -1
- package/lib/codec/Switcheo/carbon/cdp/tx.d.ts +43 -2
- package/lib/codec/Switcheo/carbon/cdp/tx.js +112 -10
- package/lib/codec/Switcheo/carbon/coin/group.d.ts +6 -3
- package/lib/codec/Switcheo/carbon/coin/token.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/coin/token.js +18 -18
- package/lib/codec/Switcheo/carbon/coin/tx.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/erc20/erc20.d.ts +4 -1
- package/lib/codec/Switcheo/carbon/erc20/events.d.ts +8 -2
- package/lib/codec/Switcheo/carbon/erc20/export.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/erc20/export.js +4 -3
- package/lib/codec/Switcheo/carbon/erc20/genesis.d.ts +1 -17
- package/lib/codec/Switcheo/carbon/erc20/genesis.js +7 -65
- package/lib/codec/Switcheo/carbon/erc20/params.d.ts +41 -0
- package/lib/codec/Switcheo/carbon/erc20/params.js +133 -0
- package/lib/codec/Switcheo/carbon/erc20/query.d.ts +5 -2
- package/lib/codec/Switcheo/carbon/erc20/query.js +6 -6
- package/lib/codec/Switcheo/carbon/erc20/tx.d.ts +36 -17
- package/lib/codec/Switcheo/carbon/erc20/tx.js +8 -6
- package/lib/codec/Switcheo/carbon/evmcontract/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/evmcontract/export.js +2 -3
- package/lib/codec/Switcheo/carbon/evmcontract/genesis.d.ts +10 -4
- package/lib/codec/Switcheo/carbon/evmcontract/genesis.js +54 -4
- package/lib/codec/Switcheo/carbon/evmcontract/params.d.ts +10 -0
- package/lib/codec/Switcheo/carbon/evmcontract/params.js +50 -1
- package/lib/codec/Switcheo/carbon/evmcontract/query.d.ts +98 -0
- package/lib/codec/Switcheo/carbon/evmcontract/query.js +374 -1
- package/lib/codec/Switcheo/carbon/evmcontract/tx.d.ts +77 -0
- package/lib/codec/Switcheo/carbon/evmcontract/tx.js +327 -1
- package/lib/codec/Switcheo/carbon/evmmerge/offchain.d.ts +4 -1
- package/lib/codec/Switcheo/carbon/evmmerge/query.d.ts +16 -4
- package/lib/codec/Switcheo/carbon/evmmerge/tx.d.ts +8 -2
- package/lib/codec/Switcheo/carbon/headersync/genesis.d.ts +8 -2
- package/lib/codec/Switcheo/carbon/inflation/inflation.d.ts +4 -1
- package/lib/codec/Switcheo/carbon/insurance/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/insurance/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/insurance/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/event.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/leverage.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/query.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/query.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/liquidation/event.d.ts +23 -0
- package/lib/codec/Switcheo/carbon/liquidation/event.js +154 -0
- package/lib/codec/Switcheo/carbon/liquidation/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/liquidation/export.js +3 -5
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.js +9 -9
- package/lib/codec/Switcheo/carbon/liquidation/query.d.ts +1 -26
- package/lib/codec/Switcheo/carbon/liquidation/query.js +10 -97
- package/lib/codec/Switcheo/carbon/liquiditypool/export.d.ts +4 -3
- package/lib/codec/Switcheo/carbon/liquiditypool/export.js +11 -4
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.js +7 -6
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.d.ts +22 -13
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.js +223 -85
- package/lib/codec/{perpsliquidity → Switcheo/carbon/liquiditypool}/params.d.ts +14 -11
- package/lib/codec/Switcheo/carbon/liquiditypool/params.js +149 -0
- package/lib/codec/Switcheo/carbon/liquiditypool/query.d.ts +24 -1
- package/lib/codec/Switcheo/carbon/liquiditypool/query.js +94 -6
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.d.ts +46 -4
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.js +157 -58
- package/lib/codec/Switcheo/carbon/market/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/market/event.js +13 -11
- package/lib/codec/Switcheo/carbon/market/export.d.ts +4 -3
- package/lib/codec/Switcheo/carbon/market/export.js +14 -4
- package/lib/codec/Switcheo/carbon/market/fee.d.ts +11 -5
- package/lib/codec/Switcheo/carbon/market/genesis.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/market/genesis.js +18 -19
- package/lib/codec/Switcheo/carbon/market/market.d.ts +9 -46
- package/lib/codec/Switcheo/carbon/market/market.js +22 -415
- package/lib/codec/Switcheo/carbon/market/params.d.ts +83 -0
- package/lib/codec/Switcheo/carbon/market/params.js +791 -0
- package/lib/codec/Switcheo/carbon/market/query.d.ts +45 -7
- package/lib/codec/Switcheo/carbon/market/query.js +271 -45
- package/lib/codec/Switcheo/carbon/market/tx.d.ts +91 -4
- package/lib/codec/Switcheo/carbon/market/tx.js +356 -20
- package/lib/codec/Switcheo/carbon/marketstats/export.d.ts +1 -2
- package/lib/codec/Switcheo/carbon/marketstats/export.js +1 -5
- package/lib/codec/Switcheo/carbon/marketstats/genesis.d.ts +4 -7
- package/lib/codec/Switcheo/carbon/marketstats/genesis.js +4 -21
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.js +9 -9
- package/lib/codec/Switcheo/carbon/marketstats/query.d.ts +0 -26
- package/lib/codec/Switcheo/carbon/marketstats/query.js +1 -88
- package/lib/codec/Switcheo/carbon/misc/message.d.ts +2 -0
- package/lib/codec/Switcheo/carbon/misc/message.js +30 -1
- package/lib/codec/Switcheo/carbon/misc/trade.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/misc/trade.js +9 -9
- package/lib/codec/Switcheo/carbon/oracle/export.d.ts +4 -3
- package/lib/codec/Switcheo/carbon/oracle/export.js +15 -2
- package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/oracle/genesis.js +6 -5
- package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +0 -20
- package/lib/codec/Switcheo/carbon/oracle/oracle.js +1 -176
- package/lib/codec/Switcheo/carbon/oracle/params.d.ts +45 -0
- package/lib/codec/Switcheo/carbon/oracle/params.js +362 -0
- package/lib/codec/Switcheo/carbon/oracle/query.d.ts +25 -3
- package/lib/codec/Switcheo/carbon/oracle/query.js +126 -8
- package/lib/codec/Switcheo/carbon/oracle/tx.d.ts +114 -0
- package/lib/codec/Switcheo/carbon/oracle/tx.js +541 -1
- package/lib/codec/Switcheo/carbon/order/export.d.ts +5 -3
- package/lib/codec/Switcheo/carbon/order/export.js +14 -5
- package/lib/codec/Switcheo/carbon/order/genesis.d.ts +12 -11
- package/lib/codec/Switcheo/carbon/order/genesis.js +30 -29
- package/lib/codec/Switcheo/carbon/order/order.d.ts +16 -26
- package/lib/codec/Switcheo/carbon/order/order.js +39 -67
- package/lib/codec/Switcheo/carbon/order/params.d.ts +28 -0
- package/lib/codec/Switcheo/carbon/order/params.js +109 -0
- package/lib/codec/Switcheo/carbon/order/query.d.ts +4 -3
- package/lib/codec/Switcheo/carbon/order/query.js +24 -23
- package/lib/codec/Switcheo/carbon/order/tx.d.ts +44 -2
- package/lib/codec/Switcheo/carbon/order/tx.js +121 -19
- package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/perpspool/event.js +9 -9
- package/lib/codec/Switcheo/carbon/perpspool/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/perpspool/export.js +5 -4
- package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +20 -7
- package/lib/codec/Switcheo/carbon/perpspool/market.js +9 -9
- package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +20 -1
- package/lib/codec/Switcheo/carbon/perpspool/params.js +175 -1
- package/lib/codec/Switcheo/carbon/perpspool/pool.d.ts +8 -2
- package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +39 -26
- package/lib/codec/Switcheo/carbon/perpspool/tx.js +50 -129
- package/lib/codec/Switcheo/carbon/position/evm_hooks.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/position/evm_hooks.js +9 -9
- package/lib/codec/Switcheo/carbon/position/export.d.ts +1 -0
- package/lib/codec/Switcheo/carbon/position/export.js +4 -1
- package/lib/codec/Switcheo/carbon/position/position.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/position/position.js +18 -18
- package/lib/codec/Switcheo/carbon/position/query.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/position/query.js +18 -18
- package/lib/codec/Switcheo/carbon/position/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/position/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/pricing/event.d.ts +10 -0
- package/lib/codec/Switcheo/carbon/pricing/event.js +51 -1
- package/lib/codec/Switcheo/carbon/pricing/export.d.ts +4 -3
- package/lib/codec/Switcheo/carbon/pricing/export.js +11 -2
- package/lib/codec/Switcheo/carbon/pricing/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/pricing/genesis.js +6 -5
- package/lib/codec/Switcheo/carbon/pricing/params.d.ts +35 -0
- package/lib/codec/Switcheo/carbon/pricing/params.js +212 -0
- package/lib/codec/Switcheo/carbon/pricing/pricing.d.ts +1 -16
- package/lib/codec/Switcheo/carbon/pricing/pricing.js +10 -109
- package/lib/codec/Switcheo/carbon/pricing/proposal.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/pricing/proposal.js +9 -9
- package/lib/codec/Switcheo/carbon/pricing/query.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/pricing/query.js +15 -14
- package/lib/codec/Switcheo/carbon/pricing/tx.d.ts +89 -0
- package/lib/codec/Switcheo/carbon/pricing/tx.js +323 -1
- package/lib/codec/Switcheo/carbon/profile/query.d.ts +0 -1
- package/lib/codec/Switcheo/carbon/profile/query.js +1 -14
- package/lib/codec/Switcheo/carbon/subaccount/export.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/subaccount/export.js +6 -2
- package/lib/codec/Switcheo/carbon/subaccount/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/subaccount/genesis.js +6 -5
- package/lib/codec/Switcheo/carbon/subaccount/params.d.ts +29 -0
- package/lib/codec/Switcheo/carbon/subaccount/params.js +119 -0
- package/lib/codec/Switcheo/carbon/subaccount/query.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/subaccount/query.js +6 -5
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.d.ts +0 -11
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.js +1 -54
- package/lib/codec/Switcheo/carbon/subaccount/tx.d.ts +42 -0
- package/lib/codec/Switcheo/carbon/subaccount/tx.js +103 -1
- package/lib/codec/adl/genesis.d.ts +3 -3
- package/lib/codec/admin/genesis.d.ts +3 -3
- package/lib/codec/admin/query.d.ts +6 -6
- package/lib/codec/admin/tx.d.ts +6 -6
- package/lib/codec/alliance/alliance/export.d.ts +1 -1
- package/lib/codec/alliance/alliance/export.js +6 -5
- package/lib/codec/alliance/alliance/gov.d.ts +2 -0
- package/lib/codec/alliance/alliance/gov.js +20 -0
- package/lib/codec/alliance/alliance/params.d.ts +1 -0
- package/lib/codec/alliance/alliance/params.js +14 -2
- package/lib/codec/alliance/alliance/query.d.ts +61 -73
- package/lib/codec/alliance/alliance/query.js +262 -250
- package/lib/codec/alliance/alliance/tx.d.ts +2 -0
- package/lib/codec/alliance/alliance/tx.js +20 -0
- package/lib/codec/alliance/alliance/unbonding.d.ts +2 -0
- package/lib/codec/alliance/alliance/unbonding.js +18 -2
- package/lib/codec/alliance/alliance.d.ts +5 -5
- package/lib/codec/alliance/delegations.d.ts +8 -8
- package/lib/codec/alliance/events.d.ts +6 -6
- package/lib/codec/alliance/genesis.d.ts +7 -7
- package/lib/codec/alliance/gov.d.ts +5 -5
- package/lib/codec/alliance/params.d.ts +4 -4
- package/lib/codec/alliance/query.d.ts +24 -24
- package/lib/codec/alliance/tx.d.ts +10 -10
- package/lib/codec/bank/event.d.ts +7 -7
- package/lib/codec/bank/genesis.d.ts +3 -3
- package/lib/codec/bank/query.d.ts +6 -6
- package/lib/codec/book/book.d.ts +19 -7
- package/lib/codec/book/book.js +80 -13
- package/lib/codec/book/event.d.ts +3 -3
- package/lib/codec/book/genesis.d.ts +3 -3
- package/lib/codec/book/legacy.d.ts +3 -3
- package/lib/codec/book/query.d.ts +56 -9
- package/lib/codec/book/query.js +224 -1
- package/lib/codec/broker/amm.d.ts +37 -9
- package/lib/codec/broker/amm.js +181 -6
- package/lib/codec/broker/candlestick.d.ts +3 -3
- package/lib/codec/broker/event.d.ts +16 -3
- package/lib/codec/broker/event.js +89 -1
- package/lib/codec/broker/genesis.d.ts +6 -5
- package/lib/codec/broker/genesis.js +26 -11
- package/lib/codec/broker/incoming_liquidations.d.ts +3 -3
- package/lib/codec/broker/pagination.d.ts +3 -3
- package/lib/codec/broker/query.d.ts +8 -8
- package/lib/codec/broker/tx.d.ts +5 -5
- package/lib/codec/btcx/denom_cross_chain_info.d.ts +3 -3
- package/lib/codec/btcx/denom_info.d.ts +3 -3
- package/lib/codec/btcx/genesis.d.ts +3 -3
- package/lib/codec/btcx/query.d.ts +6 -6
- package/lib/codec/btcx/tx.d.ts +8 -8
- package/lib/codec/carbon-models.d.ts +2 -1
- package/lib/codec/carbon-models.js +3 -2
- package/lib/codec/ccm/ccm.d.ts +3 -3
- package/lib/codec/ccm/genesis.d.ts +7 -7
- package/lib/codec/ccm/query.d.ts +4 -4
- package/lib/codec/ccm/tx.d.ts +8 -8
- package/lib/codec/cdp/asset_params.d.ts +5 -5
- package/lib/codec/cdp/cdp_liquidations.d.ts +3 -3
- package/lib/codec/cdp/debt_info.d.ts +3 -3
- package/lib/codec/cdp/e_mode_category.d.ts +3 -3
- package/lib/codec/cdp/event.d.ts +50 -43
- package/lib/codec/cdp/event.js +163 -81
- package/lib/codec/cdp/genesis.d.ts +10 -10
- package/lib/codec/cdp/params.d.ts +5 -7
- package/lib/codec/cdp/params.js +20 -30
- package/lib/codec/cdp/query.d.ts +73 -52
- package/lib/codec/cdp/query.js +104 -17
- package/lib/codec/cdp/rate_strategy_params.d.ts +3 -3
- package/lib/codec/cdp/reward_scheme.d.ts +6 -6
- package/lib/codec/cdp/stablecoin_debt_info.d.ts +3 -3
- package/lib/codec/cdp/stablecoin_interest_info.d.ts +3 -3
- package/lib/codec/cdp/tx.d.ts +123 -101
- package/lib/codec/cdp/tx.js +115 -31
- package/lib/codec/coin/bridge.d.ts +3 -3
- package/lib/codec/coin/event.d.ts +14 -14
- package/lib/codec/coin/genesis.d.ts +4 -4
- package/lib/codec/coin/group.d.ts +5 -5
- package/lib/codec/coin/proposal.d.ts +3 -3
- package/lib/codec/coin/query.d.ts +26 -26
- package/lib/codec/coin/token.d.ts +10 -9
- package/lib/codec/coin/token.js +19 -0
- package/lib/codec/coin/tx.d.ts +48 -48
- package/lib/codec/cosmos/app/module/v1alpha1/module.d.ts +3 -3
- package/lib/codec/cosmos/app/runtime/v1alpha1/module.d.ts +18 -0
- package/lib/codec/cosmos/app/runtime/v1alpha1/module.js +50 -2
- package/lib/codec/cosmos/app/v1alpha1/config.d.ts +26 -0
- package/lib/codec/cosmos/app/v1alpha1/config.js +94 -4
- package/lib/codec/cosmos/app/v1alpha1/module.d.ts +1 -1
- package/lib/codec/cosmos/auth/v1beta1/auth.d.ts +21 -0
- package/lib/codec/cosmos/auth/v1beta1/auth.js +92 -1
- package/lib/codec/cosmos/auth/v1beta1/export.d.ts +3 -2
- package/lib/codec/cosmos/auth/v1beta1/export.js +7 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +54 -2
- package/lib/codec/cosmos/auth/v1beta1/query.js +120 -2
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +18 -18
- package/lib/codec/cosmos/authz/v1beta1/tx.js +36 -36
- package/lib/codec/cosmos/autocli/v1/options.d.ts +2 -4
- package/lib/codec/cosmos/autocli/v1/options.js +4 -19
- package/lib/codec/cosmos/bank/module/v1/module.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +7 -0
- package/lib/codec/cosmos/bank/v1beta1/authz.js +18 -3
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +9 -0
- package/lib/codec/cosmos/bank/v1beta1/export.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/export.js +13 -1
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +9 -3
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +17 -2
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +211 -6
- package/lib/codec/cosmos/bank/v1beta1/query.js +513 -3
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +103 -1
- package/lib/codec/cosmos/bank/v1beta1/tx.js +215 -2
- package/lib/codec/cosmos/base/abci/v1beta1/abci.d.ts +23 -0
- package/lib/codec/cosmos/base/abci/v1beta1/abci.js +137 -1
- package/lib/codec/cosmos/base/kv/v1beta1/kv.d.ts +4 -4
- package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +36 -0
- package/lib/codec/cosmos/base/node/v1beta1/query.js +257 -3
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +11 -11
- package/lib/codec/cosmos/base/store/v1beta1/commit_info.d.ts +5 -5
- package/lib/codec/cosmos/base/store/v1beta1/listening.d.ts +5 -5
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +16 -46
- package/lib/codec/cosmos/base/v1beta1/coin.d.ts +8 -2
- package/lib/codec/cosmos/capability/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/capability/v1beta1/capability.d.ts +5 -5
- package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/{Switcheo/carbon/marketstats/params.d.ts → cosmos/circuit/module/v1/module.d.ts} +11 -9
- package/lib/codec/{Switcheo/carbon/ccm/ccm.js → cosmos/circuit/module/v1/module.js} +16 -17
- package/lib/codec/cosmos/circuit/v1/query.d.ts +97 -0
- package/lib/codec/cosmos/circuit/v1/query.js +333 -0
- package/lib/codec/cosmos/circuit/v1/tx.d.ts +128 -0
- package/lib/codec/cosmos/circuit/v1/tx.js +371 -0
- package/lib/codec/cosmos/circuit/v1/types.d.ts +81 -0
- package/lib/codec/cosmos/circuit/v1/types.js +266 -0
- package/lib/codec/cosmos/consensus/v1/query.d.ts +1 -1
- package/lib/codec/cosmos/consensus/v1/tx.d.ts +5 -3
- package/lib/codec/cosmos/consensus/v1/tx.js +16 -0
- package/lib/codec/cosmos/crisis/v1beta1/tx.d.ts +46 -1
- package/lib/codec/cosmos/crisis/v1beta1/tx.js +103 -1
- package/lib/codec/cosmos/crypto/ed25519/keys.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +20 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.js +16 -16
- package/lib/codec/cosmos/distribution/v1beta1/export.d.ts +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/export.js +10 -1
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +33 -2
- package/lib/codec/cosmos/distribution/v1beta1/query.js +134 -1
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +144 -3
- package/lib/codec/cosmos/distribution/v1beta1/tx.js +328 -1
- package/lib/codec/cosmos/evidence/v1beta1/evidence.d.ts +4 -0
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +12 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.js +14 -2
- package/lib/codec/cosmos/evidence/v1beta1/tx.d.ts +2 -0
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/feegrant/v1beta1/tx.d.ts +37 -0
- package/lib/codec/cosmos/feegrant/v1beta1/tx.js +84 -1
- package/lib/codec/cosmos/gov/v1/export.d.ts +3 -0
- package/lib/codec/cosmos/gov/v1/export.js +53 -0
- package/lib/codec/cosmos/gov/v1/genesis.d.ts +34 -4
- package/lib/codec/cosmos/gov/v1/genesis.js +34 -2
- package/lib/codec/cosmos/gov/v1/gov.d.ts +154 -7
- package/lib/codec/cosmos/gov/v1/gov.js +352 -3
- package/lib/codec/cosmos/gov/v1/query.d.ts +55 -7
- package/lib/codec/cosmos/gov/v1/query.js +101 -1
- package/lib/codec/cosmos/gov/v1/tx.d.ts +126 -2
- package/lib/codec/cosmos/gov/v1/tx.js +317 -3
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +30 -5
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +5 -3
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +14 -1
- package/lib/codec/cosmos/group/v1/events.d.ts +17 -1
- package/lib/codec/cosmos/group/v1/events.js +81 -1
- package/lib/codec/cosmos/group/v1/query.d.ts +5 -5
- package/lib/codec/cosmos/group/v1/tx.d.ts +25 -13
- package/lib/codec/cosmos/group/v1/tx.js +60 -34
- package/lib/codec/cosmos/group/v1/types.d.ts +34 -8
- package/lib/codec/cosmos/group/v1/types.js +27 -1
- package/lib/codec/cosmos/mint/v1beta1/export.d.ts +1 -0
- package/lib/codec/cosmos/mint/v1beta1/export.js +4 -1
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/mint.d.ts +1 -1
- package/lib/codec/cosmos/msg/textual/v1/textual.d.ts +1 -0
- package/lib/codec/cosmos/msg/textual/v1/textual.js +14 -0
- package/lib/codec/cosmos/nft/v1beta1/event.d.ts +10 -0
- package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +1 -0
- package/lib/codec/cosmos/nft/v1beta1/query.d.ts +20 -0
- package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +2 -2
- package/lib/codec/cosmos/orm/v1/orm.d.ts +5 -2
- package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +2 -22
- package/lib/codec/cosmos/orm/v1alpha1/schema.js +2 -32
- package/lib/codec/cosmos/slashing/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/slashing.d.ts +9 -8
- package/lib/codec/cosmos/slashing/v1beta1/tx.d.ts +46 -0
- package/lib/codec/cosmos/slashing/v1beta1/tx.js +101 -1
- package/lib/codec/cosmos/staking/module/v1/module.d.ts +4 -0
- package/lib/codec/cosmos/staking/module/v1/module.js +35 -2
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +2 -0
- package/lib/codec/cosmos/staking/v1beta1/authz.js +7 -0
- package/lib/codec/cosmos/staking/v1beta1/export.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/export.js +8 -2
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +3 -2
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +36 -5
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +44 -5
- package/lib/codec/cosmos/staking/v1beta1/staking.js +212 -2
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +58 -1
- package/lib/codec/cosmos/staking/v1beta1/tx.js +116 -1
- package/lib/codec/cosmos/store/internal/kv/v1beta1/kv.d.ts +31 -0
- package/lib/codec/cosmos/store/internal/kv/v1beta1/kv.js +154 -0
- package/lib/codec/cosmos/store/snapshots/v1/snapshot.d.ts +119 -0
- package/lib/codec/cosmos/store/snapshots/v1/snapshot.js +540 -0
- package/lib/codec/cosmos/store/streaming/abci/grpc.d.ts +72 -0
- package/lib/codec/cosmos/store/streaming/abci/grpc.js +247 -0
- package/lib/codec/cosmos/store/v1beta1/commit_info.d.ts +54 -0
- package/lib/codec/cosmos/store/v1beta1/commit_info.js +273 -0
- package/lib/codec/cosmos/store/v1beta1/listening.d.ts +48 -0
- package/lib/codec/cosmos/store/v1beta1/listening.js +220 -0
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +4 -3
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +4 -3
- package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/export.js +9 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +196 -11
- package/lib/codec/cosmos/tx/v1beta1/service.js +433 -10
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +6 -5
- package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/upgrade.d.ts +6 -4
- package/lib/codec/cosmos-models.d.ts +1 -1
- package/lib/codec/cosmos-models.js +1 -1
- package/lib/codec/erc20/erc20.d.ts +3 -3
- package/lib/codec/erc20/events.d.ts +6 -6
- package/lib/codec/erc20/genesis.d.ts +4 -4
- package/lib/codec/erc20/query.d.ts +8 -8
- package/lib/codec/erc20/tx.d.ts +16 -16
- package/lib/codec/ethermint/evm/v1/export.d.ts +2 -1
- package/lib/codec/ethermint/evm/v1/export.js +8 -1
- package/lib/codec/ethermint/evm/v1/tx.d.ts +37 -1
- package/lib/codec/ethermint/evm/v1/tx.js +100 -1
- package/lib/codec/ethermint/feemarket/v1/export.d.ts +2 -0
- package/lib/codec/ethermint/feemarket/v1/export.js +7 -1
- package/lib/codec/ethermint/feemarket/v1/feemarket.d.ts +10 -0
- package/lib/codec/ethermint/feemarket/v1/feemarket.js +28 -1
- package/lib/codec/evmbank/genesis.d.ts +4 -4
- package/lib/codec/evmbank/query.d.ts +4 -4
- package/lib/codec/evmcontract/genesis.d.ts +3 -3
- package/lib/codec/evmmerge/address.d.ts +3 -3
- package/lib/codec/evmmerge/event.d.ts +3 -3
- package/lib/codec/evmmerge/genesis.d.ts +5 -5
- package/lib/codec/evmmerge/offchain.d.ts +3 -3
- package/lib/codec/evmmerge/query.d.ts +6 -6
- package/lib/codec/evmmerge/tx.d.ts +4 -4
- package/lib/codec/fee/event.d.ts +3 -3
- package/lib/codec/fee/fee.d.ts +5 -5
- package/lib/codec/fee/genesis.d.ts +3 -3
- package/lib/codec/fee/proposal.d.ts +6 -6
- package/lib/codec/fee/query.d.ts +10 -10
- package/lib/codec/fee/tx.d.ts +10 -10
- package/lib/codec/google/protobuf/any.d.ts +5 -4
- package/lib/codec/google/protobuf/descriptor.d.ts +266 -11
- package/lib/codec/google/protobuf/descriptor.js +1060 -41
- package/lib/codec/google/protobuf/empty.d.ts +26 -0
- package/lib/codec/{Switcheo/carbon/marketstats/params.js → google/protobuf/empty.js} +7 -7
- package/lib/codec/google/protobuf/timestamp.d.ts +1 -1
- package/lib/codec/headersync/consensus_peers.d.ts +7 -7
- package/lib/codec/headersync/genesis.d.ts +7 -7
- package/lib/codec/headersync/query.d.ts +6 -6
- package/lib/codec/headersync/tx.d.ts +6 -6
- package/lib/codec/ibc/applications/fee/v1/query.d.ts +7 -1
- package/lib/codec/ibc/applications/fee/v1/query.js +54 -0
- package/lib/codec/ibc/applications/interchain_accounts/controller/export.d.ts +2 -1
- package/lib/codec/ibc/applications/interchain_accounts/controller/export.js +10 -1
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/query.d.ts +26 -0
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/query.js +113 -1
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +34 -0
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.js +117 -2
- package/lib/codec/ibc/applications/interchain_accounts/host/export.d.ts +1 -0
- package/lib/codec/ibc/applications/interchain_accounts/host/export.js +4 -1
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/tx.d.ts +50 -0
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/tx.js +120 -0
- package/lib/codec/ibc/applications/interchain_accounts/v1/export.d.ts +0 -1
- package/lib/codec/ibc/applications/interchain_accounts/v1/export.js +1 -6
- package/lib/codec/ibc/applications/transfer/v1/authz.d.ts +5 -0
- package/lib/codec/ibc/applications/transfer/v1/authz.js +18 -2
- package/lib/codec/ibc/applications/transfer/v1/export.d.ts +3 -2
- package/lib/codec/ibc/applications/transfer/v1/export.js +10 -1
- package/lib/codec/ibc/applications/transfer/v1/genesis.d.ts +6 -0
- package/lib/codec/ibc/applications/transfer/v1/genesis.js +18 -2
- package/lib/codec/ibc/applications/transfer/v1/query.d.ts +59 -4
- package/lib/codec/ibc/applications/transfer/v1/query.js +216 -7
- package/lib/codec/ibc/applications/transfer/v1/tx.d.ts +43 -4
- package/lib/codec/ibc/applications/transfer/v1/tx.js +135 -6
- package/lib/codec/ibc/applications/transfer/v2/packet.d.ts +2 -0
- package/lib/codec/ibc/applications/transfer/v2/packet.js +14 -1
- package/lib/codec/ibc/core/channel/v1/channel.d.ts +65 -1
- package/lib/codec/ibc/core/channel/v1/channel.js +241 -2
- package/lib/codec/ibc/core/channel/v1/export.d.ts +4 -3
- package/lib/codec/ibc/core/channel/v1/export.js +35 -2
- package/lib/codec/ibc/core/channel/v1/genesis.d.ts +2 -1
- package/lib/codec/ibc/core/channel/v1/genesis.js +16 -0
- package/lib/codec/ibc/core/channel/v1/query.d.ts +127 -2
- package/lib/codec/ibc/core/channel/v1/query.js +526 -1
- package/lib/codec/ibc/core/channel/v1/tx.d.ts +306 -13
- package/lib/codec/ibc/core/channel/v1/tx.js +1785 -89
- package/lib/codec/ibc/core/channel/v1/upgrade.d.ts +62 -0
- package/lib/codec/ibc/core/channel/v1/upgrade.js +238 -0
- package/lib/codec/ibc/core/client/v1/client.d.ts +50 -38
- package/lib/codec/ibc/core/client/v1/client.js +117 -117
- package/lib/codec/ibc/core/client/v1/export.d.ts +3 -3
- package/lib/codec/ibc/core/client/v1/export.js +11 -3
- package/lib/codec/ibc/core/client/v1/genesis.d.ts +6 -1
- package/lib/codec/ibc/core/client/v1/query.d.ts +38 -1
- package/lib/codec/ibc/core/client/v1/query.js +137 -1
- package/lib/codec/ibc/core/client/v1/tx.d.ts +108 -3
- package/lib/codec/ibc/core/client/v1/tx.js +348 -12
- package/lib/codec/ibc/core/commitment/v1/commitment.d.ts +1 -1
- package/lib/codec/ibc/core/commitment/v1/commitment.js +1 -1
- package/lib/codec/ibc/core/connection/v1/export.d.ts +2 -2
- package/lib/codec/ibc/core/connection/v1/export.js +5 -1
- package/lib/codec/ibc/core/connection/v1/query.d.ts +26 -1
- package/lib/codec/ibc/core/connection/v1/query.js +87 -1
- package/lib/codec/ibc/core/connection/v1/tx.d.ts +42 -3
- package/lib/codec/ibc/core/connection/v1/tx.js +138 -3
- package/lib/codec/ibc/lightclients/localhost/v1/localhost.d.ts +3 -3
- package/lib/codec/ibc/lightclients/solomachine/v1/solomachine.d.ts +18 -18
- package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.d.ts +12 -5
- package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.js +1 -1
- package/lib/codec/{perpsliquidity → ibc/lightclients/wasm/v1}/genesis.d.ts +14 -18
- package/lib/codec/ibc/lightclients/wasm/v1/genesis.js +140 -0
- package/lib/codec/ibc/lightclients/wasm/v1/query.d.ts +74 -0
- package/lib/codec/ibc/lightclients/wasm/v1/query.js +272 -0
- package/lib/codec/ibc/lightclients/wasm/v1/tx.d.ts +105 -0
- package/lib/codec/ibc/lightclients/wasm/v1/tx.js +384 -0
- package/lib/codec/ibc/lightclients/wasm/v1/wasm.d.ts +70 -0
- package/lib/codec/ibc/lightclients/wasm/v1/wasm.js +267 -0
- package/lib/codec/ibc-models.d.ts +3 -2
- package/lib/codec/ibc-models.js +4 -3
- package/lib/codec/index.d.ts +157 -24
- package/lib/codec/index.js +6887 -2429
- package/lib/codec/inflation/genesis.d.ts +3 -3
- package/lib/codec/inflation/inflation.d.ts +9 -5
- package/lib/codec/inflation/inflation.js +80 -25
- package/lib/codec/inflation/query.d.ts +4 -4
- package/lib/codec/insurance/event.d.ts +3 -3
- package/lib/codec/insurance/fund.d.ts +4 -4
- package/lib/codec/insurance/genesis.d.ts +3 -3
- package/lib/codec/insurance/query.d.ts +4 -4
- package/lib/codec/insurance/tx.d.ts +4 -4
- package/lib/codec/leverage/event.d.ts +3 -3
- package/lib/codec/leverage/genesis.d.ts +3 -3
- package/lib/codec/leverage/leverage.d.ts +4 -4
- package/lib/codec/leverage/query.d.ts +6 -6
- package/lib/codec/leverage/tx.d.ts +4 -4
- package/lib/codec/liquidation/genesis.d.ts +4 -4
- package/lib/codec/liquidation/liquidation.d.ts +3 -3
- package/lib/codec/liquidation/outstanding_position.d.ts +4 -4
- package/lib/codec/liquidation/query.d.ts +6 -6
- package/lib/codec/liquidation/quote_changes.d.ts +3 -3
- package/lib/codec/liquiditypool/event.d.ts +52 -13
- package/lib/codec/liquiditypool/event.js +294 -1
- package/lib/codec/liquiditypool/genesis.d.ts +7 -8
- package/lib/codec/liquiditypool/genesis.js +34 -49
- package/lib/codec/liquiditypool/liquiditypool.d.ts +12 -12
- package/lib/codec/liquiditypool/proposal.d.ts +11 -11
- package/lib/codec/liquiditypool/query.d.ts +33 -82
- package/lib/codec/liquiditypool/query.js +18 -265
- package/lib/codec/liquiditypool/reward.d.ts +37 -37
- package/lib/codec/liquiditypool/reward.js +97 -111
- package/lib/codec/liquiditypool/tx.d.ts +39 -39
- package/lib/codec/lockproxy/event.d.ts +4 -4
- package/lib/codec/lockproxy/genesis.d.ts +6 -6
- package/lib/codec/lockproxy/lockproxy.d.ts +3 -3
- package/lib/codec/lockproxy/query.d.ts +6 -6
- package/lib/codec/lockproxy/tx.d.ts +12 -12
- package/lib/codec/market/event.d.ts +3 -3
- package/lib/codec/market/fee.d.ts +7 -7
- package/lib/codec/market/genesis.d.ts +3 -3
- package/lib/codec/market/market.d.ts +7 -7
- package/lib/codec/market/proposal.d.ts +5 -5
- package/lib/codec/market/query.d.ts +20 -20
- package/lib/codec/market/tx.d.ts +21 -21
- package/lib/codec/marketstats/genesis.d.ts +3 -3
- package/lib/codec/marketstats/marketstats.d.ts +3 -3
- package/lib/codec/marketstats/params.d.ts +3 -3
- package/lib/codec/marketstats/query.d.ts +6 -6
- package/lib/codec/misc/block.d.ts +3 -3
- package/lib/codec/misc/message.d.ts +3 -3
- package/lib/codec/misc/message_type.d.ts +3 -3
- package/lib/codec/misc/query.d.ts +16 -16
- package/lib/codec/misc/trade.d.ts +3 -3
- package/lib/codec/misc/transaction.d.ts +4 -4
- package/lib/codec/oracle/event.d.ts +4 -4
- package/lib/codec/oracle/genesis.d.ts +3 -3
- package/lib/codec/oracle/oracle.d.ts +8 -8
- package/lib/codec/oracle/proposal.d.ts +3 -3
- package/lib/codec/oracle/query.d.ts +61 -58
- package/lib/codec/oracle/query.js +37 -31
- package/lib/codec/oracle/slashing.d.ts +4 -4
- package/lib/codec/oracle/tx.d.ts +14 -14
- package/lib/codec/oraclesvc/query.d.ts +20 -0
- package/lib/codec/oraclesvc/query.js +29 -0
- package/lib/codec/order/event.d.ts +3 -3
- package/lib/codec/order/genesis.d.ts +6 -6
- package/lib/codec/order/order.d.ts +9 -9
- package/lib/codec/order/query.d.ts +12 -12
- package/lib/codec/order/tx.d.ts +12 -12
- package/lib/codec/perpspool/event.d.ts +9 -9
- package/lib/codec/perpspool/genesis.d.ts +6 -6
- package/lib/codec/perpspool/market.d.ts +8 -8
- package/lib/codec/perpspool/params.d.ts +3 -3
- package/lib/codec/perpspool/pool.d.ts +8 -8
- package/lib/codec/perpspool/query.d.ts +20 -20
- package/lib/codec/perpspool/tx.d.ts +18 -18
- package/lib/codec/position/event.d.ts +3 -3
- package/lib/codec/position/genesis.d.ts +3 -3
- package/lib/codec/position/position.d.ts +8 -6
- package/lib/codec/position/position.js +34 -0
- package/lib/codec/position/query.d.ts +8 -8
- package/lib/codec/position/tx.d.ts +4 -4
- package/lib/codec/pricing/event.d.ts +8 -8
- package/lib/codec/pricing/genesis.d.ts +3 -3
- package/lib/codec/pricing/legacy.d.ts +3 -3
- package/lib/codec/pricing/pricing.d.ts +5 -5
- package/lib/codec/pricing/proposal.d.ts +4 -4
- package/lib/codec/pricing/query.d.ts +16 -16
- package/lib/codec/pricing/tx.d.ts +12 -12
- package/lib/codec/profile/event.d.ts +3 -3
- package/lib/codec/profile/genesis.d.ts +3 -3
- package/lib/codec/profile/profile.d.ts +3 -3
- package/lib/codec/profile/query.d.ts +8 -8
- package/lib/codec/profile/tx.d.ts +4 -4
- package/lib/codec/proofs.d.ts +16 -15
- package/lib/codec/proofs.js +6 -0
- package/lib/codec/sequence/genesis.d.ts +4 -4
- package/lib/codec/sequence/query.d.ts +6 -6
- package/lib/codec/sequence/tx.d.ts +4 -4
- package/lib/codec/subaccount/export.d.ts +1 -1
- package/lib/codec/subaccount/export.js +1 -3
- package/lib/codec/subaccount/genesis.d.ts +8 -4
- package/lib/codec/subaccount/genesis.js +48 -2
- package/lib/codec/subaccount/legacy.d.ts +3 -3
- package/lib/codec/subaccount/query.d.ts +118 -29
- package/lib/codec/subaccount/query.js +503 -47
- package/lib/codec/subaccount/subaccount.d.ts +33 -7
- package/lib/codec/subaccount/subaccount.js +234 -31
- package/lib/codec/subaccount/tx.d.ts +15 -9
- package/lib/codec/subaccount/tx.js +101 -16
- package/lib/codec/tendermint/abci/types.d.ts +297 -186
- package/lib/codec/tendermint/abci/types.js +1968 -1310
- package/lib/codec/tendermint/oracle/types.d.ts +90 -0
- package/lib/codec/tendermint/oracle/types.js +629 -0
- package/lib/codec/tendermint/types/params.d.ts +24 -8
- package/lib/codec/tendermint/types/params.js +80 -34
- package/lib/codec/tendermint/types/types.d.ts +52 -12
- package/lib/codec/tendermint/types/types.js +250 -49
- package/lib/codec/tendermint/types/validator.d.ts +14 -0
- package/lib/codec/tendermint/types/validator.js +50 -1
- package/lib/constant/grant.d.ts +1 -0
- package/lib/constant/grant.js +4 -0
- package/lib/constant/ibc.d.ts +0 -3
- package/lib/constant/ibc.js +1 -4
- package/lib/constant/node.js +0 -3
- package/lib/insights/common.d.ts +0 -3
- package/lib/insights/common.js +0 -3
- package/lib/insights/competition.d.ts +0 -15
- package/lib/insights/funding.d.ts +4 -7
- package/lib/insights/node.d.ts +0 -1
- package/lib/insights/pool.d.ts +0 -20
- package/lib/insights/position.d.ts +1 -3
- package/lib/modules/admin.d.ts +1 -1
- package/lib/modules/admin.js +1 -1
- package/lib/modules/cdp.js +13 -13
- package/lib/modules/evm.d.ts +1 -0
- package/lib/modules/evm.js +45 -3
- package/lib/modules/evmmerge.d.ts +1 -1
- package/lib/modules/evmmerge.js +2 -2
- package/lib/modules/feemarket.d.ts +1 -1
- package/lib/modules/feemarket.js +2 -2
- package/lib/modules/gov.js +2 -2
- package/lib/modules/grant.d.ts +33 -0
- package/lib/modules/grant.js +196 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +1 -0
- package/lib/modules/leverage.js +2 -2
- package/lib/modules/market.js +3 -3
- package/lib/modules/order.d.ts +2 -9
- package/lib/modules/order.js +47 -55
- package/lib/modules/perpspool.js +0 -1
- package/lib/modules/position.js +2 -2
- package/lib/modules/subaccount.d.ts +1 -7
- package/lib/modules/subaccount.js +1 -7
- package/lib/provider/amino/types/evm.js +7 -1
- package/lib/provider/amino/types/gov.js +0 -5
- package/lib/provider/amino/types/grant.d.ts +13 -0
- package/lib/provider/amino/types/grant.js +202 -0
- package/lib/provider/keplr/KeplrStore.js +1 -1
- package/lib/util/alliance.d.ts +2 -0
- package/lib/util/alliance.js +27 -0
- package/lib/util/grant.d.ts +10 -0
- package/lib/util/grant.js +30 -0
- package/lib/util/tx.d.ts +146 -11
- package/lib/wallet/CarbonWallet.d.ts +13 -3
- package/lib/wallet/CarbonWallet.js +59 -31
- package/lib/websocket/connector.js +7 -11
- package/package.json +2 -4
- package/lib/codec/Switcheo/carbon/liquidation/liquidation.d.ts +0 -17
- package/lib/codec/Switcheo/carbon/liquidation/liquidation.js +0 -46
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +0 -76
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +0 -424
- package/lib/codec/perpsliquidity/event.d.ts +0 -115
- package/lib/codec/perpsliquidity/event.js +0 -657
- package/lib/codec/perpsliquidity/genesis.js +0 -163
- package/lib/codec/perpsliquidity/market.d.ts +0 -84
- package/lib/codec/perpsliquidity/market.js +0 -431
- package/lib/codec/perpsliquidity/params.js +0 -129
- package/lib/codec/perpsliquidity/pool.d.ts +0 -119
- package/lib/codec/perpsliquidity/pool.js +0 -774
- package/lib/codec/perpsliquidity/query.d.ts +0 -246
- package/lib/codec/perpsliquidity/query.js +0 -1125
- package/lib/codec/perpsliquidity/tx.d.ts +0 -203
- package/lib/codec/perpsliquidity/tx.js +0 -973
- package/lib/modules/perpsliquidity.d.ts +0 -49
- package/lib/modules/perpsliquidity.js +0 -118
- package/lib/provider/amino/types/perpsliquidity.d.ts +0 -4
- package/lib/provider/amino/types/perpsliquidity.js +0 -73
package/lib/CarbonSDK.d.ts
CHANGED
|
@@ -5,12 +5,11 @@ import * as clients from "./clients";
|
|
|
5
5
|
import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
|
|
6
6
|
import GrpcQueryClient from "./clients/GrpcQueryClient";
|
|
7
7
|
import N3Client from "./clients/N3Client";
|
|
8
|
-
import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, ERC20Module, EvmMergeModule, EvmModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
|
|
8
|
+
import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, ERC20Module, EvmMergeModule, EvmModule, FeeModule, FeemarketModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
|
|
9
9
|
import { StakingModule } from "./modules/staking";
|
|
10
10
|
import { CosmosLedger, Keplr, LeapExtended } from "./provider";
|
|
11
11
|
import { MetaMask } from "./provider/metamask/MetaMask";
|
|
12
12
|
import { CarbonWallet, CarbonWalletGenericOpts, CarbonSigner, MetaMaskWalletOpts } from "./wallet";
|
|
13
|
-
import GasFee from "./clients/GasFee";
|
|
14
13
|
export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
|
|
15
14
|
export { CarbonTx } from "./util";
|
|
16
15
|
export { DenomPrefix } from "./constant";
|
|
@@ -29,7 +28,6 @@ export interface CarbonSDKOpts {
|
|
|
29
28
|
grpcQueryClient?: GrpcQueryClient;
|
|
30
29
|
useTmAbciQuery?: boolean;
|
|
31
30
|
defaultTimeoutBlocks?: number;
|
|
32
|
-
gasFee?: GasFee;
|
|
33
31
|
}
|
|
34
32
|
export interface CarbonSDKInitOpts {
|
|
35
33
|
network: Network;
|
|
@@ -88,6 +86,7 @@ declare class CarbonSDK {
|
|
|
88
86
|
xchain: XChainModule;
|
|
89
87
|
evm: EvmModule;
|
|
90
88
|
evmmerge: EvmMergeModule;
|
|
89
|
+
feemarket: FeemarketModule;
|
|
91
90
|
neo: NEOClient;
|
|
92
91
|
eth: ETHClient;
|
|
93
92
|
bsc: ETHClient;
|
|
@@ -98,7 +97,6 @@ declare class CarbonSDK {
|
|
|
98
97
|
n3: N3Client;
|
|
99
98
|
chainId: string;
|
|
100
99
|
evmChainId: string;
|
|
101
|
-
gasFee: GasFee;
|
|
102
100
|
constructor(opts: CarbonSDKOpts);
|
|
103
101
|
static instance(opts?: CarbonSDKInitOpts): Promise<CarbonSDK>;
|
|
104
102
|
static instanceWithWallet(wallet: CarbonWallet, sdkOpts?: CarbonSDKInitOpts): Promise<ConnectedCarbonSDK>;
|
|
@@ -111,7 +109,6 @@ declare class CarbonSDK {
|
|
|
111
109
|
static instanceWithMetamask(metamask: MetaMask, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts, metamaskWalletOpts?: MetaMaskWalletOpts): Promise<ConnectedCarbonSDK>;
|
|
112
110
|
static instanceViewOnly(bech32Address: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
113
111
|
initialize(): Promise<CarbonSDK>;
|
|
114
|
-
private getGasFee;
|
|
115
112
|
clone(): CarbonSDK;
|
|
116
113
|
generateOpts(): CarbonSDKOpts;
|
|
117
114
|
connect(wallet: CarbonWallet): Promise<ConnectedCarbonSDK>;
|
package/lib/CarbonSDK.js
CHANGED
|
@@ -45,9 +45,6 @@ const staking_1 = require("./modules/staking");
|
|
|
45
45
|
const provider_1 = require("./provider");
|
|
46
46
|
const blockchain_1 = require("./util/blockchain");
|
|
47
47
|
const wallet_1 = require("./wallet");
|
|
48
|
-
const number_1 = require("./util/number");
|
|
49
|
-
const GasFee_1 = __importDefault(require("./clients/GasFee"));
|
|
50
|
-
const pagination_1 = require("cosmjs-types/cosmos/base/query/v1beta1/pagination");
|
|
51
48
|
var wallet_2 = require("./wallet");
|
|
52
49
|
Object.defineProperty(exports, "CarbonSignerTypes", { enumerable: true, get: function () { return wallet_2.CarbonSignerTypes; } });
|
|
53
50
|
Object.defineProperty(exports, "CarbonWallet", { enumerable: true, get: function () { return wallet_2.CarbonWallet; } });
|
|
@@ -56,7 +53,6 @@ Object.defineProperty(exports, "CarbonTx", { enumerable: true, get: function ()
|
|
|
56
53
|
var constant_2 = require("./constant");
|
|
57
54
|
Object.defineProperty(exports, "DenomPrefix", { enumerable: true, get: function () { return constant_2.DenomPrefix; } });
|
|
58
55
|
exports.Carbon = __importStar(require("./codec/carbon-models"));
|
|
59
|
-
const long_1 = __importDefault(require("long"));
|
|
60
56
|
const DEFAULT_SDK_INIT_OPTS = {
|
|
61
57
|
network: constant_1.DEFAULT_NETWORK,
|
|
62
58
|
};
|
|
@@ -67,22 +63,21 @@ const DEFAULT_SDK_INIT_OPTS = {
|
|
|
67
63
|
*/
|
|
68
64
|
class CarbonSDK {
|
|
69
65
|
constructor(opts) {
|
|
70
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
66
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
71
67
|
this.network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
|
|
72
68
|
this.configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
|
|
73
69
|
this.networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[this.network], this.configOverride);
|
|
74
70
|
this.useTmAbciQuery = (_c = opts.useTmAbciQuery) !== null && _c !== void 0 ? _c : false;
|
|
75
|
-
this.gasFee = (_d = opts.gasFee) !== null && _d !== void 0 ? _d : GasFee_1.default.instance();
|
|
76
71
|
this.tmClient = opts.tmClient;
|
|
77
72
|
this.wallet = opts.wallet;
|
|
78
|
-
this.chainId = (
|
|
79
|
-
this.evmChainId = (
|
|
73
|
+
this.chainId = (_e = (_d = opts.chainId) !== null && _d !== void 0 ? _d : constant_1.CarbonChainIDs[this.network]) !== null && _e !== void 0 ? _e : constant_1.CarbonChainIDs[constant_1.Network.MainNet];
|
|
74
|
+
this.evmChainId = (_g = (_f = opts.evmChainId) !== null && _f !== void 0 ? _f : constant_1.CarbonEvmChainIDs[this.network]) !== null && _g !== void 0 ? _g : constant_1.CarbonEvmChainIDs[constant_1.Network.MainNet];
|
|
80
75
|
let carbonQueryClient;
|
|
81
76
|
if (!opts.query) {
|
|
82
77
|
let grpcClient;
|
|
83
78
|
if (opts.useTmAbciQuery !== true && this.networkConfig.grpcUrl) {
|
|
84
79
|
const transport = typeof window === "undefined" ? grpc_web_node_http_transport_1.NodeHttpTransport() : undefined;
|
|
85
|
-
grpcClient = (
|
|
80
|
+
grpcClient = (_h = opts.grpcQueryClient) !== null && _h !== void 0 ? _h : new GrpcQueryClient_1.default(this.networkConfig.restUrl, {
|
|
86
81
|
transport,
|
|
87
82
|
});
|
|
88
83
|
}
|
|
@@ -91,10 +86,10 @@ class CarbonSDK {
|
|
|
91
86
|
grpcClient,
|
|
92
87
|
});
|
|
93
88
|
}
|
|
94
|
-
this.query = ((
|
|
95
|
-
this.insights = (
|
|
96
|
-
this.token = (
|
|
97
|
-
this.hydrogen = (
|
|
89
|
+
this.query = ((_j = opts.query) !== null && _j !== void 0 ? _j : carbonQueryClient);
|
|
90
|
+
this.insights = (_k = opts.insights) !== null && _k !== void 0 ? _k : new clients_1.InsightsQueryClient(this.networkConfig);
|
|
91
|
+
this.token = (_l = opts.token) !== null && _l !== void 0 ? _l : clients_1.TokenClient.instance(this.query, this);
|
|
92
|
+
this.hydrogen = (_m = opts.hydrogen) !== null && _m !== void 0 ? _m : new clients_1.HydrogenClient(this.networkConfig, this.token);
|
|
98
93
|
this.admin = new modules_1.AdminModule(this);
|
|
99
94
|
this.alliance = new modules_1.AllianceModule(this);
|
|
100
95
|
this.order = new modules_1.OrderModule(this);
|
|
@@ -118,6 +113,7 @@ class CarbonSDK {
|
|
|
118
113
|
this.xchain = new modules_1.XChainModule(this);
|
|
119
114
|
this.evm = new modules_1.EvmModule(this);
|
|
120
115
|
this.evmmerge = new modules_1.EvmMergeModule(this);
|
|
116
|
+
this.feemarket = new modules_1.FeemarketModule(this);
|
|
121
117
|
this.neo = clients_1.NEOClient.instance({
|
|
122
118
|
configProvider: this,
|
|
123
119
|
blockchain: blockchain_1.Blockchain.Neo,
|
|
@@ -242,42 +238,15 @@ class CarbonSDK {
|
|
|
242
238
|
}
|
|
243
239
|
initialize() {
|
|
244
240
|
return __awaiter(this, void 0, void 0, function* () {
|
|
245
|
-
const fees = yield this.getGasFee();
|
|
246
241
|
const chainId = yield this.query.chain.getChainId();
|
|
247
242
|
this.chainId = chainId;
|
|
248
|
-
this.gasFee = fees;
|
|
249
243
|
yield this.token.initialize();
|
|
250
244
|
if (this.wallet) {
|
|
251
|
-
yield this.wallet.initialize(this.query
|
|
245
|
+
yield this.wallet.initialize(this.query);
|
|
252
246
|
}
|
|
253
247
|
return this;
|
|
254
248
|
});
|
|
255
249
|
}
|
|
256
|
-
getGasFee() {
|
|
257
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
-
const queryClient = this.query;
|
|
259
|
-
const { msgGasCosts } = yield queryClient.fee.MsgGasCostAll({
|
|
260
|
-
pagination: pagination_1.PageRequest.fromPartial({
|
|
261
|
-
limit: new long_1.default(10000),
|
|
262
|
-
}),
|
|
263
|
-
});
|
|
264
|
-
const txGasCosts = msgGasCosts.reduce((result, item) => {
|
|
265
|
-
result[item.msgType] = number_1.bnOrZero(item.gasCost);
|
|
266
|
-
return result;
|
|
267
|
-
}, {});
|
|
268
|
-
const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({
|
|
269
|
-
pagination: pagination_1.PageRequest.fromPartial({
|
|
270
|
-
limit: new long_1.default(10000),
|
|
271
|
-
}),
|
|
272
|
-
});
|
|
273
|
-
const txGasPrices = minGasPrices.reduce((result, item) => {
|
|
274
|
-
result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
|
|
275
|
-
return result;
|
|
276
|
-
}, {});
|
|
277
|
-
const fees = new GasFee_1.default(txGasCosts, txGasPrices);
|
|
278
|
-
return fees;
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
250
|
clone() {
|
|
282
251
|
return new CarbonSDK(this.generateOpts());
|
|
283
252
|
}
|
|
@@ -288,7 +257,6 @@ class CarbonSDK {
|
|
|
288
257
|
chainId: this.chainId,
|
|
289
258
|
evmChainId: this.evmChainId,
|
|
290
259
|
useTmAbciQuery: this.useTmAbciQuery,
|
|
291
|
-
gasFee: this.gasFee,
|
|
292
260
|
wallet: this.wallet,
|
|
293
261
|
tmClient: this.tmClient,
|
|
294
262
|
token: this.token,
|
|
@@ -302,8 +270,7 @@ class CarbonSDK {
|
|
|
302
270
|
if (!wallet.initialized) {
|
|
303
271
|
try {
|
|
304
272
|
// Perform initialize function as per normal, but add try-catch statement to check err message
|
|
305
|
-
|
|
306
|
-
yield wallet.initialize(this.query, fees);
|
|
273
|
+
yield wallet.initialize(this.query);
|
|
307
274
|
}
|
|
308
275
|
catch (err) {
|
|
309
276
|
const errorTyped = err;
|
|
@@ -9,7 +9,7 @@ import { QueryClientImpl as NativeBankQueryClient } from "../codec/Switcheo/carb
|
|
|
9
9
|
import { ServiceClientImpl as CosmosTmClient } from "../codec/cosmos/base/tendermint/v1beta1/query";
|
|
10
10
|
import { QueryClientImpl as DistributionQueryClient } from "../codec/cosmos/distribution/v1beta1/query";
|
|
11
11
|
import { QueryClientImpl as EvidenceQueryClient } from "../codec/cosmos/evidence/v1beta1/query";
|
|
12
|
-
import { QueryClientImpl as GovQueryClient } from "../codec/cosmos/gov/
|
|
12
|
+
import { QueryClientImpl as GovQueryClient } from "../codec/cosmos/gov/v1/query";
|
|
13
13
|
import { QueryClientImpl as GroupQueryClient } from "../codec/cosmos/group/v1/query";
|
|
14
14
|
import { QueryClientImpl as MintQueryClient } from "../codec/cosmos/mint/v1beta1/query";
|
|
15
15
|
import { QueryClientImpl as ParamsQueryClient } from "../codec/cosmos/params/v1beta1/query";
|
|
@@ -17,6 +17,8 @@ import { QueryClientImpl as SlashingQueryClient } from "../codec/cosmos/slashing
|
|
|
17
17
|
import { QueryClientImpl as StakingQueryClient } from "../codec/cosmos/staking/v1beta1/query";
|
|
18
18
|
import { QueryClientImpl as UpgradeQueryClient } from "../codec/cosmos/upgrade/v1beta1/query";
|
|
19
19
|
import { QueryClientImpl as EthermintEVMQueryClient } from "../codec/ethermint/evm/v1/query";
|
|
20
|
+
import { QueryClientImpl as GrantQueryClient } from "../codec/cosmos/authz/v1beta1/query";
|
|
21
|
+
import { QueryClientImpl as FeeGrantQueryClient } from "../codec/cosmos/feegrant/v1beta1/query";
|
|
20
22
|
import { QueryClientImpl as EvmMergeQueryClient } from "../codec/Switcheo/carbon/evmmerge/query";
|
|
21
23
|
import { QueryClientImpl as EvmBankQueryClient } from "../codec/Switcheo/carbon/evmbank/query";
|
|
22
24
|
import { QueryClientImpl as EthermintFeeMarketQueryClient } from "../codec/ethermint/feemarket/v1/query";
|
|
@@ -42,7 +44,7 @@ import { QueryClientImpl as PositionQueryClient } from "../codec/Switcheo/carbon
|
|
|
42
44
|
import { QueryClientImpl as PricingQueryClient } from "../codec/Switcheo/carbon/pricing/query";
|
|
43
45
|
import { QueryClientImpl as ProfileQueryClient } from "../codec/Switcheo/carbon/profile/query";
|
|
44
46
|
import { QueryClientImpl as SubaccountQueryClient } from "../codec/Switcheo/carbon/subaccount/query";
|
|
45
|
-
import { QueryClientImpl as AllianceClient } from "../codec/alliance/query";
|
|
47
|
+
import { QueryClientImpl as AllianceClient } from "../codec/alliance/alliance/query";
|
|
46
48
|
import { QueryClientImpl as PerpspoolQueryClient } from "../codec/Switcheo/carbon/perpspool/query";
|
|
47
49
|
import { QueryClientImpl as ERC20QueryClient } from "../codec/Switcheo/carbon/erc20/query";
|
|
48
50
|
import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
|
|
@@ -100,6 +102,8 @@ declare class CarbonQueryClient {
|
|
|
100
102
|
staking: StakingQueryClient;
|
|
101
103
|
upgrade: UpgradeQueryClient;
|
|
102
104
|
cosmosTm: CosmosTmClient;
|
|
105
|
+
grant: GrantQueryClient;
|
|
106
|
+
feegrant: FeeGrantQueryClient;
|
|
103
107
|
alliance: AllianceClient;
|
|
104
108
|
chain: BlockchainClient;
|
|
105
109
|
ibc: IBCClientGroup;
|
|
@@ -14,7 +14,7 @@ const query_8 = require("../codec/Switcheo/carbon/bank/query");
|
|
|
14
14
|
const query_9 = require("../codec/cosmos/base/tendermint/v1beta1/query");
|
|
15
15
|
const query_10 = require("../codec/cosmos/distribution/v1beta1/query");
|
|
16
16
|
const query_11 = require("../codec/cosmos/evidence/v1beta1/query");
|
|
17
|
-
const query_12 = require("../codec/cosmos/gov/
|
|
17
|
+
const query_12 = require("../codec/cosmos/gov/v1/query");
|
|
18
18
|
const query_13 = require("../codec/cosmos/group/v1/query");
|
|
19
19
|
const query_14 = require("../codec/cosmos/mint/v1beta1/query");
|
|
20
20
|
const query_15 = require("../codec/cosmos/params/v1beta1/query");
|
|
@@ -22,34 +22,36 @@ const query_16 = require("../codec/cosmos/slashing/v1beta1/query");
|
|
|
22
22
|
const query_17 = require("../codec/cosmos/staking/v1beta1/query");
|
|
23
23
|
const query_18 = require("../codec/cosmos/upgrade/v1beta1/query");
|
|
24
24
|
const query_19 = require("../codec/ethermint/evm/v1/query");
|
|
25
|
-
const query_20 = require("../codec/
|
|
26
|
-
const query_21 = require("../codec/
|
|
27
|
-
const query_22 = require("../codec/
|
|
28
|
-
const query_23 = require("../codec/Switcheo/carbon/
|
|
29
|
-
const query_24 = require("../codec/
|
|
30
|
-
const query_25 = require("../codec/
|
|
31
|
-
const query_26 = require("../codec/
|
|
32
|
-
const query_27 = require("../codec/ibc/applications/
|
|
33
|
-
const query_28 = require("../codec/ibc/
|
|
34
|
-
const query_29 = require("../codec/ibc/
|
|
35
|
-
const query_30 = require("../codec/ibc/core/
|
|
36
|
-
const query_31 = require("../codec/
|
|
37
|
-
const query_32 = require("../codec/
|
|
38
|
-
const query_33 = require("../codec/Switcheo/carbon/
|
|
39
|
-
const query_34 = require("../codec/Switcheo/carbon/
|
|
40
|
-
const query_35 = require("../codec/Switcheo/carbon/
|
|
41
|
-
const query_36 = require("../codec/Switcheo/carbon/
|
|
42
|
-
const query_37 = require("../codec/Switcheo/carbon/
|
|
43
|
-
const query_38 = require("../codec/Switcheo/carbon/
|
|
44
|
-
const query_39 = require("../codec/Switcheo/carbon/
|
|
45
|
-
const query_40 = require("../codec/Switcheo/carbon/
|
|
46
|
-
const query_41 = require("../codec/Switcheo/carbon/
|
|
47
|
-
const query_42 = require("../codec/Switcheo/carbon/
|
|
48
|
-
const query_43 = require("../codec/Switcheo/carbon/
|
|
49
|
-
const query_44 = require("../codec/Switcheo/carbon/
|
|
50
|
-
const query_45 = require("../codec/
|
|
51
|
-
const query_46 = require("../codec/Switcheo/carbon/
|
|
52
|
-
const query_47 = require("../codec/
|
|
25
|
+
const query_20 = require("../codec/cosmos/authz/v1beta1/query");
|
|
26
|
+
const query_21 = require("../codec/cosmos/feegrant/v1beta1/query");
|
|
27
|
+
const query_22 = require("../codec/Switcheo/carbon/evmmerge/query");
|
|
28
|
+
const query_23 = require("../codec/Switcheo/carbon/evmbank/query");
|
|
29
|
+
const query_24 = require("../codec/ethermint/feemarket/v1/query");
|
|
30
|
+
const query_25 = require("../codec/Switcheo/carbon/fee/query");
|
|
31
|
+
const query_26 = require("../codec/Switcheo/carbon/headersync/query");
|
|
32
|
+
const query_27 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
|
|
33
|
+
const query_28 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
|
|
34
|
+
const query_29 = require("../codec/ibc/applications/transfer/v1/query");
|
|
35
|
+
const query_30 = require("../codec/ibc/core/client/v1/query");
|
|
36
|
+
const query_31 = require("../codec/ibc/core/connection/v1/query");
|
|
37
|
+
const query_32 = require("../codec/ibc/core/channel/v1/query");
|
|
38
|
+
const query_33 = require("../codec/Switcheo/carbon/inflation/query");
|
|
39
|
+
const query_34 = require("../codec/Switcheo/carbon/insurance/query");
|
|
40
|
+
const query_35 = require("../codec/Switcheo/carbon/leverage/query");
|
|
41
|
+
const query_36 = require("../codec/Switcheo/carbon/liquidation/query");
|
|
42
|
+
const query_37 = require("../codec/Switcheo/carbon/liquiditypool/query");
|
|
43
|
+
const query_38 = require("../codec/Switcheo/carbon/market/query");
|
|
44
|
+
const query_39 = require("../codec/Switcheo/carbon/marketstats/query");
|
|
45
|
+
const query_40 = require("../codec/Switcheo/carbon/misc/query");
|
|
46
|
+
const query_41 = require("../codec/Switcheo/carbon/oracle/query");
|
|
47
|
+
const query_42 = require("../codec/Switcheo/carbon/order/query");
|
|
48
|
+
const query_43 = require("../codec/Switcheo/carbon/position/query");
|
|
49
|
+
const query_44 = require("../codec/Switcheo/carbon/pricing/query");
|
|
50
|
+
const query_45 = require("../codec/Switcheo/carbon/profile/query");
|
|
51
|
+
const query_46 = require("../codec/Switcheo/carbon/subaccount/query");
|
|
52
|
+
const query_47 = require("../codec/alliance/alliance/query");
|
|
53
|
+
const query_48 = require("../codec/Switcheo/carbon/perpspool/query");
|
|
54
|
+
const query_49 = require("../codec/Switcheo/carbon/erc20/query");
|
|
53
55
|
const stargate_1 = require("@cosmjs/stargate");
|
|
54
56
|
const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
55
57
|
class CarbonQueryClient {
|
|
@@ -58,35 +60,37 @@ class CarbonQueryClient {
|
|
|
58
60
|
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : stargate_1.createProtobufRpcClient(new stargate_1.QueryClient(opts.tmClient));
|
|
59
61
|
this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
|
|
60
62
|
this.adl = new query_1.QueryClientImpl(rpcClient);
|
|
61
|
-
this.alliance = new
|
|
63
|
+
this.alliance = new query_47.QueryClientImpl(rpcClient);
|
|
62
64
|
this.book = new query_2.QueryClientImpl(rpcClient);
|
|
63
65
|
this.broker = new query_3.QueryClientImpl(rpcClient);
|
|
64
66
|
this.coin = new query_5.QueryClientImpl(rpcClient);
|
|
65
67
|
this.cdp = new query_4.QueryClientImpl(rpcClient);
|
|
66
|
-
this.fee = new
|
|
67
|
-
this.inflation = new
|
|
68
|
-
this.insurance = new
|
|
69
|
-
this.leverage = new
|
|
70
|
-
this.liquidation = new
|
|
71
|
-
this.liquiditypool = new
|
|
72
|
-
this.market = new
|
|
73
|
-
this.marketstats = new
|
|
74
|
-
this.misc = new
|
|
75
|
-
this.oracle = new
|
|
76
|
-
this.order = new
|
|
77
|
-
this.position = new
|
|
78
|
-
this.pricing = new
|
|
79
|
-
this.profile = new
|
|
80
|
-
this.subaccount = new
|
|
81
|
-
this.headersync = new
|
|
82
|
-
this.evmmerge = new
|
|
83
|
-
this.evmbank = new
|
|
84
|
-
this.perpspool = new
|
|
68
|
+
this.fee = new query_25.QueryClientImpl(rpcClient);
|
|
69
|
+
this.inflation = new query_33.QueryClientImpl(rpcClient);
|
|
70
|
+
this.insurance = new query_34.QueryClientImpl(rpcClient);
|
|
71
|
+
this.leverage = new query_35.QueryClientImpl(rpcClient);
|
|
72
|
+
this.liquidation = new query_36.QueryClientImpl(rpcClient);
|
|
73
|
+
this.liquiditypool = new query_37.QueryClientImpl(rpcClient);
|
|
74
|
+
this.market = new query_38.QueryClientImpl(rpcClient);
|
|
75
|
+
this.marketstats = new query_39.QueryClientImpl(rpcClient);
|
|
76
|
+
this.misc = new query_40.QueryClientImpl(rpcClient);
|
|
77
|
+
this.oracle = new query_41.QueryClientImpl(rpcClient);
|
|
78
|
+
this.order = new query_42.QueryClientImpl(rpcClient);
|
|
79
|
+
this.position = new query_43.QueryClientImpl(rpcClient);
|
|
80
|
+
this.pricing = new query_44.QueryClientImpl(rpcClient);
|
|
81
|
+
this.profile = new query_45.QueryClientImpl(rpcClient);
|
|
82
|
+
this.subaccount = new query_46.QueryClientImpl(rpcClient);
|
|
83
|
+
this.headersync = new query_26.QueryClientImpl(rpcClient);
|
|
84
|
+
this.evmmerge = new query_22.QueryClientImpl(rpcClient);
|
|
85
|
+
this.evmbank = new query_23.QueryClientImpl(rpcClient);
|
|
86
|
+
this.perpspool = new query_48.QueryClientImpl(rpcClient);
|
|
85
87
|
this.auth = new query_6.QueryClientImpl(rpcClient);
|
|
86
88
|
this.bank = new query_7.QueryClientImpl(rpcClient);
|
|
87
89
|
this.nativeBank = new query_8.QueryClientImpl(rpcClient);
|
|
88
90
|
this.distribution = new query_10.QueryClientImpl(rpcClient);
|
|
89
91
|
this.evidence = new query_11.QueryClientImpl(rpcClient);
|
|
92
|
+
this.grant = new query_20.QueryClientImpl(rpcClient);
|
|
93
|
+
this.feegrant = new query_21.QueryClientImpl(rpcClient);
|
|
90
94
|
this.group = new query_13.QueryClientImpl(rpcClient);
|
|
91
95
|
this.gov = new query_12.QueryClientImpl(rpcClient);
|
|
92
96
|
this.mint = new query_14.QueryClientImpl(rpcClient);
|
|
@@ -95,19 +99,19 @@ class CarbonQueryClient {
|
|
|
95
99
|
this.staking = new query_17.QueryClientImpl(rpcClient);
|
|
96
100
|
this.upgrade = new query_18.QueryClientImpl(rpcClient);
|
|
97
101
|
this.cosmosTm = new query_9.ServiceClientImpl(rpcClient);
|
|
98
|
-
this.alliance = new
|
|
99
|
-
this.erc20 = new
|
|
102
|
+
this.alliance = new query_47.QueryClientImpl(rpcClient);
|
|
103
|
+
this.erc20 = new query_49.QueryClientImpl(rpcClient);
|
|
100
104
|
this.ibc = {
|
|
101
|
-
controller: new
|
|
102
|
-
host: new
|
|
103
|
-
transfer: new
|
|
104
|
-
client: new
|
|
105
|
-
connection: new
|
|
106
|
-
channel: new
|
|
105
|
+
controller: new query_27.QueryClientImpl(rpcClient),
|
|
106
|
+
host: new query_28.QueryClientImpl(rpcClient),
|
|
107
|
+
transfer: new query_29.QueryClientImpl(rpcClient),
|
|
108
|
+
client: new query_30.QueryClientImpl(rpcClient),
|
|
109
|
+
connection: new query_31.QueryClientImpl(rpcClient),
|
|
110
|
+
channel: new query_32.QueryClientImpl(rpcClient),
|
|
107
111
|
};
|
|
108
112
|
this.ethermint = {
|
|
109
113
|
evm: new query_19.QueryClientImpl(rpcClient),
|
|
110
|
-
feeMarket: new
|
|
114
|
+
feeMarket: new query_24.QueryClientImpl(rpcClient),
|
|
111
115
|
};
|
|
112
116
|
}
|
|
113
117
|
}
|
package/lib/clients/GasFee.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SimpleMap } from "../util/type";
|
|
2
2
|
import BigNumber from "bignumber.js";
|
|
3
3
|
declare class GasFee {
|
|
4
|
-
readonly txGasCosts
|
|
5
|
-
readonly txGasPrices
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
getFee(msgTypeUrl: string, denom?: string): BigNumber;
|
|
9
|
-
getGasPrice(denom: string): BigNumber;
|
|
4
|
+
readonly txGasCosts: SimpleMap<BigNumber>;
|
|
5
|
+
readonly txGasPrices: SimpleMap<BigNumber>;
|
|
6
|
+
readonly defaultFeeDenom: string;
|
|
7
|
+
constructor(txGasCosts: SimpleMap<BigNumber>, txGasPrices: SimpleMap<BigNumber>, defaultFeeDenom?: string);
|
|
8
|
+
getFee(msgTypeUrl: string, denom?: string): BigNumber | null;
|
|
9
|
+
getGasPrice(denom: string): BigNumber | null;
|
|
10
10
|
getGasCost(msgTypeUrl: string): BigNumber;
|
|
11
11
|
}
|
|
12
12
|
export default GasFee;
|
package/lib/clients/GasFee.js
CHANGED
|
@@ -1,38 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constant_1 = require("../constant");
|
|
3
4
|
const number_1 = require("../util/number");
|
|
4
5
|
const tx_1 = require("../util/tx");
|
|
5
|
-
const constant_1 = require("../constant");
|
|
6
6
|
class GasFee {
|
|
7
|
-
constructor(txGasCosts, txGasPrices) {
|
|
7
|
+
constructor(txGasCosts, txGasPrices, defaultFeeDenom = constant_1.DEFAULT_FEE_DENOM) {
|
|
8
8
|
this.txGasCosts = txGasCosts;
|
|
9
9
|
this.txGasPrices = txGasPrices;
|
|
10
|
-
|
|
11
|
-
static instance(txGasCosts = {}, txGasPrices = {}) {
|
|
12
|
-
return new GasFee(txGasCosts, txGasPrices);
|
|
10
|
+
this.defaultFeeDenom = defaultFeeDenom;
|
|
13
11
|
}
|
|
14
12
|
getFee(msgTypeUrl, denom = constant_1.DEFAULT_FEE_DENOM) {
|
|
15
13
|
const minGasPrice = this.getGasPrice(denom);
|
|
14
|
+
if (!minGasPrice)
|
|
15
|
+
return null;
|
|
16
16
|
const msgGasCost = this.getGasCost(msgTypeUrl);
|
|
17
17
|
return msgGasCost.times(minGasPrice);
|
|
18
18
|
}
|
|
19
19
|
getGasPrice(denom) {
|
|
20
|
-
|
|
21
|
-
if (!this.txGasPrices) {
|
|
22
|
-
console.warn("tx gas prices not initialized");
|
|
23
|
-
}
|
|
24
|
-
const gasPrice = (_a = this.txGasPrices) === null || _a === void 0 ? void 0 : _a[denom];
|
|
20
|
+
const gasPrice = this.txGasPrices[denom];
|
|
25
21
|
if (!gasPrice) {
|
|
26
|
-
console.warn("denom not supported for paying gas");
|
|
22
|
+
console.warn("denom not supported for paying gas", denom);
|
|
27
23
|
}
|
|
28
|
-
return gasPrice !== null && gasPrice !== void 0 ? gasPrice :
|
|
24
|
+
return gasPrice !== null && gasPrice !== void 0 ? gasPrice : null;
|
|
29
25
|
}
|
|
30
26
|
getGasCost(msgTypeUrl) {
|
|
31
|
-
var _a, _b
|
|
32
|
-
|
|
33
|
-
console.warn("tx gas costs not initialized");
|
|
34
|
-
}
|
|
35
|
-
return (_d = (_b = (_a = this.txGasCosts) === null || _a === void 0 ? void 0 : _a[msgTypeUrl]) !== null && _b !== void 0 ? _b : (_c = this.txGasCosts) === null || _c === void 0 ? void 0 : _c[tx_1.TxGasCostTypeDefaultKey]) !== null && _d !== void 0 ? _d : number_1.BN_ZERO;
|
|
27
|
+
var _a, _b;
|
|
28
|
+
return (_b = (_a = this.txGasCosts[msgTypeUrl]) !== null && _a !== void 0 ? _a : this.txGasCosts[tx_1.TxGasCostTypeDefaultKey]) !== null && _b !== void 0 ? _b : number_1.BN_ZERO;
|
|
36
29
|
}
|
|
37
30
|
}
|
|
38
31
|
exports.default = GasFee;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NetworkConfig } from "../constant";
|
|
2
2
|
import { Insights } from "../index";
|
|
3
|
-
import { InsightsQueryResponse } from "../insights";
|
|
4
3
|
import { APIUtils } from "../util";
|
|
5
4
|
declare class InsightsQueryClient {
|
|
6
5
|
readonly apiManager: APIUtils.APIManager<typeof Insights.InsightsEndpoints>;
|
|
@@ -19,16 +18,8 @@ declare class InsightsQueryClient {
|
|
|
19
18
|
PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
|
|
20
19
|
PoolVolume(req: Insights.QueryGetPoolVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolVolumeResponse>>;
|
|
21
20
|
PoolsVolume(req?: Insights.QueryGetPoolsVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsVolumeResponse>>;
|
|
22
|
-
UserRewardsClaimHistory(req: Insights.QueryGetUserRewardsClaimHistoryRequest): Promise<InsightsQueryResponse<Insights.QueryGetUserRewardsClaimHistoryResponse>>;
|
|
23
21
|
CompetitionList(req?: Insights.QueryGetCompetitionListRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCompetitionListResponse>>;
|
|
24
|
-
/**
|
|
25
|
-
* endpoint for legacy Demex Trading volume Competition (circa. 2021-2022). Keeping this here as endpoint has not been removed.
|
|
26
|
-
*/
|
|
27
22
|
VolumeCompetitionLeaderboard(req: Insights.QueryGetVolumeCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetVolumeCompetitionLeaderboardResponse>>;
|
|
28
|
-
/**
|
|
29
|
-
* endpoint for Perps Trading Competition on Demex (14 Nov 2023 - 28 Nov 2023).
|
|
30
|
-
*/
|
|
31
|
-
PerpsTradingCompetitionVolume(req: Insights.QueryGetPerpsCompTradingVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPerpsCompTradingVolumeResponse>>;
|
|
32
23
|
PNLCompetitionLeaderboard(req: Insights.QueryGetPNLCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPNLCompetitionLeaderboardResponse>>;
|
|
33
24
|
LotteryCompetitionLeaderboard(req: Insights.QueryGetLotteryCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLotteryCompetitionLeaderboardResponse>>;
|
|
34
25
|
LeagueCompetitionLeaderboard(req: Insights.QueryGetLeagueCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLeagueCompetitionLeaderboardResponse>>;
|
|
@@ -48,7 +39,6 @@ declare class InsightsQueryClient {
|
|
|
48
39
|
PositionStats(req: Insights.GetPositionStatsPathParams, query: Insights.GetPositionStatsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPositionStatsResponse>>;
|
|
49
40
|
DenomToGeckoIdMap(): Promise<Insights.InsightsQueryResponse<Insights.QueryDenomToGeckoIdMap>>;
|
|
50
41
|
FundingHistory(query: Insights.QueryGetFundingRateRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingRateResponse>>;
|
|
51
|
-
HistoricalFundingHistory(query: Insights.QueryGetFundingRateRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingRateResponse>>;
|
|
52
42
|
ProposalVotes(req: Insights.GetProposalVotesPathParams, query: Insights.GetProposalVotesQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetProposalVotesResponse>>;
|
|
53
43
|
Delegations(req: Insights.GetDelegationsPathParams, query: Insights.GetDelegationsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetDelegationsResponse>>;
|
|
54
44
|
OraclePrices(req?: Insights.QueryGetOraclesPriceRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetOraclesPriceResponse>>;
|
|
@@ -166,14 +166,6 @@ class InsightsQueryClient {
|
|
|
166
166
|
return response.data;
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
UserRewardsClaimHistory(req) {
|
|
170
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
-
const routeParams = { address: req.address };
|
|
172
|
-
const request = this.apiManager.path("user/pool/rewards", routeParams, req);
|
|
173
|
-
const response = yield request.get();
|
|
174
|
-
return response.data;
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
169
|
CompetitionList(req = {}) {
|
|
178
170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
179
171
|
const request = this.apiManager.path("competition/list", {}, req);
|
|
@@ -181,9 +173,6 @@ class InsightsQueryClient {
|
|
|
181
173
|
return response.data;
|
|
182
174
|
});
|
|
183
175
|
}
|
|
184
|
-
/**
|
|
185
|
-
* endpoint for legacy Demex Trading volume Competition (circa. 2021-2022). Keeping this here as endpoint has not been removed.
|
|
186
|
-
*/
|
|
187
176
|
VolumeCompetitionLeaderboard(req) {
|
|
188
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
189
178
|
const queryParams = Object.assign(Object.assign(Object.assign({ competitionId: req.competitionId }, (req.from && { from: req.from })), (req.until && { until: req.until })), (req.market && { market: req.market }));
|
|
@@ -192,17 +181,6 @@ class InsightsQueryClient {
|
|
|
192
181
|
return response.data;
|
|
193
182
|
});
|
|
194
183
|
}
|
|
195
|
-
/**
|
|
196
|
-
* endpoint for Perps Trading Competition on Demex (14 Nov 2023 - 28 Nov 2023).
|
|
197
|
-
*/
|
|
198
|
-
PerpsTradingCompetitionVolume(req) {
|
|
199
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
-
const queryParams = Object.assign({ competitionId: req.competitionId }, (req.address && { address: req.address }));
|
|
201
|
-
const request = this.apiManager.path("competition/leaderboardvolume", {}, queryParams);
|
|
202
|
-
const response = yield request.get();
|
|
203
|
-
return response.data;
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
184
|
PNLCompetitionLeaderboard(req) {
|
|
207
185
|
return __awaiter(this, void 0, void 0, function* () {
|
|
208
186
|
const queryParams = Object.assign({ competitionId: req.competitionId }, (req.market && { market: req.market }));
|
|
@@ -393,18 +371,6 @@ class InsightsQueryClient {
|
|
|
393
371
|
return response.data;
|
|
394
372
|
});
|
|
395
373
|
}
|
|
396
|
-
HistoricalFundingHistory(query) {
|
|
397
|
-
var _a, _b, _c, _d;
|
|
398
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
-
const request = this.apiManager.path("market/funding/history", {}, {
|
|
400
|
-
market: (_b = (_a = query.market) === null || _a === void 0 ? void 0 : _a.replace('%2F', '/')) !== null && _b !== void 0 ? _b : "",
|
|
401
|
-
limit: (_c = query.limit) !== null && _c !== void 0 ? _c : 100,
|
|
402
|
-
offset: (_d = query.offset) !== null && _d !== void 0 ? _d : 0,
|
|
403
|
-
});
|
|
404
|
-
const response = yield request.get();
|
|
405
|
-
return response.data;
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
374
|
ProposalVotes(req, query) {
|
|
409
375
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410
376
|
const request = this.apiManager.path("proposal/votes", req, query);
|
|
@@ -18,7 +18,6 @@ declare class TokenClient {
|
|
|
18
18
|
readonly usdValues: TypeUtils.SimpleMap<BigNumber>;
|
|
19
19
|
readonly commonAssetNames: TypeUtils.SimpleMap<string>;
|
|
20
20
|
readonly geckoTokenNames: TypeUtils.SimpleMap<string>;
|
|
21
|
-
initialUsdValuesLoaded: boolean;
|
|
22
21
|
private additionalGeckoDenoms;
|
|
23
22
|
private constructor();
|
|
24
23
|
static instance(query: CarbonQueryClient, configProvider: NetworkConfigProvider): TokenClient;
|
|
@@ -36,10 +36,6 @@ const SYMBOL_OVERRIDE = {
|
|
|
36
36
|
};
|
|
37
37
|
const regexCdpDenom = RegExp(`^${constant_1.DenomPrefix.CDPToken}/`, "i");
|
|
38
38
|
const regexLPDenom = RegExp(`^${constant_1.DenomPrefix.LPToken}/(\\d+)$`, "i");
|
|
39
|
-
const onError = (error) => {
|
|
40
|
-
console.error("failed to reload usd values");
|
|
41
|
-
console.error(error);
|
|
42
|
-
};
|
|
43
39
|
class TokenClient {
|
|
44
40
|
constructor(query, configProvider) {
|
|
45
41
|
this.query = query;
|
|
@@ -53,7 +49,6 @@ class TokenClient {
|
|
|
53
49
|
this.usdValues = {};
|
|
54
50
|
this.commonAssetNames = constant_1.CommonAssetName;
|
|
55
51
|
this.geckoTokenNames = constant_1.CoinGeckoTokenNames;
|
|
56
|
-
this.initialUsdValuesLoaded = false;
|
|
57
52
|
this.additionalGeckoDenoms = {};
|
|
58
53
|
this.getIbcChainFromBlockchainV2 = (blockchain) => {
|
|
59
54
|
const ibcBridge = this.bridges.ibc.find(bridge => (bridge.chainName === blockchain || bridge.chainName.toLowerCase() === blockchain));
|
|
@@ -75,9 +70,15 @@ class TokenClient {
|
|
|
75
70
|
}
|
|
76
71
|
finally {
|
|
77
72
|
// non-blocking reload
|
|
78
|
-
|
|
79
|
-
this.
|
|
80
|
-
|
|
73
|
+
try {
|
|
74
|
+
this.reloadDenomGeckoMap().finally(() => {
|
|
75
|
+
this.reloadUSDValues();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.error("failed to reload usd values");
|
|
80
|
+
console.error(error);
|
|
81
|
+
}
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
84
|
}
|
|
@@ -578,7 +579,6 @@ class TokenClient {
|
|
|
578
579
|
var _a, _b;
|
|
579
580
|
return __awaiter(this, void 0, void 0, function* () {
|
|
580
581
|
this.usdValues.iusd = number_1.BN_ONE;
|
|
581
|
-
this.usdValues.cgusd = number_1.BN_ONE;
|
|
582
582
|
//Get corresponding geckoId for denoms and removes any duplicated geckoIds (espeically for different wrapped tokens as they correspond to the same geckoId(same price))
|
|
583
583
|
const geckoIds = denoms.reduce((coinIds, denom) => {
|
|
584
584
|
// To ensure that ibc denoms are not added to the gecko ids list, the default is removed.
|
|
@@ -608,8 +608,6 @@ class TokenClient {
|
|
|
608
608
|
this.usdValues[denom] = denom === (uscStablecoin === null || uscStablecoin === void 0 ? void 0 : uscStablecoin.denom) ? constant_1.uscUsdValue : price;
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
if (!this.initialUsdValuesLoaded)
|
|
612
|
-
this.initialUsdValuesLoaded = true;
|
|
613
611
|
return this.usdValues;
|
|
614
612
|
});
|
|
615
613
|
}
|
|
@@ -655,12 +653,19 @@ class TokenClient {
|
|
|
655
653
|
});
|
|
656
654
|
}
|
|
657
655
|
getDenomToGeckoIdMap() {
|
|
656
|
+
var _a;
|
|
658
657
|
return __awaiter(this, void 0, void 0, function* () {
|
|
659
658
|
const networkConfig = this.configProvider.getConfig();
|
|
660
659
|
const insights = new InsightsQueryClient_1.default(networkConfig);
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
660
|
+
let tokens = {};
|
|
661
|
+
try {
|
|
662
|
+
const response = yield insights.DenomToGeckoIdMap();
|
|
663
|
+
tokens = response.result.gecko;
|
|
664
|
+
return tokens;
|
|
665
|
+
}
|
|
666
|
+
catch (err) {
|
|
667
|
+
throw new Error((_a = err.message) !== null && _a !== void 0 ? _a : "Unknown gecko query error");
|
|
668
|
+
}
|
|
664
669
|
});
|
|
665
670
|
}
|
|
666
671
|
setCommonAssetConfig() {
|