carbon-js-sdk 0.8.2 → 0.8.4

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.
Files changed (507) hide show
  1. package/lib/CarbonSDK.d.ts +3 -2
  2. package/lib/CarbonSDK.js +7 -11
  3. package/lib/clients/BatchQueryClient.js +4 -4
  4. package/lib/clients/CarbonQueryClient.d.ts +4 -0
  5. package/lib/clients/CarbonQueryClient.js +62 -58
  6. package/lib/clients/ETHClient.js +15 -15
  7. package/lib/clients/HydrogenClient.js +1 -1
  8. package/lib/clients/InsightsQueryClient.js +3 -3
  9. package/lib/clients/NEOClient.js +8 -12
  10. package/lib/clients/TokenClient.js +2 -2
  11. package/lib/clients/ZILClient.js +17 -17
  12. package/lib/codec/Switcheo/carbon/adl/genesis.d.ts +3 -3
  13. package/lib/codec/Switcheo/carbon/admin/genesis.d.ts +3 -3
  14. package/lib/codec/Switcheo/carbon/admin/query.d.ts +6 -6
  15. package/lib/codec/Switcheo/carbon/admin/tx.d.ts +6 -6
  16. package/lib/codec/Switcheo/carbon/bank/event.d.ts +7 -7
  17. package/lib/codec/Switcheo/carbon/bank/genesis.d.ts +3 -3
  18. package/lib/codec/Switcheo/carbon/bank/query.d.ts +6 -6
  19. package/lib/codec/Switcheo/carbon/book/book.d.ts +6 -6
  20. package/lib/codec/Switcheo/carbon/book/event.d.ts +5 -5
  21. package/lib/codec/Switcheo/carbon/book/genesis.d.ts +3 -3
  22. package/lib/codec/Switcheo/carbon/book/legacy.d.ts +3 -3
  23. package/lib/codec/Switcheo/carbon/book/query.d.ts +12 -12
  24. package/lib/codec/Switcheo/carbon/broker/amm.d.ts +5 -5
  25. package/lib/codec/Switcheo/carbon/broker/candlestick.d.ts +3 -3
  26. package/lib/codec/Switcheo/carbon/broker/event.d.ts +4 -4
  27. package/lib/codec/Switcheo/carbon/broker/genesis.d.ts +3 -3
  28. package/lib/codec/Switcheo/carbon/broker/incoming_liquidations.d.ts +3 -3
  29. package/lib/codec/Switcheo/carbon/broker/pagination.d.ts +3 -3
  30. package/lib/codec/Switcheo/carbon/broker/query.d.ts +8 -8
  31. package/lib/codec/Switcheo/carbon/broker/tx.d.ts +5 -5
  32. package/lib/codec/Switcheo/carbon/btcx/denom_cross_chain_info.d.ts +3 -3
  33. package/lib/codec/Switcheo/carbon/btcx/denom_info.d.ts +3 -3
  34. package/lib/codec/Switcheo/carbon/btcx/genesis.d.ts +3 -3
  35. package/lib/codec/Switcheo/carbon/btcx/query.d.ts +6 -6
  36. package/lib/codec/Switcheo/carbon/btcx/tx.d.ts +8 -8
  37. package/lib/codec/Switcheo/carbon/ccm/ccm.d.ts +3 -3
  38. package/lib/codec/Switcheo/carbon/ccm/genesis.d.ts +7 -7
  39. package/lib/codec/Switcheo/carbon/ccm/query.d.ts +4 -4
  40. package/lib/codec/Switcheo/carbon/ccm/tx.d.ts +10 -10
  41. package/lib/codec/Switcheo/carbon/cdp/asset_params.d.ts +5 -5
  42. package/lib/codec/Switcheo/carbon/cdp/cdp_liquidations.d.ts +3 -3
  43. package/lib/codec/Switcheo/carbon/cdp/debt_info.d.ts +3 -3
  44. package/lib/codec/Switcheo/carbon/cdp/e_mode_category.d.ts +3 -3
  45. package/lib/codec/Switcheo/carbon/cdp/event.d.ts +36 -36
  46. package/lib/codec/Switcheo/carbon/cdp/genesis.d.ts +10 -10
  47. package/lib/codec/Switcheo/carbon/cdp/params.d.ts +3 -3
  48. package/lib/codec/Switcheo/carbon/cdp/query.d.ts +53 -53
  49. package/lib/codec/Switcheo/carbon/cdp/rate_strategy_params.d.ts +3 -3
  50. package/lib/codec/Switcheo/carbon/cdp/reward_scheme.d.ts +6 -6
  51. package/lib/codec/Switcheo/carbon/cdp/stablecoin_debt_info.d.ts +3 -3
  52. package/lib/codec/Switcheo/carbon/cdp/stablecoin_interest_info.d.ts +3 -3
  53. package/lib/codec/Switcheo/carbon/cdp/tx.d.ts +89 -89
  54. package/lib/codec/Switcheo/carbon/coin/bridge.d.ts +3 -3
  55. package/lib/codec/Switcheo/carbon/coin/event.d.ts +14 -14
  56. package/lib/codec/Switcheo/carbon/coin/genesis.d.ts +4 -4
  57. package/lib/codec/Switcheo/carbon/coin/group.d.ts +5 -5
  58. package/lib/codec/Switcheo/carbon/coin/proposal.d.ts +3 -3
  59. package/lib/codec/Switcheo/carbon/coin/query.d.ts +26 -26
  60. package/lib/codec/Switcheo/carbon/coin/token.d.ts +9 -9
  61. package/lib/codec/Switcheo/carbon/coin/tx.d.ts +48 -48
  62. package/lib/codec/Switcheo/carbon/erc20/erc20.d.ts +3 -3
  63. package/lib/codec/Switcheo/carbon/erc20/events.d.ts +6 -6
  64. package/lib/codec/Switcheo/carbon/erc20/genesis.d.ts +4 -4
  65. package/lib/codec/Switcheo/carbon/erc20/query.d.ts +8 -8
  66. package/lib/codec/Switcheo/carbon/erc20/tx.d.ts +16 -16
  67. package/lib/codec/Switcheo/carbon/evmbank/genesis.d.ts +4 -4
  68. package/lib/codec/Switcheo/carbon/evmbank/query.d.ts +4 -4
  69. package/lib/codec/Switcheo/carbon/evmcontract/evm_hooks.d.ts +7 -7
  70. package/lib/codec/Switcheo/carbon/evmcontract/genesis.d.ts +3 -3
  71. package/lib/codec/Switcheo/carbon/evmcontract/params.d.ts +3 -3
  72. package/lib/codec/Switcheo/carbon/evmcontract/query.d.ts +10 -10
  73. package/lib/codec/Switcheo/carbon/evmcontract/tx.d.ts +10 -10
  74. package/lib/codec/Switcheo/carbon/evmmerge/address.d.ts +3 -3
  75. package/lib/codec/Switcheo/carbon/evmmerge/event.d.ts +3 -3
  76. package/lib/codec/Switcheo/carbon/evmmerge/genesis.d.ts +5 -5
  77. package/lib/codec/Switcheo/carbon/evmmerge/offchain.d.ts +3 -3
  78. package/lib/codec/Switcheo/carbon/evmmerge/query.d.ts +6 -6
  79. package/lib/codec/Switcheo/carbon/evmmerge/tx.d.ts +4 -4
  80. package/lib/codec/Switcheo/carbon/fee/event.d.ts +3 -3
  81. package/lib/codec/Switcheo/carbon/fee/fee.d.ts +5 -5
  82. package/lib/codec/Switcheo/carbon/fee/genesis.d.ts +3 -3
  83. package/lib/codec/Switcheo/carbon/fee/proposal.d.ts +6 -6
  84. package/lib/codec/Switcheo/carbon/fee/query.d.ts +10 -10
  85. package/lib/codec/Switcheo/carbon/fee/tx.d.ts +10 -10
  86. package/lib/codec/Switcheo/carbon/headersync/consensus_peers.d.ts +7 -7
  87. package/lib/codec/Switcheo/carbon/headersync/genesis.d.ts +7 -7
  88. package/lib/codec/Switcheo/carbon/headersync/query.d.ts +6 -6
  89. package/lib/codec/Switcheo/carbon/headersync/tx.d.ts +6 -6
  90. package/lib/codec/Switcheo/carbon/inflation/genesis.d.ts +3 -3
  91. package/lib/codec/Switcheo/carbon/inflation/inflation.d.ts +3 -3
  92. package/lib/codec/Switcheo/carbon/inflation/query.d.ts +4 -4
  93. package/lib/codec/Switcheo/carbon/insurance/event.d.ts +3 -3
  94. package/lib/codec/Switcheo/carbon/insurance/fund.d.ts +4 -4
  95. package/lib/codec/Switcheo/carbon/insurance/genesis.d.ts +3 -3
  96. package/lib/codec/Switcheo/carbon/insurance/query.d.ts +4 -4
  97. package/lib/codec/Switcheo/carbon/insurance/tx.d.ts +4 -4
  98. package/lib/codec/Switcheo/carbon/leverage/event.d.ts +3 -3
  99. package/lib/codec/Switcheo/carbon/leverage/genesis.d.ts +3 -3
  100. package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +4 -4
  101. package/lib/codec/Switcheo/carbon/leverage/query.d.ts +6 -6
  102. package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +4 -4
  103. package/lib/codec/Switcheo/carbon/liquidation/genesis.d.ts +4 -4
  104. package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.d.ts +4 -4
  105. package/lib/codec/Switcheo/carbon/liquidation/query.d.ts +4 -4
  106. package/lib/codec/Switcheo/carbon/liquidation/quote_changes.d.ts +3 -3
  107. package/lib/codec/Switcheo/carbon/liquiditypool/event.d.ts +15 -15
  108. package/lib/codec/Switcheo/carbon/liquiditypool/genesis.d.ts +3 -3
  109. package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.d.ts +13 -13
  110. package/lib/codec/Switcheo/carbon/liquiditypool/proposal.d.ts +11 -11
  111. package/lib/codec/Switcheo/carbon/liquiditypool/query.d.ts +31 -31
  112. package/lib/codec/Switcheo/carbon/liquiditypool/reward.d.ts +18 -18
  113. package/lib/codec/Switcheo/carbon/liquiditypool/tx.d.ts +41 -41
  114. package/lib/codec/Switcheo/carbon/lockproxy/event.d.ts +4 -4
  115. package/lib/codec/Switcheo/carbon/lockproxy/genesis.d.ts +6 -6
  116. package/lib/codec/Switcheo/carbon/lockproxy/lockproxy.d.ts +3 -3
  117. package/lib/codec/Switcheo/carbon/lockproxy/query.d.ts +6 -6
  118. package/lib/codec/Switcheo/carbon/lockproxy/tx.d.ts +12 -12
  119. package/lib/codec/Switcheo/carbon/market/event.d.ts +3 -3
  120. package/lib/codec/Switcheo/carbon/market/fee.d.ts +7 -7
  121. package/lib/codec/Switcheo/carbon/market/genesis.d.ts +3 -3
  122. package/lib/codec/Switcheo/carbon/market/market.d.ts +7 -7
  123. package/lib/codec/Switcheo/carbon/market/proposal.d.ts +5 -5
  124. package/lib/codec/Switcheo/carbon/market/query.d.ts +22 -22
  125. package/lib/codec/Switcheo/carbon/market/tx.d.ts +23 -23
  126. package/lib/codec/Switcheo/carbon/marketstats/genesis.d.ts +3 -3
  127. package/lib/codec/Switcheo/carbon/marketstats/marketstats.d.ts +3 -3
  128. package/lib/codec/Switcheo/carbon/marketstats/query.d.ts +4 -4
  129. package/lib/codec/Switcheo/carbon/misc/block.d.ts +3 -3
  130. package/lib/codec/Switcheo/carbon/misc/message.d.ts +3 -3
  131. package/lib/codec/Switcheo/carbon/misc/message_type.d.ts +3 -3
  132. package/lib/codec/Switcheo/carbon/misc/query.d.ts +16 -16
  133. package/lib/codec/Switcheo/carbon/misc/trade.d.ts +3 -3
  134. package/lib/codec/Switcheo/carbon/misc/transaction.d.ts +4 -4
  135. package/lib/codec/Switcheo/carbon/oracle/event.d.ts +4 -4
  136. package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +3 -3
  137. package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +8 -8
  138. package/lib/codec/Switcheo/carbon/oracle/proposal.d.ts +3 -3
  139. package/lib/codec/Switcheo/carbon/oracle/query.d.ts +28 -28
  140. package/lib/codec/Switcheo/carbon/oracle/slashing.d.ts +4 -4
  141. package/lib/codec/Switcheo/carbon/oracle/tx.d.ts +16 -16
  142. package/lib/codec/Switcheo/carbon/order/event.d.ts +3 -3
  143. package/lib/codec/Switcheo/carbon/order/evm_hooks.d.ts +6 -6
  144. package/lib/codec/Switcheo/carbon/order/genesis.d.ts +6 -6
  145. package/lib/codec/Switcheo/carbon/order/order.d.ts +9 -9
  146. package/lib/codec/Switcheo/carbon/order/query.d.ts +12 -12
  147. package/lib/codec/Switcheo/carbon/order/tx.d.ts +14 -14
  148. package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +9 -9
  149. package/lib/codec/Switcheo/carbon/perpspool/genesis.d.ts +6 -6
  150. package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +8 -8
  151. package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +3 -3
  152. package/lib/codec/Switcheo/carbon/perpspool/pool.d.ts +8 -8
  153. package/lib/codec/Switcheo/carbon/perpspool/query.d.ts +20 -20
  154. package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +20 -20
  155. package/lib/codec/Switcheo/carbon/position/event.d.ts +3 -3
  156. package/lib/codec/Switcheo/carbon/position/evm_hooks.d.ts +4 -4
  157. package/lib/codec/Switcheo/carbon/position/genesis.d.ts +3 -3
  158. package/lib/codec/Switcheo/carbon/position/position.d.ts +6 -6
  159. package/lib/codec/Switcheo/carbon/position/query.d.ts +8 -8
  160. package/lib/codec/Switcheo/carbon/position/tx.d.ts +4 -4
  161. package/lib/codec/Switcheo/carbon/pricing/event.d.ts +8 -8
  162. package/lib/codec/Switcheo/carbon/pricing/genesis.d.ts +3 -3
  163. package/lib/codec/Switcheo/carbon/pricing/legacy.d.ts +3 -3
  164. package/lib/codec/Switcheo/carbon/pricing/pricing.d.ts +5 -5
  165. package/lib/codec/Switcheo/carbon/pricing/proposal.d.ts +4 -4
  166. package/lib/codec/Switcheo/carbon/pricing/query.d.ts +16 -16
  167. package/lib/codec/Switcheo/carbon/pricing/tx.d.ts +14 -14
  168. package/lib/codec/Switcheo/carbon/profile/event.d.ts +3 -3
  169. package/lib/codec/Switcheo/carbon/profile/genesis.d.ts +3 -3
  170. package/lib/codec/Switcheo/carbon/profile/profile.d.ts +3 -3
  171. package/lib/codec/Switcheo/carbon/profile/query.d.ts +8 -8
  172. package/lib/codec/Switcheo/carbon/profile/tx.d.ts +4 -4
  173. package/lib/codec/Switcheo/carbon/sequence/genesis.d.ts +4 -4
  174. package/lib/codec/Switcheo/carbon/sequence/query.d.ts +6 -6
  175. package/lib/codec/Switcheo/carbon/sequence/tx.d.ts +4 -4
  176. package/lib/codec/Switcheo/carbon/subaccount/genesis.d.ts +3 -3
  177. package/lib/codec/Switcheo/carbon/subaccount/legacy.d.ts +3 -3
  178. package/lib/codec/Switcheo/carbon/subaccount/query.d.ts +19 -19
  179. package/lib/codec/Switcheo/carbon/subaccount/subaccount.d.ts +6 -6
  180. package/lib/codec/Switcheo/carbon/subaccount/tx.d.ts +10 -10
  181. package/lib/codec/alliance/alliance/alliance.d.ts +5 -5
  182. package/lib/codec/alliance/alliance/delegations.d.ts +6 -6
  183. package/lib/codec/alliance/alliance/events.d.ts +7 -7
  184. package/lib/codec/alliance/alliance/genesis.d.ts +7 -7
  185. package/lib/codec/alliance/alliance/gov.d.ts +5 -5
  186. package/lib/codec/alliance/alliance/params.d.ts +4 -4
  187. package/lib/codec/alliance/alliance/query.d.ts +30 -30
  188. package/lib/codec/alliance/alliance/redelegations.d.ts +5 -5
  189. package/lib/codec/alliance/alliance/tx.d.ts +18 -18
  190. package/lib/codec/alliance/alliance/unbonding.d.ts +3 -3
  191. package/lib/codec/carbon-models.js +1 -5
  192. package/lib/codec/cosmos/app/runtime/v1alpha1/module.d.ts +4 -4
  193. package/lib/codec/cosmos/app/v1alpha1/config.d.ts +5 -5
  194. package/lib/codec/cosmos/app/v1alpha1/module.d.ts +5 -5
  195. package/lib/codec/cosmos/app/v1alpha1/query.d.ts +4 -4
  196. package/lib/codec/cosmos/auth/module/v1/module.d.ts +4 -4
  197. package/lib/codec/cosmos/auth/v1beta1/auth.d.ts +6 -6
  198. package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +3 -3
  199. package/lib/codec/cosmos/auth/v1beta1/query.d.ts +22 -22
  200. package/lib/codec/cosmos/auth/v1beta1/tx.d.ts +4 -4
  201. package/lib/codec/cosmos/authz/module/v1/module.d.ts +3 -3
  202. package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +6 -6
  203. package/lib/codec/cosmos/authz/v1beta1/event.d.ts +4 -4
  204. package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +3 -3
  205. package/lib/codec/cosmos/authz/v1beta1/query.d.ts +8 -8
  206. package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +8 -8
  207. package/lib/codec/cosmos/autocli/v1/options.d.ts +9 -9
  208. package/lib/codec/cosmos/autocli/v1/query.d.ts +5 -5
  209. package/lib/codec/cosmos/bank/module/v1/module.d.ts +3 -3
  210. package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +3 -3
  211. package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +9 -9
  212. package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +4 -4
  213. package/lib/codec/cosmos/bank/v1beta1/query.d.ts +25 -25
  214. package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +10 -10
  215. package/lib/codec/cosmos/base/abci/v1beta1/abci.d.ts +12 -12
  216. package/lib/codec/cosmos/base/kv/v1beta1/kv.d.ts +4 -4
  217. package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +4 -4
  218. package/lib/codec/cosmos/base/query/v1beta1/pagination.d.ts +4 -4
  219. package/lib/codec/cosmos/base/reflection/v1beta1/reflection.d.ts +6 -6
  220. package/lib/codec/cosmos/base/reflection/v2alpha1/reflection.d.ts +28 -28
  221. package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +11 -11
  222. package/lib/codec/cosmos/base/store/v1beta1/commit_info.d.ts +5 -5
  223. package/lib/codec/cosmos/base/store/v1beta1/listening.d.ts +5 -5
  224. package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +21 -21
  225. package/lib/codec/cosmos/base/tendermint/v1beta1/types.d.ts +4 -4
  226. package/lib/codec/cosmos/base/v1beta1/coin.d.ts +6 -6
  227. package/lib/codec/cosmos/capability/module/v1/module.d.ts +3 -3
  228. package/lib/codec/cosmos/capability/v1beta1/capability.d.ts +5 -5
  229. package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +4 -4
  230. package/lib/codec/cosmos/consensus/module/v1/module.d.ts +3 -3
  231. package/lib/codec/cosmos/consensus/v1/query.d.ts +4 -4
  232. package/lib/codec/cosmos/consensus/v1/tx.d.ts +4 -4
  233. package/lib/codec/cosmos/crisis/module/v1/module.d.ts +3 -3
  234. package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +3 -3
  235. package/lib/codec/cosmos/crisis/v1beta1/tx.d.ts +6 -6
  236. package/lib/codec/cosmos/crypto/ed25519/keys.d.ts +4 -4
  237. package/lib/codec/cosmos/crypto/hd/v1/hd.d.ts +3 -3
  238. package/lib/codec/cosmos/crypto/keyring/v1/record.d.ts +7 -7
  239. package/lib/codec/cosmos/crypto/multisig/keys.d.ts +3 -3
  240. package/lib/codec/cosmos/crypto/multisig/v1beta1/multisig.d.ts +4 -4
  241. package/lib/codec/cosmos/crypto/secp256k1/keys.d.ts +4 -4
  242. package/lib/codec/cosmos/crypto/secp256r1/keys.d.ts +4 -4
  243. package/lib/codec/cosmos/distribution/module/v1/module.d.ts +3 -3
  244. package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +14 -14
  245. package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +10 -10
  246. package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +24 -24
  247. package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +14 -14
  248. package/lib/codec/cosmos/evidence/module/v1/module.d.ts +3 -3
  249. package/lib/codec/cosmos/evidence/v1beta1/evidence.d.ts +3 -3
  250. package/lib/codec/cosmos/evidence/v1beta1/genesis.d.ts +3 -3
  251. package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +6 -6
  252. package/lib/codec/cosmos/evidence/v1beta1/tx.d.ts +4 -4
  253. package/lib/codec/cosmos/feegrant/module/v1/module.d.ts +3 -3
  254. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +6 -6
  255. package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +3 -3
  256. package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +8 -8
  257. package/lib/codec/cosmos/feegrant/v1beta1/tx.d.ts +6 -6
  258. package/lib/codec/cosmos/genutil/module/v1/module.d.ts +3 -3
  259. package/lib/codec/cosmos/genutil/v1beta1/genesis.d.ts +3 -3
  260. package/lib/codec/cosmos/gov/module/v1/module.d.ts +3 -3
  261. package/lib/codec/cosmos/gov/v1/genesis.d.ts +3 -3
  262. package/lib/codec/cosmos/gov/v1/gov.d.ts +11 -11
  263. package/lib/codec/cosmos/gov/v1/query.d.ts +18 -18
  264. package/lib/codec/cosmos/gov/v1/query.js +2 -2
  265. package/lib/codec/cosmos/gov/v1/tx.d.ts +14 -14
  266. package/lib/codec/cosmos/gov/v1/tx.js +2 -2
  267. package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +3 -3
  268. package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +11 -11
  269. package/lib/codec/cosmos/gov/v1beta1/query.d.ts +18 -18
  270. package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
  271. package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +10 -10
  272. package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
  273. package/lib/codec/cosmos/group/module/v1/module.d.ts +3 -3
  274. package/lib/codec/cosmos/group/v1/events.d.ts +12 -12
  275. package/lib/codec/cosmos/group/v1/events.js +4 -4
  276. package/lib/codec/cosmos/group/v1/genesis.d.ts +3 -3
  277. package/lib/codec/cosmos/group/v1/query.d.ts +30 -30
  278. package/lib/codec/cosmos/group/v1/tx.d.ts +30 -30
  279. package/lib/codec/cosmos/group/v1/tx.js +4 -4
  280. package/lib/codec/cosmos/group/v1/types.d.ts +13 -13
  281. package/lib/codec/cosmos/ics23/v1/proofs.d.ts +15 -15
  282. package/lib/codec/cosmos/mint/module/v1/module.d.ts +3 -3
  283. package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +3 -3
  284. package/lib/codec/cosmos/mint/v1beta1/mint.d.ts +4 -4
  285. package/lib/codec/cosmos/mint/v1beta1/query.d.ts +8 -8
  286. package/lib/codec/cosmos/mint/v1beta1/tx.d.ts +4 -4
  287. package/lib/codec/cosmos/nft/module/v1/module.d.ts +3 -3
  288. package/lib/codec/cosmos/nft/v1beta1/event.d.ts +5 -5
  289. package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +4 -4
  290. package/lib/codec/cosmos/nft/v1beta1/nft.d.ts +4 -4
  291. package/lib/codec/cosmos/nft/v1beta1/query.d.ts +16 -16
  292. package/lib/codec/cosmos/nft/v1beta1/tx.d.ts +4 -4
  293. package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +3 -3
  294. package/lib/codec/cosmos/orm/query/v1alpha1/query.d.ts +9 -9
  295. package/lib/codec/cosmos/orm/v1/orm.d.ts +6 -6
  296. package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +4 -4
  297. package/lib/codec/cosmos/params/module/v1/module.d.ts +3 -3
  298. package/lib/codec/cosmos/params/v1beta1/params.d.ts +4 -4
  299. package/lib/codec/cosmos/params/v1beta1/query.d.ts +7 -7
  300. package/lib/codec/cosmos/reflection/v1/reflection.d.ts +4 -4
  301. package/lib/codec/cosmos/slashing/module/v1/module.d.ts +3 -3
  302. package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +6 -6
  303. package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +8 -8
  304. package/lib/codec/cosmos/slashing/v1beta1/slashing.d.ts +4 -4
  305. package/lib/codec/cosmos/slashing/v1beta1/tx.d.ts +6 -6
  306. package/lib/codec/cosmos/staking/module/v1/module.d.ts +3 -3
  307. package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +4 -4
  308. package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +4 -4
  309. package/lib/codec/cosmos/staking/v1beta1/query.d.ts +30 -30
  310. package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +23 -23
  311. package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +16 -16
  312. package/lib/codec/cosmos/tx/config/v1/config.d.ts +3 -3
  313. package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +7 -7
  314. package/lib/codec/cosmos/tx/v1beta1/service.d.ts +20 -20
  315. package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +15 -15
  316. package/lib/codec/cosmos/tx/v1beta1/tx.js +4 -4
  317. package/lib/codec/cosmos/upgrade/module/v1/module.d.ts +3 -3
  318. package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +12 -12
  319. package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +6 -6
  320. package/lib/codec/cosmos/upgrade/v1beta1/upgrade.d.ts +6 -6
  321. package/lib/codec/cosmos/vesting/module/v1/module.d.ts +3 -3
  322. package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +8 -8
  323. package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +8 -8
  324. package/lib/codec/cosmos-models.js +1 -5
  325. package/lib/codec/ethermint/crypto/v1/ethsecp256k1/keys.d.ts +4 -4
  326. package/lib/codec/ethermint/evm/v1/events.d.ts +6 -6
  327. package/lib/codec/ethermint/evm/v1/evm.d.ts +10 -10
  328. package/lib/codec/ethermint/evm/v1/genesis.d.ts +4 -4
  329. package/lib/codec/ethermint/evm/v1/query.d.ts +26 -26
  330. package/lib/codec/ethermint/evm/v1/tx.d.ts +10 -10
  331. package/lib/codec/ethermint/feemarket/v1/events.d.ts +4 -4
  332. package/lib/codec/ethermint/feemarket/v1/feemarket.d.ts +3 -3
  333. package/lib/codec/ethermint/feemarket/v1/genesis.d.ts +3 -3
  334. package/lib/codec/ethermint/feemarket/v1/query.d.ts +8 -8
  335. package/lib/codec/ethermint/feemarket/v1/tx.d.ts +4 -4
  336. package/lib/codec/ethermint/types/v1/account.d.ts +3 -3
  337. package/lib/codec/ethermint/types/v1/dynamic_fee.d.ts +3 -3
  338. package/lib/codec/ethermint/types/v1/indexer.d.ts +3 -3
  339. package/lib/codec/ethermint/types/v1/web3.d.ts +3 -3
  340. package/lib/codec/ethermint-models.js +1 -5
  341. package/lib/codec/google/protobuf/any.d.ts +3 -3
  342. package/lib/codec/google/protobuf/descriptor.d.ts +29 -29
  343. package/lib/codec/google/protobuf/duration.d.ts +3 -3
  344. package/lib/codec/google/protobuf/timestamp.d.ts +3 -3
  345. package/lib/codec/google/protobuf/wrappers.d.ts +11 -11
  346. package/lib/codec/ibc/applications/fee/v1/ack.d.ts +3 -3
  347. package/lib/codec/ibc/applications/fee/v1/fee.d.ts +6 -6
  348. package/lib/codec/ibc/applications/fee/v1/genesis.d.ts +7 -7
  349. package/lib/codec/ibc/applications/fee/v1/metadata.d.ts +3 -3
  350. package/lib/codec/ibc/applications/fee/v1/query.d.ts +22 -22
  351. package/lib/codec/ibc/applications/fee/v1/tx.d.ts +10 -10
  352. package/lib/codec/ibc/applications/interchain_accounts/controller/v1/controller.d.ts +3 -3
  353. package/lib/codec/ibc/applications/interchain_accounts/controller/v1/query.d.ts +6 -6
  354. package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +6 -6
  355. package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +7 -7
  356. package/lib/codec/ibc/applications/interchain_accounts/host/v1/host.d.ts +3 -3
  357. package/lib/codec/ibc/applications/interchain_accounts/host/v1/query.d.ts +4 -4
  358. package/lib/codec/ibc/applications/interchain_accounts/v1/account.d.ts +3 -3
  359. package/lib/codec/ibc/applications/interchain_accounts/v1/metadata.d.ts +3 -3
  360. package/lib/codec/ibc/applications/interchain_accounts/v1/packet.d.ts +4 -4
  361. package/lib/codec/ibc/applications/transfer/v1/authz.d.ts +4 -4
  362. package/lib/codec/ibc/applications/transfer/v1/genesis.d.ts +3 -3
  363. package/lib/codec/ibc/applications/transfer/v1/query.d.ts +14 -14
  364. package/lib/codec/ibc/applications/transfer/v1/transfer.d.ts +4 -4
  365. package/lib/codec/ibc/applications/transfer/v1/tx.d.ts +4 -4
  366. package/lib/codec/ibc/applications/transfer/v2/packet.d.ts +3 -3
  367. package/lib/codec/ibc/core/channel/v1/channel.d.ts +9 -9
  368. package/lib/codec/ibc/core/channel/v1/genesis.d.ts +4 -4
  369. package/lib/codec/ibc/core/channel/v1/query.d.ts +28 -28
  370. package/lib/codec/ibc/core/channel/v1/tx.d.ts +22 -22
  371. package/lib/codec/ibc/core/client/v1/client.d.ts +9 -9
  372. package/lib/codec/ibc/core/client/v1/genesis.d.ts +5 -5
  373. package/lib/codec/ibc/core/client/v1/query.d.ts +20 -20
  374. package/lib/codec/ibc/core/client/v1/tx.d.ts +10 -10
  375. package/lib/codec/ibc/core/commitment/v1/commitment.d.ts +6 -6
  376. package/lib/codec/ibc/core/connection/v1/connection.d.ts +9 -9
  377. package/lib/codec/ibc/core/connection/v1/genesis.d.ts +3 -3
  378. package/lib/codec/ibc/core/connection/v1/query.d.ts +14 -14
  379. package/lib/codec/ibc/core/connection/v1/tx.d.ts +10 -10
  380. package/lib/codec/ibc/core/types/v1/genesis.d.ts +3 -3
  381. package/lib/codec/ibc/lightclients/localhost/v2/localhost.d.ts +3 -3
  382. package/lib/codec/ibc/lightclients/solomachine/v2/solomachine.d.ts +18 -18
  383. package/lib/codec/ibc/lightclients/solomachine/v3/solomachine.d.ts +10 -10
  384. package/lib/codec/ibc/lightclients/tendermint/v1/tendermint.d.ts +7 -7
  385. package/lib/codec/ibc-models.js +1 -5
  386. package/lib/codec/index.js +1 -5
  387. package/lib/codec/polynetwork-models.js +1 -5
  388. package/lib/codec/tendermint/abci/types.d.ts +48 -48
  389. package/lib/codec/tendermint/crypto/keys.d.ts +3 -3
  390. package/lib/codec/tendermint/crypto/proof.d.ts +7 -7
  391. package/lib/codec/tendermint/libs/bits/types.d.ts +3 -3
  392. package/lib/codec/tendermint/p2p/types.d.ts +6 -6
  393. package/lib/codec/tendermint/types/block.d.ts +3 -3
  394. package/lib/codec/tendermint/types/evidence.d.ts +6 -6
  395. package/lib/codec/tendermint/types/params.d.ts +8 -8
  396. package/lib/codec/tendermint/types/types.d.ts +15 -15
  397. package/lib/codec/tendermint/types/validator.d.ts +5 -5
  398. package/lib/codec/tendermint/version/types.d.ts +4 -4
  399. package/lib/constant/address.d.ts +1 -1
  400. package/lib/constant/generic.js +1 -1
  401. package/lib/constant/grant.d.ts +1 -0
  402. package/lib/constant/grant.js +4 -0
  403. package/lib/constant/ibc.d.ts +3 -3
  404. package/lib/constant/ibc.js +1 -5
  405. package/lib/constant/index.js +1 -5
  406. package/lib/constant/node.d.ts +1 -1
  407. package/lib/eth/index.js +1 -5
  408. package/lib/hydrogen/index.js +1 -5
  409. package/lib/hydrogen/transfer.d.ts +2 -2
  410. package/lib/index.js +1 -5
  411. package/lib/insights/common.d.ts +1 -1
  412. package/lib/insights/index.js +1 -5
  413. package/lib/insights/position.d.ts +1 -1
  414. package/lib/modules/cdp.js +46 -46
  415. package/lib/modules/cosmwasm.js +2 -2
  416. package/lib/modules/evm.d.ts +1 -1
  417. package/lib/modules/evm.js +6 -6
  418. package/lib/modules/gov.js +12 -12
  419. package/lib/modules/grant.d.ts +33 -0
  420. package/lib/modules/grant.js +196 -0
  421. package/lib/modules/index.js +1 -5
  422. package/lib/modules/liquiditypool.js +1 -1
  423. package/lib/modules/order.js +1 -1
  424. package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
  425. package/lib/provider/account/EthLedgerAccount/index.js +1 -5
  426. package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
  427. package/lib/provider/account/NeoLedgerAccount/N3Ledger/index.js +1 -5
  428. package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
  429. package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.d.ts +1 -1
  430. package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +4 -8
  431. package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
  432. package/lib/provider/account/NeoLedgerAccount/index.js +1 -5
  433. package/lib/provider/account/index.js +1 -5
  434. package/lib/provider/amino/AminoTypesMap.js +1 -1
  435. package/lib/provider/amino/types/admin.js +28 -32
  436. package/lib/provider/amino/types/bank.js +2 -6
  437. package/lib/provider/amino/types/broker.js +2 -6
  438. package/lib/provider/amino/types/cdp.js +27 -31
  439. package/lib/provider/amino/types/coin.js +5 -9
  440. package/lib/provider/amino/types/erc20.js +3 -7
  441. package/lib/provider/amino/types/evm.js +2 -6
  442. package/lib/provider/amino/types/evmmerge.js +2 -6
  443. package/lib/provider/amino/types/feemarket.js +2 -6
  444. package/lib/provider/amino/types/gov.js +6 -10
  445. package/lib/provider/amino/types/grant.d.ts +13 -0
  446. package/lib/provider/amino/types/grant.js +198 -0
  447. package/lib/provider/amino/types/ibc.js +2 -6
  448. package/lib/provider/amino/types/index.d.ts +1 -0
  449. package/lib/provider/amino/types/index.js +3 -1
  450. package/lib/provider/amino/types/leverage.js +2 -6
  451. package/lib/provider/amino/types/liquidityPool.js +8 -12
  452. package/lib/provider/amino/types/market.js +7 -11
  453. package/lib/provider/amino/types/oracle.js +3 -7
  454. package/lib/provider/amino/types/order.js +5 -9
  455. package/lib/provider/amino/types/perpspool.js +8 -12
  456. package/lib/provider/amino/types/position.js +2 -6
  457. package/lib/provider/amino/types/profile.js +2 -6
  458. package/lib/provider/amino/types/staking.js +5 -9
  459. package/lib/provider/amino/types/subaccount.js +4 -8
  460. package/lib/provider/amino/utils.d.ts +2 -2
  461. package/lib/provider/amino/utils.js +27 -11
  462. package/lib/provider/keplr/KeplrAccount.js +6 -6
  463. package/lib/provider/leap/LeapAccount.js +3 -3
  464. package/lib/provider/ledger/ledger.js +6 -9
  465. package/lib/provider/metamask/MetaMask.d.ts +1 -1
  466. package/lib/provider/metamask/MetaMask.js +24 -28
  467. package/lib/provider/metamask/error.d.ts +1 -1
  468. package/lib/provider/o3/O3Types.d.ts +1 -1
  469. package/lib/provider/o3/O3Wallet.js +11 -15
  470. package/lib/provider/o3/index.js +1 -5
  471. package/lib/provider/zilpay/Zilpay.js +4 -4
  472. package/lib/provider/zilpay/index.js +1 -5
  473. package/lib/util/address.d.ts +5 -5
  474. package/lib/util/address.js +15 -19
  475. package/lib/util/api.d.ts +3 -3
  476. package/lib/util/api.js +4 -4
  477. package/lib/util/blockchain.d.ts +7 -7
  478. package/lib/util/blockchain.js +4 -4
  479. package/lib/util/eip712.js +11 -8
  480. package/lib/util/fetch.js +1 -1
  481. package/lib/util/generic.d.ts +2 -3
  482. package/lib/util/generic.js +3 -3
  483. package/lib/util/gov.d.ts +12 -12
  484. package/lib/util/gov.js +11 -11
  485. package/lib/util/grant.d.ts +10 -0
  486. package/lib/util/grant.js +30 -0
  487. package/lib/util/index.d.ts +1 -0
  488. package/lib/util/index.js +3 -6
  489. package/lib/util/legacyEIP712.d.ts +2 -2
  490. package/lib/util/legacyEIP712.js +2 -2
  491. package/lib/util/network.js +3 -3
  492. package/lib/util/number.d.ts +4 -4
  493. package/lib/util/number.js +5 -5
  494. package/lib/util/tx.d.ts +3 -3
  495. package/lib/util/tx.js +1 -5
  496. package/lib/util/type.d.ts +1 -1
  497. package/lib/wallet/CarbonSigner.d.ts +5 -5
  498. package/lib/wallet/CarbonSigner.js +6 -6
  499. package/lib/wallet/CarbonSigningClient.d.ts +1 -1
  500. package/lib/wallet/CarbonSigningClient.js +21 -21
  501. package/lib/wallet/CarbonWallet.d.ts +16 -3
  502. package/lib/wallet/CarbonWallet.js +148 -48
  503. package/lib/wallet/index.js +1 -5
  504. package/lib/websocket/connector.js +4 -8
  505. package/lib/websocket/index.js +1 -5
  506. package/lib/websocket/types.d.ts +1 -1
  507. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  /// <reference types="node" />
