carbon-js-sdk 0.2.16-dev.4 → 0.2.17

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 (296) hide show
  1. package/lib/CarbonSDK.d.ts +1 -13
  2. package/lib/CarbonSDK.js +2 -31
  3. package/lib/clients/CarbonQueryClient.js +2 -2
  4. package/lib/clients/ETHClient.d.ts +1 -1
  5. package/lib/clients/ETHClient.js +15 -15
  6. package/lib/clients/HydrogenClient.js +1 -1
  7. package/lib/clients/N3Client.js +2 -3
  8. package/lib/clients/NEOClient.d.ts +1 -1
  9. package/lib/clients/NEOClient.js +7 -7
  10. package/lib/clients/TokenClient.d.ts +0 -5
  11. package/lib/clients/TokenClient.js +10 -38
  12. package/lib/clients/ZILClient.d.ts +1 -1
  13. package/lib/clients/ZILClient.js +16 -16
  14. package/lib/codec/book/genesis.d.ts +1 -1
  15. package/lib/codec/book/genesis.js +1 -1
  16. package/lib/codec/book/query.d.ts +1 -1
  17. package/lib/codec/book/query.js +1 -1
  18. package/lib/codec/broker/genesis.d.ts +1 -1
  19. package/lib/codec/broker/genesis.js +1 -1
  20. package/lib/codec/broker/query.d.ts +3 -3
  21. package/lib/codec/broker/query.js +3 -3
  22. package/lib/codec/btcx/denom_cross_chain_info.d.ts +1 -1
  23. package/lib/codec/btcx/denom_cross_chain_info.js +1 -1
  24. package/lib/codec/btcx/query.d.ts +1 -1
  25. package/lib/codec/btcx/query.js +1 -1
  26. package/lib/codec/ccm/genesis.d.ts +1 -1
  27. package/lib/codec/ccm/genesis.js +1 -1
  28. package/lib/codec/cdp/event.d.ts +22 -389
  29. package/lib/codec/cdp/event.js +83 -2494
  30. package/lib/codec/cdp/genesis.d.ts +4 -97
  31. package/lib/codec/cdp/genesis.js +23 -648
  32. package/lib/codec/cdp/query.d.ts +89 -439
  33. package/lib/codec/cdp/query.js +173 -1991
  34. package/lib/codec/cdp/tx.d.ts +96 -760
  35. package/lib/codec/cdp/tx.js +235 -3645
  36. package/lib/codec/coin/event.d.ts +1 -1
  37. package/lib/codec/coin/event.js +1 -1
  38. package/lib/codec/coin/genesis.d.ts +2 -2
  39. package/lib/codec/coin/genesis.js +2 -2
  40. package/lib/codec/coin/proposal.d.ts +1 -1
  41. package/lib/codec/coin/proposal.js +1 -1
  42. package/lib/codec/coin/query.d.ts +2 -2
  43. package/lib/codec/coin/query.js +2 -2
  44. package/lib/codec/coin/tx.d.ts +1 -1
  45. package/lib/codec/coin/tx.js +1 -1
  46. package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
  47. package/lib/codec/cosmos/auth/v1beta1/genesis.js +1 -1
  48. package/lib/codec/cosmos/auth/v1beta1/query.d.ts +2 -2
  49. package/lib/codec/cosmos/auth/v1beta1/query.js +2 -2
  50. package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -1
  51. package/lib/codec/cosmos/authz/v1beta1/genesis.js +1 -1
  52. package/lib/codec/cosmos/authz/v1beta1/query.d.ts +2 -2
  53. package/lib/codec/cosmos/authz/v1beta1/query.js +2 -2
  54. package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +1 -1
  55. package/lib/codec/cosmos/authz/v1beta1/tx.js +1 -1
  56. package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +1 -1
  57. package/lib/codec/cosmos/bank/v1beta1/authz.js +1 -1
  58. package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +1 -1
  59. package/lib/codec/cosmos/bank/v1beta1/bank.js +1 -1
  60. package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +2 -2
  61. package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
  62. package/lib/codec/cosmos/bank/v1beta1/query.d.ts +3 -3
  63. package/lib/codec/cosmos/bank/v1beta1/query.js +3 -3
  64. package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +2 -2
  65. package/lib/codec/cosmos/bank/v1beta1/tx.js +2 -2
  66. package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +1 -1
  67. package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1 -1
  68. package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +1 -1
  69. package/lib/codec/cosmos/capability/v1beta1/genesis.js +1 -1
  70. package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +1 -1
  71. package/lib/codec/cosmos/crisis/v1beta1/genesis.js +1 -1
  72. package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +1 -1
  73. package/lib/codec/cosmos/distribution/v1beta1/distribution.js +1 -1
  74. package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +2 -2
  75. package/lib/codec/cosmos/distribution/v1beta1/genesis.js +2 -2
  76. package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +3 -3
  77. package/lib/codec/cosmos/distribution/v1beta1/query.js +3 -3
  78. package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +1 -1
  79. package/lib/codec/cosmos/distribution/v1beta1/tx.js +1 -1
  80. package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +1 -1
  81. package/lib/codec/cosmos/evidence/v1beta1/query.js +1 -1
  82. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +1 -1
  83. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +1 -1
  84. package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +1 -1
  85. package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +1 -1
  86. package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +2 -2
  87. package/lib/codec/cosmos/feegrant/v1beta1/query.js +2 -2
  88. package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +1 -1
  89. package/lib/codec/cosmos/gov/v1beta1/genesis.js +1 -1
  90. package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +1 -1
  91. package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
  92. package/lib/codec/cosmos/gov/v1beta1/query.d.ts +2 -2
  93. package/lib/codec/cosmos/gov/v1beta1/query.js +4 -4
  94. package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
  95. package/lib/codec/cosmos/gov/v1beta1/tx.js +4 -4
  96. package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
  97. package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
  98. package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
  99. package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
  100. package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
  101. package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
  102. package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
  103. package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
  104. package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
  105. package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
  106. package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
  107. package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
  108. package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
  109. package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
  110. package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
  111. package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
  112. package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
  113. package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
  114. package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
  115. package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
  116. package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +1 -1
  117. package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +1 -1
  118. package/lib/codec/cosmos/tx/v1beta1/service.d.ts +3 -3
  119. package/lib/codec/cosmos/tx/v1beta1/service.js +3 -3
  120. package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
  121. package/lib/codec/cosmos/tx/v1beta1/tx.js +5 -5
  122. package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
  123. package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
  124. package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
  125. package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
  126. package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
  127. package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
  128. package/lib/codec/fee/genesis.d.ts +1 -1
  129. package/lib/codec/fee/genesis.js +1 -1
  130. package/lib/codec/fee/proposal.d.ts +1 -1
  131. package/lib/codec/fee/proposal.js +1 -1
  132. package/lib/codec/fee/query.d.ts +1 -1
  133. package/lib/codec/fee/query.js +1 -1
  134. package/lib/codec/fee/tx.d.ts +1 -1
  135. package/lib/codec/fee/tx.js +1 -1
  136. package/lib/codec/headersync/genesis.d.ts +1 -1
  137. package/lib/codec/headersync/genesis.js +1 -1
  138. package/lib/codec/headersync/query.d.ts +1 -1
  139. package/lib/codec/headersync/query.js +1 -1
  140. package/lib/codec/index.d.ts +18 -89
  141. package/lib/codec/index.js +180 -463
  142. package/lib/codec/inflation/genesis.d.ts +1 -1
  143. package/lib/codec/inflation/genesis.js +1 -1
  144. package/lib/codec/inflation/query.d.ts +1 -1
  145. package/lib/codec/inflation/query.js +1 -1
  146. package/lib/codec/insurance/genesis.d.ts +1 -1
  147. package/lib/codec/insurance/genesis.js +1 -1
  148. package/lib/codec/leverage/genesis.d.ts +1 -1
  149. package/lib/codec/leverage/genesis.js +1 -1
  150. package/lib/codec/leverage/query.d.ts +1 -1
  151. package/lib/codec/leverage/query.js +1 -1
  152. package/lib/codec/liquidation/genesis.d.ts +1 -1
  153. package/lib/codec/liquidation/genesis.js +1 -1
  154. package/lib/codec/liquidation/query.d.ts +1 -1
  155. package/lib/codec/liquidation/query.js +1 -1
  156. package/lib/codec/liquidation/quote_changes.d.ts +1 -1
  157. package/lib/codec/liquidation/quote_changes.js +1 -1
  158. package/lib/codec/liquiditypool/event.d.ts +2 -2
  159. package/lib/codec/liquiditypool/event.js +2 -2
  160. package/lib/codec/liquiditypool/genesis.d.ts +2 -2
  161. package/lib/codec/liquiditypool/genesis.js +2 -2
  162. package/lib/codec/liquiditypool/liquiditypool.d.ts +0 -3
  163. package/lib/codec/liquiditypool/liquiditypool.js +1 -44
  164. package/lib/codec/liquiditypool/proposal.d.ts +1 -1
  165. package/lib/codec/liquiditypool/proposal.js +1 -1
  166. package/lib/codec/liquiditypool/query.d.ts +2 -39
  167. package/lib/codec/liquiditypool/query.js +3 -195
  168. package/lib/codec/liquiditypool/tx.d.ts +1 -3
  169. package/lib/codec/liquiditypool/tx.js +1 -35
  170. package/lib/codec/lockproxy/genesis.d.ts +1 -1
  171. package/lib/codec/lockproxy/genesis.js +1 -1
  172. package/lib/codec/lockproxy/query.d.ts +1 -1
  173. package/lib/codec/lockproxy/query.js +1 -1
  174. package/lib/codec/market/event.d.ts +1 -1
  175. package/lib/codec/market/event.js +1 -1
  176. package/lib/codec/market/genesis.d.ts +1 -1
  177. package/lib/codec/market/genesis.js +1 -1
  178. package/lib/codec/market/proposal.d.ts +1 -1
  179. package/lib/codec/market/proposal.js +1 -1
  180. package/lib/codec/market/query.d.ts +1 -1
  181. package/lib/codec/market/query.js +1 -1
  182. package/lib/codec/market/tx.d.ts +1 -1
  183. package/lib/codec/market/tx.js +1 -1
  184. package/lib/codec/marketstats/genesis.d.ts +1 -1
  185. package/lib/codec/marketstats/genesis.js +1 -1
  186. package/lib/codec/marketstats/query.d.ts +2 -2
  187. package/lib/codec/marketstats/query.js +2 -2
  188. package/lib/codec/misc/message.d.ts +1 -1
  189. package/lib/codec/misc/message.js +1 -1
  190. package/lib/codec/misc/query.d.ts +3 -3
  191. package/lib/codec/misc/query.js +3 -3
  192. package/lib/codec/misc/transaction.d.ts +1 -1
  193. package/lib/codec/misc/transaction.js +1 -1
  194. package/lib/codec/oracle/event.d.ts +1 -1
  195. package/lib/codec/oracle/event.js +1 -1
  196. package/lib/codec/oracle/genesis.d.ts +1 -4
  197. package/lib/codec/oracle/genesis.js +3 -34
  198. package/lib/codec/oracle/proposal.d.ts +1 -1
  199. package/lib/codec/oracle/proposal.js +1 -1
  200. package/lib/codec/oracle/query.d.ts +2 -2
  201. package/lib/codec/oracle/query.js +2 -2
  202. package/lib/codec/order/event.d.ts +1 -1
  203. package/lib/codec/order/event.js +1 -1
  204. package/lib/codec/order/genesis.d.ts +1 -1
  205. package/lib/codec/order/genesis.js +1 -1
  206. package/lib/codec/order/query.d.ts +1 -1
  207. package/lib/codec/order/query.js +1 -1
  208. package/lib/codec/position/event.d.ts +1 -1
  209. package/lib/codec/position/event.js +1 -1
  210. package/lib/codec/position/genesis.d.ts +1 -1
  211. package/lib/codec/position/genesis.js +1 -1
  212. package/lib/codec/position/query.d.ts +1 -1
  213. package/lib/codec/position/query.js +1 -1
  214. package/lib/codec/pricing/event.d.ts +1 -56
  215. package/lib/codec/pricing/event.js +2 -298
  216. package/lib/codec/pricing/genesis.d.ts +1 -2
  217. package/lib/codec/pricing/genesis.js +5 -20
  218. package/lib/codec/pricing/pricing.d.ts +0 -14
  219. package/lib/codec/pricing/pricing.js +1 -103
  220. package/lib/codec/pricing/query.d.ts +1 -68
  221. package/lib/codec/pricing/query.js +2 -321
  222. package/lib/codec/pricing/tx.d.ts +0 -96
  223. package/lib/codec/pricing/tx.js +1 -399
  224. package/lib/codec/profile/event.d.ts +1 -1
  225. package/lib/codec/profile/event.js +1 -1
  226. package/lib/codec/profile/genesis.d.ts +1 -1
  227. package/lib/codec/profile/genesis.js +1 -1
  228. package/lib/codec/profile/query.d.ts +1 -1
  229. package/lib/codec/profile/query.js +1 -1
  230. package/lib/codec/subaccount/genesis.d.ts +1 -1
  231. package/lib/codec/subaccount/genesis.js +1 -1
  232. package/lib/codec/subaccount/query.d.ts +1 -1
  233. package/lib/codec/subaccount/query.js +1 -1
  234. package/lib/codec/tendermint/abci/types.d.ts +4 -4
  235. package/lib/codec/tendermint/abci/types.js +4 -4
  236. package/lib/codec/tendermint/types/block.d.ts +2 -2
  237. package/lib/codec/tendermint/types/block.js +2 -2
  238. package/lib/codec/tendermint/types/evidence.d.ts +2 -2
  239. package/lib/codec/tendermint/types/evidence.js +2 -2
  240. package/lib/codec/tendermint/types/types.d.ts +3 -3
  241. package/lib/codec/tendermint/types/types.js +3 -3
  242. package/lib/codec/tendermint/types/validator.d.ts +1 -1
  243. package/lib/codec/tendermint/types/validator.js +1 -1
  244. package/lib/constant/generic.js +1 -1
  245. package/lib/constant/token.d.ts +0 -4
  246. package/lib/constant/token.js +1 -5
  247. package/lib/modules/admin.d.ts +7 -114
  248. package/lib/modules/admin.js +53 -275
  249. package/lib/modules/cdp.d.ts +13 -152
  250. package/lib/modules/cdp.js +20 -800
  251. package/lib/modules/gov.js +14 -14
  252. package/lib/modules/liquiditypool.d.ts +0 -3
  253. package/lib/modules/liquiditypool.js +1 -3
  254. package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
  255. package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
  256. package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
  257. package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
  258. package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
  259. package/lib/provider/amino/types/admin.js +26 -91
  260. package/lib/provider/amino/types/bank.js +1 -1
  261. package/lib/provider/amino/types/broker.js +1 -1
  262. package/lib/provider/amino/types/cdp.js +24 -135
  263. package/lib/provider/amino/types/coin.js +2 -2
  264. package/lib/provider/amino/types/gov.js +4 -4
  265. package/lib/provider/amino/types/ibc.js +1 -1
  266. package/lib/provider/amino/types/leverage.js +1 -1
  267. package/lib/provider/amino/types/liquidityPool.js +7 -9
  268. package/lib/provider/amino/types/market.js +1 -1
  269. package/lib/provider/amino/types/oracle.js +1 -1
  270. package/lib/provider/amino/types/order.js +4 -4
  271. package/lib/provider/amino/types/position.js +1 -1
  272. package/lib/provider/amino/types/profile.js +1 -1
  273. package/lib/provider/amino/types/staking.js +4 -4
  274. package/lib/provider/amino/types/subaccount.js +3 -3
  275. package/lib/provider/amino/utils.js +11 -11
  276. package/lib/provider/keplr/KeplrStore.js +1 -1
  277. package/lib/provider/ledger/ledger.js +2 -2
  278. package/lib/provider/metamask/MetaMask.js +1 -1
  279. package/lib/provider/o3/O3Wallet.js +2 -2
  280. package/lib/util/address.d.ts +0 -1
  281. package/lib/util/address.js +13 -21
  282. package/lib/util/api.js +4 -4
  283. package/lib/util/fetch.js +1 -1
  284. package/lib/util/generic.js +3 -3
  285. package/lib/util/number.d.ts +0 -1
  286. package/lib/util/number.js +6 -7
  287. package/lib/util/tx.d.ts +10 -74
  288. package/lib/wallet/CarbonSigner.js +2 -2
  289. package/lib/wallet/CarbonSigningClient.js +8 -8
  290. package/lib/wallet/CarbonWallet.js +7 -6
  291. package/lib/websocket/channel.js +21 -115
  292. package/lib/websocket/connector.js +3 -3
  293. package/lib/websocket/models.d.ts +0 -156
  294. package/lib/websocket/types.d.ts +3 -87
  295. package/lib/websocket/types.js +0 -31
  296. package/package.json +1 -1
