carbon-js-sdk 0.7.2-beta.2 → 0.7.2
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.js +6 -2
- package/lib/clients/BatchQueryClient.js +4 -4
- package/lib/clients/CarbonQueryClient.js +1 -1
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/InsightsQueryClient.d.ts +7 -0
- package/lib/clients/InsightsQueryClient.js +17 -3
- package/lib/clients/NEOClient.js +12 -8
- package/lib/clients/TokenClient.js +2 -2
- 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 +6 -6
- package/lib/codec/book/event.d.ts +3 -3
- package/lib/codec/book/genesis.d.ts +3 -3
- package/lib/codec/book/legacy.d.ts +3 -3
- package/lib/codec/book/query.d.ts +12 -12
- package/lib/codec/broker/amm.d.ts +5 -5
- package/lib/codec/broker/candlestick.d.ts +3 -3
- package/lib/codec/broker/event.d.ts +4 -4
- 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/carbon-models.js +5 -1
- 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 +53 -53
- 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 +87 -87
- 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/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 +4 -4
- package/lib/codec/insurance/tx.d.ts +4 -4
- package/lib/codec/leverage/event.d.ts +3 -3
- package/lib/codec/leverage/genesis.d.ts +3 -3
- package/lib/codec/leverage/leverage.d.ts +4 -4
- package/lib/codec/leverage/query.d.ts +6 -6
- package/lib/codec/leverage/tx.d.ts +4 -4
- package/lib/codec/liquidation/genesis.d.ts +4 -4
- package/lib/codec/liquidation/liquidation.d.ts +3 -3
- package/lib/codec/liquidation/outstanding_position.d.ts +4 -4
- package/lib/codec/liquidation/query.d.ts +6 -6
- package/lib/codec/liquidation/quote_changes.d.ts +3 -3
- package/lib/codec/liquiditypool/event.d.ts +15 -15
- 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 +31 -31
- 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/perpspool/event.d.ts +9 -9
- package/lib/codec/perpspool/genesis.d.ts +6 -6
- package/lib/codec/perpspool/market.d.ts +8 -8
- package/lib/codec/perpspool/params.d.ts +3 -3
- package/lib/codec/perpspool/pool.d.ts +8 -8
- package/lib/codec/perpspool/query.d.ts +20 -20
- package/lib/codec/perpspool/tx.d.ts +18 -18
- package/lib/codec/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/legacy.d.ts +3 -3
- package/lib/codec/subaccount/query.d.ts +17 -17
- package/lib/codec/subaccount/subaccount.d.ts +6 -6
- 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 +2 -1
- package/lib/insights/common.js +1 -0
- package/lib/insights/competition.d.ts +15 -0
- package/lib/insights/index.js +5 -1
- package/lib/insights/position.d.ts +1 -1
- package/lib/modules/cdp.js +45 -45
- package/lib/modules/cosmwasm.js +2 -2
- 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/modules/test.d.ts +0 -0
- package/lib/modules/test.js +1 -0
- 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 +31 -27
- package/lib/provider/amino/types/coin.js +9 -5
- package/lib/provider/amino/types/erc20.js +7 -3
- 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/perpspool.js +11 -7
- 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 +6 -6
- package/lib/provider/leap/LeapAccount.js +2 -2
- package/lib/provider/ledger/ledger.js +9 -6
- package/lib/provider/metamask/MetaMask.d.ts +1 -1
- package/lib/provider/metamask/MetaMask.js +28 -24
- package/lib/provider/metamask/error.d.ts +1 -1
- 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 +1 -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 +11 -11
- 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 +1 -1
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +0 -76
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +0 -424
package/lib/modules/cdp.js
CHANGED
|
@@ -530,7 +530,7 @@ class CDPModule extends base_1.default {
|
|
|
530
530
|
let availableBorrowsUsd = number_1.BN_ZERO;
|
|
531
531
|
let currLiquidationThreshold = number_1.BN_ZERO;
|
|
532
532
|
for (let i = 0; i < collaterals.length; i++) {
|
|
533
|
-
const amount = number_1.bnOrZero(collaterals[i].collateralAmount);
|
|
533
|
+
const amount = (0, number_1.bnOrZero)(collaterals[i].collateralAmount);
|
|
534
534
|
if (amount.isZero()) {
|
|
535
535
|
continue; // no collateral for denom
|
|
536
536
|
}
|
|
@@ -547,9 +547,9 @@ class CDPModule extends base_1.default {
|
|
|
547
547
|
if (!assetParam) {
|
|
548
548
|
continue;
|
|
549
549
|
}
|
|
550
|
-
const ltv = number_1.bnOrZero(assetParam.loanToValue).div(number_1.BN_10000);
|
|
550
|
+
const ltv = (0, number_1.bnOrZero)(assetParam.loanToValue).div(number_1.BN_10000);
|
|
551
551
|
const availableBorrowUsd = collateralUsdVal.times(ltv);
|
|
552
|
-
const liquidationThreshold = number_1.bnOrZero(assetParam.liquidationThreshold).div(number_1.BN_10000);
|
|
552
|
+
const liquidationThreshold = (0, number_1.bnOrZero)(assetParam.liquidationThreshold).div(number_1.BN_10000);
|
|
553
553
|
const liquidationThresholdVal = collateralUsdVal.times(liquidationThreshold);
|
|
554
554
|
totalCollateralsUsd = totalCollateralsUsd.plus(collateralUsdVal);
|
|
555
555
|
availableBorrowsUsd = availableBorrowsUsd.plus(availableBorrowUsd);
|
|
@@ -560,7 +560,7 @@ class CDPModule extends base_1.default {
|
|
|
560
560
|
let totalDebtsUsd = number_1.BN_ZERO;
|
|
561
561
|
const debtsUsdRequests = [];
|
|
562
562
|
for (let i = 0; i < debts.length; i++) {
|
|
563
|
-
const amount = number_1.bnOrZero(debts[i].principalDebt);
|
|
563
|
+
const amount = (0, number_1.bnOrZero)(debts[i].principalDebt);
|
|
564
564
|
const denom = debts[i].denom;
|
|
565
565
|
if (amount.isZero()) {
|
|
566
566
|
continue;
|
|
@@ -583,7 +583,7 @@ class CDPModule extends base_1.default {
|
|
|
583
583
|
if (stablecoinDebtInfo) {
|
|
584
584
|
const accountStablecoin = yield sdk.query.cdp.AccountStablecoin({ address: account });
|
|
585
585
|
const stablecoinDecimals = (_a = (yield this.sdkProvider.getTokenClient().getDecimals(stablecoinDebtInfo.denom))) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
586
|
-
const stablecoinDebtAmount = number_1.bnOrZero(accountStablecoin.principalDebt).plus(number_1.bnOrZero(accountStablecoin.interestDebt));
|
|
586
|
+
const stablecoinDebtAmount = (0, number_1.bnOrZero)(accountStablecoin.principalDebt).plus((0, number_1.bnOrZero)(accountStablecoin.interestDebt));
|
|
587
587
|
stablecoinDebtUsd = stablecoinDebtAmount.shiftedBy(-stablecoinDecimals);
|
|
588
588
|
totalDebtsUsd = totalDebtsUsd.plus(stablecoinDebtUsd);
|
|
589
589
|
}
|
|
@@ -604,7 +604,7 @@ class CDPModule extends base_1.default {
|
|
|
604
604
|
const sdk = this.sdkProvider;
|
|
605
605
|
const cdpAddress = this.getCdpModuleAddress();
|
|
606
606
|
const balanceRsp = yield sdk.query.bank.Balance(query_2.QueryBalanceRequest.fromPartial({ address: cdpAddress, denom }));
|
|
607
|
-
return number_1.bnOrZero((_a = balanceRsp.balance) === null || _a === void 0 ? void 0 : _a.amount);
|
|
607
|
+
return (0, number_1.bnOrZero)((_a = balanceRsp.balance) === null || _a === void 0 ? void 0 : _a.amount);
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
getCdpToActualRatio(cdpDenom, interestFee) {
|
|
@@ -619,14 +619,14 @@ class CDPModule extends base_1.default {
|
|
|
619
619
|
const cdpAmountRsp = supplyRsp.amount;
|
|
620
620
|
if (!cdpAmountRsp)
|
|
621
621
|
throw new Error("unable to retrieve cdp token supply");
|
|
622
|
-
const cdpAmount = number_1.bnOrZero(cdpAmountRsp.amount);
|
|
622
|
+
const cdpAmount = (0, number_1.bnOrZero)(cdpAmountRsp.amount);
|
|
623
623
|
if (!balanceRsp.balance)
|
|
624
624
|
throw new Error("unable to retrieve cdp module balance");
|
|
625
625
|
const debtInfo = debtInfoRsp.debtInfo;
|
|
626
626
|
if (!debtInfo)
|
|
627
627
|
throw new Error("unable to retrieve debt info");
|
|
628
628
|
const owedAmount = yield this.getTotalTokenDebt(denom, debtInfo, interestFee);
|
|
629
|
-
const actualAmount = number_1.bnOrZero(balanceRsp.balance.amount).plus(owedAmount);
|
|
629
|
+
const actualAmount = (0, number_1.bnOrZero)(balanceRsp.balance.amount).plus(owedAmount);
|
|
630
630
|
if (!owedAmount)
|
|
631
631
|
throw new Error("unable to retrieve total token debt");
|
|
632
632
|
return cdpAmount.div(actualAmount);
|
|
@@ -649,8 +649,8 @@ class CDPModule extends base_1.default {
|
|
|
649
649
|
const debtAmtRequests = [];
|
|
650
650
|
for (let i = 0; i < allDebts.length; i++) {
|
|
651
651
|
const denom = allDebts[i].denom;
|
|
652
|
-
const interest = number_1.bnOrZero(allDebts[i].totalAccumulatedInterest);
|
|
653
|
-
const principal = number_1.bnOrZero(allDebts[i].totalPrincipal);
|
|
652
|
+
const interest = (0, number_1.bnOrZero)(allDebts[i].totalAccumulatedInterest);
|
|
653
|
+
const principal = (0, number_1.bnOrZero)(allDebts[i].totalPrincipal);
|
|
654
654
|
const debtAmt = interest.plus(principal);
|
|
655
655
|
debtAmtRequests.push(this.getTokenUsdVal(denom, debtAmt));
|
|
656
656
|
}
|
|
@@ -666,7 +666,7 @@ class CDPModule extends base_1.default {
|
|
|
666
666
|
const stablecoinDebtRes = yield this.sdkProvider.query.cdp.StablecoinDebt({});
|
|
667
667
|
if (stablecoinDebtRes.stablecoinDebtInfo) {
|
|
668
668
|
const debtInfo = stablecoinDebtRes.stablecoinDebtInfo;
|
|
669
|
-
const debtAmt = number_1.bnOrZero(debtInfo.totalPrincipal).plus(number_1.bnOrZero(debtInfo.totalAccumulatedInterest));
|
|
669
|
+
const debtAmt = (0, number_1.bnOrZero)(debtInfo.totalPrincipal).plus((0, number_1.bnOrZero)(debtInfo.totalAccumulatedInterest));
|
|
670
670
|
const stablecoinDecimals = (_a = (yield sdk.getTokenClient().getDecimals(debtInfo.denom))) !== null && _a !== void 0 ? _a : 0;
|
|
671
671
|
const debtUsdVal = debtAmt.shiftedBy(-stablecoinDecimals);
|
|
672
672
|
totalDebt = totalDebt.plus(debtUsdVal);
|
|
@@ -691,7 +691,7 @@ class CDPModule extends base_1.default {
|
|
|
691
691
|
const assetParamsPromise = sdk.query.cdp.AssetAll(query_3.QueryAssetAllRequest.fromPartial(Object.assign({}, maxPageLimit)));
|
|
692
692
|
const rateStrategyPromise = sdk.query.cdp.RateStrategyAll(CarbonSDK_1.Carbon.Cdp.QueryRateStrategyAllRequest.fromPartial(Object.assign({}, maxPageLimit)));
|
|
693
693
|
const [collateralPoolBalances, totalSupply, cdpParams, tokenPriceAll, debtInfosAll, assetParamsAll, rateStrategies, cdpModuleBalances] = yield Promise.all([collateralPoolBalancePromise, totalSupplyPromise, cdpParamsPromise, tokenPriceAllPromise, debtInfosPromise, assetParamsPromise, rateStrategyPromise, cdpModuleBalancesPromise]);
|
|
694
|
-
const interestFee = number_1.bnOrZero((_a = cdpParams.params) === null || _a === void 0 ? void 0 : _a.interestFee);
|
|
694
|
+
const interestFee = (0, number_1.bnOrZero)((_a = cdpParams.params) === null || _a === void 0 ? void 0 : _a.interestFee);
|
|
695
695
|
if (!interestFee)
|
|
696
696
|
throw new Error("unable to retrieve interest fee");
|
|
697
697
|
const tokenPrices = tokenPriceAll.tokenPrices;
|
|
@@ -719,8 +719,8 @@ class CDPModule extends base_1.default {
|
|
|
719
719
|
const newInterestRate = CDPModule.calculateInterestForTimePeriod(apy, (_b = debtInfo.lastUpdatedTime) !== null && _b !== void 0 ? _b : new Date(0), new Date());
|
|
720
720
|
return this.getTotalTokenDebt(underlyingDenom, debtInfo, interestFee, newInterestRate)
|
|
721
721
|
.then((totalDebt) => {
|
|
722
|
-
const ratio = number_1.bnOrZero(supply).div(number_1.bnOrZero(balance).plus(number_1.bnOrZero(totalDebt)));
|
|
723
|
-
const actualAmount = number_1.bnOrZero(token.amount).div(ratio);
|
|
722
|
+
const ratio = (0, number_1.bnOrZero)(supply).div((0, number_1.bnOrZero)(balance).plus((0, number_1.bnOrZero)(totalDebt)));
|
|
723
|
+
const actualAmount = (0, number_1.bnOrZero)(token.amount).div(ratio);
|
|
724
724
|
return this.getTokenUsdVal(underlyingDenom, actualAmount, tokenPrice);
|
|
725
725
|
});
|
|
726
726
|
});
|
|
@@ -749,7 +749,7 @@ class CDPModule extends base_1.default {
|
|
|
749
749
|
throw new Error("unable to retrieve token price for " + denom);
|
|
750
750
|
price = priceResult.tokenPrice;
|
|
751
751
|
}
|
|
752
|
-
const twap = number_1.bnOrZero(price.twap).shiftedBy(-18);
|
|
752
|
+
const twap = (0, number_1.bnOrZero)(price.twap).shiftedBy(-18);
|
|
753
753
|
return amount.multipliedBy(twap).shiftedBy(-decimals);
|
|
754
754
|
});
|
|
755
755
|
}
|
|
@@ -758,7 +758,7 @@ class CDPModule extends base_1.default {
|
|
|
758
758
|
return __awaiter(this, void 0, void 0, function* () {
|
|
759
759
|
if (!interestFee) {
|
|
760
760
|
const cdpParamsRsp = yield this.sdkProvider.query.cdp.Params(query_1.QueryParamsRequest.fromPartial({}));
|
|
761
|
-
interestFee = number_1.bnOrZero((_a = cdpParamsRsp.params) === null || _a === void 0 ? void 0 : _a.interestFee);
|
|
761
|
+
interestFee = (0, number_1.bnOrZero)((_a = cdpParamsRsp.params) === null || _a === void 0 ? void 0 : _a.interestFee);
|
|
762
762
|
}
|
|
763
763
|
if (!interestFee)
|
|
764
764
|
throw new Error("unable to retrieve interest fee");
|
|
@@ -772,8 +772,8 @@ class CDPModule extends base_1.default {
|
|
|
772
772
|
const cimRsp = yield this.recalculateCIM(denom, debtInfo);
|
|
773
773
|
newInterestRate = cimRsp.interest;
|
|
774
774
|
}
|
|
775
|
-
const principal = number_1.bnOrZero(debtInfo.totalPrincipal);
|
|
776
|
-
const accumInterest = number_1.bnOrZero(debtInfo.totalAccumulatedInterest);
|
|
775
|
+
const principal = (0, number_1.bnOrZero)(debtInfo.totalPrincipal);
|
|
776
|
+
const accumInterest = (0, number_1.bnOrZero)(debtInfo.totalAccumulatedInterest);
|
|
777
777
|
const newInterest = principal.times(newInterestRate).plus(accumInterest.times(number_1.BN_ONE.plus(newInterestRate)));
|
|
778
778
|
const interest = newInterest.times(number_1.BN_10000.minus(interestFee)).dividedToIntegerBy(number_1.BN_10000);
|
|
779
779
|
return principal.plus(interest);
|
|
@@ -792,8 +792,8 @@ class CDPModule extends base_1.default {
|
|
|
792
792
|
const debtRes = yield sdk.query.cdp.AccountDebt({ address: account, denom: denom });
|
|
793
793
|
debt = debtRes.debt;
|
|
794
794
|
}
|
|
795
|
-
const principalAmount = number_1.bnOrZero(debt === null || debt === void 0 ? void 0 : debt.principalDebt);
|
|
796
|
-
const initialCIM = number_1.bnOrZero(debt === null || debt === void 0 ? void 0 : debt.initialCumulativeInterestMultiplier);
|
|
795
|
+
const principalAmount = (0, number_1.bnOrZero)(debt === null || debt === void 0 ? void 0 : debt.principalDebt);
|
|
796
|
+
const initialCIM = (0, number_1.bnOrZero)(debt === null || debt === void 0 ? void 0 : debt.initialCumulativeInterestMultiplier);
|
|
797
797
|
if (principalAmount.isZero() || initialCIM.isZero())
|
|
798
798
|
return number_1.BN_ZERO;
|
|
799
799
|
const cimRsp = yield this.recalculateCIM(denom, debtInfo);
|
|
@@ -819,8 +819,8 @@ class CDPModule extends base_1.default {
|
|
|
819
819
|
const debtResp = yield sdk.query.cdp.AccountStablecoin(CarbonSDK_1.Carbon.Cdp.QueryAccountStablecoinRequest.fromPartial({ address: account }));
|
|
820
820
|
debt = debtResp;
|
|
821
821
|
}
|
|
822
|
-
principalAmount = number_1.bnOrZero(debt.principalDebt);
|
|
823
|
-
const initialCIM = number_1.bnOrZero(debt.initialCumulativeInterestMultiplier);
|
|
822
|
+
principalAmount = (0, number_1.bnOrZero)(debt.principalDebt);
|
|
823
|
+
const initialCIM = (0, number_1.bnOrZero)(debt.initialCumulativeInterestMultiplier);
|
|
824
824
|
const cim = yield this.recalculateStablecoinCIM(debtInfo);
|
|
825
825
|
if (!cim)
|
|
826
826
|
throw new Error("unable to retrieve account debt");
|
|
@@ -861,7 +861,7 @@ class CDPModule extends base_1.default {
|
|
|
861
861
|
return number_1.BN_ZERO;
|
|
862
862
|
}
|
|
863
863
|
const diffSeconds = new bignumber_js_1.BigNumber(diffMs).shiftedBy(-3).dp(0, bignumber_js_1.BigNumber.ROUND_CEIL);
|
|
864
|
-
const secondsAYear = number_1.bnOrZero(31536000);
|
|
864
|
+
const secondsAYear = (0, number_1.bnOrZero)(31536000);
|
|
865
865
|
const numPeriods = secondsAYear.div(diffSeconds).dp(18);
|
|
866
866
|
return apy.div(numPeriods).dp(18); // carbon backend sdk.dec max 18 dp
|
|
867
867
|
}
|
|
@@ -885,8 +885,8 @@ class CDPModule extends base_1.default {
|
|
|
885
885
|
throw new Error("unable to retrieve cdp params for " + denom);
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
|
-
const interestFeeRate = number_1.bnOrZero(params.interestFee).div(number_1.BN_10000);
|
|
889
|
-
const utilizationRate = number_1.bnOrZero(debtInfo.utilizationRate).shiftedBy(-18);
|
|
888
|
+
const interestFeeRate = (0, number_1.bnOrZero)(params.interestFee).div(number_1.BN_10000);
|
|
889
|
+
const utilizationRate = (0, number_1.bnOrZero)(debtInfo.utilizationRate).shiftedBy(-18);
|
|
890
890
|
return borrowInterest.times(utilizationRate).times(number_1.BN_ONE.minus(interestFeeRate));
|
|
891
891
|
});
|
|
892
892
|
}
|
|
@@ -901,7 +901,7 @@ class CDPModule extends base_1.default {
|
|
|
901
901
|
return { cim: number_1.BN_ZERO, interest: number_1.BN_ZERO };
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
const cim = number_1.bnOrZero(debtInfo.cumulativeInterestMultiplier);
|
|
904
|
+
const cim = (0, number_1.bnOrZero)(debtInfo.cumulativeInterestMultiplier);
|
|
905
905
|
const apy = yield this.calculateAPY(denom, debtInfo);
|
|
906
906
|
const newInterest = CDPModule.calculateInterestForTimePeriod(apy, (_a = debtInfo.lastUpdatedTime) !== null && _a !== void 0 ? _a : new Date(0), new Date());
|
|
907
907
|
const newCIM = cim.times(newInterest.plus(1));
|
|
@@ -920,8 +920,8 @@ class CDPModule extends base_1.default {
|
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
922
|
const stablecoinInterestResponse = yield sdk.query.cdp.StablecoinInterest({});
|
|
923
|
-
const cim = number_1.bnOrZero(debtInfo.cumulativeInterestMultiplier);
|
|
924
|
-
const apy = number_1.bnOrZero((_a = stablecoinInterestResponse.stablecoinInterestInfo) === null || _a === void 0 ? void 0 : _a.stablecoinInterestRate);
|
|
923
|
+
const cim = (0, number_1.bnOrZero)(debtInfo.cumulativeInterestMultiplier);
|
|
924
|
+
const apy = (0, number_1.bnOrZero)((_a = stablecoinInterestResponse.stablecoinInterestInfo) === null || _a === void 0 ? void 0 : _a.stablecoinInterestRate);
|
|
925
925
|
if (!apy) {
|
|
926
926
|
return number_1.BN_ZERO;
|
|
927
927
|
}
|
|
@@ -950,7 +950,7 @@ class CDPModule extends base_1.default {
|
|
|
950
950
|
cdpDenom: cdpDenom,
|
|
951
951
|
});
|
|
952
952
|
const [accountData, tokenPrice, accountCollateral] = yield Promise.all([accountDataRequest, tokenPriceRequest, accountCollateralRequest]);
|
|
953
|
-
const tokenTwap = number_1.bnOrZero((_a = tokenPrice.tokenPrice) === null || _a === void 0 ? void 0 : _a.twap);
|
|
953
|
+
const tokenTwap = (0, number_1.bnOrZero)((_a = tokenPrice.tokenPrice) === null || _a === void 0 ? void 0 : _a.twap);
|
|
954
954
|
if (tokenTwap.isZero())
|
|
955
955
|
throw new Error("unable to retrieve token price for " + denom);
|
|
956
956
|
const tokenDecimals = (_b = (yield sdk.getTokenClient().getDecimals(denom))) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -959,7 +959,7 @@ class CDPModule extends base_1.default {
|
|
|
959
959
|
const tokenAmt = unlockableUsd.div(tokenTwap.shiftedBy(-18)).shiftedBy(tokenDecimals);
|
|
960
960
|
const cdpToActualRatio = (_c = (yield this.getCdpToActualRatio(cdpDenom))) !== null && _c !== void 0 ? _c : number_1.BN_ZERO;
|
|
961
961
|
const cdpTokenAmt = tokenAmt.multipliedBy(cdpToActualRatio);
|
|
962
|
-
const lockedAmount = number_1.bnOrZero((_e = (_d = accountCollateral.collateral) === null || _d === void 0 ? void 0 : _d.collateralAmount) !== null && _e !== void 0 ? _e : "0");
|
|
962
|
+
const lockedAmount = (0, number_1.bnOrZero)((_e = (_d = accountCollateral.collateral) === null || _d === void 0 ? void 0 : _d.collateralAmount) !== null && _e !== void 0 ? _e : "0");
|
|
963
963
|
return lockedAmount.lt(cdpTokenAmt) ? lockedAmount : cdpTokenAmt;
|
|
964
964
|
});
|
|
965
965
|
}
|
|
@@ -977,7 +977,7 @@ class CDPModule extends base_1.default {
|
|
|
977
977
|
const denom = this.getUnderlyingDenom(cdpDenom);
|
|
978
978
|
const cdpToActualRatio = (_a = (yield this.getCdpToActualRatio(cdpDenom))) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
979
979
|
const tokenPrice = yield sdk.query.pricing.TokenPrice({ denom: denom });
|
|
980
|
-
const tokenTwap = number_1.bnOrZero((_b = tokenPrice.tokenPrice) === null || _b === void 0 ? void 0 : _b.twap).shiftedBy(-18);
|
|
980
|
+
const tokenTwap = (0, number_1.bnOrZero)((_b = tokenPrice.tokenPrice) === null || _b === void 0 ? void 0 : _b.twap).shiftedBy(-18);
|
|
981
981
|
return tokenTwap.multipliedBy(cdpToActualRatio);
|
|
982
982
|
});
|
|
983
983
|
}
|
|
@@ -1010,22 +1010,22 @@ class CDPModule extends base_1.default {
|
|
|
1010
1010
|
if (!debtorAccountCollateral.collateral) {
|
|
1011
1011
|
throw Error("unable to retrieve debtor's collateral amount");
|
|
1012
1012
|
}
|
|
1013
|
-
const bonus = number_1.bnOrZero(asset.assetParams.liquidationDiscount).div(number_1.BN_10000);
|
|
1013
|
+
const bonus = (0, number_1.bnOrZero)(asset.assetParams.liquidationDiscount).div(number_1.BN_10000);
|
|
1014
1014
|
const cdpTokenPrice = yield this.getCdpTokenPrice(cdpDenom);
|
|
1015
1015
|
const cdpTokenDiscountedPrice = cdpTokenPrice.multipliedBy(number_1.BN_ONE.minus(bonus));
|
|
1016
1016
|
// get close factor
|
|
1017
1017
|
const debtorAccountData = yield sdk.query.cdp.AccountData({
|
|
1018
1018
|
address: debtor,
|
|
1019
1019
|
});
|
|
1020
|
-
const debtorTotalCollateralVal = number_1.bnOrZero(debtorAccountData.totalCollateralsUsd);
|
|
1021
|
-
const debtorTotalDebtVal = number_1.bnOrZero(debtorAccountData.totalDebtsUsd);
|
|
1022
|
-
const currentLiqThreshold = number_1.bnOrZero(debtorAccountData.currLiquidationThreshold);
|
|
1023
|
-
const smallLiqSize = number_1.bnOrZero(params.params.smallLiquidationSize);
|
|
1024
|
-
const minCloseFactor = number_1.bnOrZero(params.params.minimumCloseFactor);
|
|
1025
|
-
const completeLiqThreshold = number_1.bnOrZero(params.params.completeLiquidationThreshold);
|
|
1020
|
+
const debtorTotalCollateralVal = (0, number_1.bnOrZero)(debtorAccountData.totalCollateralsUsd);
|
|
1021
|
+
const debtorTotalDebtVal = (0, number_1.bnOrZero)(debtorAccountData.totalDebtsUsd);
|
|
1022
|
+
const currentLiqThreshold = (0, number_1.bnOrZero)(debtorAccountData.currLiquidationThreshold);
|
|
1023
|
+
const smallLiqSize = (0, number_1.bnOrZero)(params.params.smallLiquidationSize);
|
|
1024
|
+
const minCloseFactor = (0, number_1.bnOrZero)(params.params.minimumCloseFactor);
|
|
1025
|
+
const completeLiqThreshold = (0, number_1.bnOrZero)(params.params.completeLiquidationThreshold);
|
|
1026
1026
|
const closeFactor = this.computeCloseFactor(debtorTotalDebtVal, debtorTotalCollateralVal, currentLiqThreshold, smallLiqSize, minCloseFactor, completeLiqThreshold);
|
|
1027
1027
|
// get max repayable amount given the debtor's debt and how much liquidator wants to repay
|
|
1028
|
-
const debtDecimals = number_1.bnOrZero(yield sdk.getTokenClient().getDecimals(debtDenom));
|
|
1028
|
+
const debtDecimals = (0, number_1.bnOrZero)(yield sdk.getTokenClient().getDecimals(debtDenom));
|
|
1029
1029
|
const maxRepayableValue = debtorTotalDebtVal.multipliedBy(closeFactor);
|
|
1030
1030
|
const maxRepayableAmt = maxRepayableValue.shiftedBy(debtDecimals.toNumber());
|
|
1031
1031
|
if (debtRepaymentAmount.isGreaterThan(maxRepayableAmt)) {
|
|
@@ -1033,7 +1033,7 @@ class CDPModule extends base_1.default {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
// calculate collateral amount that can be obtained given that debt amount and debtor's collateral balance
|
|
1035
1035
|
// AND, recalculate debt repay amount if needed
|
|
1036
|
-
const cdpTokenDecimals = number_1.bnOrZero(yield sdk.getTokenClient().getDecimals(cdpActualDenom));
|
|
1036
|
+
const cdpTokenDecimals = (0, number_1.bnOrZero)(yield sdk.getTokenClient().getDecimals(cdpActualDenom));
|
|
1037
1037
|
let collateralAmtToLiquidate = this.calculateCollateralRequiredForDebt(number_1.BN_ONE, // assumes USC is $1
|
|
1038
1038
|
cdpTokenDiscountedPrice, debtRepaymentAmount, cdpTokenDecimals, debtDecimals);
|
|
1039
1039
|
const debtorCollateralAmt = new bignumber_js_1.BigNumber(debtorAccountCollateral.collateral.collateralAmount);
|
|
@@ -1098,11 +1098,11 @@ class CDPModule extends base_1.default {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
exports.CDPModule = CDPModule;
|
|
1100
1100
|
CDPModule.calculateInterestAPY = (debtInfo, rateStrategy) => {
|
|
1101
|
-
const utilizationRate = number_1.bnOrZero(debtInfo.utilizationRate).shiftedBy(-18);
|
|
1102
|
-
const optimalUsage = number_1.bnOrZero(rateStrategy.optimalUsage).shiftedBy(-4);
|
|
1103
|
-
const variableRate1 = number_1.bnOrZero(rateStrategy.variableRateSlope1).shiftedBy(-4);
|
|
1104
|
-
const variableRate2 = number_1.bnOrZero(rateStrategy.variableRateSlope2).shiftedBy(-4);
|
|
1105
|
-
const baseVariableBorrowRate = number_1.bnOrZero(rateStrategy.baseVariableBorrowRate).shiftedBy(-4);
|
|
1101
|
+
const utilizationRate = (0, number_1.bnOrZero)(debtInfo.utilizationRate).shiftedBy(-18);
|
|
1102
|
+
const optimalUsage = (0, number_1.bnOrZero)(rateStrategy.optimalUsage).shiftedBy(-4);
|
|
1103
|
+
const variableRate1 = (0, number_1.bnOrZero)(rateStrategy.variableRateSlope1).shiftedBy(-4);
|
|
1104
|
+
const variableRate2 = (0, number_1.bnOrZero)(rateStrategy.variableRateSlope2).shiftedBy(-4);
|
|
1105
|
+
const baseVariableBorrowRate = (0, number_1.bnOrZero)(rateStrategy.baseVariableBorrowRate).shiftedBy(-4);
|
|
1106
1106
|
if (utilizationRate.lte(optimalUsage)) {
|
|
1107
1107
|
const vRate = utilizationRate.times(variableRate1).div(optimalUsage).dp(4, bignumber_js_1.BigNumber.ROUND_CEIL);
|
|
1108
1108
|
return vRate.plus(baseVariableBorrowRate);
|
package/lib/modules/cosmwasm.js
CHANGED
|
@@ -35,7 +35,7 @@ class CosmWasmModule extends base_1.default {
|
|
|
35
35
|
// empty catch
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
const { client, rpcUrl } = yield generic_1.getBestRpcTmClient(chainInfo.bestRpcs.map(r => r.address));
|
|
38
|
+
const { client, rpcUrl } = yield (0, generic_1.getBestRpcTmClient)(chainInfo.bestRpcs.map(r => r.address));
|
|
39
39
|
chainInfo.activeRpc = rpcUrl;
|
|
40
40
|
return CosmWasmModule.instanceWithTmClient(sdkProvider, client);
|
|
41
41
|
});
|
|
@@ -43,7 +43,7 @@ class CosmWasmModule extends base_1.default {
|
|
|
43
43
|
static instanceWithTmClient(sdkProvider, tmClient) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
const baseClient = new stargate_1.QueryClient(tmClient);
|
|
46
|
-
const rpcClient = stargate_1.createProtobufRpcClient(baseClient);
|
|
46
|
+
const rpcClient = (0, stargate_1.createProtobufRpcClient)(baseClient);
|
|
47
47
|
const cosmWasmClient = new query_1.QueryClientImpl(rpcClient);
|
|
48
48
|
return new CosmWasmModule(sdkProvider, cosmWasmClient);
|
|
49
49
|
});
|
package/lib/modules/evm.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { AccessListTx, DynamicFeeTx, LegacyTx } from "../codec/ethermint/evm/v1/
|
|
|
3
3
|
import { CarbonTx } from "../util";
|
|
4
4
|
import { ethers } from "ethers";
|
|
5
5
|
import BaseModule from "./base";
|
|
6
|
-
export
|
|
6
|
+
export type TxData = LegacyTx | AccessListTx | DynamicFeeTx;
|
|
7
7
|
export declare class EvmModule extends BaseModule {
|
|
8
8
|
sendEvmTx(req: ethers.providers.TransactionRequest, opts?: CarbonTx.SignTxOpts): Promise<import("..").CarbonWallet.SendTxResponse>;
|
|
9
9
|
updateParams(p: EvmModule.UpdateParams, opts?: CarbonTx.SignTxOpts): Promise<import("..").CarbonWallet.SendTxResponse>;
|
package/lib/modules/evm.js
CHANGED
|
@@ -88,7 +88,7 @@ function constructTxDataAny(req) {
|
|
|
88
88
|
value: (_d = (_c = req.value) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : "0",
|
|
89
89
|
gas: (_f = (_e = req.gasLimit) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : "0",
|
|
90
90
|
gasPrice: (_h = (_g = req.gasPrice) === null || _g === void 0 ? void 0 : _g.toString()) !== null && _h !== void 0 ? _h : "0",
|
|
91
|
-
data: req.data ? utils_1.arrayify(req.data) : undefined,
|
|
91
|
+
data: req.data ? (0, utils_1.arrayify)(req.data) : undefined,
|
|
92
92
|
});
|
|
93
93
|
txType = 'LegacyTx';
|
|
94
94
|
}
|
|
@@ -101,8 +101,8 @@ function constructTxDataAny(req) {
|
|
|
101
101
|
gas: (_r = (_q = req.gasLimit) === null || _q === void 0 ? void 0 : _q.toString()) !== null && _r !== void 0 ? _r : "0",
|
|
102
102
|
gasTipCap: (_t = (_s = req.maxPriorityFeePerGas) === null || _s === void 0 ? void 0 : _s.toString()) !== null && _t !== void 0 ? _t : "0",
|
|
103
103
|
gasFeeCap: (_v = (_u = req.maxFeePerGas) === null || _u === void 0 ? void 0 : _u.toString()) !== null && _v !== void 0 ? _v : "0",
|
|
104
|
-
data: req.data ? utils_1.arrayify(req.data) : undefined,
|
|
105
|
-
accesses: req.accessList ? utils_1.accessListify(req.accessList) : undefined,
|
|
104
|
+
data: req.data ? (0, utils_1.arrayify)(req.data) : undefined,
|
|
105
|
+
accesses: req.accessList ? (0, utils_1.accessListify)(req.accessList) : undefined,
|
|
106
106
|
});
|
|
107
107
|
txType = 'DynamicFeeTx';
|
|
108
108
|
}
|
|
@@ -114,8 +114,8 @@ function constructTxDataAny(req) {
|
|
|
114
114
|
value: (_1 = (_0 = req.value) === null || _0 === void 0 ? void 0 : _0.toString()) !== null && _1 !== void 0 ? _1 : "0",
|
|
115
115
|
gas: parseInt((_3 = (_2 = req.gasLimit) === null || _2 === void 0 ? void 0 : _2.toString()) !== null && _3 !== void 0 ? _3 : "0", 10),
|
|
116
116
|
gasPrice: (_5 = (_4 = req.gasPrice) === null || _4 === void 0 ? void 0 : _4.toString()) !== null && _5 !== void 0 ? _5 : "0",
|
|
117
|
-
data: req.data ? utils_1.arrayify(req.data) : undefined,
|
|
118
|
-
accesses: req.accessList ? utils_1.accessListify(req.accessList) : undefined,
|
|
117
|
+
data: req.data ? (0, utils_1.arrayify)(req.data) : undefined,
|
|
118
|
+
accesses: req.accessList ? (0, utils_1.accessListify)(req.accessList) : undefined,
|
|
119
119
|
});
|
|
120
120
|
txType = 'AccessListTx';
|
|
121
121
|
}
|
package/lib/modules/gov.js
CHANGED
|
@@ -48,7 +48,7 @@ class GovModule extends base_1.default {
|
|
|
48
48
|
const value = tx_1.MsgDeposit.fromPartial({
|
|
49
49
|
proposalId: new long_1.default(params.proposalId),
|
|
50
50
|
depositor: wallet.bech32Address,
|
|
51
|
-
amount: amino_1.coins(params.amount, params.denom),
|
|
51
|
+
amount: (0, amino_1.coins)(params.amount, params.denom),
|
|
52
52
|
});
|
|
53
53
|
return yield wallet.sendTx({
|
|
54
54
|
typeUrl: util_1.CarbonTx.Types.MsgDeposit,
|
|
@@ -78,7 +78,7 @@ class GovModule extends base_1.default {
|
|
|
78
78
|
const createTokenMsg = {
|
|
79
79
|
title: title,
|
|
80
80
|
description: description,
|
|
81
|
-
msg: admin_1.transfromCreateTokenParams(msg, wallet.bech32Address),
|
|
81
|
+
msg: (0, admin_1.transfromCreateTokenParams)(msg, wallet.bech32Address),
|
|
82
82
|
};
|
|
83
83
|
return proposal_1.CreateTokenProposal.encode(createTokenMsg).finish();
|
|
84
84
|
}
|
|
@@ -86,7 +86,7 @@ class GovModule extends base_1.default {
|
|
|
86
86
|
const setMsgGasCostMsg = {
|
|
87
87
|
title: title,
|
|
88
88
|
description: description,
|
|
89
|
-
msg: admin_1.transfromSetMsgGasCostParams(msg),
|
|
89
|
+
msg: (0, admin_1.transfromSetMsgGasCostParams)(msg),
|
|
90
90
|
};
|
|
91
91
|
return proposal_2.SetMsgGasCostProposal.encode(setMsgGasCostMsg).finish();
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ class GovModule extends base_1.default {
|
|
|
94
94
|
const setMinGasPriceMsg = {
|
|
95
95
|
title: title,
|
|
96
96
|
description: description,
|
|
97
|
-
msg: admin_1.transfromSetMinGasPriceParams(msg),
|
|
97
|
+
msg: (0, admin_1.transfromSetMinGasPriceParams)(msg),
|
|
98
98
|
};
|
|
99
99
|
return proposal_2.SetMinGasPriceProposal.encode(setMinGasPriceMsg).finish();
|
|
100
100
|
}
|
|
@@ -118,7 +118,7 @@ class GovModule extends base_1.default {
|
|
|
118
118
|
const setRewardCurveMsg = {
|
|
119
119
|
title: title,
|
|
120
120
|
description: description,
|
|
121
|
-
msg: admin_1.transfromSetRewardCurveParams(msg),
|
|
121
|
+
msg: (0, admin_1.transfromSetRewardCurveParams)(msg),
|
|
122
122
|
};
|
|
123
123
|
return proposal_3.SetRewardCurveProposal.encode(setRewardCurveMsg).finish();
|
|
124
124
|
}
|
|
@@ -126,7 +126,7 @@ class GovModule extends base_1.default {
|
|
|
126
126
|
const setCommitmentCurveMsg = {
|
|
127
127
|
title: title,
|
|
128
128
|
description: description,
|
|
129
|
-
msg: admin_1.transfromSetCommitmentCurveParams(msg),
|
|
129
|
+
msg: (0, admin_1.transfromSetCommitmentCurveParams)(msg),
|
|
130
130
|
};
|
|
131
131
|
return proposal_3.SetCommitmentCurveProposal.encode(setCommitmentCurveMsg).finish();
|
|
132
132
|
}
|
|
@@ -134,7 +134,7 @@ class GovModule extends base_1.default {
|
|
|
134
134
|
const setRewardsWeightsMsg = {
|
|
135
135
|
title: title,
|
|
136
136
|
description: description,
|
|
137
|
-
msg: admin_1.transfromSetRewardsWeightsParams(msg),
|
|
137
|
+
msg: (0, admin_1.transfromSetRewardsWeightsParams)(msg),
|
|
138
138
|
};
|
|
139
139
|
return proposal_3.SetRewardsWeightsProposal.encode(setRewardsWeightsMsg).finish();
|
|
140
140
|
}
|
|
@@ -142,7 +142,7 @@ class GovModule extends base_1.default {
|
|
|
142
142
|
const updatePoolProposalMsg = {
|
|
143
143
|
title: title,
|
|
144
144
|
description: description,
|
|
145
|
-
msg: admin_1.transfromUpdatePoolParams(msg),
|
|
145
|
+
msg: (0, admin_1.transfromUpdatePoolParams)(msg),
|
|
146
146
|
};
|
|
147
147
|
return proposal_3.UpdatePoolProposal.encode(updatePoolProposalMsg).finish();
|
|
148
148
|
}
|
|
@@ -150,7 +150,7 @@ class GovModule extends base_1.default {
|
|
|
150
150
|
const updateMarketProposalMsg = {
|
|
151
151
|
title: title,
|
|
152
152
|
description: description,
|
|
153
|
-
msg: market_1.transfromUpdateMarketParams(msg),
|
|
153
|
+
msg: (0, market_1.transfromUpdateMarketParams)(msg),
|
|
154
154
|
};
|
|
155
155
|
return proposal_4.UpdateMarketProposal.encode(updateMarketProposalMsg).finish();
|
|
156
156
|
}
|
|
@@ -158,7 +158,7 @@ class GovModule extends base_1.default {
|
|
|
158
158
|
const createOracleProposalMsg = {
|
|
159
159
|
title: title,
|
|
160
160
|
description: description,
|
|
161
|
-
msg: admin_1.transfromCreateOracleParams(msg, wallet.bech32Address),
|
|
161
|
+
msg: (0, admin_1.transfromCreateOracleParams)(msg, wallet.bech32Address),
|
|
162
162
|
};
|
|
163
163
|
return proposal_5.CreateOracleProposal.encode(createOracleProposalMsg).finish();
|
|
164
164
|
}
|
|
@@ -166,7 +166,7 @@ class GovModule extends base_1.default {
|
|
|
166
166
|
const settlementPriceProposalMsg = {
|
|
167
167
|
title: title,
|
|
168
168
|
description: description,
|
|
169
|
-
msg: admin_1.transformSetSettlementPriceParams(msg),
|
|
169
|
+
msg: (0, admin_1.transformSetSettlementPriceParams)(msg),
|
|
170
170
|
};
|
|
171
171
|
return proposal_6.SettlementPriceProposal.encode(settlementPriceProposalMsg).finish();
|
|
172
172
|
}
|
|
@@ -191,7 +191,7 @@ class GovModule extends base_1.default {
|
|
|
191
191
|
title: title,
|
|
192
192
|
description: description,
|
|
193
193
|
recipient: proposalMsg.recipient,
|
|
194
|
-
amount: admin_1.transformCommunityPoolSpendAmount(proposalMsg.amount),
|
|
194
|
+
amount: (0, admin_1.transformCommunityPoolSpendAmount)(proposalMsg.amount),
|
|
195
195
|
};
|
|
196
196
|
return distribution_1.CommunityPoolSpendProposal.encode(communityPoolSpendProposalMsg).finish();
|
|
197
197
|
}
|
package/lib/modules/index.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];
|
|
@@ -146,7 +146,7 @@ class LiquidityPoolModule extends base_1.default {
|
|
|
146
146
|
const SECONDS_IN_A_WEEK = new bignumber_js_1.BigNumber(604800);
|
|
147
147
|
const mintDataResponse = yield this.sdkProvider.query.inflation.MintData({});
|
|
148
148
|
const mintData = mintDataResponse.mintData;
|
|
149
|
-
const nowTime = new bignumber_js_1.BigNumber(dayjs_1.default().unix());
|
|
149
|
+
const nowTime = new bignumber_js_1.BigNumber((0, dayjs_1.default)().unix());
|
|
150
150
|
const firstBlockTime = (_b = (_a = mintData === null || mintData === void 0 ? void 0 : mintData.firstBlockTime) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0;
|
|
151
151
|
const difference = nowTime.minus(firstBlockTime / 1000);
|
|
152
152
|
const currentWeek = difference.div(SECONDS_IN_A_WEEK).dp(0, bignumber_js_1.BigNumber.ROUND_DOWN);
|
package/lib/modules/order.js
CHANGED
|
@@ -33,7 +33,7 @@ class OrderModule extends base_1.default {
|
|
|
33
33
|
quantity: params.quantity.toString(10),
|
|
34
34
|
side: params.side,
|
|
35
35
|
stopPrice: (_b = params.stopPrice) === null || _b === void 0 ? void 0 : _b.shiftedBy(18).toString(10),
|
|
36
|
-
timeInForce: params.timeInForce || order_1.getDefaultTimeInForce(order_1.isMarket(params.orderType)),
|
|
36
|
+
timeInForce: params.timeInForce || (0, order_1.getDefaultTimeInForce)((0, order_1.isMarket)(params.orderType)),
|
|
37
37
|
triggerType: params.triggerType,
|
|
38
38
|
referralAddress: params.referralAddress,
|
|
39
39
|
referralCommission: params.referralCommission,
|
|
@@ -60,7 +60,7 @@ class OrderModule extends base_1.default {
|
|
|
60
60
|
quantity: params.quantity.toString(10),
|
|
61
61
|
side: params.side,
|
|
62
62
|
stopPrice: (_b = params.stopPrice) === null || _b === void 0 ? void 0 : _b.shiftedBy(18).toString(10),
|
|
63
|
-
timeInForce: params.timeInForce || order_1.getDefaultTimeInForce(order_1.isMarket(params.orderType)),
|
|
63
|
+
timeInForce: params.timeInForce || (0, order_1.getDefaultTimeInForce)((0, order_1.isMarket)(params.orderType)),
|
|
64
64
|
triggerType: params.triggerType,
|
|
65
65
|
referralAddress: params.referralAddress,
|
|
66
66
|
referralCommission: params.referralCommission,
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -87,7 +87,7 @@ class EthLedgerAccount {
|
|
|
87
87
|
static tryConnect() {
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
89
|
try {
|
|
90
|
-
const transport = yield ledger_1.getLedgerTransport();
|
|
90
|
+
const transport = yield (0, ledger_1.getLedgerTransport)();
|
|
91
91
|
// get public key to assert that NEO app is open
|
|
92
92
|
const ethApp = new hw_app_eth_1.default(transport);
|
|
93
93
|
const bipString = EthLedgerAccount.getETHBIP44String();
|
|
@@ -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];
|
|
@@ -39,7 +39,7 @@ exports.looksLikeTransportStatusError = looksLikeTransportStatusError;
|
|
|
39
39
|
* @returns error with modified message if found.
|
|
40
40
|
*/
|
|
41
41
|
function evalTransportError(err) {
|
|
42
|
-
const transportErr = lodash_1.cloneDeep(err);
|
|
42
|
+
const transportErr = (0, lodash_1.cloneDeep)(err);
|
|
43
43
|
switch (transportErr.statusCode) {
|
|
44
44
|
case StatusWord.APP_CLOSED:
|
|
45
45
|
transportErr.message = "Your NEO app is closed! Please login.";
|
|
@@ -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];
|
|
@@ -49,8 +49,8 @@ function getAppName(ledger) {
|
|
|
49
49
|
return version.substring(0, version.length - 2); // take of status word
|
|
50
50
|
}
|
|
51
51
|
catch (e) {
|
|
52
|
-
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
53
|
-
throw ErrorCode_1.evalTransportError(e);
|
|
52
|
+
if ((0, ErrorCode_1.looksLikeTransportStatusError)(e)) {
|
|
53
|
+
throw (0, ErrorCode_1.evalTransportError)(e);
|
|
54
54
|
}
|
|
55
55
|
throw e;
|
|
56
56
|
}
|
|
@@ -72,8 +72,8 @@ function getAppVersion(ledger) {
|
|
|
72
72
|
return major.toString() + "." + minor.toString() + "." + patch.toString();
|
|
73
73
|
}
|
|
74
74
|
catch (e) {
|
|
75
|
-
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
76
|
-
throw ErrorCode_1.evalTransportError(e);
|
|
75
|
+
if ((0, ErrorCode_1.looksLikeTransportStatusError)(e)) {
|
|
76
|
+
throw (0, ErrorCode_1.evalTransportError)(e);
|
|
77
77
|
}
|
|
78
78
|
throw e;
|
|
79
79
|
}
|
|
@@ -109,8 +109,8 @@ function getPublicKey(ledger, bip44String, showAddressOnDevice = false) {
|
|
|
109
109
|
return response.toString("hex").substring(0, 130);
|
|
110
110
|
}
|
|
111
111
|
catch (e) {
|
|
112
|
-
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
113
|
-
throw ErrorCode_1.evalTransportError(e);
|
|
112
|
+
if ((0, ErrorCode_1.looksLikeTransportStatusError)(e)) {
|
|
113
|
+
throw (0, ErrorCode_1.evalTransportError)(e);
|
|
114
114
|
}
|
|
115
115
|
throw e;
|
|
116
116
|
}
|
|
@@ -142,8 +142,8 @@ function getSignature(ledger, payload, bip44String, network) {
|
|
|
142
142
|
return DerToHexSignature(response.toString("hex"));
|
|
143
143
|
}
|
|
144
144
|
catch (e) {
|
|
145
|
-
if (ErrorCode_1.looksLikeTransportStatusError(e)) {
|
|
146
|
-
throw ErrorCode_1.evalTransportError(e);
|
|
145
|
+
if ((0, ErrorCode_1.looksLikeTransportStatusError)(e)) {
|
|
146
|
+
throw (0, ErrorCode_1.evalTransportError)(e);
|
|
147
147
|
}
|
|
148
148
|
throw e;
|
|
149
149
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AddressOptions } from "../../../util/address";
|
|
2
2
|
import Transport from "@ledgerhq/hw-transport";
|
|
3
|
-
|
|
3
|
+
type NeoVersion = "neo" | "n3";
|
|
4
4
|
export declare class NeoLedgerAccount {
|
|
5
5
|
options: AddressOptions;
|
|
6
6
|
readonly ledger: Transport;
|
|
@@ -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];
|
|
@@ -111,8 +115,8 @@ class NeoLedgerAccount {
|
|
|
111
115
|
*/
|
|
112
116
|
static tryConnect(version = "neo") {
|
|
113
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
115
|
-
const ledger = yield ledger_1.getLedgerTransport();
|
|
118
|
+
const bipString = (0, NeonLedger_1.getNEOBIP44String)();
|
|
119
|
+
const ledger = yield (0, ledger_1.getLedgerTransport)();
|
|
116
120
|
// get public key to assert that NEO app is open
|
|
117
121
|
const ledgerAdapter = adapterForVersion(version);
|
|
118
122
|
const publicKey = yield ledgerAdapter.getPublicKey(ledger, bipString);
|
|
@@ -129,7 +133,7 @@ class NeoLedgerAccount {
|
|
|
129
133
|
}
|
|
130
134
|
sign(msg, magic = neon_core_next_1.CONST.MAGIC_NUMBER.MainNet) {
|
|
131
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
const bipString = NeonLedger_1.getNEOBIP44String();
|
|
136
|
+
const bipString = (0, NeonLedger_1.getNEOBIP44String)();
|
|
133
137
|
const ledger = this.useLedger();
|
|
134
138
|
const ledgerAdapter = adapterForVersion(this.version);
|
|
135
139
|
return yield ledgerAdapter.getSignature(ledger, msg, bipString, magic);
|