carbon-js-sdk 0.6.0-rc7 → 0.6.0-rc7-node
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 +12 -21
- package/lib/CarbonSDK.js +45 -31
- package/lib/clients/BatchQueryClient.js +4 -4
- package/lib/clients/CarbonQueryClient.d.ts +6 -6
- package/lib/clients/CarbonQueryClient.js +88 -88
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/GrpcNodeQueryClient.d.ts +12 -0
- package/lib/clients/GrpcNodeQueryClient.js +53 -0
- package/lib/clients/GrpcQueryClient.d.ts +1 -1
- package/lib/clients/GrpcQueryClient.js +1 -1
- package/lib/clients/GrpcWebQueryClient.d.ts +22 -0
- package/lib/clients/GrpcWebQueryClient.js +56 -0
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/InsightsQueryClient.js +3 -3
- package/lib/clients/NEOClient.js +12 -8
- package/lib/clients/TokenClient.js +3 -3
- package/lib/clients/ZILClient.js +17 -17
- 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.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 +5 -5
- package/lib/codec/book/event.d.ts +3 -3
- package/lib/codec/book/genesis.d.ts +3 -3
- package/lib/codec/book/query.d.ts +8 -8
- package/lib/codec/broker/amm.d.ts +3 -3
- package/lib/codec/broker/candlestick.d.ts +3 -3
- package/lib/codec/broker/event.d.ts +3 -3
- package/lib/codec/broker/genesis.d.ts +3 -3
- 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/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 +36 -36
- package/lib/codec/cdp/genesis.d.ts +10 -10
- package/lib/codec/cdp/params.d.ts +3 -3
- package/lib/codec/cdp/query.d.ts +51 -51
- 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 +85 -85
- 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 +9 -9
- 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/v1alpha1/config.d.ts +4 -4
- 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/v1beta1/auth.d.ts +5 -5
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +20 -20
- 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/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 +21 -21
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +6 -6
- package/lib/codec/cosmos/base/abci/v1beta1/abci.d.ts +12 -12
- package/lib/codec/cosmos/base/kv/v1beta1/kv.d.ts +4 -4
- package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +4 -4
- 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/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 +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/capability/v1beta1/capability.d.ts +5 -5
- package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/crisis/v1beta1/tx.d.ts +4 -4
- 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/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 +22 -22
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +10 -10
- 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/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 +6 -6
- package/lib/codec/cosmos/genutil/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1/gov.d.ts +10 -10
- package/lib/codec/cosmos/gov/v1/query.d.ts +18 -18
- package/lib/codec/cosmos/gov/v1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1/tx.d.ts +12 -12
- 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/v1/events.d.ts +11 -11
- package/lib/codec/cosmos/group/v1/events.js +2 -2
- 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/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/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/v1/orm.d.ts +6 -6
- package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +4 -4
- 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/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 +4 -4
- 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 +22 -22
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +14 -14
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +7 -7
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +12 -12
- 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/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/v1beta1/tx.d.ts +8 -8
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +8 -8
- package/lib/codec/cosmos-models.js +5 -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/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 +5 -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 +3 -3
- package/lib/codec/google/protobuf/duration.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/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/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 +6 -6
- 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/v1/account.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +76 -0
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +424 -0
- 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/genesis.d.ts +3 -3
- package/lib/codec/ibc/applications/transfer/v1/query.d.ts +12 -12
- package/lib/codec/ibc/applications/transfer/v1/transfer.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/tx.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v2/packet.d.ts +3 -3
- package/lib/codec/ibc/core/channel/v1/channel.d.ts +9 -9
- package/lib/codec/ibc/core/channel/v1/genesis.d.ts +4 -4
- package/lib/codec/ibc/core/channel/v1/query.d.ts +28 -28
- package/lib/codec/ibc/core/channel/v1/tx.d.ts +22 -22
- 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 +10 -10
- 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 +10 -10
- package/lib/codec/ibc/core/types/v1/genesis.d.ts +3 -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/solomachine/v2/solomachine.d.ts +18 -18
- package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.d.ts +7 -7
- package/lib/codec/ibc-models.js +5 -1
- package/lib/codec/index.js +5 -1
- package/lib/codec/inflation/genesis.d.ts +3 -3
- package/lib/codec/inflation/inflation.d.ts +3 -3
- 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 +8 -8
- 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 +12 -12
- package/lib/codec/liquiditypool/genesis.d.ts +3 -3
- 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 +35 -35
- package/lib/codec/liquiditypool/reward.d.ts +18 -18
- 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 +28 -28
- package/lib/codec/oracle/slashing.d.ts +4 -4
- package/lib/codec/oracle/tx.d.ts +14 -14
- 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/polynetwork-models.js +5 -1
- 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 +6 -6
- 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 +15 -15
- 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/genesis.d.ts +3 -3
- package/lib/codec/subaccount/query.d.ts +10 -10
- package/lib/codec/subaccount/subaccount.d.ts +4 -4
- package/lib/codec/subaccount/tx.d.ts +8 -8
- package/lib/codec/tendermint/abci/types.d.ts +46 -46
- 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/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 +8 -8
- package/lib/codec/tendermint/types/types.d.ts +15 -15
- 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/generic.js +1 -1
- package/lib/constant/ibc.d.ts +3 -3
- package/lib/constant/ibc.js +5 -1
- package/lib/constant/index.js +5 -1
- package/lib/constant/node.d.ts +1 -1
- package/lib/eth/index.js +5 -1
- package/lib/hydrogen/index.js +5 -1
- package/lib/hydrogen/transfer.d.ts +2 -2
- package/lib/index.js +5 -1
- package/lib/insights/common.d.ts +1 -1
- package/lib/insights/index.js +5 -1
- package/lib/insights/position.d.ts +1 -1
- package/lib/modules/cdp.js +44 -44
- package/lib/modules/cosmwasm.js +1 -1
- package/lib/modules/evm.d.ts +1 -1
- package/lib/modules/evm.js +5 -5
- package/lib/modules/gov.js +12 -12
- package/lib/modules/index.js +5 -1
- package/lib/modules/liquiditypool.js +1 -1
- package/lib/modules/order.js +2 -2
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
- package/lib/provider/account/EthLedgerAccount/index.js +5 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/index.js +5 -1
- 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 +8 -4
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/index.js +5 -1
- package/lib/provider/account/index.js +5 -1
- package/lib/provider/amino/types/admin.js +32 -28
- package/lib/provider/amino/types/bank.js +6 -2
- package/lib/provider/amino/types/broker.js +6 -2
- package/lib/provider/amino/types/cdp.js +30 -26
- package/lib/provider/amino/types/coin.js +9 -5
- package/lib/provider/amino/types/erc20.js +2 -2
- package/lib/provider/amino/types/evm.js +7 -3
- package/lib/provider/amino/types/evmmerge.js +6 -2
- package/lib/provider/amino/types/feemarket.js +6 -2
- package/lib/provider/amino/types/gov.js +10 -6
- package/lib/provider/amino/types/ibc.js +6 -2
- package/lib/provider/amino/types/leverage.js +6 -2
- package/lib/provider/amino/types/liquidityPool.js +12 -8
- package/lib/provider/amino/types/market.js +11 -7
- package/lib/provider/amino/types/oracle.js +7 -3
- package/lib/provider/amino/types/order.js +9 -5
- package/lib/provider/amino/types/perpsliquidity.js +6 -6
- package/lib/provider/amino/types/position.js +6 -2
- package/lib/provider/amino/types/profile.js +6 -2
- package/lib/provider/amino/types/staking.js +9 -5
- package/lib/provider/amino/types/subaccount.js +8 -4
- package/lib/provider/amino/utils.d.ts +2 -2
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/keplr/KeplrAccount.js +2 -2
- package/lib/provider/ledger/ledger.js +8 -5
- package/lib/provider/metamask/MetaMask.d.ts +1 -1
- package/lib/provider/metamask/MetaMask.js +26 -22
- package/lib/provider/o3/O3Types.d.ts +1 -1
- package/lib/provider/o3/O3Wallet.js +15 -11
- package/lib/provider/o3/index.js +5 -1
- package/lib/provider/zilpay/Zilpay.js +4 -4
- package/lib/provider/zilpay/index.js +5 -1
- package/lib/util/address.d.ts +5 -5
- package/lib/util/address.js +19 -15
- package/lib/util/api.d.ts +3 -3
- package/lib/util/api.js +4 -4
- package/lib/util/blockchain.d.ts +7 -7
- package/lib/util/blockchain.js +4 -4
- package/lib/util/eip712.js +3 -3
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.d.ts +3 -2
- package/lib/util/generic.js +3 -3
- package/lib/util/gov.d.ts +1 -1
- package/lib/util/index.js +5 -1
- 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 +3 -3
- package/lib/util/tx.js +5 -1
- package/lib/util/type.d.ts +4 -1
- package/lib/wallet/CarbonSigner.d.ts +5 -5
- package/lib/wallet/CarbonSigner.js +6 -6
- package/lib/wallet/CarbonSigningClient.js +15 -15
- package/lib/wallet/CarbonWallet.d.ts +1 -1
- package/lib/wallet/CarbonWallet.js +9 -9
- package/lib/wallet/index.js +5 -1
- package/lib/websocket/connector.js +8 -4
- package/lib/websocket/index.js +5 -1
- package/lib/websocket/types.d.ts +1 -1
- package/package.json +2 -1
package/lib/CarbonSDK.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { Network, NetworkConfig, Network as _Network } from "./constant";
|
|
|
3
3
|
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
|
4
4
|
import * as clients from "./clients";
|
|
5
5
|
import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
|
|
6
|
-
import GrpcQueryClient from "./clients/GrpcQueryClient";
|
|
7
6
|
import N3Client from "./clients/N3Client";
|
|
8
7
|
import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, EvmMergeModule, EvmModule, FeeModule, FeemarketModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
|
|
9
8
|
import { StakingModule } from "./modules/staking";
|
|
10
9
|
import { CosmosLedger, Keplr, LeapExtended } from "./provider";
|
|
11
10
|
import { MetaMask } from "./provider/metamask/MetaMask";
|
|
12
11
|
import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts, MetaMaskWalletOpts } from "./wallet";
|
|
12
|
+
import { GrpcQueryClient } from "./util/type";
|
|
13
13
|
export { CarbonTx } from "./util";
|
|
14
14
|
export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
|
|
15
15
|
export { DenomPrefix } from "./constant";
|
|
@@ -24,18 +24,9 @@ export interface CarbonSDKOpts {
|
|
|
24
24
|
useTmAbciQuery?: boolean;
|
|
25
25
|
defaultTimeoutBlocks?: number;
|
|
26
26
|
}
|
|
27
|
-
export interface CarbonSDKInitOpts {
|
|
28
|
-
network: Network;
|
|
29
|
-
tmClient?: Tendermint34Client;
|
|
30
|
-
config?: Partial<NetworkConfig>;
|
|
27
|
+
export interface CarbonSDKInitOpts extends Partial<CarbonSDKOpts> {
|
|
31
28
|
wallet?: CarbonWallet;
|
|
32
29
|
skipInit?: boolean;
|
|
33
|
-
defaultTimeoutBlocks?: number;
|
|
34
|
-
/**
|
|
35
|
-
* temporary flag to disable GRPC Query client service when required
|
|
36
|
-
* TODO: Deprecate when grpc query client is implemented across all networks
|
|
37
|
-
*/
|
|
38
|
-
useTmAbciQuery?: boolean;
|
|
39
30
|
}
|
|
40
31
|
/**
|
|
41
32
|
* Carbon SDK
|
|
@@ -90,16 +81,16 @@ declare class CarbonSDK {
|
|
|
90
81
|
chainId: string;
|
|
91
82
|
evmChainId: string;
|
|
92
83
|
constructor(opts: CarbonSDKOpts);
|
|
93
|
-
static instance(
|
|
94
|
-
static instanceWithWallet(wallet: CarbonWallet,
|
|
95
|
-
static instanceWithPrivateKey(privateKey: string | Buffer,
|
|
96
|
-
static instanceWithMnemonic(mnemonic: string,
|
|
97
|
-
static instanceWithSigner(signer: CarbonSigner, publicKeyBase64: string,
|
|
98
|
-
static instanceWithLedger(ledger: CosmosLedger,
|
|
99
|
-
static instanceWithKeplr(keplr: Keplr,
|
|
100
|
-
static instanceWithLeap(leap: LeapExtended,
|
|
101
|
-
static instanceWithMetamask(metamask: MetaMask,
|
|
102
|
-
static instanceViewOnly(bech32Address: string,
|
|
84
|
+
static instance(initOpts?: CarbonSDKInitOpts): Promise<CarbonSDK>;
|
|
85
|
+
static instanceWithWallet(wallet: CarbonWallet, sdkInitOpts?: CarbonSDKInitOpts): Promise<ConnectedCarbonSDK>;
|
|
86
|
+
static instanceWithPrivateKey(privateKey: string | Buffer, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
87
|
+
static instanceWithMnemonic(mnemonic: string, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
88
|
+
static instanceWithSigner(signer: CarbonSigner, publicKeyBase64: string, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
89
|
+
static instanceWithLedger(ledger: CosmosLedger, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
90
|
+
static instanceWithKeplr(keplr: Keplr, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
91
|
+
static instanceWithLeap(leap: LeapExtended, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
92
|
+
static instanceWithMetamask(metamask: MetaMask, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts, metamaskWalletOpts?: MetaMaskWalletOpts): Promise<ConnectedCarbonSDK>;
|
|
93
|
+
static instanceViewOnly(bech32Address: string, sdkInitOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
103
94
|
initialize(): Promise<CarbonSDK>;
|
|
104
95
|
clone(): CarbonSDK;
|
|
105
96
|
generateOpts(): CarbonSDKOpts;
|
package/lib/CarbonSDK.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -27,6 +31,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
27
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
32
|
});
|
|
29
33
|
};
|
|
34
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
35
|
+
var t = {};
|
|
36
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37
|
+
t[p] = s[p];
|
|
38
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
39
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
40
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
41
|
+
t[p[i]] = s[p[i]];
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
30
45
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
47
|
};
|
|
@@ -35,10 +50,10 @@ exports.ConnectedCarbonSDK = exports.DenomPrefix = exports.CarbonWallet = export
|
|
|
35
50
|
const constant_1 = require("./constant");
|
|
36
51
|
const util_1 = require("./util");
|
|
37
52
|
const tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
|
|
38
|
-
const grpc_web_node_http_transport_1 = require("@improbable-eng/grpc-web-node-http-transport");
|
|
39
53
|
const clients = __importStar(require("./clients"));
|
|
40
54
|
const clients_1 = require("./clients");
|
|
41
|
-
const
|
|
55
|
+
const GrpcNodeQueryClient_1 = __importDefault(require("./clients/GrpcNodeQueryClient"));
|
|
56
|
+
const GrpcWebQueryClient_1 = __importDefault(require("./clients/GrpcWebQueryClient"));
|
|
42
57
|
const N3Client_1 = __importDefault(require("./clients/N3Client"));
|
|
43
58
|
const modules_1 = require("./modules");
|
|
44
59
|
const staking_1 = require("./modules/staking");
|
|
@@ -62,7 +77,7 @@ const DEFAULT_SDK_INIT_OPTS = {
|
|
|
62
77
|
*/
|
|
63
78
|
class CarbonSDK {
|
|
64
79
|
constructor(opts) {
|
|
65
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
80
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
66
81
|
this.network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
|
|
67
82
|
this.configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
|
|
68
83
|
this.networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[this.network], this.configOverride);
|
|
@@ -71,17 +86,15 @@ class CarbonSDK {
|
|
|
71
86
|
this.evmChainId = (_f = (_e = opts.evmChainId) !== null && _e !== void 0 ? _e : constant_1.CarbonEvmChainIDs[this.network]) !== null && _f !== void 0 ? _f : constant_1.CarbonEvmChainIDs[constant_1.Network.MainNet];
|
|
72
87
|
let grpcClient;
|
|
73
88
|
if (opts.useTmAbciQuery !== true && this.networkConfig.grpcUrl) {
|
|
74
|
-
const
|
|
75
|
-
grpcClient =
|
|
76
|
-
transport,
|
|
77
|
-
});
|
|
89
|
+
const client = typeof window === "undefined" ? new GrpcNodeQueryClient_1.default(this.networkConfig.grpcUrl) : new GrpcWebQueryClient_1.default(this.networkConfig.grpcWebUrl);
|
|
90
|
+
grpcClient = client;
|
|
78
91
|
}
|
|
79
92
|
this.query = new clients_1.CarbonQueryClient({
|
|
80
93
|
tmClient: this.tmClient,
|
|
81
94
|
grpcClient,
|
|
82
95
|
});
|
|
83
96
|
this.insights = new clients_1.InsightsQueryClient(this.networkConfig);
|
|
84
|
-
this.token = (
|
|
97
|
+
this.token = (_g = opts.token) !== null && _g !== void 0 ? _g : clients_1.TokenClient.instance(this.query, this);
|
|
85
98
|
this.hydrogen = new clients_1.HydrogenClient(this.networkConfig, this.token);
|
|
86
99
|
this.hydrogen = clients_1.HydrogenClient.instance(this.networkConfig, this.token);
|
|
87
100
|
this.admin = new modules_1.AdminModule(this);
|
|
@@ -144,9 +157,10 @@ class CarbonSDK {
|
|
|
144
157
|
tokenClient: this.token,
|
|
145
158
|
});
|
|
146
159
|
}
|
|
147
|
-
static instance(
|
|
160
|
+
static instance(initOpts = DEFAULT_SDK_INIT_OPTS) {
|
|
148
161
|
var _a, _b, _c, _d;
|
|
149
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const { wallet, skipInit } = initOpts, opts = __rest(initOpts, ["wallet", "skipInit"]);
|
|
150
164
|
const network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
|
|
151
165
|
const configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
|
|
152
166
|
const networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[network], configOverride);
|
|
@@ -155,66 +169,66 @@ class CarbonSDK {
|
|
|
155
169
|
const defaultTimeoutBlocks = opts.defaultTimeoutBlocks;
|
|
156
170
|
const chainId = (_d = (yield tmClient.status())) === null || _d === void 0 ? void 0 : _d.nodeInfo.network;
|
|
157
171
|
const sdk = new CarbonSDK({ network, config: configOverride, tmClient, defaultTimeoutBlocks, chainId, useTmAbciQuery: opts.useTmAbciQuery });
|
|
158
|
-
if (
|
|
159
|
-
yield sdk.connect(
|
|
172
|
+
if (wallet) {
|
|
173
|
+
yield sdk.connect(wallet);
|
|
160
174
|
}
|
|
161
|
-
if (
|
|
175
|
+
if (skipInit !== true) {
|
|
162
176
|
yield sdk.initialize();
|
|
163
177
|
}
|
|
164
178
|
return sdk;
|
|
165
179
|
});
|
|
166
180
|
}
|
|
167
|
-
static instanceWithWallet(wallet,
|
|
181
|
+
static instanceWithWallet(wallet, sdkInitOpts = DEFAULT_SDK_INIT_OPTS) {
|
|
168
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
const sdk = yield CarbonSDK.instance(
|
|
183
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
170
184
|
return sdk.connect(wallet);
|
|
171
185
|
});
|
|
172
186
|
}
|
|
173
|
-
static instanceWithPrivateKey(privateKey,
|
|
187
|
+
static instanceWithPrivateKey(privateKey, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
174
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
const sdk = yield CarbonSDK.instance(
|
|
189
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
176
190
|
return sdk.connectWithPrivateKey(privateKey, walletOpts);
|
|
177
191
|
});
|
|
178
192
|
}
|
|
179
|
-
static instanceWithMnemonic(mnemonic,
|
|
193
|
+
static instanceWithMnemonic(mnemonic, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
180
194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
-
const sdk = yield CarbonSDK.instance(
|
|
195
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
182
196
|
return sdk.connectWithMnemonic(mnemonic, walletOpts);
|
|
183
197
|
});
|
|
184
198
|
}
|
|
185
|
-
static instanceWithSigner(signer, publicKeyBase64,
|
|
199
|
+
static instanceWithSigner(signer, publicKeyBase64, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
186
200
|
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
-
const sdk = yield CarbonSDK.instance(
|
|
201
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
188
202
|
return sdk.connectWithSigner(signer, publicKeyBase64, walletOpts);
|
|
189
203
|
});
|
|
190
204
|
}
|
|
191
|
-
static instanceWithLedger(ledger,
|
|
205
|
+
static instanceWithLedger(ledger, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
192
206
|
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
-
const sdk = yield CarbonSDK.instance(
|
|
207
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
194
208
|
return sdk.connectWithLedger(ledger, walletOpts);
|
|
195
209
|
});
|
|
196
210
|
}
|
|
197
|
-
static instanceWithKeplr(keplr,
|
|
211
|
+
static instanceWithKeplr(keplr, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
198
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
-
const sdk = yield CarbonSDK.instance(
|
|
213
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
200
214
|
return sdk.connectWithKeplr(keplr, walletOpts);
|
|
201
215
|
});
|
|
202
216
|
}
|
|
203
|
-
static instanceWithLeap(leap,
|
|
217
|
+
static instanceWithLeap(leap, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
204
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
-
const sdk = yield CarbonSDK.instance(
|
|
219
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
206
220
|
return sdk.connectWithLeap(leap, walletOpts);
|
|
207
221
|
});
|
|
208
222
|
}
|
|
209
|
-
static instanceWithMetamask(metamask,
|
|
223
|
+
static instanceWithMetamask(metamask, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts, metamaskWalletOpts) {
|
|
210
224
|
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
-
const sdk = yield CarbonSDK.instance(
|
|
225
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
212
226
|
return sdk.connectWithMetamask(metamask, walletOpts, metamaskWalletOpts);
|
|
213
227
|
});
|
|
214
228
|
}
|
|
215
|
-
static instanceViewOnly(bech32Address,
|
|
229
|
+
static instanceViewOnly(bech32Address, sdkInitOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
216
230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
const sdk = yield CarbonSDK.instance(
|
|
231
|
+
const sdk = yield CarbonSDK.instance(sdkInitOpts);
|
|
218
232
|
return sdk.connectViewOnly(bech32Address, walletOpts);
|
|
219
233
|
});
|
|
220
234
|
}
|
|
@@ -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 = rpcclient_1.hasProtocol(endpoint) ? endpoint : "http://" + endpoint;
|
|
32
|
+
this.url = (0, 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
|
-
http_1.http("POST", this.url, this.headers, requests).then((raw) => {
|
|
74
|
+
(0, 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 = json_rpc_1.parseJsonRpcResponse(el);
|
|
83
|
-
if (json_rpc_1.isJsonRpcErrorResponse(response)) {
|
|
82
|
+
const response = (0, json_rpc_1.parseJsonRpcResponse)(el);
|
|
83
|
+
if ((0, json_rpc_1.isJsonRpcErrorResponse)(response)) {
|
|
84
84
|
reject(new Error(JSON.stringify(response.error)));
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { QueryClientImpl as ADLQueryClient } from "../codec/adl/query";
|
|
2
|
+
import { QueryClientImpl as AllianceClient } from "../codec/alliance/query";
|
|
3
|
+
import { QueryClientImpl as NativeBankQueryClient } from "../codec/bank/query";
|
|
2
4
|
import { QueryClientImpl as BookQueryClient } from "../codec/book/query";
|
|
3
5
|
import { QueryClientImpl as BrokerQueryClient } from "../codec/broker/query";
|
|
4
6
|
import { QueryClientImpl as CDPQueryClient } from "../codec/cdp/query";
|
|
5
7
|
import { QueryClientImpl as CoinQueryClient } from "../codec/coin/query";
|
|
6
8
|
import { QueryClientImpl as AuthQueryClient } from "../codec/cosmos/auth/v1beta1/query";
|
|
7
9
|
import { QueryClientImpl as BankQueryClient } from "../codec/cosmos/bank/v1beta1/query";
|
|
8
|
-
import { QueryClientImpl as NativeBankQueryClient } from "../codec/bank/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";
|
|
@@ -16,17 +17,17 @@ import { QueryClientImpl as SlashingQueryClient } from "../codec/cosmos/slashing
|
|
|
16
17
|
import { QueryClientImpl as StakingQueryClient } from "../codec/cosmos/staking/v1beta1/query";
|
|
17
18
|
import { QueryClientImpl as UpgradeQueryClient } from "../codec/cosmos/upgrade/v1beta1/query";
|
|
18
19
|
import { QueryClientImpl as EthermintEVMQueryClient } from "../codec/ethermint/evm/v1/query";
|
|
19
|
-
import { QueryClientImpl as EvmMergeQueryClient } from "../codec/evmmerge/query";
|
|
20
|
-
import { QueryClientImpl as EvmBankQueryClient } from "../codec/evmbank/query";
|
|
21
20
|
import { QueryClientImpl as EthermintFeeMarketQueryClient } from "../codec/ethermint/feemarket/v1/query";
|
|
21
|
+
import { QueryClientImpl as EvmBankQueryClient } from "../codec/evmbank/query";
|
|
22
|
+
import { QueryClientImpl as EvmMergeQueryClient } from "../codec/evmmerge/query";
|
|
22
23
|
import { QueryClientImpl as FeeQueryClient } from "../codec/fee/query";
|
|
23
24
|
import { QueryClientImpl as HeadersyncQueryClient } from "../codec/headersync/query";
|
|
24
25
|
import { QueryClientImpl as IBCInterchainControlQueryClient } from "../codec/ibc/applications/interchain_accounts/controller/v1/query";
|
|
25
26
|
import { QueryClientImpl as IBCInterchainHostQueryClient } from "../codec/ibc/applications/interchain_accounts/host/v1/query";
|
|
26
27
|
import { QueryClientImpl as IBCTransferQueryClient } from "../codec/ibc/applications/transfer/v1/query";
|
|
28
|
+
import { QueryClientImpl as IBCChannelQueryClient } from "../codec/ibc/core/channel/v1/query";
|
|
27
29
|
import { QueryClientImpl as IBCClientQueryClient } from "../codec/ibc/core/client/v1/query";
|
|
28
30
|
import { QueryClientImpl as IBCConnectionQueryClient } from "../codec/ibc/core/connection/v1/query";
|
|
29
|
-
import { QueryClientImpl as IBCChannelQueryClient } from "../codec/ibc/core/channel/v1/query";
|
|
30
31
|
import { QueryClientImpl as InflationQueryClient } from "../codec/inflation/query";
|
|
31
32
|
import { QueryClientImpl as InsuranceQueryClient } from "../codec/insurance/query";
|
|
32
33
|
import { QueryClientImpl as LeverageQueryClient } from "../codec/leverage/query";
|
|
@@ -41,10 +42,9 @@ import { QueryClientImpl as PositionQueryClient } from "../codec/position/query"
|
|
|
41
42
|
import { QueryClientImpl as PricingQueryClient } from "../codec/pricing/query";
|
|
42
43
|
import { QueryClientImpl as ProfileQueryClient } from "../codec/profile/query";
|
|
43
44
|
import { QueryClientImpl as SubaccountQueryClient } from "../codec/subaccount/query";
|
|
44
|
-
import {
|
|
45
|
+
import { GrpcQueryClient } from "../util/type";
|
|
45
46
|
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
|
46
47
|
import BlockchainClient from "./BlockchainClient";
|
|
47
|
-
import GrpcQueryClient from "./GrpcQueryClient";
|
|
48
48
|
export interface IBCClientGroup {
|
|
49
49
|
controller: IBCInterchainControlQueryClient;
|
|
50
50
|
host: IBCInterchainHostQueryClient;
|
|
@@ -4,106 +4,106 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const query_1 = require("../codec/adl/query");
|
|
7
|
-
const query_2 = require("../codec/
|
|
8
|
-
const query_3 = require("../codec/
|
|
9
|
-
const query_4 = require("../codec/
|
|
10
|
-
const query_5 = require("../codec/
|
|
11
|
-
const query_6 = require("../codec/
|
|
12
|
-
const query_7 = require("../codec/
|
|
13
|
-
const query_8 = require("../codec/
|
|
14
|
-
const query_9 = require("../codec/cosmos/
|
|
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/
|
|
24
|
-
const query_19 = require("../codec/
|
|
25
|
-
const query_20 = require("../codec/
|
|
26
|
-
const query_21 = require("../codec/
|
|
27
|
-
const query_22 = require("../codec/
|
|
28
|
-
const query_23 = require("../codec/
|
|
29
|
-
const query_24 = require("../codec/
|
|
30
|
-
const query_25 = require("../codec/ibc/applications/interchain_accounts/
|
|
31
|
-
const query_26 = require("../codec/ibc/applications/
|
|
32
|
-
const query_27 = require("../codec/ibc/
|
|
33
|
-
const query_28 = require("../codec/ibc/core/
|
|
34
|
-
const query_29 = require("../codec/ibc/core/
|
|
35
|
-
const query_30 = require("../codec/
|
|
36
|
-
const query_31 = require("../codec/
|
|
37
|
-
const query_32 = require("../codec/
|
|
38
|
-
const query_33 = require("../codec/
|
|
39
|
-
const query_34 = require("../codec/
|
|
40
|
-
const query_35 = require("../codec/
|
|
41
|
-
const query_36 = require("../codec/
|
|
42
|
-
const query_37 = require("../codec/
|
|
43
|
-
const query_38 = require("../codec/
|
|
44
|
-
const query_39 = require("../codec/
|
|
45
|
-
const query_40 = require("../codec/
|
|
46
|
-
const query_41 = require("../codec/
|
|
47
|
-
const query_42 = require("../codec/
|
|
48
|
-
const query_43 = require("../codec/
|
|
49
|
-
const query_44 = require("../codec/
|
|
7
|
+
const query_2 = require("../codec/alliance/query");
|
|
8
|
+
const query_3 = require("../codec/bank/query");
|
|
9
|
+
const query_4 = require("../codec/book/query");
|
|
10
|
+
const query_5 = require("../codec/broker/query");
|
|
11
|
+
const query_6 = require("../codec/cdp/query");
|
|
12
|
+
const query_7 = require("../codec/coin/query");
|
|
13
|
+
const query_8 = require("../codec/cosmos/auth/v1beta1/query");
|
|
14
|
+
const query_9 = require("../codec/cosmos/bank/v1beta1/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/v1beta1/query");
|
|
19
|
+
const query_14 = require("../codec/cosmos/mint/v1beta1/query");
|
|
20
|
+
const query_15 = require("../codec/cosmos/params/v1beta1/query");
|
|
21
|
+
const query_16 = require("../codec/cosmos/slashing/v1beta1/query");
|
|
22
|
+
const query_17 = require("../codec/cosmos/staking/v1beta1/query");
|
|
23
|
+
const query_18 = require("../codec/cosmos/upgrade/v1beta1/query");
|
|
24
|
+
const query_19 = require("../codec/ethermint/evm/v1/query");
|
|
25
|
+
const query_20 = require("../codec/ethermint/feemarket/v1/query");
|
|
26
|
+
const query_21 = require("../codec/evmbank/query");
|
|
27
|
+
const query_22 = require("../codec/evmmerge/query");
|
|
28
|
+
const query_23 = require("../codec/fee/query");
|
|
29
|
+
const query_24 = require("../codec/headersync/query");
|
|
30
|
+
const query_25 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
|
|
31
|
+
const query_26 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
|
|
32
|
+
const query_27 = require("../codec/ibc/applications/transfer/v1/query");
|
|
33
|
+
const query_28 = require("../codec/ibc/core/channel/v1/query");
|
|
34
|
+
const query_29 = require("../codec/ibc/core/client/v1/query");
|
|
35
|
+
const query_30 = require("../codec/ibc/core/connection/v1/query");
|
|
36
|
+
const query_31 = require("../codec/inflation/query");
|
|
37
|
+
const query_32 = require("../codec/insurance/query");
|
|
38
|
+
const query_33 = require("../codec/leverage/query");
|
|
39
|
+
const query_34 = require("../codec/liquidation/query");
|
|
40
|
+
const query_35 = require("../codec/liquiditypool/query");
|
|
41
|
+
const query_36 = require("../codec/market/query");
|
|
42
|
+
const query_37 = require("../codec/marketstats/query");
|
|
43
|
+
const query_38 = require("../codec/misc/query");
|
|
44
|
+
const query_39 = require("../codec/oracle/query");
|
|
45
|
+
const query_40 = require("../codec/order/query");
|
|
46
|
+
const query_41 = require("../codec/position/query");
|
|
47
|
+
const query_42 = require("../codec/pricing/query");
|
|
48
|
+
const query_43 = require("../codec/profile/query");
|
|
49
|
+
const query_44 = require("../codec/subaccount/query");
|
|
50
50
|
const stargate_1 = require("@cosmjs/stargate");
|
|
51
51
|
const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
52
52
|
class CarbonQueryClient {
|
|
53
53
|
constructor(opts) {
|
|
54
54
|
var _a;
|
|
55
|
-
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : stargate_1.createProtobufRpcClient(new stargate_1.QueryClient(opts.tmClient));
|
|
55
|
+
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : (0, stargate_1.createProtobufRpcClient)(new stargate_1.QueryClient(opts.tmClient));
|
|
56
56
|
this.tmClient = opts.tmClient;
|
|
57
57
|
this.baseClient = rpcClient;
|
|
58
58
|
this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
|
|
59
59
|
this.adl = new query_1.QueryClientImpl(rpcClient);
|
|
60
|
-
this.alliance = new
|
|
61
|
-
this.book = new
|
|
62
|
-
this.broker = new
|
|
63
|
-
this.coin = new
|
|
64
|
-
this.cdp = new
|
|
65
|
-
this.fee = new
|
|
66
|
-
this.inflation = new
|
|
67
|
-
this.insurance = new
|
|
68
|
-
this.leverage = new
|
|
69
|
-
this.liquidation = new
|
|
70
|
-
this.liquiditypool = new
|
|
71
|
-
this.market = new
|
|
72
|
-
this.marketstats = new
|
|
73
|
-
this.misc = new
|
|
74
|
-
this.oracle = new
|
|
75
|
-
this.order = new
|
|
76
|
-
this.position = new
|
|
77
|
-
this.pricing = new
|
|
78
|
-
this.profile = new
|
|
79
|
-
this.subaccount = new
|
|
80
|
-
this.headersync = new
|
|
81
|
-
this.evmmerge = new
|
|
82
|
-
this.evmbank = new
|
|
83
|
-
this.auth = new
|
|
84
|
-
this.bank = new
|
|
85
|
-
this.nativeBank = new
|
|
86
|
-
this.distribution = new
|
|
87
|
-
this.evidence = new
|
|
88
|
-
this.gov = new
|
|
89
|
-
this.mint = new
|
|
90
|
-
this.params = new
|
|
91
|
-
this.slashing = new
|
|
92
|
-
this.staking = new
|
|
93
|
-
this.upgrade = new
|
|
94
|
-
this.cosmosTm = new
|
|
95
|
-
this.alliance = new
|
|
60
|
+
this.alliance = new query_2.QueryClientImpl(rpcClient);
|
|
61
|
+
this.book = new query_4.QueryClientImpl(rpcClient);
|
|
62
|
+
this.broker = new query_5.QueryClientImpl(rpcClient);
|
|
63
|
+
this.coin = new query_7.QueryClientImpl(rpcClient);
|
|
64
|
+
this.cdp = new query_6.QueryClientImpl(rpcClient);
|
|
65
|
+
this.fee = new query_23.QueryClientImpl(rpcClient);
|
|
66
|
+
this.inflation = new query_31.QueryClientImpl(rpcClient);
|
|
67
|
+
this.insurance = new query_32.QueryClientImpl(rpcClient);
|
|
68
|
+
this.leverage = new query_33.QueryClientImpl(rpcClient);
|
|
69
|
+
this.liquidation = new query_34.QueryClientImpl(rpcClient);
|
|
70
|
+
this.liquiditypool = new query_35.QueryClientImpl(rpcClient);
|
|
71
|
+
this.market = new query_36.QueryClientImpl(rpcClient);
|
|
72
|
+
this.marketstats = new query_37.QueryClientImpl(rpcClient);
|
|
73
|
+
this.misc = new query_38.QueryClientImpl(rpcClient);
|
|
74
|
+
this.oracle = new query_39.QueryClientImpl(rpcClient);
|
|
75
|
+
this.order = new query_40.QueryClientImpl(rpcClient);
|
|
76
|
+
this.position = new query_41.QueryClientImpl(rpcClient);
|
|
77
|
+
this.pricing = new query_42.QueryClientImpl(rpcClient);
|
|
78
|
+
this.profile = new query_43.QueryClientImpl(rpcClient);
|
|
79
|
+
this.subaccount = new query_44.QueryClientImpl(rpcClient);
|
|
80
|
+
this.headersync = new query_24.QueryClientImpl(rpcClient);
|
|
81
|
+
this.evmmerge = new query_22.QueryClientImpl(rpcClient);
|
|
82
|
+
this.evmbank = new query_21.QueryClientImpl(rpcClient);
|
|
83
|
+
this.auth = new query_8.QueryClientImpl(rpcClient);
|
|
84
|
+
this.bank = new query_9.QueryClientImpl(rpcClient);
|
|
85
|
+
this.nativeBank = new query_3.QueryClientImpl(rpcClient);
|
|
86
|
+
this.distribution = new query_11.QueryClientImpl(rpcClient);
|
|
87
|
+
this.evidence = new query_12.QueryClientImpl(rpcClient);
|
|
88
|
+
this.gov = new query_13.QueryClientImpl(rpcClient);
|
|
89
|
+
this.mint = new query_14.QueryClientImpl(rpcClient);
|
|
90
|
+
this.params = new query_15.QueryClientImpl(rpcClient);
|
|
91
|
+
this.slashing = new query_16.QueryClientImpl(rpcClient);
|
|
92
|
+
this.staking = new query_17.QueryClientImpl(rpcClient);
|
|
93
|
+
this.upgrade = new query_18.QueryClientImpl(rpcClient);
|
|
94
|
+
this.cosmosTm = new query_10.ServiceClientImpl(rpcClient);
|
|
95
|
+
this.alliance = new query_2.QueryClientImpl(rpcClient);
|
|
96
96
|
this.ibc = {
|
|
97
|
-
controller: new
|
|
98
|
-
host: new
|
|
99
|
-
transfer: new
|
|
100
|
-
client: new
|
|
101
|
-
connection: new
|
|
102
|
-
channel: new
|
|
97
|
+
controller: new query_25.QueryClientImpl(rpcClient),
|
|
98
|
+
host: new query_26.QueryClientImpl(rpcClient),
|
|
99
|
+
transfer: new query_27.QueryClientImpl(rpcClient),
|
|
100
|
+
client: new query_29.QueryClientImpl(rpcClient),
|
|
101
|
+
connection: new query_30.QueryClientImpl(rpcClient),
|
|
102
|
+
channel: new query_28.QueryClientImpl(rpcClient),
|
|
103
103
|
};
|
|
104
104
|
this.ethermint = {
|
|
105
|
-
evm: new
|
|
106
|
-
feeMarket: new
|
|
105
|
+
evm: new query_19.QueryClientImpl(rpcClient),
|
|
106
|
+
feeMarket: new query_20.QueryClientImpl(rpcClient),
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
}
|
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
|
-
blockchain_1.blockchainForChainId(token.chainId.toNumber(), api.network) == this.blockchain;
|
|
47
|
+
(0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), api.network) == this.blockchain;
|
|
48
48
|
return isCorrectBlockchain &&
|
|
49
49
|
token.tokenAddress.length == 40 &&
|
|
50
|
-
token.bridgeAddress.toLowerCase() == generic_1.stripHexPrefix(lockProxyAddress) &&
|
|
50
|
+
token.bridgeAddress.toLowerCase() == (0, generic_1.stripHexPrefix)(lockProxyAddress) &&
|
|
51
51
|
(!whitelistDenoms || whitelistDenoms.includes(token.denom)) &&
|
|
52
|
-
this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
52
|
+
this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress));
|
|
53
53
|
});
|
|
54
54
|
const assetIds = tokens.map((token) => {
|
|
55
|
-
return this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
55
|
+
return this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress));
|
|
56
56
|
});
|
|
57
57
|
const provider = this.getProvider();
|
|
58
58
|
const contractAddress = this.getBalanceReaderAddress();
|
|
@@ -99,14 +99,14 @@ class ETHClient {
|
|
|
99
99
|
}
|
|
100
100
|
const carbonNetwork = networkConfig.network;
|
|
101
101
|
const fromTokenId = fromToken.id;
|
|
102
|
-
const fromTokenAddress = generic_1.appendHexPrefix(fromToken.tokenAddress);
|
|
102
|
+
const fromTokenAddress = (0, generic_1.appendHexPrefix)(fromToken.tokenAddress);
|
|
103
103
|
const toTokenDenom = toToken.denom;
|
|
104
104
|
const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
|
|
105
105
|
const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
|
|
106
106
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
|
|
107
107
|
const nonce = yield this.getTxNonce(fromAddress, params.nonce, rpcProvider);
|
|
108
108
|
const contract = new ethers_1.ethers.Contract(this.getBridgeEntranceAddr(), eth_1.ABIs.bridgeEntrance, rpcProvider);
|
|
109
|
-
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
109
|
+
const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
|
|
110
110
|
const tokenCreator = fromToken.creator;
|
|
111
111
|
const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator, carbonNetwork);
|
|
112
112
|
const targetProxyHash = ethers_1.ethers.utils.hexlify(targetAddressBytes);
|
|
@@ -135,9 +135,9 @@ class ETHClient {
|
|
|
135
135
|
throw new Error("Minimum gas required: 150,000");
|
|
136
136
|
}
|
|
137
137
|
const networkConfig = this.getNetworkConfig();
|
|
138
|
-
const assetId = generic_1.appendHexPrefix(token.tokenAddress);
|
|
139
|
-
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
|
|
140
|
-
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
138
|
+
const assetId = (0, generic_1.appendHexPrefix)(token.tokenAddress);
|
|
139
|
+
const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(token));
|
|
140
|
+
const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
|
|
141
141
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
|
|
142
142
|
const swthAddress = ethers_1.ethers.utils.hexlify(address);
|
|
143
143
|
const contractAddress = this.getLockProxyAddress();
|
|
@@ -188,16 +188,16 @@ class ETHClient {
|
|
|
188
188
|
return "insufficient balance";
|
|
189
189
|
}
|
|
190
190
|
const networkConfig = this.getNetworkConfig();
|
|
191
|
-
const assetId = generic_1.appendHexPrefix(tokenWithExternalBalances.tokenAddress);
|
|
192
|
-
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(tokenWithExternalBalances));
|
|
193
|
-
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
191
|
+
const assetId = (0, generic_1.appendHexPrefix)(tokenWithExternalBalances.tokenAddress);
|
|
192
|
+
const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(tokenWithExternalBalances));
|
|
193
|
+
const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
|
|
194
194
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(tokenWithExternalBalances.id));
|
|
195
195
|
const nonce = Math.floor(Math.random() * 1000000000); // random nonce to prevent replay attacks
|
|
196
196
|
const message = ethers_1.ethers.utils.solidityKeccak256(["string", "address", "bytes", "bytes", "bytes", "uint256", "uint256", "uint256"], ["sendTokens", assetId, targetProxyHash, toAssetHash, feeAddress, amount, feeAmount, nonce]);
|
|
197
197
|
// logger("sendDeposit message", message)
|
|
198
198
|
let signatureResult;
|
|
199
199
|
const { address, signature } = yield getSignatureCallback(message);
|
|
200
|
-
const signatureBytes = ethers_1.ethers.utils.arrayify(generic_1.appendHexPrefix(signature));
|
|
200
|
+
const signatureBytes = ethers_1.ethers.utils.arrayify((0, generic_1.appendHexPrefix)(signature));
|
|
201
201
|
const rsv = ethers_1.ethers.utils.splitSignature(signatureBytes);
|
|
202
202
|
// logger("sign result", address, signature)
|
|
203
203
|
signatureResult = {
|
|
@@ -236,7 +236,7 @@ class ETHClient {
|
|
|
236
236
|
if (!feeInfo.deposit_fee) {
|
|
237
237
|
throw new Error("unsupported token");
|
|
238
238
|
}
|
|
239
|
-
if (blockchain_1.blockchainForChainId(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
|
|
239
|
+
if ((0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
|
|
240
240
|
throw new Error("unsupported token");
|
|
241
241
|
}
|
|
242
242
|
let feeAmount = ethers_1.ethers.BigNumber.from(feeInfo.deposit_fee);
|
|
@@ -302,7 +302,7 @@ class ETHClient {
|
|
|
302
302
|
getTargetProxyHash(token) {
|
|
303
303
|
const networkConfig = this.getNetworkConfig();
|
|
304
304
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
305
|
-
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
305
|
+
const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
306
306
|
return addressHex;
|
|
307
307
|
}
|
|
308
308
|
getProvider() {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GrpcQueryClient } from "../util/type";
|
|
2
|
+
import * as grpc from "@grpc/grpc-js";
|
|
3
|
+
export declare class GrpcNodeQueryClient implements GrpcQueryClient {
|
|
4
|
+
private host;
|
|
5
|
+
private options;
|
|
6
|
+
private client;
|
|
7
|
+
constructor(host: string, options?: {
|
|
8
|
+
metadata?: grpc.Metadata;
|
|
9
|
+
});
|
|
10
|
+
request(serviceName: string, methodName: string, data: Uint8Array): Promise<Uint8Array>;
|
|
11
|
+
}
|
|
12
|
+
export default GrpcNodeQueryClient;
|