carbon-js-sdk 0.2.15 → 0.2.16-dev.1

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 (272) hide show
  1. package/lib/CarbonSDK.d.ts +13 -1
  2. package/lib/CarbonSDK.js +31 -2
  3. package/lib/clients/ETHClient.d.ts +1 -1
  4. package/lib/clients/NEOClient.d.ts +1 -1
  5. package/lib/clients/NEOClient.js +1 -1
  6. package/lib/clients/TokenClient.d.ts +5 -0
  7. package/lib/clients/TokenClient.js +38 -10
  8. package/lib/clients/ZILClient.d.ts +1 -1
  9. package/lib/codec/book/genesis.d.ts +1 -1
  10. package/lib/codec/book/genesis.js +1 -1
  11. package/lib/codec/book/query.d.ts +1 -1
  12. package/lib/codec/book/query.js +1 -1
  13. package/lib/codec/broker/genesis.d.ts +1 -1
  14. package/lib/codec/broker/genesis.js +1 -1
  15. package/lib/codec/broker/query.d.ts +3 -3
  16. package/lib/codec/broker/query.js +3 -3
  17. package/lib/codec/btcx/denom_cross_chain_info.d.ts +1 -1
  18. package/lib/codec/btcx/denom_cross_chain_info.js +1 -1
  19. package/lib/codec/btcx/query.d.ts +1 -1
  20. package/lib/codec/btcx/query.js +1 -1
  21. package/lib/codec/ccm/genesis.d.ts +1 -1
  22. package/lib/codec/ccm/genesis.js +1 -1
  23. package/lib/codec/cdp/asset_params.d.ts +1 -1
  24. package/lib/codec/cdp/asset_params.js +11 -10
  25. package/lib/codec/cdp/event.d.ts +389 -22
  26. package/lib/codec/cdp/event.js +2494 -83
  27. package/lib/codec/cdp/genesis.d.ts +97 -4
  28. package/lib/codec/cdp/genesis.js +648 -23
  29. package/lib/codec/cdp/params.d.ts +8 -0
  30. package/lib/codec/cdp/params.js +52 -9
  31. package/lib/codec/cdp/query.d.ts +439 -89
  32. package/lib/codec/cdp/query.js +1995 -177
  33. package/lib/codec/cdp/reward_scheme.d.ts +0 -13
  34. package/lib/codec/cdp/reward_scheme.js +1 -91
  35. package/lib/codec/cdp/tx.d.ts +760 -96
  36. package/lib/codec/cdp/tx.js +3645 -235
  37. package/lib/codec/coin/event.d.ts +1 -1
  38. package/lib/codec/coin/event.js +1 -1
  39. package/lib/codec/coin/genesis.d.ts +2 -2
  40. package/lib/codec/coin/genesis.js +2 -2
  41. package/lib/codec/coin/proposal.d.ts +1 -1
  42. package/lib/codec/coin/proposal.js +1 -1
  43. package/lib/codec/coin/query.d.ts +2 -2
  44. package/lib/codec/coin/query.js +2 -2
  45. package/lib/codec/coin/tx.d.ts +1 -1
  46. package/lib/codec/coin/tx.js +1 -1
  47. package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
  48. package/lib/codec/cosmos/auth/v1beta1/genesis.js +1 -1
  49. package/lib/codec/cosmos/auth/v1beta1/query.d.ts +2 -2
  50. package/lib/codec/cosmos/auth/v1beta1/query.js +2 -2
  51. package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -1
  52. package/lib/codec/cosmos/authz/v1beta1/genesis.js +1 -1
  53. package/lib/codec/cosmos/authz/v1beta1/query.d.ts +2 -2
  54. package/lib/codec/cosmos/authz/v1beta1/query.js +2 -2
  55. package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +1 -1
  56. package/lib/codec/cosmos/authz/v1beta1/tx.js +1 -1
  57. package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +1 -1
  58. package/lib/codec/cosmos/bank/v1beta1/authz.js +1 -1
  59. package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +1 -1
  60. package/lib/codec/cosmos/bank/v1beta1/bank.js +1 -1
  61. package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +2 -2
  62. package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
  63. package/lib/codec/cosmos/bank/v1beta1/query.d.ts +3 -3
  64. package/lib/codec/cosmos/bank/v1beta1/query.js +3 -3
  65. package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +2 -2
  66. package/lib/codec/cosmos/bank/v1beta1/tx.js +2 -2
  67. package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +1 -1
  68. package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1 -1
  69. package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +1 -1
  70. package/lib/codec/cosmos/capability/v1beta1/genesis.js +1 -1
  71. package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +1 -1
  72. package/lib/codec/cosmos/crisis/v1beta1/genesis.js +1 -1
  73. package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +1 -1
  74. package/lib/codec/cosmos/distribution/v1beta1/distribution.js +1 -1
  75. package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +2 -2
  76. package/lib/codec/cosmos/distribution/v1beta1/genesis.js +2 -2
  77. package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +3 -3
  78. package/lib/codec/cosmos/distribution/v1beta1/query.js +3 -3
  79. package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +1 -1
  80. package/lib/codec/cosmos/distribution/v1beta1/tx.js +1 -1
  81. package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +1 -1
  82. package/lib/codec/cosmos/evidence/v1beta1/query.js +1 -1
  83. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +1 -1
  84. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +1 -1
  85. package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +1 -1
  86. package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +1 -1
  87. package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +2 -2
  88. package/lib/codec/cosmos/feegrant/v1beta1/query.js +2 -2
  89. package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +1 -1
  90. package/lib/codec/cosmos/gov/v1beta1/genesis.js +1 -1
  91. package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +1 -1
  92. package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
  93. package/lib/codec/cosmos/gov/v1beta1/query.d.ts +2 -2
  94. package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
  95. package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
  96. package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
  97. package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
  98. package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
  99. package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
  100. package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
  101. package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
  102. package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
  103. package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
  104. package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
  105. package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
  106. package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
  107. package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
  108. package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
  109. package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
  110. package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
  111. package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
  112. package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
  113. package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
  114. package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
  115. package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
  116. package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
  117. package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +1 -1
  118. package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +1 -1
  119. package/lib/codec/cosmos/tx/v1beta1/service.d.ts +3 -3
  120. package/lib/codec/cosmos/tx/v1beta1/service.js +3 -3
  121. package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
  122. package/lib/codec/cosmos/tx/v1beta1/tx.js +3 -3
  123. package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
  124. package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
  125. package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
  126. package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
  127. package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
  128. package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
  129. package/lib/codec/fee/genesis.d.ts +1 -1
  130. package/lib/codec/fee/genesis.js +1 -1
  131. package/lib/codec/fee/proposal.d.ts +1 -1
  132. package/lib/codec/fee/proposal.js +1 -1
  133. package/lib/codec/fee/query.d.ts +1 -1
  134. package/lib/codec/fee/query.js +1 -1
  135. package/lib/codec/fee/tx.d.ts +1 -1
  136. package/lib/codec/fee/tx.js +1 -1
  137. package/lib/codec/headersync/genesis.d.ts +1 -1
  138. package/lib/codec/headersync/genesis.js +1 -1
  139. package/lib/codec/headersync/query.d.ts +1 -1
  140. package/lib/codec/headersync/query.js +1 -1
  141. package/lib/codec/index.d.ts +89 -18
  142. package/lib/codec/index.js +463 -180
  143. package/lib/codec/inflation/genesis.d.ts +1 -1
  144. package/lib/codec/inflation/genesis.js +1 -1
  145. package/lib/codec/inflation/query.d.ts +1 -1
  146. package/lib/codec/inflation/query.js +1 -1
  147. package/lib/codec/insurance/genesis.d.ts +1 -1
  148. package/lib/codec/insurance/genesis.js +1 -1
  149. package/lib/codec/leverage/genesis.d.ts +1 -1
  150. package/lib/codec/leverage/genesis.js +1 -1
  151. package/lib/codec/leverage/query.d.ts +1 -1
  152. package/lib/codec/leverage/query.js +1 -1
  153. package/lib/codec/liquidation/genesis.d.ts +1 -1
  154. package/lib/codec/liquidation/genesis.js +1 -1
  155. package/lib/codec/liquidation/query.d.ts +1 -1
  156. package/lib/codec/liquidation/query.js +1 -1
  157. package/lib/codec/liquidation/quote_changes.d.ts +1 -1
  158. package/lib/codec/liquidation/quote_changes.js +1 -1
  159. package/lib/codec/liquiditypool/event.d.ts +2 -2
  160. package/lib/codec/liquiditypool/event.js +2 -2
  161. package/lib/codec/liquiditypool/genesis.d.ts +2 -2
  162. package/lib/codec/liquiditypool/genesis.js +2 -2
  163. package/lib/codec/liquiditypool/liquiditypool.d.ts +3 -0
  164. package/lib/codec/liquiditypool/liquiditypool.js +44 -1
  165. package/lib/codec/liquiditypool/proposal.d.ts +1 -1
  166. package/lib/codec/liquiditypool/proposal.js +1 -1
  167. package/lib/codec/liquiditypool/query.d.ts +39 -2
  168. package/lib/codec/liquiditypool/query.js +195 -3
  169. package/lib/codec/liquiditypool/tx.d.ts +3 -1
  170. package/lib/codec/liquiditypool/tx.js +35 -1
  171. package/lib/codec/lockproxy/genesis.d.ts +1 -1
  172. package/lib/codec/lockproxy/genesis.js +1 -1
  173. package/lib/codec/lockproxy/query.d.ts +1 -1
  174. package/lib/codec/lockproxy/query.js +1 -1
  175. package/lib/codec/market/event.d.ts +1 -1
  176. package/lib/codec/market/event.js +1 -1
  177. package/lib/codec/market/genesis.d.ts +1 -1
  178. package/lib/codec/market/genesis.js +1 -1
  179. package/lib/codec/market/proposal.d.ts +1 -1
  180. package/lib/codec/market/proposal.js +1 -1
  181. package/lib/codec/market/query.d.ts +1 -1
  182. package/lib/codec/market/query.js +1 -1
  183. package/lib/codec/market/tx.d.ts +1 -1
  184. package/lib/codec/market/tx.js +1 -1
  185. package/lib/codec/marketstats/genesis.d.ts +1 -1
  186. package/lib/codec/marketstats/genesis.js +1 -1
  187. package/lib/codec/marketstats/query.d.ts +2 -2
  188. package/lib/codec/marketstats/query.js +2 -2
  189. package/lib/codec/misc/message.d.ts +1 -1
  190. package/lib/codec/misc/message.js +1 -1
  191. package/lib/codec/misc/query.d.ts +3 -3
  192. package/lib/codec/misc/query.js +3 -3
  193. package/lib/codec/misc/transaction.d.ts +1 -1
  194. package/lib/codec/misc/transaction.js +1 -1
  195. package/lib/codec/oracle/event.d.ts +1 -1
  196. package/lib/codec/oracle/event.js +1 -1
  197. package/lib/codec/oracle/genesis.d.ts +4 -1
  198. package/lib/codec/oracle/genesis.js +34 -3
  199. package/lib/codec/oracle/proposal.d.ts +1 -1
  200. package/lib/codec/oracle/proposal.js +1 -1
  201. package/lib/codec/oracle/query.d.ts +2 -2
  202. package/lib/codec/oracle/query.js +2 -2
  203. package/lib/codec/order/event.d.ts +1 -1
  204. package/lib/codec/order/event.js +1 -1
  205. package/lib/codec/order/genesis.d.ts +1 -1
  206. package/lib/codec/order/genesis.js +1 -1
  207. package/lib/codec/order/query.d.ts +1 -1
  208. package/lib/codec/order/query.js +1 -1
  209. package/lib/codec/position/event.d.ts +1 -1
  210. package/lib/codec/position/event.js +1 -1
  211. package/lib/codec/position/genesis.d.ts +1 -1
  212. package/lib/codec/position/genesis.js +1 -1
  213. package/lib/codec/position/query.d.ts +1 -1
  214. package/lib/codec/position/query.js +1 -1
  215. package/lib/codec/pricing/event.d.ts +56 -1
  216. package/lib/codec/pricing/event.js +298 -2
  217. package/lib/codec/pricing/genesis.d.ts +2 -1
  218. package/lib/codec/pricing/genesis.js +20 -5
  219. package/lib/codec/pricing/legacy.d.ts +22 -0
  220. package/lib/codec/pricing/legacy.js +93 -0
  221. package/lib/codec/pricing/pricing.d.ts +14 -0
  222. package/lib/codec/pricing/pricing.js +103 -1
  223. package/lib/codec/pricing/query.d.ts +68 -1
  224. package/lib/codec/pricing/query.js +321 -2
  225. package/lib/codec/pricing/tx.d.ts +96 -0
  226. package/lib/codec/pricing/tx.js +399 -1
  227. package/lib/codec/profile/event.d.ts +1 -1
  228. package/lib/codec/profile/event.js +1 -1
  229. package/lib/codec/profile/genesis.d.ts +1 -1
  230. package/lib/codec/profile/genesis.js +1 -1
  231. package/lib/codec/profile/query.d.ts +1 -1
  232. package/lib/codec/profile/query.js +1 -1
  233. package/lib/codec/subaccount/genesis.d.ts +1 -1
  234. package/lib/codec/subaccount/genesis.js +1 -1
  235. package/lib/codec/subaccount/query.d.ts +1 -1
  236. package/lib/codec/subaccount/query.js +1 -1
  237. package/lib/codec/tendermint/abci/types.d.ts +4 -4
  238. package/lib/codec/tendermint/abci/types.js +4 -4
  239. package/lib/codec/tendermint/types/block.d.ts +2 -2
  240. package/lib/codec/tendermint/types/block.js +2 -2
  241. package/lib/codec/tendermint/types/evidence.d.ts +2 -2
  242. package/lib/codec/tendermint/types/evidence.js +2 -2
  243. package/lib/codec/tendermint/types/types.d.ts +3 -3
  244. package/lib/codec/tendermint/types/types.js +3 -3
  245. package/lib/codec/tendermint/types/validator.d.ts +1 -1
  246. package/lib/codec/tendermint/types/validator.js +1 -1
  247. package/lib/constant/network.js +1 -1
  248. package/lib/constant/token.d.ts +4 -0
  249. package/lib/constant/token.js +5 -1
  250. package/lib/modules/admin.d.ts +114 -7
  251. package/lib/modules/admin.js +275 -53
  252. package/lib/modules/cdp.d.ts +152 -13
  253. package/lib/modules/cdp.js +796 -20
  254. package/lib/modules/liquiditypool.d.ts +2 -0
  255. package/lib/modules/liquiditypool.js +2 -0
  256. package/lib/provider/amino/types/admin.js +72 -7
  257. package/lib/provider/amino/types/cdp.js +102 -32
  258. package/lib/provider/amino/types/liquidityPool.js +2 -0
  259. package/lib/provider/keplr/KeplrAccount.js +5 -0
  260. package/lib/util/address.d.ts +1 -0
  261. package/lib/util/address.js +8 -0
  262. package/lib/util/number.d.ts +1 -0
  263. package/lib/util/number.js +2 -1
  264. package/lib/util/tx.d.ts +75 -10
  265. package/lib/wallet/CarbonSigner.d.ts +5 -2
  266. package/lib/wallet/CarbonSigner.js +13 -0
  267. package/lib/wallet/CarbonWallet.js +0 -1
  268. package/lib/websocket/channel.js +115 -21
  269. package/lib/websocket/models.d.ts +155 -0
  270. package/lib/websocket/types.d.ts +87 -3
  271. package/lib/websocket/types.js +31 -0
  272. package/package.json +1 -1