2
- import { Network, NetworkConfig, Network as _Network } from "./constant";
2
+ import { Network, Network as _Network, NetworkConfig } from "./constant";
3
3
  import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
4
4
  import * as clients from "./clients";
5
5
  import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
6
6
  import GrpcQueryClient from "./clients/GrpcQueryClient";
7
7
  import N3Client from "./clients/N3Client";
8
8
  import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, ERC20Module, EvmMergeModule, EvmModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
9
+ import { GrantModule } from "./modules/grant";
9
10
  import { StakingModule } from "./modules/staking";
10
11
  import { CosmosLedger, Keplr, LeapExtended } from "./provider";
11
12
  import { MetaMask } from "./provider/metamask/MetaMask";
@@ -13,7 +14,6 @@ import { CarbonWallet, CarbonWalletGenericOpts, CarbonSigner, MetaMaskWalletOpts
13
14
  import GasFee from "./clients/GasFee";
14
15
  export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
15
16
  export { CarbonTx } from "./util";
16
- export { DenomPrefix } from "./constant";
17
17
  export * as Carbon from "./codec/carbon-models";
18
18
  export interface CarbonSDKOpts {
19
19
  network: Network;
@@ -71,6 +71,7 @@ declare class CarbonSDK {
71
71
  lp: LiquidityPoolModule;
72
72
  erc20: ERC20Module;
73
73
  perpspool: PerpspoolModule;
74
+ grant: GrantModule;
74
75
  subaccount: SubAccountModule;
75
76
  profile: ProfileModule;
76
77
  cdp: CDPModule;
package/lib/CarbonSDK.js CHANGED
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -35,7 +31,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
32
  };
37
33
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.ConnectedCarbonSDK = exports.Carbon = exports.DenomPrefix = exports.CarbonTx = exports.CarbonWallet = exports.CarbonSignerTypes = void 0;
34
+ exports.ConnectedCarbonSDK = exports.Carbon = exports.CarbonTx = exports.CarbonWallet = exports.CarbonSignerTypes = void 0;
39
35
  const constant_1 = require("./constant");
40
36
  const util_1 = require("./util");
41
37
  const tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
@@ -45,6 +41,7 @@ const clients_1 = require("./clients");
45
41
  const GrpcQueryClient_1 = __importDefault(require("./clients/GrpcQueryClient"));
46
42
  const N3Client_1 = __importDefault(require("./clients/N3Client"));
47
43
  const modules_1 = require("./modules");
44
+ const grant_1 = require("./modules/grant");
48
45
  const staking_1 = require("./modules/staking");
49
46
  const provider_1 = require("./provider");
50
47
  const blockchain_1 = require("./util/blockchain");
@@ -57,8 +54,6 @@ Object.defineProperty(exports, "CarbonSignerTypes", { enumerable: true, get: fun
57
54
  Object.defineProperty(exports, "CarbonWallet", { enumerable: true, get: function () { return wallet_2.CarbonWallet; } });
58
55
  var util_2 = require("./util");
59
56
  Object.defineProperty(exports, "CarbonTx", { enumerable: true, get: function () { return util_2.CarbonTx; } });
60
- var constant_2 = require("./constant");
61
- Object.defineProperty(exports, "DenomPrefix", { enumerable: true, get: function () { return constant_2.DenomPrefix; } });
62
57
  exports.Carbon = __importStar(require("./codec/carbon-models"));
63
58
  const long_1 = __importDefault(require("long"));
64
59
  const DEFAULT_SDK_INIT_OPTS = {
@@ -85,7 +80,7 @@ class CarbonSDK {
85
80
  if (!opts.query) {
86
81
  let grpcClient;
87
82
  if (opts.useTmAbciQuery !== true && this.networkConfig.grpcUrl) {
88
- const transport = typeof window === "undefined" ? (0, grpc_web_node_http_transport_1.NodeHttpTransport)() : undefined;
83
+ const transport = typeof window === "undefined" ? grpc_web_node_http_transport_1.NodeHttpTransport() : undefined;
89
84
  grpcClient = (_j = opts.grpcQueryClient) !== null && _j !== void 0 ? _j : new GrpcQueryClient_1.default(this.networkConfig.grpcWebUrl, {
90
85
  transport,
91
86
  });
@@ -105,6 +100,7 @@ class CarbonSDK {
105
100
  this.lp = new modules_1.LiquidityPoolModule(this);
106
101
  this.erc20 = new modules_1.ERC20Module(this);
107
102
  this.perpspool = new modules_1.PerpspoolModule(this);
103
+ this.grant = new grant_1.GrantModule(this);
108
104
  this.subaccount = new modules_1.SubAccountModule(this);
109
105
  this.profile = new modules_1.ProfileModule(this);
110
106
  this.cdp = new modules_1.CDPModule(this);
@@ -266,7 +262,7 @@ class CarbonSDK {
266
262
  }),
267
263
  });
268
264
  const txGasCosts = msgGasCosts.reduce((result, item) => {
269
- result[item.msgType] = (0, number_1.bnOrZero)(item.gasCost);
265
+ result[item.msgType] = number_1.bnOrZero(item.gasCost);
270
266
  return result;
271
267
  }, {});
272
268
  const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({
@@ -275,7 +271,7 @@ class CarbonSDK {
275
271
  }),
276
272
  });
277
273
  const txGasPrices = minGasPrices.reduce((result, item) => {
278
- result[item.denom] = (0, number_1.bnOrZero)(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
274
+ result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
279
275
  return result;
280
276
  }, {});
281
277
  const fees = new GasFee_1.default(txGasCosts, txGasPrices);
@@ -29,7 +29,7 @@ class BatchQueryClient {
29
29
  };
30
30
  if (typeof endpoint === "string") {
31
31
  // accept host.name:port and assume http protocol
32
- this.url = (0, rpcclient_1.hasProtocol)(endpoint) ? endpoint : "http://" + endpoint;
32
+ this.url = rpcclient_1.hasProtocol(endpoint) ? endpoint : "http://" + endpoint;
33
33
  }
34
34
  else {
35
35
  this.url = endpoint.url;
@@ -71,7 +71,7 @@ class BatchQueryClient {
71
71
  return;
72
72
  const requests = batch.map((s) => s.request);
73
73
  const requestIds = requests.map((request) => request.id);
74
- (0, http_1.http)("POST", this.url, this.headers, requests).then((raw) => {
74
+ http_1.http("POST", this.url, this.headers, requests).then((raw) => {
75
75
  // Requests with a single entry return as an object
76
76
  const arr = Array.isArray(raw) ? raw : [raw];
77
77
  arr.forEach((el, i) => {
@@ -79,8 +79,8 @@ class BatchQueryClient {
79
79
  if (!req)
80
80
  return;
81
81
  const { reject, resolve } = req;
82
- const response = (0, json_rpc_1.parseJsonRpcResponse)(el);
83
- if ((0, json_rpc_1.isJsonRpcErrorResponse)(response)) {
82
+ const response = json_rpc_1.parseJsonRpcResponse(el);
83
+ if (json_rpc_1.isJsonRpcErrorResponse(response)) {
84
84
  reject(new Error(JSON.stringify(response.error)));
85
85
  }
86
86
  else {
@@ -17,6 +17,8 @@ import { QueryClientImpl as SlashingQueryClient } from "../codec/cosmos/slashing
17
17
  import { QueryClientImpl as StakingQueryClient } from "../codec/cosmos/staking/v1beta1/query";
18
18
  import { QueryClientImpl as UpgradeQueryClient } from "../codec/cosmos/upgrade/v1beta1/query";
19
19
  import { QueryClientImpl as EthermintEVMQueryClient } from "../codec/ethermint/evm/v1/query";
20
+ import { QueryClientImpl as GrantQueryClient } from "../codec/cosmos/authz/v1beta1/query";
21
+ import { QueryClientImpl as FeeGrantQueryClient } from "../codec/cosmos/feegrant/v1beta1/query";
20
22
  import { QueryClientImpl as EvmMergeQueryClient } from "../codec/Switcheo/carbon/evmmerge/query";
21
23
  import { QueryClientImpl as EvmBankQueryClient } from "../codec/Switcheo/carbon/evmbank/query";
22
24
  import { QueryClientImpl as EthermintFeeMarketQueryClient } from "../codec/ethermint/feemarket/v1/query";
@@ -100,6 +102,8 @@ declare class CarbonQueryClient {
100
102
  staking: StakingQueryClient;
101
103
  upgrade: UpgradeQueryClient;
102
104
  cosmosTm: CosmosTmClient;
105
+ grant: GrantQueryClient;
106
+ feegrant: FeeGrantQueryClient;
103
107
  alliance: AllianceClient;
104
108
  chain: BlockchainClient;
105
109
  ibc: IBCClientGroup;
@@ -22,71 +22,75 @@ const query_16 = require("../codec/cosmos/slashing/v1beta1/query");
22
22
  const query_17 = require("../codec/cosmos/staking/v1beta1/query");
23
23
  const query_18 = require("../codec/cosmos/upgrade/v1beta1/query");
24
24
  const query_19 = require("../codec/ethermint/evm/v1/query");
25
- const query_20 = require("../codec/Switcheo/carbon/evmmerge/query");
26
- const query_21 = require("../codec/Switcheo/carbon/evmbank/query");
27
- const query_22 = require("../codec/ethermint/feemarket/v1/query");
28
- const query_23 = require("../codec/Switcheo/carbon/fee/query");
29
- const query_24 = require("../codec/Switcheo/carbon/headersync/query");
30
- const query_25 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
31
- const query_26 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
32
- const query_27 = require("../codec/ibc/applications/transfer/v1/query");
33
- const query_28 = require("../codec/ibc/core/client/v1/query");
34
- const query_29 = require("../codec/ibc/core/connection/v1/query");
35
- const query_30 = require("../codec/ibc/core/channel/v1/query");
36
- const query_31 = require("../codec/Switcheo/carbon/inflation/query");
37
- const query_32 = require("../codec/Switcheo/carbon/insurance/query");
38
- const query_33 = require("../codec/Switcheo/carbon/leverage/query");
39
- const query_34 = require("../codec/Switcheo/carbon/liquidation/query");
40
- const query_35 = require("../codec/Switcheo/carbon/liquiditypool/query");
41
- const query_36 = require("../codec/Switcheo/carbon/market/query");
42
- const query_37 = require("../codec/Switcheo/carbon/marketstats/query");
43
- const query_38 = require("../codec/Switcheo/carbon/misc/query");
44
- const query_39 = require("../codec/Switcheo/carbon/oracle/query");
45
- const query_40 = require("../codec/Switcheo/carbon/order/query");
46
- const query_41 = require("../codec/Switcheo/carbon/position/query");
47
- const query_42 = require("../codec/Switcheo/carbon/pricing/query");
48
- const query_43 = require("../codec/Switcheo/carbon/profile/query");
49
- const query_44 = require("../codec/Switcheo/carbon/subaccount/query");
50
- const query_45 = require("../codec/alliance/alliance/query");
51
- const query_46 = require("../codec/Switcheo/carbon/perpspool/query");
52
- const query_47 = require("../codec/Switcheo/carbon/erc20/query");
25
+ const query_20 = require("../codec/cosmos/authz/v1beta1/query");
26
+ const query_21 = require("../codec/cosmos/feegrant/v1beta1/query");
27
+ const query_22 = require("../codec/Switcheo/carbon/evmmerge/query");
28
+ const query_23 = require("../codec/Switcheo/carbon/evmbank/query");
29
+ const query_24 = require("../codec/ethermint/feemarket/v1/query");
30
+ const query_25 = require("../codec/Switcheo/carbon/fee/query");
31
+ const query_26 = require("../codec/Switcheo/carbon/headersync/query");
32
+ const query_27 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
33
+ const query_28 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
34
+ const query_29 = require("../codec/ibc/applications/transfer/v1/query");
35
+ const query_30 = require("../codec/ibc/core/client/v1/query");
36
+ const query_31 = require("../codec/ibc/core/connection/v1/query");
37
+ const query_32 = require("../codec/ibc/core/channel/v1/query");
38
+ const query_33 = require("../codec/Switcheo/carbon/inflation/query");
39
+ const query_34 = require("../codec/Switcheo/carbon/insurance/query");
40
+ const query_35 = require("../codec/Switcheo/carbon/leverage/query");
41
+ const query_36 = require("../codec/Switcheo/carbon/liquidation/query");
42
+ const query_37 = require("../codec/Switcheo/carbon/liquiditypool/query");
43
+ const query_38 = require("../codec/Switcheo/carbon/market/query");
44
+ const query_39 = require("../codec/Switcheo/carbon/marketstats/query");
45
+ const query_40 = require("../codec/Switcheo/carbon/misc/query");
46
+ const query_41 = require("../codec/Switcheo/carbon/oracle/query");
47
+ const query_42 = require("../codec/Switcheo/carbon/order/query");
48
+ const query_43 = require("../codec/Switcheo/carbon/position/query");
49
+ const query_44 = require("../codec/Switcheo/carbon/pricing/query");
50
+ const query_45 = require("../codec/Switcheo/carbon/profile/query");
51
+ const query_46 = require("../codec/Switcheo/carbon/subaccount/query");
52
+ const query_47 = require("../codec/alliance/alliance/query");
53
+ const query_48 = require("../codec/Switcheo/carbon/perpspool/query");
54
+ const query_49 = require("../codec/Switcheo/carbon/erc20/query");
53
55
  const stargate_1 = require("@cosmjs/stargate");
54
56
  const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
55
57
  class CarbonQueryClient {
56
58
  constructor(opts) {
57
59
  var _a;
58
- const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : (0, stargate_1.createProtobufRpcClient)(new stargate_1.QueryClient(opts.tmClient));
60
+ const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : stargate_1.createProtobufRpcClient(new stargate_1.QueryClient(opts.tmClient));
59
61
  this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
60
62
  this.adl = new query_1.QueryClientImpl(rpcClient);
61
- this.alliance = new query_45.QueryClientImpl(rpcClient);
63
+ this.alliance = new query_47.QueryClientImpl(rpcClient);
62
64
  this.book = new query_2.QueryClientImpl(rpcClient);
63
65
  this.broker = new query_3.QueryClientImpl(rpcClient);
64
66
  this.coin = new query_5.QueryClientImpl(rpcClient);
65
67
  this.cdp = new query_4.QueryClientImpl(rpcClient);
66
- this.fee = new query_23.QueryClientImpl(rpcClient);
67
- this.inflation = new query_31.QueryClientImpl(rpcClient);
68
- this.insurance = new query_32.QueryClientImpl(rpcClient);
69
- this.leverage = new query_33.QueryClientImpl(rpcClient);
70
- this.liquidation = new query_34.QueryClientImpl(rpcClient);
71
- this.liquiditypool = new query_35.QueryClientImpl(rpcClient);
72
- this.market = new query_36.QueryClientImpl(rpcClient);
73
- this.marketstats = new query_37.QueryClientImpl(rpcClient);
74
- this.misc = new query_38.QueryClientImpl(rpcClient);
75
- this.oracle = new query_39.QueryClientImpl(rpcClient);
76
- this.order = new query_40.QueryClientImpl(rpcClient);
77
- this.position = new query_41.QueryClientImpl(rpcClient);
78
- this.pricing = new query_42.QueryClientImpl(rpcClient);
79
- this.profile = new query_43.QueryClientImpl(rpcClient);
80
- this.subaccount = new query_44.QueryClientImpl(rpcClient);
81
- this.headersync = new query_24.QueryClientImpl(rpcClient);
82
- this.evmmerge = new query_20.QueryClientImpl(rpcClient);
83
- this.evmbank = new query_21.QueryClientImpl(rpcClient);
84
- this.perpspool = new query_46.QueryClientImpl(rpcClient);
68
+ this.fee = new query_25.QueryClientImpl(rpcClient);
69
+ this.inflation = new query_33.QueryClientImpl(rpcClient);
70
+ this.insurance = new query_34.QueryClientImpl(rpcClient);
71
+ this.leverage = new query_35.QueryClientImpl(rpcClient);
72
+ this.liquidation = new query_36.QueryClientImpl(rpcClient);
73
+ this.liquiditypool = new query_37.QueryClientImpl(rpcClient);
74
+ this.market = new query_38.QueryClientImpl(rpcClient);
75
+ this.marketstats = new query_39.QueryClientImpl(rpcClient);
76
+ this.misc = new query_40.QueryClientImpl(rpcClient);
77
+ this.oracle = new query_41.QueryClientImpl(rpcClient);
78
+ this.order = new query_42.QueryClientImpl(rpcClient);
79
+ this.position = new query_43.QueryClientImpl(rpcClient);
80
+ this.pricing = new query_44.QueryClientImpl(rpcClient);
81
+ this.profile = new query_45.QueryClientImpl(rpcClient);
82
+ this.subaccount = new query_46.QueryClientImpl(rpcClient);
83
+ this.headersync = new query_26.QueryClientImpl(rpcClient);
84
+ this.evmmerge = new query_22.QueryClientImpl(rpcClient);
85
+ this.evmbank = new query_23.QueryClientImpl(rpcClient);
86
+ this.perpspool = new query_48.QueryClientImpl(rpcClient);
85
87
  this.auth = new query_6.QueryClientImpl(rpcClient);
86
88
  this.bank = new query_7.QueryClientImpl(rpcClient);
87
89
  this.nativeBank = new query_8.QueryClientImpl(rpcClient);
88
90
  this.distribution = new query_10.QueryClientImpl(rpcClient);
89
91
  this.evidence = new query_11.QueryClientImpl(rpcClient);
92
+ this.grant = new query_20.QueryClientImpl(rpcClient);
93
+ this.feegrant = new query_21.QueryClientImpl(rpcClient);
90
94
  this.group = new query_13.QueryClientImpl(rpcClient);
91
95
  this.gov = new query_12.QueryClientImpl(rpcClient);
92
96
  this.mint = new query_14.QueryClientImpl(rpcClient);
@@ -95,19 +99,19 @@ class CarbonQueryClient {
95
99
  this.staking = new query_17.QueryClientImpl(rpcClient);
96
100
  this.upgrade = new query_18.QueryClientImpl(rpcClient);
97
101
  this.cosmosTm = new query_9.ServiceClientImpl(rpcClient);
98
- this.alliance = new query_45.QueryClientImpl(rpcClient);
99
- this.erc20 = new query_47.QueryClientImpl(rpcClient);
102
+ this.alliance = new query_47.QueryClientImpl(rpcClient);
103
+ this.erc20 = new query_49.QueryClientImpl(rpcClient);
100
104
  this.ibc = {
101
- controller: new query_25.QueryClientImpl(rpcClient),
102
- host: new query_26.QueryClientImpl(rpcClient),
103
- transfer: new query_27.QueryClientImpl(rpcClient),
104
- client: new query_28.QueryClientImpl(rpcClient),
105
- connection: new query_29.QueryClientImpl(rpcClient),
106
- channel: new query_30.QueryClientImpl(rpcClient),
105
+ controller: new query_27.QueryClientImpl(rpcClient),
106
+ host: new query_28.QueryClientImpl(rpcClient),
107
+ transfer: new query_29.QueryClientImpl(rpcClient),
108
+ client: new query_30.QueryClientImpl(rpcClient),
109
+ connection: new query_31.QueryClientImpl(rpcClient),
110
+ channel: new query_32.QueryClientImpl(rpcClient),
107
111
  };
108
112
  this.ethermint = {
109
113
  evm: new query_19.QueryClientImpl(rpcClient),
110
- feeMarket: new query_22.QueryClientImpl(rpcClient),
114
+ feeMarket: new query_24.QueryClientImpl(rpcClient),
111
115
  };
112
116
  }
113
117
  }
@@ -44,15 +44,15 @@ class ETHClient {
44
44
  ?
45
45
  this.tokenClient.getBlockchainV2(token.denom) == ETHClient.BLOCKCHAINV2_MAPPING[this.blockchain]
46
46
  :
47
- (0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), api.network) == this.blockchain;
47
+ blockchain_1.blockchainForChainId(token.chainId.toNumber(), api.network) == this.blockchain;
48
48
  return isCorrectBlockchain &&
49
49
  token.tokenAddress.length == 40 &&
50
- token.bridgeAddress.toLowerCase() == (0, generic_1.stripHexPrefix)(lockProxyAddress) &&
50
+ token.bridgeAddress.toLowerCase() == generic_1.stripHexPrefix(lockProxyAddress) &&
51
51
  (!whitelistDenoms || whitelistDenoms.includes(token.denom)) &&
52
- this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress));
52
+ this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
53
53
  });
54
54
  const assetIds = tokens.map((token) => {
55
- return this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress));
55
+ return this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
56
56
  });
57
57
  const provider = this.getProvider();
58
58
  const contractAddress = this.getBalanceReaderAddress();
@@ -101,14 +101,14 @@ class ETHClient {
101
101
  }
102
102
  const carbonNetwork = networkConfig.network;
103
103
  const fromTokenId = fromToken.id;
104
- const fromTokenAddress = (0, generic_1.appendHexPrefix)(fromToken.tokenAddress);
104
+ const fromTokenAddress = generic_1.appendHexPrefix(fromToken.tokenAddress);
105
105
  const toTokenDenom = toToken.denom;
106
106
  const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
107
107
  const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
108
108
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
109
109
  const nonce = yield this.getTxNonce(fromAddress, params.nonce, rpcProvider);
110
110
  const contract = new ethers_1.ethers.Contract(this.getBridgeEntranceAddr(), eth_1.ABIs.bridgeEntrance, rpcProvider);
111
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
111
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
112
112
  const tokenCreator = fromToken.creator;
113
113
  const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator, carbonNetwork);
114
114
  const targetProxyHash = ethers_1.ethers.utils.hexlify(targetAddressBytes);
@@ -137,9 +137,9 @@ class ETHClient {
137
137
  throw new Error("Minimum gas required: 150,000");
138
138
  }
139
139
  const networkConfig = this.getNetworkConfig();
140
- const assetId = (0, generic_1.appendHexPrefix)(token.tokenAddress);
141
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(token));
142
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
140
+ const assetId = generic_1.appendHexPrefix(token.tokenAddress);
141
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
142
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
143
143
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
144
144
  const swthAddress = ethers_1.ethers.utils.hexlify(address);
145
145
  const contractAddress = this.getLockProxyAddress();
@@ -190,15 +190,15 @@ class ETHClient {
190
190
  return "insufficient balance";
191
191
  }
192
192
  const networkConfig = this.getNetworkConfig();
193
- const assetId = (0, generic_1.appendHexPrefix)(tokenWithExternalBalances.tokenAddress);
194
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(tokenWithExternalBalances));
195
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
193
+ const assetId = generic_1.appendHexPrefix(tokenWithExternalBalances.tokenAddress);
194
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(tokenWithExternalBalances));
195
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
196
196
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(tokenWithExternalBalances.id));
197
197
  const nonce = Math.floor(Math.random() * 1000000000); // random nonce to prevent replay attacks
198
198
  const message = ethers_1.ethers.utils.solidityKeccak256(["string", "address", "bytes", "bytes", "bytes", "uint256", "uint256", "uint256"], ["sendTokens", assetId, targetProxyHash, toAssetHash, feeAddress, amount, feeAmount, nonce]);
199
199
  // logger("sendDeposit message", message)
200
200
  const { address, signature } = yield getSignatureCallback(message);
201
- const signatureBytes = ethers_1.ethers.utils.arrayify((0, generic_1.appendHexPrefix)(signature));
201
+ const signatureBytes = ethers_1.ethers.utils.arrayify(generic_1.appendHexPrefix(signature));
202
202
  const rsv = ethers_1.ethers.utils.splitSignature(signatureBytes);
203
203
  // logger("sign result", address, signature)
204
204
  const signatureResult = {
@@ -237,7 +237,7 @@ class ETHClient {
237
237
  if (!feeInfo.deposit_fee) {
238
238
  throw new Error("unsupported token");
239
239
  }
240
- if ((0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
240
+ if (blockchain_1.blockchainForChainId(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
241
241
  throw new Error("unsupported token");
242
242
  }
243
243
  let feeAmount = ethers_1.ethers.BigNumber.from(feeInfo.deposit_fee);
@@ -303,7 +303,7 @@ class ETHClient {
303
303
  getTargetProxyHash(token) {
304
304
  const networkConfig = this.getNetworkConfig();
305
305
  const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
306
- const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
306
+ const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
307
307
  return addressHex;
308
308
  }
309
309
  getProvider() {
@@ -29,7 +29,7 @@ exports.HydrogenEndpoints = {
29
29
  const formatDateField = (value) => {
30
30
  if (typeof value !== "string")
31
31
  return null;
32
- return (0, dayjs_1.default)(value);
32
+ return dayjs_1.default(value);
33
33
  };
34
34
  // temporary function to parse okt/okc blockchain
35
35
  // to remove when automatic deposit/withdraw feature is deployed
@@ -101,12 +101,12 @@ class InsightsQueryClient {
101
101
  const meta = response.data.result.meta;
102
102
  const parsedEntries = rawEntries.map(entry => ({
103
103
  lastHeight: entry.lastHeight,
104
- time: (0, dayjs_1.default)(entry.time),
104
+ time: dayjs_1.default(entry.time),
105
105
  volumeValue: new bignumber_js_1.default(entry.volumeValue),
106
106
  }));
107
107
  const parsedMeta = {
108
- from: (0, dayjs_1.default)(meta.from),
109
- until: (0, dayjs_1.default)(meta.until),
108
+ from: dayjs_1.default(meta.from),
109
+ until: dayjs_1.default(meta.until),
110
110
  interval: meta.interval,
111
111
  };
112
112
  return { result: { entries: parsedEntries, meta: parsedMeta } };
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -72,13 +68,13 @@ class NEOClient {
72
68
  ?
73
69
  !!sdk.token.getBlockchainV2(token.denom) && (blockchain_1.BLOCKCHAIN_V2_TO_V1_MAPPING[sdk.token.getBlockchainV2(token.denom)] == this.blockchain)
74
70
  :
75
- (0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), sdk.network) == this.blockchain;
71
+ blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain;
76
72
  return (isCorrectBlockchain || token.denom === "swth") && token.tokenAddress.length == 40 && token.bridgeAddress.length == 40;
77
73
  });
78
74
  const client = new Neon.rpc.RPCClient(url, "2.5.2"); // TODO: should we change the RPC version??
79
75
  // NOTE: fetching of tokens is chunked in sets of 15 as we may hit
80
76
  // the gas limit on the RPC node and error out otherwise
81
- const promises = (0, lodash_1.chunk)(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
77
+ const promises = lodash_1.chunk(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
82
78
  var _a, _b, _c;
83
79
  const acc = {};
84
80
  for (const token of partition) {
@@ -120,8 +116,8 @@ class NEOClient {
120
116
  const targetProxyHash = this.getTargetProxyHash(token);
121
117
  const toAssetHash = Neon.u.str2hexstring(token.id);
122
118
  const addressBytes = address_1.SWTHAddress.getAddressBytes(swthAddress, networkConfig.network);
123
- const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
124
- const zeroAddressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
119
+ const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
120
+ const zeroAddressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
125
121
  const amount = ethers_1.ethers.BigNumber.from(token.externalBalance);
126
122
  const feeAmount = ethers_1.ethers.BigNumber.from(feeAmountInput !== null && feeAmountInput !== void 0 ? feeAmountInput : "100000000");
127
123
  const feeAddress = feeAmount.isZero() ? zeroAddressHex : networkConfig.feeAddress;
@@ -166,7 +162,7 @@ class NEOClient {
166
162
  const fromAddress = util_1.AddressUtils.NEOAddress.publicKeyToAddress(publicKeyOutput.publicKey);
167
163
  const targetProxyHash = this.getTargetProxyHash(token);
168
164
  const toAssetHash = Neon.u.str2hexstring(token.id);
169
- const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(address));
165
+ const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
170
166
  const nonce = Math.floor(Math.random() * 1000000);
171
167
  if (amount.lt(feeAmount)) {
172
168
  throw new Error("Invalid amount");
@@ -202,7 +198,7 @@ class NEOClient {
202
198
  const fromAddress = ledger.scriptHash;
203
199
  const targetProxyHash = this.getTargetProxyHash(token);
204
200
  const toAssetHash = Neon.u.str2hexstring(token.id);
205
- const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(address));
201
+ const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
206
202
  const feeAddress = networkConfig.feeAddress;
207
203
  const nonce = Math.floor(Math.random() * 1000000);
208
204
  if (amount.lt(feeAmount)) {
@@ -317,7 +313,7 @@ class NEOClient {
317
313
  getTargetProxyHash(token) {
318
314
  const networkConfig = this.getNetworkConfig();
319
315
  const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
320
- const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
316
+ const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
321
317
  return addressHex;
322
318
  }
323
319
  getNetworkConfig() {
@@ -543,7 +543,7 @@ class TokenClient {
543
543
  if (!token)
544
544
  return undefined;
545
545
  const bridge = this.getBridgeFromToken(token);
546
- if (!bridge || !(0, blockchain_1.isIbcBridge)(bridge))
546
+ if (!bridge || !blockchain_1.isIbcBridge(bridge))
547
547
  return undefined;
548
548
  return bridge.chain_id_name;
549
549
  }
@@ -622,7 +622,7 @@ class TokenClient {
622
622
  processTokenPrices(tokenPrices) {
623
623
  return tokenPrices.reduce((prevPrices, price) => {
624
624
  const newPrev = prevPrices;
625
- newPrev[price.denom] = (0, number_1.bnOrZero)(price.twap).shiftedBy(-constant_1.decTypeDecimals);
625
+ newPrev[price.denom] = number_1.bnOrZero(price.twap).shiftedBy(-constant_1.decTypeDecimals);
626
626
  return newPrev;
627
627
  }, {});
628
628
  }
@@ -77,12 +77,12 @@ class ZILClient {
77
77
  ?
78
78
  !!sdk.token.getBlockchainV2(token.denom) && (blockchain_1.BLOCKCHAIN_V2_TO_V1_MAPPING[sdk.token.getBlockchainV2(token.denom)] == this.blockchain)
79
79
  :
80
- (0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), sdk.network) == this.blockchain;
80
+ blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain;
81
81
  return isCorrectBlockchain && token.tokenAddress.length == 40 && (!whitelistDenoms || whitelistDenoms.includes(token.denom));
82
82
  });
83
83
  const requests = tokens.map((token) => token.tokenAddress === zeroAddress
84
- ? (0, exports.balanceBatchRequest)(address.replace(/^0x/i, ""))
85
- : (0, exports.tokenBalanceBatchRequest)(token.tokenAddress, address));
84
+ ? exports.balanceBatchRequest(address.replace(/^0x/i, ""))
85
+ : exports.tokenBalanceBatchRequest(token.tokenAddress, address));
86
86
  const response = yield fetch(this.getProviderUrl(), {
87
87
  method: "post",
88
88
  headers: { "content-type": "application/json" },
@@ -107,7 +107,7 @@ class ZILClient {
107
107
  // if (!isValidAddress) {
108
108
  // throw new Error("invalid address")
109
109
  // }
110
- return (0, zilliqa_1.fromBech32Address)(bech32Address).toLowerCase().substr(2);
110
+ return zilliqa_1.fromBech32Address(bech32Address).toLowerCase().substr(2);
111
111
  });
112
112
  }
113
113
  // see examplesV2/zil_client.ts on how to confirm the transactions
@@ -153,7 +153,7 @@ class ZILClient {
153
153
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
154
154
  }
155
155
  const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
156
- const balanceAndNonceResp = yield zilliqa.blockchain.getBalance((0, generic_1.stripHexPrefix)(zilAddress));
156
+ const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(zilAddress));
157
157
  if (balanceAndNonceResp.error !== undefined) {
158
158
  throw new Error(balanceAndNonceResp.error.message);
159
159
  }
@@ -171,7 +171,7 @@ class ZILClient {
171
171
  vname: "spender",
172
172
  type: "ByStr20",
173
173
  // TODO: Check if bridgeAddress corresponds to carbon token lock_proxy_hash
174
- value: spenderAddress !== null && spenderAddress !== void 0 ? spenderAddress : (0, generic_1.appendHexPrefix)(token.bridgeAddress),
174
+ value: spenderAddress !== null && spenderAddress !== void 0 ? spenderAddress : generic_1.appendHexPrefix(token.bridgeAddress),
175
175
  },
176
176
  {
177
177
  vname: "amount",
@@ -189,7 +189,7 @@ class ZILClient {
189
189
  }
190
190
  checkAllowanceZRC2(token, owner, spender) {
191
191
  return __awaiter(this, void 0, void 0, function* () {
192
- const contractAddress = (0, generic_1.appendHexPrefix)(token.tokenAddress);
192
+ const contractAddress = generic_1.appendHexPrefix(token.tokenAddress);
193
193
  const zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
194
194
  const resp = yield zilliqa.blockchain.getSmartContractSubState(contractAddress, "allowances", [owner, spender]);
195
195
  if (resp.error !== undefined) {
@@ -211,13 +211,13 @@ class ZILClient {
211
211
  }
212
212
  const carbonNetwork = networkConfig.network;
213
213
  const fromTokenId = fromToken.id;
214
- const fromTokenAddr = (0, generic_1.appendHexPrefix)(fromToken.tokenAddress);
214
+ const fromTokenAddr = generic_1.appendHexPrefix(fromToken.tokenAddress);
215
215
  const toTokenDenom = toToken.denom;
216
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(fromToken));
216
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(fromToken));
217
217
  const recoveryAddressHex = ethers_1.ethers.utils.hexlify(index_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
218
218
  const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
219
219
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
220
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
220
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
221
221
  const contractAddress = this.getBridgeEntranceAddr();
222
222
  let zilliqa;
223
223
  if (typeof signer === "string") {
@@ -232,7 +232,7 @@ class ZILClient {
232
232
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
233
233
  }
234
234
  const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
235
- const balanceAndNonceResp = yield zilliqa.blockchain.getBalance((0, generic_1.stripHexPrefix)(fromAddress));
235
+ const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(fromAddress));
236
236
  if (balanceAndNonceResp.error !== undefined) {
237
237
  throw new Error(balanceAndNonceResp.error.message);
238
238
  }
@@ -309,13 +309,13 @@ class ZILClient {
309
309
  return __awaiter(this, void 0, void 0, function* () {
310
310
  const { address, amount, token, gasPrice, gasLimit, zilAddress, signer } = params;
311
311
  const networkConfig = this.getNetworkConfig();
312
- const assetId = (0, generic_1.appendHexPrefix)(token.tokenAddress);
313
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(token));
314
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
312
+ const assetId = generic_1.appendHexPrefix(token.tokenAddress);
313
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
314
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
315
315
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
316
316
  const swthAddress = ethers_1.ethers.utils.hexlify(address);
317
317
  // TODO: Check if bridgeAddress corresponds to carbon token lock_proxy_hash
318
- const contractAddress = (0, generic_1.appendHexPrefix)(token.bridgeAddress);
318
+ const contractAddress = generic_1.appendHexPrefix(token.bridgeAddress);
319
319
  let zilliqa;
320
320
  if (typeof signer === "string") {
321
321
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
@@ -329,7 +329,7 @@ class ZILClient {
329
329
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
330
330
  }
331
331
  const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
332
- const balanceAndNonceResp = yield zilliqa.blockchain.getBalance((0, generic_1.stripHexPrefix)(zilAddress));
332
+ const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(zilAddress));
333
333
  if (balanceAndNonceResp.error !== undefined) {
334
334
  throw new Error(balanceAndNonceResp.error.message);
335
335
  }
@@ -414,7 +414,7 @@ class ZILClient {
414
414
  getTargetProxyHash(token) {
415
415
  const networkConfig = this.getNetworkConfig();
416
416
  const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
417
- const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
417
+ const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
418
418
  return addressHex;
419
419
  }
420
420
  getNetworkConfig() {