carbon-js-sdk 0.4.26-beta.2 → 0.4.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CarbonSDK.d.ts +2 -12
- package/lib/CarbonSDK.js +5 -37
- package/lib/clients/CarbonQueryClient.d.ts +2 -15
- package/lib/clients/CarbonQueryClient.js +48 -60
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/NEOClient.js +8 -12
- 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/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 +5 -5
- package/lib/codec/bank/genesis.d.ts +3 -3
- package/lib/codec/bank/query.d.ts +6 -19
- package/lib/codec/bank/query.js +29 -148
- 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 +9 -37
- package/lib/codec/broker/amm.js +6 -185
- 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 +5 -5
- package/lib/codec/broker/genesis.js +9 -9
- 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/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 +49 -49
- 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 +28 -69
- package/lib/codec/cosmos/group/v1/query.js +1 -124
- 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 -10
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +8 -11
- package/lib/codec/cosmos-models.js +1 -5
- 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 +1 -5
- package/lib/codec/evmbank/genesis.d.ts +4 -4
- package/lib/codec/evmbank/query.d.ts +4 -4
- 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 +4 -4
- 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/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 +1 -5
- package/lib/codec/index.d.ts +4 -53
- package/lib/codec/index.js +813 -24907
- 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 +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 +8 -8
- 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 -6
- package/lib/codec/market/genesis.js +2 -33
- package/lib/codec/market/market.d.ts +7 -15
- package/lib/codec/market/proposal.d.ts +5 -5
- package/lib/codec/market/query.d.ts +8 -101
- package/lib/codec/market/query.js +1 -420
- package/lib/codec/market/tx.d.ts +13 -110
- package/lib/codec/market/tx.js +7 -553
- 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 +7 -7
- package/lib/codec/oracle/proposal.d.ts +3 -3
- package/lib/codec/oracle/query.d.ts +22 -22
- 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/perpsliquidity/event.d.ts +10 -10
- package/lib/codec/perpsliquidity/genesis.d.ts +4 -4
- package/lib/codec/perpsliquidity/params.d.ts +3 -3
- package/lib/codec/perpsliquidity/pool.d.ts +10 -10
- package/lib/codec/perpsliquidity/query.d.ts +16 -16
- package/lib/codec/perpsliquidity/tx.d.ts +16 -16
- package/lib/codec/polynetwork-models.js +1 -5
- 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 +6 -6
- 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 +47 -47
- package/lib/codec/tendermint/crypto/keys.d.ts +4 -4
- 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 +16 -16
- 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 +1 -5
- package/lib/constant/index.js +1 -5
- package/lib/constant/network.d.ts +1 -9
- package/lib/constant/network.js +5 -19
- package/lib/constant/node.d.ts +1 -1
- package/lib/constant/walletProvider.d.ts +1 -3
- package/lib/constant/walletProvider.js +0 -3
- package/lib/eth/index.js +1 -5
- package/lib/hydrogen/index.js +1 -5
- package/lib/hydrogen/transfer.d.ts +2 -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/alliance.d.ts +43 -0
- package/lib/modules/alliance.js +120 -0
- package/lib/modules/cdp.d.ts +1 -1
- package/lib/modules/cdp.js +85 -98
- 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.d.ts +2 -5
- package/lib/modules/index.js +3 -10
- package/lib/modules/liquiditypool.js +1 -1
- package/lib/modules/market.d.ts +0 -34
- package/lib/modules/market.js +1 -73
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
- package/lib/provider/account/EthLedgerAccount/index.js +1 -5
- 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 -5
- package/lib/provider/amino/types/admin.js +28 -32
- package/lib/provider/amino/types/bank.js +2 -6
- package/lib/provider/amino/types/broker.js +2 -6
- package/lib/provider/amino/types/cdp.js +26 -30
- package/lib/provider/amino/types/coin.js +5 -9
- package/lib/provider/amino/types/evm.js +3 -7
- 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 -29
- package/lib/provider/amino/types/ibc.js +2 -6
- package/lib/provider/amino/types/index.d.ts +0 -3
- package/lib/provider/amino/types/index.js +1 -7
- package/lib/provider/amino/types/leverage.js +2 -6
- package/lib/provider/amino/types/liquidityPool.js +8 -15
- package/lib/provider/amino/types/market.js +3 -45
- package/lib/provider/amino/types/oracle.js +2 -12
- package/lib/provider/amino/types/order.js +5 -9
- package/lib/provider/amino/types/perpsliquidity.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 +2 -2
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/keplr/KeplrAccount.d.ts +0 -2
- package/lib/provider/keplr/KeplrAccount.js +0 -38
- package/lib/provider/leap/LeapAccount.js +0 -4
- package/lib/provider/ledger/ledger.js +5 -8
- package/lib/provider/metamask/MetaMask.d.ts +2 -27
- package/lib/provider/metamask/MetaMask.js +13 -322
- package/lib/provider/o3/O3Types.d.ts +1 -1
- package/lib/provider/o3/O3Wallet.js +11 -18
- package/lib/provider/o3/index.js +1 -5
- package/lib/provider/zilpay/Zilpay.js +4 -4
- package/lib/provider/zilpay/index.js +1 -5
- package/lib/util/address.d.ts +5 -9
- package/lib/util/address.js +14 -29
- package/lib/util/api.d.ts +3 -3
- package/lib/util/api.js +4 -4
- package/lib/util/blockchain.d.ts +10 -9
- package/lib/util/blockchain.js +3 -9
- 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/index.js +1 -5
- package/lib/util/legacyEIP712.d.ts +2 -2
- package/lib/util/legacyEIP712.js +2 -2
- package/lib/util/number.d.ts +4 -4
- package/lib/util/number.js +5 -5
- package/lib/util/tx.d.ts +3 -42
- package/lib/util/tx.js +1 -5
- package/lib/util/type.d.ts +1 -1
- package/lib/wallet/CarbonSigner.d.ts +4 -21
- package/lib/wallet/CarbonSigner.js +7 -26
- package/lib/wallet/CarbonSigningClient.d.ts +0 -1
- package/lib/wallet/CarbonSigningClient.js +10 -58
- package/lib/wallet/CarbonWallet.d.ts +3 -39
- package/lib/wallet/CarbonWallet.js +26 -205
- 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 +6 -7
package/lib/CarbonSDK.d.ts
CHANGED
|
@@ -4,12 +4,10 @@ import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
|
|
4
4
|
import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
|
|
5
5
|
import * as clients from "./clients";
|
|
6
6
|
import N3Client from "./clients/N3Client";
|
|
7
|
-
import { AdminModule, BankModule, BrokerModule, CDPModule, CoinModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PositionModule, ProfileModule, SubAccountModule, XChainModule
|
|
7
|
+
import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
|
|
8
8
|
import { StakingModule } from "./modules/staking";
|
|
9
9
|
import { CosmosLedger, Keplr, LeapExtended } from "./provider";
|
|
10
10
|
import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts } from "./wallet";
|
|
11
|
-
import { MetaMask } from "./provider/metamask/MetaMask";
|
|
12
|
-
import { ethers } from "ethers";
|
|
13
11
|
export { CarbonTx } from "./util";
|
|
14
12
|
export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
|
|
15
13
|
export { DenomPrefix } from "./constant";
|
|
@@ -17,7 +15,6 @@ export interface CarbonSDKOpts {
|
|
|
17
15
|
network: Network;
|
|
18
16
|
tmClient: Tendermint34Client;
|
|
19
17
|
chainId?: string;
|
|
20
|
-
evmChainId?: string;
|
|
21
18
|
token?: TokenClient;
|
|
22
19
|
config?: Partial<NetworkConfig>;
|
|
23
20
|
defaultTimeoutBlocks?: number;
|
|
@@ -44,7 +41,6 @@ declare class CarbonSDK {
|
|
|
44
41
|
readonly query: CarbonQueryClient;
|
|
45
42
|
insights: InsightsQueryClient;
|
|
46
43
|
hydrogen: HydrogenClient;
|
|
47
|
-
evmJsonRpc: ethers.providers.JsonRpcProvider;
|
|
48
44
|
wallet?: CarbonWallet;
|
|
49
45
|
network: Network;
|
|
50
46
|
configOverride: Partial<NetworkConfig>;
|
|
@@ -52,9 +48,9 @@ declare class CarbonSDK {
|
|
|
52
48
|
tmClient: Tendermint34Client;
|
|
53
49
|
token: TokenClient;
|
|
54
50
|
admin: AdminModule;
|
|
51
|
+
alliance: AllianceModule;
|
|
55
52
|
order: OrderModule;
|
|
56
53
|
lp: LiquidityPoolModule;
|
|
57
|
-
plp: PerpsLiquidityModule;
|
|
58
54
|
subaccount: SubAccountModule;
|
|
59
55
|
profile: ProfileModule;
|
|
60
56
|
cdp: CDPModule;
|
|
@@ -70,9 +66,6 @@ declare class CarbonSDK {
|
|
|
70
66
|
fee: FeeModule;
|
|
71
67
|
ibc: IBCModule;
|
|
72
68
|
xchain: XChainModule;
|
|
73
|
-
evm: EvmModule;
|
|
74
|
-
evmmerge: EvmMergeModule;
|
|
75
|
-
feemarket: FeemarketModule;
|
|
76
69
|
neo: NEOClient;
|
|
77
70
|
eth: ETHClient;
|
|
78
71
|
bsc: ETHClient;
|
|
@@ -82,7 +75,6 @@ declare class CarbonSDK {
|
|
|
82
75
|
zil: ZILClient;
|
|
83
76
|
n3: N3Client;
|
|
84
77
|
chainId: string;
|
|
85
|
-
evmChainId: string;
|
|
86
78
|
constructor(opts: CarbonSDKOpts);
|
|
87
79
|
static instance(opts?: CarbonSDKInitOpts): Promise<CarbonSDK>;
|
|
88
80
|
static instanceWithWallet(wallet: CarbonWallet, sdkOpts?: CarbonSDKInitOpts): Promise<ConnectedCarbonSDK>;
|
|
@@ -92,7 +84,6 @@ declare class CarbonSDK {
|
|
|
92
84
|
static instanceWithLedger(ledger: CosmosLedger, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
93
85
|
static instanceWithKeplr(keplr: Keplr, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
94
86
|
static instanceWithLeap(leap: LeapExtended, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
95
|
-
static instanceWithMetamask(metamask: MetaMask, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
96
87
|
static instanceViewOnly(bech32Address: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
97
88
|
initialize(): Promise<CarbonSDK>;
|
|
98
89
|
clone(): CarbonSDK;
|
|
@@ -105,7 +96,6 @@ declare class CarbonSDK {
|
|
|
105
96
|
connectWithLedger(ledger: CosmosLedger, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
106
97
|
connectWithKeplr(keplr: Keplr, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
107
98
|
connectWithLeap(leap: LeapExtended, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
108
|
-
connectWithMetamask(metamask: MetaMask, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
109
99
|
connectViewOnly(bech32Address: string, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
110
100
|
getConfig(): NetworkConfig;
|
|
111
101
|
getTokenClient(): TokenClient;
|
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];
|
|
@@ -47,7 +43,6 @@ const staking_1 = require("./modules/staking");
|
|
|
47
43
|
const provider_1 = require("./provider");
|
|
48
44
|
const blockchain_1 = require("./util/blockchain");
|
|
49
45
|
const wallet_1 = require("./wallet");
|
|
50
|
-
const ethers_1 = require("ethers");
|
|
51
46
|
var util_2 = require("./util");
|
|
52
47
|
Object.defineProperty(exports, "CarbonTx", { enumerable: true, get: function () { return util_2.CarbonTx; } });
|
|
53
48
|
var wallet_2 = require("./wallet");
|
|
@@ -65,23 +60,20 @@ const DEFAULT_SDK_INIT_OPTS = {
|
|
|
65
60
|
*/
|
|
66
61
|
class CarbonSDK {
|
|
67
62
|
constructor(opts) {
|
|
68
|
-
var _a, _b, _c, _d, _e
|
|
63
|
+
var _a, _b, _c, _d, _e;
|
|
69
64
|
this.network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
|
|
70
65
|
this.configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
|
|
71
66
|
this.networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[this.network], this.configOverride);
|
|
72
67
|
this.tmClient = opts.tmClient;
|
|
73
68
|
this.chainId = (_d = (_c = opts.chainId) !== null && _c !== void 0 ? _c : constant_1.CarbonChainIDs[this.network]) !== null && _d !== void 0 ? _d : constant_1.CarbonChainIDs[constant_1.Network.MainNet];
|
|
74
|
-
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];
|
|
75
69
|
this.query = new clients_1.CarbonQueryClient(opts.tmClient);
|
|
76
70
|
this.insights = new clients_1.InsightsQueryClient(this.networkConfig);
|
|
77
|
-
this.token = (
|
|
78
|
-
this.hydrogen = new clients_1.HydrogenClient(this.networkConfig, this.token);
|
|
79
|
-
this.evmJsonRpc = new ethers_1.ethers.providers.JsonRpcProvider(constant_1.NetworkConfigs[this.network].evmJsonRpcUrl);
|
|
71
|
+
this.token = (_e = opts.token) !== null && _e !== void 0 ? _e : clients_1.TokenClient.instance(this.query, this);
|
|
80
72
|
this.hydrogen = clients_1.HydrogenClient.instance(this.networkConfig, this.token);
|
|
81
73
|
this.admin = new modules_1.AdminModule(this);
|
|
74
|
+
this.alliance = new modules_1.AllianceModule(this);
|
|
82
75
|
this.order = new modules_1.OrderModule(this);
|
|
83
76
|
this.lp = new modules_1.LiquidityPoolModule(this);
|
|
84
|
-
this.plp = new modules_1.PerpsLiquidityModule(this);
|
|
85
77
|
this.subaccount = new modules_1.SubAccountModule(this);
|
|
86
78
|
this.profile = new modules_1.ProfileModule(this);
|
|
87
79
|
this.cdp = new modules_1.CDPModule(this);
|
|
@@ -97,9 +89,6 @@ class CarbonSDK {
|
|
|
97
89
|
this.fee = new modules_1.FeeModule(this);
|
|
98
90
|
this.ibc = new modules_1.IBCModule(this);
|
|
99
91
|
this.xchain = new modules_1.XChainModule(this);
|
|
100
|
-
this.evm = new modules_1.EvmModule(this);
|
|
101
|
-
this.evmmerge = new modules_1.EvmMergeModule(this);
|
|
102
|
-
this.feemarket = new modules_1.FeemarketModule(this);
|
|
103
92
|
this.neo = clients_1.NEOClient.instance({
|
|
104
93
|
configProvider: this,
|
|
105
94
|
blockchain: blockchain_1.Blockchain.Neo,
|
|
@@ -144,8 +133,7 @@ class CarbonSDK {
|
|
|
144
133
|
const network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
|
|
145
134
|
const configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
|
|
146
135
|
const networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[network], configOverride);
|
|
147
|
-
|
|
148
|
-
const tmClient = (_c = opts.tmClient) !== null && _c !== void 0 ? _c : util_1.GenericUtils.modifyTmClient(yield tendermint_rpc_1.Tendermint34Client.create(new tendermint_rpc_1.HttpBatchClient(networkConfig.tmRpcUrl)));
|
|
136
|
+
const tmClient = (_c = opts.tmClient) !== null && _c !== void 0 ? _c : util_1.GenericUtils.modifyTmClient(yield tendermint_rpc_1.Tendermint34Client.connect(networkConfig.tmRpcUrl));
|
|
149
137
|
const defaultTimeoutBlocks = opts.defaultTimeoutBlocks;
|
|
150
138
|
const chainId = (_d = (yield tmClient.status())) === null || _d === void 0 ? void 0 : _d.nodeInfo.network;
|
|
151
139
|
const sdk = new CarbonSDK({ network, config: configOverride, tmClient, defaultTimeoutBlocks, chainId });
|
|
@@ -200,12 +188,6 @@ class CarbonSDK {
|
|
|
200
188
|
return sdk.connectWithLeap(leap, walletOpts);
|
|
201
189
|
});
|
|
202
190
|
}
|
|
203
|
-
static instanceWithMetamask(metamask, sdkOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
204
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
-
const sdk = yield CarbonSDK.instance(sdkOpts);
|
|
206
|
-
return sdk.connectWithMetamask(metamask, walletOpts);
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
191
|
static instanceViewOnly(bech32Address, sdkOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
210
192
|
return __awaiter(this, void 0, void 0, function* () {
|
|
211
193
|
const sdk = yield CarbonSDK.instance(sdkOpts);
|
|
@@ -309,20 +291,6 @@ class CarbonSDK {
|
|
|
309
291
|
return this.connect(wallet);
|
|
310
292
|
});
|
|
311
293
|
}
|
|
312
|
-
connectWithMetamask(metamask, opts) {
|
|
313
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
314
|
-
const evmChainId = this.evmChainId;
|
|
315
|
-
const addressOptions = {
|
|
316
|
-
network: this.networkConfig.network,
|
|
317
|
-
bech32Prefix: this.networkConfig.Bech32Prefix
|
|
318
|
-
};
|
|
319
|
-
const address = yield metamask.defaultAccount();
|
|
320
|
-
const publicKeyHex = yield metamask.getPublicKey(address);
|
|
321
|
-
const publicKeyBase64 = Buffer.from(publicKeyHex, 'hex').toString('base64');
|
|
322
|
-
const wallet = wallet_1.CarbonWallet.withMetamask(metamask, evmChainId, publicKeyBase64, addressOptions, Object.assign(Object.assign({}, opts), { network: this.network, config: this.configOverride }));
|
|
323
|
-
return this.connect(wallet);
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
294
|
connectViewOnly(bech32Address, opts) {
|
|
327
295
|
return __awaiter(this, void 0, void 0, function* () {
|
|
328
296
|
const wallet = wallet_1.CarbonWallet.withAddress(bech32Address, Object.assign(Object.assign({}, opts), { network: this.network, config: this.configOverride }));
|
|
@@ -14,10 +14,6 @@ import { QueryClientImpl as ParamsQueryClient } from "../codec/cosmos/params/v1b
|
|
|
14
14
|
import { QueryClientImpl as SlashingQueryClient } from "../codec/cosmos/slashing/v1beta1/query";
|
|
15
15
|
import { QueryClientImpl as StakingQueryClient } from "../codec/cosmos/staking/v1beta1/query";
|
|
16
16
|
import { QueryClientImpl as UpgradeQueryClient } from "../codec/cosmos/upgrade/v1beta1/query";
|
|
17
|
-
import { QueryClientImpl as EthermintEVMQueryClient } from "../codec/ethermint/evm/v1/query";
|
|
18
|
-
import { QueryClientImpl as EvmMergeQueryClient } from "../codec/evmmerge/query";
|
|
19
|
-
import { QueryClientImpl as EvmBankQueryClient } from "../codec/evmbank/query";
|
|
20
|
-
import { QueryClientImpl as EthermintFeeMarketQueryClient } from "../codec/ethermint/feemarket/v1/query";
|
|
21
17
|
import { QueryClientImpl as FeeQueryClient } from "../codec/fee/query";
|
|
22
18
|
import { QueryClientImpl as HeadersyncQueryClient } from "../codec/headersync/query";
|
|
23
19
|
import { QueryClientImpl as IBCInterchainControlQueryClient } from "../codec/ibc/applications/interchain_accounts/controller/v1/query";
|
|
@@ -31,7 +27,6 @@ import { QueryClientImpl as InsuranceQueryClient } from "../codec/insurance/quer
|
|
|
31
27
|
import { QueryClientImpl as LeverageQueryClient } from "../codec/leverage/query";
|
|
32
28
|
import { QueryClientImpl as LiquidationQueryClient } from "../codec/liquidation/query";
|
|
33
29
|
import { QueryClientImpl as LiquidityPoolQueryClient } from "../codec/liquiditypool/query";
|
|
34
|
-
import { QueryClientImpl as PerpLiquidityPoolQueryClient } from "../codec/perpsliquidity/query";
|
|
35
30
|
import { QueryClientImpl as MarketQueryClient } from "../codec/market/query";
|
|
36
31
|
import { QueryClientImpl as MarketStatsQueryClient } from "../codec/marketstats/query";
|
|
37
32
|
import { QueryClientImpl as MiscQueryClient } from "../codec/misc/query";
|
|
@@ -41,7 +36,7 @@ import { QueryClientImpl as PositionQueryClient } from "../codec/position/query"
|
|
|
41
36
|
import { QueryClientImpl as PricingQueryClient } from "../codec/pricing/query";
|
|
42
37
|
import { QueryClientImpl as ProfileQueryClient } from "../codec/profile/query";
|
|
43
38
|
import { QueryClientImpl as SubaccountQueryClient } from "../codec/subaccount/query";
|
|
44
|
-
import { QueryClientImpl as
|
|
39
|
+
import { QueryClientImpl as AllianceClient } from "../codec/alliance/query";
|
|
45
40
|
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
|
46
41
|
import BlockchainClient from "./BlockchainClient";
|
|
47
42
|
export interface IBCClientGroup {
|
|
@@ -52,10 +47,6 @@ export interface IBCClientGroup {
|
|
|
52
47
|
connection: IBCConnectionQueryClient;
|
|
53
48
|
channel: IBCChannelQueryClient;
|
|
54
49
|
}
|
|
55
|
-
export interface EthermintClientGroup {
|
|
56
|
-
evm: EthermintEVMQueryClient;
|
|
57
|
-
feeMarket: EthermintFeeMarketQueryClient;
|
|
58
|
-
}
|
|
59
50
|
declare class CarbonQueryClient {
|
|
60
51
|
private readonly tmClient;
|
|
61
52
|
adl: ADLQueryClient;
|
|
@@ -69,7 +60,6 @@ declare class CarbonQueryClient {
|
|
|
69
60
|
leverage: LeverageQueryClient;
|
|
70
61
|
liquidation: LiquidationQueryClient;
|
|
71
62
|
liquiditypool: LiquidityPoolQueryClient;
|
|
72
|
-
perpetualpool: PerpLiquidityPoolQueryClient;
|
|
73
63
|
market: MarketQueryClient;
|
|
74
64
|
marketstats: MarketStatsQueryClient;
|
|
75
65
|
misc: MiscQueryClient;
|
|
@@ -91,12 +81,9 @@ declare class CarbonQueryClient {
|
|
|
91
81
|
staking: StakingQueryClient;
|
|
92
82
|
upgrade: UpgradeQueryClient;
|
|
93
83
|
cosmosTm: CosmosTmClient;
|
|
94
|
-
|
|
84
|
+
alliance: AllianceClient;
|
|
95
85
|
chain: BlockchainClient;
|
|
96
86
|
ibc: IBCClientGroup;
|
|
97
|
-
ethermint: EthermintClientGroup;
|
|
98
|
-
evmmerge: EvmMergeQueryClient;
|
|
99
|
-
evmbank: EvmBankQueryClient;
|
|
100
87
|
private baseClient;
|
|
101
88
|
constructor(tmClient: Tendermint34Client);
|
|
102
89
|
getProtobufRpcClient(): import("@cosmjs/stargate").ProtobufRpcClient;
|
|
@@ -19,66 +19,59 @@ const query_13 = require("../codec/cosmos/params/v1beta1/query");
|
|
|
19
19
|
const query_14 = require("../codec/cosmos/slashing/v1beta1/query");
|
|
20
20
|
const query_15 = require("../codec/cosmos/staking/v1beta1/query");
|
|
21
21
|
const query_16 = require("../codec/cosmos/upgrade/v1beta1/query");
|
|
22
|
-
const query_17 = require("../codec/
|
|
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/ibc/
|
|
29
|
-
const query_24 = require("../codec/ibc/
|
|
30
|
-
const query_25 = require("../codec/
|
|
31
|
-
const query_26 = require("../codec/
|
|
32
|
-
const query_27 = require("../codec/
|
|
33
|
-
const query_28 = require("../codec/
|
|
34
|
-
const query_29 = require("../codec/
|
|
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/position/query");
|
|
46
|
-
const query_41 = require("../codec/pricing/query");
|
|
47
|
-
const query_42 = require("../codec/profile/query");
|
|
48
|
-
const query_43 = require("../codec/subaccount/query");
|
|
49
|
-
const query_44 = require("../codec/alliance/query");
|
|
22
|
+
const query_17 = require("../codec/fee/query");
|
|
23
|
+
const query_18 = require("../codec/headersync/query");
|
|
24
|
+
const query_19 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
|
|
25
|
+
const query_20 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
|
|
26
|
+
const query_21 = require("../codec/ibc/applications/transfer/v1/query");
|
|
27
|
+
const query_22 = require("../codec/ibc/core/client/v1/query");
|
|
28
|
+
const query_23 = require("../codec/ibc/core/connection/v1/query");
|
|
29
|
+
const query_24 = require("../codec/ibc/core/channel/v1/query");
|
|
30
|
+
const query_25 = require("../codec/inflation/query");
|
|
31
|
+
const query_26 = require("../codec/insurance/query");
|
|
32
|
+
const query_27 = require("../codec/leverage/query");
|
|
33
|
+
const query_28 = require("../codec/liquidation/query");
|
|
34
|
+
const query_29 = require("../codec/liquiditypool/query");
|
|
35
|
+
const query_30 = require("../codec/market/query");
|
|
36
|
+
const query_31 = require("../codec/marketstats/query");
|
|
37
|
+
const query_32 = require("../codec/misc/query");
|
|
38
|
+
const query_33 = require("../codec/oracle/query");
|
|
39
|
+
const query_34 = require("../codec/order/query");
|
|
40
|
+
const query_35 = require("../codec/position/query");
|
|
41
|
+
const query_36 = require("../codec/pricing/query");
|
|
42
|
+
const query_37 = require("../codec/profile/query");
|
|
43
|
+
const query_38 = require("../codec/subaccount/query");
|
|
44
|
+
const query_39 = require("../codec/alliance/query");
|
|
50
45
|
const stargate_1 = require("@cosmjs/stargate");
|
|
51
46
|
const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
52
47
|
class CarbonQueryClient {
|
|
53
48
|
constructor(tmClient) {
|
|
54
49
|
this.tmClient = tmClient;
|
|
55
50
|
this.baseClient = new stargate_1.QueryClient(this.tmClient);
|
|
56
|
-
const rpcClient =
|
|
51
|
+
const rpcClient = stargate_1.createProtobufRpcClient(this.baseClient);
|
|
57
52
|
this.chain = BlockchainClient_1.default.connectWithTm(this.tmClient);
|
|
58
53
|
this.adl = new query_1.QueryClientImpl(rpcClient);
|
|
54
|
+
this.alliance = new query_39.QueryClientImpl(rpcClient);
|
|
59
55
|
this.book = new query_2.QueryClientImpl(rpcClient);
|
|
60
56
|
this.broker = new query_3.QueryClientImpl(rpcClient);
|
|
61
57
|
this.coin = new query_5.QueryClientImpl(rpcClient);
|
|
62
58
|
this.cdp = new query_4.QueryClientImpl(rpcClient);
|
|
63
|
-
this.fee = new
|
|
64
|
-
this.inflation = new
|
|
65
|
-
this.insurance = new
|
|
66
|
-
this.leverage = new
|
|
67
|
-
this.liquidation = new
|
|
68
|
-
this.liquiditypool = new
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
79
|
-
this.headersync = new query_22.QueryClientImpl(rpcClient);
|
|
80
|
-
this.evmmerge = new query_18.QueryClientImpl(rpcClient);
|
|
81
|
-
this.evmbank = new query_19.QueryClientImpl(rpcClient);
|
|
59
|
+
this.fee = new query_17.QueryClientImpl(rpcClient);
|
|
60
|
+
this.inflation = new query_25.QueryClientImpl(rpcClient);
|
|
61
|
+
this.insurance = new query_26.QueryClientImpl(rpcClient);
|
|
62
|
+
this.leverage = new query_27.QueryClientImpl(rpcClient);
|
|
63
|
+
this.liquidation = new query_28.QueryClientImpl(rpcClient);
|
|
64
|
+
this.liquiditypool = new query_29.QueryClientImpl(rpcClient);
|
|
65
|
+
this.market = new query_30.QueryClientImpl(rpcClient);
|
|
66
|
+
this.marketstats = new query_31.QueryClientImpl(rpcClient);
|
|
67
|
+
this.misc = new query_32.QueryClientImpl(rpcClient);
|
|
68
|
+
this.oracle = new query_33.QueryClientImpl(rpcClient);
|
|
69
|
+
this.order = new query_34.QueryClientImpl(rpcClient);
|
|
70
|
+
this.position = new query_35.QueryClientImpl(rpcClient);
|
|
71
|
+
this.pricing = new query_36.QueryClientImpl(rpcClient);
|
|
72
|
+
this.profile = new query_37.QueryClientImpl(rpcClient);
|
|
73
|
+
this.subaccount = new query_38.QueryClientImpl(rpcClient);
|
|
74
|
+
this.headersync = new query_18.QueryClientImpl(rpcClient);
|
|
82
75
|
this.auth = new query_6.QueryClientImpl(rpcClient);
|
|
83
76
|
this.bank = new query_7.QueryClientImpl(rpcClient);
|
|
84
77
|
this.distribution = new query_9.QueryClientImpl(rpcClient);
|
|
@@ -90,22 +83,17 @@ class CarbonQueryClient {
|
|
|
90
83
|
this.staking = new query_15.QueryClientImpl(rpcClient);
|
|
91
84
|
this.upgrade = new query_16.QueryClientImpl(rpcClient);
|
|
92
85
|
this.cosmosTm = new query_8.ServiceClientImpl(rpcClient);
|
|
93
|
-
this.alliances = new query_44.QueryClientImpl(rpcClient);
|
|
94
86
|
this.ibc = {
|
|
95
|
-
controller: new
|
|
96
|
-
host: new
|
|
97
|
-
transfer: new
|
|
98
|
-
client: new
|
|
99
|
-
connection: new
|
|
100
|
-
channel: new
|
|
101
|
-
};
|
|
102
|
-
this.ethermint = {
|
|
103
|
-
evm: new query_17.QueryClientImpl(rpcClient),
|
|
104
|
-
feeMarket: new query_20.QueryClientImpl(rpcClient),
|
|
87
|
+
controller: new query_19.QueryClientImpl(rpcClient),
|
|
88
|
+
host: new query_20.QueryClientImpl(rpcClient),
|
|
89
|
+
transfer: new query_21.QueryClientImpl(rpcClient),
|
|
90
|
+
client: new query_22.QueryClientImpl(rpcClient),
|
|
91
|
+
connection: new query_23.QueryClientImpl(rpcClient),
|
|
92
|
+
channel: new query_24.QueryClientImpl(rpcClient),
|
|
105
93
|
};
|
|
106
94
|
}
|
|
107
95
|
getProtobufRpcClient() {
|
|
108
|
-
return
|
|
96
|
+
return stargate_1.createProtobufRpcClient(this.baseClient);
|
|
109
97
|
}
|
|
110
98
|
}
|
|
111
99
|
exports.default = CarbonQueryClient;
|
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();
|
|
@@ -99,14 +99,14 @@ class ETHClient {
|
|
|
99
99
|
}
|
|
100
100
|
const carbonNetwork = networkConfig.network;
|
|
101
101
|
const fromTokenId = fromToken.id;
|
|
102
|
-
const fromTokenAddress =
|
|
102
|
+
const fromTokenAddress = 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 =
|
|
109
|
+
const feeAddress = 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 =
|
|
139
|
-
const targetProxyHash =
|
|
140
|
-
const feeAddress =
|
|
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);
|
|
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 =
|
|
192
|
-
const targetProxyHash =
|
|
193
|
-
const feeAddress =
|
|
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);
|
|
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(
|
|
200
|
+
const signatureBytes = ethers_1.ethers.utils.arrayify(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 (
|
|
239
|
+
if (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 =
|
|
305
|
+
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
306
306
|
return addressHex;
|
|
307
307
|
}
|
|
308
308
|
getProvider() {
|
|
@@ -29,7 +29,7 @@ exports.HydrogenEndpoints = {
|
|
|
29
29
|
const formatDateField = (value) => {
|
|
30
30
|
if (typeof value !== "string")
|
|
31
31
|
return null;
|
|
32
|
-
return
|
|
32
|
+
return dayjs_1.default(value);
|
|
33
33
|
};
|
|
34
34
|
// temporary function to parse okt/okc blockchain
|
|
35
35
|
// to remove when automatic deposit/withdraw feature is deployed
|
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];
|
|
@@ -73,13 +69,13 @@ class NEOClient {
|
|
|
73
69
|
?
|
|
74
70
|
!!sdk.token.getBlockchainV2(token.denom) && (blockchain_1.BLOCKCHAIN_V2_TO_V1_MAPPING[sdk.token.getBlockchainV2(token.denom)] == this.blockchain)
|
|
75
71
|
:
|
|
76
|
-
|
|
72
|
+
blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain;
|
|
77
73
|
return (isCorrectBlockchain || token.denom === "swth") && token.tokenAddress.length == 40 && token.bridgeAddress.length == 40;
|
|
78
74
|
});
|
|
79
75
|
const client = new Neon.rpc.RPCClient(url, "2.5.2"); // TODO: should we change the RPC version??
|
|
80
76
|
// NOTE: fetching of tokens is chunked in sets of 15 as we may hit
|
|
81
77
|
// the gas limit on the RPC node and error out otherwise
|
|
82
|
-
const promises =
|
|
78
|
+
const promises = lodash_1.chunk(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
|
|
83
79
|
var _a, _b, _c;
|
|
84
80
|
let acc = {};
|
|
85
81
|
for (const token of partition) {
|
|
@@ -121,8 +117,8 @@ class NEOClient {
|
|
|
121
117
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
122
118
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
123
119
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(swthAddress, networkConfig.network);
|
|
124
|
-
const toAddress =
|
|
125
|
-
const zeroAddressHex =
|
|
120
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
121
|
+
const zeroAddressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
|
|
126
122
|
const amount = ethers_1.ethers.BigNumber.from(token.externalBalance);
|
|
127
123
|
const feeAmount = ethers_1.ethers.BigNumber.from(feeAmountInput !== null && feeAmountInput !== void 0 ? feeAmountInput : "100000000");
|
|
128
124
|
const feeAddress = feeAmount.isZero() ? zeroAddressHex : networkConfig.feeAddress;
|
|
@@ -169,7 +165,7 @@ class NEOClient {
|
|
|
169
165
|
const fromAddress = util_1.AddressUtils.NEOAddress.publicKeyToAddress(publicKeyOutput.publicKey);
|
|
170
166
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
171
167
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
172
|
-
const toAddress =
|
|
168
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
173
169
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
174
170
|
if (amount.lt(feeAmount)) {
|
|
175
171
|
throw new Error("Invalid amount");
|
|
@@ -205,7 +201,7 @@ class NEOClient {
|
|
|
205
201
|
const fromAddress = ledger.scriptHash;
|
|
206
202
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
207
203
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
208
|
-
const toAddress =
|
|
204
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
209
205
|
const feeAddress = networkConfig.feeAddress;
|
|
210
206
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
211
207
|
if (amount.lt(feeAmount)) {
|
|
@@ -325,7 +321,7 @@ class NEOClient {
|
|
|
325
321
|
getTargetProxyHash(token) {
|
|
326
322
|
const networkConfig = this.getNetworkConfig();
|
|
327
323
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
328
|
-
const addressHex =
|
|
324
|
+
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
329
325
|
return addressHex;
|
|
330
326
|
}
|
|
331
327
|
getNetworkConfig() {
|
|
@@ -570,7 +570,7 @@ class TokenClient {
|
|
|
570
570
|
if (!token)
|
|
571
571
|
return undefined;
|
|
572
572
|
const bridge = this.getBridgeFromToken(token);
|
|
573
|
-
if (!bridge || !
|
|
573
|
+
if (!bridge || !blockchain_1.isIbcBridge(bridge))
|
|
574
574
|
return undefined;
|
|
575
575
|
return bridge.chain_id_name;
|
|
576
576
|
}
|
|
@@ -579,7 +579,7 @@ class TokenClient {
|
|
|
579
579
|
// get swth on osmosis
|
|
580
580
|
const osmoTmClient = yield tendermint_rpc_1.Tendermint34Client.connect(network_1.publicRpcNodes.Osmosis);
|
|
581
581
|
const osmoClient = new stargate_1.QueryClient(osmoTmClient);
|
|
582
|
-
const osmosRpcClient =
|
|
582
|
+
const osmosRpcClient = stargate_1.createProtobufRpcClient(osmoClient);
|
|
583
583
|
const osmoIbcClient = new query_1.QueryClientImpl(osmosRpcClient);
|
|
584
584
|
const osmoDenomTraces = yield osmoIbcClient.DenomTraces({
|
|
585
585
|
pagination: pagination_1.PageRequest.fromPartial({
|
|
@@ -672,7 +672,7 @@ class TokenClient {
|
|
|
672
672
|
processTokenPrices(tokenPrices) {
|
|
673
673
|
return tokenPrices.reduce((prevPrices, price) => {
|
|
674
674
|
const newPrev = prevPrices;
|
|
675
|
-
newPrev[price.denom] =
|
|
675
|
+
newPrev[price.denom] = number_1.bnOrZero(price.twap).shiftedBy(-constant_1.decTypeDecimals);
|
|
676
676
|
return newPrev;
|
|
677
677
|
}, {});
|
|
678
678
|
}
|