@@ -37,7 +37,6 @@ const MsgCreatePool = {
37
37
  swapFee: utils_1.ConvertEncType.Dec,
38
38
  tokenAWeight: utils_1.ConvertEncType.Dec,
39
39
  tokenBWeight: utils_1.ConvertEncType.Dec,
40
- ampBps: utils_1.ConvertEncType.Long,
41
40
  },
42
41
  };
43
42
  const MsgCreatePoolWithLiquidity = {
@@ -47,7 +46,6 @@ const MsgCreatePoolWithLiquidity = {
47
46
  tokenBWeight: utils_1.ConvertEncType.Dec,
48
47
  swapFee: utils_1.ConvertEncType.Dec,
49
48
  numQuotes: utils_1.ConvertEncType.Long,
50
- ampBps: utils_1.ConvertEncType.Long,
51
49
  },
52
50
  };
53
51
  const MsgAddLiquidity = {
@@ -95,12 +93,12 @@ const commitTokensProcess = {
95
93
  },
96
94
  };
97
95
  const LiquidityPoolAmino = {
98
- [CarbonTx.Types.MsgCreatePool]: utils_1.generateAminoType(MsgCreatePool),
99
- [CarbonTx.Types.MsgCreatePoolWithLiquidity]: utils_1.generateAminoType(MsgCreatePoolWithLiquidity),
100
- [CarbonTx.Types.MsgAddLiquidity]: utils_1.generateAminoType(MsgAddLiquidity),
101
- [CarbonTx.Types.MsgRemoveLiquidity]: utils_1.generateAminoType(MsgRemoveLiquidity),
102
- [CarbonTx.Types.MsgStakePoolToken]: utils_1.generateAminoType(MsgStakePoolToken, commitTokensProcess),
103
- [CarbonTx.Types.MsgUnstakePoolToken]: utils_1.generateAminoType(MsgUnstakePoolToken),
104
- [CarbonTx.Types.MsgClaimPoolRewards]: utils_1.generateAminoType(MsgClaimPoolRewards),
96
+ [CarbonTx.Types.MsgCreatePool]: (0, utils_1.generateAminoType)(MsgCreatePool),
97
+ [CarbonTx.Types.MsgCreatePoolWithLiquidity]: (0, utils_1.generateAminoType)(MsgCreatePoolWithLiquidity),
98
+ [CarbonTx.Types.MsgAddLiquidity]: (0, utils_1.generateAminoType)(MsgAddLiquidity),
99
+ [CarbonTx.Types.MsgRemoveLiquidity]: (0, utils_1.generateAminoType)(MsgRemoveLiquidity),
100
+ [CarbonTx.Types.MsgStakePoolToken]: (0, utils_1.generateAminoType)(MsgStakePoolToken, commitTokensProcess),
101
+ [CarbonTx.Types.MsgUnstakePoolToken]: (0, utils_1.generateAminoType)(MsgUnstakePoolToken),
102
+ [CarbonTx.Types.MsgClaimPoolRewards]: (0, utils_1.generateAminoType)(MsgClaimPoolRewards),
105
103
  };
