carbon-js-sdk 0.11.16 → 0.11.17
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 +4 -2
- package/lib/CarbonSDK.js +8 -8
- package/lib/clients/BatchQueryClient.js +4 -4
- package/lib/clients/CarbonQueryClient.d.ts +2 -0
- package/lib/clients/CarbonQueryClient.js +86 -84
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.d.ts +1 -0
- package/lib/clients/HydrogenClient.js +13 -4
- package/lib/clients/InsightsQueryClient.js +3 -3
- package/lib/clients/NEOClient.js +8 -12
- package/lib/clients/TokenClient.d.ts +5 -2
- package/lib/clients/TokenClient.js +66 -4
- package/lib/clients/ZILClient.js +17 -17
- package/lib/clients/index.d.ts +1 -0
- package/lib/clients/index.js +3 -1
- package/lib/codec/Switcheo/carbon/adl/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/admin/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/admin/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/admin/tx.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/bank/event.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/bank/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/bank/query.d.ts +10 -10
- package/lib/codec/Switcheo/carbon/bank/tx.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/book/book.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/book/event.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/book/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/book/legacy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/book/query.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/bridge/bridge.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/bridge/event.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/bridge/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/bridge/params.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/bridge/pending_action.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/bridge/query.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/bridge/tx.d.ts +65 -65
- package/lib/codec/Switcheo/carbon/broker/amm.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/broker/candlestick.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/broker/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/incoming_liquidations.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/pagination.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/query.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/broker/tx.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/btcx/denom_cross_chain_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/btcx/denom_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/btcx/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/btcx/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/btcx/tx.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/ccm/genesis.d.ts +9 -9
- package/lib/codec/Switcheo/carbon/ccm/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/ccm/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/ccm/tx.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/cdp/asset_params.d.ts +5 -7
- package/lib/codec/Switcheo/carbon/cdp/asset_params.js +8 -21
- package/lib/codec/Switcheo/carbon/cdp/cdp_liquidations.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/debt_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/e_mode_category.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/event.d.ts +35 -35
- package/lib/codec/Switcheo/carbon/cdp/genesis.d.ts +10 -10
- package/lib/codec/Switcheo/carbon/cdp/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/cdp/query.d.ts +55 -55
- package/lib/codec/Switcheo/carbon/cdp/rate_strategy_params.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/reward_scheme.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_debt_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_interest_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/tx.d.ts +71 -71
- package/lib/codec/Switcheo/carbon/coin/bridge.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/coin/event.d.ts +14 -14
- package/lib/codec/Switcheo/carbon/coin/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/coin/export.js +6 -2
- package/lib/codec/Switcheo/carbon/coin/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/coin/group.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/coin/proposal.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/coin/query.d.ts +47 -26
- package/lib/codec/Switcheo/carbon/coin/query.js +88 -1
- package/lib/codec/Switcheo/carbon/coin/token.d.ts +9 -9
- package/lib/codec/Switcheo/carbon/coin/tx.d.ts +72 -48
- package/lib/codec/Switcheo/carbon/coin/tx.js +125 -1
- package/lib/codec/Switcheo/carbon/erc20/erc20.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/erc20/events.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/erc20/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/erc20/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/erc20/query.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/erc20/tx.d.ts +16 -16
- package/lib/codec/Switcheo/carbon/evmbank/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/evmbank/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/evmcontract/evm_hooks.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/evmcontract/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmcontract/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/evmcontract/query.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/evmcontract/tx.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/evmmerge/address.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmmerge/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmmerge/genesis.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/evmmerge/offchain.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmmerge/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/evmmerge/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/fee/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/fee/fee.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/fee/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/fee/query.d.ts +10 -10
- package/lib/codec/Switcheo/carbon/fee/tx.d.ts +10 -10
- package/lib/codec/Switcheo/carbon/headersync/consensus_peers.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/headersync/genesis.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/headersync/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/headersync/tx.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/inflation/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/inflation/inflation.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/inflation/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/insurance/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/insurance/fund.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/insurance/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/insurance/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/insurance/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/insurance/tx.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/leverage/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/leverage/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/leverage/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/liquidation/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/quote_changes.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/liquiditypool/event.d.ts +15 -15
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/liquiditypool/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquiditypool/proposal.d.ts +11 -11
- package/lib/codec/Switcheo/carbon/liquiditypool/query.d.ts +33 -33
- package/lib/codec/Switcheo/carbon/liquiditypool/reward.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.d.ts +41 -41
- package/lib/codec/Switcheo/carbon/lockproxy/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/lockproxy/genesis.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/lockproxy/lockproxy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/lockproxy/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/lockproxy/tx.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/market/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/market/fee.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/market/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/market/market.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/market/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/market/proposal.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/market/query.d.ts +22 -22
- package/lib/codec/Switcheo/carbon/market/tx.d.ts +27 -27
- package/lib/codec/Switcheo/carbon/marketstats/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/marketstats/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/misc/block.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/message.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/message_type.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/query.d.ts +16 -16
- package/lib/codec/Switcheo/carbon/misc/trade.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/transaction.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/oracle/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/oracle/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/oracle/export.js +2 -6
- package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +4 -5
- package/lib/codec/Switcheo/carbon/oracle/genesis.js +11 -26
- package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +5 -29
- package/lib/codec/Switcheo/carbon/oracle/oracle.js +1 -152
- package/lib/codec/Switcheo/carbon/oracle/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/oracle/query.d.ts +29 -56
- package/lib/codec/Switcheo/carbon/oracle/query.js +1 -169
- package/lib/codec/Switcheo/carbon/oracle/slashing.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/oracle/tx.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/order/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/order/evm_hooks.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/order/genesis.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/order/order.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/order/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/order/query.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/order/tx.d.ts +14 -14
- package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +9 -9
- package/lib/codec/Switcheo/carbon/perpspool/genesis.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/perpspool/pool.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/perpspool/query.d.ts +20 -20
- package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/position/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/position/evm_hooks.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/position/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/position/position.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/position/query.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/position/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/pricing/event.d.ts +9 -9
- package/lib/codec/Switcheo/carbon/pricing/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/pricing/legacy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/pricing/params.d.ts +6 -4
- package/lib/codec/Switcheo/carbon/pricing/params.js +40 -0
- package/lib/codec/Switcheo/carbon/pricing/pricing.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/pricing/query.d.ts +16 -16
- package/lib/codec/Switcheo/carbon/pricing/tx.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/profile/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/profile/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/profile/profile.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/profile/query.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/profile/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/sequence/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/sequence/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/sequence/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/subaccount/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/subaccount/legacy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/subaccount/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/subaccount/query.d.ts +19 -19
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/subaccount/tx.d.ts +10 -10
- package/lib/codec/alliance/alliance/alliance.d.ts +5 -5
- package/lib/codec/alliance/alliance/delegations.d.ts +6 -6
- package/lib/codec/alliance/alliance/events.d.ts +7 -7
- package/lib/codec/alliance/alliance/genesis.d.ts +7 -7
- package/lib/codec/alliance/alliance/gov.d.ts +5 -5
- package/lib/codec/alliance/alliance/params.d.ts +4 -4
- package/lib/codec/alliance/alliance/query.d.ts +31 -31
- package/lib/codec/alliance/alliance/redelegations.d.ts +5 -5
- package/lib/codec/alliance/alliance/tx.d.ts +18 -18
- package/lib/codec/alliance/alliance/unbonding.d.ts +3 -3
- package/lib/codec/carbon-models.d.ts +1 -0
- package/lib/codec/carbon-models.js +3 -6
- package/lib/codec/cosmos/app/runtime/v1alpha1/module.d.ts +4 -4
- package/lib/codec/cosmos/app/v1alpha1/config.d.ts +5 -5
- package/lib/codec/cosmos/app/v1alpha1/module.d.ts +5 -5
- package/lib/codec/cosmos/app/v1alpha1/query.d.ts +4 -4
- package/lib/codec/cosmos/auth/module/v1/module.d.ts +4 -4
- package/lib/codec/cosmos/auth/v1beta1/auth.d.ts +6 -6
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +22 -22
- package/lib/codec/cosmos/auth/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/authz/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +6 -6
- package/lib/codec/cosmos/authz/v1beta1/event.d.ts +4 -4
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +8 -8
- package/lib/codec/cosmos/autocli/v1/options.d.ts +9 -9
- package/lib/codec/cosmos/autocli/v1/query.d.ts +5 -5
- package/lib/codec/cosmos/bank/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +3 -3
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +9 -9
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +29 -29
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +10 -10
- package/lib/codec/cosmos/base/abci/v1beta1/abci.d.ts +13 -13
- package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +6 -6
- package/lib/codec/cosmos/base/query/v1beta1/pagination.d.ts +4 -4
- package/lib/codec/cosmos/base/reflection/v1beta1/reflection.d.ts +6 -6
- package/lib/codec/cosmos/base/reflection/v2alpha1/reflection.d.ts +28 -28
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +21 -21
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.d.ts +4 -4
- package/lib/codec/cosmos/base/v1beta1/coin.d.ts +6 -6
- package/lib/codec/cosmos/circuit/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/circuit/v1/query.d.ts +8 -8
- package/lib/codec/cosmos/circuit/v1/tx.d.ts +8 -8
- package/lib/codec/cosmos/circuit/v1/types.d.ts +5 -5
- package/lib/codec/cosmos/consensus/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/consensus/v1/query.d.ts +4 -4
- package/lib/codec/cosmos/consensus/v1/tx.d.ts +4 -4
- package/lib/codec/cosmos/crisis/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/crisis/v1beta1/tx.d.ts +6 -6
- package/lib/codec/cosmos/crypto/ed25519/keys.d.ts +4 -4
- package/lib/codec/cosmos/crypto/hd/v1/hd.d.ts +3 -3
- package/lib/codec/cosmos/crypto/keyring/v1/record.d.ts +7 -7
- package/lib/codec/cosmos/crypto/multisig/keys.d.ts +3 -3
- package/lib/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts +4 -4
- package/lib/codec/cosmos/crypto/secp256k1/keys.d.ts +4 -4
- package/lib/codec/cosmos/crypto/secp256r1/keys.d.ts +4 -4
- package/lib/codec/cosmos/distribution/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +14 -14
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +10 -10
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +24 -24
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +16 -16
- package/lib/codec/cosmos/evidence/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/evidence/v1beta1/evidence.d.ts +3 -3
- package/lib/codec/cosmos/evidence/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +6 -6
- package/lib/codec/cosmos/evidence/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/feegrant/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +6 -6
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/feegrant/v1beta1/tx.d.ts +8 -8
- package/lib/codec/cosmos/genutil/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/genutil/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1/gov.d.ts +11 -11
- package/lib/codec/cosmos/gov/v1/query.d.ts +20 -20
- package/lib/codec/cosmos/gov/v1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1/tx.d.ts +16 -16
- package/lib/codec/cosmos/gov/v1/tx.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +11 -11
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +18 -18
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +10 -10
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/group/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/group/v1/events.d.ts +12 -12
- package/lib/codec/cosmos/group/v1/events.js +4 -4
- package/lib/codec/cosmos/group/v1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/group/v1/query.d.ts +30 -30
- package/lib/codec/cosmos/group/v1/tx.d.ts +30 -30
- package/lib/codec/cosmos/group/v1/tx.js +4 -4
- package/lib/codec/cosmos/group/v1/types.d.ts +13 -13
- package/lib/codec/cosmos/ics23/v1/proofs.d.ts +19 -16
- package/lib/codec/cosmos/mint/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/mint/v1beta1/mint.d.ts +4 -4
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/mint/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/nft/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/nft/v1beta1/event.d.ts +5 -5
- package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/nft/v1beta1/nft.d.ts +4 -4
- package/lib/codec/cosmos/nft/v1beta1/query.d.ts +16 -16
- package/lib/codec/cosmos/nft/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +3 -3
- package/lib/codec/cosmos/orm/query/v1alpha1/query.d.ts +9 -9
- package/lib/codec/cosmos/orm/v1/orm.d.ts +6 -6
- package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +4 -4
- package/lib/codec/cosmos/params/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/params/v1beta1/params.d.ts +4 -4
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +7 -7
- package/lib/codec/cosmos/reflection/v1/reflection.d.ts +4 -4
- package/lib/codec/cosmos/slashing/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +6 -6
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/slashing/v1beta1/slashing.d.ts +4 -4
- package/lib/codec/cosmos/slashing/v1beta1/tx.d.ts +6 -6
- package/lib/codec/cosmos/staking/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +4 -4
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +30 -30
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +23 -23
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +16 -16
- package/lib/codec/cosmos/store/internal/kv/v1beta1/kv.d.ts +4 -4
- package/lib/codec/cosmos/store/snapshots/v1/snapshot.d.ts +9 -9
- package/lib/codec/cosmos/store/streaming/abci/grpc.d.ts +6 -6
- package/lib/codec/cosmos/store/v1beta1/commit_info.d.ts +5 -5
- package/lib/codec/cosmos/store/v1beta1/listening.d.ts +4 -4
- package/lib/codec/cosmos/tx/config/v1/config.d.ts +3 -3
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +7 -7
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +20 -20
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +15 -15
- package/lib/codec/cosmos/tx/v1beta1/tx.js +4 -4
- package/lib/codec/cosmos/upgrade/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +12 -12
- package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +6 -6
- package/lib/codec/cosmos/upgrade/v1beta1/upgrade.d.ts +6 -6
- package/lib/codec/cosmos/vesting/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +8 -8
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +8 -8
- package/lib/codec/cosmos-models.js +1 -5
- package/lib/codec/ethermint/crypto/v1/ethsecp256k1/keys.d.ts +4 -4
- package/lib/codec/ethermint/evm/v1/events.d.ts +6 -6
- package/lib/codec/ethermint/evm/v1/evm.d.ts +10 -10
- package/lib/codec/ethermint/evm/v1/genesis.d.ts +4 -4
- package/lib/codec/ethermint/evm/v1/query.d.ts +26 -26
- package/lib/codec/ethermint/evm/v1/tx.d.ts +10 -10
- package/lib/codec/ethermint/feemarket/v1/events.d.ts +4 -4
- package/lib/codec/ethermint/feemarket/v1/feemarket.d.ts +3 -3
- package/lib/codec/ethermint/feemarket/v1/genesis.d.ts +3 -3
- package/lib/codec/ethermint/feemarket/v1/query.d.ts +8 -8
- package/lib/codec/ethermint/feemarket/v1/tx.d.ts +4 -4
- package/lib/codec/ethermint/types/v1/account.d.ts +3 -3
- package/lib/codec/ethermint/types/v1/dynamic_fee.d.ts +3 -3
- package/lib/codec/ethermint/types/v1/indexer.d.ts +3 -3
- package/lib/codec/ethermint/types/v1/web3.d.ts +3 -3
- package/lib/codec/ethermint-models.js +1 -5
- package/lib/codec/google/protobuf/any.d.ts +3 -3
- package/lib/codec/google/protobuf/descriptor.d.ts +34 -34
- package/lib/codec/google/protobuf/duration.d.ts +3 -3
- package/lib/codec/google/protobuf/empty.d.ts +3 -3
- package/lib/codec/google/protobuf/timestamp.d.ts +3 -3
- package/lib/codec/google/protobuf/wrappers.d.ts +11 -11
- package/lib/codec/ibc/applications/fee/v1/ack.d.ts +3 -3
- package/lib/codec/ibc/applications/fee/v1/fee.d.ts +6 -6
- package/lib/codec/ibc/applications/fee/v1/genesis.d.ts +7 -7
- package/lib/codec/ibc/applications/fee/v1/metadata.d.ts +3 -3
- package/lib/codec/ibc/applications/fee/v1/query.d.ts +22 -22
- package/lib/codec/ibc/applications/fee/v1/tx.d.ts +10 -10
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/controller.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/query.d.ts +6 -6
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +8 -8
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.js +2 -2
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +7 -7
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/host.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/query.d.ts +4 -4
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/tx.d.ts +4 -4
- package/lib/codec/ibc/applications/interchain_accounts/v1/account.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/v1/metadata.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/v1/packet.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/authz.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/genesis.d.ts +3 -3
- package/lib/codec/ibc/applications/transfer/v1/query.d.ts +14 -14
- package/lib/codec/ibc/applications/transfer/v1/transfer.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/tx.d.ts +6 -6
- package/lib/codec/ibc/applications/transfer/v2/packet.d.ts +3 -3
- package/lib/codec/ibc/core/channel/v1/channel.d.ts +11 -11
- package/lib/codec/ibc/core/channel/v1/genesis.d.ts +4 -4
- package/lib/codec/ibc/core/channel/v1/query.d.ts +36 -36
- package/lib/codec/ibc/core/channel/v1/tx.d.ts +40 -40
- package/lib/codec/ibc/core/channel/v1/tx.js +4 -4
- package/lib/codec/ibc/core/channel/v1/upgrade.d.ts +5 -5
- package/lib/codec/ibc/core/channel/v1/upgrade.js +2 -2
- package/lib/codec/ibc/core/client/v1/client.d.ts +9 -9
- package/lib/codec/ibc/core/client/v1/genesis.d.ts +5 -5
- package/lib/codec/ibc/core/client/v1/query.d.ts +20 -20
- package/lib/codec/ibc/core/client/v1/tx.d.ts +16 -16
- package/lib/codec/ibc/core/commitment/v1/commitment.d.ts +6 -6
- package/lib/codec/ibc/core/connection/v1/connection.d.ts +9 -9
- package/lib/codec/ibc/core/connection/v1/genesis.d.ts +3 -3
- package/lib/codec/ibc/core/connection/v1/query.d.ts +14 -14
- package/lib/codec/ibc/core/connection/v1/tx.d.ts +12 -12
- package/lib/codec/ibc/core/types/v1/genesis.d.ts +3 -3
- package/lib/codec/ibc/lightclients/localhost/v2/localhost.d.ts +3 -3
- package/lib/codec/ibc/lightclients/solomachine/v2/solomachine.d.ts +18 -18
- package/lib/codec/ibc/lightclients/solomachine/v3/solomachine.d.ts +10 -10
- package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.d.ts +7 -7
- package/lib/codec/ibc/lightclients/wasm/v1/genesis.d.ts +4 -4
- package/lib/codec/ibc/lightclients/wasm/v1/query.d.ts +6 -6
- package/lib/codec/ibc/lightclients/wasm/v1/tx.d.ts +8 -8
- package/lib/codec/ibc/lightclients/wasm/v1/wasm.d.ts +6 -6
- package/lib/codec/ibc-models.js +1 -5
- package/lib/codec/index.d.ts +64 -0
- package/lib/codec/index.js +1650 -223
- package/lib/codec/oraclesvc/query.js +1 -1
- package/lib/codec/polynetwork-models.js +1 -5
- package/lib/codec/tendermint/abci/types.d.ts +49 -49
- package/lib/codec/tendermint/abci/types.js +4 -4
- package/lib/codec/tendermint/crypto/keys.d.ts +3 -3
- package/lib/codec/tendermint/crypto/proof.d.ts +7 -7
- package/lib/codec/tendermint/libs/bits/types.d.ts +3 -3
- package/lib/codec/tendermint/oracle/types.d.ts +8 -8
- package/lib/codec/tendermint/p2p/types.d.ts +6 -6
- package/lib/codec/tendermint/types/block.d.ts +3 -3
- package/lib/codec/tendermint/types/evidence.d.ts +6 -6
- package/lib/codec/tendermint/types/params.d.ts +9 -9
- package/lib/codec/tendermint/types/types.d.ts +17 -17
- package/lib/codec/tendermint/types/types.js +4 -4
- package/lib/codec/tendermint/types/validator.d.ts +5 -5
- package/lib/codec/tendermint/version/types.d.ts +4 -4
- package/lib/constant/address.d.ts +1 -1
- package/lib/constant/eip6963Provider.d.ts +1 -1
- package/lib/constant/generic.d.ts +1 -1
- package/lib/constant/generic.js +1 -1
- package/lib/constant/ibc.d.ts +3 -3
- package/lib/constant/ibc.js +1 -5
- package/lib/constant/index.js +1 -5
- package/lib/constant/network.d.ts +4 -0
- package/lib/constant/network.js +23 -0
- package/lib/constant/node.d.ts +1 -1
- package/lib/constant/web3Config.d.ts +2 -0
- package/lib/constant/web3Config.js +34 -13
- package/lib/eth/abis/index.d.ts +2 -1
- package/lib/eth/abis/index.js +3 -1
- package/lib/eth/index.js +1 -5
- package/lib/hydrogen/index.js +1 -5
- package/lib/hydrogen/transfer.d.ts +3 -2
- package/lib/index.js +1 -5
- package/lib/insights/common.d.ts +1 -1
- package/lib/insights/index.js +1 -5
- package/lib/insights/position.d.ts +1 -1
- package/lib/modules/admin.js +0 -1
- package/lib/modules/alliance.js +1 -1
- package/lib/modules/cdp.js +46 -46
- package/lib/modules/cosmwasm.js +2 -2
- package/lib/modules/evm.d.ts +1 -1
- package/lib/modules/evm.js +6 -6
- package/lib/modules/gov.js +1 -1
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -5
- package/lib/modules/liquiditypool.js +1 -1
- package/lib/modules/order.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/index.js +1 -5
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.d.ts +1 -1
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +4 -8
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/index.js +1 -5
- package/lib/provider/account/index.js +1 -5
- package/lib/provider/amino/AminoTypesMap.js +1 -1
- package/lib/provider/amino/types/admin.js +28 -32
- package/lib/provider/amino/types/bank.js +2 -6
- package/lib/provider/amino/types/bridge.js +2 -6
- package/lib/provider/amino/types/broker.js +2 -6
- package/lib/provider/amino/types/cdp.js +22 -26
- package/lib/provider/amino/types/coin.js +5 -9
- package/lib/provider/amino/types/erc20.js +3 -7
- package/lib/provider/amino/types/evm.js +2 -6
- package/lib/provider/amino/types/evmmerge.js +2 -6
- package/lib/provider/amino/types/feemarket.js +2 -6
- package/lib/provider/amino/types/gov.js +5 -9
- package/lib/provider/amino/types/grant.js +10 -14
- package/lib/provider/amino/types/ibc.js +2 -6
- package/lib/provider/amino/types/index.d.ts +1 -0
- package/lib/provider/amino/types/index.js +3 -1
- package/lib/provider/amino/types/leverage.js +2 -6
- package/lib/provider/amino/types/liquidityPool.js +8 -12
- package/lib/provider/amino/types/market.js +7 -11
- package/lib/provider/amino/types/order.js +5 -9
- package/lib/provider/amino/types/perpspool.js +7 -11
- package/lib/provider/amino/types/position.js +2 -6
- package/lib/provider/amino/types/profile.js +2 -6
- package/lib/provider/amino/types/staking.js +5 -9
- package/lib/provider/amino/types/subaccount.js +4 -8
- package/lib/provider/amino/utils.d.ts +4 -2
- package/lib/provider/amino/utils.js +29 -20
- package/lib/provider/keplr/KeplrAccount.js +7 -7
- package/lib/provider/leap/LeapAccount.js +7 -7
- package/lib/provider/ledger/ledger.js +6 -9
- package/lib/provider/metamask/MetaMask.js +36 -25
- package/lib/provider/metamask/error.d.ts +1 -1
- package/lib/provider/o3/O3Types.d.ts +1 -1
- package/lib/provider/o3/O3Wallet.js +11 -15
- package/lib/provider/o3/index.js +1 -5
- package/lib/provider/rainbowKit/RainbowKitAccount.js +16 -16
- package/lib/provider/zilpay/Zilpay.js +4 -4
- package/lib/provider/zilpay/index.js +1 -5
- package/lib/util/address.d.ts +5 -5
- package/lib/util/address.js +15 -19
- package/lib/util/alliance.d.ts +1 -1
- package/lib/util/api.d.ts +3 -3
- package/lib/util/api.js +4 -4
- package/lib/util/blockchain.d.ts +22 -13
- package/lib/util/blockchain.js +50 -8
- package/lib/util/eip712.js +3 -3
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.d.ts +2 -3
- package/lib/util/generic.js +3 -3
- package/lib/util/gov.d.ts +1 -1
- package/lib/util/grant.d.ts +1 -1
- package/lib/util/grant.js +1 -1
- package/lib/util/index.js +1 -5
- package/lib/util/legacyEIP712.d.ts +2 -2
- package/lib/util/legacyEIP712.js +2 -2
- package/lib/util/network.js +3 -3
- package/lib/util/number.d.ts +4 -4
- package/lib/util/number.js +5 -5
- package/lib/util/tx.d.ts +67 -3
- package/lib/util/tx.js +2 -6
- package/lib/util/type.d.ts +1 -1
- package/lib/wallet/CarbonSigner.d.ts +5 -5
- package/lib/wallet/CarbonSigner.js +10 -10
- package/lib/wallet/CarbonSigningClient.js +16 -16
- package/lib/wallet/CarbonWallet.d.ts +1 -1
- package/lib/wallet/CarbonWallet.js +10 -12
- package/lib/wallet/index.js +1 -5
- package/lib/websocket/connector.js +4 -8
- package/lib/websocket/index.js +1 -5
- package/lib/websocket/types.d.ts +1 -1
- package/package.json +2 -2
package/lib/CarbonSDK.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { Network, NetworkConfig, Network as _Network } from "./constant";
|
|
3
3
|
import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
|
|
4
4
|
import * as clients from "./clients";
|
|
5
|
-
import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
|
|
5
|
+
import { CarbonQueryClient, AxelarBridgeClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
|
|
6
6
|
import GasFee from "./clients/GasFee";
|
|
7
7
|
import GrpcQueryClient from "./clients/GrpcQueryClient";
|
|
8
8
|
import N3Client from "./clients/N3Client";
|
|
9
|
-
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";
|
|
9
|
+
import { AdminModule, AllianceModule, BankModule, BridgeModule, BrokerModule, CDPModule, CoinModule, ERC20Module, EvmMergeModule, EvmModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
|
|
10
10
|
import { GrantModule } from "./modules/grant";
|
|
11
11
|
import { StakingModule } from "./modules/staking";
|
|
12
12
|
import { CosmosLedger, Keplr, LeapExtended } from "./provider";
|
|
@@ -95,12 +95,14 @@ declare class CarbonSDK {
|
|
|
95
95
|
xchain: XChainModule;
|
|
96
96
|
evm: EvmModule;
|
|
97
97
|
evmmerge: EvmMergeModule;
|
|
98
|
+
bridge: BridgeModule;
|
|
98
99
|
neo: NEOClient;
|
|
99
100
|
eth: ETHClient;
|
|
100
101
|
bsc: ETHClient;
|
|
101
102
|
arbitrum: ETHClient;
|
|
102
103
|
polygon: ETHClient;
|
|
103
104
|
okc: ETHClient;
|
|
105
|
+
axelarBridgeClient: AxelarBridgeClient;
|
|
104
106
|
zil: ZILClient;
|
|
105
107
|
n3: N3Client;
|
|
106
108
|
chainId: string;
|
package/lib/CarbonSDK.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
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);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -82,7 +78,7 @@ class CarbonSDK {
|
|
|
82
78
|
if (!opts.query) {
|
|
83
79
|
let grpcClient;
|
|
84
80
|
if (opts.useTmAbciQuery !== true && this.networkConfig.grpcUrl) {
|
|
85
|
-
const transport = typeof window === "undefined" ?
|
|
81
|
+
const transport = typeof window === "undefined" ? grpc_web_node_http_transport_1.NodeHttpTransport() : undefined;
|
|
86
82
|
grpcClient = (_h = opts.grpcQueryClient) !== null && _h !== void 0 ? _h : new GrpcQueryClient_1.default(this.networkConfig.restUrl, {
|
|
87
83
|
transport,
|
|
88
84
|
});
|
|
@@ -120,6 +116,7 @@ class CarbonSDK {
|
|
|
120
116
|
this.xchain = new modules_1.XChainModule(this);
|
|
121
117
|
this.evm = new modules_1.EvmModule(this);
|
|
122
118
|
this.evmmerge = new modules_1.EvmMergeModule(this);
|
|
119
|
+
this.bridge = new modules_1.BridgeModule(this);
|
|
123
120
|
this.neo = clients_1.NEOClient.instance({
|
|
124
121
|
configProvider: this,
|
|
125
122
|
blockchain: blockchain_1.Blockchain.Neo,
|
|
@@ -157,6 +154,9 @@ class CarbonSDK {
|
|
|
157
154
|
blockchain: blockchain_1.Blockchain.Okc,
|
|
158
155
|
tokenClient: this.token,
|
|
159
156
|
});
|
|
157
|
+
this.axelarBridgeClient = clients_1.AxelarBridgeClient.instance({
|
|
158
|
+
configProvider: this,
|
|
159
|
+
});
|
|
160
160
|
}
|
|
161
161
|
static instance(opts = DEFAULT_SDK_INIT_OPTS) {
|
|
162
162
|
var _a, _b, _c, _d;
|
|
@@ -270,14 +270,14 @@ class CarbonSDK {
|
|
|
270
270
|
pagination: constant_1.PAGINATE_10K,
|
|
271
271
|
});
|
|
272
272
|
const txGasCosts = msgGasCosts.reduce((result, item) => {
|
|
273
|
-
result[item.msgType] =
|
|
273
|
+
result[item.msgType] = number_1.bnOrZero(item.gasCost);
|
|
274
274
|
return result;
|
|
275
275
|
}, {});
|
|
276
276
|
const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({
|
|
277
277
|
pagination: constant_1.PAGINATE_10K,
|
|
278
278
|
});
|
|
279
279
|
const txGasPrices = minGasPrices.reduce((result, item) => {
|
|
280
|
-
result[item.denom] =
|
|
280
|
+
result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
|
|
281
281
|
return result;
|
|
282
282
|
}, {});
|
|
283
283
|
return new GasFee_1.default(txGasCosts, txGasPrices);
|
|
@@ -29,7 +29,7 @@ class BatchQueryClient {
|
|
|
29
29
|
};
|
|
30
30
|
if (typeof endpoint === "string") {
|
|
31
31
|
// accept host.name:port and assume http protocol
|
|
32
|
-
this.url =
|
|
32
|
+
this.url = rpcclient_1.hasProtocol(endpoint) ? endpoint : "http://" + endpoint;
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
this.url = endpoint.url;
|
|
@@ -71,7 +71,7 @@ class BatchQueryClient {
|
|
|
71
71
|
return;
|
|
72
72
|
const requests = batch.map((s) => s.request);
|
|
73
73
|
const requestIds = requests.map((request) => request.id);
|
|
74
|
-
|
|
74
|
+
http_1.http("POST", this.url, this.headers, requests).then((raw) => {
|
|
75
75
|
// Requests with a single entry return as an object
|
|
76
76
|
const arr = Array.isArray(raw) ? raw : [raw];
|
|
77
77
|
arr.forEach((el, i) => {
|
|
@@ -79,8 +79,8 @@ class BatchQueryClient {
|
|
|
79
79
|
if (!req)
|
|
80
80
|
return;
|
|
81
81
|
const { reject, resolve } = req;
|
|
82
|
-
const response =
|
|
83
|
-
if (
|
|
82
|
+
const response = json_rpc_1.parseJsonRpcResponse(el);
|
|
83
|
+
if (json_rpc_1.isJsonRpcErrorResponse(response)) {
|
|
84
84
|
reject(new Error(JSON.stringify(response.error)));
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
@@ -6,6 +6,7 @@ import { QueryClientImpl as CoinQueryClient } from "../codec/Switcheo/carbon/coi
|
|
|
6
6
|
import { QueryClientImpl as AuthQueryClient } from "../codec/cosmos/auth/v1beta1/query";
|
|
7
7
|
import { QueryClientImpl as BankQueryClient } from "../codec/cosmos/bank/v1beta1/query";
|
|
8
8
|
import { QueryClientImpl as NativeBankQueryClient } from "../codec/Switcheo/carbon/bank/query";
|
|
9
|
+
import { QueryClientImpl as BridgeQueryClient } from "../codec/Switcheo/carbon/bridge/query";
|
|
9
10
|
import { ServiceClientImpl as CosmosTmClient } from "../codec/cosmos/base/tendermint/v1beta1/query";
|
|
10
11
|
import { QueryClientImpl as DistributionQueryClient } from "../codec/cosmos/distribution/v1beta1/query";
|
|
11
12
|
import { QueryClientImpl as EvidenceQueryClient } from "../codec/cosmos/evidence/v1beta1/query";
|
|
@@ -69,6 +70,7 @@ export interface CarbonQueryClientOpts {
|
|
|
69
70
|
declare class CarbonQueryClient {
|
|
70
71
|
adl: ADLQueryClient;
|
|
71
72
|
book: BookQueryClient;
|
|
73
|
+
bridge: BridgeQueryClient;
|
|
72
74
|
broker: BrokerQueryClient;
|
|
73
75
|
coin: CoinQueryClient;
|
|
74
76
|
cdp: CDPQueryClient;
|
|
@@ -11,107 +11,109 @@ const query_5 = require("../codec/Switcheo/carbon/coin/query");
|
|
|
11
11
|
const query_6 = require("../codec/cosmos/auth/v1beta1/query");
|
|
12
12
|
const query_7 = require("../codec/cosmos/bank/v1beta1/query");
|
|
13
13
|
const query_8 = require("../codec/Switcheo/carbon/bank/query");
|
|
14
|
-
const query_9 = require("../codec/
|
|
15
|
-
const query_10 = require("../codec/cosmos/
|
|
16
|
-
const query_11 = require("../codec/cosmos/
|
|
17
|
-
const query_12 = require("../codec/cosmos/
|
|
18
|
-
const query_13 = require("../codec/cosmos/
|
|
19
|
-
const query_14 = require("../codec/cosmos/
|
|
20
|
-
const query_15 = require("../codec/cosmos/
|
|
21
|
-
const query_16 = require("../codec/cosmos/
|
|
22
|
-
const query_17 = require("../codec/cosmos/
|
|
23
|
-
const query_18 = require("../codec/cosmos/
|
|
24
|
-
const query_19 = require("../codec/
|
|
25
|
-
const query_20 = require("../codec/
|
|
26
|
-
const query_21 = require("../codec/cosmos/
|
|
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/Switcheo/carbon/
|
|
32
|
-
const query_27 = require("../codec/
|
|
33
|
-
const query_28 = require("../codec/ibc/applications/interchain_accounts/
|
|
34
|
-
const query_29 = require("../codec/ibc/applications/
|
|
35
|
-
const query_30 = require("../codec/ibc/
|
|
36
|
-
const query_31 = require("../codec/ibc/core/
|
|
37
|
-
const query_32 = require("../codec/ibc/core/
|
|
38
|
-
const query_33 = require("../codec/
|
|
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/Switcheo/carbon/
|
|
51
|
-
const query_46 = require("../codec/Switcheo/carbon/
|
|
52
|
-
const query_47 = require("../codec/
|
|
53
|
-
const query_48 = require("../codec/
|
|
54
|
-
const query_49 = require("../codec/Switcheo/carbon/
|
|
14
|
+
const query_9 = require("../codec/Switcheo/carbon/bridge/query");
|
|
15
|
+
const query_10 = require("../codec/cosmos/base/tendermint/v1beta1/query");
|
|
16
|
+
const query_11 = require("../codec/cosmos/distribution/v1beta1/query");
|
|
17
|
+
const query_12 = require("../codec/cosmos/evidence/v1beta1/query");
|
|
18
|
+
const query_13 = require("../codec/cosmos/gov/v1/query");
|
|
19
|
+
const query_14 = require("../codec/cosmos/group/v1/query");
|
|
20
|
+
const query_15 = require("../codec/cosmos/mint/v1beta1/query");
|
|
21
|
+
const query_16 = require("../codec/cosmos/params/v1beta1/query");
|
|
22
|
+
const query_17 = require("../codec/cosmos/slashing/v1beta1/query");
|
|
23
|
+
const query_18 = require("../codec/cosmos/staking/v1beta1/query");
|
|
24
|
+
const query_19 = require("../codec/cosmos/upgrade/v1beta1/query");
|
|
25
|
+
const query_20 = require("../codec/ethermint/evm/v1/query");
|
|
26
|
+
const query_21 = require("../codec/cosmos/authz/v1beta1/query");
|
|
27
|
+
const query_22 = require("../codec/cosmos/feegrant/v1beta1/query");
|
|
28
|
+
const query_23 = require("../codec/Switcheo/carbon/evmmerge/query");
|
|
29
|
+
const query_24 = require("../codec/Switcheo/carbon/evmbank/query");
|
|
30
|
+
const query_25 = require("../codec/ethermint/feemarket/v1/query");
|
|
31
|
+
const query_26 = require("../codec/Switcheo/carbon/fee/query");
|
|
32
|
+
const query_27 = require("../codec/Switcheo/carbon/headersync/query");
|
|
33
|
+
const query_28 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
|
|
34
|
+
const query_29 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
|
|
35
|
+
const query_30 = require("../codec/ibc/applications/transfer/v1/query");
|
|
36
|
+
const query_31 = require("../codec/ibc/core/client/v1/query");
|
|
37
|
+
const query_32 = require("../codec/ibc/core/connection/v1/query");
|
|
38
|
+
const query_33 = require("../codec/ibc/core/channel/v1/query");
|
|
39
|
+
const query_34 = require("../codec/Switcheo/carbon/inflation/query");
|
|
40
|
+
const query_35 = require("../codec/Switcheo/carbon/insurance/query");
|
|
41
|
+
const query_36 = require("../codec/Switcheo/carbon/leverage/query");
|
|
42
|
+
const query_37 = require("../codec/Switcheo/carbon/liquidation/query");
|
|
43
|
+
const query_38 = require("../codec/Switcheo/carbon/liquiditypool/query");
|
|
44
|
+
const query_39 = require("../codec/Switcheo/carbon/market/query");
|
|
45
|
+
const query_40 = require("../codec/Switcheo/carbon/marketstats/query");
|
|
46
|
+
const query_41 = require("../codec/Switcheo/carbon/misc/query");
|
|
47
|
+
const query_42 = require("../codec/Switcheo/carbon/oracle/query");
|
|
48
|
+
const query_43 = require("../codec/Switcheo/carbon/order/query");
|
|
49
|
+
const query_44 = require("../codec/Switcheo/carbon/position/query");
|
|
50
|
+
const query_45 = require("../codec/Switcheo/carbon/pricing/query");
|
|
51
|
+
const query_46 = require("../codec/Switcheo/carbon/profile/query");
|
|
52
|
+
const query_47 = require("../codec/Switcheo/carbon/subaccount/query");
|
|
53
|
+
const query_48 = require("../codec/alliance/alliance/query");
|
|
54
|
+
const query_49 = require("../codec/Switcheo/carbon/perpspool/query");
|
|
55
|
+
const query_50 = require("../codec/Switcheo/carbon/erc20/query");
|
|
55
56
|
const stargate_1 = require("@cosmjs/stargate");
|
|
56
57
|
const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
57
58
|
class CarbonQueryClient {
|
|
58
59
|
constructor(opts) {
|
|
59
60
|
var _a;
|
|
60
|
-
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a :
|
|
61
|
+
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : stargate_1.createProtobufRpcClient(new stargate_1.QueryClient(opts.tmClient));
|
|
61
62
|
this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
|
|
62
63
|
this.adl = new query_1.QueryClientImpl(rpcClient);
|
|
63
|
-
this.alliance = new
|
|
64
|
+
this.alliance = new query_48.QueryClientImpl(rpcClient);
|
|
64
65
|
this.book = new query_2.QueryClientImpl(rpcClient);
|
|
66
|
+
this.bridge = new query_9.QueryClientImpl(rpcClient);
|
|
65
67
|
this.broker = new query_3.QueryClientImpl(rpcClient);
|
|
66
68
|
this.coin = new query_5.QueryClientImpl(rpcClient);
|
|
67
69
|
this.cdp = new query_4.QueryClientImpl(rpcClient);
|
|
68
|
-
this.fee = new
|
|
69
|
-
this.inflation = new
|
|
70
|
-
this.insurance = new
|
|
71
|
-
this.leverage = new
|
|
72
|
-
this.liquidation = new
|
|
73
|
-
this.liquiditypool = new
|
|
74
|
-
this.market = new
|
|
75
|
-
this.marketstats = new
|
|
76
|
-
this.misc = new
|
|
77
|
-
this.oracle = new
|
|
78
|
-
this.order = new
|
|
79
|
-
this.position = new
|
|
80
|
-
this.pricing = new
|
|
81
|
-
this.profile = new
|
|
82
|
-
this.subaccount = new
|
|
83
|
-
this.headersync = new
|
|
84
|
-
this.evmmerge = new
|
|
85
|
-
this.evmbank = new
|
|
86
|
-
this.perpspool = new
|
|
70
|
+
this.fee = new query_26.QueryClientImpl(rpcClient);
|
|
71
|
+
this.inflation = new query_34.QueryClientImpl(rpcClient);
|
|
72
|
+
this.insurance = new query_35.QueryClientImpl(rpcClient);
|
|
73
|
+
this.leverage = new query_36.QueryClientImpl(rpcClient);
|
|
74
|
+
this.liquidation = new query_37.QueryClientImpl(rpcClient);
|
|
75
|
+
this.liquiditypool = new query_38.QueryClientImpl(rpcClient);
|
|
76
|
+
this.market = new query_39.QueryClientImpl(rpcClient);
|
|
77
|
+
this.marketstats = new query_40.QueryClientImpl(rpcClient);
|
|
78
|
+
this.misc = new query_41.QueryClientImpl(rpcClient);
|
|
79
|
+
this.oracle = new query_42.QueryClientImpl(rpcClient);
|
|
80
|
+
this.order = new query_43.QueryClientImpl(rpcClient);
|
|
81
|
+
this.position = new query_44.QueryClientImpl(rpcClient);
|
|
82
|
+
this.pricing = new query_45.QueryClientImpl(rpcClient);
|
|
83
|
+
this.profile = new query_46.QueryClientImpl(rpcClient);
|
|
84
|
+
this.subaccount = new query_47.QueryClientImpl(rpcClient);
|
|
85
|
+
this.headersync = new query_27.QueryClientImpl(rpcClient);
|
|
86
|
+
this.evmmerge = new query_23.QueryClientImpl(rpcClient);
|
|
87
|
+
this.evmbank = new query_24.QueryClientImpl(rpcClient);
|
|
88
|
+
this.perpspool = new query_49.QueryClientImpl(rpcClient);
|
|
87
89
|
this.auth = new query_6.QueryClientImpl(rpcClient);
|
|
88
90
|
this.bank = new query_7.QueryClientImpl(rpcClient);
|
|
89
91
|
this.nativeBank = new query_8.QueryClientImpl(rpcClient);
|
|
90
|
-
this.distribution = new
|
|
91
|
-
this.evidence = new
|
|
92
|
-
this.grant = new
|
|
93
|
-
this.feegrant = new
|
|
94
|
-
this.group = new
|
|
95
|
-
this.gov = new
|
|
96
|
-
this.mint = new
|
|
97
|
-
this.params = new
|
|
98
|
-
this.slashing = new
|
|
99
|
-
this.staking = new
|
|
100
|
-
this.upgrade = new
|
|
101
|
-
this.cosmosTm = new
|
|
102
|
-
this.alliance = new
|
|
103
|
-
this.erc20 = new
|
|
92
|
+
this.distribution = new query_11.QueryClientImpl(rpcClient);
|
|
93
|
+
this.evidence = new query_12.QueryClientImpl(rpcClient);
|
|
94
|
+
this.grant = new query_21.QueryClientImpl(rpcClient);
|
|
95
|
+
this.feegrant = new query_22.QueryClientImpl(rpcClient);
|
|
96
|
+
this.group = new query_14.QueryClientImpl(rpcClient);
|
|
97
|
+
this.gov = new query_13.QueryClientImpl(rpcClient);
|
|
98
|
+
this.mint = new query_15.QueryClientImpl(rpcClient);
|
|
99
|
+
this.params = new query_16.QueryClientImpl(rpcClient);
|
|
100
|
+
this.slashing = new query_17.QueryClientImpl(rpcClient);
|
|
101
|
+
this.staking = new query_18.QueryClientImpl(rpcClient);
|
|
102
|
+
this.upgrade = new query_19.QueryClientImpl(rpcClient);
|
|
103
|
+
this.cosmosTm = new query_10.ServiceClientImpl(rpcClient);
|
|
104
|
+
this.alliance = new query_48.QueryClientImpl(rpcClient);
|
|
105
|
+
this.erc20 = new query_50.QueryClientImpl(rpcClient);
|
|
104
106
|
this.ibc = {
|
|
105
|
-
controller: new
|
|
106
|
-
host: new
|
|
107
|
-
transfer: new
|
|
108
|
-
client: new
|
|
109
|
-
connection: new
|
|
110
|
-
channel: new
|
|
107
|
+
controller: new query_28.QueryClientImpl(rpcClient),
|
|
108
|
+
host: new query_29.QueryClientImpl(rpcClient),
|
|
109
|
+
transfer: new query_30.QueryClientImpl(rpcClient),
|
|
110
|
+
client: new query_31.QueryClientImpl(rpcClient),
|
|
111
|
+
connection: new query_32.QueryClientImpl(rpcClient),
|
|
112
|
+
channel: new query_33.QueryClientImpl(rpcClient),
|
|
111
113
|
};
|
|
112
114
|
this.ethermint = {
|
|
113
|
-
evm: new
|
|
114
|
-
feeMarket: new
|
|
115
|
+
evm: new query_20.QueryClientImpl(rpcClient),
|
|
116
|
+
feeMarket: new query_25.QueryClientImpl(rpcClient),
|
|
115
117
|
};
|
|
116
118
|
}
|
|
117
119
|
}
|
package/lib/clients/ETHClient.js
CHANGED
|
@@ -44,15 +44,15 @@ class ETHClient {
|
|
|
44
44
|
?
|
|
45
45
|
this.tokenClient.getBlockchainV2(token.denom) == ETHClient.BLOCKCHAINV2_MAPPING[this.blockchain]
|
|
46
46
|
:
|
|
47
|
-
|
|
47
|
+
blockchain_1.blockchainForChainId(token.chainId.toNumber(), api.network) == this.blockchain;
|
|
48
48
|
return isCorrectBlockchain &&
|
|
49
49
|
token.tokenAddress.length == 40 &&
|
|
50
|
-
token.bridgeAddress.toLowerCase() ==
|
|
50
|
+
token.bridgeAddress.toLowerCase() == generic_1.stripHexPrefix(lockProxyAddress) &&
|
|
51
51
|
(!whitelistDenoms || whitelistDenoms.includes(token.denom)) &&
|
|
52
|
-
this.verifyChecksum(
|
|
52
|
+
this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
53
53
|
});
|
|
54
54
|
const assetIds = tokens.map((token) => {
|
|
55
|
-
return this.verifyChecksum(
|
|
55
|
+
return this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
56
56
|
});
|
|
57
57
|
const provider = this.getProvider();
|
|
58
58
|
const contractAddress = this.getBalanceReaderAddress();
|
|
@@ -101,14 +101,14 @@ class ETHClient {
|
|
|
101
101
|
}
|
|
102
102
|
const carbonNetwork = networkConfig.network;
|
|
103
103
|
const fromTokenId = fromToken.id;
|
|
104
|
-
const fromTokenAddress =
|
|
104
|
+
const fromTokenAddress = generic_1.appendHexPrefix(fromToken.tokenAddress);
|
|
105
105
|
const toTokenDenom = toToken.denom;
|
|
106
106
|
const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
|
|
107
107
|
const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
|
|
108
108
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
|
|
109
109
|
const nonce = yield this.getTxNonce(fromAddress, params.nonce, rpcProvider);
|
|
110
110
|
const contract = new ethers_1.ethers.Contract(this.getBridgeEntranceAddr(), eth_1.ABIs.bridgeEntrance, rpcProvider);
|
|
111
|
-
const feeAddress =
|
|
111
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
112
112
|
const tokenCreator = fromToken.creator;
|
|
113
113
|
const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator, carbonNetwork);
|
|
114
114
|
const targetProxyHash = ethers_1.ethers.utils.hexlify(targetAddressBytes);
|
|
@@ -137,9 +137,9 @@ class ETHClient {
|
|
|
137
137
|
throw new Error("Minimum gas required: 150,000");
|
|
138
138
|
}
|
|
139
139
|
const networkConfig = this.getNetworkConfig();
|
|
140
|
-
const assetId =
|
|
141
|
-
const targetProxyHash =
|
|
142
|
-
const feeAddress =
|
|
140
|
+
const assetId = generic_1.appendHexPrefix(token.tokenAddress);
|
|
141
|
+
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
|
|
142
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
143
143
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
|
|
144
144
|
const swthAddress = ethers_1.ethers.utils.hexlify(address);
|
|
145
145
|
const contractAddress = this.getLockProxyAddress();
|
|
@@ -190,15 +190,15 @@ class ETHClient {
|
|
|
190
190
|
return "insufficient balance";
|
|
191
191
|
}
|
|
192
192
|
const networkConfig = this.getNetworkConfig();
|
|
193
|
-
const assetId =
|
|
194
|
-
const targetProxyHash =
|
|
195
|
-
const feeAddress =
|
|
193
|
+
const assetId = generic_1.appendHexPrefix(tokenWithExternalBalances.tokenAddress);
|
|
194
|
+
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(tokenWithExternalBalances));
|
|
195
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
196
196
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(tokenWithExternalBalances.id));
|
|
197
197
|
const nonce = Math.floor(Math.random() * 1000000000); // random nonce to prevent replay attacks
|
|
198
198
|
const message = ethers_1.ethers.utils.solidityKeccak256(["string", "address", "bytes", "bytes", "bytes", "uint256", "uint256", "uint256"], ["sendTokens", assetId, targetProxyHash, toAssetHash, feeAddress, amount, feeAmount, nonce]);
|
|
199
199
|
// logger("sendDeposit message", message)
|
|
200
200
|
const { address, signature } = yield getSignatureCallback(message);
|
|
201
|
-
const signatureBytes = ethers_1.ethers.utils.arrayify(
|
|
201
|
+
const signatureBytes = ethers_1.ethers.utils.arrayify(generic_1.appendHexPrefix(signature));
|
|
202
202
|
const rsv = ethers_1.ethers.utils.splitSignature(signatureBytes);
|
|
203
203
|
// logger("sign result", address, signature)
|
|
204
204
|
const signatureResult = {
|
|
@@ -237,7 +237,7 @@ class ETHClient {
|
|
|
237
237
|
if (!feeInfo.deposit_fee) {
|
|
238
238
|
throw new Error("unsupported token");
|
|
239
239
|
}
|
|
240
|
-
if (
|
|
240
|
+
if (blockchain_1.blockchainForChainId(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
|
|
241
241
|
throw new Error("unsupported token");
|
|
242
242
|
}
|
|
243
243
|
let feeAmount = ethers_1.ethers.BigNumber.from(feeInfo.deposit_fee);
|
|
@@ -303,7 +303,7 @@ class ETHClient {
|
|
|
303
303
|
getTargetProxyHash(token) {
|
|
304
304
|
const networkConfig = this.getNetworkConfig();
|
|
305
305
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
306
|
-
const addressHex =
|
|
306
|
+
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
307
307
|
return addressHex;
|
|
308
308
|
}
|
|
309
309
|
getProvider() {
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.HydrogenEndpoints = void 0;
|
|
16
16
|
const constant_1 = require("../constant");
|
|
17
17
|
const util_1 = require("../util");
|
|
18
|
+
const blockchain_1 = require("../util/blockchain");
|
|
18
19
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
19
20
|
exports.HydrogenEndpoints = {
|
|
20
21
|
// Status api
|
|
@@ -25,11 +26,13 @@ exports.HydrogenEndpoints = {
|
|
|
25
26
|
relays: "/relays",
|
|
26
27
|
// Fee service api
|
|
27
28
|
fee_quote: "/fee_quote",
|
|
29
|
+
// Bridge fees
|
|
30
|
+
bridge_fee: "/bridge_fee",
|
|
28
31
|
};
|
|
29
32
|
const formatDateField = (value) => {
|
|
30
33
|
if (typeof value !== "string")
|
|
31
34
|
return null;
|
|
32
|
-
return
|
|
35
|
+
return dayjs_1.default(value);
|
|
33
36
|
};
|
|
34
37
|
// temporary function to parse okt/okc blockchain
|
|
35
38
|
// to remove when automatic deposit/withdraw feature is deployed
|
|
@@ -73,6 +76,8 @@ const getBridgeBlockchainFromId = (bridgeId) => {
|
|
|
73
76
|
return 'Polynetwork';
|
|
74
77
|
case 2:
|
|
75
78
|
return 'Ibc';
|
|
79
|
+
case 3:
|
|
80
|
+
return 'Axelar';
|
|
76
81
|
default:
|
|
77
82
|
return 'Polynetwork';
|
|
78
83
|
}
|
|
@@ -84,13 +89,17 @@ class HydrogenClient {
|
|
|
84
89
|
var _a, _b, _c, _d;
|
|
85
90
|
if (typeof value !== "object")
|
|
86
91
|
return value;
|
|
87
|
-
|
|
92
|
+
// brdg tokens will all be chain_id 0 which will also be deprecated in future
|
|
93
|
+
// hence for brdg tokens cannot use chain_id to differentiate between blockchains
|
|
94
|
+
const isBridgeToken = this.tokenClient.isBridgedToken(value.carbon_token_id);
|
|
95
|
+
return Object.assign(Object.assign({}, value), { created_at: formatDateField((_a = value.created_at) === null || _a === void 0 ? void 0 : _a.toString()), updated_at: formatDateField((_b = value.updated_at) === null || _b === void 0 ? void 0 : _b.toString()), source_blockchain: isBridgeToken ? blockchain_1.getFormattedBlockchainName(value.source_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id), bridging_blockchain: getBridgeBlockchainFromId(value.bridge_id), destination_blockchain: isBridgeToken ? blockchain_1.getFormattedBlockchainName(value.destination_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id), source_event: this.formatChainEventV2(value.source_event, (_c = value.source_blockchain) !== null && _c !== void 0 ? _c : ''), bridging_event: this.formatChainEventV2(value.bridging_event, getBridgeBlockchainFromId(value.bridge_id)), destination_event: this.formatChainEventV2(value.destination_event, (_d = value.destination_blockchain) !== null && _d !== void 0 ? _d : ''), relay: this.formatRelaysTransfersV2(value.relay) });
|
|
88
96
|
};
|
|
89
97
|
this.formatCrossChainTransferDetailedV2 = (value) => {
|
|
90
98
|
if (!value || typeof value !== "object")
|
|
91
99
|
return value;
|
|
92
|
-
const
|
|
93
|
-
const
|
|
100
|
+
const isBridgeToken = this.tokenClient.isBridgedToken(value.carbon_token_id);
|
|
101
|
+
const source_blockchain = isBridgeToken ? blockchain_1.getFormattedBlockchainName(value.source_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id);
|
|
102
|
+
const destination_blockchain = isBridgeToken ? blockchain_1.getFormattedBlockchainName(value.destination_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id);
|
|
94
103
|
const bridging_blockchain = getBridgeBlockchainFromId(value.bridge_id);
|
|
95
104
|
return Object.assign(Object.assign({}, this.formatCrossChainTransferV2(value)), { source_event: this.formatChainEventV2(value.source_event, source_blockchain !== null && source_blockchain !== void 0 ? source_blockchain : ''), bridging_event: this.formatChainEventV2(value.bridging_event, bridging_blockchain), destination_event: this.formatChainEventV2(value.destination_event, destination_blockchain !== null && destination_blockchain !== void 0 ? destination_blockchain : '') });
|
|
96
105
|
};
|
|
@@ -101,12 +101,12 @@ class InsightsQueryClient {
|
|
|
101
101
|
const meta = response.data.result.meta;
|
|
102
102
|
const parsedEntries = rawEntries.map(entry => ({
|
|
103
103
|
lastHeight: entry.lastHeight,
|
|
104
|
-
time:
|
|
104
|
+
time: dayjs_1.default(entry.time),
|
|
105
105
|
volumeValue: new bignumber_js_1.default(entry.volumeValue),
|
|
106
106
|
}));
|
|
107
107
|
const parsedMeta = {
|
|
108
|
-
from:
|
|
109
|
-
until:
|
|
108
|
+
from: dayjs_1.default(meta.from),
|
|
109
|
+
until: dayjs_1.default(meta.until),
|
|
110
110
|
interval: meta.interval,
|
|
111
111
|
};
|
|
112
112
|
return { result: { entries: parsedEntries, meta: parsedMeta } };
|
package/lib/clients/NEOClient.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
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);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -72,13 +68,13 @@ class NEOClient {
|
|
|
72
68
|
?
|
|
73
69
|
!!sdk.token.getBlockchainV2(token.denom) && (blockchain_1.BLOCKCHAIN_V2_TO_V1_MAPPING[sdk.token.getBlockchainV2(token.denom)] == this.blockchain)
|
|
74
70
|
:
|
|
75
|
-
|
|
71
|
+
blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain;
|
|
76
72
|
return (isCorrectBlockchain || token.denom === "swth") && token.tokenAddress.length == 40 && token.bridgeAddress.length == 40;
|
|
77
73
|
});
|
|
78
74
|
const client = new Neon.rpc.RPCClient(url, "2.5.2"); // TODO: should we change the RPC version??
|
|
79
75
|
// NOTE: fetching of tokens is chunked in sets of 15 as we may hit
|
|
80
76
|
// the gas limit on the RPC node and error out otherwise
|
|
81
|
-
const promises =
|
|
77
|
+
const promises = lodash_1.chunk(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
|
|
82
78
|
var _a, _b, _c;
|
|
83
79
|
const acc = {};
|
|
84
80
|
for (const token of partition) {
|
|
@@ -120,8 +116,8 @@ class NEOClient {
|
|
|
120
116
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
121
117
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
122
118
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(swthAddress, networkConfig.network);
|
|
123
|
-
const toAddress =
|
|
124
|
-
const zeroAddressHex =
|
|
119
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
120
|
+
const zeroAddressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
|
|
125
121
|
const amount = ethers_1.ethers.BigNumber.from(token.externalBalance);
|
|
126
122
|
const feeAmount = ethers_1.ethers.BigNumber.from(feeAmountInput !== null && feeAmountInput !== void 0 ? feeAmountInput : "100000000");
|
|
127
123
|
const feeAddress = feeAmount.isZero() ? zeroAddressHex : networkConfig.feeAddress;
|
|
@@ -166,7 +162,7 @@ class NEOClient {
|
|
|
166
162
|
const fromAddress = util_1.AddressUtils.NEOAddress.publicKeyToAddress(publicKeyOutput.publicKey);
|
|
167
163
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
168
164
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
169
|
-
const toAddress =
|
|
165
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
170
166
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
171
167
|
if (amount.lt(feeAmount)) {
|
|
172
168
|
throw new Error("Invalid amount");
|
|
@@ -202,7 +198,7 @@ class NEOClient {
|
|
|
202
198
|
const fromAddress = ledger.scriptHash;
|
|
203
199
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
204
200
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
205
|
-
const toAddress =
|
|
201
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
206
202
|
const feeAddress = networkConfig.feeAddress;
|
|
207
203
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
208
204
|
if (amount.lt(feeAmount)) {
|
|
@@ -317,7 +313,7 @@ class NEOClient {
|
|
|
317
313
|
getTargetProxyHash(token) {
|
|
318
314
|
const networkConfig = this.getNetworkConfig();
|
|
319
315
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
320
|
-
const addressHex =
|
|
316
|
+
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
321
317
|
return addressHex;
|
|
322
318
|
}
|
|
323
319
|
getNetworkConfig() {
|
|
@@ -2,7 +2,7 @@ import { Carbon } from "../CarbonSDK";
|
|
|
2
2
|
import { NetworkConfigProvider } from "../constant";
|
|
3
3
|
import { GetFeeQuoteResponse } from "../hydrogen/feeQuote";
|
|
4
4
|
import { BlockchainUtils, TypeUtils } from "../util";
|
|
5
|
-
import { BlockchainV2, BridgeMap, IbcBridge } from '../util/blockchain';
|
|
5
|
+
import { AxelarBridge, BlockchainV2, BridgeMap, IbcBridge } from '../util/blockchain';
|
|
6
6
|
import BigNumber from "bignumber.js";
|
|
7
7
|
import CarbonQueryClient from "./CarbonQueryClient";
|
|
8
8
|
declare class TokenClient {
|
|
@@ -57,18 +57,21 @@ declare class TokenClient {
|
|
|
57
57
|
isNativeToken(denom: string): boolean;
|
|
58
58
|
isNativeStablecoin(denom: string): boolean;
|
|
59
59
|
isGroupedToken(denom: string): boolean;
|
|
60
|
+
isBridgedToken(denom: string): boolean;
|
|
60
61
|
isCarbonToken(token?: Carbon.Coin.Token | null): boolean;
|
|
61
62
|
getDepositTokenFor(tokenDenom: string, chain: BlockchainUtils.Blockchain | BlockchainUtils.BlockchainV2, version?: string): Carbon.Coin.Token | undefined;
|
|
62
63
|
getAllTokens(): Promise<Carbon.Coin.Token[]>;
|
|
63
64
|
reloadTokens(): Promise<TypeUtils.SimpleMap<Carbon.Coin.Token>>;
|
|
64
65
|
getBridges(): Promise<BridgeMap>;
|
|
65
66
|
matchChainsWithDifferentChainIds(bridges: Carbon.Coin.Bridge[]): Promise<IbcBridge[]>;
|
|
67
|
+
mapBridgesFromConnections(): Promise<AxelarBridge[]>;
|
|
66
68
|
getIbcBlockchainNames(): string[];
|
|
69
|
+
getAxelarBlockchainNames(): string[];
|
|
67
70
|
getIbcBridgeFromBlockchainV2: (blockchain: BlockchainV2 | undefined) => IbcBridge | undefined;
|
|
68
71
|
getIbcChainFromBlockchainV2: (blockchain: BlockchainV2 | undefined) => string | undefined;
|
|
69
72
|
getPolynetworkBlockchainNames(): string[];
|
|
70
73
|
getAllBlockchainNames(): string[];
|
|
71
|
-
getBridgesFromBridgeId(bridgeId: number): Carbon.Coin.Bridge[] | IbcBridge[];
|
|
74
|
+
getBridgesFromBridgeId(bridgeId: number): Carbon.Coin.Bridge[] | IbcBridge[] | AxelarBridge[];
|
|
72
75
|
getIbcTokens(): TypeUtils.SimpleMap<Carbon.Coin.Token>;
|
|
73
76
|
getPolyNetworkTokens(): TypeUtils.SimpleMap<Carbon.Coin.Token>;
|
|
74
77
|
getBlockchainV2FromIDs(chainId: number, bridgeId: number): BlockchainV2 | undefined;
|