@@ -2,6 +2,7 @@
2
2
  import { Network, Network as _Network, NetworkConfig } from "./constant";
3
3
  import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
4
4
  import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
5
+ import * as clients from "./clients";
5
6
  import N3Client from "./clients/N3Client";
6
7
  import { AdminModule, BankModule, BrokerModule, CDPModule, CoinModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
7
8
  import { StakingModule } from "./modules/staking";
@@ -9,6 +10,7 @@ import { CosmosLedger, Keplr } from "./provider";
9
10
  import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts } from "./wallet";
10
11
  export { CarbonTx } from "./util";
11
12
  export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
13
+ export { DenomPrefix } from "./constant";
12
14
  export interface CarbonSDKOpts {
13
15
  network: Network;
14
16
  tmClient: Tendermint34Client;
@@ -31,7 +33,10 @@ export interface CarbonSDKInitOpts {
31
33
  */
32
34
  declare class CarbonSDK {
33
35
  static DEFAULT_NETWORK: Network;
34
- static TokenClient: typeof TokenClient;
36
+ static DenomPrefix: {
37
+ LPToken: string;
38
+ CDPToken: string;
39
+ };
35
40
  readonly query: CarbonQueryClient;
36
41
  insights: InsightsQueryClient;
37
42
  hydrogen: HydrogenClient;
@@ -98,5 +103,12 @@ export declare class ConnectedCarbonSDK extends CarbonSDK {
98
103
  }
99
104
  declare namespace CarbonSDK {
100
105
  export import Network = _Network;
106
+ export import CarbonQueryClient = clients.CarbonQueryClient;
107
+ export import ETHClient = clients.ETHClient;
108
+ export import HydrogenClient = clients.HydrogenClient;
109
+ export import InsightsQueryClient = clients.InsightsQueryClient;
110
+ export import NEOClient = clients.NEOClient;
111
+ export import TokenClient = clients.TokenClient;
112
+ export import ZILClient = clients.ZILClient;
101
113
  }
102
114
  export default CarbonSDK;
package/lib/CarbonSDK.js CHANGED
@@ -1,4 +1,23 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
2
21
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
22
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
23
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -12,11 +31,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
32
  };
14
33
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ConnectedCarbonSDK = exports.CarbonWallet = exports.CarbonSignerTypes = exports.CarbonTx = void 0;
34
+ exports.ConnectedCarbonSDK = exports.DenomPrefix = exports.CarbonWallet = exports.CarbonSignerTypes = exports.CarbonTx = void 0;
16
35
  const constant_1 = require("./constant");
17
36
  const util_1 = require("./util");
18
37
  const tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
19
38
  const clients_1 = require("./clients");
39
+ const clients = __importStar(require("./clients"));
20
40
  const N3Client_1 = __importDefault(require("./clients/N3Client"));
21
41
  const modules_1 = require("./modules");
22
42
  const staking_1 = require("./modules/staking");
@@ -28,6 +48,8 @@ Object.defineProperty(exports, "CarbonTx", { enumerable: true, get: function ()
28
48
  var wallet_2 = require("./wallet");
29
49
  Object.defineProperty(exports, "CarbonSignerTypes", { enumerable: true, get: function () { return wallet_2.CarbonSignerTypes; } });
30
50
  Object.defineProperty(exports, "CarbonWallet", { enumerable: true, get: function () { return wallet_2.CarbonWallet; } });
51
+ var constant_2 = require("./constant");
52
+ Object.defineProperty(exports, "DenomPrefix", { enumerable: true, get: function () { return constant_2.DenomPrefix; } });
31
53
  const DEFAULT_SDK_INIT_OPTS = {
32
54
  network: constant_1.DEFAULT_NETWORK,
33
55
  };
@@ -253,7 +275,7 @@ class CarbonSDK {
253
275
  }
254
276
  }
255
277
  CarbonSDK.DEFAULT_NETWORK = constant_1.DEFAULT_NETWORK;
256
- CarbonSDK.TokenClient = clients_1.TokenClient;
278
+ CarbonSDK.DenomPrefix = constant_1.DenomPrefix;
257
279
  CarbonSDK.parseNetwork = util_1.NetworkUtils.parseNetwork;
258
280
  class ConnectedCarbonSDK extends CarbonSDK {
259
281
  constructor(wallet, opts) {
@@ -267,5 +289,12 @@ class ConnectedCarbonSDK extends CarbonSDK {
267
289
  exports.ConnectedCarbonSDK = ConnectedCarbonSDK;
268
290
  (function (CarbonSDK) {
269
291
  CarbonSDK.Network = constant_1.Network;
292
+ CarbonSDK.CarbonQueryClient = clients.CarbonQueryClient;
293
+ CarbonSDK.ETHClient = clients.ETHClient;
294
+ CarbonSDK.HydrogenClient = clients.HydrogenClient;
295
+ CarbonSDK.InsightsQueryClient = clients.InsightsQueryClient;
296
+ CarbonSDK.NEOClient = clients.NEOClient;
297
+ CarbonSDK.TokenClient = clients.TokenClient;
298
+ CarbonSDK.ZILClient = clients.ZILClient;
270
299
  })(CarbonSDK || (CarbonSDK = {}));
271
300
  exports.default = CarbonSDK;
@@ -55,7 +55,7 @@ export declare class ETHClient {
55
55
  eth: string;
56
56
  };
57
57
  private constructor();
58
- static instance(opts: ETHClientOpts): ETHClient;
58
+ static instance(opts: ETHClientOpts): CarbonSDK.ETHClient;
59
59
  getExternalBalances(api: CarbonSDK, address: string, whitelistDenoms?: string[]): Promise<TokensWithExternalBalance[]>;
60
60
  approveERC20(params: ApproveERC20Params): Promise<EthersTransactionResponse>;
61
61
  checkAllowanceERC20(token: Models.Token, owner: string, spender: string): Promise<BigNumber>;
@@ -34,7 +34,7 @@ export declare class NEOClient {
34
34
  neo: string;
35
35
  };
36
36
  private constructor();
37
- static instance(opts: NEOClientOpts): NEOClient;
37
+ static instance(opts: NEOClientOpts): CarbonSDK.NEOClient;
38
38
  static parseHexNum(hex: string, exp?: number): string;
39
39
  getExternalBalances(sdk: CarbonSDK, address: string, url: string, whitelistDenoms?: string[]): Promise<TokensWithExternalBalance[]>;
40
40
  lockDeposit(token: TokensWithExternalBalance, feeAmountInput: string, swthAddress: string, neoPrivateKey: string): Promise<false | import("@cityofzion/neon-api/lib/funcs/types").DoInvokeConfig>;
@@ -37,8 +37,8 @@ const util_1 = require("../util");
37
37
  const address_1 = require("../util/address");
38
38
  const blockchain_1 = require("../util/blockchain");
39
39
  const generic_1 = require("../util/generic");
40
- const neon_js_1 = require("@cityofzion/neon-js");
41
40
  const Neon = __importStar(require("@cityofzion/neon-core"));
41
+ const neon_js_1 = require("@cityofzion/neon-js");
42
42
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
43
43
  const ethers_1 = require("ethers");
44
44
  const lodash_1 = require("lodash");
@@ -11,6 +11,7 @@ declare class TokenClient {
11
11
  readonly tokens: TypeUtils.SimpleMap<Token>;
12
12
  readonly wrapperMap: TypeUtils.SimpleMap<string>;
13
13
  readonly poolTokens: TypeUtils.SimpleMap<Token>;
14
+ readonly cdpTokens: TypeUtils.SimpleMap<Token>;
14
15
  readonly symbols: TypeUtils.SimpleMap<string>;
15
16
  readonly usdValues: TypeUtils.SimpleMap<BigNumber>;
16
17
  readonly commonAssetNames: TypeUtils.SimpleMap<string>;
@@ -34,6 +35,7 @@ declare class TokenClient {
34
35
  getTokenDesc(denom: string): string;
35
36
  static isPoolTokenNew(denom: string): boolean;
36
37
  static isPoolTokenLegacy(denom: string): boolean;
38
+ static isCdpToken(denom: string): boolean;
37
39
  static isPoolToken(denom: string): boolean;
38
40
  static isIBCDenom(denom: string): boolean;
39
41
  isWrappedToken(denom?: string): boolean;
@@ -42,11 +44,14 @@ declare class TokenClient {
42
44
  getWrappedToken(denom: string, blockchain?: BlockchainUtils.Blockchain): Token | null;
43
45
  getSourceToken(denom: string): Token | null;
44
46
  getNativeToken(): Token | undefined;
47
+ getNativeStablecoin(): Token | undefined;
45
48
  isNativeToken(denom: string): boolean;
49
+ isNativeStablecoin(denom: string): boolean;
46
50
  getDepositTokenFor(tokenDenom: string, chain: BlockchainUtils.Blockchain): Token | undefined;
47
51
  getAllTokens(): Promise<Token[]>;
48
52
  reloadTokens(): Promise<TypeUtils.SimpleMap<Token>>;
49
53
  getCarbonIbcTokens(): Token[];
54
+ getCdpUnderlyingToken(cdpDenom: string): Token | undefined;
50
55
  reloadWrapperMap(): Promise<TypeUtils.SimpleMap<string>>;
51
56
  reloadDenomGeckoMap(): Promise<void>;
52
57
  reloadUSDValues(denoms?: string[]): Promise<TypeUtils.SimpleMap<BigNumber>>;
@@ -32,6 +32,8 @@ const SYMBOL_OVERRIDE = {
32
32
  AVA1: 'AVA',
33
33
  TSWTH: 'tSWTH',
34
34
  };
35
+ const regexCdpDenom = RegExp(`^${constant_1.DenomPrefix.CDPToken}/`, "i");
36
+ const regexLPDenom = RegExp(`^${constant_1.DenomPrefix.LPToken}/(\\d+)$`, "i");
35
37
  class TokenClient {
36
38
  constructor(query, configProvider) {
37
39
  this.query = query;
@@ -39,6 +41,7 @@ class TokenClient {
39
41
  this.tokens = {};
40
42
  this.wrapperMap = {};
41
43
  this.poolTokens = {};
44
+ this.cdpTokens = {};
42
45
  this.symbols = {};
43
46
  this.usdValues = {};
44
47
  this.commonAssetNames = constant_1.CommonAssetName;
@@ -72,16 +75,16 @@ class TokenClient {
72
75
  return (_a = this.commonAssetNames[denom]) !== null && _a !== void 0 ? _a : denom;
73
76
  }
74
77
  getDecimals(denom) {
75
- var _a, _b;
76
- return (_b = ((_a = this.tokens[denom]) !== null && _a !== void 0 ? _a : this.poolTokens[denom])) === null || _b === void 0 ? void 0 : _b.decimals.toNumber();
78
+ var _a, _b, _c;
79
+ return (_c = ((_b = (_a = this.tokens[denom]) !== null && _a !== void 0 ? _a : this.poolTokens[denom]) !== null && _b !== void 0 ? _b : this.cdpTokens[denom])) === null || _c === void 0 ? void 0 : _c.decimals.toNumber();
77
80
  }
78
81
  getBlockchain(denom) {
79
82
  var _a, _b, _c;
80
83
  // chainId defaults to 3 so that blockchain will be undefined
81
84
  let chainId = (_c = (_b = (_a = this.tokens[denom]) === null || _a === void 0 ? void 0 : _a.chainId) === null || _b === void 0 ? void 0 : _b.toNumber()) !== null && _c !== void 0 ? _c : 3;
82
- if (this.isNativeToken(denom) || TokenClient.isPoolToken(denom)) {
83
- // native denom "swth" should be native.
84
- // pool tokens are on the Native blockchain, hence 0
85
+ if (this.isNativeToken(denom) || this.isNativeStablecoin(denom) || TokenClient.isPoolToken(denom) || TokenClient.isCdpToken(denom)) {
86
+ // native denoms "swth" and "usc" should be native.
87
+ // pool and cdp tokens are on the Native blockchain, hence 0
85
88
  chainId = 0;
86
89
  }
87
90
  if (TokenClient.isIBCDenom(denom)) {
@@ -91,9 +94,12 @@ class TokenClient {
91
94
  return blockchain;
92
95
  }
93
96
  getSymbol(denom) {
94
- var _a;
97
+ var _a, _b;
98
+ if (TokenClient.isCdpToken(denom)) {
99
+ return (_a = this.symbols[denom]) !== null && _a !== void 0 ? _a : denom;
100
+ }
95
101
  const commonDenom = this.getCommonDenom(denom);
96
- return (_a = this.symbols[commonDenom]) !== null && _a !== void 0 ? _a : commonDenom.toUpperCase();
102
+ return (_b = this.symbols[commonDenom]) !== null && _b !== void 0 ? _b : commonDenom.toUpperCase();
97
103
  }
98
104
  getUSDValue(denom) {
99
105
  return this.usdValues[denom];
@@ -155,7 +161,7 @@ class TokenClient {
155
161
  return symbol;
156
162
  }
157
163
  getTokenDesc(denom) {
158
- var _a, _b;
164
+ var _a, _b, _c, _d;
159
165
  if (typeof denom !== 'string')
160
166
  return '';
161
167
  denom = denom.toLowerCase();
@@ -172,14 +178,20 @@ class TokenClient {
172
178
  const symbolB = this.getTokenName(denomB);
173
179
  return `${weightA}% ${symbolA} / ${weightB}% ${symbolB}`;
174
180
  }
175
- return (_b = (_a = this.tokens[denom]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : this.getSymbol(denom);
181
+ if (TokenClient.isCdpToken(denom)) {
182
+ return (_b = (_a = this.cdpTokens[denom]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : this.getSymbol(denom);
183
+ }
184
+ return (_d = (_c = this.tokens[denom]) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : this.getSymbol(denom);
176
185
  }
177
186
  static isPoolTokenNew(denom) {
178
- return denom.match(/^clpt\/(\d+)$/i) !== null;
187
+ return denom.match(regexLPDenom) !== null;
179
188
  }
180
189
  static isPoolTokenLegacy(denom) {
181
190
  return denom.match(/^([a-z\d.-]+)-(\d+)-([a-z\d.-]+)-(\d+)-lp\d+$/i) !== null;
182
191
  }
192
+ static isCdpToken(denom) {
193
+ return denom.match(regexCdpDenom) !== null;
194
+ }
183
195
  static isPoolToken(denom) {
184
196
  return this.isPoolTokenNew(denom) || this.isPoolTokenLegacy(denom);
185
197
  }
@@ -252,9 +264,15 @@ class TokenClient {
252
264
  getNativeToken() {
253
265
  return this.tokenForId("swth");
254
266
  }
267
+ getNativeStablecoin() {
268
+ return this.tokenForId("usc");
269
+ }
255
270
  isNativeToken(denom) {
256
271
  return denom === "swth";
257
272
  }
273
+ isNativeStablecoin(denom) {
274
+ return denom === "usc";
275
+ }
258
276
  getDepositTokenFor(tokenDenom, chain) {
259
277
  const token = this.tokenForDenom(tokenDenom);
260
278
  if (!token) {
@@ -300,6 +318,10 @@ class TokenClient {
300
318
  if (TokenClient.isPoolToken(token.denom)) {
301
319
  this.poolTokens[token.denom] = token;
302
320
  }
321
+ else if (TokenClient.isCdpToken(token.denom)) {
322
+ this.cdpTokens[token.denom] = token;
323
+ this.symbols[token.denom] = token.symbol;
324
+ }
303
325
  else {
304
326
  if (this.isNativeToken(token.denom)) {
305
327
  // Change token name to Carbon
@@ -356,6 +378,12 @@ class TokenClient {
356
378
  });
357
379
  return swthTokens;
358
380
  }
381
+ getCdpUnderlyingToken(cdpDenom) {
382
+ if (!this.cdpTokens[cdpDenom])
383
+ throw new Error("not a CDP denom");
384
+ const tokenDenom = cdpDenom.replace(regexCdpDenom, "");
385
+ return this.tokenForDenom(tokenDenom);
386
+ }
359
387
  reloadWrapperMap() {
360
388
  var _a;
361
389
  return __awaiter(this, void 0, void 0, function* () {
@@ -76,7 +76,7 @@ export declare class ZILClient {
76
76
  };
77
77
  private walletProvider?;
78
78
  private constructor();
79
- static instance(opts: ZILClientOpts): ZILClient;
79
+ static instance(opts: ZILClientOpts): CarbonSDK.ZILClient;
80
80
  getExternalBalances(sdk: CarbonSDK, address: string, whitelistDenoms?: string[]): Promise<TokensWithExternalBalance[]>;
81
81
  formatWithdrawalAddress(bech32Address: string): Promise<string>;
82
82
  private callContract;
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { OrderBook, StopBook } from "../book/book";
3
+ import { OrderBook, StopBook } from "./book";
4
4
  export declare const protobufPackage = "Switcheo.carbon.book";
5
5
  /** GenesisState defines the book module's genesis state. */
6
6
  export interface GenesisState {
@@ -7,7 +7,7 @@ exports.GenesisState = exports.protobufPackage = void 0;
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const book_1 = require("../book/book");
10
+ const book_1 = require("./book");
11
11
  exports.protobufPackage = "Switcheo.carbon.book";
12
12
  const baseGenesisState = {};
13
13
  exports.GenesisState = {
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { OrderBook } from "../book/book";
3
+ import { OrderBook } from "./book";
4
4
  import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
5
5
  export declare const protobufPackage = "Switcheo.carbon.book";
6
6
  /** this line is used by starport scaffolding # 3 */
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryAllBookResponse = exports.QueryAllBookReq
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const book_1 = require("../book/book");
10
+ const book_1 = require("./book");
11
11
  const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
12
12
  exports.protobufPackage = "Switcheo.carbon.book";
13
13
  const baseQueryGetBookRequest = { market: "" };
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { Amm } from "../broker/amm";
3
+ import { Amm } from "./amm";
4
4
  export declare const protobufPackage = "Switcheo.carbon.broker";
5
5
  /** GenesisState defines the broker module's genesis state. */
6
6
  export interface GenesisState {
@@ -7,7 +7,7 @@ exports.GenesisState = exports.protobufPackage = void 0;
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const amm_1 = require("../broker/amm");
10
+ const amm_1 = require("./amm");
11
11
  exports.protobufPackage = "Switcheo.carbon.broker";
12
12
  const baseGenesisState = {};
13
13
  exports.GenesisState = {
@@ -1,9 +1,9 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
3
  import { PageRequest, PageResponse } from "../query/pagination";
4
- import { MinMaxBoundary } from "../broker/pagination";
5
- import { Candlestick } from "../broker/candlestick";
6
- import { TradeEvent } from "../broker/event";
4
+ import { MinMaxBoundary } from "./pagination";
5
+ import { Candlestick } from "./candlestick";
6
+ import { TradeEvent } from "./event";
7
7
  export declare const protobufPackage = "Switcheo.carbon.broker";
8
8
  export interface QueryCandlesticksRequest {
9
9
  market: string;
@@ -8,9 +8,9 @@ exports.QueryClientImpl = exports.QueryTradesForPositionResponse = exports.Query
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
10
  const pagination_1 = require("../query/pagination");
11
- const pagination_2 = require("../broker/pagination");
12
- const candlestick_1 = require("../broker/candlestick");
13
- const event_1 = require("../broker/event");
11
+ const pagination_2 = require("./pagination");
12
+ const candlestick_1 = require("./candlestick");
13
+ const event_1 = require("./event");
14
14
  exports.protobufPackage = "Switcheo.carbon.broker";
15
15
  const baseQueryCandlesticksRequest = {
16
16
  market: "",
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { DenomInfo } from "../btcx/denom_info";
3
+ import { DenomInfo } from "./denom_info";
4
4
  export declare const protobufPackage = "Switcheo.carbon.btcx";
5
5
  export interface DenomCrossChainInfo {
6
6
  denomInfo?: DenomInfo;
@@ -7,7 +7,7 @@ exports.DenomCrossChainInfo = exports.protobufPackage = void 0;
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const denom_info_1 = require("../btcx/denom_info");
10
+ const denom_info_1 = require("./denom_info");
11
11
  exports.protobufPackage = "Switcheo.carbon.btcx";
12
12
  const baseDenomCrossChainInfo = {
13
13
  toChainId: long_1.default.UZERO,
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { DenomInfo } from "../btcx/denom_info";
3
+ import { DenomInfo } from "./denom_info";
4
4
  export declare const protobufPackage = "Switcheo.carbon.btcx";
5
5
  /** this line is used by starport scaffolding # 3 */
6
6
  export interface QueryGetDenomInfoRequest {
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryGetDenomCrossChainInfoResponse = exports.
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const denom_info_1 = require("../btcx/denom_info");
10
+ const denom_info_1 = require("./denom_info");
11
11
  exports.protobufPackage = "Switcheo.carbon.btcx";
12
12
  const baseQueryGetDenomInfoRequest = { denom: "" };
13
13
  exports.QueryGetDenomInfoRequest = {
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { Params } from "../ccm/ccm";
3
+ import { Params } from "./ccm";
4
4
  export declare const protobufPackage = "Switcheo.carbon.ccm";
5
5
  /** GenesisState defines the ccm module's genesis state. */
6
6
  export interface GenesisState {
@@ -7,7 +7,7 @@ exports.GenesisState_ZionCreatedTxDetailsEntry = exports.GenesisState_DenomCreat
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const ccm_1 = require("../ccm/ccm");
10
+ const ccm_1 = require("./ccm");
11
11
  exports.protobufPackage = "Switcheo.carbon.ccm";
12
12
  const baseGenesisState = { createdTxCount: "" };
13
13
  exports.GenesisState = {
@@ -8,7 +8,7 @@ export interface AssetParams {
8
8
  allowRepayStablecoinInterestDebt: boolean;
9
9
  loanToValue: string;
10
10
  liquidationThreshold: string;
11
- liquidationBonus: string;
11
+ liquidationDiscount: string;
12
12
  supplyCap: string;
13
13
  borrowCap: string;
14
14
  }
@@ -15,7 +15,7 @@ const baseAssetParams = {
15
15
  allowRepayStablecoinInterestDebt: false,
16
16
  loanToValue: "",
17
17
  liquidationThreshold: "",
18
- liquidationBonus: "",
18
+ liquidationDiscount: "",
19
19
  supplyCap: "",
20
20
  borrowCap: "",
21
21
  };
@@ -39,8 +39,8 @@ exports.AssetParams = {
39
39
  if (message.liquidationThreshold !== "") {
40
40
  writer.uint32(50).string(message.liquidationThreshold);
41
41
  }
42
- if (message.liquidationBonus !== "") {
43
- writer.uint32(58).string(message.liquidationBonus);
42
+ if (message.liquidationDiscount !== "") {
43
+ writer.uint32(58).string(message.liquidationDiscount);
44
44
  }
45
45
  if (message.supplyCap !== "") {
46
46
  writer.uint32(66).string(message.supplyCap);
@@ -76,7 +76,7 @@ exports.AssetParams = {
76
76
  message.liquidationThreshold = reader.string();
77
77
  break;
78
78
  case 7:
79
- message.liquidationBonus = reader.string();
79
+ message.liquidationDiscount = reader.string();
80
80
  break;
81
81
  case 8:
82
82
  message.supplyCap = reader.string();
@@ -119,9 +119,10 @@ exports.AssetParams = {
119
119
  object.liquidationThreshold !== null
120
120
  ? String(object.liquidationThreshold)
121
121
  : "";
122
- message.liquidationBonus =
123
- object.liquidationBonus !== undefined && object.liquidationBonus !== null
124
- ? String(object.liquidationBonus)
122
+ message.liquidationDiscount =
123
+ object.liquidationDiscount !== undefined &&
124
+ object.liquidationDiscount !== null
125
+ ? String(object.liquidationDiscount)
125
126
  : "";
126
127
  message.supplyCap =
127
128
  object.supplyCap !== undefined && object.supplyCap !== null
@@ -146,8 +147,8 @@ exports.AssetParams = {
146
147
  (obj.loanToValue = message.loanToValue);
147
148
  message.liquidationThreshold !== undefined &&
148
149
  (obj.liquidationThreshold = message.liquidationThreshold);
149
- message.liquidationBonus !== undefined &&
150
- (obj.liquidationBonus = message.liquidationBonus);
150
+ message.liquidationDiscount !== undefined &&
151
+ (obj.liquidationDiscount = message.liquidationDiscount);
151
152
  message.supplyCap !== undefined && (obj.supplyCap = message.supplyCap);
152
153
  message.borrowCap !== undefined && (obj.borrowCap = message.borrowCap);
153
154
  return obj;
@@ -162,7 +163,7 @@ exports.AssetParams = {
162
163
  (_d = object.allowRepayStablecoinInterestDebt) !== null && _d !== void 0 ? _d : false;
163
164
  message.loanToValue = (_e = object.loanToValue) !== null && _e !== void 0 ? _e : "";
164
165
  message.liquidationThreshold = (_f = object.liquidationThreshold) !== null && _f !== void 0 ? _f : "";
165
- message.liquidationBonus = (_g = object.liquidationBonus) !== null && _g !== void 0 ? _g : "";
166
+ message.liquidationDiscount = (_g = object.liquidationDiscount) !== null && _g !== void 0 ? _g : "";
166
167
  message.supplyCap = (_h = object.supplyCap) !== null && _h !== void 0 ? _h : "";
167
168
  message.borrowCap = (_j = object.borrowCap) !== null && _j !== void 0 ? _j : "";
168
169
  return message;