106
104
  exports.default = LiquidityPoolAmino;
@@ -41,6 +41,6 @@ const MsgUpdateMarket = {
41
41
  },
42
42
  };
43
43
  const MarketAmino = {
44
- [CarbonTx.Types.MsgUpdateMarket]: utils_1.generateAminoType(MsgUpdateMarket),
44
+ [CarbonTx.Types.MsgUpdateMarket]: (0, utils_1.generateAminoType)(MsgUpdateMarket),
45
45
  };
46
46
  exports.default = MarketAmino;
@@ -31,6 +31,6 @@ const MsgCreateVote = {
31
31
  },
32
32
  };
33
33
  const OracleAmino = {
34
- [CarbonTx.Types.MsgCreateVote]: utils_1.generateAminoType(MsgCreateVote),
34
+ [CarbonTx.Types.MsgCreateVote]: (0, utils_1.generateAminoType)(MsgCreateVote),
35
35
  };
36
36
  exports.default = OracleAmino;
@@ -80,9 +80,9 @@ const createOrderProcess = {
80
80
  },
81
81
  };
82
82
  const OrderAmino = {
83
- [CarbonTx.Types.MsgCreateOrder]: utils_1.generateAminoType(MsgCreateOrder, createOrderProcess),
84
- [CarbonTx.Types.MsgCancelOrder]: utils_1.generateAminoType(MsgCancelOrder),
85
- [CarbonTx.Types.MsgEditOrder]: utils_1.generateAminoType(MsgEditOrder),
86
- [CarbonTx.Types.MsgCancelAll]: utils_1.generateAminoType(MsgCancelAll),
83
+ [CarbonTx.Types.MsgCreateOrder]: (0, utils_1.generateAminoType)(MsgCreateOrder, createOrderProcess),
84
+ [CarbonTx.Types.MsgCancelOrder]: (0, utils_1.generateAminoType)(MsgCancelOrder),
85
+ [CarbonTx.Types.MsgEditOrder]: (0, utils_1.generateAminoType)(MsgEditOrder),
86
+ [CarbonTx.Types.MsgCancelAll]: (0, utils_1.generateAminoType)(MsgCancelAll),
87
87
  };
