carbon-js-sdk 0.11.20 → 0.11.21
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/README.md +85 -85
- package/lib/CarbonSDK.d.ts +159 -159
- package/lib/CarbonSDK.js +466 -470
- package/lib/clients/AxelarBridgeClient.d.ts +28 -28
- package/lib/clients/AxelarBridgeClient.js +37 -37
- package/lib/clients/BatchQueryClient.d.ts +26 -26
- package/lib/clients/BatchQueryClient.js +100 -100
- package/lib/clients/BlockchainClient.d.ts +16 -16
- package/lib/clients/BlockchainClient.js +19 -19
- package/lib/clients/CarbonQueryClient.d.ts +118 -118
- package/lib/clients/CarbonQueryClient.js +120 -120
- package/lib/clients/ETHClient.d.ts +115 -115
- package/lib/clients/ETHClient.js +377 -377
- package/lib/clients/GasFee.d.ts +12 -12
- package/lib/clients/GasFee.js +31 -31
- package/lib/clients/GrpcQueryClient.d.ts +22 -22
- package/lib/clients/GrpcQueryClient.js +56 -56
- package/lib/clients/HydrogenClient.d.ts +31 -31
- package/lib/clients/HydrogenClient.js +184 -184
- package/lib/clients/InsightsQueryClient.d.ts +70 -70
- package/lib/clients/InsightsQueryClient.js +552 -552
- package/lib/clients/N3Client.d.ts +73 -73
- package/lib/clients/N3Client.js +287 -287
- package/lib/clients/NEOClient.d.ts +57 -57
- package/lib/clients/NEOClient.js +335 -339
- package/lib/clients/TokenClient.d.ts +90 -90
- package/lib/clients/TokenClient.js +757 -757
- package/lib/clients/ZILClient.d.ts +106 -106
- package/lib/clients/ZILClient.js +443 -443
- package/lib/clients/index.d.ts +10 -10
- package/lib/clients/index.js +26 -26
- package/lib/codec/Switcheo/carbon/adl/genesis.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/adl/genesis.js +46 -46
- package/lib/codec/Switcheo/carbon/adl/query.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/adl/query.js +20 -20
- package/lib/codec/Switcheo/carbon/adl/tx.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/adl/tx.js +20 -20
- package/lib/codec/Switcheo/carbon/admin/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/admin/export.js +13 -13
- package/lib/codec/Switcheo/carbon/admin/genesis.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/admin/genesis.js +46 -46
- package/lib/codec/Switcheo/carbon/admin/query.d.ts +62 -62
- package/lib/codec/Switcheo/carbon/admin/query.js +186 -186
- package/lib/codec/Switcheo/carbon/admin/tx.d.ts +62 -62
- package/lib/codec/Switcheo/carbon/admin/tx.js +198 -198
- package/lib/codec/Switcheo/carbon/bank/event.d.ts +65 -65
- package/lib/codec/Switcheo/carbon/bank/event.js +332 -332
- package/lib/codec/Switcheo/carbon/bank/export.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/bank/export.js +23 -23
- package/lib/codec/Switcheo/carbon/bank/genesis.d.ts +19 -19
- package/lib/codec/Switcheo/carbon/bank/genesis.js +63 -63
- package/lib/codec/Switcheo/carbon/bank/query.d.ts +122 -122
- package/lib/codec/Switcheo/carbon/bank/query.js +643 -643
- package/lib/codec/Switcheo/carbon/bank/tx.d.ts +63 -63
- package/lib/codec/Switcheo/carbon/bank/tx.js +210 -210
- package/lib/codec/Switcheo/carbon/book/book.d.ts +57 -57
- package/lib/codec/Switcheo/carbon/book/book.js +319 -319
- package/lib/codec/Switcheo/carbon/book/event.d.ts +41 -41
- package/lib/codec/Switcheo/carbon/book/event.js +195 -195
- package/lib/codec/Switcheo/carbon/book/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/book/export.js +25 -25
- package/lib/codec/Switcheo/carbon/book/genesis.d.ts +25 -25
- package/lib/codec/Switcheo/carbon/book/genesis.js +79 -79
- package/lib/codec/Switcheo/carbon/book/legacy.d.ts +22 -22
- package/lib/codec/Switcheo/carbon/book/legacy.js +120 -120
- package/lib/codec/Switcheo/carbon/book/query.d.ts +147 -147
- package/lib/codec/Switcheo/carbon/book/query.js +618 -618
- package/lib/codec/Switcheo/carbon/book/tx.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/book/tx.js +20 -20
- package/lib/codec/Switcheo/carbon/bridge/bridge.d.ts +97 -97
- package/lib/codec/Switcheo/carbon/bridge/bridge.js +596 -596
- package/lib/codec/Switcheo/carbon/bridge/event.d.ts +293 -293
- package/lib/codec/Switcheo/carbon/bridge/event.js +1851 -1851
- package/lib/codec/Switcheo/carbon/bridge/export.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/bridge/export.js +131 -131
- package/lib/codec/Switcheo/carbon/bridge/genesis.d.ts +28 -28
- package/lib/codec/Switcheo/carbon/bridge/genesis.js +201 -201
- package/lib/codec/Switcheo/carbon/bridge/params.d.ts +47 -47
- package/lib/codec/Switcheo/carbon/bridge/params.js +136 -136
- package/lib/codec/Switcheo/carbon/bridge/pending_action.d.ts +94 -94
- package/lib/codec/Switcheo/carbon/bridge/pending_action.js +698 -698
- package/lib/codec/Switcheo/carbon/bridge/query.d.ts +291 -291
- package/lib/codec/Switcheo/carbon/bridge/query.js +1301 -1301
- package/lib/codec/Switcheo/carbon/bridge/tx.d.ts +810 -810
- package/lib/codec/Switcheo/carbon/bridge/tx.js +3970 -3970
- package/lib/codec/Switcheo/carbon/broker/amm.d.ts +48 -48
- package/lib/codec/Switcheo/carbon/broker/amm.js +312 -312
- package/lib/codec/Switcheo/carbon/broker/candlestick.d.ts +27 -27
- package/lib/codec/Switcheo/carbon/broker/candlestick.js +211 -211
- package/lib/codec/Switcheo/carbon/broker/event.d.ts +53 -53
- package/lib/codec/Switcheo/carbon/broker/event.js +485 -485
- package/lib/codec/Switcheo/carbon/broker/export.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/broker/export.js +27 -27
- package/lib/codec/Switcheo/carbon/broker/genesis.d.ts +25 -25
- package/lib/codec/Switcheo/carbon/broker/genesis.js +79 -79
- package/lib/codec/Switcheo/carbon/broker/incoming_liquidations.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/broker/incoming_liquidations.js +93 -93
- package/lib/codec/Switcheo/carbon/broker/pagination.d.ts +19 -19
- package/lib/codec/Switcheo/carbon/broker/pagination.js +78 -78
- package/lib/codec/Switcheo/carbon/broker/query.d.ts +107 -107
- package/lib/codec/Switcheo/carbon/broker/query.js +597 -597
- package/lib/codec/Switcheo/carbon/broker/tx.d.ts +53 -53
- package/lib/codec/Switcheo/carbon/broker/tx.js +176 -176
- package/lib/codec/Switcheo/carbon/btcx/denom_cross_chain_info.d.ts +21 -21
- package/lib/codec/Switcheo/carbon/btcx/denom_cross_chain_info.js +98 -98
- package/lib/codec/Switcheo/carbon/btcx/denom_info.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/btcx/denom_info.js +140 -140
- package/lib/codec/Switcheo/carbon/btcx/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/btcx/export.js +19 -19
- package/lib/codec/Switcheo/carbon/btcx/genesis.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/btcx/genesis.js +46 -46
- package/lib/codec/Switcheo/carbon/btcx/query.d.ts +68 -68
- package/lib/codec/Switcheo/carbon/btcx/query.js +275 -275
- package/lib/codec/Switcheo/carbon/btcx/tx.d.ts +92 -92
- package/lib/codec/Switcheo/carbon/btcx/tx.js +436 -436
- package/lib/codec/Switcheo/carbon/ccm/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/ccm/export.js +24 -24
- package/lib/codec/Switcheo/carbon/ccm/genesis.d.ts +119 -119
- package/lib/codec/Switcheo/carbon/ccm/genesis.js +604 -604
- package/lib/codec/Switcheo/carbon/ccm/params.d.ts +28 -28
- package/lib/codec/Switcheo/carbon/ccm/params.js +78 -78
- package/lib/codec/Switcheo/carbon/ccm/query.d.ts +75 -75
- package/lib/codec/Switcheo/carbon/ccm/query.js +284 -284
- package/lib/codec/Switcheo/carbon/ccm/tx.d.ts +101 -101
- package/lib/codec/Switcheo/carbon/ccm/tx.js +359 -359
- package/lib/codec/Switcheo/carbon/cdp/asset_params.d.ts +55 -55
- package/lib/codec/Switcheo/carbon/cdp/asset_params.js +396 -396
- package/lib/codec/Switcheo/carbon/cdp/cdp_liquidations.d.ts +32 -32
- package/lib/codec/Switcheo/carbon/cdp/cdp_liquidations.js +288 -288
- package/lib/codec/Switcheo/carbon/cdp/debt_info.d.ts +23 -23
- package/lib/codec/Switcheo/carbon/cdp/debt_info.js +158 -158
- package/lib/codec/Switcheo/carbon/cdp/e_mode_category.d.ts +23 -23
- package/lib/codec/Switcheo/carbon/cdp/e_mode_category.js +135 -135
- package/lib/codec/Switcheo/carbon/cdp/event.d.ts +424 -424
- package/lib/codec/Switcheo/carbon/cdp/event.js +2695 -2695
- package/lib/codec/Switcheo/carbon/cdp/export.d.ts +13 -13
- package/lib/codec/Switcheo/carbon/cdp/export.js +196 -196
- package/lib/codec/Switcheo/carbon/cdp/genesis.d.ts +134 -134
- package/lib/codec/Switcheo/carbon/cdp/genesis.js +823 -823
- package/lib/codec/Switcheo/carbon/cdp/params.d.ts +98 -98
- package/lib/codec/Switcheo/carbon/cdp/params.js +405 -405
- package/lib/codec/Switcheo/carbon/cdp/query.d.ts +669 -669
- package/lib/codec/Switcheo/carbon/cdp/query.js +3250 -3250
- package/lib/codec/Switcheo/carbon/cdp/rate_strategy_params.d.ts +26 -26
- package/lib/codec/Switcheo/carbon/cdp/rate_strategy_params.js +180 -180
- package/lib/codec/Switcheo/carbon/cdp/reward_scheme.d.ts +71 -71
- package/lib/codec/Switcheo/carbon/cdp/reward_scheme.js +550 -550
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_debt_info.d.ts +22 -22
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_debt_info.js +144 -144
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_interest_info.d.ts +19 -19
- package/lib/codec/Switcheo/carbon/cdp/stablecoin_interest_info.js +99 -99
- package/lib/codec/Switcheo/carbon/cdp/tx.d.ts +831 -831
- package/lib/codec/Switcheo/carbon/cdp/tx.js +3889 -3889
- package/lib/codec/Switcheo/carbon/coin/bridge.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/coin/bridge.js +151 -151
- package/lib/codec/Switcheo/carbon/coin/event.d.ts +143 -143
- package/lib/codec/Switcheo/carbon/coin/event.js +775 -775
- package/lib/codec/Switcheo/carbon/coin/export.d.ts +8 -8
- package/lib/codec/Switcheo/carbon/coin/export.js +111 -111
- package/lib/codec/Switcheo/carbon/coin/genesis.d.ts +42 -42
- package/lib/codec/Switcheo/carbon/coin/genesis.js +207 -207
- package/lib/codec/Switcheo/carbon/coin/group.d.ts +53 -53
- package/lib/codec/Switcheo/carbon/coin/group.js +230 -230
- package/lib/codec/Switcheo/carbon/coin/proposal.d.ts +21 -21
- package/lib/codec/Switcheo/carbon/coin/proposal.js +91 -91
- package/lib/codec/Switcheo/carbon/coin/query.d.ts +331 -331
- package/lib/codec/Switcheo/carbon/coin/query.js +1526 -1526
- package/lib/codec/Switcheo/carbon/coin/token.d.ts +104 -104
- package/lib/codec/Switcheo/carbon/coin/token.js +700 -700
- package/lib/codec/Switcheo/carbon/coin/tx.d.ts +611 -611
- package/lib/codec/Switcheo/carbon/coin/tx.js +3255 -3255
- package/lib/codec/Switcheo/carbon/erc20/erc20.d.ts +44 -44
- package/lib/codec/Switcheo/carbon/erc20/erc20.js +144 -144
- package/lib/codec/Switcheo/carbon/erc20/events.d.ts +82 -82
- package/lib/codec/Switcheo/carbon/erc20/events.js +330 -330
- package/lib/codec/Switcheo/carbon/erc20/export.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/erc20/export.js +38 -38
- package/lib/codec/Switcheo/carbon/erc20/genesis.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/erc20/genesis.js +81 -81
- package/lib/codec/Switcheo/carbon/erc20/params.d.ts +41 -41
- package/lib/codec/Switcheo/carbon/erc20/params.js +133 -133
- package/lib/codec/Switcheo/carbon/erc20/query.d.ts +120 -120
- package/lib/codec/Switcheo/carbon/erc20/query.js +333 -333
- package/lib/codec/Switcheo/carbon/erc20/tx.d.ts +251 -251
- package/lib/codec/Switcheo/carbon/erc20/tx.js +767 -767
- package/lib/codec/Switcheo/carbon/evmbank/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/evmbank/export.js +8 -8
- package/lib/codec/Switcheo/carbon/evmbank/genesis.d.ts +32 -32
- package/lib/codec/Switcheo/carbon/evmbank/genesis.js +152 -152
- package/lib/codec/Switcheo/carbon/evmbank/query.d.ts +40 -40
- package/lib/codec/Switcheo/carbon/evmbank/query.js +116 -116
- package/lib/codec/Switcheo/carbon/evmcontract/evm_hooks.d.ts +67 -67
- package/lib/codec/Switcheo/carbon/evmcontract/evm_hooks.js +407 -407
- package/lib/codec/Switcheo/carbon/evmcontract/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/evmcontract/export.js +30 -30
- package/lib/codec/Switcheo/carbon/evmcontract/genesis.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/evmcontract/genesis.js +96 -96
- package/lib/codec/Switcheo/carbon/evmcontract/params.d.ts +28 -28
- package/lib/codec/Switcheo/carbon/evmcontract/params.js +111 -111
- package/lib/codec/Switcheo/carbon/evmcontract/query.d.ts +139 -139
- package/lib/codec/Switcheo/carbon/evmcontract/query.js +581 -581
- package/lib/codec/Switcheo/carbon/evmcontract/tx.d.ts +89 -89
- package/lib/codec/Switcheo/carbon/evmcontract/tx.js +346 -346
- package/lib/codec/Switcheo/carbon/evmmerge/address.d.ts +19 -19
- package/lib/codec/Switcheo/carbon/evmmerge/address.js +75 -75
- package/lib/codec/Switcheo/carbon/evmmerge/event.d.ts +20 -20
- package/lib/codec/Switcheo/carbon/evmmerge/event.js +90 -90
- package/lib/codec/Switcheo/carbon/evmmerge/export.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/evmmerge/export.js +20 -20
- package/lib/codec/Switcheo/carbon/evmmerge/genesis.d.ts +48 -48
- package/lib/codec/Switcheo/carbon/evmmerge/genesis.js +216 -216
- package/lib/codec/Switcheo/carbon/evmmerge/offchain.d.ts +25 -25
- package/lib/codec/Switcheo/carbon/evmmerge/offchain.js +105 -105
- package/lib/codec/Switcheo/carbon/evmmerge/query.d.ts +87 -87
- package/lib/codec/Switcheo/carbon/evmmerge/query.js +254 -254
- package/lib/codec/Switcheo/carbon/evmmerge/tx.d.ts +51 -51
- package/lib/codec/Switcheo/carbon/evmmerge/tx.js +128 -128
- package/lib/codec/Switcheo/carbon/fee/event.d.ts +20 -20
- package/lib/codec/Switcheo/carbon/fee/event.js +83 -83
- package/lib/codec/Switcheo/carbon/fee/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/fee/export.js +27 -27
- package/lib/codec/Switcheo/carbon/fee/fee.d.ts +42 -42
- package/lib/codec/Switcheo/carbon/fee/fee.js +183 -183
- package/lib/codec/Switcheo/carbon/fee/genesis.d.ts +23 -23
- package/lib/codec/Switcheo/carbon/fee/genesis.js +79 -79
- package/lib/codec/Switcheo/carbon/fee/query.d.ts +114 -114
- package/lib/codec/Switcheo/carbon/fee/query.js +470 -470
- package/lib/codec/Switcheo/carbon/fee/tx.d.ts +108 -108
- package/lib/codec/Switcheo/carbon/fee/tx.js +415 -415
- package/lib/codec/Switcheo/carbon/headersync/consensus_peers.d.ts +71 -71
- package/lib/codec/Switcheo/carbon/headersync/consensus_peers.js +383 -383
- package/lib/codec/Switcheo/carbon/headersync/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/headersync/export.js +22 -22
- package/lib/codec/Switcheo/carbon/headersync/genesis.d.ts +82 -82
- package/lib/codec/Switcheo/carbon/headersync/genesis.js +419 -419
- package/lib/codec/Switcheo/carbon/headersync/query.d.ts +42 -42
- package/lib/codec/Switcheo/carbon/headersync/query.js +125 -125
- package/lib/codec/Switcheo/carbon/headersync/tx.d.ts +64 -64
- package/lib/codec/Switcheo/carbon/headersync/tx.js +215 -215
- package/lib/codec/Switcheo/carbon/inflation/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/inflation/export.js +8 -8
- package/lib/codec/Switcheo/carbon/inflation/genesis.d.ts +25 -25
- package/lib/codec/Switcheo/carbon/inflation/genesis.js +79 -79
- package/lib/codec/Switcheo/carbon/inflation/inflation.d.ts +29 -29
- package/lib/codec/Switcheo/carbon/inflation/inflation.js +165 -165
- package/lib/codec/Switcheo/carbon/inflation/query.d.ts +41 -41
- package/lib/codec/Switcheo/carbon/inflation/query.js +109 -109
- package/lib/codec/Switcheo/carbon/inflation/tx.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/inflation/tx.js +20 -20
- package/lib/codec/Switcheo/carbon/insurance/event.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/insurance/event.js +46 -46
- package/lib/codec/Switcheo/carbon/insurance/export.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/insurance/export.js +21 -21
- package/lib/codec/Switcheo/carbon/insurance/fund.d.ts +29 -29
- package/lib/codec/Switcheo/carbon/insurance/fund.js +148 -148
- package/lib/codec/Switcheo/carbon/insurance/genesis.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/insurance/genesis.js +63 -63
- package/lib/codec/Switcheo/carbon/insurance/params.d.ts +29 -29
- package/lib/codec/Switcheo/carbon/insurance/params.js +113 -113
- package/lib/codec/Switcheo/carbon/insurance/query.d.ts +63 -63
- package/lib/codec/Switcheo/carbon/insurance/query.js +195 -195
- package/lib/codec/Switcheo/carbon/insurance/tx.d.ts +69 -69
- package/lib/codec/Switcheo/carbon/insurance/tx.js +246 -246
- package/lib/codec/Switcheo/carbon/leverage/event.d.ts +21 -21
- package/lib/codec/Switcheo/carbon/leverage/event.js +100 -100
- package/lib/codec/Switcheo/carbon/leverage/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/leverage/export.js +16 -16
- package/lib/codec/Switcheo/carbon/leverage/genesis.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/leverage/genesis.js +64 -64
- package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +30 -30
- package/lib/codec/Switcheo/carbon/leverage/leverage.js +134 -134
- package/lib/codec/Switcheo/carbon/leverage/query.d.ts +70 -70
- package/lib/codec/Switcheo/carbon/leverage/query.js +234 -234
- package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +43 -43
- package/lib/codec/Switcheo/carbon/leverage/tx.js +127 -127
- package/lib/codec/Switcheo/carbon/liquidation/event.d.ts +23 -23
- package/lib/codec/Switcheo/carbon/liquidation/event.js +154 -154
- package/lib/codec/Switcheo/carbon/liquidation/export.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/liquidation/export.js +15 -15
- package/lib/codec/Switcheo/carbon/liquidation/genesis.d.ts +37 -37
- package/lib/codec/Switcheo/carbon/liquidation/genesis.js +136 -136
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.d.ts +33 -33
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.js +203 -203
- package/lib/codec/Switcheo/carbon/liquidation/query.d.ts +52 -52
- package/lib/codec/Switcheo/carbon/liquidation/query.js +254 -254
- package/lib/codec/Switcheo/carbon/liquidation/quote_changes.d.ts +22 -22
- package/lib/codec/Switcheo/carbon/liquidation/quote_changes.js +95 -95
- package/lib/codec/Switcheo/carbon/liquidation/tx.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/liquidation/tx.js +20 -20
- package/lib/codec/Switcheo/carbon/liquiditypool/event.d.ts +182 -182
- package/lib/codec/Switcheo/carbon/liquiditypool/event.js +1268 -1268
- package/lib/codec/Switcheo/carbon/liquiditypool/export.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/liquiditypool/export.js +132 -132
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.d.ts +33 -33
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.js +229 -229
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.d.ts +147 -147
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.js +1081 -1081
- package/lib/codec/Switcheo/carbon/liquiditypool/params.d.ts +30 -30
- package/lib/codec/Switcheo/carbon/liquiditypool/params.js +149 -149
- package/lib/codec/Switcheo/carbon/liquiditypool/proposal.d.ts +117 -117
- package/lib/codec/Switcheo/carbon/liquiditypool/proposal.js +697 -697
- package/lib/codec/Switcheo/carbon/liquiditypool/query.d.ts +393 -393
- package/lib/codec/Switcheo/carbon/liquiditypool/query.js +1826 -1826
- package/lib/codec/Switcheo/carbon/liquiditypool/reward.d.ts +196 -196
- package/lib/codec/Switcheo/carbon/liquiditypool/reward.js +1204 -1204
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.d.ts +495 -495
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.js +2522 -2522
- package/lib/codec/Switcheo/carbon/lockproxy/event.d.ts +46 -46
- package/lib/codec/Switcheo/carbon/lockproxy/event.js +348 -348
- package/lib/codec/Switcheo/carbon/lockproxy/export.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/lockproxy/export.js +28 -28
- package/lib/codec/Switcheo/carbon/lockproxy/genesis.d.ts +68 -68
- package/lib/codec/Switcheo/carbon/lockproxy/genesis.js +355 -355
- package/lib/codec/Switcheo/carbon/lockproxy/lockproxy.d.ts +22 -22
- package/lib/codec/Switcheo/carbon/lockproxy/lockproxy.js +147 -147
- package/lib/codec/Switcheo/carbon/lockproxy/query.d.ts +67 -67
- package/lib/codec/Switcheo/carbon/lockproxy/query.js +274 -274
- package/lib/codec/Switcheo/carbon/lockproxy/tx.d.ts +147 -147
- package/lib/codec/Switcheo/carbon/lockproxy/tx.js +808 -808
- package/lib/codec/Switcheo/carbon/market/event.d.ts +20 -20
- package/lib/codec/Switcheo/carbon/market/event.js +76 -76
- package/lib/codec/Switcheo/carbon/market/export.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/market/export.js +71 -71
- package/lib/codec/Switcheo/carbon/market/fee.d.ts +129 -129
- package/lib/codec/Switcheo/carbon/market/fee.js +334 -334
- package/lib/codec/Switcheo/carbon/market/genesis.d.ts +32 -32
- package/lib/codec/Switcheo/carbon/market/genesis.js +146 -146
- package/lib/codec/Switcheo/carbon/market/market.d.ts +96 -96
- package/lib/codec/Switcheo/carbon/market/market.js +880 -880
- package/lib/codec/Switcheo/carbon/market/params.d.ts +85 -85
- package/lib/codec/Switcheo/carbon/market/params.js +821 -821
- package/lib/codec/Switcheo/carbon/market/proposal.d.ts +46 -46
- package/lib/codec/Switcheo/carbon/market/proposal.js +245 -245
- package/lib/codec/Switcheo/carbon/market/query.d.ts +276 -276
- package/lib/codec/Switcheo/carbon/market/query.js +1250 -1250
- package/lib/codec/Switcheo/carbon/market/tx.d.ts +337 -337
- package/lib/codec/Switcheo/carbon/market/tx.js +1601 -1601
- package/lib/codec/Switcheo/carbon/marketstats/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/marketstats/export.js +8 -8
- package/lib/codec/Switcheo/carbon/marketstats/genesis.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/marketstats/genesis.js +46 -46
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.d.ts +31 -31
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.js +258 -258
- package/lib/codec/Switcheo/carbon/marketstats/query.d.ts +40 -40
- package/lib/codec/Switcheo/carbon/marketstats/query.js +108 -108
- package/lib/codec/Switcheo/carbon/marketstats/tx.d.ts +12 -12
- package/lib/codec/Switcheo/carbon/marketstats/tx.js +20 -20
- package/lib/codec/Switcheo/carbon/misc/block.d.ts +21 -21
- package/lib/codec/Switcheo/carbon/misc/block.js +105 -105
- package/lib/codec/Switcheo/carbon/misc/export.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/misc/export.js +29 -29
- package/lib/codec/Switcheo/carbon/misc/message.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/misc/message.js +157 -157
- package/lib/codec/Switcheo/carbon/misc/message_type.d.ts +18 -18
- package/lib/codec/Switcheo/carbon/misc/message_type.js +60 -60
- package/lib/codec/Switcheo/carbon/misc/query.d.ts +192 -192
- package/lib/codec/Switcheo/carbon/misc/query.js +884 -884
- package/lib/codec/Switcheo/carbon/misc/trade.d.ts +28 -28
- package/lib/codec/Switcheo/carbon/misc/trade.js +224 -224
- package/lib/codec/Switcheo/carbon/misc/transaction.d.ts +45 -45
- package/lib/codec/Switcheo/carbon/misc/transaction.js +369 -369
- package/lib/codec/Switcheo/carbon/oracle/event.d.ts +37 -37
- package/lib/codec/Switcheo/carbon/oracle/event.js +228 -228
- package/lib/codec/Switcheo/carbon/oracle/export.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/oracle/export.js +67 -67
- package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +28 -28
- package/lib/codec/Switcheo/carbon/oracle/genesis.js +127 -127
- package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +50 -50
- package/lib/codec/Switcheo/carbon/oracle/oracle.js +324 -324
- package/lib/codec/Switcheo/carbon/oracle/params.d.ts +47 -47
- package/lib/codec/Switcheo/carbon/oracle/params.js +389 -389
- package/lib/codec/Switcheo/carbon/oracle/query.d.ts +331 -331
- package/lib/codec/Switcheo/carbon/oracle/query.js +1501 -1501
- package/lib/codec/Switcheo/carbon/oracle/slashing.d.ts +33 -33
- package/lib/codec/Switcheo/carbon/oracle/slashing.js +191 -191
- package/lib/codec/Switcheo/carbon/oracle/tx.d.ts +306 -306
- package/lib/codec/Switcheo/carbon/oracle/tx.js +1496 -1496
- package/lib/codec/Switcheo/carbon/order/event.d.ts +23 -23
- package/lib/codec/Switcheo/carbon/order/event.js +146 -146
- package/lib/codec/Switcheo/carbon/order/evm_hooks.d.ts +57 -57
- package/lib/codec/Switcheo/carbon/order/evm_hooks.js +356 -356
- package/lib/codec/Switcheo/carbon/order/export.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/order/export.js +48 -48
- package/lib/codec/Switcheo/carbon/order/genesis.d.ts +63 -63
- package/lib/codec/Switcheo/carbon/order/genesis.js +323 -323
- package/lib/codec/Switcheo/carbon/order/order.d.ts +103 -103
- package/lib/codec/Switcheo/carbon/order/order.js +847 -847
- package/lib/codec/Switcheo/carbon/order/params.d.ts +28 -28
- package/lib/codec/Switcheo/carbon/order/params.js +109 -109
- package/lib/codec/Switcheo/carbon/order/query.d.ts +144 -144
- package/lib/codec/Switcheo/carbon/order/query.js +597 -597
- package/lib/codec/Switcheo/carbon/order/tx.d.ts +188 -188
- package/lib/codec/Switcheo/carbon/order/tx.js +817 -817
- package/lib/codec/Switcheo/carbon/otc/event.d.ts +34 -0
- package/lib/codec/Switcheo/carbon/otc/event.js +174 -0
- package/lib/codec/Switcheo/carbon/otc/export.d.ts +6 -0
- package/lib/codec/Switcheo/carbon/otc/export.js +36 -0
- package/lib/codec/{marketstats → Switcheo/carbon/otc}/genesis.d.ts +25 -21
- package/lib/codec/{marketstats → Switcheo/carbon/otc}/genesis.js +97 -63
- package/lib/codec/Switcheo/carbon/otc/params.d.ts +45 -0
- package/lib/codec/Switcheo/carbon/otc/params.js +332 -0
- package/lib/codec/Switcheo/carbon/otc/query.d.ts +170 -0
- package/lib/codec/Switcheo/carbon/otc/query.js +675 -0
- package/lib/codec/Switcheo/carbon/otc/quote.d.ts +34 -0
- package/lib/codec/Switcheo/carbon/otc/quote.js +197 -0
- package/lib/codec/Switcheo/carbon/otc/rfq.d.ts +34 -0
- package/lib/codec/Switcheo/carbon/otc/rfq.js +197 -0
- package/lib/codec/Switcheo/carbon/otc/tx.d.ts +137 -0
- package/lib/codec/Switcheo/carbon/otc/tx.js +578 -0
- package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +95 -95
- package/lib/codec/Switcheo/carbon/perpspool/event.js +561 -561
- package/lib/codec/Switcheo/carbon/perpspool/export.d.ts +7 -7
- package/lib/codec/Switcheo/carbon/perpspool/export.js +69 -69
- package/lib/codec/Switcheo/carbon/perpspool/genesis.d.ts +61 -61
- package/lib/codec/Switcheo/carbon/perpspool/genesis.js +343 -343
- package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +109 -109
- package/lib/codec/Switcheo/carbon/perpspool/market.js +493 -493
- package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +49 -49
- package/lib/codec/Switcheo/carbon/perpspool/params.js +363 -363
- package/lib/codec/Switcheo/carbon/perpspool/pool.d.ts +109 -109
- package/lib/codec/Switcheo/carbon/perpspool/pool.js +638 -638
- package/lib/codec/Switcheo/carbon/perpspool/query.d.ts +247 -247
- package/lib/codec/Switcheo/carbon/perpspool/query.js +1141 -1141
- package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +242 -242
- package/lib/codec/Switcheo/carbon/perpspool/tx.js +1065 -1065
- package/lib/codec/Switcheo/carbon/position/event.d.ts +36 -36
- package/lib/codec/Switcheo/carbon/position/event.js +230 -230
- package/lib/codec/Switcheo/carbon/position/evm_hooks.d.ts +32 -32
- package/lib/codec/Switcheo/carbon/position/evm_hooks.js +195 -195
- package/lib/codec/Switcheo/carbon/position/export.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/position/export.js +29 -29
- package/lib/codec/Switcheo/carbon/position/genesis.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/position/genesis.js +64 -64
- package/lib/codec/Switcheo/carbon/position/position.d.ts +85 -85
- package/lib/codec/Switcheo/carbon/position/position.js +659 -659
- package/lib/codec/Switcheo/carbon/position/query.d.ts +135 -135
- package/lib/codec/Switcheo/carbon/position/query.js +588 -588
- package/lib/codec/Switcheo/carbon/position/tx.d.ts +42 -42
- package/lib/codec/Switcheo/carbon/position/tx.js +127 -127
- package/lib/codec/Switcheo/carbon/pricing/event.d.ts +84 -84
- package/lib/codec/Switcheo/carbon/pricing/event.js +411 -411
- package/lib/codec/Switcheo/carbon/pricing/export.d.ts +6 -6
- package/lib/codec/Switcheo/carbon/pricing/export.js +51 -51
- package/lib/codec/Switcheo/carbon/pricing/genesis.d.ts +27 -27
- package/lib/codec/Switcheo/carbon/pricing/genesis.js +96 -96
- package/lib/codec/Switcheo/carbon/pricing/legacy.d.ts +22 -22
- package/lib/codec/Switcheo/carbon/pricing/legacy.js +93 -93
- package/lib/codec/Switcheo/carbon/pricing/params.d.ts +37 -37
- package/lib/codec/Switcheo/carbon/pricing/params.js +252 -252
- package/lib/codec/Switcheo/carbon/pricing/pricing.d.ts +45 -45
- package/lib/codec/Switcheo/carbon/pricing/pricing.js +357 -357
- package/lib/codec/Switcheo/carbon/pricing/query.d.ts +184 -184
- package/lib/codec/Switcheo/carbon/pricing/query.js +760 -760
- package/lib/codec/Switcheo/carbon/pricing/tx.d.ts +220 -220
- package/lib/codec/Switcheo/carbon/pricing/tx.js +851 -851
- package/lib/codec/Switcheo/carbon/profile/event.d.ts +20 -20
- package/lib/codec/Switcheo/carbon/profile/event.js +78 -78
- package/lib/codec/Switcheo/carbon/profile/export.d.ts +4 -4
- package/lib/codec/Switcheo/carbon/profile/export.js +17 -17
- package/lib/codec/Switcheo/carbon/profile/genesis.d.ts +24 -24
- package/lib/codec/Switcheo/carbon/profile/genesis.js +64 -64
- package/lib/codec/Switcheo/carbon/profile/profile.d.ts +20 -20
- package/lib/codec/Switcheo/carbon/profile/profile.js +83 -83
- package/lib/codec/Switcheo/carbon/profile/query.d.ts +91 -91
- package/lib/codec/Switcheo/carbon/profile/query.js +347 -347
- package/lib/codec/Switcheo/carbon/profile/tx.d.ts +43 -43
- package/lib/codec/Switcheo/carbon/profile/tx.js +127 -127
- package/lib/codec/Switcheo/carbon/sequence/export.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/sequence/export.js +13 -13
- package/lib/codec/Switcheo/carbon/sequence/genesis.d.ts +30 -30
- package/lib/codec/Switcheo/carbon/sequence/genesis.js +122 -122
- package/lib/codec/Switcheo/carbon/sequence/query.d.ts +66 -66
- package/lib/codec/Switcheo/carbon/sequence/query.js +245 -245
- package/lib/codec/Switcheo/carbon/sequence/tx.d.ts +41 -41
- package/lib/codec/Switcheo/carbon/sequence/tx.js +148 -148
- package/lib/codec/Switcheo/carbon/subaccount/export.d.ts +5 -5
- package/lib/codec/Switcheo/carbon/subaccount/export.js +39 -39
- package/lib/codec/Switcheo/carbon/subaccount/genesis.d.ts +29 -29
- package/lib/codec/Switcheo/carbon/subaccount/genesis.js +111 -111
- package/lib/codec/Switcheo/carbon/subaccount/legacy.d.ts +19 -19
- package/lib/codec/Switcheo/carbon/subaccount/legacy.js +72 -72
- package/lib/codec/Switcheo/carbon/subaccount/params.d.ts +29 -29
- package/lib/codec/Switcheo/carbon/subaccount/params.js +119 -119
- package/lib/codec/Switcheo/carbon/subaccount/query.d.ts +230 -230
- package/lib/codec/Switcheo/carbon/subaccount/query.js +1027 -1027
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.d.ts +46 -46
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.js +296 -296
- package/lib/codec/Switcheo/carbon/subaccount/tx.d.ts +134 -134
- package/lib/codec/Switcheo/carbon/subaccount/tx.js +497 -497
- package/lib/codec/alliance/alliance/alliance.d.ts +65 -65
- package/lib/codec/alliance/alliance/alliance.js +354 -354
- package/lib/codec/alliance/alliance/delegations.d.ts +63 -63
- package/lib/codec/alliance/alliance/delegations.js +344 -344
- package/lib/codec/alliance/alliance/events.d.ts +71 -71
- package/lib/codec/alliance/alliance/events.js +452 -452
- package/lib/codec/alliance/alliance/export.d.ts +10 -10
- package/lib/codec/alliance/alliance/export.js +84 -84
- package/lib/codec/alliance/alliance/genesis.d.ts +75 -75
- package/lib/codec/alliance/alliance/genesis.js +470 -470
- package/lib/codec/alliance/alliance/gov.d.ts +80 -80
- package/lib/codec/alliance/alliance/gov.js +400 -400
- package/lib/codec/alliance/alliance/params.d.ts +35 -35
- package/lib/codec/alliance/alliance/params.js +194 -194
- package/lib/codec/alliance/alliance/query.d.ts +404 -404
- package/lib/codec/alliance/alliance/query.js +1982 -1982
- package/lib/codec/alliance/alliance/redelegations.d.ts +57 -57
- package/lib/codec/alliance/alliance/redelegations.js +294 -294
- package/lib/codec/alliance/alliance/tx.d.ts +230 -230
- package/lib/codec/alliance/alliance/tx.js +1050 -1050
- package/lib/codec/alliance/alliance/unbonding.d.ts +26 -26
- package/lib/codec/alliance/alliance/unbonding.js +126 -126
- package/lib/codec/amino/amino.d.ts +1 -1
- package/lib/codec/amino/amino.js +14 -14
- package/lib/codec/carbon-models.d.ts +29 -29
- package/lib/codec/carbon-models.js +51 -55
- package/lib/codec/cosmos/app/runtime/v1alpha1/module.d.ts +84 -84
- package/lib/codec/cosmos/app/runtime/v1alpha1/module.js +246 -246
- package/lib/codec/cosmos/app/v1alpha1/config.d.ts +83 -83
- package/lib/codec/cosmos/app/v1alpha1/config.js +215 -215
- package/lib/codec/cosmos/app/v1alpha1/module.d.ts +109 -109
- package/lib/codec/cosmos/app/v1alpha1/module.js +192 -192
- package/lib/codec/cosmos/app/v1alpha1/query.d.ts +44 -44
- package/lib/codec/cosmos/app/v1alpha1/query.js +107 -107
- package/lib/codec/cosmos/auth/module/v1/module.d.ts +41 -41
- package/lib/codec/cosmos/auth/module/v1/module.js +149 -149
- package/lib/codec/cosmos/auth/v1beta1/auth.d.ts +76 -76
- package/lib/codec/cosmos/auth/v1beta1/auth.js +408 -408
- package/lib/codec/cosmos/auth/v1beta1/export.d.ts +3 -3
- package/lib/codec/cosmos/auth/v1beta1/export.js +32 -32
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +24 -24
- package/lib/codec/cosmos/auth/v1beta1/genesis.js +81 -81
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +379 -379
- package/lib/codec/cosmos/auth/v1beta1/query.js +1050 -1050
- package/lib/codec/cosmos/auth/v1beta1/tx.d.ts +64 -64
- package/lib/codec/cosmos/auth/v1beta1/tx.js +120 -120
- package/lib/codec/cosmos/authz/module/v1/module.d.ts +18 -18
- package/lib/codec/cosmos/authz/module/v1/module.js +46 -46
- package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +74 -74
- package/lib/codec/cosmos/authz/v1beta1/authz.js +284 -284
- package/lib/codec/cosmos/authz/v1beta1/event.d.ts +41 -41
- package/lib/codec/cosmos/authz/v1beta1/event.js +152 -152
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +21 -21
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +64 -64
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +122 -122
- package/lib/codec/cosmos/authz/v1beta1/query.js +458 -458
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +126 -126
- package/lib/codec/cosmos/authz/v1beta1/tx.js +386 -386
- package/lib/codec/cosmos/autocli/v1/options.d.ts +184 -184
- package/lib/codec/cosmos/autocli/v1/options.js +686 -686
- package/lib/codec/cosmos/autocli/v1/query.d.ts +60 -60
- package/lib/codec/cosmos/autocli/v1/query.js +180 -180
- package/lib/codec/cosmos/bank/module/v1/module.d.ts +26 -26
- package/lib/codec/cosmos/bank/module/v1/module.js +76 -76
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +32 -32
- package/lib/codec/cosmos/bank/v1beta1/authz.js +79 -79
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +160 -160
- package/lib/codec/cosmos/bank/v1beta1/bank.js +519 -519
- package/lib/codec/cosmos/bank/v1beta1/export.d.ts +5 -5
- package/lib/codec/cosmos/bank/v1beta1/export.js +52 -52
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +54 -54
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +187 -187
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +557 -557
- package/lib/codec/cosmos/bank/v1beta1/query.js +1649 -1649
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +173 -173
- package/lib/codec/cosmos/bank/v1beta1/tx.js +449 -449
- package/lib/codec/cosmos/base/abci/v1beta1/abci.d.ts +258 -258
- package/lib/codec/cosmos/base/abci/v1beta1/abci.js +1068 -1068
- package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +78 -78
- package/lib/codec/cosmos/base/node/v1beta1/query.js +358 -358
- package/lib/codec/cosmos/base/query/v1beta1/pagination.d.ts +85 -85
- package/lib/codec/cosmos/base/query/v1beta1/pagination.js +215 -215
- package/lib/codec/cosmos/base/reflection/v1beta1/reflection.d.ts +81 -81
- package/lib/codec/cosmos/base/reflection/v1beta1/reflection.js +210 -210
- package/lib/codec/cosmos/base/reflection/v2alpha1/reflection.d.ts +414 -414
- package/lib/codec/cosmos/base/reflection/v2alpha1/reflection.js +1438 -1438
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +321 -321
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1490 -1490
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.d.ts +67 -67
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.js +423 -423
- package/lib/codec/cosmos/base/v1beta1/coin.d.ts +70 -70
- package/lib/codec/cosmos/base/v1beta1/coin.js +214 -214
- package/lib/codec/cosmos/circuit/module/v1/module.d.ts +20 -20
- package/lib/codec/cosmos/circuit/module/v1/module.js +59 -59
- package/lib/codec/cosmos/circuit/v1/query.d.ts +97 -97
- package/lib/codec/cosmos/circuit/v1/query.js +333 -333
- package/lib/codec/cosmos/circuit/v1/tx.d.ts +128 -128
- package/lib/codec/cosmos/circuit/v1/tx.js +371 -371
- package/lib/codec/cosmos/circuit/v1/types.d.ts +81 -81
- package/lib/codec/cosmos/circuit/v1/types.js +266 -266
- package/lib/codec/cosmos/consensus/module/v1/module.d.ts +20 -20
- package/lib/codec/cosmos/consensus/module/v1/module.js +59 -59
- package/lib/codec/cosmos/consensus/v1/query.d.ts +49 -49
- package/lib/codec/cosmos/consensus/v1/query.js +109 -109
- package/lib/codec/cosmos/consensus/v1/tx.d.ts +65 -65
- package/lib/codec/cosmos/consensus/v1/tx.js +174 -174
- package/lib/codec/cosmos/crisis/module/v1/module.d.ts +22 -22
- package/lib/codec/cosmos/crisis/module/v1/module.js +72 -72
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +24 -24
- package/lib/codec/cosmos/crisis/v1beta1/genesis.js +65 -65
- package/lib/codec/cosmos/crisis/v1beta1/tx.d.ts +89 -89
- package/lib/codec/cosmos/crisis/v1beta1/tx.js +236 -236
- package/lib/codec/cosmos/crypto/ed25519/keys.d.ts +39 -39
- package/lib/codec/cosmos/crypto/ed25519/keys.js +138 -138
- package/lib/codec/cosmos/crypto/hd/v1/hd.d.ts +32 -32
- package/lib/codec/cosmos/crypto/hd/v1/hd.js +114 -114
- package/lib/codec/cosmos/crypto/keyring/v1/record.d.ts +78 -78
- package/lib/codec/cosmos/crypto/keyring/v1/record.js +309 -309
- package/lib/codec/cosmos/crypto/multisig/keys.d.ts +25 -25
- package/lib/codec/cosmos/crypto/multisig/keys.js +76 -76
- package/lib/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts +40 -40
- package/lib/codec/cosmos/crypto/multisig/v1beta1/multisig.js +153 -153
- package/lib/codec/cosmos/crypto/secp256k1/keys.d.ts +36 -36
- package/lib/codec/cosmos/crypto/secp256k1/keys.js +138 -138
- package/lib/codec/cosmos/crypto/secp256r1/keys.d.ts +36 -36
- package/lib/codec/cosmos/crypto/secp256r1/keys.js +138 -138
- package/lib/codec/cosmos/distribution/module/v1/module.d.ts +21 -21
- package/lib/codec/cosmos/distribution/module/v1/module.js +72 -72
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +225 -225
- package/lib/codec/cosmos/distribution/v1beta1/distribution.js +858 -858
- package/lib/codec/cosmos/distribution/v1beta1/export.d.ts +4 -4
- package/lib/codec/cosmos/distribution/v1beta1/export.js +63 -63
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +156 -156
- package/lib/codec/cosmos/distribution/v1beta1/genesis.js +722 -722
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +384 -384
- package/lib/codec/cosmos/distribution/v1beta1/query.js +1232 -1232
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +287 -287
- package/lib/codec/cosmos/distribution/v1beta1/tx.js +766 -766
- package/lib/codec/cosmos/evidence/module/v1/module.d.ts +18 -18
- package/lib/codec/cosmos/evidence/module/v1/module.js +46 -46
- package/lib/codec/cosmos/evidence/v1beta1/evidence.d.ts +29 -29
- package/lib/codec/cosmos/evidence/v1beta1/evidence.js +133 -133
- package/lib/codec/cosmos/evidence/v1beta1/genesis.d.ts +21 -21
- package/lib/codec/cosmos/evidence/v1beta1/genesis.js +64 -64
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +93 -93
- package/lib/codec/cosmos/evidence/v1beta1/query.js +292 -292
- package/lib/codec/cosmos/evidence/v1beta1/tx.d.ts +54 -54
- package/lib/codec/cosmos/evidence/v1beta1/tx.js +167 -167
- package/lib/codec/cosmos/feegrant/module/v1/module.d.ts +18 -18
- package/lib/codec/cosmos/feegrant/module/v1/module.js +46 -46
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +96 -96
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +359 -359
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +21 -21
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +64 -64
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +122 -122
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +407 -407
- package/lib/codec/cosmos/feegrant/v1beta1/tx.d.ts +122 -122
- package/lib/codec/cosmos/feegrant/v1beta1/tx.js +312 -312
- package/lib/codec/cosmos/genutil/module/v1/module.d.ts +18 -18
- package/lib/codec/cosmos/genutil/module/v1/module.js +46 -46
- package/lib/codec/cosmos/genutil/v1beta1/genesis.d.ts +20 -20
- package/lib/codec/cosmos/genutil/v1beta1/genesis.js +93 -93
- package/lib/codec/cosmos/gov/module/v1/module.d.ts +25 -25
- package/lib/codec/cosmos/gov/module/v1/module.js +75 -75
- package/lib/codec/cosmos/gov/v1/export.d.ts +3 -3
- package/lib/codec/cosmos/gov/v1/export.js +53 -53
- package/lib/codec/cosmos/gov/v1/genesis.d.ts +64 -64
- package/lib/codec/cosmos/gov/v1/genesis.js +198 -198
- package/lib/codec/cosmos/gov/v1/gov.d.ts +345 -345
- package/lib/codec/cosmos/gov/v1/gov.js +1204 -1204
- package/lib/codec/cosmos/gov/v1/query.d.ts +312 -312
- package/lib/codec/cosmos/gov/v1/query.js +1145 -1145
- package/lib/codec/cosmos/gov/v1/tx.d.ts +291 -291
- package/lib/codec/cosmos/gov/v1/tx.js +953 -953
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +33 -33
- package/lib/codec/cosmos/gov/v1beta1/genesis.js +166 -166
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +246 -246
- package/lib/codec/cosmos/gov/v1beta1/gov.js +929 -929
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +265 -265
- package/lib/codec/cosmos/gov/v1beta1/query.js +1045 -1045
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +154 -154
- package/lib/codec/cosmos/gov/v1beta1/tx.js +496 -496
- package/lib/codec/cosmos/group/module/v1/module.d.ts +29 -29
- package/lib/codec/cosmos/group/module/v1/module.js +83 -83
- package/lib/codec/cosmos/group/v1/events.d.ts +140 -140
- package/lib/codec/cosmos/group/v1/events.js +560 -560
- package/lib/codec/cosmos/group/v1/genesis.d.ts +45 -45
- package/lib/codec/cosmos/group/v1/genesis.js +176 -176
- package/lib/codec/cosmos/group/v1/query.d.ts +453 -453
- package/lib/codec/cosmos/group/v1/query.js +1771 -1771
- package/lib/codec/cosmos/group/v1/tx.d.ts +495 -495
- package/lib/codec/cosmos/group/v1/tx.js +1866 -1866
- package/lib/codec/cosmos/group/v1/types.d.ts +382 -382
- package/lib/codec/cosmos/group/v1/types.js +1332 -1332
- package/lib/codec/cosmos/ics23/v1/proofs.d.ts +328 -328
- package/lib/codec/cosmos/ics23/v1/proofs.js +1347 -1347
- package/lib/codec/cosmos/mint/module/v1/module.d.ts +21 -21
- package/lib/codec/cosmos/mint/module/v1/module.js +72 -72
- package/lib/codec/cosmos/mint/v1beta1/export.d.ts +3 -3
- package/lib/codec/cosmos/mint/v1beta1/export.js +16 -16
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +23 -23
- package/lib/codec/cosmos/mint/v1beta1/genesis.js +79 -79
- package/lib/codec/cosmos/mint/v1beta1/mint.d.ts +44 -44
- package/lib/codec/cosmos/mint/v1beta1/mint.js +192 -192
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +103 -103
- package/lib/codec/cosmos/mint/v1beta1/query.js +309 -309
- package/lib/codec/cosmos/mint/v1beta1/tx.d.ts +64 -64
- package/lib/codec/cosmos/mint/v1beta1/tx.js +120 -120
- package/lib/codec/cosmos/msg/textual/v1/textual.d.ts +1 -1
- package/lib/codec/cosmos/msg/textual/v1/textual.js +14 -14
- package/lib/codec/cosmos/msg/v1/msg.d.ts +1 -1
- package/lib/codec/cosmos/msg/v1/msg.js +14 -14
- package/lib/codec/cosmos/nft/module/v1/module.d.ts +18 -18
- package/lib/codec/cosmos/nft/module/v1/module.js +46 -46
- package/lib/codec/cosmos/nft/v1beta1/event.d.ts +58 -58
- package/lib/codec/cosmos/nft/v1beta1/event.js +227 -227
- package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +37 -37
- package/lib/codec/cosmos/nft/v1beta1/genesis.js +140 -140
- package/lib/codec/cosmos/nft/v1beta1/nft.d.ts +53 -53
- package/lib/codec/cosmos/nft/v1beta1/nft.js +233 -233
- package/lib/codec/cosmos/nft/v1beta1/query.d.ts +226 -226
- package/lib/codec/cosmos/nft/v1beta1/query.js +817 -817
- package/lib/codec/cosmos/nft/v1beta1/tx.d.ts +49 -49
- package/lib/codec/cosmos/nft/v1beta1/tx.js +137 -137
- package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +22 -22
- package/lib/codec/cosmos/orm/module/v1alpha1/module.js +46 -46
- package/lib/codec/cosmos/orm/query/v1alpha1/query.d.ts +173 -173
- package/lib/codec/cosmos/orm/query/v1alpha1/query.js +652 -652
- package/lib/codec/cosmos/orm/v1/orm.d.ts +126 -126
- package/lib/codec/cosmos/orm/v1/orm.js +263 -263
- package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +76 -76
- package/lib/codec/cosmos/orm/v1alpha1/schema.js +235 -235
- package/lib/codec/cosmos/params/module/v1/module.d.ts +18 -18
- package/lib/codec/cosmos/params/module/v1/module.js +46 -46
- package/lib/codec/cosmos/params/v1beta1/export.d.ts +2 -2
- package/lib/codec/cosmos/params/v1beta1/export.js +12 -12
- package/lib/codec/cosmos/params/v1beta1/params.d.ts +37 -37
- package/lib/codec/cosmos/params/v1beta1/params.js +155 -155
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +106 -106
- package/lib/codec/cosmos/params/v1beta1/query.js +280 -280
- package/lib/codec/cosmos/query/v1/query.d.ts +1 -1
- package/lib/codec/cosmos/query/v1/query.js +14 -14
- package/lib/codec/cosmos/reflection/v1/reflection.d.ts +50 -50
- package/lib/codec/cosmos/reflection/v1/reflection.js +108 -108
- package/lib/codec/cosmos/slashing/module/v1/module.d.ts +20 -20
- package/lib/codec/cosmos/slashing/module/v1/module.js +59 -59
- package/lib/codec/cosmos/slashing/v1beta1/export.d.ts +4 -4
- package/lib/codec/cosmos/slashing/v1beta1/export.js +22 -22
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +76 -76
- package/lib/codec/cosmos/slashing/v1beta1/genesis.js +282 -282
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +110 -110
- package/lib/codec/cosmos/slashing/v1beta1/query.js +333 -333
- package/lib/codec/cosmos/slashing/v1beta1/slashing.d.ts +59 -59
- package/lib/codec/cosmos/slashing/v1beta1/slashing.js +320 -320
- package/lib/codec/cosmos/slashing/v1beta1/tx.d.ts +92 -92
- package/lib/codec/cosmos/slashing/v1beta1/tx.js +204 -204
- package/lib/codec/cosmos/staking/module/v1/module.d.ts +30 -30
- package/lib/codec/cosmos/staking/module/v1/module.js +108 -108
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +68 -68
- package/lib/codec/cosmos/staking/v1beta1/authz.js +225 -225
- package/lib/codec/cosmos/staking/v1beta1/export.d.ts +5 -5
- package/lib/codec/cosmos/staking/v1beta1/export.js +84 -84
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +55 -55
- package/lib/codec/cosmos/staking/v1beta1/genesis.js +259 -259
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +525 -525
- package/lib/codec/cosmos/staking/v1beta1/query.js +1750 -1750
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +427 -427
- package/lib/codec/cosmos/staking/v1beta1/staking.js +1900 -1900
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +282 -282
- package/lib/codec/cosmos/staking/v1beta1/tx.js +1001 -1001
- package/lib/codec/cosmos/store/internal/kv/v1beta1/kv.d.ts +31 -31
- package/lib/codec/cosmos/store/internal/kv/v1beta1/kv.js +154 -154
- package/lib/codec/cosmos/store/snapshots/v1/snapshot.d.ts +119 -119
- package/lib/codec/cosmos/store/snapshots/v1/snapshot.js +540 -540
- package/lib/codec/cosmos/store/streaming/abci/grpc.d.ts +72 -72
- package/lib/codec/cosmos/store/streaming/abci/grpc.js +247 -247
- package/lib/codec/cosmos/store/v1beta1/commit_info.d.ts +54 -54
- package/lib/codec/cosmos/store/v1beta1/commit_info.js +273 -273
- package/lib/codec/cosmos/store/v1beta1/listening.d.ts +48 -48
- package/lib/codec/cosmos/store/v1beta1/listening.js +220 -220
- package/lib/codec/cosmos/tx/config/v1/config.d.ts +28 -28
- package/lib/codec/cosmos/tx/config/v1/config.js +73 -73
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +147 -147
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +477 -477
- package/lib/codec/cosmos/tx/v1beta1/export.d.ts +2 -2
- package/lib/codec/cosmos/tx/v1beta1/export.js +43 -43
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +460 -460
- package/lib/codec/cosmos/tx/v1beta1/service.js +1340 -1340
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +377 -377
- package/lib/codec/cosmos/tx/v1beta1/tx.js +1121 -1121
- package/lib/codec/cosmos/upgrade/module/v1/module.d.ts +20 -20
- package/lib/codec/cosmos/upgrade/module/v1/module.js +59 -59
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +213 -213
- package/lib/codec/cosmos/upgrade/v1beta1/query.js +526 -526
- package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +97 -97
- package/lib/codec/cosmos/upgrade/v1beta1/tx.js +203 -203
- package/lib/codec/cosmos/upgrade/v1beta1/upgrade.d.ts +114 -114
- package/lib/codec/cosmos/upgrade/v1beta1/upgrade.js +341 -341
- package/lib/codec/cosmos/vesting/module/v1/module.d.ts +18 -18
- package/lib/codec/cosmos/vesting/module/v1/module.js +46 -46
- package/lib/codec/cosmos/vesting/v1beta1/export.d.ts +2 -2
- package/lib/codec/cosmos/vesting/v1beta1/export.js +17 -17
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +138 -138
- package/lib/codec/cosmos/vesting/v1beta1/tx.js +416 -416
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +106 -106
- package/lib/codec/cosmos/vesting/v1beta1/vesting.js +451 -451
- package/lib/codec/cosmos-models.d.ts +10 -10
- package/lib/codec/cosmos-models.js +32 -36
- package/lib/codec/ethermint/crypto/v1/ethsecp256k1/export.d.ts +1 -1
- package/lib/codec/ethermint/crypto/v1/ethsecp256k1/export.js +6 -6
- package/lib/codec/ethermint/crypto/v1/ethsecp256k1/keys.d.ts +39 -39
- package/lib/codec/ethermint/crypto/v1/ethsecp256k1/keys.js +138 -138
- package/lib/codec/ethermint/evm/v1/events.d.ts +72 -72
- package/lib/codec/ethermint/evm/v1/events.js +303 -303
- package/lib/codec/ethermint/evm/v1/evm.d.ts +239 -239
- package/lib/codec/ethermint/evm/v1/evm.js +1140 -1140
- package/lib/codec/ethermint/evm/v1/export.d.ts +5 -5
- package/lib/codec/ethermint/evm/v1/export.js +53 -53
- package/lib/codec/ethermint/evm/v1/genesis.d.ts +43 -43
- package/lib/codec/ethermint/evm/v1/genesis.js +153 -153
- package/lib/codec/ethermint/evm/v1/query.d.ts +424 -424
- package/lib/codec/ethermint/evm/v1/query.js +1637 -1637
- package/lib/codec/ethermint/evm/v1/tx.d.ts +219 -219
- package/lib/codec/ethermint/evm/v1/tx.js +935 -935
- package/lib/codec/ethermint/feemarket/v1/events.d.ts +34 -34
- package/lib/codec/ethermint/feemarket/v1/events.js +116 -116
- package/lib/codec/ethermint/feemarket/v1/export.d.ts +4 -4
- package/lib/codec/ethermint/feemarket/v1/export.js +18 -18
- package/lib/codec/ethermint/feemarket/v1/feemarket.d.ts +51 -51
- package/lib/codec/ethermint/feemarket/v1/feemarket.js +176 -176
- package/lib/codec/ethermint/feemarket/v1/genesis.d.ts +26 -26
- package/lib/codec/ethermint/feemarket/v1/genesis.js +79 -79
- package/lib/codec/ethermint/feemarket/v1/query.d.ts +100 -100
- package/lib/codec/ethermint/feemarket/v1/query.js +276 -276
- package/lib/codec/ethermint/feemarket/v1/tx.d.ts +55 -55
- package/lib/codec/ethermint/feemarket/v1/tx.js +120 -120
- package/lib/codec/ethermint/types/v1/account.d.ts +26 -26
- package/lib/codec/ethermint/types/v1/account.js +78 -78
- package/lib/codec/ethermint/types/v1/dynamic_fee.d.ts +20 -20
- package/lib/codec/ethermint/types/v1/dynamic_fee.js +60 -60
- package/lib/codec/ethermint/types/v1/export.d.ts +4 -4
- package/lib/codec/ethermint/types/v1/export.js +11 -11
- package/lib/codec/ethermint/types/v1/indexer.d.ts +41 -41
- package/lib/codec/ethermint/types/v1/indexer.js +153 -153
- package/lib/codec/ethermint/types/v1/web3.d.ts +36 -36
- package/lib/codec/ethermint/types/v1/web3.js +124 -124
- package/lib/codec/ethermint-models.d.ts +4 -4
- package/lib/codec/ethermint-models.js +26 -30
- package/lib/codec/google/protobuf/any.d.ts +137 -137
- package/lib/codec/google/protobuf/any.js +103 -103
- package/lib/codec/google/protobuf/descriptor.d.ts +1372 -1372
- package/lib/codec/google/protobuf/descriptor.js +4471 -4471
- package/lib/codec/google/protobuf/duration.d.ts +92 -92
- package/lib/codec/google/protobuf/duration.js +75 -75
- package/lib/codec/google/protobuf/empty.d.ts +26 -26
- package/lib/codec/google/protobuf/empty.js +46 -46
- package/lib/codec/google/protobuf/timestamp.d.ts +121 -121
- package/lib/codec/google/protobuf/timestamp.js +75 -75
- package/lib/codec/google/protobuf/wrappers.d.ts +152 -152
- package/lib/codec/google/protobuf/wrappers.js +457 -457
- package/lib/codec/ibc/applications/fee/v1/ack.d.ts +24 -24
- package/lib/codec/ibc/applications/fee/v1/ack.js +125 -125
- package/lib/codec/ibc/applications/fee/v1/fee.d.ts +68 -68
- package/lib/codec/ibc/applications/fee/v1/fee.js +289 -289
- package/lib/codec/ibc/applications/fee/v1/genesis.d.ts +93 -93
- package/lib/codec/ibc/applications/fee/v1/genesis.js +390 -390
- package/lib/codec/ibc/applications/fee/v1/metadata.d.ts +25 -25
- package/lib/codec/ibc/applications/fee/v1/metadata.js +71 -71
- package/lib/codec/ibc/applications/fee/v1/query.d.ts +318 -318
- package/lib/codec/ibc/applications/fee/v1/query.js +1241 -1241
- package/lib/codec/ibc/applications/fee/v1/tx.d.ts +171 -171
- package/lib/codec/ibc/applications/fee/v1/tx.js +524 -524
- package/lib/codec/ibc/applications/interchain_accounts/controller/export.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/controller/export.js +17 -17
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/controller.d.ts +23 -23
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/controller.js +61 -61
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/query.d.ts +70 -70
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/query.js +219 -219
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +113 -113
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.js +426 -426
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +80 -80
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.js +439 -439
- package/lib/codec/ibc/applications/interchain_accounts/host/export.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/host/export.js +11 -11
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/host.d.ts +25 -25
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/host.js +76 -76
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/query.d.ts +44 -44
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/query.js +107 -107
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/tx.d.ts +50 -50
- package/lib/codec/ibc/applications/interchain_accounts/host/v1/tx.js +120 -120
- package/lib/codec/ibc/applications/interchain_accounts/v1/account.d.ts +21 -21
- package/lib/codec/ibc/applications/interchain_accounts/v1/account.js +79 -79
- package/lib/codec/ibc/applications/interchain_accounts/v1/export.d.ts +3 -3
- package/lib/codec/ibc/applications/interchain_accounts/v1/export.js +13 -13
- package/lib/codec/ibc/applications/interchain_accounts/v1/metadata.d.ts +36 -36
- package/lib/codec/ibc/applications/interchain_accounts/v1/metadata.js +129 -129
- package/lib/codec/ibc/applications/interchain_accounts/v1/packet.d.ts +46 -46
- package/lib/codec/ibc/applications/interchain_accounts/v1/packet.js +203 -203
- package/lib/codec/ibc/applications/transfer/v1/authz.d.ts +47 -47
- package/lib/codec/ibc/applications/transfer/v1/authz.js +173 -173
- package/lib/codec/ibc/applications/transfer/v1/export.d.ts +4 -4
- package/lib/codec/ibc/applications/transfer/v1/export.js +27 -27
- package/lib/codec/ibc/applications/transfer/v1/genesis.d.ts +28 -28
- package/lib/codec/ibc/applications/transfer/v1/genesis.js +108 -108
- package/lib/codec/ibc/applications/transfer/v1/query.d.ts +201 -201
- package/lib/codec/ibc/applications/transfer/v1/query.js +637 -637
- package/lib/codec/ibc/applications/transfer/v1/transfer.d.ts +53 -53
- package/lib/codec/ibc/applications/transfer/v1/transfer.js +130 -130
- package/lib/codec/ibc/applications/transfer/v1/tx.d.ts +106 -106
- package/lib/codec/ibc/applications/transfer/v1/tx.js +327 -327
- package/lib/codec/ibc/applications/transfer/v2/export.d.ts +1 -1
- package/lib/codec/ibc/applications/transfer/v2/export.js +5 -5
- package/lib/codec/ibc/applications/transfer/v2/packet.d.ts +32 -32
- package/lib/codec/ibc/applications/transfer/v2/packet.js +113 -113
- package/lib/codec/ibc/core/channel/v1/channel.d.ts +257 -257
- package/lib/codec/ibc/core/channel/v1/channel.js +1003 -1003
- package/lib/codec/ibc/core/channel/v1/export.d.ts +5 -5
- package/lib/codec/ibc/core/channel/v1/export.js +103 -103
- package/lib/codec/ibc/core/channel/v1/genesis.d.ts +45 -45
- package/lib/codec/ibc/core/channel/v1/genesis.js +265 -265
- package/lib/codec/ibc/core/channel/v1/query.d.ts +687 -687
- package/lib/codec/ibc/core/channel/v1/query.js +2693 -2693
- package/lib/codec/ibc/core/channel/v1/tx.d.ts +643 -643
- package/lib/codec/ibc/core/channel/v1/tx.js +3315 -3315
- package/lib/codec/ibc/core/channel/v1/upgrade.d.ts +62 -62
- package/lib/codec/ibc/core/channel/v1/upgrade.js +238 -238
- package/lib/codec/ibc/core/client/v1/client.d.ts +161 -161
- package/lib/codec/ibc/core/client/v1/client.js +506 -506
- package/lib/codec/ibc/core/client/v1/export.d.ts +4 -4
- package/lib/codec/ibc/core/client/v1/export.js +48 -48
- package/lib/codec/ibc/core/client/v1/genesis.d.ts +67 -67
- package/lib/codec/ibc/core/client/v1/genesis.js +296 -296
- package/lib/codec/ibc/core/client/v1/query.d.ts +346 -346
- package/lib/codec/ibc/core/client/v1/query.js +1128 -1128
- package/lib/codec/ibc/core/client/v1/tx.d.ts +264 -264
- package/lib/codec/ibc/core/client/v1/tx.js +896 -896
- package/lib/codec/ibc/core/commitment/v1/commitment.d.ts +70 -70
- package/lib/codec/ibc/core/commitment/v1/commitment.js +237 -237
- package/lib/codec/ibc/core/commitment/v1/export.d.ts +1 -1
- package/lib/codec/ibc/core/commitment/v1/export.js +8 -8
- package/lib/codec/ibc/core/connection/v1/connection.d.ts +170 -170
- package/lib/codec/ibc/core/connection/v1/connection.js +600 -600
- package/lib/codec/ibc/core/connection/v1/export.d.ts +3 -3
- package/lib/codec/ibc/core/connection/v1/export.js +38 -38
- package/lib/codec/ibc/core/connection/v1/genesis.d.ts +24 -24
- package/lib/codec/ibc/core/connection/v1/genesis.js +113 -113
- package/lib/codec/ibc/core/connection/v1/query.d.ts +245 -245
- package/lib/codec/ibc/core/connection/v1/query.js +866 -866
- package/lib/codec/ibc/core/connection/v1/tx.d.ts +221 -221
- package/lib/codec/ibc/core/connection/v1/tx.js +963 -963
- package/lib/codec/ibc/core/types/v1/genesis.d.ts +27 -27
- package/lib/codec/ibc/core/types/v1/genesis.js +105 -105
- package/lib/codec/ibc/lightclients/localhost/v2/export.d.ts +1 -1
- package/lib/codec/ibc/lightclients/localhost/v2/export.js +5 -5
- package/lib/codec/ibc/lightclients/localhost/v2/localhost.d.ts +21 -21
- package/lib/codec/ibc/lightclients/localhost/v2/localhost.js +65 -65
- package/lib/codec/ibc/lightclients/solomachine/v2/export.d.ts +1 -1
- package/lib/codec/ibc/lightclients/solomachine/v2/export.js +23 -23
- package/lib/codec/ibc/lightclients/solomachine/v2/solomachine.d.ts +298 -298
- package/lib/codec/ibc/lightclients/solomachine/v2/solomachine.js +1352 -1352
- package/lib/codec/ibc/lightclients/solomachine/v3/export.d.ts +1 -1
- package/lib/codec/ibc/lightclients/solomachine/v3/export.js +12 -12
- package/lib/codec/ibc/lightclients/solomachine/v3/solomachine.d.ts +146 -146
- package/lib/codec/ibc/lightclients/solomachine/v3/solomachine.js +712 -712
- package/lib/codec/ibc/lightclients/tendermint/v1/export.d.ts +1 -1
- package/lib/codec/ibc/lightclients/tendermint/v1/export.js +9 -9
- package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.d.ts +147 -147
- package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.js +623 -623
- package/lib/codec/ibc/lightclients/wasm/v1/genesis.d.ts +32 -32
- package/lib/codec/ibc/lightclients/wasm/v1/genesis.js +140 -140
- package/lib/codec/ibc/lightclients/wasm/v1/query.d.ts +74 -74
- package/lib/codec/ibc/lightclients/wasm/v1/query.js +272 -272
- package/lib/codec/ibc/lightclients/wasm/v1/tx.d.ts +105 -105
- package/lib/codec/ibc/lightclients/wasm/v1/tx.js +384 -384
- package/lib/codec/ibc/lightclients/wasm/v1/wasm.d.ts +70 -70
- package/lib/codec/ibc/lightclients/wasm/v1/wasm.js +267 -267
- package/lib/codec/ibc-models.d.ts +13 -13
- package/lib/codec/ibc-models.js +35 -39
- package/lib/codec/index.d.ts +662 -662
- package/lib/codec/index.js +30969 -30973
- package/lib/codec/oraclesvc/query.d.ts +20 -20
- package/lib/codec/oraclesvc/query.js +29 -29
- package/lib/codec/polynetwork-models.d.ts +4 -4
- package/lib/codec/polynetwork-models.js +26 -30
- package/lib/codec/tendermint/abci/types.d.ts +817 -817
- package/lib/codec/tendermint/abci/types.js +4769 -4769
- package/lib/codec/tendermint/crypto/keys.d.ts +20 -20
- package/lib/codec/tendermint/crypto/keys.js +109 -109
- package/lib/codec/tendermint/crypto/proof.d.ts +74 -74
- package/lib/codec/tendermint/crypto/proof.js +391 -391
- package/lib/codec/tendermint/libs/bits/types.d.ts +19 -19
- package/lib/codec/tendermint/libs/bits/types.js +89 -89
- package/lib/codec/tendermint/oracle/types.d.ts +90 -90
- package/lib/codec/tendermint/oracle/types.js +629 -629
- package/lib/codec/tendermint/p2p/types.d.ts +60 -60
- package/lib/codec/tendermint/p2p/types.js +400 -400
- package/lib/codec/tendermint/types/block.d.ts +23 -23
- package/lib/codec/tendermint/types/block.js +116 -116
- package/lib/codec/tendermint/types/evidence.d.ts +61 -61
- package/lib/codec/tendermint/types/evidence.js +390 -390
- package/lib/codec/tendermint/types/params.d.ts +141 -141
- package/lib/codec/tendermint/types/params.js +498 -498
- package/lib/codec/tendermint/types/types.d.ts +274 -274
- package/lib/codec/tendermint/types/types.js +1643 -1643
- package/lib/codec/tendermint/types/validator.d.ts +59 -59
- package/lib/codec/tendermint/types/validator.js +343 -343
- package/lib/codec/tendermint/version/types.d.ts +40 -40
- package/lib/codec/tendermint/version/types.js +139 -139
- package/lib/constant/address.d.ts +3 -3
- package/lib/constant/address.js +5 -5
- package/lib/constant/eip6963Provider.d.ts +66 -66
- package/lib/constant/eip6963Provider.js +31 -31
- package/lib/constant/eip712.d.ts +46 -46
- package/lib/constant/eip712.js +106 -106
- package/lib/constant/generic.d.ts +24 -24
- package/lib/constant/generic.js +24 -24
- package/lib/constant/grant.d.ts +1 -1
- package/lib/constant/grant.js +4 -4
- package/lib/constant/ibc.d.ts +190 -190
- package/lib/constant/ibc.js +2131 -2135
- package/lib/constant/index.d.ts +9 -9
- package/lib/constant/index.js +21 -25
- package/lib/constant/network.d.ts +76 -76
- package/lib/constant/network.js +349 -349
- package/lib/constant/node.d.ts +5 -5
- package/lib/constant/node.js +80 -80
- package/lib/constant/token.d.ts +11 -11
- package/lib/constant/token.js +373 -373
- package/lib/constant/walletProvider.d.ts +10 -10
- package/lib/constant/walletProvider.js +15 -15
- package/lib/constant/web3Config.d.ts +33 -33
- package/lib/constant/web3Config.js +175 -175
- package/lib/eth/abis/axelarBridge.json +1150 -1150
- package/lib/eth/abis/balanceReader.json +26 -26
- package/lib/eth/abis/bridgeEntrance.json +105 -105
- package/lib/eth/abis/erc20.json +222 -222
- package/lib/eth/abis/index.d.ts +8 -8
- package/lib/eth/abis/index.js +20 -20
- package/lib/eth/abis/keyStorage.json +44 -44
- package/lib/eth/abis/lockProxy.json +574 -574
- package/lib/eth/abis/vault.json +119 -119
- package/lib/eth/index.d.ts +1 -1
- package/lib/eth/index.js +23 -27
- package/lib/hydrogen/feeQuote.d.ts +23 -23
- package/lib/hydrogen/feeQuote.js +2 -2
- package/lib/hydrogen/index.d.ts +3 -3
- package/lib/hydrogen/index.js +15 -19
- package/lib/hydrogen/relays.d.ts +34 -34
- package/lib/hydrogen/relays.js +2 -2
- package/lib/hydrogen/stats.d.ts +26 -26
- package/lib/hydrogen/stats.js +2 -2
- package/lib/hydrogen/transfer.d.ts +159 -159
- package/lib/hydrogen/transfer.js +10 -10
- package/lib/index.d.ts +12 -12
- package/lib/index.js +59 -63
- package/lib/insights/alliances.d.ts +39 -39
- package/lib/insights/alliances.js +2 -2
- package/lib/insights/balance.d.ts +74 -74
- package/lib/insights/balance.js +2 -2
- package/lib/insights/block.d.ts +25 -25
- package/lib/insights/block.js +2 -2
- package/lib/insights/chain.d.ts +40 -40
- package/lib/insights/chain.js +2 -2
- package/lib/insights/common.d.ts +93 -93
- package/lib/insights/common.js +73 -73
- package/lib/insights/competition.d.ts +196 -196
- package/lib/insights/competition.js +2 -2
- package/lib/insights/delegation.d.ts +26 -26
- package/lib/insights/delegation.js +2 -2
- package/lib/insights/funding.d.ts +41 -41
- package/lib/insights/funding.js +2 -2
- package/lib/insights/index.d.ts +15 -15
- package/lib/insights/index.js +27 -31
- package/lib/insights/inflation.d.ts +6 -6
- package/lib/insights/inflation.js +2 -2
- package/lib/insights/market.d.ts +20 -20
- package/lib/insights/market.js +2 -2
- package/lib/insights/node.d.ts +32 -32
- package/lib/insights/node.js +2 -2
- package/lib/insights/oracles.d.ts +17 -17
- package/lib/insights/oracles.js +2 -2
- package/lib/insights/pool.d.ts +143 -143
- package/lib/insights/pool.js +2 -2
- package/lib/insights/position.d.ts +104 -104
- package/lib/insights/position.js +10 -10
- package/lib/insights/proposal.d.ts +21 -21
- package/lib/insights/proposal.js +2 -2
- package/lib/insights/transaction.d.ts +30 -30
- package/lib/insights/transaction.js +2 -2
- package/lib/insights/user.d.ts +148 -148
- package/lib/insights/user.js +2 -2
- package/lib/modules/admin.d.ts +377 -377
- package/lib/modules/admin.js +715 -715
- package/lib/modules/alliance.d.ts +43 -43
- package/lib/modules/alliance.js +102 -102
- package/lib/modules/bank.d.ts +14 -14
- package/lib/modules/bank.js +35 -35
- package/lib/modules/base.d.ts +12 -12
- package/lib/modules/base.js +29 -29
- package/lib/modules/bridge.d.ts +27 -27
- package/lib/modules/bridge.js +68 -68
- package/lib/modules/broker.d.ts +16 -16
- package/lib/modules/broker.js +50 -50
- package/lib/modules/cdp.d.ts +189 -189
- package/lib/modules/cdp.js +973 -973
- package/lib/modules/coin.d.ts +54 -54
- package/lib/modules/coin.js +138 -138
- package/lib/modules/cosmwasm.d.ts +20 -20
- package/lib/modules/cosmwasm.js +88 -88
- package/lib/modules/erc20.d.ts +30 -30
- package/lib/modules/erc20.js +81 -81
- package/lib/modules/evm.d.ts +45 -45
- package/lib/modules/evm.js +85 -85
- package/lib/modules/evmmerge.d.ts +12 -12
- package/lib/modules/evmmerge.js +35 -35
- package/lib/modules/fee.d.ts +5 -5
- package/lib/modules/fee.js +27 -27
- package/lib/modules/gov.d.ts +21 -21
- package/lib/modules/gov.js +70 -70
- package/lib/modules/grant.d.ts +33 -33
- package/lib/modules/grant.js +196 -196
- package/lib/modules/ibc.d.ts +46 -46
- package/lib/modules/ibc.js +236 -236
- package/lib/modules/index.d.ts +24 -24
- package/lib/modules/index.js +36 -40
- package/lib/modules/leverage.d.ts +13 -13
- package/lib/modules/leverage.js +52 -52
- package/lib/modules/liquiditypool.d.ts +84 -84
- package/lib/modules/liquiditypool.js +198 -198
- package/lib/modules/market.d.ts +104 -104
- package/lib/modules/market.js +183 -183
- package/lib/modules/oracle.d.ts +5 -5
- package/lib/modules/oracle.js +10 -10
- package/lib/modules/order.d.ts +70 -70
- package/lib/modules/order.js +194 -194
- package/lib/modules/perpspool.d.ts +49 -49
- package/lib/modules/perpspool.js +117 -117
- package/lib/modules/position.d.ts +13 -13
- package/lib/modules/position.js +52 -52
- package/lib/modules/profile.d.ts +11 -11
- package/lib/modules/profile.js +35 -35
- package/lib/modules/staking.d.ts +36 -36
- package/lib/modules/staking.js +107 -107
- package/lib/modules/subaccount.d.ts +24 -24
- package/lib/modules/subaccount.js +66 -66
- package/lib/modules/xchain.d.ts +22 -22
- package/lib/modules/xchain.js +53 -53
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/BIP44.d.ts +5 -5
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/BIP44.js +26 -26
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.d.ts +40 -40
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +62 -62
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/index.d.ts +3 -3
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/index.js +17 -21
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.d.ts +42 -42
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +181 -181
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.d.ts +24 -24
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +146 -150
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.d.ts +59 -59
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +180 -180
- package/lib/provider/account/NeoLedgerAccount/index.d.ts +1 -1
- package/lib/provider/account/NeoLedgerAccount/index.js +13 -17
- package/lib/provider/account/index.d.ts +1 -1
- package/lib/provider/account/index.js +13 -17
- package/lib/provider/amino/AminoTypesMap.d.ts +3 -3
- package/lib/provider/amino/AminoTypesMap.js +6 -6
- package/lib/provider/amino/index.d.ts +1 -1
- package/lib/provider/amino/index.js +8 -8
- package/lib/provider/amino/types/admin.d.ts +4 -4
- package/lib/provider/amino/types/admin.js +242 -246
- package/lib/provider/amino/types/bank.d.ts +4 -4
- package/lib/provider/amino/types/bank.js +34 -38
- package/lib/provider/amino/types/bridge.d.ts +4 -4
- package/lib/provider/amino/types/bridge.js +36 -40
- package/lib/provider/amino/types/broker.d.ts +4 -4
- package/lib/provider/amino/types/broker.js +34 -38
- package/lib/provider/amino/types/cdp.d.ts +4 -4
- package/lib/provider/amino/types/cdp.js +173 -177
- package/lib/provider/amino/types/coin.d.ts +4 -4
- package/lib/provider/amino/types/coin.js +52 -56
- package/lib/provider/amino/types/erc20.d.ts +4 -4
- package/lib/provider/amino/types/erc20.js +40 -44
- package/lib/provider/amino/types/evm.d.ts +4 -4
- package/lib/provider/amino/types/evm.js +34 -38
- package/lib/provider/amino/types/evmmerge.d.ts +4 -4
- package/lib/provider/amino/types/evmmerge.js +34 -38
- package/lib/provider/amino/types/feemarket.d.ts +4 -4
- package/lib/provider/amino/types/feemarket.js +34 -38
- package/lib/provider/amino/types/gov.d.ts +4 -4
- package/lib/provider/amino/types/gov.js +413 -417
- package/lib/provider/amino/types/grant.d.ts +13 -13
- package/lib/provider/amino/types/grant.js +198 -202
- package/lib/provider/amino/types/ibc.d.ts +4 -4
- package/lib/provider/amino/types/ibc.js +57 -61
- package/lib/provider/amino/types/index.d.ts +23 -23
- package/lib/provider/amino/types/index.js +52 -52
- package/lib/provider/amino/types/leverage.d.ts +4 -4
- package/lib/provider/amino/types/leverage.js +36 -40
- package/lib/provider/amino/types/liquidityPool.d.ts +4 -4
- package/lib/provider/amino/types/liquidityPool.js +97 -101
- package/lib/provider/amino/types/market.d.ts +4 -4
- package/lib/provider/amino/types/market.js +90 -94
- package/lib/provider/amino/types/oracle.d.ts +4 -4
- package/lib/provider/amino/types/oracle.js +4 -4
- package/lib/provider/amino/types/order.d.ts +4 -4
- package/lib/provider/amino/types/order.js +84 -88
- package/lib/provider/amino/types/perpspool.d.ts +4 -4
- package/lib/provider/amino/types/perpspool.js +73 -77
- package/lib/provider/amino/types/position.d.ts +4 -4
- package/lib/provider/amino/types/position.js +34 -38
- package/lib/provider/amino/types/profile.d.ts +4 -4
- package/lib/provider/amino/types/profile.js +50 -54
- package/lib/provider/amino/types/staking.d.ts +4 -4
- package/lib/provider/amino/types/staking.js +52 -56
- package/lib/provider/amino/types/subaccount.d.ts +4 -4
- package/lib/provider/amino/types/subaccount.js +46 -50
- package/lib/provider/amino/utils.d.ts +44 -44
- package/lib/provider/amino/utils.js +247 -246
- package/lib/provider/chainProvider/GetSigningCosmosClientOptions.d.ts +2 -2
- package/lib/provider/chainProvider/GetSigningCosmosClientOptions.js +18 -18
- package/lib/provider/chainProvider/index.d.ts +2 -2
- package/lib/provider/chainProvider/index.js +5 -5
- package/lib/provider/eip6963Provider/Eip6963Provider.d.ts +8 -8
- package/lib/provider/eip6963Provider/Eip6963Provider.js +24 -24
- package/lib/provider/eip6963Provider/index.d.ts +1 -1
- package/lib/provider/eip6963Provider/index.js +8 -8
- package/lib/provider/index.d.ts +13 -13
- package/lib/provider/index.js +29 -29
- package/lib/provider/keplr/KeplrAccount.d.ts +27 -27
- package/lib/provider/keplr/KeplrAccount.js +230 -230
- package/lib/provider/keplr/KeplrStore.js +1 -1
- package/lib/provider/keplr/index.d.ts +3 -3
- package/lib/provider/keplr/index.js +8 -8
- package/lib/provider/leap/LeapAccount.d.ts +28 -28
- package/lib/provider/leap/LeapAccount.js +208 -208
- package/lib/provider/leap/index.d.ts +3 -3
- package/lib/provider/leap/index.js +8 -8
- package/lib/provider/ledger/index.d.ts +1 -1
- package/lib/provider/ledger/index.js +8 -8
- package/lib/provider/ledger/ledger.d.ts +28 -28
- package/lib/provider/ledger/ledger.js +336 -339
- package/lib/provider/metamask/MetaMask.d.ts +76 -76
- package/lib/provider/metamask/MetaMask.js +730 -734
- package/lib/provider/metamask/error.d.ts +2 -2
- package/lib/provider/metamask/error.js +18 -18
- package/lib/provider/metamask/index.d.ts +1 -1
- package/lib/provider/metamask/index.js +5 -5
- package/lib/provider/metamask/legacy-accounts.d.ts +11 -11
- package/lib/provider/metamask/legacy-accounts.js +2254 -2254
- package/lib/provider/o3/O3Types.d.ts +84 -84
- package/lib/provider/o3/O3Types.js +41 -41
- package/lib/provider/o3/O3Wallet.d.ts +29 -29
- package/lib/provider/o3/O3Wallet.js +238 -242
- package/lib/provider/o3/index.d.ts +2 -2
- package/lib/provider/o3/index.js +28 -32
- package/lib/provider/rainbowKit/RainbowKitAccount.d.ts +37 -37
- package/lib/provider/rainbowKit/RainbowKitAccount.js +341 -341
- package/lib/provider/rainbowKit/index.d.ts +1 -1
- package/lib/provider/rainbowKit/index.js +8 -8
- package/lib/provider/sdk/SDKProvider.d.ts +13 -13
- package/lib/provider/sdk/SDKProvider.js +2 -2
- package/lib/provider/sdk/index.d.ts +1 -1
- package/lib/provider/sdk/index.js +2 -2
- package/lib/provider/zilpay/Zilpay.d.ts +33 -33
- package/lib/provider/zilpay/Zilpay.js +82 -82
- package/lib/provider/zilpay/index.d.ts +1 -1
- package/lib/provider/zilpay/index.js +13 -17
- package/lib/util/address.d.ts +80 -80
- package/lib/util/address.js +324 -328
- package/lib/util/alliance.d.ts +2 -2
- package/lib/util/alliance.js +27 -27
- package/lib/util/api.d.ts +117 -117
- package/lib/util/api.js +177 -177
- package/lib/util/blockchain.d.ts +107 -107
- package/lib/util/blockchain.js +479 -479
- package/lib/util/eip712.d.ts +10 -10
- package/lib/util/eip712.js +198 -198
- package/lib/util/ethermint.d.ts +9 -9
- package/lib/util/ethermint.js +118 -118
- package/lib/util/external.d.ts +11 -11
- package/lib/util/external.js +8 -8
- package/lib/util/fetch.d.ts +1 -1
- package/lib/util/fetch.js +16 -16
- package/lib/util/generic.d.ts +41 -42
- package/lib/util/generic.js +171 -171
- package/lib/util/gov.d.ts +55 -55
- package/lib/util/gov.js +301 -301
- package/lib/util/grant.d.ts +10 -10
- package/lib/util/grant.js +30 -30
- package/lib/util/ibc.d.ts +19 -19
- package/lib/util/ibc.js +150 -150
- package/lib/util/index.d.ts +17 -17
- package/lib/util/index.js +39 -43
- package/lib/util/ledger.d.ts +3 -3
- package/lib/util/ledger.js +59 -59
- package/lib/util/legacyEIP712.d.ts +20 -20
- package/lib/util/legacyEIP712.js +98 -98
- package/lib/util/message.d.ts +2 -2
- package/lib/util/message.js +24 -24
- package/lib/util/network.d.ts +9 -9
- package/lib/util/network.js +40 -40
- package/lib/util/number.d.ts +9 -9
- package/lib/util/number.js +47 -47
- package/lib/util/order.d.ts +3 -3
- package/lib/util/order.js +13 -13
- package/lib/util/provider.d.ts +1 -1
- package/lib/util/provider.js +24 -24
- package/lib/util/token.d.ts +16 -16
- package/lib/util/token.js +23 -23
- package/lib/util/transferfees.d.ts +18 -18
- package/lib/util/transferfees.js +9 -9
- package/lib/util/tx.d.ts +709 -709
- package/lib/util/tx.js +156 -160
- package/lib/util/type.d.ts +22 -22
- package/lib/util/type.js +45 -45
- package/lib/wallet/CarbonSigner.d.ts +68 -68
- package/lib/wallet/CarbonSigner.js +170 -170
- package/lib/wallet/CarbonSigningClient.d.ts +41 -41
- package/lib/wallet/CarbonSigningClient.js +210 -210
- package/lib/wallet/CarbonWallet.d.ts +220 -220
- package/lib/wallet/CarbonWallet.js +756 -756
- package/lib/wallet/index.d.ts +2 -2
- package/lib/wallet/index.js +14 -18
- package/lib/websocket/channel.d.ts +3 -3
- package/lib/websocket/channel.js +286 -286
- package/lib/websocket/connector.d.ts +234 -234
- package/lib/websocket/connector.js +514 -518
- package/lib/websocket/index.d.ts +1 -1
- package/lib/websocket/index.js +13 -17
- package/lib/websocket/models.d.ts +331 -331
- package/lib/websocket/models.js +2 -2
- package/lib/websocket/types.d.ts +233 -233
- package/lib/websocket/types.js +73 -73
- package/package.json +92 -92
- package/lib/codec/Switcheo/carbon/ccm/ccm.d.ts +0 -19
- package/lib/codec/Switcheo/carbon/ccm/ccm.js +0 -60
- package/lib/codec/Switcheo/carbon/fee/proposal.d.ts +0 -57
- package/lib/codec/Switcheo/carbon/fee/proposal.js +0 -311
- package/lib/codec/Switcheo/carbon/liquidation/liquidation.d.ts +0 -17
- package/lib/codec/Switcheo/carbon/liquidation/liquidation.js +0 -46
- package/lib/codec/Switcheo/carbon/marketstats/params.d.ts +0 -18
- package/lib/codec/Switcheo/carbon/marketstats/params.js +0 -46
- package/lib/codec/Switcheo/carbon/oracle/proposal.d.ts +0 -21
- package/lib/codec/Switcheo/carbon/oracle/proposal.js +0 -91
- package/lib/codec/Switcheo/carbon/pricing/proposal.d.ts +0 -31
- package/lib/codec/Switcheo/carbon/pricing/proposal.js +0 -148
- package/lib/codec/adl/genesis.d.ts +0 -18
- package/lib/codec/adl/genesis.js +0 -46
- package/lib/codec/adl/query.d.ts +0 -12
- package/lib/codec/adl/query.js +0 -20
- package/lib/codec/adl/tx.d.ts +0 -12
- package/lib/codec/adl/tx.js +0 -20
- package/lib/codec/admin/export.d.ts +0 -2
- package/lib/codec/admin/export.js +0 -13
- package/lib/codec/admin/genesis.d.ts +0 -18
- package/lib/codec/admin/genesis.js +0 -46
- package/lib/codec/admin/query.d.ts +0 -62
- package/lib/codec/admin/query.js +0 -186
- package/lib/codec/admin/tx.d.ts +0 -62
- package/lib/codec/admin/tx.js +0 -198
- package/lib/codec/alliance/alliance.d.ts +0 -65
- package/lib/codec/alliance/alliance.js +0 -354
- package/lib/codec/alliance/delegations.d.ts +0 -86
- package/lib/codec/alliance/delegations.js +0 -489
- package/lib/codec/alliance/events.d.ts +0 -61
- package/lib/codec/alliance/events.js +0 -403
- package/lib/codec/alliance/export.d.ts +0 -8
- package/lib/codec/alliance/export.js +0 -64
- package/lib/codec/alliance/genesis.d.ts +0 -74
- package/lib/codec/alliance/genesis.js +0 -469
- package/lib/codec/alliance/gov.d.ts +0 -78
- package/lib/codec/alliance/gov.js +0 -380
- package/lib/codec/alliance/params.d.ts +0 -34
- package/lib/codec/alliance/params.js +0 -182
- package/lib/codec/alliance/query.d.ts +0 -333
- package/lib/codec/alliance/query.js +0 -1497
- package/lib/codec/alliance/tx.d.ts +0 -111
- package/lib/codec/alliance/tx.js +0 -495
- package/lib/codec/bank/event.d.ts +0 -65
- package/lib/codec/bank/event.js +0 -332
- package/lib/codec/bank/export.d.ts +0 -2
- package/lib/codec/bank/export.js +0 -14
- package/lib/codec/bank/genesis.d.ts +0 -18
- package/lib/codec/bank/genesis.js +0 -46
- package/lib/codec/bank/query.d.ts +0 -77
- package/lib/codec/bank/query.js +0 -459
- package/lib/codec/book/book.d.ts +0 -57
- package/lib/codec/book/book.js +0 -319
- package/lib/codec/book/event.d.ts +0 -22
- package/lib/codec/book/event.js +0 -113
- package/lib/codec/book/export.d.ts +0 -4
- package/lib/codec/book/export.js +0 -23
- package/lib/codec/book/genesis.d.ts +0 -25
- package/lib/codec/book/genesis.js +0 -79
- package/lib/codec/book/legacy.d.ts +0 -22
- package/lib/codec/book/legacy.js +0 -120
- package/lib/codec/book/query.d.ts +0 -141
- package/lib/codec/book/query.js +0 -606
- package/lib/codec/book/tx.d.ts +0 -12
- package/lib/codec/book/tx.js +0 -20
- package/lib/codec/broker/amm.d.ts +0 -50
- package/lib/codec/broker/amm.js +0 -326
- package/lib/codec/broker/candlestick.d.ts +0 -27
- package/lib/codec/broker/candlestick.js +0 -211
- package/lib/codec/broker/event.d.ts +0 -53
- package/lib/codec/broker/event.js +0 -485
- package/lib/codec/broker/export.d.ts +0 -7
- package/lib/codec/broker/export.js +0 -27
- package/lib/codec/broker/genesis.d.ts +0 -25
- package/lib/codec/broker/genesis.js +0 -79
- package/lib/codec/broker/incoming_liquidations.d.ts +0 -18
- package/lib/codec/broker/incoming_liquidations.js +0 -93
- package/lib/codec/broker/incoming_pool_swap.d.ts +0 -23
- package/lib/codec/broker/incoming_pool_swap.js +0 -136
- package/lib/codec/broker/pagination.d.ts +0 -19
- package/lib/codec/broker/pagination.js +0 -78
- package/lib/codec/broker/query.d.ts +0 -107
- package/lib/codec/broker/query.js +0 -597
- package/lib/codec/broker/tx.d.ts +0 -53
- package/lib/codec/broker/tx.js +0 -176
- package/lib/codec/btcx/denom_cross_chain_info.d.ts +0 -21
- package/lib/codec/btcx/denom_cross_chain_info.js +0 -98
- package/lib/codec/btcx/denom_info.d.ts +0 -24
- package/lib/codec/btcx/denom_info.js +0 -140
- package/lib/codec/btcx/export.d.ts +0 -4
- package/lib/codec/btcx/export.js +0 -19
- package/lib/codec/btcx/genesis.d.ts +0 -18
- package/lib/codec/btcx/genesis.js +0 -46
- package/lib/codec/btcx/query.d.ts +0 -68
- package/lib/codec/btcx/query.js +0 -275
- package/lib/codec/btcx/tx.d.ts +0 -92
- package/lib/codec/btcx/tx.js +0 -436
- package/lib/codec/ccm/ccm.d.ts +0 -19
- package/lib/codec/ccm/ccm.js +0 -60
- package/lib/codec/ccm/export.d.ts +0 -4
- package/lib/codec/ccm/export.js +0 -20
- package/lib/codec/ccm/genesis.d.ts +0 -83
- package/lib/codec/ccm/genesis.js +0 -438
- package/lib/codec/ccm/query.d.ts +0 -45
- package/lib/codec/ccm/query.js +0 -197
- package/lib/codec/ccm/tx.d.ts +0 -97
- package/lib/codec/ccm/tx.js +0 -462
- package/lib/codec/cdp/asset_params.d.ts +0 -57
- package/lib/codec/cdp/asset_params.js +0 -411
- package/lib/codec/cdp/cdp_liquidations.d.ts +0 -32
- package/lib/codec/cdp/cdp_liquidations.js +0 -288
- package/lib/codec/cdp/debt_info.d.ts +0 -23
- package/lib/codec/cdp/debt_info.js +0 -158
- package/lib/codec/cdp/e_mode_category.d.ts +0 -23
- package/lib/codec/cdp/e_mode_category.js +0 -135
- package/lib/codec/cdp/event.d.ts +0 -446
- package/lib/codec/cdp/event.js +0 -2913
- package/lib/codec/cdp/export.d.ts +0 -13
- package/lib/codec/cdp/export.js +0 -210
- package/lib/codec/cdp/genesis.d.ts +0 -134
- package/lib/codec/cdp/genesis.js +0 -825
- package/lib/codec/cdp/params.d.ts +0 -68
- package/lib/codec/cdp/params.js +0 -210
- package/lib/codec/cdp/query.d.ts +0 -644
- package/lib/codec/cdp/query.js +0 -3099
- package/lib/codec/cdp/rate_strategy_params.d.ts +0 -26
- package/lib/codec/cdp/rate_strategy_params.js +0 -180
- package/lib/codec/cdp/reward_scheme.d.ts +0 -71
- package/lib/codec/cdp/reward_scheme.js +0 -550
- package/lib/codec/cdp/stablecoin_debt_info.d.ts +0 -22
- package/lib/codec/cdp/stablecoin_debt_info.js +0 -144
- package/lib/codec/cdp/stablecoin_interest_info.d.ts +0 -19
- package/lib/codec/cdp/stablecoin_interest_info.js +0 -99
- package/lib/codec/cdp/tx.d.ts +0 -1026
- package/lib/codec/cdp/tx.js +0 -5191
- package/lib/codec/coin/bridge.d.ts +0 -24
- package/lib/codec/coin/bridge.js +0 -151
- package/lib/codec/coin/event.d.ts +0 -143
- package/lib/codec/coin/event.js +0 -775
- package/lib/codec/coin/export.d.ts +0 -8
- package/lib/codec/coin/export.js +0 -107
- package/lib/codec/coin/genesis.d.ts +0 -42
- package/lib/codec/coin/genesis.js +0 -207
- package/lib/codec/coin/group.d.ts +0 -50
- package/lib/codec/coin/group.js +0 -230
- package/lib/codec/coin/proposal.d.ts +0 -21
- package/lib/codec/coin/proposal.js +0 -91
- package/lib/codec/coin/query.d.ts +0 -310
- package/lib/codec/coin/query.js +0 -1439
- package/lib/codec/coin/token.d.ts +0 -104
- package/lib/codec/coin/token.js +0 -700
- package/lib/codec/coin/tx.d.ts +0 -586
- package/lib/codec/coin/tx.js +0 -3131
- package/lib/codec/cosmos/app/module/v1alpha1/module.d.ts +0 -18
- package/lib/codec/cosmos/app/module/v1alpha1/module.js +0 -46
- package/lib/codec/cosmos/base/kv/v1beta1/kv.d.ts +0 -31
- package/lib/codec/cosmos/base/kv/v1beta1/kv.js +0 -154
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +0 -160
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.js +0 -684
- package/lib/codec/cosmos/base/store/v1beta1/commit_info.d.ts +0 -54
- package/lib/codec/cosmos/base/store/v1beta1/commit_info.js +0 -273
- package/lib/codec/cosmos/base/store/v1beta1/listening.d.ts +0 -62
- package/lib/codec/cosmos/base/store/v1beta1/listening.js +0 -341
- package/lib/codec/cosmos/capability/module/v1/module.d.ts +0 -23
- package/lib/codec/cosmos/capability/module/v1/module.js +0 -59
- package/lib/codec/cosmos/capability/v1beta1/capability.d.ts +0 -51
- package/lib/codec/cosmos/capability/v1beta1/capability.js +0 -168
- package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +0 -40
- package/lib/codec/cosmos/capability/v1beta1/genesis.js +0 -146
- package/lib/codec/cosmos/gov/v1beta1/export.d.ts +0 -3
- package/lib/codec/cosmos/gov/v1beta1/export.js +0 -45
- package/lib/codec/crisis/genesis.d.ts +0 -18
- package/lib/codec/crisis/genesis.js +0 -46
- package/lib/codec/crisis/query.d.ts +0 -43
- package/lib/codec/crisis/query.js +0 -103
- package/lib/codec/crisis/tx.d.ts +0 -12
- package/lib/codec/crisis/tx.js +0 -20
- package/lib/codec/erc20/erc20.d.ts +0 -41
- package/lib/codec/erc20/erc20.js +0 -144
- package/lib/codec/erc20/events.d.ts +0 -76
- package/lib/codec/erc20/events.js +0 -330
- package/lib/codec/erc20/export.d.ts +0 -5
- package/lib/codec/erc20/export.js +0 -37
- package/lib/codec/erc20/genesis.d.ts +0 -40
- package/lib/codec/erc20/genesis.js +0 -139
- package/lib/codec/erc20/query.d.ts +0 -117
- package/lib/codec/erc20/query.js +0 -333
- package/lib/codec/erc20/tx.d.ts +0 -232
- package/lib/codec/erc20/tx.js +0 -765
- package/lib/codec/evmbank/export.d.ts +0 -2
- package/lib/codec/evmbank/export.js +0 -8
- package/lib/codec/evmbank/genesis.d.ts +0 -32
- package/lib/codec/evmbank/genesis.js +0 -152
- package/lib/codec/evmbank/query.d.ts +0 -40
- package/lib/codec/evmbank/query.js +0 -116
- package/lib/codec/evmcontract/genesis.d.ts +0 -18
- package/lib/codec/evmcontract/genesis.js +0 -46
- package/lib/codec/evmcontract/query.d.ts +0 -12
- package/lib/codec/evmcontract/query.js +0 -20
- package/lib/codec/evmcontract/tx.d.ts +0 -12
- package/lib/codec/evmcontract/tx.js +0 -20
- package/lib/codec/evmmerge/address.d.ts +0 -19
- package/lib/codec/evmmerge/address.js +0 -75
- package/lib/codec/evmmerge/event.d.ts +0 -20
- package/lib/codec/evmmerge/event.js +0 -90
- package/lib/codec/evmmerge/export.d.ts +0 -6
- package/lib/codec/evmmerge/export.js +0 -20
- package/lib/codec/evmmerge/genesis.d.ts +0 -48
- package/lib/codec/evmmerge/genesis.js +0 -216
- package/lib/codec/evmmerge/offchain.d.ts +0 -22
- package/lib/codec/evmmerge/offchain.js +0 -105
- package/lib/codec/evmmerge/query.d.ts +0 -75
- package/lib/codec/evmmerge/query.js +0 -254
- package/lib/codec/evmmerge/tx.d.ts +0 -45
- package/lib/codec/evmmerge/tx.js +0 -128
- package/lib/codec/fee/event.d.ts +0 -20
- package/lib/codec/fee/event.js +0 -83
- package/lib/codec/fee/export.d.ts +0 -5
- package/lib/codec/fee/export.js +0 -32
- package/lib/codec/fee/fee.d.ts +0 -42
- package/lib/codec/fee/fee.js +0 -183
- package/lib/codec/fee/genesis.d.ts +0 -23
- package/lib/codec/fee/genesis.js +0 -79
- package/lib/codec/fee/proposal.d.ts +0 -57
- package/lib/codec/fee/proposal.js +0 -311
- package/lib/codec/fee/query.d.ts +0 -114
- package/lib/codec/fee/query.js +0 -470
- package/lib/codec/fee/tx.d.ts +0 -108
- package/lib/codec/fee/tx.js +0 -415
- package/lib/codec/headersync/consensus_peers.d.ts +0 -70
- package/lib/codec/headersync/consensus_peers.js +0 -383
- package/lib/codec/headersync/export.d.ts +0 -4
- package/lib/codec/headersync/export.js +0 -24
- package/lib/codec/headersync/genesis.d.ts +0 -79
- package/lib/codec/headersync/genesis.js +0 -419
- package/lib/codec/headersync/query.d.ts +0 -64
- package/lib/codec/headersync/query.js +0 -231
- package/lib/codec/headersync/tx.d.ts +0 -64
- package/lib/codec/headersync/tx.js +0 -215
- 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/codec/ibc/lightclients/localhost/v1/export.d.ts +0 -1
- package/lib/codec/ibc/lightclients/localhost/v1/export.js +0 -5
- package/lib/codec/ibc/lightclients/localhost/v1/localhost.d.ts +0 -26
- package/lib/codec/ibc/lightclients/localhost/v1/localhost.js +0 -76
- package/lib/codec/ibc/lightclients/solomachine/v1/export.d.ts +0 -1
- package/lib/codec/ibc/lightclients/solomachine/v1/export.js +0 -23
- package/lib/codec/ibc/lightclients/solomachine/v1/solomachine.d.ts +0 -298
- package/lib/codec/ibc/lightclients/solomachine/v1/solomachine.js +0 -1356
- package/lib/codec/inflation/export.d.ts +0 -2
- package/lib/codec/inflation/export.js +0 -8
- package/lib/codec/inflation/genesis.d.ts +0 -25
- package/lib/codec/inflation/genesis.js +0 -79
- package/lib/codec/inflation/inflation.d.ts +0 -26
- package/lib/codec/inflation/inflation.js +0 -165
- package/lib/codec/inflation/query.d.ts +0 -41
- package/lib/codec/inflation/query.js +0 -109
- package/lib/codec/inflation/tx.d.ts +0 -12
- package/lib/codec/inflation/tx.js +0 -20
- package/lib/codec/insurance/event.d.ts +0 -24
- package/lib/codec/insurance/event.js +0 -46
- package/lib/codec/insurance/export.d.ts +0 -4
- package/lib/codec/insurance/export.js +0 -14
- package/lib/codec/insurance/fund.d.ts +0 -29
- package/lib/codec/insurance/fund.js +0 -148
- package/lib/codec/insurance/genesis.d.ts +0 -18
- package/lib/codec/insurance/genesis.js +0 -46
- package/lib/codec/insurance/query.d.ts +0 -41
- package/lib/codec/insurance/query.js +0 -108
- package/lib/codec/insurance/tx.d.ts +0 -44
- package/lib/codec/insurance/tx.js +0 -144
- package/lib/codec/leverage/event.d.ts +0 -21
- package/lib/codec/leverage/event.js +0 -100
- package/lib/codec/leverage/export.d.ts +0 -4
- package/lib/codec/leverage/export.js +0 -16
- package/lib/codec/leverage/genesis.d.ts +0 -24
- package/lib/codec/leverage/genesis.js +0 -64
- package/lib/codec/leverage/leverage.d.ts +0 -30
- package/lib/codec/leverage/leverage.js +0 -134
- package/lib/codec/leverage/query.d.ts +0 -70
- package/lib/codec/leverage/query.js +0 -234
- package/lib/codec/leverage/tx.d.ts +0 -43
- package/lib/codec/leverage/tx.js +0 -127
- package/lib/codec/liquidation/export.d.ts +0 -5
- package/lib/codec/liquidation/export.js +0 -17
- package/lib/codec/liquidation/genesis.d.ts +0 -37
- package/lib/codec/liquidation/genesis.js +0 -136
- package/lib/codec/liquidation/liquidation.d.ts +0 -17
- package/lib/codec/liquidation/liquidation.js +0 -46
- package/lib/codec/liquidation/outstanding_position.d.ts +0 -33
- package/lib/codec/liquidation/outstanding_position.js +0 -203
- package/lib/codec/liquidation/query.d.ts +0 -77
- package/lib/codec/liquidation/query.js +0 -341
- package/lib/codec/liquidation/quote_changes.d.ts +0 -22
- package/lib/codec/liquidation/quote_changes.js +0 -95
- package/lib/codec/liquidation/tx.d.ts +0 -12
- package/lib/codec/liquidation/tx.js +0 -20
- package/lib/codec/liquiditypool/event.d.ts +0 -182
- package/lib/codec/liquiditypool/event.js +0 -1268
- package/lib/codec/liquiditypool/export.d.ts +0 -6
- package/lib/codec/liquiditypool/export.js +0 -125
- package/lib/codec/liquiditypool/genesis.d.ts +0 -32
- package/lib/codec/liquiditypool/genesis.js +0 -228
- package/lib/codec/liquiditypool/liquiditypool.d.ts +0 -138
- package/lib/codec/liquiditypool/liquiditypool.js +0 -943
- package/lib/codec/liquiditypool/proposal.d.ts +0 -117
- package/lib/codec/liquiditypool/proposal.js +0 -697
- package/lib/codec/liquiditypool/query.d.ts +0 -370
- package/lib/codec/liquiditypool/query.js +0 -1738
- package/lib/codec/liquiditypool/reward.d.ts +0 -196
- package/lib/codec/liquiditypool/reward.js +0 -1204
- package/lib/codec/liquiditypool/tx.d.ts +0 -453
- package/lib/codec/liquiditypool/tx.js +0 -2423
- package/lib/codec/lockproxy/event.d.ts +0 -46
- package/lib/codec/lockproxy/event.js +0 -348
- package/lib/codec/lockproxy/export.d.ts +0 -5
- package/lib/codec/lockproxy/export.js +0 -28
- package/lib/codec/lockproxy/genesis.d.ts +0 -68
- package/lib/codec/lockproxy/genesis.js +0 -355
- package/lib/codec/lockproxy/lockproxy.d.ts +0 -22
- package/lib/codec/lockproxy/lockproxy.js +0 -147
- package/lib/codec/lockproxy/query.d.ts +0 -67
- package/lib/codec/lockproxy/query.js +0 -274
- package/lib/codec/lockproxy/tx.d.ts +0 -147
- package/lib/codec/lockproxy/tx.js +0 -808
- package/lib/codec/market/event.d.ts +0 -20
- package/lib/codec/market/event.js +0 -76
- package/lib/codec/market/export.d.ts +0 -6
- package/lib/codec/market/export.js +0 -61
- package/lib/codec/market/fee.d.ts +0 -123
- package/lib/codec/market/fee.js +0 -334
- package/lib/codec/market/genesis.d.ts +0 -31
- package/lib/codec/market/genesis.js +0 -147
- package/lib/codec/market/legacy.d.ts +0 -62
- package/lib/codec/market/legacy.js +0 -630
- package/lib/codec/market/market.d.ts +0 -131
- package/lib/codec/market/market.js +0 -1245
- package/lib/codec/market/proposal.d.ts +0 -46
- package/lib/codec/market/proposal.js +0 -245
- package/lib/codec/market/query.d.ts +0 -233
- package/lib/codec/market/query.js +0 -938
- package/lib/codec/market/tx.d.ts +0 -250
- package/lib/codec/market/tx.js +0 -1265
- package/lib/codec/marketstats/export.d.ts +0 -3
- package/lib/codec/marketstats/export.js +0 -12
- package/lib/codec/marketstats/marketstats.d.ts +0 -31
- package/lib/codec/marketstats/marketstats.js +0 -258
- package/lib/codec/marketstats/params.d.ts +0 -18
- package/lib/codec/marketstats/params.js +0 -46
- package/lib/codec/marketstats/query.d.ts +0 -66
- package/lib/codec/marketstats/query.js +0 -195
- package/lib/codec/marketstats/tx.d.ts +0 -12
- package/lib/codec/marketstats/tx.js +0 -20
- package/lib/codec/misc/block.d.ts +0 -21
- package/lib/codec/misc/block.js +0 -105
- package/lib/codec/misc/export.d.ts +0 -6
- package/lib/codec/misc/export.js +0 -29
- package/lib/codec/misc/message.d.ts +0 -22
- package/lib/codec/misc/message.js +0 -128
- package/lib/codec/misc/message_type.d.ts +0 -18
- package/lib/codec/misc/message_type.js +0 -60
- package/lib/codec/misc/query.d.ts +0 -192
- package/lib/codec/misc/query.js +0 -884
- package/lib/codec/misc/trade.d.ts +0 -28
- package/lib/codec/misc/trade.js +0 -224
- package/lib/codec/misc/transaction.d.ts +0 -45
- package/lib/codec/misc/transaction.js +0 -369
- package/lib/codec/oracle/event.d.ts +0 -37
- package/lib/codec/oracle/event.js +0 -228
- package/lib/codec/oracle/export.d.ts +0 -6
- package/lib/codec/oracle/export.js +0 -58
- package/lib/codec/oracle/genesis.d.ts +0 -28
- package/lib/codec/oracle/genesis.js +0 -141
- package/lib/codec/oracle/oracle.d.ts +0 -94
- package/lib/codec/oracle/oracle.js +0 -650
- package/lib/codec/oracle/proposal.d.ts +0 -21
- package/lib/codec/oracle/proposal.js +0 -91
- package/lib/codec/oracle/query.d.ts +0 -336
- package/lib/codec/oracle/query.js +0 -1551
- package/lib/codec/oracle/slashing.d.ts +0 -33
- package/lib/codec/oracle/slashing.js +0 -191
- package/lib/codec/oracle/tx.d.ts +0 -169
- package/lib/codec/oracle/tx.js +0 -877
- package/lib/codec/order/event.d.ts +0 -23
- package/lib/codec/order/event.js +0 -146
- package/lib/codec/order/export.d.ts +0 -5
- package/lib/codec/order/export.js +0 -39
- package/lib/codec/order/genesis.d.ts +0 -62
- package/lib/codec/order/genesis.js +0 -322
- package/lib/codec/order/order.d.ts +0 -113
- package/lib/codec/order/order.js +0 -875
- package/lib/codec/order/query.d.ts +0 -143
- package/lib/codec/order/query.js +0 -596
- package/lib/codec/order/tx.d.ts +0 -146
- package/lib/codec/order/tx.js +0 -715
- package/lib/codec/perpsliquidity/event.d.ts +0 -115
- package/lib/codec/perpsliquidity/event.js +0 -657
- package/lib/codec/perpsliquidity/genesis.d.ts +0 -36
- package/lib/codec/perpsliquidity/genesis.js +0 -163
- package/lib/codec/perpsliquidity/market.d.ts +0 -84
- package/lib/codec/perpsliquidity/market.js +0 -431
- package/lib/codec/perpsliquidity/params.d.ts +0 -27
- package/lib/codec/perpsliquidity/params.js +0 -129
- package/lib/codec/perpsliquidity/pool.d.ts +0 -119
- package/lib/codec/perpsliquidity/pool.js +0 -774
- package/lib/codec/perpsliquidity/query.d.ts +0 -246
- package/lib/codec/perpsliquidity/query.js +0 -1125
- package/lib/codec/perpsliquidity/tx.d.ts +0 -203
- package/lib/codec/perpsliquidity/tx.js +0 -973
- package/lib/codec/perpspool/event.d.ts +0 -95
- package/lib/codec/perpspool/event.js +0 -561
- package/lib/codec/perpspool/export.d.ts +0 -7
- package/lib/codec/perpspool/export.js +0 -68
- package/lib/codec/perpspool/genesis.d.ts +0 -61
- package/lib/codec/perpspool/genesis.js +0 -343
- package/lib/codec/perpspool/market.d.ts +0 -96
- package/lib/codec/perpspool/market.js +0 -493
- package/lib/codec/perpspool/params.d.ts +0 -30
- package/lib/codec/perpspool/params.js +0 -189
- package/lib/codec/perpspool/pool.d.ts +0 -103
- package/lib/codec/perpspool/pool.js +0 -638
- package/lib/codec/perpspool/query.d.ts +0 -247
- package/lib/codec/perpspool/query.js +0 -1141
- package/lib/codec/perpspool/tx.d.ts +0 -229
- package/lib/codec/perpspool/tx.js +0 -1144
- package/lib/codec/position/event.d.ts +0 -26
- package/lib/codec/position/event.js +0 -180
- package/lib/codec/position/export.d.ts +0 -4
- package/lib/codec/position/export.js +0 -20
- package/lib/codec/position/genesis.d.ts +0 -24
- package/lib/codec/position/genesis.js +0 -64
- package/lib/codec/position/position.d.ts +0 -74
- package/lib/codec/position/position.js +0 -601
- package/lib/codec/position/query.d.ts +0 -92
- package/lib/codec/position/query.js +0 -400
- package/lib/codec/position/tx.d.ts +0 -42
- package/lib/codec/position/tx.js +0 -127
- package/lib/codec/pricing/event.d.ts +0 -74
- package/lib/codec/pricing/event.js +0 -361
- package/lib/codec/pricing/export.d.ts +0 -6
- package/lib/codec/pricing/export.js +0 -45
- package/lib/codec/pricing/genesis.d.ts +0 -26
- package/lib/codec/pricing/genesis.js +0 -95
- package/lib/codec/pricing/legacy.d.ts +0 -22
- package/lib/codec/pricing/legacy.js +0 -93
- package/lib/codec/pricing/pricing.d.ts +0 -60
- package/lib/codec/pricing/pricing.js +0 -456
- package/lib/codec/pricing/proposal.d.ts +0 -31
- package/lib/codec/pricing/proposal.js +0 -148
- package/lib/codec/pricing/query.d.ts +0 -183
- package/lib/codec/pricing/query.js +0 -759
- package/lib/codec/pricing/tx.d.ts +0 -131
- package/lib/codec/pricing/tx.js +0 -529
- package/lib/codec/profile/event.d.ts +0 -20
- package/lib/codec/profile/event.js +0 -78
- package/lib/codec/profile/export.d.ts +0 -4
- package/lib/codec/profile/export.js +0 -17
- package/lib/codec/profile/genesis.d.ts +0 -24
- package/lib/codec/profile/genesis.js +0 -64
- package/lib/codec/profile/profile.d.ts +0 -20
- package/lib/codec/profile/profile.js +0 -83
- package/lib/codec/profile/query.d.ts +0 -92
- package/lib/codec/profile/query.js +0 -360
- package/lib/codec/profile/tx.d.ts +0 -43
- package/lib/codec/profile/tx.js +0 -127
- package/lib/codec/proofs.d.ts +0 -315
- package/lib/codec/proofs.js +0 -1304
- package/lib/codec/query/pagination.d.ts +0 -29
- package/lib/codec/query/pagination.js +0 -126
- package/lib/codec/sequence/export.d.ts +0 -3
- package/lib/codec/sequence/export.js +0 -13
- package/lib/codec/sequence/genesis.d.ts +0 -30
- package/lib/codec/sequence/genesis.js +0 -122
- package/lib/codec/sequence/query.d.ts +0 -63
- package/lib/codec/sequence/query.js +0 -208
- package/lib/codec/sequence/tx.d.ts +0 -41
- package/lib/codec/sequence/tx.js +0 -148
- package/lib/codec/subaccount/export.d.ts +0 -4
- package/lib/codec/subaccount/export.js +0 -35
- package/lib/codec/subaccount/genesis.d.ts +0 -28
- package/lib/codec/subaccount/genesis.js +0 -110
- package/lib/codec/subaccount/legacy.d.ts +0 -19
- package/lib/codec/subaccount/legacy.js +0 -72
- package/lib/codec/subaccount/query.d.ts +0 -229
- package/lib/codec/subaccount/query.js +0 -1026
- package/lib/codec/subaccount/subaccount.d.ts +0 -57
- package/lib/codec/subaccount/subaccount.js +0 -349
- package/lib/codec/subaccount/tx.d.ts +0 -92
- package/lib/codec/subaccount/tx.js +0 -395
- package/lib/constant/amino.d.ts +0 -0
- package/lib/constant/amino.js +0 -1
- package/lib/constant/chainConfig.d.ts +0 -26
- package/lib/constant/chainConfig.js +0 -154
- package/lib/constant/signless.d.ts +0 -2
- package/lib/constant/signless.js +0 -5
- package/lib/modules/feemarket.d.ts +0 -20
- package/lib/modules/feemarket.js +0 -45
- package/lib/modules/perpsliquidity.d.ts +0 -49
- package/lib/modules/perpsliquidity.js +0 -118
- package/lib/modules/signless.d.ts +0 -24
- package/lib/modules/signless.js +0 -108
- package/lib/modules/vault.d.ts +0 -56
- package/lib/modules/vault.js +0 -128
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.d.ts +0 -29
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +0 -178
- package/lib/provider/account/EthLedgerAccount/EthLedgerSigner.d.ts +0 -13
- package/lib/provider/account/EthLedgerAccount/EthLedgerSigner.js +0 -81
- package/lib/provider/account/EthLedgerAccount/index.d.ts +0 -2
- package/lib/provider/account/EthLedgerAccount/index.js +0 -14
- package/lib/provider/amino/types/perpsliquidity.d.ts +0 -4
- package/lib/provider/amino/types/perpsliquidity.js +0 -73
- package/lib/provider/amino/types/signless.d.ts +0 -12
- package/lib/provider/amino/types/signless.js +0 -193
- package/lib/provider/station/StationAccount.d.ts +0 -28
- package/lib/provider/station/StationAccount.js +0 -168
- package/lib/provider/station/index.d.ts +0 -2
- package/lib/provider/station/index.js +0 -10
- package/lib/util/signless.d.ts +0 -11
- package/lib/util/signless.js +0 -92
|
@@ -1,757 +1,757 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const pagination_1 = require("../codec/cosmos/base/query/v1beta1/pagination");
|
|
16
|
-
const tendermint_1 = require("../codec/ibc/lightclients/tendermint/v1/tendermint");
|
|
17
|
-
const constant_1 = require("../constant");
|
|
18
|
-
const ibc_1 = require("../constant/ibc");
|
|
19
|
-
const util_1 = require("../util");
|
|
20
|
-
const blockchain_1 = require("../util/blockchain");
|
|
21
|
-
const number_1 = require("../util/number");
|
|
22
|
-
const long_1 = __importDefault(require("long"));
|
|
23
|
-
const InsightsQueryClient_1 = __importDefault(require("./InsightsQueryClient"));
|
|
24
|
-
const SYMBOL_OVERRIDE = {
|
|
25
|
-
swth: "SWTH",
|
|
26
|
-
NNEO: "nNEO",
|
|
27
|
-
YAM1: "YAM",
|
|
28
|
-
YAM2: "YAM",
|
|
29
|
-
ASA1: "ASA",
|
|
30
|
-
ASA2: "ASA",
|
|
31
|
-
DBC1: "DBC",
|
|
32
|
-
DBC2: "DBC",
|
|
33
|
-
AVA1: "AVA",
|
|
34
|
-
TSWTH: "tSWTH",
|
|
35
|
-
"cibStride Liquid Staked LUNA": "cibstLUNA",
|
|
36
|
-
};
|
|
37
|
-
const regexCdpDenom = RegExp(`^${constant_1.DenomPrefix.CDPToken}/`, "i");
|
|
38
|
-
const regexLPDenom = RegExp(`^${constant_1.DenomPrefix.LPToken}/(\\d+)$`, "i");
|
|
39
|
-
const onError = (error) => {
|
|
40
|
-
console.error("failed to reload usd values");
|
|
41
|
-
console.error(error);
|
|
42
|
-
};
|
|
43
|
-
class TokenClient {
|
|
44
|
-
constructor(query, configProvider) {
|
|
45
|
-
this.query = query;
|
|
46
|
-
this.configProvider = configProvider;
|
|
47
|
-
this.tokens = {};
|
|
48
|
-
this.wrapperMap = {};
|
|
49
|
-
this.poolTokens = {};
|
|
50
|
-
this.cdpTokens = {};
|
|
51
|
-
this.bridges = { polynetwork: [], ibc: [], axelar: [] };
|
|
52
|
-
this.symbols = {};
|
|
53
|
-
this.usdValues = {};
|
|
54
|
-
this.commonAssetNames = constant_1.CommonAssetName;
|
|
55
|
-
this.geckoTokenNames = constant_1.CoinGeckoTokenNames;
|
|
56
|
-
this.initialUsdValuesLoaded = false;
|
|
57
|
-
this.additionalGeckoDenoms = {};
|
|
58
|
-
this.getIbcBridgeFromBlockchainV2 = (blockchain) => {
|
|
59
|
-
return this.bridges.ibc.find(bridge => (bridge.chainName === blockchain || bridge.chainName.toLowerCase() === blockchain));
|
|
60
|
-
};
|
|
61
|
-
this.getIbcChainFromBlockchainV2 = (blockchain) => {
|
|
62
|
-
const ibcBridge = this.getIbcBridgeFromBlockchainV2(blockchain);
|
|
63
|
-
return ibcBridge === null || ibcBridge === void 0 ? void 0 : ibcBridge.chain_id_name;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
static instance(query, configProvider) {
|
|
67
|
-
return new TokenClient(query, configProvider);
|
|
68
|
-
}
|
|
69
|
-
initialize() {
|
|
70
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
this.setCommonAssetConfig();
|
|
72
|
-
try {
|
|
73
|
-
yield Promise.all([
|
|
74
|
-
this.reloadTokens(),
|
|
75
|
-
this.reloadWrapperMap(),
|
|
76
|
-
this.getBridges(),
|
|
77
|
-
]);
|
|
78
|
-
}
|
|
79
|
-
finally {
|
|
80
|
-
// non-blocking reload
|
|
81
|
-
this.reloadDenomGeckoMap().catch(onError).finally(() => {
|
|
82
|
-
this.reloadUSDValues().catch(onError);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
registerGeckoIdMap(map) {
|
|
88
|
-
this.additionalGeckoDenoms = Object.assign(Object.assign({}, this.additionalGeckoDenoms), map);
|
|
89
|
-
}
|
|
90
|
-
getCommonDenom(denom) {
|
|
91
|
-
var _a;
|
|
92
|
-
return (_a = this.commonAssetNames[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
93
|
-
}
|
|
94
|
-
getDecimals(denom) {
|
|
95
|
-
var _a, _b, _c;
|
|
96
|
-
return (_c = ((_b = (_a = this.tokens[denom]) !== null && _a !== void 0 ? _a : this.poolTokens[denom]) !== null && _b !== void 0 ? _b : this.cdpTokens[denom])) === null || _c === void 0 ? void 0 : _c.decimals.toNumber();
|
|
97
|
-
}
|
|
98
|
-
getBlockchain(denom) {
|
|
99
|
-
var _a, _b;
|
|
100
|
-
const networkConfig = this.configProvider.getConfig();
|
|
101
|
-
const tokenData = this.tokens[denom];
|
|
102
|
-
// chainId defaults to 3 so that blockchain will be undefined
|
|
103
|
-
let chainId = (_b = (_a = tokenData === null || tokenData === void 0 ? void 0 : tokenData.chainId) === null || _a === void 0 ? void 0 : _a.toNumber()) !== null && _b !== void 0 ? _b : 3;
|
|
104
|
-
if (this.isNativeToken(denom) || this.isNativeStablecoin(denom) || TokenClient.isPoolToken(denom) || TokenClient.isCdpToken(denom)) {
|
|
105
|
-
// native denoms "swth" and "usc" should be native.
|
|
106
|
-
// pool and cdp tokens are on the Native blockchain, hence 0
|
|
107
|
-
chainId = 0;
|
|
108
|
-
}
|
|
109
|
-
if (TokenClient.isIBCDenom(denom)) {
|
|
110
|
-
return util_1.IBCUtils.BlockchainMap[denom];
|
|
111
|
-
}
|
|
112
|
-
const blockchain = util_1.BlockchainUtils.blockchainForChainId(chainId, networkConfig.network);
|
|
113
|
-
return blockchain;
|
|
114
|
-
}
|
|
115
|
-
getBlockchainV2(denom) {
|
|
116
|
-
var _a;
|
|
117
|
-
if (!denom)
|
|
118
|
-
return undefined;
|
|
119
|
-
const token = this.tokens[denom];
|
|
120
|
-
if (this.isNativeToken(denom) || this.isNativeStablecoin(denom) || TokenClient.isPoolToken(denom) || TokenClient.isCdpToken(denom) || this.isGroupedToken(denom)) {
|
|
121
|
-
// native denoms "swth" and "usc" should be native.
|
|
122
|
-
// pool and cdp tokens are on the Native blockchain, hence 0
|
|
123
|
-
return 'Native';
|
|
124
|
-
}
|
|
125
|
-
if (this.isBridgedToken(denom)) {
|
|
126
|
-
// brdg tokens will all be chain_id 0 which will also be deprecated in future
|
|
127
|
-
// hence for brdg tokens cannot use chain_id to differentiate between blockchains
|
|
128
|
-
const bridgeList = this.bridges.axelar;
|
|
129
|
-
const chainName = (_a = bridgeList.find((bridge) => bridge.bridgeAddress === token.bridgeAddress)) === null || _a === void 0 ? void 0 : _a.chainName;
|
|
130
|
-
return chainName;
|
|
131
|
-
}
|
|
132
|
-
const bridge = this.getBridgeFromToken(token);
|
|
133
|
-
return bridge === null || bridge === void 0 ? void 0 : bridge.chainName;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* use getTokenName directly instead
|
|
137
|
-
* @deprecated
|
|
138
|
-
*/
|
|
139
|
-
getSymbol(denom) {
|
|
140
|
-
var _a, _b;
|
|
141
|
-
if (TokenClient.isCdpToken(denom)) {
|
|
142
|
-
return (_a = this.symbols[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
143
|
-
}
|
|
144
|
-
const commonDenom = this.getCommonDenom(denom);
|
|
145
|
-
return (_b = this.symbols[commonDenom]) !== null && _b !== void 0 ? _b : commonDenom.toUpperCase();
|
|
146
|
-
}
|
|
147
|
-
getUSDValue(denom) {
|
|
148
|
-
return this.usdValues[denom];
|
|
149
|
-
}
|
|
150
|
-
toHuman(denom, unitlessAmt) {
|
|
151
|
-
var _a;
|
|
152
|
-
const decimals = this.getDecimals(denom);
|
|
153
|
-
return (_a = util_1.NumberUtils.toHuman(unitlessAmt, decimals)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
154
|
-
}
|
|
155
|
-
toUnitless(denom, humanAmt) {
|
|
156
|
-
var _a;
|
|
157
|
-
const decimals = this.getDecimals(denom);
|
|
158
|
-
return (_a = util_1.NumberUtils.toUnitless(humanAmt, decimals)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
159
|
-
}
|
|
160
|
-
tokenForId(id) {
|
|
161
|
-
let tokensList = Object.values(this.tokens);
|
|
162
|
-
if (TokenClient.isPoolToken(id)) {
|
|
163
|
-
tokensList = Object.values(this.poolTokens);
|
|
164
|
-
}
|
|
165
|
-
else if (TokenClient.isCdpToken(id)) {
|
|
166
|
-
tokensList = Object.values(this.cdpTokens);
|
|
167
|
-
}
|
|
168
|
-
return tokensList.find((token) => token.id === id);
|
|
169
|
-
}
|
|
170
|
-
tokenForDenom(denom) {
|
|
171
|
-
var _a, _b;
|
|
172
|
-
return (_b = (_a = this.poolTokens[denom]) !== null && _a !== void 0 ? _a : this.cdpTokens[denom]) !== null && _b !== void 0 ? _b : this.tokens[denom];
|
|
173
|
-
}
|
|
174
|
-
getFeeInfo(denom) {
|
|
175
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
-
const config = this.configProvider.getConfig();
|
|
177
|
-
const url = `${config.hydrogenUrl}/fee_quote?token_denom=${denom}`;
|
|
178
|
-
const requestOptions = {
|
|
179
|
-
method: 'POST',
|
|
180
|
-
headers: {
|
|
181
|
-
'Content-Type': 'application/json',
|
|
182
|
-
},
|
|
183
|
-
body: JSON.stringify({}),
|
|
184
|
-
};
|
|
185
|
-
const result = yield util_1.FetchUtils.fetch(url, requestOptions).then((res) => res.json());
|
|
186
|
-
return result;
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
getTokenName(denom, overrideMap) {
|
|
190
|
-
var _a;
|
|
191
|
-
if (typeof denom !== "string")
|
|
192
|
-
return "";
|
|
193
|
-
if (!TokenClient.isIBCDenom(denom) && !TokenClient.isCdpIbcDenom(denom)) {
|
|
194
|
-
denom = denom.toLowerCase();
|
|
195
|
-
}
|
|
196
|
-
const symbol = this.getSymbol(denom);
|
|
197
|
-
if (TokenClient.isPoolTokenLegacy(denom)) {
|
|
198
|
-
const match = symbol.match(/^([a-z\d.-/]+)-(\d+)-([a-z\d.-/]+)-(\d+)-lp\d+$/i);
|
|
199
|
-
// inconsistent implementation of isPoolToken, exit
|
|
200
|
-
if (match === null)
|
|
201
|
-
return symbol;
|
|
202
|
-
const denomA = match[1];
|
|
203
|
-
const denomB = match[3];
|
|
204
|
-
const symbolA = this.getTokenName(denomA);
|
|
205
|
-
const symbolB = this.getTokenName(denomB);
|
|
206
|
-
return `${symbolA}-${symbolB}`;
|
|
207
|
-
}
|
|
208
|
-
if (TokenClient.isIBCDenom(denom)) {
|
|
209
|
-
const splitDenom = denom.split("/");
|
|
210
|
-
denom = `${splitDenom[0].toLowerCase()}/${splitDenom[1].toUpperCase()}`;
|
|
211
|
-
return (_a = this.symbols[denom]) !== null && _a !== void 0 ? _a : denom.toUpperCase();
|
|
212
|
-
}
|
|
213
|
-
if (SYMBOL_OVERRIDE[symbol]) {
|
|
214
|
-
return SYMBOL_OVERRIDE[symbol];
|
|
215
|
-
}
|
|
216
|
-
if (overrideMap === null || overrideMap === void 0 ? void 0 : overrideMap[symbol]) {
|
|
217
|
-
return overrideMap[symbol];
|
|
218
|
-
}
|
|
219
|
-
return symbol;
|
|
220
|
-
}
|
|
221
|
-
getTokenDesc(denom) {
|
|
222
|
-
var _a, _b, _c, _d;
|
|
223
|
-
if (typeof denom !== "string")
|
|
224
|
-
return "";
|
|
225
|
-
denom = denom.toLowerCase();
|
|
226
|
-
if (TokenClient.isPoolTokenLegacy(denom)) {
|
|
227
|
-
const match = denom.match(/^([a-z\d.-/]+)-(\d+)-([a-z\d.-/]+)-(\d+)-lp\d+$/i);
|
|
228
|
-
// inconsistent implementation of isPoolToken, exit
|
|
229
|
-
if (match === null)
|
|
230
|
-
return this.getSymbol(denom);
|
|
231
|
-
const denomA = match[1];
|
|
232
|
-
const weightA = match[2];
|
|
233
|
-
const denomB = match[3];
|
|
234
|
-
const weightB = match[4];
|
|
235
|
-
const symbolA = this.getTokenName(denomA);
|
|
236
|
-
const symbolB = this.getTokenName(denomB);
|
|
237
|
-
return `${weightA}% ${symbolA} / ${weightB}% ${symbolB}`;
|
|
238
|
-
}
|
|
239
|
-
if (TokenClient.isCdpToken(denom)) {
|
|
240
|
-
return (_b = (_a = this.cdpTokens[denom]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : this.getSymbol(denom);
|
|
241
|
-
}
|
|
242
|
-
return (_d = (_c = this.tokens[denom]) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : this.getSymbol(denom);
|
|
243
|
-
}
|
|
244
|
-
static isPoolTokenNew(denom) {
|
|
245
|
-
return denom.match(regexLPDenom) !== null;
|
|
246
|
-
}
|
|
247
|
-
static isPoolTokenLegacy(denom) {
|
|
248
|
-
return denom.match(/^([a-z\d.-]+)-(\d+)-([a-z\d.-]+)-(\d+)-lp\d+$/i) !== null;
|
|
249
|
-
}
|
|
250
|
-
static isCdpToken(denom) {
|
|
251
|
-
return denom.match(regexCdpDenom) !== null;
|
|
252
|
-
}
|
|
253
|
-
static isPoolToken(denom) {
|
|
254
|
-
return this.isPoolTokenNew(denom) || this.isPoolTokenLegacy(denom);
|
|
255
|
-
}
|
|
256
|
-
static isIBCDenom(denom) {
|
|
257
|
-
return denom.match(ibc_1.ibcTokenRegex) !== null;
|
|
258
|
-
}
|
|
259
|
-
static isCdpIbcDenom(denom) {
|
|
260
|
-
return ibc_1.cibtIbcTokenRegex.test(denom);
|
|
261
|
-
}
|
|
262
|
-
isWrappedToken(denom) {
|
|
263
|
-
return !!this.wrapperMap[denom !== null && denom !== void 0 ? denom : ""];
|
|
264
|
-
}
|
|
265
|
-
hasWrappedToken(denom) {
|
|
266
|
-
return Object.values(this.wrapperMap).includes(denom !== null && denom !== void 0 ? denom : "");
|
|
267
|
-
}
|
|
268
|
-
getWrappedTokens(denom) {
|
|
269
|
-
const result = [];
|
|
270
|
-
if (!this.tokens)
|
|
271
|
-
return result;
|
|
272
|
-
// check if denom is source token
|
|
273
|
-
if (Object.values(this.wrapperMap).includes(denom)) {
|
|
274
|
-
for (const [wrappedDenom, sourceDenom] of Object.entries(this.wrapperMap)) {
|
|
275
|
-
// if mapping is not relevant to current source denom, skip.
|
|
276
|
-
if (sourceDenom !== denom) {
|
|
277
|
-
continue;
|
|
278
|
-
}
|
|
279
|
-
// add wrapped to result list
|
|
280
|
-
const token = this.tokens[wrappedDenom];
|
|
281
|
-
if (token) {
|
|
282
|
-
result.push(token);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return result;
|
|
287
|
-
}
|
|
288
|
-
getWrappedToken(denom, blockchain, version = 'V1') {
|
|
289
|
-
// if denom is already a wrapped denom or no blockchain was specified,
|
|
290
|
-
// just return the input denom.
|
|
291
|
-
if (this.wrapperMap[denom] || !blockchain) {
|
|
292
|
-
return this.tokens[denom];
|
|
293
|
-
}
|
|
294
|
-
// check if denom is source token
|
|
295
|
-
if (Object.values(this.wrapperMap).includes(denom)) {
|
|
296
|
-
for (const [wrappedDenom, sourceDenom] of Object.entries(this.wrapperMap)) {
|
|
297
|
-
// if mapping is not relevant to current source denom, skip.
|
|
298
|
-
if (sourceDenom !== denom) {
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
// check if wrapped denom is of correct blockchain
|
|
302
|
-
const token = this.tokens[wrappedDenom];
|
|
303
|
-
let tokenChain = '';
|
|
304
|
-
if (version === "V1") {
|
|
305
|
-
tokenChain = util_1.BlockchainUtils.blockchainForChainId(token.chainId.toNumber());
|
|
306
|
-
if (TokenClient.isIBCDenom(token.denom)) {
|
|
307
|
-
tokenChain = util_1.IBCUtils.BlockchainMap[wrappedDenom];
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
tokenChain = this.getBlockchainV2(token.denom);
|
|
312
|
-
}
|
|
313
|
-
if (!tokenChain) {
|
|
314
|
-
continue; // unknown chain! just ignore this source token
|
|
315
|
-
}
|
|
316
|
-
if (tokenChain === blockchain) {
|
|
317
|
-
return token;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
return null;
|
|
322
|
-
}
|
|
323
|
-
getSourceToken(denom) {
|
|
324
|
-
// check if denom is source token
|
|
325
|
-
if (Object.values(this.wrapperMap).includes(denom)) {
|
|
326
|
-
return this.tokens[denom];
|
|
327
|
-
}
|
|
328
|
-
// check if denom is wrapped token
|
|
329
|
-
if (this.wrapperMap[denom]) {
|
|
330
|
-
const sourceDenom = this.wrapperMap[denom];
|
|
331
|
-
return this.tokens[sourceDenom];
|
|
332
|
-
}
|
|
333
|
-
return null;
|
|
334
|
-
}
|
|
335
|
-
getNativeToken() {
|
|
336
|
-
return this.tokenForId("swth");
|
|
337
|
-
}
|
|
338
|
-
getNativeStablecoin() {
|
|
339
|
-
return this.tokenForId("usc");
|
|
340
|
-
}
|
|
341
|
-
isNativeToken(denom) {
|
|
342
|
-
return denom === "swth";
|
|
343
|
-
}
|
|
344
|
-
isNativeStablecoin(denom) {
|
|
345
|
-
return denom === "usc";
|
|
346
|
-
}
|
|
347
|
-
isGroupedToken(denom) {
|
|
348
|
-
const groupedTokenRegex = new RegExp(/^cgt\/\d+$/);
|
|
349
|
-
return groupedTokenRegex.test(denom);
|
|
350
|
-
}
|
|
351
|
-
isBridgedToken(denom) {
|
|
352
|
-
const bridgedTokenRegex = new RegExp(/^brdg\//);
|
|
353
|
-
return bridgedTokenRegex.test(denom);
|
|
354
|
-
}
|
|
355
|
-
isCarbonToken(token) {
|
|
356
|
-
return Boolean(token && (this.isNativeToken(token.denom) || token.bridgeId.eq(0)));
|
|
357
|
-
}
|
|
358
|
-
getDepositTokenFor(tokenDenom, chain, version = "V1") {
|
|
359
|
-
const networkConfig = this.configProvider.getConfig();
|
|
360
|
-
const token = this.tokenForDenom(tokenDenom);
|
|
361
|
-
if (!token) {
|
|
362
|
-
console.debug("getDepositTokenFor token not found for", tokenDenom);
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
let targetChain = "";
|
|
366
|
-
// check if selected token is a source token
|
|
367
|
-
if (version === "V1") {
|
|
368
|
-
targetChain = util_1.BlockchainUtils.blockchainForChainId(token.chainId.toNumber(), networkConfig.network);
|
|
369
|
-
if (TokenClient.isIBCDenom(token.denom)) {
|
|
370
|
-
targetChain = util_1.IBCUtils.BlockchainMap[token.denom];
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
targetChain = this.getBlockchainV2(token.denom);
|
|
375
|
-
}
|
|
376
|
-
const isSourceToken = targetChain === chain && token.denom !== "swth";
|
|
377
|
-
// if not source token find wrapped token for chain
|
|
378
|
-
const depositToken = isSourceToken ? token : this.getWrappedToken(token.denom, chain, version);
|
|
379
|
-
if (!depositToken) {
|
|
380
|
-
console.debug(`getDepositTokenFor wrapped token not found for "${token.denom}"`);
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
return depositToken;
|
|
384
|
-
}
|
|
385
|
-
getAllTokens() {
|
|
386
|
-
var _a;
|
|
387
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
388
|
-
const result = yield this.query.coin.TokenAll({
|
|
389
|
-
pagination: {
|
|
390
|
-
limit: new long_1.default(10000),
|
|
391
|
-
offset: long_1.default.UZERO,
|
|
392
|
-
key: new Uint8Array(),
|
|
393
|
-
countTotal: false,
|
|
394
|
-
reverse: false,
|
|
395
|
-
},
|
|
396
|
-
});
|
|
397
|
-
const networkConfig = this.configProvider.getConfig();
|
|
398
|
-
const tokenBlacklist = (_a = constant_1.TokenBlacklist[networkConfig.network]) !== null && _a !== void 0 ? _a : [];
|
|
399
|
-
return result.tokens.filter((token) => !tokenBlacklist.includes(token.denom));
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
reloadTokens() {
|
|
403
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
404
|
-
const tokenResponse = yield this.getAllTokens();
|
|
405
|
-
for (const token of tokenResponse) {
|
|
406
|
-
if (TokenClient.isPoolToken(token.denom)) {
|
|
407
|
-
this.poolTokens[token.denom] = token;
|
|
408
|
-
}
|
|
409
|
-
else if (TokenClient.isCdpToken(token.denom)) {
|
|
410
|
-
this.cdpTokens[token.denom] = token;
|
|
411
|
-
this.symbols[token.denom] = token.symbol;
|
|
412
|
-
}
|
|
413
|
-
else {
|
|
414
|
-
if (this.isNativeToken(token.denom)) {
|
|
415
|
-
// Change token name to Carbon
|
|
416
|
-
token.name = "Carbon";
|
|
417
|
-
}
|
|
418
|
-
this.tokens[token.denom] = token;
|
|
419
|
-
this.symbols[token.denom] = token.symbol;
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
return this.tokens;
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
getBridges() {
|
|
426
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
427
|
-
const allBridges = yield this.query.coin.BridgeAll({
|
|
428
|
-
pagination: {
|
|
429
|
-
key: new Uint8Array(),
|
|
430
|
-
limit: new long_1.default(10000),
|
|
431
|
-
offset: long_1.default.UZERO,
|
|
432
|
-
countTotal: true,
|
|
433
|
-
reverse: false,
|
|
434
|
-
},
|
|
435
|
-
});
|
|
436
|
-
const unmatchedIbcBridgeList = allBridges.bridges.filter(bridge => {
|
|
437
|
-
if (!bridge.enabled)
|
|
438
|
-
return;
|
|
439
|
-
return bridge.bridgeId.toNumber() === blockchain_1.BRIDGE_IDS.ibc;
|
|
440
|
-
});
|
|
441
|
-
const ibcBridges = yield this.matchChainsWithDifferentChainIds(unmatchedIbcBridgeList);
|
|
442
|
-
const axelarBridges = yield this.mapBridgesFromConnections();
|
|
443
|
-
const polynetworkBridges = allBridges.bridges.reduce((prev, bridge) => {
|
|
444
|
-
if (bridge.bridgeId.toNumber() !== blockchain_1.BRIDGE_IDS.polynetwork)
|
|
445
|
-
return prev;
|
|
446
|
-
prev.push(Object.assign(Object.assign({}, bridge), { isEvmChain: util_1.BlockchainUtils.isEvmChain(bridge.chainName) }));
|
|
447
|
-
return prev;
|
|
448
|
-
}, []);
|
|
449
|
-
Object.assign(this.bridges, {
|
|
450
|
-
polynetwork: polynetworkBridges,
|
|
451
|
-
ibc: ibcBridges,
|
|
452
|
-
axelar: axelarBridges,
|
|
453
|
-
});
|
|
454
|
-
return this.bridges;
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
matchChainsWithDifferentChainIds(bridges) {
|
|
458
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
-
let newBridges = [];
|
|
460
|
-
try {
|
|
461
|
-
const pagination = pagination_1.PageRequest.fromPartial({ limit: new long_1.default(1e6) });
|
|
462
|
-
const results = yield Promise.all([
|
|
463
|
-
this.query.ibc.channel.Channels({ pagination }),
|
|
464
|
-
this.query.ibc.connection.Connections({ pagination }),
|
|
465
|
-
this.query.ibc.client.ClientStates({ pagination }),
|
|
466
|
-
]);
|
|
467
|
-
const [{ channels }, { connections }, { clientStates: rawClientStates }] = results;
|
|
468
|
-
const clientStates = rawClientStates.map(s => ({
|
|
469
|
-
clientState: tendermint_1.ClientState.decode(s.clientState.value),
|
|
470
|
-
clientId: s.clientId,
|
|
471
|
-
}));
|
|
472
|
-
newBridges = bridges.map(bridge => {
|
|
473
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
474
|
-
const connection = channels.find(channel => channel.channelId === ("channel-" + (bridge.chainId.toNumber() - 1)));
|
|
475
|
-
const connectionId = connection === null || connection === void 0 ? void 0 : connection.connectionHops[0];
|
|
476
|
-
const src_channel = (_a = connection === null || connection === void 0 ? void 0 : connection.channelId) !== null && _a !== void 0 ? _a : "";
|
|
477
|
-
const dst_channel = (_c = (_b = connection === null || connection === void 0 ? void 0 : connection.counterparty) === null || _b === void 0 ? void 0 : _b.channelId) !== null && _c !== void 0 ? _c : "";
|
|
478
|
-
const cosmRegexArr = (_e = (_d = connection === null || connection === void 0 ? void 0 : connection.counterparty) === null || _d === void 0 ? void 0 : _d.portId) === null || _e === void 0 ? void 0 : _e.match(ibc_1.cosmBridgeRegex);
|
|
479
|
-
const portId = (_f = cosmRegexArr === null || cosmRegexArr === void 0 ? void 0 : cosmRegexArr[1]) !== null && _f !== void 0 ? _f : "transfer";
|
|
480
|
-
const clientId = (_g = connections.find(connection => connection.id === connectionId)) === null || _g === void 0 ? void 0 : _g.clientId;
|
|
481
|
-
const chainIdName = (_j = ((_h = clientStates.find(client => client.clientId === clientId)) === null || _h === void 0 ? void 0 : _h.clientState)) === null || _j === void 0 ? void 0 : _j.chainId;
|
|
482
|
-
return Object.assign(Object.assign({}, bridge), { chain_id_name: chainIdName !== null && chainIdName !== void 0 ? chainIdName : "", channels: { src_channel, dst_channel, port_id: portId } });
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
finally {
|
|
486
|
-
const checkedBefore = new Array(newBridges.length).fill(false);
|
|
487
|
-
const chainMap = {};
|
|
488
|
-
for (let i = 0; i < newBridges.length; i++) {
|
|
489
|
-
if (checkedBefore[i])
|
|
490
|
-
continue;
|
|
491
|
-
const bridge = newBridges[i];
|
|
492
|
-
const chainId = bridge.chain_id_name;
|
|
493
|
-
if (chainMap[chainId]) {
|
|
494
|
-
const chainName = chainMap[chainId];
|
|
495
|
-
for (let j = i; j < newBridges.length; j++) {
|
|
496
|
-
const subBridge = newBridges[j];
|
|
497
|
-
if (subBridge.chain_id_name === chainId) {
|
|
498
|
-
subBridge.chainName = chainName;
|
|
499
|
-
checkedBefore[j] = true;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
else {
|
|
504
|
-
chainMap[chainId] = bridge.chainName;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
return newBridges;
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
mapBridgesFromConnections() {
|
|
512
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
513
|
-
const newBridges = [];
|
|
514
|
-
try {
|
|
515
|
-
const results = yield this.query.bridge.ConnectionAll({
|
|
516
|
-
bridgeId: new long_1.default(0),
|
|
517
|
-
pagination: pagination_1.PageRequest.fromPartial({
|
|
518
|
-
limit: new long_1.default(10000),
|
|
519
|
-
}),
|
|
520
|
-
});
|
|
521
|
-
const connections = results.connections;
|
|
522
|
-
connections.forEach(connection => {
|
|
523
|
-
newBridges.push({
|
|
524
|
-
name: `${connection.chainDisplayName} via Axelar`,
|
|
525
|
-
bridgeId: new long_1.default(blockchain_1.BRIDGE_IDS.axelar),
|
|
526
|
-
chainId: new long_1.default(blockchain_1.BRIDGE_IDS.axelar),
|
|
527
|
-
bridgeAddress: connection.connectionId,
|
|
528
|
-
chain_id_name: connection.chainId,
|
|
529
|
-
chainName: connection.chainDisplayName,
|
|
530
|
-
bridgeName: 'Axelar',
|
|
531
|
-
bridgeAddresses: [],
|
|
532
|
-
enabled: connection.isEnabled,
|
|
533
|
-
});
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
catch (err) {
|
|
537
|
-
console.error(err);
|
|
538
|
-
}
|
|
539
|
-
finally {
|
|
540
|
-
const chainMap = {};
|
|
541
|
-
newBridges.forEach((bridge) => {
|
|
542
|
-
const chainId = bridge.chain_id_name;
|
|
543
|
-
if (chainMap[chainId]) {
|
|
544
|
-
bridge.chainName = chainMap[chainId];
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
chainMap[chainId] = bridge.chainName;
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
return newBridges;
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
getIbcBlockchainNames() {
|
|
555
|
-
return this.bridges.ibc.map(bridge => bridge.chainName);
|
|
556
|
-
}
|
|
557
|
-
getAxelarBlockchainNames() {
|
|
558
|
-
return this.bridges.axelar.map(bridge => bridge.chainName);
|
|
559
|
-
}
|
|
560
|
-
getPolynetworkBlockchainNames() {
|
|
561
|
-
return this.bridges.polynetwork.map(bridge => bridge.chainName);
|
|
562
|
-
}
|
|
563
|
-
getAllBlockchainNames() {
|
|
564
|
-
return this.getIbcBlockchainNames().concat(this.getPolynetworkBlockchainNames()).concat(this.getAxelarBlockchainNames());
|
|
565
|
-
}
|
|
566
|
-
getBridgesFromBridgeId(bridgeId) {
|
|
567
|
-
switch (bridgeId) {
|
|
568
|
-
case blockchain_1.BRIDGE_IDS.polynetwork:
|
|
569
|
-
return this.bridges.polynetwork;
|
|
570
|
-
case blockchain_1.BRIDGE_IDS.ibc:
|
|
571
|
-
return this.bridges.ibc;
|
|
572
|
-
case blockchain_1.BRIDGE_IDS.axelar:
|
|
573
|
-
return this.bridges.axelar;
|
|
574
|
-
default:
|
|
575
|
-
return this.bridges.polynetwork;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
getIbcTokens() {
|
|
579
|
-
const ibcTokens = Object.values(this.tokens).reduce((prev, token) => {
|
|
580
|
-
const newPrev = prev;
|
|
581
|
-
if (token.bridgeId.toNumber() === blockchain_1.BRIDGE_IDS.ibc) {
|
|
582
|
-
newPrev[token.denom] = token;
|
|
583
|
-
}
|
|
584
|
-
return newPrev;
|
|
585
|
-
}, {});
|
|
586
|
-
return ibcTokens;
|
|
587
|
-
}
|
|
588
|
-
getPolyNetworkTokens() {
|
|
589
|
-
const polynetworkTokens = Object.values(this.tokens).reduce((prev, token) => {
|
|
590
|
-
const newPrev = prev;
|
|
591
|
-
if (token.bridgeId.toNumber() === blockchain_1.BRIDGE_IDS.polynetwork) {
|
|
592
|
-
newPrev[token.denom] = token;
|
|
593
|
-
}
|
|
594
|
-
return newPrev;
|
|
595
|
-
}, {});
|
|
596
|
-
return polynetworkTokens;
|
|
597
|
-
}
|
|
598
|
-
getBlockchainV2FromIDs(chainId, bridgeId) {
|
|
599
|
-
var _a, _b;
|
|
600
|
-
if ((chainId === 5 && bridgeId === 1) || (chainId === 0 && bridgeId === 2))
|
|
601
|
-
return "Carbon";
|
|
602
|
-
const bridgeList = this.getBridgesFromBridgeId(bridgeId);
|
|
603
|
-
return (_b = (_a = bridgeList.find(bridge => bridge.chainId.toNumber() === chainId)) === null || _a === void 0 ? void 0 : _a.chainName) !== null && _b !== void 0 ? _b : undefined;
|
|
604
|
-
}
|
|
605
|
-
getBridgeFromToken(token) {
|
|
606
|
-
if (!token || !token.bridgeId)
|
|
607
|
-
return undefined;
|
|
608
|
-
const bridgeList = this.getBridgesFromBridgeId(token.bridgeId.toNumber());
|
|
609
|
-
return bridgeList.find(bridge => token.chainId.equals(bridge.chainId));
|
|
610
|
-
}
|
|
611
|
-
getIbcChainIdFromToken(token) {
|
|
612
|
-
if (!token)
|
|
613
|
-
return undefined;
|
|
614
|
-
const bridge = this.getBridgeFromToken(token);
|
|
615
|
-
if (!bridge || !
|
|
616
|
-
return undefined;
|
|
617
|
-
return bridge.chain_id_name;
|
|
618
|
-
}
|
|
619
|
-
getCdpUnderlyingToken(cdpDenom) {
|
|
620
|
-
if (!this.cdpTokens[cdpDenom]) {
|
|
621
|
-
console.error("not a CDP denom");
|
|
622
|
-
return undefined;
|
|
623
|
-
}
|
|
624
|
-
const tokenDenom = cdpDenom.replace(regexCdpDenom, "");
|
|
625
|
-
if (TokenClient.isPoolToken(tokenDenom)) {
|
|
626
|
-
return this.poolTokens[tokenDenom];
|
|
627
|
-
}
|
|
628
|
-
return this.tokenForDenom(tokenDenom);
|
|
629
|
-
}
|
|
630
|
-
reloadWrapperMap() {
|
|
631
|
-
var _a;
|
|
632
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
633
|
-
const mappingResponse = yield this.query.coin.WrapperMappings({});
|
|
634
|
-
Object.assign(this.wrapperMap, (_a = mappingResponse.wrapperMappings) !== null && _a !== void 0 ? _a : {});
|
|
635
|
-
return this.wrapperMap;
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
reloadDenomGeckoMap() {
|
|
639
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
640
|
-
const geckoTokensDenomToCoinIdMap = (yield this.getDenomToGeckoIdMap());
|
|
641
|
-
for (const geckoDenom in geckoTokensDenomToCoinIdMap) {
|
|
642
|
-
this.geckoTokenNames[geckoDenom] = geckoTokensDenomToCoinIdMap[geckoDenom];
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
reloadUSDValues(denoms = Object.keys(this.tokens)) {
|
|
647
|
-
var _a, _b;
|
|
648
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
649
|
-
this.usdValues.iusd = number_1.BN_ONE;
|
|
650
|
-
this.usdValues.cgusd = number_1.BN_ONE;
|
|
651
|
-
//Get corresponding geckoId for denoms and removes any duplicated geckoIds (espeically for different wrapped tokens as they correspond to the same geckoId(same price))
|
|
652
|
-
const geckoIds = denoms.reduce((coinIds, denom) => {
|
|
653
|
-
// To ensure that ibc denoms are not added to the gecko ids list, the default is removed.
|
|
654
|
-
const geckoId = this.geckoTokenNames[denom];
|
|
655
|
-
if (geckoId && !coinIds.includes(geckoId)) {
|
|
656
|
-
coinIds.push(geckoId);
|
|
657
|
-
}
|
|
658
|
-
return coinIds;
|
|
659
|
-
}, []);
|
|
660
|
-
const geckoIdToUsdPriceMap = yield this.getUSDValuesFromCoinGecko(geckoIds);
|
|
661
|
-
const carbonTokenPrices = yield this.getUSDValuesFromPricingModule();
|
|
662
|
-
const uscStablecoin = this.getNativeStablecoin();
|
|
663
|
-
// add carbon token prices first
|
|
664
|
-
Object.entries(carbonTokenPrices).forEach(([key, value]) => {
|
|
665
|
-
this.usdValues[key] = value;
|
|
666
|
-
});
|
|
667
|
-
//store price based on denoms
|
|
668
|
-
for (const denom of denoms) {
|
|
669
|
-
// if token price in pricing module exists for denom, return that as usd price first
|
|
670
|
-
// else check coingecko
|
|
671
|
-
if (this.usdValues[denom])
|
|
672
|
-
continue;
|
|
673
|
-
const coinId = (_a = this.geckoTokenNames[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
674
|
-
const price = util_1.NumberUtils.bnOrZero((_b = geckoIdToUsdPriceMap === null || geckoIdToUsdPriceMap === void 0 ? void 0 : geckoIdToUsdPriceMap[coinId]) === null || _b === void 0 ? void 0 : _b.usd);
|
|
675
|
-
if (price.gt(0)) {
|
|
676
|
-
// if denom is usc, then return uscUsdValue, else return coingecko usd price
|
|
677
|
-
this.usdValues[denom] = denom === (uscStablecoin === null || uscStablecoin === void 0 ? void 0 : uscStablecoin.denom) ? constant_1.uscUsdValue : price;
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
if (!this.initialUsdValuesLoaded)
|
|
681
|
-
this.initialUsdValuesLoaded = true;
|
|
682
|
-
return this.usdValues;
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
getUSDValuesFromCoinGecko(geckoIds) {
|
|
686
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
687
|
-
const response = yield util_1.FetchUtils.fetch(`https://coingecko-proxy.dem.exchange/api/v3/simple/price?ids=${geckoIds.join(",")}&vs_currencies=usd`);
|
|
688
|
-
return yield response.json();
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
processTokenPrices(tokenPrices) {
|
|
692
|
-
return tokenPrices.reduce((prevPrices, price) => {
|
|
693
|
-
const newPrev = prevPrices;
|
|
694
|
-
newPrev[price.denom] =
|
|
695
|
-
return newPrev;
|
|
696
|
-
}, {});
|
|
697
|
-
}
|
|
698
|
-
getUSDValuesFromPricingModule() {
|
|
699
|
-
var _a, _b, _c, _d;
|
|
700
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
-
const initTokenPrices = yield this.query.pricing.TokenPriceAll({
|
|
702
|
-
pagination: {
|
|
703
|
-
limit: new long_1.default(10000),
|
|
704
|
-
offset: new long_1.default(0),
|
|
705
|
-
key: new Uint8Array(),
|
|
706
|
-
countTotal: true,
|
|
707
|
-
reverse: false,
|
|
708
|
-
},
|
|
709
|
-
});
|
|
710
|
-
if (((_a = initTokenPrices.pagination) === null || _a === void 0 ? void 0 : _a.total) && ((_b = initTokenPrices.pagination) === null || _b === void 0 ? void 0 : _b.total.lt(10000))) {
|
|
711
|
-
const tokenPricesMap = this.processTokenPrices(initTokenPrices.tokenPrices);
|
|
712
|
-
return tokenPricesMap;
|
|
713
|
-
}
|
|
714
|
-
const fullTokenPrices = yield this.query.pricing.TokenPriceAll({
|
|
715
|
-
pagination: {
|
|
716
|
-
limit: (_d = (_c = initTokenPrices.pagination) === null || _c === void 0 ? void 0 : _c.total) !== null && _d !== void 0 ? _d : new long_1.default(0),
|
|
717
|
-
offset: new long_1.default(0),
|
|
718
|
-
key: new Uint8Array(),
|
|
719
|
-
countTotal: true,
|
|
720
|
-
reverse: false,
|
|
721
|
-
},
|
|
722
|
-
});
|
|
723
|
-
return this.processTokenPrices(fullTokenPrices.tokenPrices);
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
getDenomToGeckoIdMap() {
|
|
727
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
728
|
-
const networkConfig = this.configProvider.getConfig();
|
|
729
|
-
const insights = new InsightsQueryClient_1.default(networkConfig);
|
|
730
|
-
const response = yield insights.DenomToGeckoIdMap();
|
|
731
|
-
const tokens = response.result.gecko;
|
|
732
|
-
return tokens;
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
setCommonAssetConfig() {
|
|
736
|
-
// whitelisted ibc tokens
|
|
737
|
-
ibc_1.ibcWhitelist.forEach((chainId) => {
|
|
738
|
-
var _a;
|
|
739
|
-
const currencies = util_1.IBCUtils.EmbedChainInfos[chainId].currencies;
|
|
740
|
-
const channelObj = (_a = ibc_1.swthChannels[chainId]) === null || _a === void 0 ? void 0 : _a.ibc;
|
|
741
|
-
currencies.forEach((asset) => {
|
|
742
|
-
var _a, _b;
|
|
743
|
-
const channel = asset.coinMinimalDenom !== "swth" ? (_a = channelObj === null || channelObj === void 0 ? void 0 : channelObj.sourceChannel) !== null && _a !== void 0 ? _a : "channel-0" : (_b = channelObj === null || channelObj === void 0 ? void 0 : channelObj.dstChannel) !== null && _b !== void 0 ? _b : "channel-0";
|
|
744
|
-
const assetDenom = TokenClient.isIBCDenom(asset.coinMinimalDenom)
|
|
745
|
-
? asset.coinMinimalDenom
|
|
746
|
-
: util_1.IBCUtils.makeIBCMinimalDenom(channel, asset.coinMinimalDenom);
|
|
747
|
-
const symbolSmall = asset.coinDenom.toLowerCase();
|
|
748
|
-
if (!this.commonAssetNames[assetDenom])
|
|
749
|
-
this.commonAssetNames[assetDenom] = symbolSmall;
|
|
750
|
-
if (asset.coinGeckoId && !this.geckoTokenNames[symbolSmall])
|
|
751
|
-
this.geckoTokenNames[symbolSmall] = asset.coinGeckoId;
|
|
752
|
-
});
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
TokenClient.Blacklist = constant_1.TokenBlacklist;
|
|
757
|
-
exports.default = TokenClient;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const pagination_1 = require("../codec/cosmos/base/query/v1beta1/pagination");
|
|
16
|
+
const tendermint_1 = require("../codec/ibc/lightclients/tendermint/v1/tendermint");
|
|
17
|
+
const constant_1 = require("../constant");
|
|
18
|
+
const ibc_1 = require("../constant/ibc");
|
|
19
|
+
const util_1 = require("../util");
|
|
20
|
+
const blockchain_1 = require("../util/blockchain");
|
|
21
|
+
const number_1 = require("../util/number");
|
|
22
|
+
const long_1 = __importDefault(require("long"));
|
|
23
|
+
const InsightsQueryClient_1 = __importDefault(require("./InsightsQueryClient"));
|
|
24
|
+
const SYMBOL_OVERRIDE = {
|
|
25
|
+
swth: "SWTH",
|
|
26
|
+
NNEO: "nNEO",
|
|
27
|
+
YAM1: "YAM",
|
|
28
|
+
YAM2: "YAM",
|
|
29
|
+
ASA1: "ASA",
|
|
30
|
+
ASA2: "ASA",
|
|
31
|
+
DBC1: "DBC",
|
|
32
|
+
DBC2: "DBC",
|
|
33
|
+
AVA1: "AVA",
|
|
34
|
+
TSWTH: "tSWTH",
|
|
35
|
+
"cibStride Liquid Staked LUNA": "cibstLUNA",
|
|
36
|
+
};
|
|
37
|
+
const regexCdpDenom = RegExp(`^${constant_1.DenomPrefix.CDPToken}/`, "i");
|
|
38
|
+
const regexLPDenom = RegExp(`^${constant_1.DenomPrefix.LPToken}/(\\d+)$`, "i");
|
|
39
|
+
const onError = (error) => {
|
|
40
|
+
console.error("failed to reload usd values");
|
|
41
|
+
console.error(error);
|
|
42
|
+
};
|
|
43
|
+
class TokenClient {
|
|
44
|
+
constructor(query, configProvider) {
|
|
45
|
+
this.query = query;
|
|
46
|
+
this.configProvider = configProvider;
|
|
47
|
+
this.tokens = {};
|
|
48
|
+
this.wrapperMap = {};
|
|
49
|
+
this.poolTokens = {};
|
|
50
|
+
this.cdpTokens = {};
|
|
51
|
+
this.bridges = { polynetwork: [], ibc: [], axelar: [] };
|
|
52
|
+
this.symbols = {};
|
|
53
|
+
this.usdValues = {};
|
|
54
|
+
this.commonAssetNames = constant_1.CommonAssetName;
|
|
55
|
+
this.geckoTokenNames = constant_1.CoinGeckoTokenNames;
|
|
56
|
+
this.initialUsdValuesLoaded = false;
|
|
57
|
+
this.additionalGeckoDenoms = {};
|
|
58
|
+
this.getIbcBridgeFromBlockchainV2 = (blockchain) => {
|
|
59
|
+
return this.bridges.ibc.find(bridge => (bridge.chainName === blockchain || bridge.chainName.toLowerCase() === blockchain));
|
|
60
|
+
};
|
|
61
|
+
this.getIbcChainFromBlockchainV2 = (blockchain) => {
|
|
62
|
+
const ibcBridge = this.getIbcBridgeFromBlockchainV2(blockchain);
|
|
63
|
+
return ibcBridge === null || ibcBridge === void 0 ? void 0 : ibcBridge.chain_id_name;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static instance(query, configProvider) {
|
|
67
|
+
return new TokenClient(query, configProvider);
|
|
68
|
+
}
|
|
69
|
+
initialize() {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
this.setCommonAssetConfig();
|
|
72
|
+
try {
|
|
73
|
+
yield Promise.all([
|
|
74
|
+
this.reloadTokens(),
|
|
75
|
+
this.reloadWrapperMap(),
|
|
76
|
+
this.getBridges(),
|
|
77
|
+
]);
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
// non-blocking reload
|
|
81
|
+
this.reloadDenomGeckoMap().catch(onError).finally(() => {
|
|
82
|
+
this.reloadUSDValues().catch(onError);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
registerGeckoIdMap(map) {
|
|
88
|
+
this.additionalGeckoDenoms = Object.assign(Object.assign({}, this.additionalGeckoDenoms), map);
|
|
89
|
+
}
|
|
90
|
+
getCommonDenom(denom) {
|
|
91
|
+
var _a;
|
|
92
|
+
return (_a = this.commonAssetNames[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
93
|
+
}
|
|
94
|
+
getDecimals(denom) {
|
|
95
|
+
var _a, _b, _c;
|
|
96
|
+
return (_c = ((_b = (_a = this.tokens[denom]) !== null && _a !== void 0 ? _a : this.poolTokens[denom]) !== null && _b !== void 0 ? _b : this.cdpTokens[denom])) === null || _c === void 0 ? void 0 : _c.decimals.toNumber();
|
|
97
|
+
}
|
|
98
|
+
getBlockchain(denom) {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
const networkConfig = this.configProvider.getConfig();
|
|
101
|
+
const tokenData = this.tokens[denom];
|
|
102
|
+
// chainId defaults to 3 so that blockchain will be undefined
|
|
103
|
+
let chainId = (_b = (_a = tokenData === null || tokenData === void 0 ? void 0 : tokenData.chainId) === null || _a === void 0 ? void 0 : _a.toNumber()) !== null && _b !== void 0 ? _b : 3;
|
|
104
|
+
if (this.isNativeToken(denom) || this.isNativeStablecoin(denom) || TokenClient.isPoolToken(denom) || TokenClient.isCdpToken(denom)) {
|
|
105
|
+
// native denoms "swth" and "usc" should be native.
|
|
106
|
+
// pool and cdp tokens are on the Native blockchain, hence 0
|
|
107
|
+
chainId = 0;
|
|
108
|
+
}
|
|
109
|
+
if (TokenClient.isIBCDenom(denom)) {
|
|
110
|
+
return util_1.IBCUtils.BlockchainMap[denom];
|
|
111
|
+
}
|
|
112
|
+
const blockchain = util_1.BlockchainUtils.blockchainForChainId(chainId, networkConfig.network);
|
|
113
|
+
return blockchain;
|
|
114
|
+
}
|
|
115
|
+
getBlockchainV2(denom) {
|
|
116
|
+
var _a;
|
|
117
|
+
if (!denom)
|
|
118
|
+
return undefined;
|
|
119
|
+
const token = this.tokens[denom];
|
|
120
|
+
if (this.isNativeToken(denom) || this.isNativeStablecoin(denom) || TokenClient.isPoolToken(denom) || TokenClient.isCdpToken(denom) || this.isGroupedToken(denom)) {
|
|
121
|
+
// native denoms "swth" and "usc" should be native.
|
|
122
|
+
// pool and cdp tokens are on the Native blockchain, hence 0
|
|
123
|
+
return 'Native';
|
|
124
|
+
}
|
|
125
|
+
if (this.isBridgedToken(denom)) {
|
|
126
|
+
// brdg tokens will all be chain_id 0 which will also be deprecated in future
|
|
127
|
+
// hence for brdg tokens cannot use chain_id to differentiate between blockchains
|
|
128
|
+
const bridgeList = this.bridges.axelar;
|
|
129
|
+
const chainName = (_a = bridgeList.find((bridge) => bridge.bridgeAddress === token.bridgeAddress)) === null || _a === void 0 ? void 0 : _a.chainName;
|
|
130
|
+
return chainName;
|
|
131
|
+
}
|
|
132
|
+
const bridge = this.getBridgeFromToken(token);
|
|
133
|
+
return bridge === null || bridge === void 0 ? void 0 : bridge.chainName;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* use getTokenName directly instead
|
|
137
|
+
* @deprecated
|
|
138
|
+
*/
|
|
139
|
+
getSymbol(denom) {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
if (TokenClient.isCdpToken(denom)) {
|
|
142
|
+
return (_a = this.symbols[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
143
|
+
}
|
|
144
|
+
const commonDenom = this.getCommonDenom(denom);
|
|
145
|
+
return (_b = this.symbols[commonDenom]) !== null && _b !== void 0 ? _b : commonDenom.toUpperCase();
|
|
146
|
+
}
|
|
147
|
+
getUSDValue(denom) {
|
|
148
|
+
return this.usdValues[denom];
|
|
149
|
+
}
|
|
150
|
+
toHuman(denom, unitlessAmt) {
|
|
151
|
+
var _a;
|
|
152
|
+
const decimals = this.getDecimals(denom);
|
|
153
|
+
return (_a = util_1.NumberUtils.toHuman(unitlessAmt, decimals)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
154
|
+
}
|
|
155
|
+
toUnitless(denom, humanAmt) {
|
|
156
|
+
var _a;
|
|
157
|
+
const decimals = this.getDecimals(denom);
|
|
158
|
+
return (_a = util_1.NumberUtils.toUnitless(humanAmt, decimals)) !== null && _a !== void 0 ? _a : number_1.BN_ZERO;
|
|
159
|
+
}
|
|
160
|
+
tokenForId(id) {
|
|
161
|
+
let tokensList = Object.values(this.tokens);
|
|
162
|
+
if (TokenClient.isPoolToken(id)) {
|
|
163
|
+
tokensList = Object.values(this.poolTokens);
|
|
164
|
+
}
|
|
165
|
+
else if (TokenClient.isCdpToken(id)) {
|
|
166
|
+
tokensList = Object.values(this.cdpTokens);
|
|
167
|
+
}
|
|
168
|
+
return tokensList.find((token) => token.id === id);
|
|
169
|
+
}
|
|
170
|
+
tokenForDenom(denom) {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
return (_b = (_a = this.poolTokens[denom]) !== null && _a !== void 0 ? _a : this.cdpTokens[denom]) !== null && _b !== void 0 ? _b : this.tokens[denom];
|
|
173
|
+
}
|
|
174
|
+
getFeeInfo(denom) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
const config = this.configProvider.getConfig();
|
|
177
|
+
const url = `${config.hydrogenUrl}/fee_quote?token_denom=${denom}`;
|
|
178
|
+
const requestOptions = {
|
|
179
|
+
method: 'POST',
|
|
180
|
+
headers: {
|
|
181
|
+
'Content-Type': 'application/json',
|
|
182
|
+
},
|
|
183
|
+
body: JSON.stringify({}),
|
|
184
|
+
};
|
|
185
|
+
const result = yield util_1.FetchUtils.fetch(url, requestOptions).then((res) => res.json());
|
|
186
|
+
return result;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
getTokenName(denom, overrideMap) {
|
|
190
|
+
var _a;
|
|
191
|
+
if (typeof denom !== "string")
|
|
192
|
+
return "";
|
|
193
|
+
if (!TokenClient.isIBCDenom(denom) && !TokenClient.isCdpIbcDenom(denom)) {
|
|
194
|
+
denom = denom.toLowerCase();
|
|
195
|
+
}
|
|
196
|
+
const symbol = this.getSymbol(denom);
|
|
197
|
+
if (TokenClient.isPoolTokenLegacy(denom)) {
|
|
198
|
+
const match = symbol.match(/^([a-z\d.-/]+)-(\d+)-([a-z\d.-/]+)-(\d+)-lp\d+$/i);
|
|
199
|
+
// inconsistent implementation of isPoolToken, exit
|
|
200
|
+
if (match === null)
|
|
201
|
+
return symbol;
|
|
202
|
+
const denomA = match[1];
|
|
203
|
+
const denomB = match[3];
|
|
204
|
+
const symbolA = this.getTokenName(denomA);
|
|
205
|
+
const symbolB = this.getTokenName(denomB);
|
|
206
|
+
return `${symbolA}-${symbolB}`;
|
|
207
|
+
}
|
|
208
|
+
if (TokenClient.isIBCDenom(denom)) {
|
|
209
|
+
const splitDenom = denom.split("/");
|
|
210
|
+
denom = `${splitDenom[0].toLowerCase()}/${splitDenom[1].toUpperCase()}`;
|
|
211
|
+
return (_a = this.symbols[denom]) !== null && _a !== void 0 ? _a : denom.toUpperCase();
|
|
212
|
+
}
|
|
213
|
+
if (SYMBOL_OVERRIDE[symbol]) {
|
|
214
|
+
return SYMBOL_OVERRIDE[symbol];
|
|
215
|
+
}
|
|
216
|
+
if (overrideMap === null || overrideMap === void 0 ? void 0 : overrideMap[symbol]) {
|
|
217
|
+
return overrideMap[symbol];
|
|
218
|
+
}
|
|
219
|
+
return symbol;
|
|
220
|
+
}
|
|
221
|
+
getTokenDesc(denom) {
|
|
222
|
+
var _a, _b, _c, _d;
|
|
223
|
+
if (typeof denom !== "string")
|
|
224
|
+
return "";
|
|
225
|
+
denom = denom.toLowerCase();
|
|
226
|
+
if (TokenClient.isPoolTokenLegacy(denom)) {
|
|
227
|
+
const match = denom.match(/^([a-z\d.-/]+)-(\d+)-([a-z\d.-/]+)-(\d+)-lp\d+$/i);
|
|
228
|
+
// inconsistent implementation of isPoolToken, exit
|
|
229
|
+
if (match === null)
|
|
230
|
+
return this.getSymbol(denom);
|
|
231
|
+
const denomA = match[1];
|
|
232
|
+
const weightA = match[2];
|
|
233
|
+
const denomB = match[3];
|
|
234
|
+
const weightB = match[4];
|
|
235
|
+
const symbolA = this.getTokenName(denomA);
|
|
236
|
+
const symbolB = this.getTokenName(denomB);
|
|
237
|
+
return `${weightA}% ${symbolA} / ${weightB}% ${symbolB}`;
|
|
238
|
+
}
|
|
239
|
+
if (TokenClient.isCdpToken(denom)) {
|
|
240
|
+
return (_b = (_a = this.cdpTokens[denom]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : this.getSymbol(denom);
|
|
241
|
+
}
|
|
242
|
+
return (_d = (_c = this.tokens[denom]) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : this.getSymbol(denom);
|
|
243
|
+
}
|
|
244
|
+
static isPoolTokenNew(denom) {
|
|
245
|
+
return denom.match(regexLPDenom) !== null;
|
|
246
|
+
}
|
|
247
|
+
static isPoolTokenLegacy(denom) {
|
|
248
|
+
return denom.match(/^([a-z\d.-]+)-(\d+)-([a-z\d.-]+)-(\d+)-lp\d+$/i) !== null;
|
|
249
|
+
}
|
|
250
|
+
static isCdpToken(denom) {
|
|
251
|
+
return denom.match(regexCdpDenom) !== null;
|
|
252
|
+
}
|
|
253
|
+
static isPoolToken(denom) {
|
|
254
|
+
return this.isPoolTokenNew(denom) || this.isPoolTokenLegacy(denom);
|
|
255
|
+
}
|
|
256
|
+
static isIBCDenom(denom) {
|
|
257
|
+
return denom.match(ibc_1.ibcTokenRegex) !== null;
|
|
258
|
+
}
|
|
259
|
+
static isCdpIbcDenom(denom) {
|
|
260
|
+
return ibc_1.cibtIbcTokenRegex.test(denom);
|
|
261
|
+
}
|
|
262
|
+
isWrappedToken(denom) {
|
|
263
|
+
return !!this.wrapperMap[denom !== null && denom !== void 0 ? denom : ""];
|
|
264
|
+
}
|
|
265
|
+
hasWrappedToken(denom) {
|
|
266
|
+
return Object.values(this.wrapperMap).includes(denom !== null && denom !== void 0 ? denom : "");
|
|
267
|
+
}
|
|
268
|
+
getWrappedTokens(denom) {
|
|
269
|
+
const result = [];
|
|
270
|
+
if (!this.tokens)
|
|
271
|
+
return result;
|
|
272
|
+
// check if denom is source token
|
|
273
|
+
if (Object.values(this.wrapperMap).includes(denom)) {
|
|
274
|
+
for (const [wrappedDenom, sourceDenom] of Object.entries(this.wrapperMap)) {
|
|
275
|
+
// if mapping is not relevant to current source denom, skip.
|
|
276
|
+
if (sourceDenom !== denom) {
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
// add wrapped to result list
|
|
280
|
+
const token = this.tokens[wrappedDenom];
|
|
281
|
+
if (token) {
|
|
282
|
+
result.push(token);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return result;
|
|
287
|
+
}
|
|
288
|
+
getWrappedToken(denom, blockchain, version = 'V1') {
|
|
289
|
+
// if denom is already a wrapped denom or no blockchain was specified,
|
|
290
|
+
// just return the input denom.
|
|
291
|
+
if (this.wrapperMap[denom] || !blockchain) {
|
|
292
|
+
return this.tokens[denom];
|
|
293
|
+
}
|
|
294
|
+
// check if denom is source token
|
|
295
|
+
if (Object.values(this.wrapperMap).includes(denom)) {
|
|
296
|
+
for (const [wrappedDenom, sourceDenom] of Object.entries(this.wrapperMap)) {
|
|
297
|
+
// if mapping is not relevant to current source denom, skip.
|
|
298
|
+
if (sourceDenom !== denom) {
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
// check if wrapped denom is of correct blockchain
|
|
302
|
+
const token = this.tokens[wrappedDenom];
|
|
303
|
+
let tokenChain = '';
|
|
304
|
+
if (version === "V1") {
|
|
305
|
+
tokenChain = util_1.BlockchainUtils.blockchainForChainId(token.chainId.toNumber());
|
|
306
|
+
if (TokenClient.isIBCDenom(token.denom)) {
|
|
307
|
+
tokenChain = util_1.IBCUtils.BlockchainMap[wrappedDenom];
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
tokenChain = this.getBlockchainV2(token.denom);
|
|
312
|
+
}
|
|
313
|
+
if (!tokenChain) {
|
|
314
|
+
continue; // unknown chain! just ignore this source token
|
|
315
|
+
}
|
|
316
|
+
if (tokenChain === blockchain) {
|
|
317
|
+
return token;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
getSourceToken(denom) {
|
|
324
|
+
// check if denom is source token
|
|
325
|
+
if (Object.values(this.wrapperMap).includes(denom)) {
|
|
326
|
+
return this.tokens[denom];
|
|
327
|
+
}
|
|
328
|
+
// check if denom is wrapped token
|
|
329
|
+
if (this.wrapperMap[denom]) {
|
|
330
|
+
const sourceDenom = this.wrapperMap[denom];
|
|
331
|
+
return this.tokens[sourceDenom];
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
getNativeToken() {
|
|
336
|
+
return this.tokenForId("swth");
|
|
337
|
+
}
|
|
338
|
+
getNativeStablecoin() {
|
|
339
|
+
return this.tokenForId("usc");
|
|
340
|
+
}
|
|
341
|
+
isNativeToken(denom) {
|
|
342
|
+
return denom === "swth";
|
|
343
|
+
}
|
|
344
|
+
isNativeStablecoin(denom) {
|
|
345
|
+
return denom === "usc";
|
|
346
|
+
}
|
|
347
|
+
isGroupedToken(denom) {
|
|
348
|
+
const groupedTokenRegex = new RegExp(/^cgt\/\d+$/);
|
|
349
|
+
return groupedTokenRegex.test(denom);
|
|
350
|
+
}
|
|
351
|
+
isBridgedToken(denom) {
|
|
352
|
+
const bridgedTokenRegex = new RegExp(/^brdg\//);
|
|
353
|
+
return bridgedTokenRegex.test(denom);
|
|
354
|
+
}
|
|
355
|
+
isCarbonToken(token) {
|
|
356
|
+
return Boolean(token && (this.isNativeToken(token.denom) || token.bridgeId.eq(0)));
|
|
357
|
+
}
|
|
358
|
+
getDepositTokenFor(tokenDenom, chain, version = "V1") {
|
|
359
|
+
const networkConfig = this.configProvider.getConfig();
|
|
360
|
+
const token = this.tokenForDenom(tokenDenom);
|
|
361
|
+
if (!token) {
|
|
362
|
+
console.debug("getDepositTokenFor token not found for", tokenDenom);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
let targetChain = "";
|
|
366
|
+
// check if selected token is a source token
|
|
367
|
+
if (version === "V1") {
|
|
368
|
+
targetChain = util_1.BlockchainUtils.blockchainForChainId(token.chainId.toNumber(), networkConfig.network);
|
|
369
|
+
if (TokenClient.isIBCDenom(token.denom)) {
|
|
370
|
+
targetChain = util_1.IBCUtils.BlockchainMap[token.denom];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
targetChain = this.getBlockchainV2(token.denom);
|
|
375
|
+
}
|
|
376
|
+
const isSourceToken = targetChain === chain && token.denom !== "swth";
|
|
377
|
+
// if not source token find wrapped token for chain
|
|
378
|
+
const depositToken = isSourceToken ? token : this.getWrappedToken(token.denom, chain, version);
|
|
379
|
+
if (!depositToken) {
|
|
380
|
+
console.debug(`getDepositTokenFor wrapped token not found for "${token.denom}"`);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
return depositToken;
|
|
384
|
+
}
|
|
385
|
+
getAllTokens() {
|
|
386
|
+
var _a;
|
|
387
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
388
|
+
const result = yield this.query.coin.TokenAll({
|
|
389
|
+
pagination: {
|
|
390
|
+
limit: new long_1.default(10000),
|
|
391
|
+
offset: long_1.default.UZERO,
|
|
392
|
+
key: new Uint8Array(),
|
|
393
|
+
countTotal: false,
|
|
394
|
+
reverse: false,
|
|
395
|
+
},
|
|
396
|
+
});
|
|
397
|
+
const networkConfig = this.configProvider.getConfig();
|
|
398
|
+
const tokenBlacklist = (_a = constant_1.TokenBlacklist[networkConfig.network]) !== null && _a !== void 0 ? _a : [];
|
|
399
|
+
return result.tokens.filter((token) => !tokenBlacklist.includes(token.denom));
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
reloadTokens() {
|
|
403
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
404
|
+
const tokenResponse = yield this.getAllTokens();
|
|
405
|
+
for (const token of tokenResponse) {
|
|
406
|
+
if (TokenClient.isPoolToken(token.denom)) {
|
|
407
|
+
this.poolTokens[token.denom] = token;
|
|
408
|
+
}
|
|
409
|
+
else if (TokenClient.isCdpToken(token.denom)) {
|
|
410
|
+
this.cdpTokens[token.denom] = token;
|
|
411
|
+
this.symbols[token.denom] = token.symbol;
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
if (this.isNativeToken(token.denom)) {
|
|
415
|
+
// Change token name to Carbon
|
|
416
|
+
token.name = "Carbon";
|
|
417
|
+
}
|
|
418
|
+
this.tokens[token.denom] = token;
|
|
419
|
+
this.symbols[token.denom] = token.symbol;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return this.tokens;
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
getBridges() {
|
|
426
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
427
|
+
const allBridges = yield this.query.coin.BridgeAll({
|
|
428
|
+
pagination: {
|
|
429
|
+
key: new Uint8Array(),
|
|
430
|
+
limit: new long_1.default(10000),
|
|
431
|
+
offset: long_1.default.UZERO,
|
|
432
|
+
countTotal: true,
|
|
433
|
+
reverse: false,
|
|
434
|
+
},
|
|
435
|
+
});
|
|
436
|
+
const unmatchedIbcBridgeList = allBridges.bridges.filter(bridge => {
|
|
437
|
+
if (!bridge.enabled)
|
|
438
|
+
return;
|
|
439
|
+
return bridge.bridgeId.toNumber() === blockchain_1.BRIDGE_IDS.ibc;
|
|
440
|
+
});
|
|
441
|
+
const ibcBridges = yield this.matchChainsWithDifferentChainIds(unmatchedIbcBridgeList);
|
|
442
|
+
const axelarBridges = yield this.mapBridgesFromConnections();
|
|
443
|
+
const polynetworkBridges = allBridges.bridges.reduce((prev, bridge) => {
|
|
444
|
+
if (bridge.bridgeId.toNumber() !== blockchain_1.BRIDGE_IDS.polynetwork)
|
|
445
|
+
return prev;
|
|
446
|
+
prev.push(Object.assign(Object.assign({}, bridge), { isEvmChain: util_1.BlockchainUtils.isEvmChain(bridge.chainName) }));
|
|
447
|
+
return prev;
|
|
448
|
+
}, []);
|
|
449
|
+
Object.assign(this.bridges, {
|
|
450
|
+
polynetwork: polynetworkBridges,
|
|
451
|
+
ibc: ibcBridges,
|
|
452
|
+
axelar: axelarBridges,
|
|
453
|
+
});
|
|
454
|
+
return this.bridges;
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
matchChainsWithDifferentChainIds(bridges) {
|
|
458
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
+
let newBridges = [];
|
|
460
|
+
try {
|
|
461
|
+
const pagination = pagination_1.PageRequest.fromPartial({ limit: new long_1.default(1e6) });
|
|
462
|
+
const results = yield Promise.all([
|
|
463
|
+
this.query.ibc.channel.Channels({ pagination }),
|
|
464
|
+
this.query.ibc.connection.Connections({ pagination }),
|
|
465
|
+
this.query.ibc.client.ClientStates({ pagination }),
|
|
466
|
+
]);
|
|
467
|
+
const [{ channels }, { connections }, { clientStates: rawClientStates }] = results;
|
|
468
|
+
const clientStates = rawClientStates.map(s => ({
|
|
469
|
+
clientState: tendermint_1.ClientState.decode(s.clientState.value),
|
|
470
|
+
clientId: s.clientId,
|
|
471
|
+
}));
|
|
472
|
+
newBridges = bridges.map(bridge => {
|
|
473
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
474
|
+
const connection = channels.find(channel => channel.channelId === ("channel-" + (bridge.chainId.toNumber() - 1)));
|
|
475
|
+
const connectionId = connection === null || connection === void 0 ? void 0 : connection.connectionHops[0];
|
|
476
|
+
const src_channel = (_a = connection === null || connection === void 0 ? void 0 : connection.channelId) !== null && _a !== void 0 ? _a : "";
|
|
477
|
+
const dst_channel = (_c = (_b = connection === null || connection === void 0 ? void 0 : connection.counterparty) === null || _b === void 0 ? void 0 : _b.channelId) !== null && _c !== void 0 ? _c : "";
|
|
478
|
+
const cosmRegexArr = (_e = (_d = connection === null || connection === void 0 ? void 0 : connection.counterparty) === null || _d === void 0 ? void 0 : _d.portId) === null || _e === void 0 ? void 0 : _e.match(ibc_1.cosmBridgeRegex);
|
|
479
|
+
const portId = (_f = cosmRegexArr === null || cosmRegexArr === void 0 ? void 0 : cosmRegexArr[1]) !== null && _f !== void 0 ? _f : "transfer";
|
|
480
|
+
const clientId = (_g = connections.find(connection => connection.id === connectionId)) === null || _g === void 0 ? void 0 : _g.clientId;
|
|
481
|
+
const chainIdName = (_j = ((_h = clientStates.find(client => client.clientId === clientId)) === null || _h === void 0 ? void 0 : _h.clientState)) === null || _j === void 0 ? void 0 : _j.chainId;
|
|
482
|
+
return Object.assign(Object.assign({}, bridge), { chain_id_name: chainIdName !== null && chainIdName !== void 0 ? chainIdName : "", channels: { src_channel, dst_channel, port_id: portId } });
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
finally {
|
|
486
|
+
const checkedBefore = new Array(newBridges.length).fill(false);
|
|
487
|
+
const chainMap = {};
|
|
488
|
+
for (let i = 0; i < newBridges.length; i++) {
|
|
489
|
+
if (checkedBefore[i])
|
|
490
|
+
continue;
|
|
491
|
+
const bridge = newBridges[i];
|
|
492
|
+
const chainId = bridge.chain_id_name;
|
|
493
|
+
if (chainMap[chainId]) {
|
|
494
|
+
const chainName = chainMap[chainId];
|
|
495
|
+
for (let j = i; j < newBridges.length; j++) {
|
|
496
|
+
const subBridge = newBridges[j];
|
|
497
|
+
if (subBridge.chain_id_name === chainId) {
|
|
498
|
+
subBridge.chainName = chainName;
|
|
499
|
+
checkedBefore[j] = true;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
chainMap[chainId] = bridge.chainName;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return newBridges;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
mapBridgesFromConnections() {
|
|
512
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
513
|
+
const newBridges = [];
|
|
514
|
+
try {
|
|
515
|
+
const results = yield this.query.bridge.ConnectionAll({
|
|
516
|
+
bridgeId: new long_1.default(0),
|
|
517
|
+
pagination: pagination_1.PageRequest.fromPartial({
|
|
518
|
+
limit: new long_1.default(10000),
|
|
519
|
+
}),
|
|
520
|
+
});
|
|
521
|
+
const connections = results.connections;
|
|
522
|
+
connections.forEach(connection => {
|
|
523
|
+
newBridges.push({
|
|
524
|
+
name: `${connection.chainDisplayName} via Axelar`,
|
|
525
|
+
bridgeId: new long_1.default(blockchain_1.BRIDGE_IDS.axelar),
|
|
526
|
+
chainId: new long_1.default(blockchain_1.BRIDGE_IDS.axelar),
|
|
527
|
+
bridgeAddress: connection.connectionId,
|
|
528
|
+
chain_id_name: connection.chainId,
|
|
529
|
+
chainName: connection.chainDisplayName,
|
|
530
|
+
bridgeName: 'Axelar',
|
|
531
|
+
bridgeAddresses: [],
|
|
532
|
+
enabled: connection.isEnabled,
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
catch (err) {
|
|
537
|
+
console.error(err);
|
|
538
|
+
}
|
|
539
|
+
finally {
|
|
540
|
+
const chainMap = {};
|
|
541
|
+
newBridges.forEach((bridge) => {
|
|
542
|
+
const chainId = bridge.chain_id_name;
|
|
543
|
+
if (chainMap[chainId]) {
|
|
544
|
+
bridge.chainName = chainMap[chainId];
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
chainMap[chainId] = bridge.chainName;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
return newBridges;
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
getIbcBlockchainNames() {
|
|
555
|
+
return this.bridges.ibc.map(bridge => bridge.chainName);
|
|
556
|
+
}
|
|
557
|
+
getAxelarBlockchainNames() {
|
|
558
|
+
return this.bridges.axelar.map(bridge => bridge.chainName);
|
|
559
|
+
}
|
|
560
|
+
getPolynetworkBlockchainNames() {
|
|
561
|
+
return this.bridges.polynetwork.map(bridge => bridge.chainName);
|
|
562
|
+
}
|
|
563
|
+
getAllBlockchainNames() {
|
|
564
|
+
return this.getIbcBlockchainNames().concat(this.getPolynetworkBlockchainNames()).concat(this.getAxelarBlockchainNames());
|
|
565
|
+
}
|
|
566
|
+
getBridgesFromBridgeId(bridgeId) {
|
|
567
|
+
switch (bridgeId) {
|
|
568
|
+
case blockchain_1.BRIDGE_IDS.polynetwork:
|
|
569
|
+
return this.bridges.polynetwork;
|
|
570
|
+
case blockchain_1.BRIDGE_IDS.ibc:
|
|
571
|
+
return this.bridges.ibc;
|
|
572
|
+
case blockchain_1.BRIDGE_IDS.axelar:
|
|
573
|
+
return this.bridges.axelar;
|
|
574
|
+
default:
|
|
575
|
+
return this.bridges.polynetwork;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
getIbcTokens() {
|
|
579
|
+
const ibcTokens = Object.values(this.tokens).reduce((prev, token) => {
|
|
580
|
+
const newPrev = prev;
|
|
581
|
+
if (token.bridgeId.toNumber() === blockchain_1.BRIDGE_IDS.ibc) {
|
|
582
|
+
newPrev[token.denom] = token;
|
|
583
|
+
}
|
|
584
|
+
return newPrev;
|
|
585
|
+
}, {});
|
|
586
|
+
return ibcTokens;
|
|
587
|
+
}
|
|
588
|
+
getPolyNetworkTokens() {
|
|
589
|
+
const polynetworkTokens = Object.values(this.tokens).reduce((prev, token) => {
|
|
590
|
+
const newPrev = prev;
|
|
591
|
+
if (token.bridgeId.toNumber() === blockchain_1.BRIDGE_IDS.polynetwork) {
|
|
592
|
+
newPrev[token.denom] = token;
|
|
593
|
+
}
|
|
594
|
+
return newPrev;
|
|
595
|
+
}, {});
|
|
596
|
+
return polynetworkTokens;
|
|
597
|
+
}
|
|
598
|
+
getBlockchainV2FromIDs(chainId, bridgeId) {
|
|
599
|
+
var _a, _b;
|
|
600
|
+
if ((chainId === 5 && bridgeId === 1) || (chainId === 0 && bridgeId === 2))
|
|
601
|
+
return "Carbon";
|
|
602
|
+
const bridgeList = this.getBridgesFromBridgeId(bridgeId);
|
|
603
|
+
return (_b = (_a = bridgeList.find(bridge => bridge.chainId.toNumber() === chainId)) === null || _a === void 0 ? void 0 : _a.chainName) !== null && _b !== void 0 ? _b : undefined;
|
|
604
|
+
}
|
|
605
|
+
getBridgeFromToken(token) {
|
|
606
|
+
if (!token || !token.bridgeId)
|
|
607
|
+
return undefined;
|
|
608
|
+
const bridgeList = this.getBridgesFromBridgeId(token.bridgeId.toNumber());
|
|
609
|
+
return bridgeList.find(bridge => token.chainId.equals(bridge.chainId));
|
|
610
|
+
}
|
|
611
|
+
getIbcChainIdFromToken(token) {
|
|
612
|
+
if (!token)
|
|
613
|
+
return undefined;
|
|
614
|
+
const bridge = this.getBridgeFromToken(token);
|
|
615
|
+
if (!bridge || !blockchain_1.isIbcBridge(bridge))
|
|
616
|
+
return undefined;
|
|
617
|
+
return bridge.chain_id_name;
|
|
618
|
+
}
|
|
619
|
+
getCdpUnderlyingToken(cdpDenom) {
|
|
620
|
+
if (!this.cdpTokens[cdpDenom]) {
|
|
621
|
+
console.error("not a CDP denom");
|
|
622
|
+
return undefined;
|
|
623
|
+
}
|
|
624
|
+
const tokenDenom = cdpDenom.replace(regexCdpDenom, "");
|
|
625
|
+
if (TokenClient.isPoolToken(tokenDenom)) {
|
|
626
|
+
return this.poolTokens[tokenDenom];
|
|
627
|
+
}
|
|
628
|
+
return this.tokenForDenom(tokenDenom);
|
|
629
|
+
}
|
|
630
|
+
reloadWrapperMap() {
|
|
631
|
+
var _a;
|
|
632
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
633
|
+
const mappingResponse = yield this.query.coin.WrapperMappings({});
|
|
634
|
+
Object.assign(this.wrapperMap, (_a = mappingResponse.wrapperMappings) !== null && _a !== void 0 ? _a : {});
|
|
635
|
+
return this.wrapperMap;
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
reloadDenomGeckoMap() {
|
|
639
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
640
|
+
const geckoTokensDenomToCoinIdMap = (yield this.getDenomToGeckoIdMap());
|
|
641
|
+
for (const geckoDenom in geckoTokensDenomToCoinIdMap) {
|
|
642
|
+
this.geckoTokenNames[geckoDenom] = geckoTokensDenomToCoinIdMap[geckoDenom];
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
reloadUSDValues(denoms = Object.keys(this.tokens)) {
|
|
647
|
+
var _a, _b;
|
|
648
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
649
|
+
this.usdValues.iusd = number_1.BN_ONE;
|
|
650
|
+
this.usdValues.cgusd = number_1.BN_ONE;
|
|
651
|
+
//Get corresponding geckoId for denoms and removes any duplicated geckoIds (espeically for different wrapped tokens as they correspond to the same geckoId(same price))
|
|
652
|
+
const geckoIds = denoms.reduce((coinIds, denom) => {
|
|
653
|
+
// To ensure that ibc denoms are not added to the gecko ids list, the default is removed.
|
|
654
|
+
const geckoId = this.geckoTokenNames[denom];
|
|
655
|
+
if (geckoId && !coinIds.includes(geckoId)) {
|
|
656
|
+
coinIds.push(geckoId);
|
|
657
|
+
}
|
|
658
|
+
return coinIds;
|
|
659
|
+
}, []);
|
|
660
|
+
const geckoIdToUsdPriceMap = yield this.getUSDValuesFromCoinGecko(geckoIds);
|
|
661
|
+
const carbonTokenPrices = yield this.getUSDValuesFromPricingModule();
|
|
662
|
+
const uscStablecoin = this.getNativeStablecoin();
|
|
663
|
+
// add carbon token prices first
|
|
664
|
+
Object.entries(carbonTokenPrices).forEach(([key, value]) => {
|
|
665
|
+
this.usdValues[key] = value;
|
|
666
|
+
});
|
|
667
|
+
//store price based on denoms
|
|
668
|
+
for (const denom of denoms) {
|
|
669
|
+
// if token price in pricing module exists for denom, return that as usd price first
|
|
670
|
+
// else check coingecko
|
|
671
|
+
if (this.usdValues[denom])
|
|
672
|
+
continue;
|
|
673
|
+
const coinId = (_a = this.geckoTokenNames[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
674
|
+
const price = util_1.NumberUtils.bnOrZero((_b = geckoIdToUsdPriceMap === null || geckoIdToUsdPriceMap === void 0 ? void 0 : geckoIdToUsdPriceMap[coinId]) === null || _b === void 0 ? void 0 : _b.usd);
|
|
675
|
+
if (price.gt(0)) {
|
|
676
|
+
// if denom is usc, then return uscUsdValue, else return coingecko usd price
|
|
677
|
+
this.usdValues[denom] = denom === (uscStablecoin === null || uscStablecoin === void 0 ? void 0 : uscStablecoin.denom) ? constant_1.uscUsdValue : price;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
if (!this.initialUsdValuesLoaded)
|
|
681
|
+
this.initialUsdValuesLoaded = true;
|
|
682
|
+
return this.usdValues;
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
getUSDValuesFromCoinGecko(geckoIds) {
|
|
686
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
687
|
+
const response = yield util_1.FetchUtils.fetch(`https://coingecko-proxy.dem.exchange/api/v3/simple/price?ids=${geckoIds.join(",")}&vs_currencies=usd`);
|
|
688
|
+
return yield response.json();
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
processTokenPrices(tokenPrices) {
|
|
692
|
+
return tokenPrices.reduce((prevPrices, price) => {
|
|
693
|
+
const newPrev = prevPrices;
|
|
694
|
+
newPrev[price.denom] = number_1.bnOrZero(price.twap).shiftedBy(-constant_1.decTypeDecimals);
|
|
695
|
+
return newPrev;
|
|
696
|
+
}, {});
|
|
697
|
+
}
|
|
698
|
+
getUSDValuesFromPricingModule() {
|
|
699
|
+
var _a, _b, _c, _d;
|
|
700
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
+
const initTokenPrices = yield this.query.pricing.TokenPriceAll({
|
|
702
|
+
pagination: {
|
|
703
|
+
limit: new long_1.default(10000),
|
|
704
|
+
offset: new long_1.default(0),
|
|
705
|
+
key: new Uint8Array(),
|
|
706
|
+
countTotal: true,
|
|
707
|
+
reverse: false,
|
|
708
|
+
},
|
|
709
|
+
});
|
|
710
|
+
if (((_a = initTokenPrices.pagination) === null || _a === void 0 ? void 0 : _a.total) && ((_b = initTokenPrices.pagination) === null || _b === void 0 ? void 0 : _b.total.lt(10000))) {
|
|
711
|
+
const tokenPricesMap = this.processTokenPrices(initTokenPrices.tokenPrices);
|
|
712
|
+
return tokenPricesMap;
|
|
713
|
+
}
|
|
714
|
+
const fullTokenPrices = yield this.query.pricing.TokenPriceAll({
|
|
715
|
+
pagination: {
|
|
716
|
+
limit: (_d = (_c = initTokenPrices.pagination) === null || _c === void 0 ? void 0 : _c.total) !== null && _d !== void 0 ? _d : new long_1.default(0),
|
|
717
|
+
offset: new long_1.default(0),
|
|
718
|
+
key: new Uint8Array(),
|
|
719
|
+
countTotal: true,
|
|
720
|
+
reverse: false,
|
|
721
|
+
},
|
|
722
|
+
});
|
|
723
|
+
return this.processTokenPrices(fullTokenPrices.tokenPrices);
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
getDenomToGeckoIdMap() {
|
|
727
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
728
|
+
const networkConfig = this.configProvider.getConfig();
|
|
729
|
+
const insights = new InsightsQueryClient_1.default(networkConfig);
|
|
730
|
+
const response = yield insights.DenomToGeckoIdMap();
|
|
731
|
+
const tokens = response.result.gecko;
|
|
732
|
+
return tokens;
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
setCommonAssetConfig() {
|
|
736
|
+
// whitelisted ibc tokens
|
|
737
|
+
ibc_1.ibcWhitelist.forEach((chainId) => {
|
|
738
|
+
var _a;
|
|
739
|
+
const currencies = util_1.IBCUtils.EmbedChainInfos[chainId].currencies;
|
|
740
|
+
const channelObj = (_a = ibc_1.swthChannels[chainId]) === null || _a === void 0 ? void 0 : _a.ibc;
|
|
741
|
+
currencies.forEach((asset) => {
|
|
742
|
+
var _a, _b;
|
|
743
|
+
const channel = asset.coinMinimalDenom !== "swth" ? (_a = channelObj === null || channelObj === void 0 ? void 0 : channelObj.sourceChannel) !== null && _a !== void 0 ? _a : "channel-0" : (_b = channelObj === null || channelObj === void 0 ? void 0 : channelObj.dstChannel) !== null && _b !== void 0 ? _b : "channel-0";
|
|
744
|
+
const assetDenom = TokenClient.isIBCDenom(asset.coinMinimalDenom)
|
|
745
|
+
? asset.coinMinimalDenom
|
|
746
|
+
: util_1.IBCUtils.makeIBCMinimalDenom(channel, asset.coinMinimalDenom);
|
|
747
|
+
const symbolSmall = asset.coinDenom.toLowerCase();
|
|
748
|
+
if (!this.commonAssetNames[assetDenom])
|
|
749
|
+
this.commonAssetNames[assetDenom] = symbolSmall;
|
|
750
|
+
if (asset.coinGeckoId && !this.geckoTokenNames[symbolSmall])
|
|
751
|
+
this.geckoTokenNames[symbolSmall] = asset.coinGeckoId;
|
|
752
|
+
});
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
TokenClient.Blacklist = constant_1.TokenBlacklist;
|
|
757
|
+
exports.default = TokenClient;
|