carbon-js-sdk 0.11.13-beta.2 → 0.11.13
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 +0 -3
- package/lib/CarbonSDK.js +8 -21
- package/lib/clients/AxelarBridgeClient.d.ts +0 -11
- package/lib/clients/AxelarBridgeClient.js +0 -29
- 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 +4 -4
- package/lib/clients/InsightsQueryClient.d.ts +4 -0
- package/lib/clients/InsightsQueryClient.js +38 -3
- package/lib/clients/NEOClient.js +12 -8
- package/lib/clients/TokenClient.js +2 -2
- package/lib/clients/ZILClient.js +19 -19
- package/lib/codec/Switcheo/carbon/adl/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/admin/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/admin/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/admin/tx.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/bank/event.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/bank/export.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/bank/export.js +10 -1
- package/lib/codec/Switcheo/carbon/bank/genesis.d.ts +8 -7
- package/lib/codec/Switcheo/carbon/bank/genesis.js +22 -5
- package/lib/codec/Switcheo/carbon/bank/query.d.ts +51 -6
- package/lib/codec/Switcheo/carbon/bank/query.js +185 -1
- package/lib/codec/Switcheo/carbon/bank/tx.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/book/book.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/book/event.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/book/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/book/legacy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/book/query.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/bridge/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/bridge/tx.js +5 -6
- package/lib/codec/Switcheo/carbon/broker/amm.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/broker/candlestick.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/broker/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/incoming_liquidations.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/pagination.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/query.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/broker/tx.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/btcx/denom_cross_chain_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/btcx/denom_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/btcx/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/btcx/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/btcx/tx.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/ccm/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/ccm/export.js +3 -4
- package/lib/codec/Switcheo/carbon/ccm/genesis.d.ts +38 -8
- package/lib/codec/Switcheo/carbon/ccm/genesis.js +169 -3
- package/lib/codec/Switcheo/carbon/ccm/params.d.ts +12 -14
- package/lib/codec/Switcheo/carbon/ccm/params.js +9 -38
- package/lib/codec/Switcheo/carbon/ccm/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/ccm/tx.d.ts +7 -45
- package/lib/codec/Switcheo/carbon/ccm/tx.js +1 -206
- package/lib/codec/Switcheo/carbon/cdp/asset_params.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/cdp/asset_params.js +23 -25
- package/lib/codec/Switcheo/carbon/cdp/cdp_liquidations.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/debt_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/e_mode_category.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/event.d.ts +39 -61
- package/lib/codec/Switcheo/carbon/cdp/event.js +72 -290
- package/lib/codec/Switcheo/carbon/cdp/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/cdp/export.js +13 -30
- package/lib/codec/Switcheo/carbon/cdp/genesis.d.ts +59 -59
- package/lib/codec/Switcheo/carbon/cdp/genesis.js +115 -117
- package/lib/codec/Switcheo/carbon/cdp/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/cdp/query.d.ts +88 -63
- package/lib/codec/Switcheo/carbon/cdp/query.js +214 -63
- package/lib/codec/Switcheo/carbon/cdp/rate_strategy_params.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/reward_scheme.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_debt_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_interest_info.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/cdp/tx.d.ts +86 -322
- package/lib/codec/Switcheo/carbon/cdp/tx.js +313 -1717
- package/lib/codec/Switcheo/carbon/coin/bridge.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/coin/event.d.ts +14 -14
- package/lib/codec/Switcheo/carbon/coin/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/coin/group.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/coin/proposal.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/coin/query.d.ts +26 -26
- package/lib/codec/Switcheo/carbon/coin/token.d.ts +9 -9
- package/lib/codec/Switcheo/carbon/coin/tx.d.ts +48 -48
- package/lib/codec/Switcheo/carbon/erc20/erc20.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/erc20/events.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/erc20/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/erc20/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/erc20/query.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/erc20/tx.d.ts +16 -16
- package/lib/codec/Switcheo/carbon/evmbank/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/evmbank/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/evmcontract/evm_hooks.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/evmcontract/export.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/evmcontract/export.js +3 -1
- package/lib/codec/Switcheo/carbon/evmcontract/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmcontract/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/evmcontract/query.d.ts +47 -18
- package/lib/codec/Switcheo/carbon/evmcontract/query.js +201 -13
- package/lib/codec/Switcheo/carbon/evmcontract/tx.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/evmmerge/address.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmmerge/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmmerge/genesis.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/evmmerge/offchain.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/evmmerge/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/evmmerge/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/fee/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/fee/export.d.ts +0 -1
- package/lib/codec/Switcheo/carbon/fee/export.js +1 -6
- package/lib/codec/Switcheo/carbon/fee/fee.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/fee/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/fee/query.d.ts +10 -10
- package/lib/codec/Switcheo/carbon/fee/tx.d.ts +10 -10
- package/lib/codec/Switcheo/carbon/headersync/consensus_peers.d.ts +8 -7
- package/lib/codec/Switcheo/carbon/headersync/export.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/headersync/export.js +1 -3
- package/lib/codec/Switcheo/carbon/headersync/genesis.d.ts +9 -12
- package/lib/codec/Switcheo/carbon/headersync/query.d.ts +5 -27
- package/lib/codec/Switcheo/carbon/headersync/query.js +1 -107
- package/lib/codec/Switcheo/carbon/headersync/tx.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/inflation/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/inflation/inflation.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/inflation/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/insurance/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/insurance/export.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/insurance/export.js +8 -1
- package/lib/codec/Switcheo/carbon/insurance/fund.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/insurance/genesis.d.ts +13 -7
- package/lib/codec/Switcheo/carbon/insurance/genesis.js +21 -4
- package/lib/codec/Switcheo/carbon/insurance/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/insurance/query.d.ts +26 -4
- package/lib/codec/Switcheo/carbon/insurance/query.js +88 -1
- package/lib/codec/Switcheo/carbon/insurance/tx.d.ts +29 -4
- package/lib/codec/Switcheo/carbon/insurance/tx.js +103 -1
- package/lib/codec/Switcheo/carbon/leverage/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/leverage/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/leverage/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/liquidation/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquidation/quote_changes.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/liquiditypool/event.d.ts +15 -15
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/liquiditypool/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/liquiditypool/proposal.d.ts +11 -11
- package/lib/codec/Switcheo/carbon/liquiditypool/query.d.ts +33 -33
- package/lib/codec/Switcheo/carbon/liquiditypool/reward.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.d.ts +41 -41
- package/lib/codec/Switcheo/carbon/lockproxy/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/lockproxy/genesis.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/lockproxy/lockproxy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/lockproxy/query.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/lockproxy/tx.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/market/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/market/event.js +11 -13
- package/lib/codec/Switcheo/carbon/market/fee.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/market/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/market/market.d.ts +8 -6
- package/lib/codec/Switcheo/carbon/market/market.js +30 -2
- package/lib/codec/Switcheo/carbon/market/params.d.ts +6 -4
- package/lib/codec/Switcheo/carbon/market/params.js +32 -2
- package/lib/codec/Switcheo/carbon/market/proposal.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/market/query.d.ts +35 -30
- package/lib/codec/Switcheo/carbon/market/query.js +94 -8
- package/lib/codec/Switcheo/carbon/market/tx.d.ts +27 -27
- package/lib/codec/Switcheo/carbon/marketstats/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/marketstats/query.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/misc/block.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/message.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/message_type.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/query.d.ts +16 -16
- package/lib/codec/Switcheo/carbon/misc/trade.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/misc/transaction.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/oracle/event.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/oracle/export.d.ts +1 -2
- package/lib/codec/Switcheo/carbon/oracle/export.js +6 -6
- package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/oracle/params.d.ts +6 -4
- package/lib/codec/Switcheo/carbon/oracle/params.js +29 -2
- package/lib/codec/Switcheo/carbon/oracle/query.d.ts +30 -30
- package/lib/codec/Switcheo/carbon/oracle/slashing.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/oracle/tx.d.ts +68 -45
- package/lib/codec/Switcheo/carbon/oracle/tx.js +218 -139
- package/lib/codec/Switcheo/carbon/order/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/order/evm_hooks.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/order/genesis.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/order/order.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/order/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/order/query.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/order/tx.d.ts +14 -14
- package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +9 -9
- package/lib/codec/Switcheo/carbon/perpspool/genesis.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/perpspool/pool.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/perpspool/query.d.ts +20 -20
- package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/position/event.d.ts +14 -4
- package/lib/codec/Switcheo/carbon/position/event.js +51 -1
- package/lib/codec/Switcheo/carbon/position/evm_hooks.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/position/export.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/position/export.js +7 -1
- package/lib/codec/Switcheo/carbon/position/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/position/position.d.ts +17 -6
- package/lib/codec/Switcheo/carbon/position/position.js +59 -1
- package/lib/codec/Switcheo/carbon/position/query.d.ts +52 -9
- package/lib/codec/Switcheo/carbon/position/query.js +189 -1
- package/lib/codec/Switcheo/carbon/position/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/pricing/event.d.ts +9 -9
- package/lib/codec/Switcheo/carbon/pricing/export.d.ts +0 -1
- package/lib/codec/Switcheo/carbon/pricing/export.js +1 -4
- package/lib/codec/Switcheo/carbon/pricing/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/pricing/legacy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/pricing/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/pricing/pricing.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/pricing/query.d.ts +16 -16
- package/lib/codec/Switcheo/carbon/pricing/tx.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/profile/event.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/profile/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/profile/profile.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/profile/query.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/profile/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/sequence/genesis.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/sequence/query.d.ts +13 -10
- package/lib/codec/Switcheo/carbon/sequence/query.js +41 -4
- package/lib/codec/Switcheo/carbon/sequence/tx.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/subaccount/genesis.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/subaccount/legacy.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/subaccount/params.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/subaccount/query.d.ts +19 -19
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/subaccount/tx.d.ts +10 -10
- package/lib/codec/alliance/alliance/alliance.d.ts +5 -5
- package/lib/codec/alliance/alliance/delegations.d.ts +6 -6
- package/lib/codec/alliance/alliance/events.d.ts +7 -7
- package/lib/codec/alliance/alliance/genesis.d.ts +7 -7
- package/lib/codec/alliance/alliance/gov.d.ts +5 -5
- package/lib/codec/alliance/alliance/params.d.ts +4 -4
- package/lib/codec/alliance/alliance/query.d.ts +31 -31
- package/lib/codec/alliance/alliance/redelegations.d.ts +5 -5
- package/lib/codec/alliance/alliance/tx.d.ts +18 -18
- package/lib/codec/alliance/alliance/unbonding.d.ts +3 -3
- package/lib/codec/carbon-models.js +5 -1
- package/lib/codec/cosmos/app/runtime/v1alpha1/module.d.ts +4 -4
- package/lib/codec/cosmos/app/v1alpha1/config.d.ts +5 -5
- package/lib/codec/cosmos/app/v1alpha1/module.d.ts +5 -5
- package/lib/codec/cosmos/app/v1alpha1/query.d.ts +4 -4
- package/lib/codec/cosmos/auth/module/v1/module.d.ts +4 -4
- package/lib/codec/cosmos/auth/v1beta1/auth.d.ts +6 -6
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +22 -22
- package/lib/codec/cosmos/auth/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/authz/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +6 -6
- package/lib/codec/cosmos/authz/v1beta1/event.d.ts +4 -4
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +8 -8
- package/lib/codec/cosmos/autocli/v1/options.d.ts +9 -9
- package/lib/codec/cosmos/autocli/v1/query.d.ts +5 -5
- package/lib/codec/cosmos/bank/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +3 -3
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +9 -9
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +29 -29
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +10 -10
- package/lib/codec/cosmos/base/abci/v1beta1/abci.d.ts +13 -13
- package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +6 -6
- package/lib/codec/cosmos/base/query/v1beta1/pagination.d.ts +4 -4
- package/lib/codec/cosmos/base/reflection/v1beta1/reflection.d.ts +6 -6
- package/lib/codec/cosmos/base/reflection/v2alpha1/reflection.d.ts +28 -28
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +21 -21
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.d.ts +4 -4
- package/lib/codec/cosmos/base/v1beta1/coin.d.ts +6 -6
- package/lib/codec/cosmos/circuit/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/circuit/v1/query.d.ts +8 -8
- package/lib/codec/cosmos/circuit/v1/tx.d.ts +8 -8
- package/lib/codec/cosmos/circuit/v1/types.d.ts +5 -5
- package/lib/codec/cosmos/consensus/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/consensus/v1/query.d.ts +4 -4
- package/lib/codec/cosmos/consensus/v1/tx.d.ts +4 -4
- package/lib/codec/cosmos/crisis/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/crisis/v1beta1/tx.d.ts +6 -6
- package/lib/codec/cosmos/crypto/ed25519/keys.d.ts +4 -4
- package/lib/codec/cosmos/crypto/hd/v1/hd.d.ts +3 -3
- package/lib/codec/cosmos/crypto/keyring/v1/record.d.ts +7 -7
- package/lib/codec/cosmos/crypto/multisig/keys.d.ts +3 -3
- package/lib/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts +4 -4
- package/lib/codec/cosmos/crypto/secp256k1/keys.d.ts +4 -4
- package/lib/codec/cosmos/crypto/secp256r1/keys.d.ts +4 -4
- package/lib/codec/cosmos/distribution/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +14 -14
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +10 -10
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +24 -24
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +16 -16
- package/lib/codec/cosmos/evidence/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/evidence/v1beta1/evidence.d.ts +3 -3
- package/lib/codec/cosmos/evidence/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +6 -6
- package/lib/codec/cosmos/evidence/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/feegrant/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +6 -6
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/feegrant/v1beta1/tx.d.ts +8 -8
- package/lib/codec/cosmos/genutil/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/genutil/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1/gov.d.ts +11 -11
- package/lib/codec/cosmos/gov/v1/query.d.ts +20 -20
- package/lib/codec/cosmos/gov/v1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1/tx.d.ts +16 -16
- package/lib/codec/cosmos/gov/v1/tx.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +11 -11
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +18 -18
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +10 -10
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/group/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/group/v1/events.d.ts +12 -12
- package/lib/codec/cosmos/group/v1/events.js +4 -4
- package/lib/codec/cosmos/group/v1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/group/v1/query.d.ts +30 -30
- package/lib/codec/cosmos/group/v1/tx.d.ts +30 -30
- package/lib/codec/cosmos/group/v1/tx.js +4 -4
- package/lib/codec/cosmos/group/v1/types.d.ts +13 -13
- package/lib/codec/cosmos/ics23/v1/proofs.d.ts +15 -15
- package/lib/codec/cosmos/mint/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +3 -3
- package/lib/codec/cosmos/mint/v1beta1/mint.d.ts +4 -4
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/mint/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/nft/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/nft/v1beta1/event.d.ts +5 -5
- package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/nft/v1beta1/nft.d.ts +4 -4
- package/lib/codec/cosmos/nft/v1beta1/query.d.ts +16 -16
- package/lib/codec/cosmos/nft/v1beta1/tx.d.ts +4 -4
- package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +3 -3
- package/lib/codec/cosmos/orm/query/v1alpha1/query.d.ts +9 -9
- package/lib/codec/cosmos/orm/v1/orm.d.ts +6 -6
- package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +4 -4
- package/lib/codec/cosmos/params/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/params/v1beta1/params.d.ts +4 -4
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +7 -7
- package/lib/codec/cosmos/reflection/v1/reflection.d.ts +4 -4
- package/lib/codec/cosmos/slashing/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +6 -6
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +8 -8
- package/lib/codec/cosmos/slashing/v1beta1/slashing.d.ts +4 -4
- package/lib/codec/cosmos/slashing/v1beta1/tx.d.ts +6 -6
- package/lib/codec/cosmos/staking/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +4 -4
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +4 -4
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +30 -30
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +23 -23
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +16 -16
- package/lib/codec/cosmos/store/internal/kv/v1beta1/kv.d.ts +4 -4
- package/lib/codec/cosmos/store/snapshots/v1/snapshot.d.ts +9 -9
- package/lib/codec/cosmos/store/streaming/abci/grpc.d.ts +6 -6
- package/lib/codec/cosmos/store/v1beta1/commit_info.d.ts +5 -5
- package/lib/codec/cosmos/store/v1beta1/listening.d.ts +4 -4
- package/lib/codec/cosmos/tx/config/v1/config.d.ts +3 -3
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +7 -7
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +20 -20
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +15 -15
- package/lib/codec/cosmos/tx/v1beta1/tx.js +4 -4
- package/lib/codec/cosmos/upgrade/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +12 -12
- package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +6 -6
- package/lib/codec/cosmos/upgrade/v1beta1/upgrade.d.ts +6 -6
- package/lib/codec/cosmos/vesting/module/v1/module.d.ts +3 -3
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +8 -8
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +8 -8
- package/lib/codec/cosmos-models.js +5 -1
- 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/google/protobuf/any.d.ts +3 -3
- package/lib/codec/google/protobuf/descriptor.d.ts +34 -34
- package/lib/codec/google/protobuf/duration.d.ts +3 -3
- package/lib/codec/google/protobuf/empty.d.ts +3 -3
- package/lib/codec/google/protobuf/timestamp.d.ts +3 -3
- package/lib/codec/google/protobuf/wrappers.d.ts +11 -11
- package/lib/codec/ibc/applications/fee/v1/ack.d.ts +3 -3
- package/lib/codec/ibc/applications/fee/v1/fee.d.ts +6 -6
- package/lib/codec/ibc/applications/fee/v1/genesis.d.ts +7 -7
- package/lib/codec/ibc/applications/fee/v1/metadata.d.ts +3 -3
- package/lib/codec/ibc/applications/fee/v1/query.d.ts +22 -22
- package/lib/codec/ibc/applications/fee/v1/tx.d.ts +10 -10
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/controller.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/query.d.ts +6 -6
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +8 -8
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.js +2 -2
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +7 -7
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/host.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/query.d.ts +4 -4
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/tx.d.ts +4 -4
- package/lib/codec/ibc/applications/interchain_accounts/v1/account.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/v1/metadata.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/v1/packet.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/authz.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/genesis.d.ts +3 -3
- package/lib/codec/ibc/applications/transfer/v1/query.d.ts +14 -14
- package/lib/codec/ibc/applications/transfer/v1/transfer.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/tx.d.ts +6 -6
- package/lib/codec/ibc/applications/transfer/v2/packet.d.ts +3 -3
- package/lib/codec/ibc/core/channel/v1/channel.d.ts +11 -11
- package/lib/codec/ibc/core/channel/v1/genesis.d.ts +4 -4
- package/lib/codec/ibc/core/channel/v1/query.d.ts +36 -36
- package/lib/codec/ibc/core/channel/v1/tx.d.ts +40 -40
- package/lib/codec/ibc/core/channel/v1/tx.js +4 -4
- package/lib/codec/ibc/core/channel/v1/upgrade.d.ts +5 -5
- package/lib/codec/ibc/core/channel/v1/upgrade.js +2 -2
- package/lib/codec/ibc/core/client/v1/client.d.ts +9 -9
- package/lib/codec/ibc/core/client/v1/genesis.d.ts +5 -5
- package/lib/codec/ibc/core/client/v1/query.d.ts +20 -20
- package/lib/codec/ibc/core/client/v1/tx.d.ts +16 -16
- package/lib/codec/ibc/core/commitment/v1/commitment.d.ts +6 -6
- package/lib/codec/ibc/core/connection/v1/connection.d.ts +9 -9
- package/lib/codec/ibc/core/connection/v1/genesis.d.ts +3 -3
- package/lib/codec/ibc/core/connection/v1/query.d.ts +14 -14
- package/lib/codec/ibc/core/connection/v1/tx.d.ts +12 -12
- package/lib/codec/ibc/core/types/v1/genesis.d.ts +3 -3
- package/lib/codec/ibc/lightclients/localhost/v2/localhost.d.ts +3 -3
- package/lib/codec/ibc/lightclients/solomachine/v2/solomachine.d.ts +18 -18
- package/lib/codec/ibc/lightclients/solomachine/v3/solomachine.d.ts +10 -10
- package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.d.ts +7 -7
- package/lib/codec/ibc/lightclients/wasm/v1/genesis.d.ts +4 -4
- package/lib/codec/ibc/lightclients/wasm/v1/query.d.ts +6 -6
- package/lib/codec/ibc/lightclients/wasm/v1/tx.d.ts +8 -8
- package/lib/codec/ibc/lightclients/wasm/v1/wasm.d.ts +6 -6
- package/lib/codec/ibc-models.js +5 -1
- package/lib/codec/index.d.ts +10 -29
- package/lib/codec/index.js +674 -897
- package/lib/codec/oraclesvc/query.js +1 -1
- package/lib/codec/polynetwork-models.js +5 -1
- package/lib/codec/tendermint/abci/types.d.ts +49 -49
- package/lib/codec/tendermint/abci/types.js +4 -4
- package/lib/codec/tendermint/crypto/keys.d.ts +3 -3
- package/lib/codec/tendermint/crypto/proof.d.ts +7 -7
- package/lib/codec/tendermint/libs/bits/types.d.ts +3 -3
- package/lib/codec/tendermint/oracle/types.d.ts +8 -8
- package/lib/codec/tendermint/p2p/types.d.ts +6 -6
- package/lib/codec/tendermint/types/block.d.ts +3 -3
- package/lib/codec/tendermint/types/evidence.d.ts +6 -6
- package/lib/codec/tendermint/types/params.d.ts +9 -9
- package/lib/codec/tendermint/types/types.d.ts +17 -17
- package/lib/codec/tendermint/types/types.js +4 -4
- package/lib/codec/tendermint/types/validator.d.ts +5 -5
- package/lib/codec/tendermint/version/types.d.ts +4 -4
- package/lib/constant/address.d.ts +1 -1
- package/lib/constant/generic.d.ts +0 -10
- package/lib/constant/generic.js +1 -1
- package/lib/constant/ibc.d.ts +3 -3
- package/lib/constant/ibc.js +5 -7
- package/lib/constant/index.d.ts +0 -2
- package/lib/constant/index.js +5 -3
- package/lib/constant/network.d.ts +1 -1
- package/lib/constant/network.js +2 -2
- package/lib/constant/node.d.ts +1 -1
- package/lib/constant/walletProvider.d.ts +1 -2
- package/lib/constant/walletProvider.js +0 -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.d.ts +2 -2
- package/lib/index.js +6 -5
- package/lib/insights/common.d.ts +9 -1
- package/lib/insights/common.js +4 -0
- package/lib/insights/competition.d.ts +42 -4
- package/lib/insights/funding.d.ts +12 -0
- package/lib/insights/index.js +5 -1
- package/lib/insights/position.d.ts +1 -1
- package/lib/insights/user.d.ts +29 -1
- package/lib/modules/admin.d.ts +2 -7
- package/lib/modules/admin.js +3 -10
- package/lib/modules/alliance.js +1 -1
- package/lib/modules/bridge.d.ts +16 -0
- package/lib/modules/bridge.js +54 -0
- package/lib/modules/cdp.d.ts +21 -91
- package/lib/modules/cdp.js +97 -239
- package/lib/modules/cosmwasm.js +2 -2
- package/lib/modules/evm.d.ts +1 -1
- package/lib/modules/evm.js +6 -6
- package/lib/modules/gov.js +1 -1
- package/lib/modules/ibc.d.ts +1 -1
- package/lib/modules/ibc.js +9 -5
- package/lib/modules/index.js +5 -1
- package/lib/modules/liquiditypool.js +1 -1
- package/lib/modules/oracle.d.ts +0 -7
- package/lib/modules/oracle.js +0 -27
- package/lib/modules/order.js +1 -1
- package/lib/modules/xchain.d.ts +0 -1
- package/lib/modules/xchain.js +0 -16
- 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/bridge.js +1 -3
- package/lib/provider/amino/types/broker.js +6 -2
- package/lib/provider/amino/types/cdp.js +26 -52
- 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 +6 -2
- 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 +75 -95
- package/lib/provider/amino/types/grant.js +14 -10
- 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 +1 -39
- package/lib/provider/amino/types/order.js +11 -7
- 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 +12 -12
- package/lib/provider/index.d.ts +1 -4
- package/lib/provider/index.js +1 -5
- package/lib/provider/keplr/KeplrAccount.js +32 -24
- package/lib/provider/leap/LeapAccount.d.ts +1 -1
- package/lib/provider/leap/LeapAccount.js +62 -5
- package/lib/provider/leap/index.d.ts +1 -1
- package/lib/provider/ledger/ledger.js +9 -6
- package/lib/provider/metamask/MetaMask.d.ts +26 -10
- package/lib/provider/metamask/MetaMask.js +200 -46
- package/lib/provider/metamask/error.d.ts +1 -1
- package/lib/provider/metamask/index.d.ts +1 -1
- package/lib/provider/o3/O3Types.d.ts +1 -1
- package/lib/provider/o3/O3Wallet.js +18 -11
- package/lib/provider/o3/index.js +5 -1
- package/lib/provider/rainbowKit/RainbowKitAccount.d.ts +1 -0
- package/lib/provider/rainbowKit/RainbowKitAccount.js +18 -2
- package/lib/provider/zilpay/Zilpay.d.ts +1 -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/alliance.d.ts +1 -1
- package/lib/util/api.d.ts +3 -3
- package/lib/util/api.js +4 -4
- package/lib/util/blockchain.d.ts +7 -7
- package/lib/util/blockchain.js +4 -4
- package/lib/util/eip712.js +3 -3
- package/lib/util/ethermint.d.ts +1 -0
- package/lib/util/ethermint.js +45 -1
- 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 -3
- package/lib/util/gov.js +0 -34
- package/lib/util/grant.d.ts +1 -1
- package/lib/util/grant.js +1 -1
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.js +7 -2
- 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 +13 -32
- package/lib/util/tx.js +6 -3
- package/lib/util/type.d.ts +1 -1
- package/lib/wallet/CarbonSigner.d.ts +11 -5
- package/lib/wallet/CarbonSigner.js +29 -6
- package/lib/wallet/CarbonSigningClient.js +16 -16
- package/lib/wallet/CarbonWallet.d.ts +4 -7
- package/lib/wallet/CarbonWallet.js +14 -19
- package/lib/wallet/index.js +5 -1
- package/lib/websocket/connector.js +8 -4
- package/lib/websocket/index.js +5 -1
- package/lib/websocket/models.d.ts +4 -4
- package/lib/websocket/types.d.ts +1 -1
- package/package.json +3 -3
package/lib/CarbonSDK.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts, MetaMaskWalletOpts
|
|
|
15
15
|
export { CarbonTx } from "./util";
|
|
16
16
|
export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
|
|
17
17
|
export * as Carbon from "./codec/carbon-models";
|
|
18
|
-
import RainbowKitAccount, { RainbowKitWalletOpts } from "./provider/rainbowKit/RainbowKitAccount";
|
|
19
18
|
export interface CarbonSDKOpts {
|
|
20
19
|
network: Network;
|
|
21
20
|
tmClient: Tendermint37Client;
|
|
@@ -115,7 +114,6 @@ declare class CarbonSDK {
|
|
|
115
114
|
static instanceWithKeplr(keplr: Keplr, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
116
115
|
static instanceWithLeap(leap: LeapExtended, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
117
116
|
static instanceWithMetamask(metamask: MetaMask, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts, metamaskWalletOpts?: MetaMaskWalletOpts): Promise<ConnectedCarbonSDK>;
|
|
118
|
-
static instanceWithRainbowKit(rainbowKit: RainbowKitAccount, sdkOpts: CarbonSDKInitOpts | undefined, rainbowKitWalletOpts: RainbowKitWalletOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
119
117
|
static instanceViewOnly(bech32Address: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
120
118
|
initialize(): Promise<CarbonSDK>;
|
|
121
119
|
getGasFee(): Promise<GasFee>;
|
|
@@ -130,7 +128,6 @@ declare class CarbonSDK {
|
|
|
130
128
|
connectWithKeplr(keplr: Keplr, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
131
129
|
connectWithLeap(leap: LeapExtended, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
132
130
|
connectWithMetamask(metamask: MetaMask, opts?: CarbonWalletGenericOpts, metamaskWalletOpts?: MetaMaskWalletOpts): Promise<ConnectedCarbonSDK>;
|
|
133
|
-
connectWithRainbowKit(rainbowKit: RainbowKitAccount, rainbowKitWalletOpts: RainbowKitWalletOpts, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
134
131
|
connectViewOnly(bech32Address: string, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
135
132
|
getConfig(): NetworkConfig;
|
|
136
133
|
getTokenClient(): TokenClient;
|
package/lib/CarbonSDK.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -78,7 +82,7 @@ class CarbonSDK {
|
|
|
78
82
|
if (!opts.query) {
|
|
79
83
|
let grpcClient;
|
|
80
84
|
if (opts.useTmAbciQuery !== true && this.networkConfig.grpcUrl) {
|
|
81
|
-
const transport = typeof window === "undefined" ? grpc_web_node_http_transport_1.NodeHttpTransport() : undefined;
|
|
85
|
+
const transport = typeof window === "undefined" ? (0, grpc_web_node_http_transport_1.NodeHttpTransport)() : undefined;
|
|
82
86
|
grpcClient = (_h = opts.grpcQueryClient) !== null && _h !== void 0 ? _h : new GrpcQueryClient_1.default(this.networkConfig.restUrl, {
|
|
83
87
|
transport,
|
|
84
88
|
});
|
|
@@ -232,12 +236,6 @@ class CarbonSDK {
|
|
|
232
236
|
return sdk.connectWithMetamask(metamask, walletOpts, metamaskWalletOpts);
|
|
233
237
|
});
|
|
234
238
|
}
|
|
235
|
-
static instanceWithRainbowKit(rainbowKit, sdkOpts = DEFAULT_SDK_INIT_OPTS, rainbowKitWalletOpts, walletOpts) {
|
|
236
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
const sdk = yield CarbonSDK.instance(sdkOpts);
|
|
238
|
-
return sdk.connectWithRainbowKit(rainbowKit, rainbowKitWalletOpts, walletOpts);
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
239
|
static instanceViewOnly(bech32Address, sdkOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
|
|
242
240
|
return __awaiter(this, void 0, void 0, function* () {
|
|
243
241
|
const sdk = yield CarbonSDK.instance(sdkOpts);
|
|
@@ -266,14 +264,14 @@ class CarbonSDK {
|
|
|
266
264
|
pagination: constant_1.PAGINATE_10K,
|
|
267
265
|
});
|
|
268
266
|
const txGasCosts = msgGasCosts.reduce((result, item) => {
|
|
269
|
-
result[item.msgType] = number_1.bnOrZero(item.gasCost);
|
|
267
|
+
result[item.msgType] = (0, number_1.bnOrZero)(item.gasCost);
|
|
270
268
|
return result;
|
|
271
269
|
}, {});
|
|
272
270
|
const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({
|
|
273
271
|
pagination: constant_1.PAGINATE_10K,
|
|
274
272
|
});
|
|
275
273
|
const txGasPrices = minGasPrices.reduce((result, item) => {
|
|
276
|
-
result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
|
|
274
|
+
result[item.denom] = (0, number_1.bnOrZero)(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
|
|
277
275
|
return result;
|
|
278
276
|
}, {});
|
|
279
277
|
return new GasFee_1.default(txGasCosts, txGasPrices);
|
|
@@ -400,17 +398,6 @@ class CarbonSDK {
|
|
|
400
398
|
return this.connect(wallet);
|
|
401
399
|
});
|
|
402
400
|
}
|
|
403
|
-
connectWithRainbowKit(rainbowKit, rainbowKitWalletOpts, opts) {
|
|
404
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
405
|
-
const evmChainId = this.evmChainId;
|
|
406
|
-
const addressOptions = {
|
|
407
|
-
network: this.networkConfig.network,
|
|
408
|
-
bech32Prefix: this.networkConfig.Bech32Prefix,
|
|
409
|
-
};
|
|
410
|
-
const wallet = wallet_1.CarbonWallet.withRainbowKit(rainbowKit, evmChainId, rainbowKitWalletOpts.publicKeyBase64, addressOptions, rainbowKitWalletOpts.walletProvider, Object.assign(Object.assign({}, opts), { network: this.network, config: this.configOverride }));
|
|
411
|
-
return this.connect(wallet);
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
401
|
connectViewOnly(bech32Address, opts) {
|
|
415
402
|
return __awaiter(this, void 0, void 0, function* () {
|
|
416
403
|
const wallet = wallet_1.CarbonWallet.withAddress(bech32Address, Object.assign(Object.assign({}, opts), { network: this.network, config: this.configOverride }));
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import CarbonSDK from "../CarbonSDK";
|
|
2
1
|
import { NetworkConfigProvider } from "../constant";
|
|
3
|
-
import { CarbonTx } from "../util";
|
|
4
|
-
import { Coin } from "@cosmjs/stargate";
|
|
5
2
|
import BigNumber from "bignumber.js";
|
|
6
3
|
import { ethers } from "ethers";
|
|
7
4
|
export interface AxelarBridgeClientOpts {
|
|
@@ -19,13 +16,6 @@ export interface DepositParams {
|
|
|
19
16
|
signer: ethers.Signer;
|
|
20
17
|
nonce?: number;
|
|
21
18
|
}
|
|
22
|
-
export interface WithdrawParams {
|
|
23
|
-
connectionId: string;
|
|
24
|
-
receiver: string;
|
|
25
|
-
tokens: Coin;
|
|
26
|
-
relayFee: Coin;
|
|
27
|
-
expirySeconds: number;
|
|
28
|
-
}
|
|
29
19
|
export interface EthersTransactionResponse extends ethers.Transaction {
|
|
30
20
|
wait: () => Promise<ethers.Transaction>;
|
|
31
21
|
}
|
|
@@ -34,6 +24,5 @@ export declare class AxelarBridgeClient {
|
|
|
34
24
|
private constructor();
|
|
35
25
|
static instance(opts: AxelarBridgeClientOpts): AxelarBridgeClient;
|
|
36
26
|
deposit(params: DepositParams): Promise<EthersTransactionResponse>;
|
|
37
|
-
withdraw(api: CarbonSDK, params: WithdrawParams, opts?: CarbonTx.SignTxOpts): Promise<import("../CarbonSDK").CarbonWallet.SendTxResponse>;
|
|
38
27
|
}
|
|
39
28
|
export default AxelarBridgeClient;
|
|
@@ -8,16 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.AxelarBridgeClient = void 0;
|
|
16
|
-
const codec_1 = require("../codec");
|
|
17
13
|
const eth_1 = require("../eth");
|
|
18
|
-
const util_1 = require("../util");
|
|
19
14
|
const ethers_1 = require("ethers");
|
|
20
|
-
const long_1 = __importDefault(require("long"));
|
|
21
15
|
class AxelarBridgeClient {
|
|
22
16
|
constructor(configProvider) {
|
|
23
17
|
this.configProvider = configProvider;
|
|
@@ -38,29 +32,6 @@ class AxelarBridgeClient {
|
|
|
38
32
|
amount.toString(10));
|
|
39
33
|
});
|
|
40
34
|
}
|
|
41
|
-
withdraw(api, params, opts) {
|
|
42
|
-
var _a;
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const { connectionId, receiver, tokens, relayFee, expirySeconds, } = params;
|
|
45
|
-
const wallet = api.getConnectedWallet();
|
|
46
|
-
const walletAddress = (_a = wallet.bech32Address) !== null && _a !== void 0 ? _a : '';
|
|
47
|
-
const expiryDuration = codec_1.Duration.fromPartial({
|
|
48
|
-
seconds: new long_1.default(expirySeconds),
|
|
49
|
-
});
|
|
50
|
-
const value = codec_1.Carbon.Bridge.MsgWithdrawToken.fromPartial({
|
|
51
|
-
creator: walletAddress,
|
|
52
|
-
connectionId,
|
|
53
|
-
receiver,
|
|
54
|
-
tokens,
|
|
55
|
-
relayFee,
|
|
56
|
-
expiryDuration,
|
|
57
|
-
});
|
|
58
|
-
return yield wallet.sendTx({
|
|
59
|
-
typeUrl: util_1.CarbonTx.Types.MsgWithdrawToken,
|
|
60
|
-
value,
|
|
61
|
-
}, opts);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
35
|
}
|
|
65
36
|
exports.AxelarBridgeClient = AxelarBridgeClient;
|
|
66
37
|
exports.default = AxelarBridgeClient;
|
|
@@ -29,7 +29,7 @@ class BatchQueryClient {
|
|
|
29
29
|
};
|
|
30
30
|
if (typeof endpoint === "string") {
|
|
31
31
|
// accept host.name:port and assume http protocol
|
|
32
|
-
this.url = rpcclient_1.hasProtocol(endpoint) ? endpoint : "http://" + endpoint;
|
|
32
|
+
this.url = (0, rpcclient_1.hasProtocol)(endpoint) ? endpoint : "http://" + endpoint;
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
this.url = endpoint.url;
|
|
@@ -71,7 +71,7 @@ class BatchQueryClient {
|
|
|
71
71
|
return;
|
|
72
72
|
const requests = batch.map((s) => s.request);
|
|
73
73
|
const requestIds = requests.map((request) => request.id);
|
|
74
|
-
http_1.http("POST", this.url, this.headers, requests).then((raw) => {
|
|
74
|
+
(0, http_1.http)("POST", this.url, this.headers, requests).then((raw) => {
|
|
75
75
|
// Requests with a single entry return as an object
|
|
76
76
|
const arr = Array.isArray(raw) ? raw : [raw];
|
|
77
77
|
arr.forEach((el, i) => {
|
|
@@ -79,8 +79,8 @@ class BatchQueryClient {
|
|
|
79
79
|
if (!req)
|
|
80
80
|
return;
|
|
81
81
|
const { reject, resolve } = req;
|
|
82
|
-
const response = json_rpc_1.parseJsonRpcResponse(el);
|
|
83
|
-
if (json_rpc_1.isJsonRpcErrorResponse(response)) {
|
|
82
|
+
const response = (0, json_rpc_1.parseJsonRpcResponse)(el);
|
|
83
|
+
if ((0, json_rpc_1.isJsonRpcErrorResponse)(response)) {
|
|
84
84
|
reject(new Error(JSON.stringify(response.error)));
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
@@ -57,7 +57,7 @@ const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
|
57
57
|
class CarbonQueryClient {
|
|
58
58
|
constructor(opts) {
|
|
59
59
|
var _a;
|
|
60
|
-
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : stargate_1.createProtobufRpcClient(new stargate_1.QueryClient(opts.tmClient));
|
|
60
|
+
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : (0, stargate_1.createProtobufRpcClient)(new stargate_1.QueryClient(opts.tmClient));
|
|
61
61
|
this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
|
|
62
62
|
this.adl = new query_1.QueryClientImpl(rpcClient);
|
|
63
63
|
this.alliance = new query_47.QueryClientImpl(rpcClient);
|
package/lib/clients/ETHClient.js
CHANGED
|
@@ -44,15 +44,15 @@ class ETHClient {
|
|
|
44
44
|
?
|
|
45
45
|
this.tokenClient.getBlockchainV2(token.denom) == ETHClient.BLOCKCHAINV2_MAPPING[this.blockchain]
|
|
46
46
|
:
|
|
47
|
-
blockchain_1.blockchainForChainId(token.chainId.toNumber(), api.network) == this.blockchain;
|
|
47
|
+
(0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), api.network) == this.blockchain;
|
|
48
48
|
return isCorrectBlockchain &&
|
|
49
49
|
token.tokenAddress.length == 40 &&
|
|
50
|
-
token.bridgeAddress.toLowerCase() == generic_1.stripHexPrefix(lockProxyAddress) &&
|
|
50
|
+
token.bridgeAddress.toLowerCase() == (0, generic_1.stripHexPrefix)(lockProxyAddress) &&
|
|
51
51
|
(!whitelistDenoms || whitelistDenoms.includes(token.denom)) &&
|
|
52
|
-
this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
52
|
+
this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress));
|
|
53
53
|
});
|
|
54
54
|
const assetIds = tokens.map((token) => {
|
|
55
|
-
return this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
55
|
+
return this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress));
|
|
56
56
|
});
|
|
57
57
|
const provider = this.getProvider();
|
|
58
58
|
const contractAddress = this.getBalanceReaderAddress();
|
|
@@ -101,14 +101,14 @@ class ETHClient {
|
|
|
101
101
|
}
|
|
102
102
|
const carbonNetwork = networkConfig.network;
|
|
103
103
|
const fromTokenId = fromToken.id;
|
|
104
|
-
const fromTokenAddress = generic_1.appendHexPrefix(fromToken.tokenAddress);
|
|
104
|
+
const fromTokenAddress = (0, generic_1.appendHexPrefix)(fromToken.tokenAddress);
|
|
105
105
|
const toTokenDenom = toToken.denom;
|
|
106
106
|
const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
|
|
107
107
|
const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
|
|
108
108
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
|
|
109
109
|
const nonce = yield this.getTxNonce(fromAddress, params.nonce, rpcProvider);
|
|
110
110
|
const contract = new ethers_1.ethers.Contract(this.getBridgeEntranceAddr(), eth_1.ABIs.bridgeEntrance, rpcProvider);
|
|
111
|
-
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
111
|
+
const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
|
|
112
112
|
const tokenCreator = fromToken.creator;
|
|
113
113
|
const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator, carbonNetwork);
|
|
114
114
|
const targetProxyHash = ethers_1.ethers.utils.hexlify(targetAddressBytes);
|
|
@@ -137,9 +137,9 @@ class ETHClient {
|
|
|
137
137
|
throw new Error("Minimum gas required: 150,000");
|
|
138
138
|
}
|
|
139
139
|
const networkConfig = this.getNetworkConfig();
|
|
140
|
-
const assetId = generic_1.appendHexPrefix(token.tokenAddress);
|
|
141
|
-
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
|
|
142
|
-
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
140
|
+
const assetId = (0, generic_1.appendHexPrefix)(token.tokenAddress);
|
|
141
|
+
const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(token));
|
|
142
|
+
const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
|
|
143
143
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
|
|
144
144
|
const swthAddress = ethers_1.ethers.utils.hexlify(address);
|
|
145
145
|
const contractAddress = this.getLockProxyAddress();
|
|
@@ -190,15 +190,15 @@ class ETHClient {
|
|
|
190
190
|
return "insufficient balance";
|
|
191
191
|
}
|
|
192
192
|
const networkConfig = this.getNetworkConfig();
|
|
193
|
-
const assetId = generic_1.appendHexPrefix(tokenWithExternalBalances.tokenAddress);
|
|
194
|
-
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(tokenWithExternalBalances));
|
|
195
|
-
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
193
|
+
const assetId = (0, generic_1.appendHexPrefix)(tokenWithExternalBalances.tokenAddress);
|
|
194
|
+
const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(tokenWithExternalBalances));
|
|
195
|
+
const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
|
|
196
196
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(tokenWithExternalBalances.id));
|
|
197
197
|
const nonce = Math.floor(Math.random() * 1000000000); // random nonce to prevent replay attacks
|
|
198
198
|
const message = ethers_1.ethers.utils.solidityKeccak256(["string", "address", "bytes", "bytes", "bytes", "uint256", "uint256", "uint256"], ["sendTokens", assetId, targetProxyHash, toAssetHash, feeAddress, amount, feeAmount, nonce]);
|
|
199
199
|
// logger("sendDeposit message", message)
|
|
200
200
|
const { address, signature } = yield getSignatureCallback(message);
|
|
201
|
-
const signatureBytes = ethers_1.ethers.utils.arrayify(generic_1.appendHexPrefix(signature));
|
|
201
|
+
const signatureBytes = ethers_1.ethers.utils.arrayify((0, generic_1.appendHexPrefix)(signature));
|
|
202
202
|
const rsv = ethers_1.ethers.utils.splitSignature(signatureBytes);
|
|
203
203
|
// logger("sign result", address, signature)
|
|
204
204
|
const signatureResult = {
|
|
@@ -237,7 +237,7 @@ class ETHClient {
|
|
|
237
237
|
if (!feeInfo.deposit_fee) {
|
|
238
238
|
throw new Error("unsupported token");
|
|
239
239
|
}
|
|
240
|
-
if (blockchain_1.blockchainForChainId(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
|
|
240
|
+
if ((0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
|
|
241
241
|
throw new Error("unsupported token");
|
|
242
242
|
}
|
|
243
243
|
let feeAmount = ethers_1.ethers.BigNumber.from(feeInfo.deposit_fee);
|
|
@@ -303,7 +303,7 @@ class ETHClient {
|
|
|
303
303
|
getTargetProxyHash(token) {
|
|
304
304
|
const networkConfig = this.getNetworkConfig();
|
|
305
305
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
306
|
-
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
306
|
+
const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
307
307
|
return addressHex;
|
|
308
308
|
}
|
|
309
309
|
getProvider() {
|
|
@@ -29,7 +29,7 @@ exports.HydrogenEndpoints = {
|
|
|
29
29
|
const formatDateField = (value) => {
|
|
30
30
|
if (typeof value !== "string")
|
|
31
31
|
return null;
|
|
32
|
-
return dayjs_1.default(value);
|
|
32
|
+
return (0, 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
|
|
@@ -84,13 +84,13 @@ class HydrogenClient {
|
|
|
84
84
|
var _a, _b, _c, _d;
|
|
85
85
|
if (typeof value !== "object")
|
|
86
86
|
return value;
|
|
87
|
-
return Object.assign(Object.assign({}, value), { created_at: formatDateField((_a = value.created_at) === null || _a === void 0 ? void 0 : _a.toString()), updated_at: formatDateField((_b = value.updated_at) === null || _b === void 0 ? void 0 : _b.toString()), source_blockchain: this.tokenClient.getBlockchainV2FromIDs(value.from_chain_id, value.bridge_id), bridging_blockchain: getBridgeBlockchainFromId(value.bridge_id), destination_blockchain: this.tokenClient.getBlockchainV2FromIDs(value.to_chain_id, value.bridge_id), source_event: this.formatChainEventV2(value.source_event, (_c = value.source_blockchain) !== null && _c !== void 0 ? _c : ''), bridging_event: this.formatChainEventV2(value.bridging_event, getBridgeBlockchainFromId(value.bridge_id)), destination_event: this.formatChainEventV2(value.destination_event, (_d = value.destination_blockchain) !== null && _d !== void 0 ? _d : ''), relay: this.formatRelaysTransfersV2(value.relay) });
|
|
87
|
+
return Object.assign(Object.assign({}, value), { created_at: formatDateField((_a = value.created_at) === null || _a === void 0 ? void 0 : _a.toString()), updated_at: formatDateField((_b = value.updated_at) === null || _b === void 0 ? void 0 : _b.toString()), source_blockchain: this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id), bridging_blockchain: getBridgeBlockchainFromId(value.bridge_id), destination_blockchain: this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id), source_event: this.formatChainEventV2(value.source_event, (_c = value.source_blockchain) !== null && _c !== void 0 ? _c : ''), bridging_event: this.formatChainEventV2(value.bridging_event, getBridgeBlockchainFromId(value.bridge_id)), destination_event: this.formatChainEventV2(value.destination_event, (_d = value.destination_blockchain) !== null && _d !== void 0 ? _d : ''), relay: this.formatRelaysTransfersV2(value.relay) });
|
|
88
88
|
};
|
|
89
89
|
this.formatCrossChainTransferDetailedV2 = (value) => {
|
|
90
90
|
if (!value || typeof value !== "object")
|
|
91
91
|
return value;
|
|
92
|
-
const source_blockchain = this.tokenClient.getBlockchainV2FromIDs(value.from_chain_id, value.bridge_id);
|
|
93
|
-
const destination_blockchain = this.tokenClient.getBlockchainV2FromIDs(value.to_chain_id, value.bridge_id);
|
|
92
|
+
const source_blockchain = this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id);
|
|
93
|
+
const destination_blockchain = this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id);
|
|
94
94
|
const bridging_blockchain = getBridgeBlockchainFromId(value.bridge_id);
|
|
95
95
|
return Object.assign(Object.assign({}, this.formatCrossChainTransferV2(value)), { source_event: this.formatChainEventV2(value.source_event, source_blockchain !== null && source_blockchain !== void 0 ? source_blockchain : ''), bridging_event: this.formatChainEventV2(value.bridging_event, bridging_blockchain), destination_event: this.formatChainEventV2(value.destination_event, destination_blockchain !== null && destination_blockchain !== void 0 ? destination_blockchain : '') });
|
|
96
96
|
};
|
|
@@ -18,6 +18,8 @@ declare class InsightsQueryClient {
|
|
|
18
18
|
UserPnl(req: Insights.QueryGetUserPnlPathParams, query: Insights.QueryGetUserPnlGraphQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserPnlResponse>>;
|
|
19
19
|
UserBalanceGraph(req: Insights.QueryGetUserBalanceGraphPathParams, query: Insights.QueryGetUserBalanceGraphQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserBalanceGraphResponse>>;
|
|
20
20
|
UserPnlGraph(req: Insights.QueryGetUserPnlGraphPathParams, query: Insights.QueryGetUserPnlGraphQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserPnlGraphResponse>>;
|
|
21
|
+
UserFundings(req: Insights.QueryGetUserFundingsPathParams, query: Insights.QueryGetUserFundingsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserFundingsResponse>>;
|
|
22
|
+
UserFundingBreakdown(req: Insights.QueryGetFundingBreakdownChartPathParams, query: Insights.QueryGetFundingBreakdownChartQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingBreakdownChartResponse>>;
|
|
21
23
|
Pools(req?: Insights.QueryGetPoolsRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsResponse>>;
|
|
22
24
|
PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
|
|
23
25
|
PerpPoolHistory(query: Insights.QueryGetPerpPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPerpPoolHistoryResponse>>;
|
|
@@ -38,6 +40,7 @@ declare class InsightsQueryClient {
|
|
|
38
40
|
PNLCompetitionLeaderboard(req: Insights.QueryGetPNLCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPNLCompetitionLeaderboardResponse>>;
|
|
39
41
|
LotteryCompetitionLeaderboard(req: Insights.QueryGetLotteryCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLotteryCompetitionLeaderboardResponse>>;
|
|
40
42
|
LeagueCompetitionLeaderboard(req: Insights.QueryGetLeagueCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLeagueCompetitionLeaderboardResponse>>;
|
|
43
|
+
CosmosCompetitionLeaderboard(req: Insights.QueryGetCosmosCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCosmosCompetitionLeaderboardResponse>>;
|
|
41
44
|
PoolsLiquidity(req?: Insights.QueryGetPoolsLiquidityRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsLiquidityResponse>>;
|
|
42
45
|
MarketsVolume(req?: Insights.QueryGetMarketVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetMarketVolumeResponse>>;
|
|
43
46
|
CarbonCreditsRewards(req: Insights.QueryCarbonCreditsRewardsRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryCarbonCreditsRewardsResponse>>;
|
|
@@ -57,6 +60,7 @@ declare class InsightsQueryClient {
|
|
|
57
60
|
DenomToGeckoIdMap(): Promise<Insights.InsightsQueryResponse<Insights.QueryDenomToGeckoIdMap>>;
|
|
58
61
|
FundingHistory(query: Insights.QueryGetFundingHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingHistoryResponse>>;
|
|
59
62
|
HistoricalFundingHistory(query: Insights.QueryGetFundingRateRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingRateResponse>>;
|
|
63
|
+
FundingHistoryGraphData(query: Insights.QueryGetFundingHistoryGraphDataRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingHistoryGraphDataResponse>>;
|
|
60
64
|
ProposalVotes(req: Insights.GetProposalVotesPathParams, query: Insights.GetProposalVotesQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetProposalVotesResponse>>;
|
|
61
65
|
Delegations(req: Insights.GetDelegationsPathParams, query: Insights.GetDelegationsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetDelegationsResponse>>;
|
|
62
66
|
OraclePrices(req?: Insights.QueryGetOraclesPriceRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetOraclesPriceResponse>>;
|
|
@@ -101,12 +101,12 @@ class InsightsQueryClient {
|
|
|
101
101
|
const meta = response.data.result.meta;
|
|
102
102
|
const parsedEntries = rawEntries.map(entry => ({
|
|
103
103
|
lastHeight: entry.lastHeight,
|
|
104
|
-
time: dayjs_1.default(entry.time),
|
|
104
|
+
time: (0, dayjs_1.default)(entry.time),
|
|
105
105
|
volumeValue: new bignumber_js_1.default(entry.volumeValue),
|
|
106
106
|
}));
|
|
107
107
|
const parsedMeta = {
|
|
108
|
-
from: dayjs_1.default(meta.from),
|
|
109
|
-
until: dayjs_1.default(meta.until),
|
|
108
|
+
from: (0, dayjs_1.default)(meta.from),
|
|
109
|
+
until: (0, dayjs_1.default)(meta.until),
|
|
110
110
|
interval: meta.interval,
|
|
111
111
|
};
|
|
112
112
|
return { result: { entries: parsedEntries, meta: parsedMeta } };
|
|
@@ -140,6 +140,20 @@ class InsightsQueryClient {
|
|
|
140
140
|
return response.data;
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
+
UserFundings(req, query) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const request = this.apiManager.path("user/fundings", req, query);
|
|
146
|
+
const response = yield request.get();
|
|
147
|
+
return response.data;
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
UserFundingBreakdown(req, query) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
const request = this.apiManager.path("user/funding/breakdown", req, query);
|
|
153
|
+
const response = yield request.get();
|
|
154
|
+
return response.data;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
143
157
|
// Pool api
|
|
144
158
|
Pools(req = {}) {
|
|
145
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -275,12 +289,23 @@ class InsightsQueryClient {
|
|
|
275
289
|
return __awaiter(this, void 0, void 0, function* () {
|
|
276
290
|
const queryParams = {
|
|
277
291
|
competitionId: req.competitionId,
|
|
292
|
+
subCompetitionId: req.subCompetitionId,
|
|
278
293
|
};
|
|
279
294
|
const request = this.apiManager.path("competition/leaderboardleague", {}, queryParams);
|
|
280
295
|
const response = yield request.get();
|
|
281
296
|
return response.data;
|
|
282
297
|
});
|
|
283
298
|
}
|
|
299
|
+
CosmosCompetitionLeaderboard(req) {
|
|
300
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
const queryParams = {
|
|
302
|
+
competitionId: req.competitionId,
|
|
303
|
+
};
|
|
304
|
+
const request = this.apiManager.path("competition/leaderboardcosmos", {}, queryParams);
|
|
305
|
+
const response = yield request.get();
|
|
306
|
+
return response.data;
|
|
307
|
+
});
|
|
308
|
+
}
|
|
284
309
|
PoolsLiquidity(req = {}) {
|
|
285
310
|
return __awaiter(this, void 0, void 0, function* () {
|
|
286
311
|
const queryParams = {
|
|
@@ -478,6 +503,16 @@ class InsightsQueryClient {
|
|
|
478
503
|
return response.data;
|
|
479
504
|
});
|
|
480
505
|
}
|
|
506
|
+
FundingHistoryGraphData(query) {
|
|
507
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
508
|
+
const request = this.apiManager.path("market/funding/history/chart", {}, {
|
|
509
|
+
market: query.market,
|
|
510
|
+
period: query.period,
|
|
511
|
+
});
|
|
512
|
+
const response = yield request.get();
|
|
513
|
+
return response.data;
|
|
514
|
+
});
|
|
515
|
+
}
|
|
481
516
|
ProposalVotes(req, query) {
|
|
482
517
|
return __awaiter(this, void 0, void 0, function* () {
|
|
483
518
|
const request = this.apiManager.path("proposal/votes", req, query);
|
package/lib/clients/NEOClient.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];
|
|
@@ -68,13 +72,13 @@ class NEOClient {
|
|
|
68
72
|
?
|
|
69
73
|
!!sdk.token.getBlockchainV2(token.denom) && (blockchain_1.BLOCKCHAIN_V2_TO_V1_MAPPING[sdk.token.getBlockchainV2(token.denom)] == this.blockchain)
|
|
70
74
|
:
|
|
71
|
-
blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain;
|
|
75
|
+
(0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), sdk.network) == this.blockchain;
|
|
72
76
|
return (isCorrectBlockchain || token.denom === "swth") && token.tokenAddress.length == 40 && token.bridgeAddress.length == 40;
|
|
73
77
|
});
|
|
74
78
|
const client = new Neon.rpc.RPCClient(url, "2.5.2"); // TODO: should we change the RPC version??
|
|
75
79
|
// NOTE: fetching of tokens is chunked in sets of 15 as we may hit
|
|
76
80
|
// the gas limit on the RPC node and error out otherwise
|
|
77
|
-
const promises = lodash_1.chunk(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const promises = (0, lodash_1.chunk)(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
|
|
78
82
|
var _a, _b, _c;
|
|
79
83
|
const acc = {};
|
|
80
84
|
for (const token of partition) {
|
|
@@ -116,8 +120,8 @@ class NEOClient {
|
|
|
116
120
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
117
121
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
118
122
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(swthAddress, networkConfig.network);
|
|
119
|
-
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
120
|
-
const zeroAddressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
|
|
123
|
+
const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
124
|
+
const zeroAddressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
|
|
121
125
|
const amount = ethers_1.ethers.BigNumber.from(token.externalBalance);
|
|
122
126
|
const feeAmount = ethers_1.ethers.BigNumber.from(feeAmountInput !== null && feeAmountInput !== void 0 ? feeAmountInput : "100000000");
|
|
123
127
|
const feeAddress = feeAmount.isZero() ? zeroAddressHex : networkConfig.feeAddress;
|
|
@@ -162,7 +166,7 @@ class NEOClient {
|
|
|
162
166
|
const fromAddress = util_1.AddressUtils.NEOAddress.publicKeyToAddress(publicKeyOutput.publicKey);
|
|
163
167
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
164
168
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
165
|
-
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
169
|
+
const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(address));
|
|
166
170
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
167
171
|
if (amount.lt(feeAmount)) {
|
|
168
172
|
throw new Error("Invalid amount");
|
|
@@ -198,7 +202,7 @@ class NEOClient {
|
|
|
198
202
|
const fromAddress = ledger.scriptHash;
|
|
199
203
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
200
204
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
201
|
-
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
205
|
+
const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(address));
|
|
202
206
|
const feeAddress = networkConfig.feeAddress;
|
|
203
207
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
204
208
|
if (amount.lt(feeAmount)) {
|
|
@@ -313,7 +317,7 @@ class NEOClient {
|
|
|
313
317
|
getTargetProxyHash(token) {
|
|
314
318
|
const networkConfig = this.getNetworkConfig();
|
|
315
319
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
316
|
-
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
320
|
+
const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
317
321
|
return addressHex;
|
|
318
322
|
}
|
|
319
323
|
getNetworkConfig() {
|
|
@@ -550,7 +550,7 @@ class TokenClient {
|
|
|
550
550
|
if (!token)
|
|
551
551
|
return undefined;
|
|
552
552
|
const bridge = this.getBridgeFromToken(token);
|
|
553
|
-
if (!bridge || !blockchain_1.isIbcBridge(bridge))
|
|
553
|
+
if (!bridge || !(0, blockchain_1.isIbcBridge)(bridge))
|
|
554
554
|
return undefined;
|
|
555
555
|
return bridge.chain_id_name;
|
|
556
556
|
}
|
|
@@ -629,7 +629,7 @@ class TokenClient {
|
|
|
629
629
|
processTokenPrices(tokenPrices) {
|
|
630
630
|
return tokenPrices.reduce((prevPrices, price) => {
|
|
631
631
|
const newPrev = prevPrices;
|
|
632
|
-
newPrev[price.denom] = number_1.bnOrZero(price.twap).shiftedBy(-constant_1.decTypeDecimals);
|
|
632
|
+
newPrev[price.denom] = (0, number_1.bnOrZero)(price.twap).shiftedBy(-constant_1.decTypeDecimals);
|
|
633
633
|
return newPrev;
|
|
634
634
|
}, {});
|
|
635
635
|
}
|