88
88
  exports.default = OrderAmino;
@@ -29,6 +29,6 @@ const MsgSetMargin = {
29
29
  valueMap: {},
30
30
  };
31
31
  const PositionAmino = {
32
- [CarbonTx.Types.MsgSetMargin]: utils_1.generateAminoType(MsgSetMargin),
32
+ [CarbonTx.Types.MsgSetMargin]: (0, utils_1.generateAminoType)(MsgSetMargin),
33
33
  };
34
34
  exports.default = PositionAmino;
@@ -45,6 +45,6 @@ const updateProfileProcess = {
45
45
  },
46
46
  };
47
47
  const ProfileAmino = {
48
- [CarbonTx.Types.MsgUpdateProfile]: utils_1.generateAminoType(MsgUpdateProfile, updateProfileProcess),
48
+ [CarbonTx.Types.MsgUpdateProfile]: (0, utils_1.generateAminoType)(MsgUpdateProfile, updateProfileProcess),
49
49
  };
50
50
  exports.default = ProfileAmino;
@@ -44,9 +44,9 @@ const MsgWithdrawDelegatorReward = {
44
44
  valueMap: {},
45
45
  };
46
46
  const StakingAmino = {
47
- [CarbonTx.Types.MsgDelegate]: utils_1.generateAminoType(MsgDelegate),
48
- [CarbonTx.Types.MsgUndelegate]: utils_1.generateAminoType(MsgUndelegate),
49
- [CarbonTx.Types.MsgBeginRedelegate]: utils_1.generateAminoType(MsgBeginRedelegate),
50
- [CarbonTx.Types.MsgWithdrawDelegatorReward]: utils_1.generateAminoType(MsgWithdrawDelegatorReward),
47
+ [CarbonTx.Types.MsgDelegate]: (0, utils_1.generateAminoType)(MsgDelegate),
48
+ [CarbonTx.Types.MsgUndelegate]: (0, utils_1.generateAminoType)(MsgUndelegate),
49
+ [CarbonTx.Types.MsgBeginRedelegate]: (0, utils_1.generateAminoType)(MsgBeginRedelegate),
50
+ [CarbonTx.Types.MsgWithdrawDelegatorReward]: (0, utils_1.generateAminoType)(MsgWithdrawDelegatorReward),
51
51
  };
52
52
  exports.default = StakingAmino;
@@ -39,8 +39,8 @@ const MsgRemoveSubAccount = {
39
39
  valueMap: {},
40
40
  };
41
41
  const SubAccountAmino = {
42
- [CarbonTx.Types.MsgCreateSubAccount]: utils_1.generateAminoType(MsgCreateSubAccount),
43
- [CarbonTx.Types.MsgActivateSubAccount]: utils_1.generateAminoType(MsgActivateSubAccount),
44
- [CarbonTx.Types.MsgRemoveSubAccount]: utils_1.generateAminoType(MsgRemoveSubAccount),
42
+ [CarbonTx.Types.MsgCreateSubAccount]: (0, utils_1.generateAminoType)(MsgCreateSubAccount),
43
+ [CarbonTx.Types.MsgActivateSubAccount]: (0, utils_1.generateAminoType)(MsgActivateSubAccount),
44
+ [CarbonTx.Types.MsgRemoveSubAccount]: (0, utils_1.generateAminoType)(MsgRemoveSubAccount),
45
45
  };
46
46
  exports.default = SubAccountAmino;
@@ -48,23 +48,23 @@ const mapEachIndiv = (mapItem, valueKey, toAmino = false) => {
48
48
  if (typeof keyMap !== "object") {
49
49
  // Check if this is a Long/BigNumber/Buffer/Date/Duration obj or a non-object/array
50
50
  if (typeCheck(mapItem[key]) || typeof mapItem[key] !== "object") {
51
- directMap[altKey] = exports.paramConverter(mapItem[key], keyMap, toAmino);
51
+ directMap[altKey] = (0, exports.paramConverter)(mapItem[key], keyMap, toAmino);
52
52
  return;
53
53
  }
54
54
  }
55
55
  if (mapItem[key].length && typeof mapItem[key] === "object") {
56
56
  // If value is an array of objects, iterate through objects and call mapToObj function
57
57
  directMap[altKey] = mapItem[key].map((newMap) => {
58
- return exports.mapEachIndiv(newMap, valueKey, toAmino);
58
+ return (0, exports.mapEachIndiv)(newMap, valueKey, toAmino);
59
59
  });
60
60
  return;
61
61
  }
62
62
  else {
63
63
  if (util_1.TypeUtils.isDurationType(mapItem[key])) {
64
- directMap[altKey] = exports.paramConverter(mapItem[key], keyMap, toAmino);
64
+ directMap[altKey] = (0, exports.paramConverter)(mapItem[key], keyMap, toAmino);
65
65
  return;
66
66
  }
67
- directMap[altKey] = exports.mapEachIndiv(mapItem[key], keyMap, toAmino);
67
+ directMap[altKey] = (0, exports.mapEachIndiv)(mapItem[key], keyMap, toAmino);
68
68
  }
69
69
  });
70
70
  return directMap;
