carbon-js-sdk 0.2.13 → 0.2.14-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.
- package/lib/clients/NEOClient.js +1 -1
- package/lib/clients/TokenClient.d.ts +5 -0
- package/lib/clients/TokenClient.js +29 -7
- package/lib/codec/book/genesis.d.ts +1 -1
- package/lib/codec/book/genesis.js +1 -1
- package/lib/codec/book/query.d.ts +1 -1
- package/lib/codec/book/query.js +1 -1
- package/lib/codec/broker/genesis.d.ts +1 -1
- package/lib/codec/broker/genesis.js +1 -1
- package/lib/codec/broker/query.d.ts +3 -3
- package/lib/codec/broker/query.js +3 -3
- package/lib/codec/btcx/denom_cross_chain_info.d.ts +1 -1
- package/lib/codec/btcx/denom_cross_chain_info.js +1 -1
- package/lib/codec/btcx/query.d.ts +1 -1
- package/lib/codec/btcx/query.js +1 -1
- package/lib/codec/ccm/genesis.d.ts +1 -1
- package/lib/codec/ccm/genesis.js +1 -1
- package/lib/codec/cdp/asset_params.d.ts +1 -12
- package/lib/codec/cdp/asset_params.js +14 -81
- package/lib/codec/cdp/debt_info.d.ts +1 -1
- package/lib/codec/cdp/debt_info.js +11 -13
- package/lib/codec/cdp/event.d.ts +321 -22
- package/lib/codec/cdp/event.js +2005 -82
- package/lib/codec/cdp/genesis.d.ts +80 -4
- package/lib/codec/cdp/genesis.js +531 -22
- package/lib/codec/cdp/params.d.ts +35 -0
- package/lib/codec/cdp/params.js +47 -1
- package/lib/codec/cdp/query.d.ts +437 -89
- package/lib/codec/cdp/query.js +1966 -177
- package/lib/codec/cdp/reward_scheme.d.ts +85 -0
- package/lib/codec/cdp/reward_scheme.js +656 -0
- package/lib/codec/cdp/stablecoin_debt_info.d.ts +1 -1
- package/lib/codec/cdp/stablecoin_debt_info.js +11 -13
- package/lib/codec/cdp/tx.d.ts +667 -96
- package/lib/codec/cdp/tx.js +3196 -243
- package/lib/codec/coin/event.d.ts +1 -1
- package/lib/codec/coin/event.js +1 -1
- package/lib/codec/coin/genesis.d.ts +2 -2
- package/lib/codec/coin/genesis.js +2 -2
- package/lib/codec/coin/proposal.d.ts +1 -1
- package/lib/codec/coin/proposal.js +1 -1
- package/lib/codec/coin/query.d.ts +2 -5
- package/lib/codec/coin/query.js +2 -8
- package/lib/codec/coin/token.d.ts +11 -0
- package/lib/codec/coin/token.js +65 -1
- package/lib/codec/coin/tx.d.ts +1 -1
- package/lib/codec/coin/tx.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/auth/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +19 -0
- package/lib/codec/cosmos/authz/v1beta1/authz.js +89 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -15
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +7 -120
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +70 -2
- package/lib/codec/cosmos/authz/v1beta1/query.js +275 -3
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +43 -3
- package/lib/codec/cosmos/bank/v1beta1/query.js +140 -4
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +64 -0
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.js +343 -1
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/query.js +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +35 -2
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +139 -3
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +14 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +19 -1
- package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +53 -5
- package/lib/codec/cosmos/tx/v1beta1/service.js +179 -4
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.js +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
- package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
- package/lib/codec/fee/genesis.d.ts +1 -1
- package/lib/codec/fee/genesis.js +1 -1
- package/lib/codec/fee/proposal.d.ts +1 -1
- package/lib/codec/fee/proposal.js +1 -1
- package/lib/codec/fee/query.d.ts +1 -1
- package/lib/codec/fee/query.js +1 -1
- package/lib/codec/fee/tx.d.ts +1 -1
- package/lib/codec/fee/tx.js +1 -1
- package/lib/codec/headersync/genesis.d.ts +1 -1
- package/lib/codec/headersync/genesis.js +1 -1
- package/lib/codec/headersync/query.d.ts +1 -1
- package/lib/codec/headersync/query.js +1 -1
- package/lib/codec/index.d.ts +71 -23
- package/lib/codec/index.js +590 -384
- package/lib/codec/inflation/genesis.d.ts +1 -1
- package/lib/codec/inflation/genesis.js +1 -1
- package/lib/codec/inflation/query.d.ts +1 -1
- package/lib/codec/inflation/query.js +1 -1
- package/lib/codec/insurance/genesis.d.ts +1 -1
- package/lib/codec/insurance/genesis.js +1 -1
- package/lib/codec/leverage/genesis.d.ts +1 -1
- package/lib/codec/leverage/genesis.js +1 -1
- package/lib/codec/leverage/query.d.ts +1 -1
- package/lib/codec/leverage/query.js +1 -1
- package/lib/codec/liquidation/genesis.d.ts +1 -1
- package/lib/codec/liquidation/genesis.js +1 -1
- package/lib/codec/liquidation/query.d.ts +1 -1
- package/lib/codec/liquidation/query.js +1 -1
- package/lib/codec/liquidation/quote_changes.d.ts +1 -1
- package/lib/codec/liquidation/quote_changes.js +1 -1
- package/lib/codec/liquiditypool/event.d.ts +2 -2
- package/lib/codec/liquiditypool/event.js +2 -2
- package/lib/codec/liquiditypool/genesis.d.ts +2 -2
- package/lib/codec/liquiditypool/genesis.js +2 -2
- package/lib/codec/liquiditypool/proposal.d.ts +1 -1
- package/lib/codec/liquiditypool/proposal.js +1 -1
- package/lib/codec/liquiditypool/query.d.ts +2 -2
- package/lib/codec/liquiditypool/query.js +2 -2
- package/lib/codec/liquiditypool/tx.d.ts +1 -1
- package/lib/codec/liquiditypool/tx.js +1 -1
- package/lib/codec/lockproxy/genesis.d.ts +1 -1
- package/lib/codec/lockproxy/genesis.js +1 -1
- package/lib/codec/lockproxy/query.d.ts +1 -1
- package/lib/codec/lockproxy/query.js +1 -1
- package/lib/codec/market/event.d.ts +1 -1
- package/lib/codec/market/event.js +1 -1
- package/lib/codec/market/genesis.d.ts +2 -1
- package/lib/codec/market/genesis.js +20 -2
- package/lib/codec/market/proposal.d.ts +1 -1
- package/lib/codec/market/proposal.js +1 -1
- package/lib/codec/market/query.d.ts +1 -1
- package/lib/codec/market/query.js +1 -1
- package/lib/codec/market/tx.d.ts +1 -1
- package/lib/codec/market/tx.js +1 -1
- package/lib/codec/marketstats/genesis.d.ts +1 -1
- package/lib/codec/marketstats/genesis.js +1 -1
- package/lib/codec/marketstats/query.d.ts +2 -2
- package/lib/codec/marketstats/query.js +2 -2
- package/lib/codec/misc/message.d.ts +1 -1
- package/lib/codec/misc/message.js +1 -1
- package/lib/codec/misc/query.d.ts +3 -3
- package/lib/codec/misc/query.js +3 -3
- package/lib/codec/misc/trade.d.ts +1 -0
- package/lib/codec/misc/trade.js +17 -0
- package/lib/codec/misc/transaction.d.ts +1 -1
- package/lib/codec/misc/transaction.js +1 -1
- package/lib/codec/oracle/event.d.ts +1 -1
- package/lib/codec/oracle/event.js +1 -1
- package/lib/codec/oracle/genesis.d.ts +1 -1
- package/lib/codec/oracle/genesis.js +1 -1
- package/lib/codec/oracle/proposal.d.ts +1 -1
- package/lib/codec/oracle/proposal.js +1 -1
- package/lib/codec/oracle/query.d.ts +2 -2
- package/lib/codec/oracle/query.js +2 -2
- package/lib/codec/order/event.d.ts +1 -1
- package/lib/codec/order/event.js +1 -1
- package/lib/codec/order/genesis.d.ts +1 -1
- package/lib/codec/order/genesis.js +1 -1
- package/lib/codec/order/query.d.ts +1 -1
- package/lib/codec/order/query.js +1 -1
- package/lib/codec/position/event.d.ts +1 -1
- package/lib/codec/position/event.js +1 -1
- package/lib/codec/position/genesis.d.ts +1 -1
- package/lib/codec/position/genesis.js +1 -1
- package/lib/codec/position/query.d.ts +1 -1
- package/lib/codec/position/query.js +1 -1
- package/lib/codec/pricing/event.d.ts +11 -1
- package/lib/codec/pricing/event.js +52 -2
- package/lib/codec/pricing/genesis.d.ts +2 -1
- package/lib/codec/pricing/genesis.js +20 -5
- package/lib/codec/pricing/pricing.d.ts +13 -0
- package/lib/codec/pricing/pricing.js +83 -1
- package/lib/codec/pricing/query.d.ts +68 -1
- package/lib/codec/pricing/query.js +321 -2
- package/lib/codec/profile/event.d.ts +1 -1
- package/lib/codec/profile/event.js +1 -1
- package/lib/codec/profile/genesis.d.ts +1 -1
- package/lib/codec/profile/genesis.js +1 -1
- package/lib/codec/profile/query.d.ts +1 -1
- package/lib/codec/profile/query.js +1 -1
- package/lib/codec/subaccount/genesis.d.ts +1 -1
- package/lib/codec/subaccount/genesis.js +1 -1
- package/lib/codec/subaccount/query.d.ts +1 -1
- package/lib/codec/subaccount/query.js +1 -1
- package/lib/codec/tendermint/abci/types.d.ts +4 -4
- package/lib/codec/tendermint/abci/types.js +4 -4
- package/lib/codec/tendermint/types/block.d.ts +2 -2
- package/lib/codec/tendermint/types/block.js +2 -2
- package/lib/codec/tendermint/types/evidence.d.ts +2 -2
- package/lib/codec/tendermint/types/evidence.js +2 -2
- package/lib/codec/tendermint/types/types.d.ts +3 -3
- package/lib/codec/tendermint/types/types.js +3 -3
- package/lib/codec/tendermint/types/validator.d.ts +1 -1
- package/lib/codec/tendermint/types/validator.js +1 -1
- package/lib/modules/admin.d.ts +53 -1
- package/lib/modules/admin.js +175 -43
- package/lib/modules/cdp.d.ts +104 -13
- package/lib/modules/cdp.js +618 -20
- package/lib/provider/amino/types/admin.js +48 -7
- package/lib/provider/amino/types/cdp.js +72 -32
- package/lib/util/number.d.ts +1 -0
- package/lib/util/number.js +2 -1
- package/lib/util/tx.d.ts +58 -14
- package/lib/wallet/CarbonSigningClient.js +27 -2
- package/lib/wallet/CarbonWallet.js +0 -1
- package/lib/websocket/channel.js +60 -0
- package/lib/websocket/models.d.ts +179 -21
- package/lib/websocket/types.d.ts +69 -3
- package/lib/websocket/types.js +27 -0
- package/package.json +1 -1
package/lib/clients/NEOClient.js
CHANGED
|
@@ -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>;
|
|
@@ -35,6 +36,7 @@ declare class TokenClient {
|
|
|
35
36
|
static isPoolTokenNew(denom: string): boolean;
|
|
36
37
|
static isPoolTokenLegacy(denom: string): boolean;
|
|
37
38
|
static isPoolToken(denom: string): boolean;
|
|
39
|
+
static isCdpToken(denom: string): boolean;
|
|
38
40
|
static isIBCDenom(denom: string): boolean;
|
|
39
41
|
isWrappedToken(denom?: string): boolean;
|
|
40
42
|
hasWrappedToken(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>>;
|
|
@@ -39,6 +39,7 @@ class TokenClient {
|
|
|
39
39
|
this.tokens = {};
|
|
40
40
|
this.wrapperMap = {};
|
|
41
41
|
this.poolTokens = {};
|
|
42
|
+
this.cdpTokens = {};
|
|
42
43
|
this.symbols = {};
|
|
43
44
|
this.usdValues = {};
|
|
44
45
|
this.commonAssetNames = constant_1.CommonAssetName;
|
|
@@ -72,16 +73,16 @@ class TokenClient {
|
|
|
72
73
|
return (_a = this.commonAssetNames[denom]) !== null && _a !== void 0 ? _a : denom;
|
|
73
74
|
}
|
|
74
75
|
getDecimals(denom) {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
return (_b = (
|
|
76
|
+
var _a, _b, _c;
|
|
77
|
+
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
78
|
}
|
|
78
79
|
getBlockchain(denom) {
|
|
79
80
|
var _a, _b, _c;
|
|
80
81
|
// chainId defaults to 3 so that blockchain will be undefined
|
|
81
82
|
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
|
|
84
|
-
// pool tokens are on the Native blockchain, hence 0
|
|
83
|
+
if (this.isNativeToken(denom) || this.isNativeStablecoin(denom) || TokenClient.isPoolToken(denom) || TokenClient.isCdpToken(denom)) {
|
|
84
|
+
// native denoms "swth" and "usc" should be native.
|
|
85
|
+
// pool and cdp tokens are on the Native blockchain, hence 0
|
|
85
86
|
chainId = 0;
|
|
86
87
|
}
|
|
87
88
|
if (TokenClient.isIBCDenom(denom)) {
|
|
@@ -155,7 +156,7 @@ class TokenClient {
|
|
|
155
156
|
return symbol;
|
|
156
157
|
}
|
|
157
158
|
getTokenDesc(denom) {
|
|
158
|
-
var _a, _b;
|
|
159
|
+
var _a, _b, _c, _d;
|
|
159
160
|
if (typeof denom !== 'string')
|
|
160
161
|
return '';
|
|
161
162
|
denom = denom.toLowerCase();
|
|
@@ -172,7 +173,10 @@ class TokenClient {
|
|
|
172
173
|
const symbolB = this.getTokenName(denomB);
|
|
173
174
|
return `${weightA}% ${symbolA} / ${weightB}% ${symbolB}`;
|
|
174
175
|
}
|
|
175
|
-
|
|
176
|
+
if (TokenClient.isCdpToken(denom)) {
|
|
177
|
+
return (_b = (_a = this.cdpTokens[denom]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : this.getSymbol(denom);
|
|
178
|
+
}
|
|
179
|
+
return (_d = (_c = this.tokens[denom]) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : this.getSymbol(denom);
|
|
176
180
|
}
|
|
177
181
|
static isPoolTokenNew(denom) {
|
|
178
182
|
return denom.match(/^clpt\/(\d+)$/i) !== null;
|
|
@@ -183,6 +187,9 @@ class TokenClient {
|
|
|
183
187
|
static isPoolToken(denom) {
|
|
184
188
|
return this.isPoolTokenNew(denom) || this.isPoolTokenLegacy(denom);
|
|
185
189
|
}
|
|
190
|
+
static isCdpToken(denom) {
|
|
191
|
+
return denom.includes('cdp/');
|
|
192
|
+
}
|
|
186
193
|
static isIBCDenom(denom) {
|
|
187
194
|
return denom.match(ibc_1.ibcTokenRegex) !== null;
|
|
188
195
|
}
|
|
@@ -252,9 +259,15 @@ class TokenClient {
|
|
|
252
259
|
getNativeToken() {
|
|
253
260
|
return this.tokenForId("swth");
|
|
254
261
|
}
|
|
262
|
+
getNativeStablecoin() {
|
|
263
|
+
return this.tokenForId("usc");
|
|
264
|
+
}
|
|
255
265
|
isNativeToken(denom) {
|
|
256
266
|
return denom === "swth";
|
|
257
267
|
}
|
|
268
|
+
isNativeStablecoin(denom) {
|
|
269
|
+
return denom === "usc";
|
|
270
|
+
}
|
|
258
271
|
getDepositTokenFor(tokenDenom, chain) {
|
|
259
272
|
const token = this.tokenForDenom(tokenDenom);
|
|
260
273
|
if (!token) {
|
|
@@ -300,6 +313,9 @@ class TokenClient {
|
|
|
300
313
|
if (TokenClient.isPoolToken(token.denom)) {
|
|
301
314
|
this.poolTokens[token.denom] = token;
|
|
302
315
|
}
|
|
316
|
+
else if (TokenClient.isCdpToken(token.denom)) {
|
|
317
|
+
this.cdpTokens[token.denom] = token;
|
|
318
|
+
}
|
|
303
319
|
else {
|
|
304
320
|
if (this.isNativeToken(token.denom)) {
|
|
305
321
|
// Change token name to Carbon
|
|
@@ -356,6 +372,12 @@ class TokenClient {
|
|
|
356
372
|
});
|
|
357
373
|
return swthTokens;
|
|
358
374
|
}
|
|
375
|
+
getCdpUnderlyingToken(cdpDenom) {
|
|
376
|
+
if (!this.cdpTokens[cdpDenom])
|
|
377
|
+
throw new Error("not a CDP denom");
|
|
378
|
+
const tokenDenom = cdpDenom.replace(/^cdp\//i, "");
|
|
379
|
+
return this.tokenForDenom(tokenDenom);
|
|
380
|
+
}
|
|
359
381
|
reloadWrapperMap() {
|
|
360
382
|
var _a;
|
|
361
383
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { OrderBook, StopBook } from "
|
|
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("
|
|
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 "
|
|
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 */
|
package/lib/codec/book/query.js
CHANGED
|
@@ -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("
|
|
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 "
|
|
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("
|
|
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 "
|
|
5
|
-
import { Candlestick } from "
|
|
6
|
-
import { TradeEvent } from "
|
|
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("
|
|
12
|
-
const candlestick_1 = require("
|
|
13
|
-
const event_1 = require("
|
|
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 "
|
|
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("
|
|
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 "
|
|
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 {
|
package/lib/codec/btcx/query.js
CHANGED
|
@@ -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("
|
|
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 "
|
|
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 {
|
package/lib/codec/ccm/genesis.js
CHANGED
|
@@ -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("
|
|
10
|
+
const ccm_1 = require("./ccm");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.ccm";
|
|
12
12
|
const baseGenesisState = { createdTxCount: "" };
|
|
13
13
|
exports.GenesisState = {
|
|
@@ -5,7 +5,7 @@ export interface AssetParams {
|
|
|
5
5
|
denom: string;
|
|
6
6
|
oracleId: string;
|
|
7
7
|
rateStrategyName: string;
|
|
8
|
-
|
|
8
|
+
allowRepayStablecoinInterestDebt: boolean;
|
|
9
9
|
loanToValue: string;
|
|
10
10
|
liquidationThreshold: string;
|
|
11
11
|
liquidationBonus: string;
|
|
@@ -18,10 +18,6 @@ export interface AssetUtilization {
|
|
|
18
18
|
totalAmount: string;
|
|
19
19
|
utilizationRate: string;
|
|
20
20
|
}
|
|
21
|
-
export interface AssetData {
|
|
22
|
-
assetParams?: AssetParams;
|
|
23
|
-
assetUtilization?: AssetUtilization;
|
|
24
|
-
}
|
|
25
21
|
export declare const AssetParams: {
|
|
26
22
|
encode(message: AssetParams, writer?: _m0.Writer): _m0.Writer;
|
|
27
23
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AssetParams;
|
|
@@ -36,13 +32,6 @@ export declare const AssetUtilization: {
|
|
|
36
32
|
toJSON(message: AssetUtilization): unknown;
|
|
37
33
|
fromPartial(object: DeepPartial<AssetUtilization>): AssetUtilization;
|
|
38
34
|
};
|
|
39
|
-
export declare const AssetData: {
|
|
40
|
-
encode(message: AssetData, writer?: _m0.Writer): _m0.Writer;
|
|
41
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AssetData;
|
|
42
|
-
fromJSON(object: any): AssetData;
|
|
43
|
-
toJSON(message: AssetData): unknown;
|
|
44
|
-
fromPartial(object: DeepPartial<AssetData>): AssetData;
|
|
45
|
-
};
|
|
46
35
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
47
36
|
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
48
37
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,7 +3,7 @@ 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.
|
|
6
|
+
exports.AssetUtilization = exports.AssetParams = 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"));
|
|
@@ -12,7 +12,7 @@ const baseAssetParams = {
|
|
|
12
12
|
denom: "",
|
|
13
13
|
oracleId: "",
|
|
14
14
|
rateStrategyName: "",
|
|
15
|
-
|
|
15
|
+
allowRepayStablecoinInterestDebt: false,
|
|
16
16
|
loanToValue: "",
|
|
17
17
|
liquidationThreshold: "",
|
|
18
18
|
liquidationBonus: "",
|
|
@@ -30,8 +30,8 @@ exports.AssetParams = {
|
|
|
30
30
|
if (message.rateStrategyName !== "") {
|
|
31
31
|
writer.uint32(26).string(message.rateStrategyName);
|
|
32
32
|
}
|
|
33
|
-
if (message.
|
|
34
|
-
writer.uint32(32).bool(message.
|
|
33
|
+
if (message.allowRepayStablecoinInterestDebt === true) {
|
|
34
|
+
writer.uint32(32).bool(message.allowRepayStablecoinInterestDebt);
|
|
35
35
|
}
|
|
36
36
|
if (message.loanToValue !== "") {
|
|
37
37
|
writer.uint32(42).string(message.loanToValue);
|
|
@@ -67,7 +67,7 @@ exports.AssetParams = {
|
|
|
67
67
|
message.rateStrategyName = reader.string();
|
|
68
68
|
break;
|
|
69
69
|
case 4:
|
|
70
|
-
message.
|
|
70
|
+
message.allowRepayStablecoinInterestDebt = reader.bool();
|
|
71
71
|
break;
|
|
72
72
|
case 5:
|
|
73
73
|
message.loanToValue = reader.string();
|
|
@@ -105,10 +105,10 @@ exports.AssetParams = {
|
|
|
105
105
|
object.rateStrategyName !== undefined && object.rateStrategyName !== null
|
|
106
106
|
? String(object.rateStrategyName)
|
|
107
107
|
: "";
|
|
108
|
-
message.
|
|
109
|
-
object.
|
|
110
|
-
object.
|
|
111
|
-
? Boolean(object.
|
|
108
|
+
message.allowRepayStablecoinInterestDebt =
|
|
109
|
+
object.allowRepayStablecoinInterestDebt !== undefined &&
|
|
110
|
+
object.allowRepayStablecoinInterestDebt !== null
|
|
111
|
+
? Boolean(object.allowRepayStablecoinInterestDebt)
|
|
112
112
|
: false;
|
|
113
113
|
message.loanToValue =
|
|
114
114
|
object.loanToValue !== undefined && object.loanToValue !== null
|
|
@@ -139,8 +139,9 @@ exports.AssetParams = {
|
|
|
139
139
|
message.oracleId !== undefined && (obj.oracleId = message.oracleId);
|
|
140
140
|
message.rateStrategyName !== undefined &&
|
|
141
141
|
(obj.rateStrategyName = message.rateStrategyName);
|
|
142
|
-
message.
|
|
143
|
-
(obj.
|
|
142
|
+
message.allowRepayStablecoinInterestDebt !== undefined &&
|
|
143
|
+
(obj.allowRepayStablecoinInterestDebt =
|
|
144
|
+
message.allowRepayStablecoinInterestDebt);
|
|
144
145
|
message.loanToValue !== undefined &&
|
|
145
146
|
(obj.loanToValue = message.loanToValue);
|
|
146
147
|
message.liquidationThreshold !== undefined &&
|
|
@@ -157,8 +158,8 @@ exports.AssetParams = {
|
|
|
157
158
|
message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
|
|
158
159
|
message.oracleId = (_b = object.oracleId) !== null && _b !== void 0 ? _b : "";
|
|
159
160
|
message.rateStrategyName = (_c = object.rateStrategyName) !== null && _c !== void 0 ? _c : "";
|
|
160
|
-
message.
|
|
161
|
-
(_d = object.
|
|
161
|
+
message.allowRepayStablecoinInterestDebt =
|
|
162
|
+
(_d = object.allowRepayStablecoinInterestDebt) !== null && _d !== void 0 ? _d : false;
|
|
162
163
|
message.loanToValue = (_e = object.loanToValue) !== null && _e !== void 0 ? _e : "";
|
|
163
164
|
message.liquidationThreshold = (_f = object.liquidationThreshold) !== null && _f !== void 0 ? _f : "";
|
|
164
165
|
message.liquidationBonus = (_g = object.liquidationBonus) !== null && _g !== void 0 ? _g : "";
|
|
@@ -256,74 +257,6 @@ exports.AssetUtilization = {
|
|
|
256
257
|
return message;
|
|
257
258
|
},
|
|
258
259
|
};
|
|
259
|
-
const baseAssetData = {};
|
|
260
|
-
exports.AssetData = {
|
|
261
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
262
|
-
if (message.assetParams !== undefined) {
|
|
263
|
-
exports.AssetParams.encode(message.assetParams, writer.uint32(10).fork()).ldelim();
|
|
264
|
-
}
|
|
265
|
-
if (message.assetUtilization !== undefined) {
|
|
266
|
-
exports.AssetUtilization.encode(message.assetUtilization, writer.uint32(18).fork()).ldelim();
|
|
267
|
-
}
|
|
268
|
-
return writer;
|
|
269
|
-
},
|
|
270
|
-
decode(input, length) {
|
|
271
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
272
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
273
|
-
const message = Object.assign({}, baseAssetData);
|
|
274
|
-
while (reader.pos < end) {
|
|
275
|
-
const tag = reader.uint32();
|
|
276
|
-
switch (tag >>> 3) {
|
|
277
|
-
case 1:
|
|
278
|
-
message.assetParams = exports.AssetParams.decode(reader, reader.uint32());
|
|
279
|
-
break;
|
|
280
|
-
case 2:
|
|
281
|
-
message.assetUtilization = exports.AssetUtilization.decode(reader, reader.uint32());
|
|
282
|
-
break;
|
|
283
|
-
default:
|
|
284
|
-
reader.skipType(tag & 7);
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return message;
|
|
289
|
-
},
|
|
290
|
-
fromJSON(object) {
|
|
291
|
-
const message = Object.assign({}, baseAssetData);
|
|
292
|
-
message.assetParams =
|
|
293
|
-
object.assetParams !== undefined && object.assetParams !== null
|
|
294
|
-
? exports.AssetParams.fromJSON(object.assetParams)
|
|
295
|
-
: undefined;
|
|
296
|
-
message.assetUtilization =
|
|
297
|
-
object.assetUtilization !== undefined && object.assetUtilization !== null
|
|
298
|
-
? exports.AssetUtilization.fromJSON(object.assetUtilization)
|
|
299
|
-
: undefined;
|
|
300
|
-
return message;
|
|
301
|
-
},
|
|
302
|
-
toJSON(message) {
|
|
303
|
-
const obj = {};
|
|
304
|
-
message.assetParams !== undefined &&
|
|
305
|
-
(obj.assetParams = message.assetParams
|
|
306
|
-
? exports.AssetParams.toJSON(message.assetParams)
|
|
307
|
-
: undefined);
|
|
308
|
-
message.assetUtilization !== undefined &&
|
|
309
|
-
(obj.assetUtilization = message.assetUtilization
|
|
310
|
-
? exports.AssetUtilization.toJSON(message.assetUtilization)
|
|
311
|
-
: undefined);
|
|
312
|
-
return obj;
|
|
313
|
-
},
|
|
314
|
-
fromPartial(object) {
|
|
315
|
-
const message = Object.assign({}, baseAssetData);
|
|
316
|
-
message.assetParams =
|
|
317
|
-
object.assetParams !== undefined && object.assetParams !== null
|
|
318
|
-
? exports.AssetParams.fromPartial(object.assetParams)
|
|
319
|
-
: undefined;
|
|
320
|
-
message.assetUtilization =
|
|
321
|
-
object.assetUtilization !== undefined && object.assetUtilization !== null
|
|
322
|
-
? exports.AssetUtilization.fromPartial(object.assetUtilization)
|
|
323
|
-
: undefined;
|
|
324
|
-
return message;
|
|
325
|
-
},
|
|
326
|
-
};
|
|
327
260
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
328
261
|
minimal_1.default.util.Long = long_1.default;
|
|
329
262
|
minimal_1.default.configure();
|
|
@@ -6,7 +6,7 @@ export interface DebtInfo {
|
|
|
6
6
|
lastUpdatedTime?: Date;
|
|
7
7
|
totalPrincipal: string;
|
|
8
8
|
cumulativeInterestMultiplier: string;
|
|
9
|
-
|
|
9
|
+
totalAccumulatedInterest: string;
|
|
10
10
|
utilizationRate: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const DebtInfo: {
|
|
@@ -13,7 +13,7 @@ const baseDebtInfo = {
|
|
|
13
13
|
denom: "",
|
|
14
14
|
totalPrincipal: "",
|
|
15
15
|
cumulativeInterestMultiplier: "",
|
|
16
|
-
|
|
16
|
+
totalAccumulatedInterest: "",
|
|
17
17
|
utilizationRate: "",
|
|
18
18
|
};
|
|
19
19
|
exports.DebtInfo = {
|
|
@@ -30,8 +30,8 @@ exports.DebtInfo = {
|
|
|
30
30
|
if (message.cumulativeInterestMultiplier !== "") {
|
|
31
31
|
writer.uint32(34).string(message.cumulativeInterestMultiplier);
|
|
32
32
|
}
|
|
33
|
-
if (message.
|
|
34
|
-
writer.uint32(42).string(message.
|
|
33
|
+
if (message.totalAccumulatedInterest !== "") {
|
|
34
|
+
writer.uint32(42).string(message.totalAccumulatedInterest);
|
|
35
35
|
}
|
|
36
36
|
if (message.utilizationRate !== "") {
|
|
37
37
|
writer.uint32(50).string(message.utilizationRate);
|
|
@@ -58,7 +58,7 @@ exports.DebtInfo = {
|
|
|
58
58
|
message.cumulativeInterestMultiplier = reader.string();
|
|
59
59
|
break;
|
|
60
60
|
case 5:
|
|
61
|
-
message.
|
|
61
|
+
message.totalAccumulatedInterest = reader.string();
|
|
62
62
|
break;
|
|
63
63
|
case 6:
|
|
64
64
|
message.utilizationRate = reader.string();
|
|
@@ -89,10 +89,10 @@ exports.DebtInfo = {
|
|
|
89
89
|
object.cumulativeInterestMultiplier !== null
|
|
90
90
|
? String(object.cumulativeInterestMultiplier)
|
|
91
91
|
: "";
|
|
92
|
-
message.
|
|
93
|
-
object.
|
|
94
|
-
object.
|
|
95
|
-
? String(object.
|
|
92
|
+
message.totalAccumulatedInterest =
|
|
93
|
+
object.totalAccumulatedInterest !== undefined &&
|
|
94
|
+
object.totalAccumulatedInterest !== null
|
|
95
|
+
? String(object.totalAccumulatedInterest)
|
|
96
96
|
: "";
|
|
97
97
|
message.utilizationRate =
|
|
98
98
|
object.utilizationRate !== undefined && object.utilizationRate !== null
|
|
@@ -109,9 +109,8 @@ exports.DebtInfo = {
|
|
|
109
109
|
(obj.totalPrincipal = message.totalPrincipal);
|
|
110
110
|
message.cumulativeInterestMultiplier !== undefined &&
|
|
111
111
|
(obj.cumulativeInterestMultiplier = message.cumulativeInterestMultiplier);
|
|
112
|
-
message.
|
|
113
|
-
(obj.
|
|
114
|
-
message.initialCumulativeInterestMultiplier);
|
|
112
|
+
message.totalAccumulatedInterest !== undefined &&
|
|
113
|
+
(obj.totalAccumulatedInterest = message.totalAccumulatedInterest);
|
|
115
114
|
message.utilizationRate !== undefined &&
|
|
116
115
|
(obj.utilizationRate = message.utilizationRate);
|
|
117
116
|
return obj;
|
|
@@ -124,8 +123,7 @@ exports.DebtInfo = {
|
|
|
124
123
|
message.totalPrincipal = (_c = object.totalPrincipal) !== null && _c !== void 0 ? _c : "";
|
|
125
124
|
message.cumulativeInterestMultiplier =
|
|
126
125
|
(_d = object.cumulativeInterestMultiplier) !== null && _d !== void 0 ? _d : "";
|
|
127
|
-
message.
|
|
128
|
-
(_e = object.initialCumulativeInterestMultiplier) !== null && _e !== void 0 ? _e : "";
|
|
126
|
+
message.totalAccumulatedInterest = (_e = object.totalAccumulatedInterest) !== null && _e !== void 0 ? _e : "";
|
|
129
127
|
message.utilizationRate = (_f = object.utilizationRate) !== null && _f !== void 0 ? _f : "";
|
|
130
128
|
return message;
|
|
131
129
|
},
|