carbon-js-sdk 0.2.14-dev.4 → 0.2.14-dev.6
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/codec/cdp/asset_params.d.ts +1 -1
- package/lib/codec/cdp/asset_params.js +11 -10
- package/lib/codec/cdp/genesis.d.ts +18 -1
- package/lib/codec/cdp/genesis.js +153 -37
- package/lib/codec/cdp/tx.d.ts +0 -1
- package/lib/codec/cdp/tx.js +6 -20
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.js +1 -1
- package/lib/codec/index.d.ts +1 -0
- package/lib/codec/index.js +3 -1
- package/lib/codec/oracle/genesis.d.ts +3 -0
- package/lib/codec/oracle/genesis.js +33 -2
- package/lib/codec/pricing/genesis.d.ts +1 -1
- package/lib/codec/pricing/genesis.js +8 -8
- package/lib/codec/pricing/legacy.d.ts +22 -0
- package/lib/codec/pricing/legacy.js +93 -0
- package/lib/modules/admin.d.ts +1 -3
- package/lib/modules/admin.js +2 -3
- package/lib/modules/cdp.d.ts +24 -14
- package/lib/modules/cdp.js +196 -161
- package/lib/util/address.d.ts +1 -0
- package/lib/util/address.js +8 -0
- package/lib/websocket/channel.js +29 -29
- package/lib/websocket/models.d.ts +1 -2
- package/lib/websocket/types.d.ts +0 -1
- package/package.json +1 -1
package/lib/codec/index.js
CHANGED
|
@@ -33,7 +33,7 @@ exports.MsgSetLeverageResponse = exports.MsgSetLeverage = exports.MarketLeverage
|
|
|
33
33
|
exports.MarketParams = exports.Market = exports.ControlledParams = exports.MarketDefaultsParams = exports.UpdatePerpetualsFundingIntervalProposal = exports.UpdateMarketProposal = exports.CreateMarketProposal = exports.MsgUpdatePerpetualsFundingIntervalResponse = exports.MsgUpdatePerpetualsFundingInterval = exports.MsgUpdateMarketResponse = exports.MsgUpdateMarket = exports.MsgCreateMarketResponse = exports.MsgCreateMarket = exports.OrderBookEvent = exports.QueryAllBookResponse = exports.QueryAllBookRequest = exports.QueryGetBookResponse = exports.QueryGetBookRequest = exports.StopBook = exports.OrderBook = exports.OrderBookLevel = exports.GenesisSubAccount = exports.SubAccount = exports.QuerySubAccountPowerResponse = exports.QuerySubAccountPowerRequest = exports.QuerySubAccountStatusResponse = exports.QuerySubAccountStatusRequest = exports.QueryAllSubAccountResponse = exports.QueryAllSubAccountRequest = exports.QueryGetSubAccountResponse = exports.QueryGetSubAccountRequest = exports.MsgRemoveSubAccountResponse = exports.MsgRemoveSubAccount = exports.MsgActivateSubAccountResponse = exports.MsgActivateSubAccount = exports.MsgCreateSubAccountResponse = exports.MsgCreateSubAccount = exports.UpdateProfileEvent = exports.QueryAllProfileResponse = exports.QueryAllProfileRequest = exports.QueryGetProfileResponse = exports.QueryGetProfileRequest = exports.Profile = exports.MsgUpdateProfileResponse = exports.MsgUpdateProfile = exports.LeverageEvent = exports.QueryAllLeverageResponse = exports.QueryAllLeverageRequest = exports.QueryGetLeverageResponse = exports.QueryGetLeverageRequest = void 0;
|
|
34
34
|
exports.RewardWeights = exports.RewardWeight = exports.CommitmentCurve = exports.RewardCurve = exports.MsgUpdatePoolResponse = exports.UpdatePoolParams = exports.MsgUpdatePool = exports.MsgSetCommitmentCurveResponse = exports.SetCommitmentCurveParams = exports.MsgSetCommitmentCurve = exports.MsgSetRewardCurveResponse = exports.SetRewardCurveParams = exports.MsgSetRewardCurve = exports.MsgClaimPoolRewardsResponse = exports.MsgClaimPoolRewards = exports.MsgUnstakePoolTokenResponse = exports.MsgUnstakePoolToken = exports.MsgStakePoolTokenResponse = exports.MsgStakePoolToken = exports.MsgSetRewardsWeightsResponse = exports.SetRewardsWeightsParams = exports.MsgSetRewardsWeights = exports.MsgUnlinkPoolResponse = exports.UnlinkPoolParams = exports.MsgUnlinkPool = exports.MsgLinkPoolResponse = exports.LinkPoolParams = exports.MsgLinkPool = exports.MsgRemoveLiquidityResponse = exports.MsgRemoveLiquidity = exports.MsgAddLiquidityResponse = exports.MsgAddLiquidity = exports.MsgCreatePoolWithLiquidityResponse = exports.MsgCreatePoolWithLiquidity = exports.MsgCreatePoolResponse = exports.MsgCreatePool = exports.PageResponse = exports.PageRequest = exports.QueryMintDataResponse = exports.QueryMintDataRequest = exports.MintData = exports.MarketEvent = exports.ParamsV280 = exports.ParamsV270 = exports.QueryMarketParamsResponse = exports.QueryMarketParamsRequest = exports.QueryAllMarketResponse = exports.QueryAllMarketRequest = exports.QueryGetMarketResponse = exports.QueryGetMarketRequest = void 0;
|
|
35
35
|
exports.QueryLiquiditypoolParamsResponse = exports.QueryLiquiditypoolParamsRequest = exports.QueryClaimableRewardsResponse = exports.QueryClaimableRewardsRequest = exports.QueryAllTotalCommitmentResponse = exports.QueryAllTotalCommitmentRequest = exports.QueryTotalCommitmentResponse = exports.QueryTotalCommitmentRequest = exports.QueryRewardCurveResponse = exports.QueryRewardCurveRequest = exports.QueryCommitmentCurveResponse = exports.QueryCommitmentCurveRequest = exports.QueryLastClaimResponse = exports.QueryLastClaimRequest = exports.QueryAllCommitmentResponse = exports.QueryAllCommitmentRequest = exports.QueryCommitmentResponse = exports.QueryCommitmentRequest = exports.QueryRewardHistoryResponse = exports.ExtendedPool = exports.QueryRewardHistoryRequest = exports.QueryAllPoolResponse = exports.QueryAllPoolRequest = exports.QueryGetPoolResponse = exports.QueryGetPoolRequest = exports.UpdatePoolProposal = exports.SetRewardsWeightsProposal = exports.SetCommitmentCurveProposal = exports.SetRewardCurveProposal = exports.UnlinkPoolProposal = exports.LinkPoolProposal = exports.RemoveLiquidities = exports.RemoveLiquidity = exports.AddLiquidities = exports.AddLiquidity = exports.Pools = exports.Pool = exports.LiquiditypoolParams = exports.AllocatedRewards = exports.LastClaimRecord = exports.CommitmentExpiriesRecord = exports.CommitmentExpiries = exports.CommitmentExpiry = exports.RewardHistoryRecord = exports.RewardHistory = exports.CommitmentResponse = exports.TotalCommitmentRecord = exports.TotalCommitment = exports.CommitmentRecord = exports.Commitment = void 0;
|
|
36
|
-
exports.SetBackfillTimeIntervalEvent = exports.SetStaleIndexAllowanceEvent = exports.SetSmoothenBandEvent = exports.SetImpactBandEvent = exports.TokenPriceUpdateEvent = exports.PriceUpdateEvent = exports.QueryTokenPriceAllResponse = exports.QueryTokenPriceAllRequest = exports.QueryTokenPriceResponse = exports.QueryTokenPriceRequest = exports.QueryPricingParamsResponse = exports.QueryPricingParamsRequest = exports.QueryRateResponse = exports.QueryRateRequest = exports.QueryAllPriceSetResponse = exports.QueryAllPriceSetRequest = exports.QueryPriceSetResponse = exports.QueryPriceSetRequest = exports.QueryPriceTokenResponse = exports.QueryPriceTokenRequest = exports.SettlementPriceParams = exports.SettlementPriceProposal = exports.TokenPrice = exports.PriceSet = exports.PricingParams = exports.MsgSetStaleIndexAllowanceResponse = exports.MsgSetStaleIndexAllowance = exports.MsgSetImpactBandResponse = exports.MsgSetImpactBand = exports.MsgSetSmoothenBandResponse = exports.MsgSetSmoothenBand = exports.MsgSetBackfillTimeIntervalResponse = exports.MsgSetBackfillTimeInterval = exports.Fund = exports.FundByMarket = exports.EventDataInsuranceFundTransfer = exports.QueryCoinBalancesResponse = exports.QueryCoinBalancesRequest = exports.CommitmentEvent = exports.CommitmentCurveEvent = exports.RewardsWeightChangeEvent = exports.TotalCommitmentChangeEvent = exports.PoolEvent = void 0;
|
|
36
|
+
exports.SetBackfillTimeIntervalEvent = exports.SetStaleIndexAllowanceEvent = exports.SetSmoothenBandEvent = exports.SetImpactBandEvent = exports.TokenPriceUpdateEvent = exports.PriceUpdateEvent = exports.ParamsV2130 = exports.QueryTokenPriceAllResponse = exports.QueryTokenPriceAllRequest = exports.QueryTokenPriceResponse = exports.QueryTokenPriceRequest = exports.QueryPricingParamsResponse = exports.QueryPricingParamsRequest = exports.QueryRateResponse = exports.QueryRateRequest = exports.QueryAllPriceSetResponse = exports.QueryAllPriceSetRequest = exports.QueryPriceSetResponse = exports.QueryPriceSetRequest = exports.QueryPriceTokenResponse = exports.QueryPriceTokenRequest = exports.SettlementPriceParams = exports.SettlementPriceProposal = exports.TokenPrice = exports.PriceSet = exports.PricingParams = exports.MsgSetStaleIndexAllowanceResponse = exports.MsgSetStaleIndexAllowance = exports.MsgSetImpactBandResponse = exports.MsgSetImpactBand = exports.MsgSetSmoothenBandResponse = exports.MsgSetSmoothenBand = exports.MsgSetBackfillTimeIntervalResponse = exports.MsgSetBackfillTimeInterval = exports.Fund = exports.FundByMarket = exports.EventDataInsuranceFundTransfer = exports.QueryCoinBalancesResponse = exports.QueryCoinBalancesRequest = exports.CommitmentEvent = exports.CommitmentCurveEvent = exports.RewardsWeightChangeEvent = exports.TotalCommitmentChangeEvent = exports.PoolEvent = void 0;
|
|
37
37
|
// GENERATED by scripts/generate-registry.sh
|
|
38
38
|
const proto_signing_1 = require("@cosmjs/proto-signing");
|
|
39
39
|
const tx_1 = require("./order/tx");
|
|
@@ -1376,6 +1376,8 @@ Object.defineProperty(exports, "QueryTokenPriceRequest", { enumerable: true, get
|
|
|
1376
1376
|
Object.defineProperty(exports, "QueryTokenPriceResponse", { enumerable: true, get: function () { return query_20.QueryTokenPriceResponse; } });
|
|
1377
1377
|
Object.defineProperty(exports, "QueryTokenPriceAllRequest", { enumerable: true, get: function () { return query_20.QueryTokenPriceAllRequest; } });
|
|
1378
1378
|
Object.defineProperty(exports, "QueryTokenPriceAllResponse", { enumerable: true, get: function () { return query_20.QueryTokenPriceAllResponse; } });
|
|
1379
|
+
var legacy_2 = require("./pricing/legacy");
|
|
1380
|
+
Object.defineProperty(exports, "ParamsV2130", { enumerable: true, get: function () { return legacy_2.ParamsV2130; } });
|
|
1379
1381
|
var event_15 = require("./pricing/event");
|
|
1380
1382
|
Object.defineProperty(exports, "PriceUpdateEvent", { enumerable: true, get: function () { return event_15.PriceUpdateEvent; } });
|
|
1381
1383
|
Object.defineProperty(exports, "TokenPriceUpdateEvent", { enumerable: true, get: function () { return event_15.TokenPriceUpdateEvent; } });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { Params, Oracle, Result, Vote } from "./oracle";
|
|
4
|
+
import { OracleVotesWindow, SlashCounter } from "./slashing";
|
|
4
5
|
export declare const protobufPackage = "Switcheo.carbon.oracle";
|
|
5
6
|
/** GenesisState defines the oracle module's genesis state. */
|
|
6
7
|
export interface GenesisState {
|
|
@@ -10,6 +11,8 @@ export interface GenesisState {
|
|
|
10
11
|
votes: Vote[];
|
|
11
12
|
/** this line is used by starport scaffolding # ibc/genesis/proto */
|
|
12
13
|
params?: Params;
|
|
14
|
+
allOracleVotesWindow: OracleVotesWindow[];
|
|
15
|
+
slashCounters: SlashCounter[];
|
|
13
16
|
}
|
|
14
17
|
export declare const GenesisState: {
|
|
15
18
|
encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -8,6 +8,7 @@ exports.GenesisState = exports.protobufPackage = void 0;
|
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
10
|
const oracle_1 = require("./oracle");
|
|
11
|
+
const slashing_1 = require("./slashing");
|
|
11
12
|
exports.protobufPackage = "Switcheo.carbon.oracle";
|
|
12
13
|
const baseGenesisState = {};
|
|
13
14
|
exports.GenesisState = {
|
|
@@ -24,6 +25,12 @@ exports.GenesisState = {
|
|
|
24
25
|
if (message.params !== undefined) {
|
|
25
26
|
oracle_1.Params.encode(message.params, writer.uint32(42).fork()).ldelim();
|
|
26
27
|
}
|
|
28
|
+
for (const v of message.allOracleVotesWindow) {
|
|
29
|
+
slashing_1.OracleVotesWindow.encode(v, writer.uint32(50).fork()).ldelim();
|
|
30
|
+
}
|
|
31
|
+
for (const v of message.slashCounters) {
|
|
32
|
+
slashing_1.SlashCounter.encode(v, writer.uint32(58).fork()).ldelim();
|
|
33
|
+
}
|
|
27
34
|
return writer;
|
|
28
35
|
},
|
|
29
36
|
decode(input, length) {
|
|
@@ -33,6 +40,8 @@ exports.GenesisState = {
|
|
|
33
40
|
message.oracles = [];
|
|
34
41
|
message.results = [];
|
|
35
42
|
message.votes = [];
|
|
43
|
+
message.allOracleVotesWindow = [];
|
|
44
|
+
message.slashCounters = [];
|
|
36
45
|
while (reader.pos < end) {
|
|
37
46
|
const tag = reader.uint32();
|
|
38
47
|
switch (tag >>> 3) {
|
|
@@ -48,6 +57,12 @@ exports.GenesisState = {
|
|
|
48
57
|
case 5:
|
|
49
58
|
message.params = oracle_1.Params.decode(reader, reader.uint32());
|
|
50
59
|
break;
|
|
60
|
+
case 6:
|
|
61
|
+
message.allOracleVotesWindow.push(slashing_1.OracleVotesWindow.decode(reader, reader.uint32()));
|
|
62
|
+
break;
|
|
63
|
+
case 7:
|
|
64
|
+
message.slashCounters.push(slashing_1.SlashCounter.decode(reader, reader.uint32()));
|
|
65
|
+
break;
|
|
51
66
|
default:
|
|
52
67
|
reader.skipType(tag & 7);
|
|
53
68
|
break;
|
|
@@ -56,7 +71,7 @@ exports.GenesisState = {
|
|
|
56
71
|
return message;
|
|
57
72
|
},
|
|
58
73
|
fromJSON(object) {
|
|
59
|
-
var _a, _b, _c;
|
|
74
|
+
var _a, _b, _c, _d, _e;
|
|
60
75
|
const message = Object.assign({}, baseGenesisState);
|
|
61
76
|
message.oracles = ((_a = object.oracles) !== null && _a !== void 0 ? _a : []).map((e) => oracle_1.Oracle.fromJSON(e));
|
|
62
77
|
message.results = ((_b = object.results) !== null && _b !== void 0 ? _b : []).map((e) => oracle_1.Result.fromJSON(e));
|
|
@@ -65,6 +80,8 @@ exports.GenesisState = {
|
|
|
65
80
|
object.params !== undefined && object.params !== null
|
|
66
81
|
? oracle_1.Params.fromJSON(object.params)
|
|
67
82
|
: undefined;
|
|
83
|
+
message.allOracleVotesWindow = ((_d = object.allOracleVotesWindow) !== null && _d !== void 0 ? _d : []).map((e) => slashing_1.OracleVotesWindow.fromJSON(e));
|
|
84
|
+
message.slashCounters = ((_e = object.slashCounters) !== null && _e !== void 0 ? _e : []).map((e) => slashing_1.SlashCounter.fromJSON(e));
|
|
68
85
|
return message;
|
|
69
86
|
},
|
|
70
87
|
toJSON(message) {
|
|
@@ -89,10 +106,22 @@ exports.GenesisState = {
|
|
|
89
106
|
}
|
|
90
107
|
message.params !== undefined &&
|
|
91
108
|
(obj.params = message.params ? oracle_1.Params.toJSON(message.params) : undefined);
|
|
109
|
+
if (message.allOracleVotesWindow) {
|
|
110
|
+
obj.allOracleVotesWindow = message.allOracleVotesWindow.map((e) => e ? slashing_1.OracleVotesWindow.toJSON(e) : undefined);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
obj.allOracleVotesWindow = [];
|
|
114
|
+
}
|
|
115
|
+
if (message.slashCounters) {
|
|
116
|
+
obj.slashCounters = message.slashCounters.map((e) => e ? slashing_1.SlashCounter.toJSON(e) : undefined);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
obj.slashCounters = [];
|
|
120
|
+
}
|
|
92
121
|
return obj;
|
|
93
122
|
},
|
|
94
123
|
fromPartial(object) {
|
|
95
|
-
var _a, _b, _c;
|
|
124
|
+
var _a, _b, _c, _d, _e;
|
|
96
125
|
const message = Object.assign({}, baseGenesisState);
|
|
97
126
|
message.oracles = ((_a = object.oracles) !== null && _a !== void 0 ? _a : []).map((e) => oracle_1.Oracle.fromPartial(e));
|
|
98
127
|
message.results = ((_b = object.results) !== null && _b !== void 0 ? _b : []).map((e) => oracle_1.Result.fromPartial(e));
|
|
@@ -101,6 +130,8 @@ exports.GenesisState = {
|
|
|
101
130
|
object.params !== undefined && object.params !== null
|
|
102
131
|
? oracle_1.Params.fromPartial(object.params)
|
|
103
132
|
: undefined;
|
|
133
|
+
message.allOracleVotesWindow = ((_d = object.allOracleVotesWindow) !== null && _d !== void 0 ? _d : []).map((e) => slashing_1.OracleVotesWindow.fromPartial(e));
|
|
134
|
+
message.slashCounters = ((_e = object.slashCounters) !== null && _e !== void 0 ? _e : []).map((e) => slashing_1.SlashCounter.fromPartial(e));
|
|
104
135
|
return message;
|
|
105
136
|
},
|
|
106
137
|
};
|
|
@@ -15,7 +15,7 @@ exports.GenesisState = {
|
|
|
15
15
|
for (const v of message.prices) {
|
|
16
16
|
pricing_1.PriceSet.encode(v, writer.uint32(10).fork()).ldelim();
|
|
17
17
|
}
|
|
18
|
-
for (const v of message.
|
|
18
|
+
for (const v of message.tokenPrices) {
|
|
19
19
|
pricing_1.TokenPrice.encode(v, writer.uint32(18).fork()).ldelim();
|
|
20
20
|
}
|
|
21
21
|
if (message.params !== undefined) {
|
|
@@ -28,7 +28,7 @@ exports.GenesisState = {
|
|
|
28
28
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
29
|
const message = Object.assign({}, baseGenesisState);
|
|
30
30
|
message.prices = [];
|
|
31
|
-
message.
|
|
31
|
+
message.tokenPrices = [];
|
|
32
32
|
while (reader.pos < end) {
|
|
33
33
|
const tag = reader.uint32();
|
|
34
34
|
switch (tag >>> 3) {
|
|
@@ -36,7 +36,7 @@ exports.GenesisState = {
|
|
|
36
36
|
message.prices.push(pricing_1.PriceSet.decode(reader, reader.uint32()));
|
|
37
37
|
break;
|
|
38
38
|
case 2:
|
|
39
|
-
message.
|
|
39
|
+
message.tokenPrices.push(pricing_1.TokenPrice.decode(reader, reader.uint32()));
|
|
40
40
|
break;
|
|
41
41
|
case 3:
|
|
42
42
|
message.params = pricing_1.Params.decode(reader, reader.uint32());
|
|
@@ -52,7 +52,7 @@ exports.GenesisState = {
|
|
|
52
52
|
var _a, _b;
|
|
53
53
|
const message = Object.assign({}, baseGenesisState);
|
|
54
54
|
message.prices = ((_a = object.prices) !== null && _a !== void 0 ? _a : []).map((e) => pricing_1.PriceSet.fromJSON(e));
|
|
55
|
-
message.
|
|
55
|
+
message.tokenPrices = ((_b = object.tokenPrices) !== null && _b !== void 0 ? _b : []).map((e) => pricing_1.TokenPrice.fromJSON(e));
|
|
56
56
|
message.params =
|
|
57
57
|
object.params !== undefined && object.params !== null
|
|
58
58
|
? pricing_1.Params.fromJSON(object.params)
|
|
@@ -67,11 +67,11 @@ exports.GenesisState = {
|
|
|
67
67
|
else {
|
|
68
68
|
obj.prices = [];
|
|
69
69
|
}
|
|
70
|
-
if (message.
|
|
71
|
-
obj.
|
|
70
|
+
if (message.tokenPrices) {
|
|
71
|
+
obj.tokenPrices = message.tokenPrices.map((e) => e ? pricing_1.TokenPrice.toJSON(e) : undefined);
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
|
-
obj.
|
|
74
|
+
obj.tokenPrices = [];
|
|
75
75
|
}
|
|
76
76
|
message.params !== undefined &&
|
|
77
77
|
(obj.params = message.params ? pricing_1.Params.toJSON(message.params) : undefined);
|
|
@@ -81,7 +81,7 @@ exports.GenesisState = {
|
|
|
81
81
|
var _a, _b;
|
|
82
82
|
const message = Object.assign({}, baseGenesisState);
|
|
83
83
|
message.prices = ((_a = object.prices) !== null && _a !== void 0 ? _a : []).map((e) => pricing_1.PriceSet.fromPartial(e));
|
|
84
|
-
message.
|
|
84
|
+
message.tokenPrices = ((_b = object.tokenPrices) !== null && _b !== void 0 ? _b : []).map((e) => pricing_1.TokenPrice.fromPartial(e));
|
|
85
85
|
message.params =
|
|
86
86
|
object.params !== undefined && object.params !== null
|
|
87
87
|
? pricing_1.Params.fromPartial(object.params)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Duration } from "../google/protobuf/duration";
|
|
4
|
+
export declare const protobufPackage = "Switcheo.carbon.pricing";
|
|
5
|
+
/** Legacy Params from v.2.13.0. */
|
|
6
|
+
export interface ParamsV2130 {
|
|
7
|
+
smoothenBand: number;
|
|
8
|
+
impactBand: number;
|
|
9
|
+
staleIndexAllowance?: Duration;
|
|
10
|
+
}
|
|
11
|
+
export declare const ParamsV2130: {
|
|
12
|
+
encode(message: ParamsV2130, writer?: _m0.Writer): _m0.Writer;
|
|
13
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ParamsV2130;
|
|
14
|
+
fromJSON(object: any): ParamsV2130;
|
|
15
|
+
toJSON(message: ParamsV2130): unknown;
|
|
16
|
+
fromPartial(object: DeepPartial<ParamsV2130>): ParamsV2130;
|
|
17
|
+
};
|
|
18
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
19
|
+
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 {} ? {
|
|
20
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
21
|
+
} : Partial<T>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ParamsV2130 = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
9
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
const duration_1 = require("../google/protobuf/duration");
|
|
11
|
+
exports.protobufPackage = "Switcheo.carbon.pricing";
|
|
12
|
+
const baseParamsV2130 = { smoothenBand: 0, impactBand: 0 };
|
|
13
|
+
exports.ParamsV2130 = {
|
|
14
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
15
|
+
if (message.smoothenBand !== 0) {
|
|
16
|
+
writer.uint32(8).uint32(message.smoothenBand);
|
|
17
|
+
}
|
|
18
|
+
if (message.impactBand !== 0) {
|
|
19
|
+
writer.uint32(16).uint32(message.impactBand);
|
|
20
|
+
}
|
|
21
|
+
if (message.staleIndexAllowance !== undefined) {
|
|
22
|
+
duration_1.Duration.encode(message.staleIndexAllowance, writer.uint32(26).fork()).ldelim();
|
|
23
|
+
}
|
|
24
|
+
return writer;
|
|
25
|
+
},
|
|
26
|
+
decode(input, length) {
|
|
27
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
28
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
|
+
const message = Object.assign({}, baseParamsV2130);
|
|
30
|
+
while (reader.pos < end) {
|
|
31
|
+
const tag = reader.uint32();
|
|
32
|
+
switch (tag >>> 3) {
|
|
33
|
+
case 1:
|
|
34
|
+
message.smoothenBand = reader.uint32();
|
|
35
|
+
break;
|
|
36
|
+
case 2:
|
|
37
|
+
message.impactBand = reader.uint32();
|
|
38
|
+
break;
|
|
39
|
+
case 3:
|
|
40
|
+
message.staleIndexAllowance = duration_1.Duration.decode(reader, reader.uint32());
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
reader.skipType(tag & 7);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return message;
|
|
48
|
+
},
|
|
49
|
+
fromJSON(object) {
|
|
50
|
+
const message = Object.assign({}, baseParamsV2130);
|
|
51
|
+
message.smoothenBand =
|
|
52
|
+
object.smoothenBand !== undefined && object.smoothenBand !== null
|
|
53
|
+
? Number(object.smoothenBand)
|
|
54
|
+
: 0;
|
|
55
|
+
message.impactBand =
|
|
56
|
+
object.impactBand !== undefined && object.impactBand !== null
|
|
57
|
+
? Number(object.impactBand)
|
|
58
|
+
: 0;
|
|
59
|
+
message.staleIndexAllowance =
|
|
60
|
+
object.staleIndexAllowance !== undefined &&
|
|
61
|
+
object.staleIndexAllowance !== null
|
|
62
|
+
? duration_1.Duration.fromJSON(object.staleIndexAllowance)
|
|
63
|
+
: undefined;
|
|
64
|
+
return message;
|
|
65
|
+
},
|
|
66
|
+
toJSON(message) {
|
|
67
|
+
const obj = {};
|
|
68
|
+
message.smoothenBand !== undefined &&
|
|
69
|
+
(obj.smoothenBand = message.smoothenBand);
|
|
70
|
+
message.impactBand !== undefined && (obj.impactBand = message.impactBand);
|
|
71
|
+
message.staleIndexAllowance !== undefined &&
|
|
72
|
+
(obj.staleIndexAllowance = message.staleIndexAllowance
|
|
73
|
+
? duration_1.Duration.toJSON(message.staleIndexAllowance)
|
|
74
|
+
: undefined);
|
|
75
|
+
return obj;
|
|
76
|
+
},
|
|
77
|
+
fromPartial(object) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
const message = Object.assign({}, baseParamsV2130);
|
|
80
|
+
message.smoothenBand = (_a = object.smoothenBand) !== null && _a !== void 0 ? _a : 0;
|
|
81
|
+
message.impactBand = (_b = object.impactBand) !== null && _b !== void 0 ? _b : 0;
|
|
82
|
+
message.staleIndexAllowance =
|
|
83
|
+
object.staleIndexAllowance !== undefined &&
|
|
84
|
+
object.staleIndexAllowance !== null
|
|
85
|
+
? duration_1.Duration.fromPartial(object.staleIndexAllowance)
|
|
86
|
+
: undefined;
|
|
87
|
+
return message;
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
91
|
+
minimal_1.default.util.Long = long_1.default;
|
|
92
|
+
minimal_1.default.configure();
|
|
93
|
+
}
|
package/lib/modules/admin.d.ts
CHANGED
|
@@ -212,7 +212,7 @@ export declare namespace AdminModule {
|
|
|
212
212
|
rateStrategyName: string;
|
|
213
213
|
loanToValue: BigNumber;
|
|
214
214
|
liquidationThreshold: BigNumber;
|
|
215
|
-
|
|
215
|
+
liquidationDiscount: BigNumber;
|
|
216
216
|
supplyCap: BigNumber;
|
|
217
217
|
borrowCap: BigNumber;
|
|
218
218
|
}
|
|
@@ -256,7 +256,6 @@ export declare namespace AdminModule {
|
|
|
256
256
|
rewardAmountPerSecond: BigNumber;
|
|
257
257
|
startTime?: Date;
|
|
258
258
|
endTime?: Date;
|
|
259
|
-
reservesAmount: BigNumber;
|
|
260
259
|
}
|
|
261
260
|
interface UpdateRewardSchemeParams {
|
|
262
261
|
rewardSchemeId: number;
|
|
@@ -354,7 +353,6 @@ export declare function transformCreateRewardScheme(msg: AdminModule.CreateRewar
|
|
|
354
353
|
rewardAmountPerSecond: string;
|
|
355
354
|
startTime: Date | undefined;
|
|
356
355
|
endTime: Date | undefined;
|
|
357
|
-
reservesAmount: string;
|
|
358
356
|
};
|
|
359
357
|
export declare function transformUpdateRewardScheme(msg: AdminModule.UpdateRewardSchemeParams): {
|
|
360
358
|
rewardSchemeId: Long.Long;
|
package/lib/modules/admin.js
CHANGED
|
@@ -452,7 +452,7 @@ class AdminModule extends base_1.default {
|
|
|
452
452
|
rateStrategyName: params.asset.rateStrategyName,
|
|
453
453
|
loanToValue: params.asset.loanToValue.toString(10),
|
|
454
454
|
liquidationThreshold: params.asset.liquidationThreshold.toString(10),
|
|
455
|
-
|
|
455
|
+
liquidationDiscount: params.asset.liquidationDiscount.toString(10),
|
|
456
456
|
supplyCap: params.asset.supplyCap.toString(10),
|
|
457
457
|
borrowCap: params.asset.borrowCap.toString(10),
|
|
458
458
|
}
|
|
@@ -474,7 +474,7 @@ class AdminModule extends base_1.default {
|
|
|
474
474
|
rateStrategyName: params.asset.rateStrategyName,
|
|
475
475
|
loanToValue: params.asset.loanToValue.toString(10),
|
|
476
476
|
liquidationThreshold: params.asset.liquidationThreshold.toString(10),
|
|
477
|
-
|
|
477
|
+
liquidationDiscount: params.asset.liquidationDiscount.toString(10),
|
|
478
478
|
supplyCap: params.asset.supplyCap.toString(10),
|
|
479
479
|
borrowCap: params.asset.borrowCap.toString(10),
|
|
480
480
|
}
|
|
@@ -737,7 +737,6 @@ function transformCreateRewardScheme(msg) {
|
|
|
737
737
|
rewardAmountPerSecond: msg.rewardAmountPerSecond.toString(10),
|
|
738
738
|
startTime: msg.startTime,
|
|
739
739
|
endTime: msg.endTime,
|
|
740
|
-
reservesAmount: msg.reservesAmount.toString(10),
|
|
741
740
|
};
|
|
742
741
|
}
|
|
743
742
|
exports.transformCreateRewardScheme = transformCreateRewardScheme;
|
package/lib/modules/cdp.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { Debt } from './../codec/cdp/query';
|
|
|
5
5
|
import BaseModule from "./base";
|
|
6
6
|
export declare class CDPModule extends BaseModule {
|
|
7
7
|
private cdpModuleAddress;
|
|
8
|
-
private collateralPoolAddress;
|
|
9
8
|
supplyAsset(params: CDPModule.SupplyAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
10
9
|
withdrawAsset(params: CDPModule.WithdrawAssetParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
11
10
|
lockCollateral(params: CDPModule.LockCollateralParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
@@ -24,6 +23,7 @@ export declare class CDPModule extends BaseModule {
|
|
|
24
23
|
returnStablecoin(params: CDPModule.ReturnStablecoinParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
25
24
|
updateRateStrategy(params: CDPModule.UpdateRateStrategyParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
26
25
|
claimRewards(opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
26
|
+
createRewardScheme(params: CDPModule.CreateRewardSchemeParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
27
27
|
getAccountData(account: string): Promise<{
|
|
28
28
|
TotalCollateralsUsd: BigNumber;
|
|
29
29
|
AvailableBorrowsUsd: BigNumber;
|
|
@@ -31,24 +31,27 @@ export declare class CDPModule extends BaseModule {
|
|
|
31
31
|
TotalDebtsUsd: BigNumber;
|
|
32
32
|
TotalStablecoinDebtsUsd: BigNumber;
|
|
33
33
|
HealthFactor: BigNumber;
|
|
34
|
-
}
|
|
35
|
-
getAssetBorrowableSupply(denom: string): Promise<BigNumber
|
|
36
|
-
getCdpToActualRatio(cdpDenom: string): Promise<BigNumber
|
|
37
|
-
getTotalAccountTokenDebtUsdVal(account: string, denom: string, debt?: Debt, debtInfo?: DebtInfo): Promise<
|
|
34
|
+
}>;
|
|
35
|
+
getAssetBorrowableSupply(denom: string): Promise<BigNumber>;
|
|
36
|
+
getCdpToActualRatio(cdpDenom: string): Promise<BigNumber>;
|
|
37
|
+
getTotalAccountTokenDebtUsdVal(account: string, denom: string, debt?: Debt, debtInfo?: DebtInfo): Promise<BigNumber>;
|
|
38
38
|
getModuleTotalDebtUsdVal(): Promise<BigNumber | undefined>;
|
|
39
|
-
getModuleTotalCollateralUsdVal(): Promise<BigNumber
|
|
40
|
-
getCdpTokenUsdVal(cdpDenom: string, amount: BigNumber): Promise<BigNumber
|
|
41
|
-
getTokenUsdVal(denom: string, amount: BigNumber): Promise<BigNumber
|
|
42
|
-
getTotalTokenDebt(denom: string, debtInfo?: DebtInfo): Promise<BigNumber
|
|
43
|
-
getTotalAccountTokenDebt(account: string, denom: string, debt?: Debt, debtInfo?: DebtInfo): Promise<BigNumber
|
|
39
|
+
getModuleTotalCollateralUsdVal(): Promise<BigNumber>;
|
|
40
|
+
getCdpTokenUsdVal(cdpDenom: string, amount: BigNumber): Promise<BigNumber>;
|
|
41
|
+
getTokenUsdVal(denom: string, amount: BigNumber): Promise<BigNumber>;
|
|
42
|
+
getTotalTokenDebt(denom: string, debtInfo?: DebtInfo): Promise<BigNumber>;
|
|
43
|
+
getTotalAccountTokenDebt(account: string, denom: string, debt?: Debt, debtInfo?: DebtInfo): Promise<BigNumber>;
|
|
44
44
|
getTotalAccountStablecoinDebt(account: string, debt?: CDPModule.StablecoinDebt, debtInfo?: StablecoinDebtInfo): Promise<BigNumber>;
|
|
45
|
-
calculateAPY(denom: string, debtInfo?: DebtInfo, assetParams?: AssetParams, rateStrategyParams?: RateStrategyParams): Promise<BigNumber
|
|
45
|
+
calculateAPY(denom: string, debtInfo?: DebtInfo, assetParams?: AssetParams, rateStrategyParams?: RateStrategyParams): Promise<BigNumber>;
|
|
46
46
|
calculateInterestForTimePeriod(apy: BigNumber, start: Date, end: Date): BigNumber;
|
|
47
47
|
recalculateCIM(denom: string, debtInfo?: DebtInfo): Promise<BigNumber>;
|
|
48
48
|
recalculateStablecoinCIM(debtInfo?: StablecoinDebtInfo): Promise<BigNumber>;
|
|
49
49
|
getMaxCollateralForUnlock(account: string, cdpDenom: string): Promise<BigNumber | undefined>;
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
getCdpModuleAddress(): string;
|
|
51
|
+
getCdpTokenPrice(cdpDenom: string): Promise<BigNumber>;
|
|
52
|
+
getUnderlyingDenom(cdpDenom: string): string;
|
|
53
|
+
getCollateralReceivableForLiquidation(debtDenom: string, debtAmount: BigNumber, cdpDenom: string): Promise<BigNumber>;
|
|
54
|
+
getCollateralReceivableForStablecoinLiq(cdpDenom: string, stablecoinRepayAmt: BigNumber, interestDenom: string, interestRepayAmt: BigNumber): Promise<BigNumber>;
|
|
52
55
|
}
|
|
53
56
|
export declare namespace CDPModule {
|
|
54
57
|
interface SupplyAssetParams {
|
|
@@ -116,7 +119,6 @@ export declare namespace CDPModule {
|
|
|
116
119
|
minCollateralAmount: BigNumber;
|
|
117
120
|
debtDenom: string;
|
|
118
121
|
debtAmount: BigNumber;
|
|
119
|
-
principalAmount: BigNumber;
|
|
120
122
|
interestDenom: string;
|
|
121
123
|
interestAmount: BigNumber;
|
|
122
124
|
}
|
|
@@ -147,4 +149,12 @@ export declare namespace CDPModule {
|
|
|
147
149
|
principalDebt: string;
|
|
148
150
|
initialCumulativeInterestMultiplier: string;
|
|
149
151
|
}
|
|
152
|
+
interface CreateRewardSchemeParams {
|
|
153
|
+
rewardDenom: string;
|
|
154
|
+
assetDenom: string;
|
|
155
|
+
rewardType: string;
|
|
156
|
+
rewardAmountPerSecond: BigNumber;
|
|
157
|
+
startTime: Date;
|
|
158
|
+
endTime: Date;
|
|
159
|
+
}
|
|
150
160
|
}
|