@@ -147,18 +147,18 @@ const generateAminoType = (amino, aminoProcess = {}) => {
147
147
  if (!newInput[key])
148
148
  return;
149
149
  if (typeCheck(newInput[key])) {
150
- aminoObj[snakeKey] = exports.paramConverter(newInput[key], newAminoMap[key], true);
150
+ aminoObj[snakeKey] = (0, exports.paramConverter)(newInput[key], newAminoMap[key], true);
151
151
  return;
152
152
  }
153
153
  if (typeof newInput[key] !== "object" && typeof newAminoMap[key] !== "object") {
154
- aminoObj[snakeKey] = exports.paramConverter(newInput[key], newAminoMap[key], true);
154
+ aminoObj[snakeKey] = (0, exports.paramConverter)(newInput[key], newAminoMap[key], true);
155
155
  }
156
156
  else {
157
157
  if (((_a = newInput[key]) === null || _a === void 0 ? void 0 : _a.length) && typeof newInput[key] === "object") {
158
- aminoObj[snakeKey] = newInput[key].map((newItem) => exports.mapEachIndiv(newItem, newAminoMap[key], true));
158
+ aminoObj[snakeKey] = newInput[key].map((newItem) => (0, exports.mapEachIndiv)(newItem, newAminoMap[key], true));
159
159
  return;
160
160
  }
161
- aminoObj[snakeKey] = exports.mapEachIndiv(newInput[key], newAminoMap[key], true);
161
+ aminoObj[snakeKey] = (0, exports.mapEachIndiv)(newInput[key], newAminoMap[key], true);
162
162
  }
163
163
  });
164
164
  return aminoObj;
@@ -172,14 +172,14 @@ const generateAminoType = (amino, aminoProcess = {}) => {
172
172
  var _a;
173
173
  const camelKey = util_1.TypeUtils.snakeToCamel(key);
174
174
  if (typeof newInput[key] !== "object" && typeof newAminoMap[key] !== "object") {
175
- aminoObj[camelKey] = exports.paramConverter(newInput[key], newAminoMap[camelKey], false);
175
+ aminoObj[camelKey] = (0, exports.paramConverter)(newInput[key], newAminoMap[camelKey], false);
176
176
  }
177
177
  else {
178
178
  if (((_a = newInput[key]) === null || _a === void 0 ? void 0 : _a.length) && typeof newInput[key] === "object") {
179
- aminoObj[camelKey] = newInput[key].map((newItem) => exports.mapEachIndiv(newItem, newAminoMap[camelKey], false));
179
+ aminoObj[camelKey] = newInput[key].map((newItem) => (0, exports.mapEachIndiv)(newItem, newAminoMap[camelKey], false));
180
180
  return;
181
181
  }
182
- aminoObj[camelKey] = exports.mapEachIndiv(newInput[key], newAminoMap[camelKey], false);
182
+ aminoObj[camelKey] = (0, exports.mapEachIndiv)(newInput[key], newAminoMap[camelKey], false);
183
183
  }
184
184
  });
185
185
  return aminoObj;
@@ -39,7 +39,7 @@ class RootStore {
39
39
  }
40
40
  exports.RootStore = RootStore;
41
41
  function createRootStore(getKeplr, additionalChains) {
42
- if (external_1.iOS()) {
42
+ if ((0, external_1.iOS)()) {
43
43
  return null;
44
44
  }
45
45
  return new RootStore(getKeplr, additionalChains);
@@ -149,7 +149,7 @@ class CosmosLedger {
149
149
  const response = yield this.cosmosApp.getVersion();
150
150
  this.checkLedgerErrors(response);
151
151
  const { major, minor, patch, test_mode } = response;
152
- exports.checkAppMode(this.testModeAllowed, test_mode);
152
+ (0, exports.checkAppMode)(this.testModeAllowed, test_mode);
153
153
  const version = versionString({ major, minor, patch });
154
154
  return version;
155
155
  });
@@ -218,7 +218,7 @@ class CosmosLedger {
218
218
  const response = yield this.cosmosApp.sign(this.hdPath, signMessage);
219
219
  this.checkLedgerErrors(response);
220
220
  // we have to parse the signature from Ledger as it's in DER format
221
- const parsedSignature = secp256k1_1.signatureImport(response.signature);
221
+ const parsedSignature = (0, secp256k1_1.signatureImport)(response.signature);
222
222
  return parsedSignature;
223
223
  });
224
224
  }
@@ -157,7 +157,7 @@ class MetaMask {
157
157
  return __awaiter(this, void 0, void 0, function* () {
158
158
  const chainIdHex = yield ((_a = this.getAPI()) === null || _a === void 0 ? void 0 : _a.request({ method: 'eth_chainId' }));
159
159
  const chainId = !!chainIdHex ? parseInt(chainIdHex, 16) : undefined;
160
- const blockchain = blockchain_1.getBlockchainFromChain(chainId);
160
+ const blockchain = (0, blockchain_1.getBlockchainFromChain)(chainId);
161
161
  this.blockchain = blockchain;
162
162
  return { chainId, blockchain };
163
163
  });
@@ -60,9 +60,9 @@ class O3Wallet {
60
60
  return {
61
61
  type: index_1.CarbonSignerTypes.BrowserInjected,
62
62
  signAmino: (_, doc) => __awaiter(this, void 0, void 0, function* () {
63
- const msg = JSON.stringify(generic_1.sortObject(doc));
63
+ const msg = JSON.stringify((0, generic_1.sortObject)(doc));
64
64
  const signBytes = yield dapi.signMessage(msg);
65
- const signature = amino_1.encodeSecp256k1Signature(pubKey, signBytes);
65
+ const signature = (0, amino_1.encodeSecp256k1Signature)(pubKey, signBytes);
66
66
  return {
67
67
  signed: doc,
68
68
  signature,
@@ -62,7 +62,6 @@ declare type SWTHAddressType = AddressBuilder<SWTHAddressOptions> & {
62
62
  getAddressBytes(bech32Address: string, networkConfig: Network): Uint8Array;
63
63
  keyDerivationPath(index?: number, change?: number, account?: number): number[];
64
64
  encode(hash: string | Buffer, opts?: SWTHAddressOptions): string;
65
- getModuleAddress(moduleKey: string, network?: Network): string;
66
65
  };
67
66
  export declare const SWTHAddress: SWTHAddressType;
68
67
  declare type NEOAddressType = AddressBuilder<AddressOptions> & {
@@ -18,9 +18,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
21
  Object.defineProperty(exports, "__esModule", { value: true });
25
22
  exports.ETHAddress = exports.N3Address = exports.NEOAddress = exports.SWTHAddress = exports.wifEncodePrivateKey = exports.randomMnemonic = exports.BIP44Path = exports.stringOrBufferToBuffer = void 0;
26
23
  const constant_1 = require("../constant");
@@ -29,7 +26,6 @@ const Base58Check = __importStar(require("base58check"));
29
26
  const bech32 = __importStar(require("bech32"));
30
27
  const BIP32 = __importStar(require("bip32"));
31
28
  const BIP39 = __importStar(require("bip39"));
32
- const crypto_js_1 = __importDefault(require("crypto-js"));
33
29
  const ethers_1 = require("ethers");
34
30
  const secp256k1 = __importStar(require("secp256k1"));
35
31
  const secp256r1 = __importStar(require("secp256r1"));
@@ -100,13 +96,13 @@ const randomMnemonic = () => {
100
96
  };
101
97
  exports.randomMnemonic = randomMnemonic;
102
98
  const wifEncodePrivateKey = (privateKey, iter = 128) => {
103
- const privateKeyBuf = exports.stringOrBufferToBuffer(privateKey);
99
+ const privateKeyBuf = (0, exports.stringOrBufferToBuffer)(privateKey);
104
100
  return wif.encode(iter, privateKeyBuf, true);
105
101
  };
106
102
  exports.wifEncodePrivateKey = wifEncodePrivateKey;
107
103
  exports.SWTHAddress = {
108
104
  newMnemonic: () => {
109
- return exports.randomMnemonic();
105
+ return (0, exports.randomMnemonic)();
110
106
  },
111
107
  coinType: () => {
112
108
  return SWTH_COIN_TYPE;
@@ -116,10 +112,10 @@ exports.SWTHAddress = {
116
112
  return new BIP44Path(BIP44_PURPOSE, coinType).update(index, change, account).toArray();
117
113
  },
118
114
  publicKeyToScriptHash: (publicKey) => {
119
- const pubKeyBuffer = exports.stringOrBufferToBuffer(publicKey);
115
+ const pubKeyBuffer = (0, exports.stringOrBufferToBuffer)(publicKey);
120
116
  const sha256Hash = ethers_1.ethers.utils.sha256(pubKeyBuffer);
121
117
  const ripemdHash = ethers_1.ethers.utils.ripemd160(sha256Hash);
122
- return generic_1.stripHexPrefix(ripemdHash);
118
+ return (0, generic_1.stripHexPrefix)(ripemdHash);
123
119
  },
124
120
  publicKeyToAddress: (publicKey, opts) => {
125
121
  const scriptHash = exports.SWTHAddress.publicKeyToScriptHash(publicKey);
@@ -141,7 +137,7 @@ exports.SWTHAddress = {
141
137
  return privateKey;
142
138
  },
143
139
  privateToPublicKey: (privateKey) => {
144
- const privateKeyBuff = exports.stringOrBufferToBuffer(privateKey);
140
+ const privateKeyBuff = (0, exports.stringOrBufferToBuffer)(privateKey);
145
141
  const publicKeyUint8Array = secp256k1.publicKeyCreate(privateKeyBuff, true);
146
142
  const publicKey = Buffer.from(publicKeyUint8Array);
147
143
  return publicKey;
@@ -152,7 +148,7 @@ exports.SWTHAddress = {
152
148
  return address;
153
149
  },
154
150
  encode: (hash, opts) => {
155
- const hashBuff = exports.stringOrBufferToBuffer(hash, 'hex');
151
+ const hashBuff = (0, exports.stringOrBufferToBuffer)(hash, 'hex');
156
152
  const words = bech32.toWords(hashBuff.slice(0, 20));
157
153
  const addressPrefix = exports.SWTHAddress.getBech32Prefix(opts === null || opts === void 0 ? void 0 : opts.network, opts === null || opts === void 0 ? void 0 : opts.bech32Prefix, opts === null || opts === void 0 ? void 0 : opts.type);
158
154
  const address = bech32.encode(addressPrefix, words);
@@ -193,10 +189,6 @@ exports.SWTHAddress = {
193
189
  }
194
190
  return new Uint8Array(bech32.fromWords(words));
195
191
  },
196
- getModuleAddress: (moduleKey, network = constant_1.Network.MainNet) => {
197
- const addressHash = crypto_js_1.default.SHA256(moduleKey).toString(crypto_js_1.default.enc.Hex);
198
- return exports.SWTHAddress.encode(addressHash, { network });
199
- },
200
192
  };
201
193
  exports.NEOAddress = {
202
194
  coinType: () => {
@@ -211,7 +203,7 @@ exports.NEOAddress = {
211
203
  ]);
212
204
  const sha256Hash = ethers_1.ethers.utils.sha256(addressScript);
213
205
  const ripemdHash = ethers_1.ethers.utils.ripemd160(sha256Hash);
214
- return generic_1.stripHexPrefix(ripemdHash);
206
+ return (0, generic_1.stripHexPrefix)(ripemdHash);
215
207
  },
216
208
  publicKeyToAddress: (publicKey) => {
217
209
  const addressScript = exports.NEOAddress.publicKeyToScriptHash(publicKey);
@@ -219,7 +211,7 @@ exports.NEOAddress = {
219
211
  return address;
220
212
  },
221
213
  encodePublicKey: (unencodedPublicKey) => {
222
- const unencPubKeyBuf = exports.stringOrBufferToBuffer(unencodedPublicKey);
214
+ const unencPubKeyBuf = (0, exports.stringOrBufferToBuffer)(unencodedPublicKey);
223
215
  if (unencPubKeyBuf.length <= 33) {
224
216
  // length indicates already encoded
225
217
  return unencPubKeyBuf;
@@ -244,7 +236,7 @@ exports.NEOAddress = {
244
236
  return privateKey;
245
237
  },
246
238
  privateToPublicKey: (privateKey) => {
247
- const privateKeyBuff = exports.stringOrBufferToBuffer(privateKey);
239
+ const privateKeyBuff = (0, exports.stringOrBufferToBuffer)(privateKey);
248
240
  const publicKeyUint8Array = secp256r1.publicKeyCreate(privateKeyBuff, true);
249
241
  return Buffer.from(publicKeyUint8Array);
250
242
  },
@@ -262,7 +254,7 @@ exports.NEOAddress = {
262
254
  },
263
255
  };
264
256
  exports.N3Address = Object.assign(Object.assign({}, exports.NEOAddress), { publicKeyToScriptHash: (publicKey) => {
265
- const publicKeyHex = exports.stringOrBufferToBuffer(publicKey).toString("hex");
257
+ const publicKeyHex = (0, exports.stringOrBufferToBuffer)(publicKey).toString("hex");
266
258
  return neon_core_next_1.wallet.getScriptHashFromPublicKey(publicKeyHex);
267
259
  }, publicKeyToAddress: (publicKey) => {
268
260
  const addressScript = exports.N3Address.publicKeyToScriptHash(publicKey);
@@ -288,11 +280,11 @@ exports.ETHAddress = {
288
280
  return ethers_1.ethers.utils.keccak256(encodedPublicKey);
289
281
  },
290
282
  publicKeyToAddress: (publicKey) => {
291
- const publicKeyBuff = exports.stringOrBufferToBuffer(publicKey);
283
+ const publicKeyBuff = (0, exports.stringOrBufferToBuffer)(publicKey);
292
284
  return ethers_1.ethers.utils.computeAddress(publicKeyBuff);
293
285
  },
294
286
  encodePublicKey: (unencodedPublicKey) => {
295
- const unencodedPublicKeyBuff = exports.stringOrBufferToBuffer(unencodedPublicKey);
287
+ const unencodedPublicKeyBuff = (0, exports.stringOrBufferToBuffer)(unencodedPublicKey);
296
288
  const publicKey = ethers_1.ethers.utils.computePublicKey(unencodedPublicKeyBuff, true);
297
289
  return Buffer.from(publicKey, "hex");
298
290
  },
@@ -304,7 +296,7 @@ exports.ETHAddress = {
304
296
  return Buffer.from((_a = wallet.privateKey) === null || _a === void 0 ? void 0 : _a.replace(/^0x/, ""), "hex");
305
297
  },
306
298
  privateToPublicKey: (privateKey) => {
307
- const privateKeyBuff = exports.stringOrBufferToBuffer(privateKey);
299
+ const privateKeyBuff = (0, exports.stringOrBufferToBuffer)(privateKey);
308
300
  return Buffer.from(ethers_1.ethers.utils.computePublicKey(privateKeyBuff).replace(/^0x/, ""), "hex");
309
301
  },
310
302
  privateKeyToAddress: (privateKey) => {
package/lib/util/api.js CHANGED
@@ -84,7 +84,7 @@ class HTTP {
84
84
  * Executes HTTP GET request with fetch
85
85
  */
86
86
  this.get = ({ url, headers }) => {
87
- return fetch_1.fetch(url, {
87
+ return (0, fetch_1.fetch)(url, {
88
88
  method: 'GET',
89
89
  headers,
90
90
  });
@@ -93,7 +93,7 @@ class HTTP {
93
93
  * Executes HTTP POST request with fetch
94
94
  */
95
95
  this.post = (options) => {
96
- return fetch_1.fetch(options.url, {
96
+ return (0, fetch_1.fetch)(options.url, {
97
97
  method: 'POST',
98
98
  headers: Object.assign({ 'Content-Type': options.content_type || 'application/json' }, options.headers),
99
99
  body: JSON.stringify(options.body),
@@ -103,7 +103,7 @@ class HTTP {
103
103
  * Executes HTTP DELETE request with fetch
104
104
  */
105
105
  this.del = (options) => {
106
- return fetch_1.fetch(options.url, {
106
+ return (0, fetch_1.fetch)(options.url, {
107
107
  method: 'DELETE',
108
108
  headers: Object.assign({ 'Content-Type': options.content_type || 'application/json' }, options.headers),
109
109
  body: JSON.stringify(options.body),
@@ -114,7 +114,7 @@ class HTTP {
114
114
  */
115
115
  this.raw = (options) => {
116
116
  const { url } = options, otherOpts = __rest(options, ["url"]);
117
- return fetch_1.fetch(url, otherOpts);
117
+ return (0, fetch_1.fetch)(url, otherOpts);
118
118
  };
119
119
  this.apiPrefix = apiPrefix;
120
120
  this.apiEndpoints = apiEndpoints;
package/lib/util/fetch.js CHANGED
@@ -10,7 +10,7 @@ function fetch(url, init) {
10
10
  return window.fetch(url, Object.assign({}, init));
11
11
  }
12
12
  else {
13
- return node_fetch_1.default(url, init);
13
+ return (0, node_fetch_1.default)(url, init);
14
14
  }
15
15
  }
16
16
  exports.fetch = fetch;
@@ -22,7 +22,7 @@ const overrideConfig = (defaults, override) => {
22
22
  continue;
23
23
  if (typeof member === "object") {
24
24
  // @ts-ignore
25
- result[key] = exports.overrideConfig(result[key], member);
25
+ result[key] = (0, exports.overrideConfig)(result[key], member);
26
26
  }
27
27
  else {
28
28
  // @ts-ignore
@@ -41,7 +41,7 @@ const sortObject = (input) => {
41
41
  Object.keys(input)
42
42
  .sort()
43
43
  // @ts-ignore noImplicitAny
44
- .forEach((key) => (output[key] = exports.sortObject(input[key])));
44
+ .forEach((key) => (output[key] = (0, exports.sortObject)(input[key])));
45
45
  return output;
46
46
  };
47
47
  exports.sortObject = sortObject;
@@ -56,7 +56,7 @@ exports.appendHexPrefix = appendHexPrefix;
56
56
  const computeTxHash = (bytes) => {
57
57
  if (!bytes)
58
58
  return bytes;
59
- return exports.toTxHash(crypto_1.sha256(bytes));
59
+ return (0, exports.toTxHash)((0, crypto_1.sha256)(bytes));
60
60
  };
61
61
  exports.computeTxHash = computeTxHash;
62
62
  const toTxHash = (bytes) => {
@@ -1,7 +1,6 @@
1
1
  import BigNumber from "bignumber.js";
2
2
  export declare const BN_ONE: BigNumber;
3
3
  export declare const BN_ZERO: BigNumber;
4
- export declare const BN_10000: BigNumber;
5
4
  export declare const parseBN: (input?: string | number | BigNumber | null | undefined, defaultValue?: BigNumber | undefined) => BigNumber | undefined;
6
5
  export declare const bnOrZero: (input?: string | number | BigNumber | null | undefined, defaultValue?: BigNumber) => BigNumber;
7
6
  export declare const toHuman: (value?: string | number | BigNumber | null | undefined, decimals?: string | number | BigNumber | null | undefined) => BigNumber | undefined;
@@ -3,11 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.generateNonce = exports.toUnitless = exports.toHuman = exports.bnOrZero = exports.parseBN = exports.BN_10000 = exports.BN_ZERO = exports.BN_ONE = void 0;
6
+ exports.generateNonce = exports.toUnitless = exports.toHuman = exports.bnOrZero = exports.parseBN = exports.BN_ZERO = exports.BN_ONE = void 0;
7
7
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
8
  exports.BN_ONE = new bignumber_js_1.default(1);
9
9
  exports.BN_ZERO = new bignumber_js_1.default(0);
10
- exports.BN_10000 = new bignumber_js_1.default(10000);
11
10
  const parseBN = (input, defaultValue) => {
12
11
  if (!input && input !== 0)
13
12
  return defaultValue;
@@ -18,26 +17,26 @@ const parseBN = (input, defaultValue) => {
18
17
  };
19
18
  exports.parseBN = parseBN;
20
19
  const bnOrZero = (input, defaultValue = exports.BN_ZERO) => {
21
- return exports.parseBN(input, defaultValue);
20
+ return (0, exports.parseBN)(input, defaultValue);
22
21
  };
23
22
  exports.bnOrZero = bnOrZero;
24
23
  const toHuman = (value, decimals) => {
25
24
  if (value === undefined || value === null)
26
25
  return undefined;
27
- const valueBN = exports.bnOrZero(value);
26
+ const valueBN = (0, exports.bnOrZero)(value);
28
27
  if (!decimals)
29
28
  return valueBN; // decimals = 0 or nullish
30
- const decimalsBN = exports.bnOrZero(decimals);
29
+ const decimalsBN = (0, exports.bnOrZero)(decimals);
31
30
  return valueBN.shiftedBy(decimalsBN.negated().toNumber());
32
31
  };
33
32
  exports.toHuman = toHuman;
34
33
  const toUnitless = (value, decimals) => {
35
34
  if (value === undefined || value === null)
36
35
  return undefined;
37
- const valueBN = exports.bnOrZero(value);
36
+ const valueBN = (0, exports.bnOrZero)(value);
38
37
  if (!decimals)
39
38
  return valueBN; // decimals = 0 or nullish
40
- const decimalsBN = exports.bnOrZero(decimals);
39
+ const decimalsBN = (0, exports.bnOrZero)(decimals);
41
40
  return valueBN.shiftedBy(decimalsBN.toNumber());
42
41
  };
43
42
  exports.toUnitless = toUnitless;
package/lib/util/tx.d.ts CHANGED
@@ -58,72 +58,16 @@ export declare const Types: {
58
58
  MsgCancelOrderResponse: string;
59
59
  MsgCancelAll: string;
60
60
  MsgCancelAllResponse: string;
61
- MsgAddRateStrategy: string;
62
- MsgAddRateStrategyResponse: string;
63
- MsgUpdateRateStrategy: string;
64
- MsgUpdateRateStrategyResponse: string;
65
- MsgRemoveRateStrategy: string;
66
- MsgRemoveRateStrategyResponse: string;
67
- MsgAddAsset: string;
68
- MsgAddAssetResponse: string;
69
- MsgUpdateAsset: string;
70
- MsgUpdateAssetResponse: string;
71
- MsgSupplyAsset: string;
72
- MsgSupplyAssetResponse: string;
73
- MsgWithdrawAsset: string;
74
- MsgWithdrawAssetResponse: string;
75
- MsgLockCollateral: string;
76
- MsgLockCollateralResponse: string;
77
- MsgUnlockCollateral: string;
78
- MsgUnlockCollateralResponse: string;
79
- MsgBorrowAsset: string;
80
- MsgBorrowAssetResponse: string;
81
- MsgRepayAsset: string;
82
- MsgRepayAssetResponse: string;
83
- MsgSupplyAssetAndLockCollateral: string;
84
- MsgSupplyAssetAndLockCollateralResponse: string;
85
- MsgUnlockCollateralAndWithdrawAsset: string;
86
- MsgUnlockCollateralAndWithdrawAssetResponse: string;
87
- MsgLiquidateCollateral: string;
88
- MsgLiquidateCollateralResponse: string;
89
- MsgSetLiquidationFee: string;
90
- MsgSetLiquidationFeeResponse: string;
91
- MsgSetInterestFee: string;
92
- MsgSetInterestFeeResponse: string;
93
- MsgRepayAssetWithCdpTokens: string;
94
- MsgRepayAssetWithCdpTokensResponse: string;
95
- MsgRepayAssetWithCollateral: string;
96
- MsgRepayAssetWithCollateralResponse: string;
97
- MsgSetStablecoinInterestRate: string;
98
- MsgSetStablecoinInterestRateResponse: string;
99
- MsgSetStablecoinMintCap: string;
100
- MsgSetStablecoinMintCapResponse: string;
101
- MsgMintStablecoin: string;
102
- MsgMintStablecoinResponse: string;
103
- MsgReturnStablecoin: string;
104
- MsgReturnStablecoinResponse: string;
105
- MsgSetCompleteLiquidationThreshold: string;
106
- MsgSetCompleteLiquidationThresholdResponse: string;
107
- MsgSetMinimumCloseFactor: string;
108
- MsgSetMinimumCloseFactorResponse: string;
109
- MsgSetSmallLiquidationSize: string;
110
- MsgSetSmallLiquidationSizeResponse: string;
111
- MsgLiquidateCollateralWithCdpTokens: string;
112
- MsgLiquidateCollateralWithCdpTokensResponse: string;
113
- MsgLiquidateCollateralWithCollateral: string;
114
- MsgLiquidateCollateralWithCollateralResponse: string;
115
- MsgLiquidateCollateralWithStablecoin: string;
116
- MsgLiquidateCollateralWithStablecoinResponse: string;
117
- MsgCreateRewardScheme: string;
118
- MsgCreateRewardSchemeResponse: string;
119
- MsgUpdateRewardScheme: string;
120
- MsgUpdateRewardSchemeResponse: string;
121
- MsgClaimRewards: string;
122
- MsgClaimRewardsResponse: string;
123
- MsgSetStalePriceGracePeriod: string;
124
- MsgSetStalePriceGracePeriodResponse: string;
125
- MsgSetCdpPaused: string;
126
- MsgSetCdpPausedResponse: string;
61
+ MsgAddCollateral: string;
62
+ MsgAddCollateralResponse: string;
63
+ MsgRemoveCollateral: string;
64
+ MsgRemoveCollateralResponse: string;
65
+ MsgAddDebt: string;
66
+ MsgAddDebtResponse: string;
67
+ MsgRemoveDebt: string;
68
+ MsgRemoveDebtResponse: string;
69
+ MsgCreateVaultType: string;
70
+ MsgCreateVaultTypeResponse: string;
127
71
  MsgSyncGenesis: string;
128
72
  MsgSyncGenesisResponse: string;
129
73
  MsgSyncHeaders: string;
@@ -342,14 +286,6 @@ export declare const Types: {
342
286
  SetCommitmentCurveProposal: string;
343
287
  SetRewardsWeightsProposal: string;
344
288
  UpdatePoolProposal: string;
345
- MsgSetBackfillTimeInterval: string;
346
- MsgSetBackfillTimeIntervalResponse: string;
347
- MsgSetSmoothenBand: string;
348
- MsgSetSmoothenBandResponse: string;
349
- MsgSetImpactBand: string;
350
- MsgSetImpactBandResponse: string;
351
- MsgSetStaleIndexAllowance: string;
352
- MsgSetStaleIndexAllowanceResponse: string;
353
289
  SettlementPriceProposal: string;
354
290
  MsgSetWrapperMapping: string;
355
291
  MsgSetWrapperMappingResponse: string;
@@ -106,9 +106,9 @@ class CarbonLedgerSigner {
106
106
  return __awaiter(this, void 0, void 0, function* () {
107
107
  const account = yield this.retrieveAccount();
108
108
  const { pubkey } = account;
109
- const msg = JSON.stringify(generic_1.sortObject(doc));
109
+ const msg = JSON.stringify((0, generic_1.sortObject)(doc));
110
110
  const signBytes = yield this.ledger.sign(msg);
111
- const signature = amino_1.encodeSecp256k1Signature(pubkey, signBytes);
111
+ const signature = (0, amino_1.encodeSecp256k1Signature)(pubkey, signBytes);
112
112
  return {
113
113
  signed: doc,
114
114
  signature,