carbon-js-sdk 0.2.14-dev.1 → 0.2.14-dev.3
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/event.d.ts +24 -0
- package/lib/codec/cdp/event.js +244 -1
- package/lib/codec/cdp/query.d.ts +4 -3
- package/lib/codec/cdp/query.js +41 -12
- package/lib/codec/cdp/tx.d.ts +51 -1
- package/lib/codec/cdp/tx.js +280 -1
- package/lib/codec/index.d.ts +16 -3
- package/lib/codec/index.js +236 -193
- package/lib/codec/pricing/event.d.ts +45 -0
- package/lib/codec/pricing/event.js +247 -1
- package/lib/codec/pricing/pricing.d.ts +1 -0
- package/lib/codec/pricing/pricing.js +20 -0
- package/lib/codec/pricing/tx.d.ts +96 -0
- package/lib/codec/pricing/tx.js +399 -1
- package/lib/modules/admin.d.ts +64 -6
- package/lib/modules/admin.js +114 -10
- package/lib/modules/cdp.d.ts +33 -1
- package/lib/modules/cdp.js +99 -15
- package/lib/modules/fee.d.ts +2 -0
- package/lib/modules/liquiditypool.d.ts +3 -0
- package/lib/modules/oracle.d.ts +3 -0
- package/lib/modules/oracle.js +2 -0
- package/lib/modules/order.d.ts +3 -0
- package/lib/modules/order.js +2 -0
- package/lib/modules/position.d.ts +3 -0
- package/lib/modules/position.js +2 -0
- package/lib/modules/profile.d.ts +3 -0
- package/lib/modules/profile.js +2 -0
- package/lib/modules/subaccount.d.ts +3 -0
- package/lib/modules/subaccount.js +2 -0
- package/lib/provider/amino/types/admin.js +36 -12
- package/lib/provider/amino/types/cdp.js +30 -0
- package/lib/util/tx.d.ts +12 -0
- package/lib/websocket/models.d.ts +1 -0
- package/lib/websocket/types.d.ts +5 -0
- package/package.json +1 -1
package/lib/codec/cdp/event.d.ts
CHANGED
|
@@ -127,6 +127,23 @@ export interface LiquidateCollateralEvent {
|
|
|
127
127
|
debtDenom: string;
|
|
128
128
|
debtAmount: string;
|
|
129
129
|
}
|
|
130
|
+
export interface LiquidateCollateralWithStablecoinEvent {
|
|
131
|
+
creator: string;
|
|
132
|
+
liquidator: string;
|
|
133
|
+
debtor: string;
|
|
134
|
+
collateralDenom: string;
|
|
135
|
+
collateralAmountLiquidated: string;
|
|
136
|
+
collateralAmountLiquidator: string;
|
|
137
|
+
collateralAmountFee: string;
|
|
138
|
+
liquidationPrice: string;
|
|
139
|
+
marketPrice: string;
|
|
140
|
+
discount: string;
|
|
141
|
+
debtDenom: string;
|
|
142
|
+
debtAmount: string;
|
|
143
|
+
principalAmount: string;
|
|
144
|
+
interestDenom: string;
|
|
145
|
+
interestAmount: string;
|
|
146
|
+
}
|
|
130
147
|
export interface ClaimRewardEvent {
|
|
131
148
|
receiver: string;
|
|
132
149
|
rewardSchemeId: string;
|
|
@@ -298,6 +315,13 @@ export declare const LiquidateCollateralEvent: {
|
|
|
298
315
|
toJSON(message: LiquidateCollateralEvent): unknown;
|
|
299
316
|
fromPartial(object: DeepPartial<LiquidateCollateralEvent>): LiquidateCollateralEvent;
|
|
300
317
|
};
|
|
318
|
+
export declare const LiquidateCollateralWithStablecoinEvent: {
|
|
319
|
+
encode(message: LiquidateCollateralWithStablecoinEvent, writer?: _m0.Writer): _m0.Writer;
|
|
320
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): LiquidateCollateralWithStablecoinEvent;
|
|
321
|
+
fromJSON(object: any): LiquidateCollateralWithStablecoinEvent;
|
|
322
|
+
toJSON(message: LiquidateCollateralWithStablecoinEvent): unknown;
|
|
323
|
+
fromPartial(object: DeepPartial<LiquidateCollateralWithStablecoinEvent>): LiquidateCollateralWithStablecoinEvent;
|
|
324
|
+
};
|
|
301
325
|
export declare const ClaimRewardEvent: {
|
|
302
326
|
encode(message: ClaimRewardEvent, writer?: _m0.Writer): _m0.Writer;
|
|
303
327
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ClaimRewardEvent;
|
package/lib/codec/cdp/event.js
CHANGED
|
@@ -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.AddReserveEvent = exports.RewardSchemeEvent = exports.RewardDebtEvent = exports.ClaimRewardEvent = exports.LiquidateCollateralEvent = exports.ReturnStablecoinEvent = exports.MintStablecoinEvent = exports.UpdateStablecoinDebtInfoEvent = exports.UpdateDebtInfoEvent = exports.UnlockCollateralEvent = exports.LockCollateralEvent = exports.RepayAssetEvent = exports.BorrowAssetEvent = exports.WithdrawAssetEvent = exports.SupplyAssetEvent = exports.SetSmallLiquidationSizeEvent = exports.SetMinimumCloseFactorEvent = exports.SetCompleteLiquidationThresholdEvent = exports.SetStablecoinInterestRateEvent = exports.SetLiquidationFeeEvent = exports.SetInterestFeeEvent = exports.UpdateAssetParamsEvent = exports.NewAssetParamsEvent = exports.RemoveRateStrategyParamsEvent = exports.UpdateRateStrategyParamsEvent = exports.NewRateStrategyParamsEvent = exports.protobufPackage = void 0;
|
|
6
|
+
exports.AddReserveEvent = exports.RewardSchemeEvent = exports.RewardDebtEvent = exports.ClaimRewardEvent = exports.LiquidateCollateralWithStablecoinEvent = exports.LiquidateCollateralEvent = exports.ReturnStablecoinEvent = exports.MintStablecoinEvent = exports.UpdateStablecoinDebtInfoEvent = exports.UpdateDebtInfoEvent = exports.UnlockCollateralEvent = exports.LockCollateralEvent = exports.RepayAssetEvent = exports.BorrowAssetEvent = exports.WithdrawAssetEvent = exports.SupplyAssetEvent = exports.SetSmallLiquidationSizeEvent = exports.SetMinimumCloseFactorEvent = exports.SetCompleteLiquidationThresholdEvent = exports.SetStablecoinInterestRateEvent = exports.SetLiquidationFeeEvent = exports.SetInterestFeeEvent = exports.UpdateAssetParamsEvent = exports.NewAssetParamsEvent = exports.RemoveRateStrategyParamsEvent = exports.UpdateRateStrategyParamsEvent = exports.NewRateStrategyParamsEvent = 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"));
|
|
@@ -1834,6 +1834,249 @@ exports.LiquidateCollateralEvent = {
|
|
|
1834
1834
|
return message;
|
|
1835
1835
|
},
|
|
1836
1836
|
};
|
|
1837
|
+
const baseLiquidateCollateralWithStablecoinEvent = {
|
|
1838
|
+
creator: "",
|
|
1839
|
+
liquidator: "",
|
|
1840
|
+
debtor: "",
|
|
1841
|
+
collateralDenom: "",
|
|
1842
|
+
collateralAmountLiquidated: "",
|
|
1843
|
+
collateralAmountLiquidator: "",
|
|
1844
|
+
collateralAmountFee: "",
|
|
1845
|
+
liquidationPrice: "",
|
|
1846
|
+
marketPrice: "",
|
|
1847
|
+
discount: "",
|
|
1848
|
+
debtDenom: "",
|
|
1849
|
+
debtAmount: "",
|
|
1850
|
+
principalAmount: "",
|
|
1851
|
+
interestDenom: "",
|
|
1852
|
+
interestAmount: "",
|
|
1853
|
+
};
|
|
1854
|
+
exports.LiquidateCollateralWithStablecoinEvent = {
|
|
1855
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1856
|
+
if (message.creator !== "") {
|
|
1857
|
+
writer.uint32(10).string(message.creator);
|
|
1858
|
+
}
|
|
1859
|
+
if (message.liquidator !== "") {
|
|
1860
|
+
writer.uint32(18).string(message.liquidator);
|
|
1861
|
+
}
|
|
1862
|
+
if (message.debtor !== "") {
|
|
1863
|
+
writer.uint32(26).string(message.debtor);
|
|
1864
|
+
}
|
|
1865
|
+
if (message.collateralDenom !== "") {
|
|
1866
|
+
writer.uint32(34).string(message.collateralDenom);
|
|
1867
|
+
}
|
|
1868
|
+
if (message.collateralAmountLiquidated !== "") {
|
|
1869
|
+
writer.uint32(42).string(message.collateralAmountLiquidated);
|
|
1870
|
+
}
|
|
1871
|
+
if (message.collateralAmountLiquidator !== "") {
|
|
1872
|
+
writer.uint32(50).string(message.collateralAmountLiquidator);
|
|
1873
|
+
}
|
|
1874
|
+
if (message.collateralAmountFee !== "") {
|
|
1875
|
+
writer.uint32(58).string(message.collateralAmountFee);
|
|
1876
|
+
}
|
|
1877
|
+
if (message.liquidationPrice !== "") {
|
|
1878
|
+
writer.uint32(66).string(message.liquidationPrice);
|
|
1879
|
+
}
|
|
1880
|
+
if (message.marketPrice !== "") {
|
|
1881
|
+
writer.uint32(74).string(message.marketPrice);
|
|
1882
|
+
}
|
|
1883
|
+
if (message.discount !== "") {
|
|
1884
|
+
writer.uint32(82).string(message.discount);
|
|
1885
|
+
}
|
|
1886
|
+
if (message.debtDenom !== "") {
|
|
1887
|
+
writer.uint32(90).string(message.debtDenom);
|
|
1888
|
+
}
|
|
1889
|
+
if (message.debtAmount !== "") {
|
|
1890
|
+
writer.uint32(98).string(message.debtAmount);
|
|
1891
|
+
}
|
|
1892
|
+
if (message.principalAmount !== "") {
|
|
1893
|
+
writer.uint32(106).string(message.principalAmount);
|
|
1894
|
+
}
|
|
1895
|
+
if (message.interestDenom !== "") {
|
|
1896
|
+
writer.uint32(114).string(message.interestDenom);
|
|
1897
|
+
}
|
|
1898
|
+
if (message.interestAmount !== "") {
|
|
1899
|
+
writer.uint32(122).string(message.interestAmount);
|
|
1900
|
+
}
|
|
1901
|
+
return writer;
|
|
1902
|
+
},
|
|
1903
|
+
decode(input, length) {
|
|
1904
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1905
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1906
|
+
const message = Object.assign({}, baseLiquidateCollateralWithStablecoinEvent);
|
|
1907
|
+
while (reader.pos < end) {
|
|
1908
|
+
const tag = reader.uint32();
|
|
1909
|
+
switch (tag >>> 3) {
|
|
1910
|
+
case 1:
|
|
1911
|
+
message.creator = reader.string();
|
|
1912
|
+
break;
|
|
1913
|
+
case 2:
|
|
1914
|
+
message.liquidator = reader.string();
|
|
1915
|
+
break;
|
|
1916
|
+
case 3:
|
|
1917
|
+
message.debtor = reader.string();
|
|
1918
|
+
break;
|
|
1919
|
+
case 4:
|
|
1920
|
+
message.collateralDenom = reader.string();
|
|
1921
|
+
break;
|
|
1922
|
+
case 5:
|
|
1923
|
+
message.collateralAmountLiquidated = reader.string();
|
|
1924
|
+
break;
|
|
1925
|
+
case 6:
|
|
1926
|
+
message.collateralAmountLiquidator = reader.string();
|
|
1927
|
+
break;
|
|
1928
|
+
case 7:
|
|
1929
|
+
message.collateralAmountFee = reader.string();
|
|
1930
|
+
break;
|
|
1931
|
+
case 8:
|
|
1932
|
+
message.liquidationPrice = reader.string();
|
|
1933
|
+
break;
|
|
1934
|
+
case 9:
|
|
1935
|
+
message.marketPrice = reader.string();
|
|
1936
|
+
break;
|
|
1937
|
+
case 10:
|
|
1938
|
+
message.discount = reader.string();
|
|
1939
|
+
break;
|
|
1940
|
+
case 11:
|
|
1941
|
+
message.debtDenom = reader.string();
|
|
1942
|
+
break;
|
|
1943
|
+
case 12:
|
|
1944
|
+
message.debtAmount = reader.string();
|
|
1945
|
+
break;
|
|
1946
|
+
case 13:
|
|
1947
|
+
message.principalAmount = reader.string();
|
|
1948
|
+
break;
|
|
1949
|
+
case 14:
|
|
1950
|
+
message.interestDenom = reader.string();
|
|
1951
|
+
break;
|
|
1952
|
+
case 15:
|
|
1953
|
+
message.interestAmount = reader.string();
|
|
1954
|
+
break;
|
|
1955
|
+
default:
|
|
1956
|
+
reader.skipType(tag & 7);
|
|
1957
|
+
break;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
return message;
|
|
1961
|
+
},
|
|
1962
|
+
fromJSON(object) {
|
|
1963
|
+
const message = Object.assign({}, baseLiquidateCollateralWithStablecoinEvent);
|
|
1964
|
+
message.creator =
|
|
1965
|
+
object.creator !== undefined && object.creator !== null
|
|
1966
|
+
? String(object.creator)
|
|
1967
|
+
: "";
|
|
1968
|
+
message.liquidator =
|
|
1969
|
+
object.liquidator !== undefined && object.liquidator !== null
|
|
1970
|
+
? String(object.liquidator)
|
|
1971
|
+
: "";
|
|
1972
|
+
message.debtor =
|
|
1973
|
+
object.debtor !== undefined && object.debtor !== null
|
|
1974
|
+
? String(object.debtor)
|
|
1975
|
+
: "";
|
|
1976
|
+
message.collateralDenom =
|
|
1977
|
+
object.collateralDenom !== undefined && object.collateralDenom !== null
|
|
1978
|
+
? String(object.collateralDenom)
|
|
1979
|
+
: "";
|
|
1980
|
+
message.collateralAmountLiquidated =
|
|
1981
|
+
object.collateralAmountLiquidated !== undefined &&
|
|
1982
|
+
object.collateralAmountLiquidated !== null
|
|
1983
|
+
? String(object.collateralAmountLiquidated)
|
|
1984
|
+
: "";
|
|
1985
|
+
message.collateralAmountLiquidator =
|
|
1986
|
+
object.collateralAmountLiquidator !== undefined &&
|
|
1987
|
+
object.collateralAmountLiquidator !== null
|
|
1988
|
+
? String(object.collateralAmountLiquidator)
|
|
1989
|
+
: "";
|
|
1990
|
+
message.collateralAmountFee =
|
|
1991
|
+
object.collateralAmountFee !== undefined &&
|
|
1992
|
+
object.collateralAmountFee !== null
|
|
1993
|
+
? String(object.collateralAmountFee)
|
|
1994
|
+
: "";
|
|
1995
|
+
message.liquidationPrice =
|
|
1996
|
+
object.liquidationPrice !== undefined && object.liquidationPrice !== null
|
|
1997
|
+
? String(object.liquidationPrice)
|
|
1998
|
+
: "";
|
|
1999
|
+
message.marketPrice =
|
|
2000
|
+
object.marketPrice !== undefined && object.marketPrice !== null
|
|
2001
|
+
? String(object.marketPrice)
|
|
2002
|
+
: "";
|
|
2003
|
+
message.discount =
|
|
2004
|
+
object.discount !== undefined && object.discount !== null
|
|
2005
|
+
? String(object.discount)
|
|
2006
|
+
: "";
|
|
2007
|
+
message.debtDenom =
|
|
2008
|
+
object.debtDenom !== undefined && object.debtDenom !== null
|
|
2009
|
+
? String(object.debtDenom)
|
|
2010
|
+
: "";
|
|
2011
|
+
message.debtAmount =
|
|
2012
|
+
object.debtAmount !== undefined && object.debtAmount !== null
|
|
2013
|
+
? String(object.debtAmount)
|
|
2014
|
+
: "";
|
|
2015
|
+
message.principalAmount =
|
|
2016
|
+
object.principalAmount !== undefined && object.principalAmount !== null
|
|
2017
|
+
? String(object.principalAmount)
|
|
2018
|
+
: "";
|
|
2019
|
+
message.interestDenom =
|
|
2020
|
+
object.interestDenom !== undefined && object.interestDenom !== null
|
|
2021
|
+
? String(object.interestDenom)
|
|
2022
|
+
: "";
|
|
2023
|
+
message.interestAmount =
|
|
2024
|
+
object.interestAmount !== undefined && object.interestAmount !== null
|
|
2025
|
+
? String(object.interestAmount)
|
|
2026
|
+
: "";
|
|
2027
|
+
return message;
|
|
2028
|
+
},
|
|
2029
|
+
toJSON(message) {
|
|
2030
|
+
const obj = {};
|
|
2031
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
2032
|
+
message.liquidator !== undefined && (obj.liquidator = message.liquidator);
|
|
2033
|
+
message.debtor !== undefined && (obj.debtor = message.debtor);
|
|
2034
|
+
message.collateralDenom !== undefined &&
|
|
2035
|
+
(obj.collateralDenom = message.collateralDenom);
|
|
2036
|
+
message.collateralAmountLiquidated !== undefined &&
|
|
2037
|
+
(obj.collateralAmountLiquidated = message.collateralAmountLiquidated);
|
|
2038
|
+
message.collateralAmountLiquidator !== undefined &&
|
|
2039
|
+
(obj.collateralAmountLiquidator = message.collateralAmountLiquidator);
|
|
2040
|
+
message.collateralAmountFee !== undefined &&
|
|
2041
|
+
(obj.collateralAmountFee = message.collateralAmountFee);
|
|
2042
|
+
message.liquidationPrice !== undefined &&
|
|
2043
|
+
(obj.liquidationPrice = message.liquidationPrice);
|
|
2044
|
+
message.marketPrice !== undefined &&
|
|
2045
|
+
(obj.marketPrice = message.marketPrice);
|
|
2046
|
+
message.discount !== undefined && (obj.discount = message.discount);
|
|
2047
|
+
message.debtDenom !== undefined && (obj.debtDenom = message.debtDenom);
|
|
2048
|
+
message.debtAmount !== undefined && (obj.debtAmount = message.debtAmount);
|
|
2049
|
+
message.principalAmount !== undefined &&
|
|
2050
|
+
(obj.principalAmount = message.principalAmount);
|
|
2051
|
+
message.interestDenom !== undefined &&
|
|
2052
|
+
(obj.interestDenom = message.interestDenom);
|
|
2053
|
+
message.interestAmount !== undefined &&
|
|
2054
|
+
(obj.interestAmount = message.interestAmount);
|
|
2055
|
+
return obj;
|
|
2056
|
+
},
|
|
2057
|
+
fromPartial(object) {
|
|
2058
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2059
|
+
const message = Object.assign({}, baseLiquidateCollateralWithStablecoinEvent);
|
|
2060
|
+
message.creator = (_a = object.creator) !== null && _a !== void 0 ? _a : "";
|
|
2061
|
+
message.liquidator = (_b = object.liquidator) !== null && _b !== void 0 ? _b : "";
|
|
2062
|
+
message.debtor = (_c = object.debtor) !== null && _c !== void 0 ? _c : "";
|
|
2063
|
+
message.collateralDenom = (_d = object.collateralDenom) !== null && _d !== void 0 ? _d : "";
|
|
2064
|
+
message.collateralAmountLiquidated =
|
|
2065
|
+
(_e = object.collateralAmountLiquidated) !== null && _e !== void 0 ? _e : "";
|
|
2066
|
+
message.collateralAmountLiquidator =
|
|
2067
|
+
(_f = object.collateralAmountLiquidator) !== null && _f !== void 0 ? _f : "";
|
|
2068
|
+
message.collateralAmountFee = (_g = object.collateralAmountFee) !== null && _g !== void 0 ? _g : "";
|
|
2069
|
+
message.liquidationPrice = (_h = object.liquidationPrice) !== null && _h !== void 0 ? _h : "";
|
|
2070
|
+
message.marketPrice = (_j = object.marketPrice) !== null && _j !== void 0 ? _j : "";
|
|
2071
|
+
message.discount = (_k = object.discount) !== null && _k !== void 0 ? _k : "";
|
|
2072
|
+
message.debtDenom = (_l = object.debtDenom) !== null && _l !== void 0 ? _l : "";
|
|
2073
|
+
message.debtAmount = (_m = object.debtAmount) !== null && _m !== void 0 ? _m : "";
|
|
2074
|
+
message.principalAmount = (_o = object.principalAmount) !== null && _o !== void 0 ? _o : "";
|
|
2075
|
+
message.interestDenom = (_p = object.interestDenom) !== null && _p !== void 0 ? _p : "";
|
|
2076
|
+
message.interestAmount = (_q = object.interestAmount) !== null && _q !== void 0 ? _q : "";
|
|
2077
|
+
return message;
|
|
2078
|
+
},
|
|
2079
|
+
};
|
|
1837
2080
|
const baseClaimRewardEvent = {
|
|
1838
2081
|
receiver: "",
|
|
1839
2082
|
rewardSchemeId: "",
|
package/lib/codec/cdp/query.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/paginati
|
|
|
6
6
|
import { AssetParams } from "./asset_params";
|
|
7
7
|
import { DebtInfo } from "./debt_info";
|
|
8
8
|
import { StablecoinDebtInfo } from "./stablecoin_debt_info";
|
|
9
|
-
import { PageRequest as PageRequest1, PageResponse as PageResponse2 } from "../query/pagination";
|
|
10
9
|
import { Coin } from "../cosmos/base/v1beta1/coin";
|
|
11
10
|
import { RewardScheme, RewardDebt } from "./reward_scheme";
|
|
12
11
|
export declare const protobufPackage = "Switcheo.carbon.cdp";
|
|
@@ -135,11 +134,13 @@ export interface CdpPosition {
|
|
|
135
134
|
borrow: Coin[];
|
|
136
135
|
}
|
|
137
136
|
export interface QueryCdpPositionsRequest {
|
|
138
|
-
pagination?:
|
|
137
|
+
pagination?: PageRequest;
|
|
138
|
+
maxHealthFactor: string;
|
|
139
|
+
minHealthFactor: string;
|
|
139
140
|
}
|
|
140
141
|
export interface QueryCdpPositionsResponse {
|
|
141
142
|
positions: CdpPosition[];
|
|
142
|
-
pagination?:
|
|
143
|
+
pagination?: PageResponse;
|
|
143
144
|
}
|
|
144
145
|
export interface QueryRewardSchemesAllRequest {
|
|
145
146
|
pagination?: PageRequest;
|
package/lib/codec/cdp/query.js
CHANGED
|
@@ -13,7 +13,6 @@ const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
|
|
|
13
13
|
const asset_params_1 = require("./asset_params");
|
|
14
14
|
const debt_info_1 = require("./debt_info");
|
|
15
15
|
const stablecoin_debt_info_1 = require("./stablecoin_debt_info");
|
|
16
|
-
const pagination_2 = require("../query/pagination");
|
|
17
16
|
const coin_1 = require("../cosmos/base/v1beta1/coin");
|
|
18
17
|
const reward_scheme_1 = require("./reward_scheme");
|
|
19
18
|
exports.protobufPackage = "Switcheo.carbon.cdp";
|
|
@@ -1923,11 +1922,20 @@ exports.CdpPosition = {
|
|
|
1923
1922
|
return message;
|
|
1924
1923
|
},
|
|
1925
1924
|
};
|
|
1926
|
-
const baseQueryCdpPositionsRequest = {
|
|
1925
|
+
const baseQueryCdpPositionsRequest = {
|
|
1926
|
+
maxHealthFactor: "",
|
|
1927
|
+
minHealthFactor: "",
|
|
1928
|
+
};
|
|
1927
1929
|
exports.QueryCdpPositionsRequest = {
|
|
1928
1930
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1929
1931
|
if (message.pagination !== undefined) {
|
|
1930
|
-
|
|
1932
|
+
pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
|
|
1933
|
+
}
|
|
1934
|
+
if (message.maxHealthFactor !== "") {
|
|
1935
|
+
writer.uint32(18).string(message.maxHealthFactor);
|
|
1936
|
+
}
|
|
1937
|
+
if (message.minHealthFactor !== "") {
|
|
1938
|
+
writer.uint32(26).string(message.minHealthFactor);
|
|
1931
1939
|
}
|
|
1932
1940
|
return writer;
|
|
1933
1941
|
},
|
|
@@ -1939,7 +1947,13 @@ exports.QueryCdpPositionsRequest = {
|
|
|
1939
1947
|
const tag = reader.uint32();
|
|
1940
1948
|
switch (tag >>> 3) {
|
|
1941
1949
|
case 1:
|
|
1942
|
-
message.pagination =
|
|
1950
|
+
message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
|
|
1951
|
+
break;
|
|
1952
|
+
case 2:
|
|
1953
|
+
message.maxHealthFactor = reader.string();
|
|
1954
|
+
break;
|
|
1955
|
+
case 3:
|
|
1956
|
+
message.minHealthFactor = reader.string();
|
|
1943
1957
|
break;
|
|
1944
1958
|
default:
|
|
1945
1959
|
reader.skipType(tag & 7);
|
|
@@ -1952,24 +1966,39 @@ exports.QueryCdpPositionsRequest = {
|
|
|
1952
1966
|
const message = Object.assign({}, baseQueryCdpPositionsRequest);
|
|
1953
1967
|
message.pagination =
|
|
1954
1968
|
object.pagination !== undefined && object.pagination !== null
|
|
1955
|
-
?
|
|
1969
|
+
? pagination_1.PageRequest.fromJSON(object.pagination)
|
|
1956
1970
|
: undefined;
|
|
1971
|
+
message.maxHealthFactor =
|
|
1972
|
+
object.maxHealthFactor !== undefined && object.maxHealthFactor !== null
|
|
1973
|
+
? String(object.maxHealthFactor)
|
|
1974
|
+
: "";
|
|
1975
|
+
message.minHealthFactor =
|
|
1976
|
+
object.minHealthFactor !== undefined && object.minHealthFactor !== null
|
|
1977
|
+
? String(object.minHealthFactor)
|
|
1978
|
+
: "";
|
|
1957
1979
|
return message;
|
|
1958
1980
|
},
|
|
1959
1981
|
toJSON(message) {
|
|
1960
1982
|
const obj = {};
|
|
1961
1983
|
message.pagination !== undefined &&
|
|
1962
1984
|
(obj.pagination = message.pagination
|
|
1963
|
-
?
|
|
1985
|
+
? pagination_1.PageRequest.toJSON(message.pagination)
|
|
1964
1986
|
: undefined);
|
|
1987
|
+
message.maxHealthFactor !== undefined &&
|
|
1988
|
+
(obj.maxHealthFactor = message.maxHealthFactor);
|
|
1989
|
+
message.minHealthFactor !== undefined &&
|
|
1990
|
+
(obj.minHealthFactor = message.minHealthFactor);
|
|
1965
1991
|
return obj;
|
|
1966
1992
|
},
|
|
1967
1993
|
fromPartial(object) {
|
|
1994
|
+
var _a, _b;
|
|
1968
1995
|
const message = Object.assign({}, baseQueryCdpPositionsRequest);
|
|
1969
1996
|
message.pagination =
|
|
1970
1997
|
object.pagination !== undefined && object.pagination !== null
|
|
1971
|
-
?
|
|
1998
|
+
? pagination_1.PageRequest.fromPartial(object.pagination)
|
|
1972
1999
|
: undefined;
|
|
2000
|
+
message.maxHealthFactor = (_a = object.maxHealthFactor) !== null && _a !== void 0 ? _a : "";
|
|
2001
|
+
message.minHealthFactor = (_b = object.minHealthFactor) !== null && _b !== void 0 ? _b : "";
|
|
1973
2002
|
return message;
|
|
1974
2003
|
},
|
|
1975
2004
|
};
|
|
@@ -1980,7 +2009,7 @@ exports.QueryCdpPositionsResponse = {
|
|
|
1980
2009
|
exports.CdpPosition.encode(v, writer.uint32(10).fork()).ldelim();
|
|
1981
2010
|
}
|
|
1982
2011
|
if (message.pagination !== undefined) {
|
|
1983
|
-
|
|
2012
|
+
pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
|
|
1984
2013
|
}
|
|
1985
2014
|
return writer;
|
|
1986
2015
|
},
|
|
@@ -1996,7 +2025,7 @@ exports.QueryCdpPositionsResponse = {
|
|
|
1996
2025
|
message.positions.push(exports.CdpPosition.decode(reader, reader.uint32()));
|
|
1997
2026
|
break;
|
|
1998
2027
|
case 2:
|
|
1999
|
-
message.pagination =
|
|
2028
|
+
message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
|
|
2000
2029
|
break;
|
|
2001
2030
|
default:
|
|
2002
2031
|
reader.skipType(tag & 7);
|
|
@@ -2011,7 +2040,7 @@ exports.QueryCdpPositionsResponse = {
|
|
|
2011
2040
|
message.positions = ((_a = object.positions) !== null && _a !== void 0 ? _a : []).map((e) => exports.CdpPosition.fromJSON(e));
|
|
2012
2041
|
message.pagination =
|
|
2013
2042
|
object.pagination !== undefined && object.pagination !== null
|
|
2014
|
-
?
|
|
2043
|
+
? pagination_1.PageResponse.fromJSON(object.pagination)
|
|
2015
2044
|
: undefined;
|
|
2016
2045
|
return message;
|
|
2017
2046
|
},
|
|
@@ -2025,7 +2054,7 @@ exports.QueryCdpPositionsResponse = {
|
|
|
2025
2054
|
}
|
|
2026
2055
|
message.pagination !== undefined &&
|
|
2027
2056
|
(obj.pagination = message.pagination
|
|
2028
|
-
?
|
|
2057
|
+
? pagination_1.PageResponse.toJSON(message.pagination)
|
|
2029
2058
|
: undefined);
|
|
2030
2059
|
return obj;
|
|
2031
2060
|
},
|
|
@@ -2035,7 +2064,7 @@ exports.QueryCdpPositionsResponse = {
|
|
|
2035
2064
|
message.positions = ((_a = object.positions) !== null && _a !== void 0 ? _a : []).map((e) => exports.CdpPosition.fromPartial(e));
|
|
2036
2065
|
message.pagination =
|
|
2037
2066
|
object.pagination !== undefined && object.pagination !== null
|
|
2038
|
-
?
|
|
2067
|
+
? pagination_1.PageResponse.fromPartial(object.pagination)
|
|
2039
2068
|
: undefined;
|
|
2040
2069
|
return message;
|
|
2041
2070
|
},
|
package/lib/codec/cdp/tx.d.ts
CHANGED
|
@@ -199,6 +199,19 @@ export interface MsgLiquidateCollateralWithCollateral {
|
|
|
199
199
|
}
|
|
200
200
|
export interface MsgLiquidateCollateralWithCollateralResponse {
|
|
201
201
|
}
|
|
202
|
+
export interface MsgLiquidateCollateralWithStablecoin {
|
|
203
|
+
creator: string;
|
|
204
|
+
debtor: string;
|
|
205
|
+
collateralDenom: string;
|
|
206
|
+
minCollateralAmount: string;
|
|
207
|
+
debtDenom: string;
|
|
208
|
+
debtAmount: string;
|
|
209
|
+
principalAmount: string;
|
|
210
|
+
interestDenom: string;
|
|
211
|
+
interestAmount: string;
|
|
212
|
+
}
|
|
213
|
+
export interface MsgLiquidateCollateralWithStablecoinResponse {
|
|
214
|
+
}
|
|
202
215
|
export interface MsgCreateRewardScheme {
|
|
203
216
|
creator: string;
|
|
204
217
|
createRewardSchemeParams?: CreateRewardSchemeParams;
|
|
@@ -224,6 +237,11 @@ export interface MsgAddRewardReserve {
|
|
|
224
237
|
}
|
|
225
238
|
export interface MsgAddRewardReserveResponse {
|
|
226
239
|
}
|
|
240
|
+
export interface MsgClaimRewards {
|
|
241
|
+
creator: string;
|
|
242
|
+
}
|
|
243
|
+
export interface MsgClaimRewardsResponse {
|
|
244
|
+
}
|
|
227
245
|
export declare const MsgAddRateStrategy: {
|
|
228
246
|
encode(message: MsgAddRateStrategy, writer?: _m0.Writer): _m0.Writer;
|
|
229
247
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgAddRateStrategy;
|
|
@@ -588,6 +606,20 @@ export declare const MsgLiquidateCollateralWithCollateralResponse: {
|
|
|
588
606
|
toJSON(_: MsgLiquidateCollateralWithCollateralResponse): unknown;
|
|
589
607
|
fromPartial(_: DeepPartial<MsgLiquidateCollateralWithCollateralResponse>): MsgLiquidateCollateralWithCollateralResponse;
|
|
590
608
|
};
|
|
609
|
+
export declare const MsgLiquidateCollateralWithStablecoin: {
|
|
610
|
+
encode(message: MsgLiquidateCollateralWithStablecoin, writer?: _m0.Writer): _m0.Writer;
|
|
611
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgLiquidateCollateralWithStablecoin;
|
|
612
|
+
fromJSON(object: any): MsgLiquidateCollateralWithStablecoin;
|
|
613
|
+
toJSON(message: MsgLiquidateCollateralWithStablecoin): unknown;
|
|
614
|
+
fromPartial(object: DeepPartial<MsgLiquidateCollateralWithStablecoin>): MsgLiquidateCollateralWithStablecoin;
|
|
615
|
+
};
|
|
616
|
+
export declare const MsgLiquidateCollateralWithStablecoinResponse: {
|
|
617
|
+
encode(_: MsgLiquidateCollateralWithStablecoinResponse, writer?: _m0.Writer): _m0.Writer;
|
|
618
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgLiquidateCollateralWithStablecoinResponse;
|
|
619
|
+
fromJSON(_: any): MsgLiquidateCollateralWithStablecoinResponse;
|
|
620
|
+
toJSON(_: MsgLiquidateCollateralWithStablecoinResponse): unknown;
|
|
621
|
+
fromPartial(_: DeepPartial<MsgLiquidateCollateralWithStablecoinResponse>): MsgLiquidateCollateralWithStablecoinResponse;
|
|
622
|
+
};
|
|
591
623
|
export declare const MsgCreateRewardScheme: {
|
|
592
624
|
encode(message: MsgCreateRewardScheme, writer?: _m0.Writer): _m0.Writer;
|
|
593
625
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgCreateRewardScheme;
|
|
@@ -630,6 +662,20 @@ export declare const MsgAddRewardReserveResponse: {
|
|
|
630
662
|
toJSON(_: MsgAddRewardReserveResponse): unknown;
|
|
631
663
|
fromPartial(_: DeepPartial<MsgAddRewardReserveResponse>): MsgAddRewardReserveResponse;
|
|
632
664
|
};
|
|
665
|
+
export declare const MsgClaimRewards: {
|
|
666
|
+
encode(message: MsgClaimRewards, writer?: _m0.Writer): _m0.Writer;
|
|
667
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgClaimRewards;
|
|
668
|
+
fromJSON(object: any): MsgClaimRewards;
|
|
669
|
+
toJSON(message: MsgClaimRewards): unknown;
|
|
670
|
+
fromPartial(object: DeepPartial<MsgClaimRewards>): MsgClaimRewards;
|
|
671
|
+
};
|
|
672
|
+
export declare const MsgClaimRewardsResponse: {
|
|
673
|
+
encode(_: MsgClaimRewardsResponse, writer?: _m0.Writer): _m0.Writer;
|
|
674
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgClaimRewardsResponse;
|
|
675
|
+
fromJSON(_: any): MsgClaimRewardsResponse;
|
|
676
|
+
toJSON(_: MsgClaimRewardsResponse): unknown;
|
|
677
|
+
fromPartial(_: DeepPartial<MsgClaimRewardsResponse>): MsgClaimRewardsResponse;
|
|
678
|
+
};
|
|
633
679
|
/** Msg defines the Msg service. */
|
|
634
680
|
export interface Msg {
|
|
635
681
|
AddRateStrategy(request: MsgAddRateStrategy): Promise<MsgAddRateStrategyResponse>;
|
|
@@ -653,6 +699,7 @@ export interface Msg {
|
|
|
653
699
|
CreateRewardScheme(request: MsgCreateRewardScheme): Promise<MsgCreateRewardSchemeResponse>;
|
|
654
700
|
UpdateRewardScheme(request: MsgUpdateRewardScheme): Promise<MsgUpdateRewardSchemeResponse>;
|
|
655
701
|
AddReserve(request: MsgAddRewardReserve): Promise<MsgAddRewardReserveResponse>;
|
|
702
|
+
ClaimRewards(request: MsgClaimRewards): Promise<MsgClaimRewardsResponse>;
|
|
656
703
|
SetStablecoinInterestRate(request: MsgSetStablecoinInterestRate): Promise<MsgSetStablecoinInterestRateResponse>;
|
|
657
704
|
MintStablecoin(request: MsgMintStablecoin): Promise<MsgMintStablecoinResponse>;
|
|
658
705
|
ReturnStablecoin(request: MsgReturnStablecoin): Promise<MsgReturnStablecoinResponse>;
|
|
@@ -660,8 +707,9 @@ export interface Msg {
|
|
|
660
707
|
SetMinimumCloseFactor(request: MsgSetMinimumCloseFactor): Promise<MsgSetMinimumCloseFactorResponse>;
|
|
661
708
|
SetSmallLiquidationSize(request: MsgSetSmallLiquidationSize): Promise<MsgSetSmallLiquidationSizeResponse>;
|
|
662
709
|
LiquidateCollateralWithCdpTokens(request: MsgLiquidateCollateralWithCdpTokens): Promise<MsgLiquidateCollateralWithCdpTokensResponse>;
|
|
663
|
-
/** this line is used by starport scaffolding # proto/tx/rpc */
|
|
664
710
|
LiquidateCollateralWithCollateral(request: MsgLiquidateCollateralWithCollateral): Promise<MsgLiquidateCollateralWithCollateralResponse>;
|
|
711
|
+
/** this line is used by starport scaffolding # proto/tx/rpc */
|
|
712
|
+
LiquidateCollateralWithStablecoin(request: MsgLiquidateCollateralWithStablecoin): Promise<MsgLiquidateCollateralWithStablecoinResponse>;
|
|
665
713
|
}
|
|
666
714
|
export declare class MsgClientImpl implements Msg {
|
|
667
715
|
private readonly rpc;
|
|
@@ -687,6 +735,7 @@ export declare class MsgClientImpl implements Msg {
|
|
|
687
735
|
CreateRewardScheme(request: MsgCreateRewardScheme): Promise<MsgCreateRewardSchemeResponse>;
|
|
688
736
|
UpdateRewardScheme(request: MsgUpdateRewardScheme): Promise<MsgUpdateRewardSchemeResponse>;
|
|
689
737
|
AddReserve(request: MsgAddRewardReserve): Promise<MsgAddRewardReserveResponse>;
|
|
738
|
+
ClaimRewards(request: MsgClaimRewards): Promise<MsgClaimRewardsResponse>;
|
|
690
739
|
SetStablecoinInterestRate(request: MsgSetStablecoinInterestRate): Promise<MsgSetStablecoinInterestRateResponse>;
|
|
691
740
|
MintStablecoin(request: MsgMintStablecoin): Promise<MsgMintStablecoinResponse>;
|
|
692
741
|
ReturnStablecoin(request: MsgReturnStablecoin): Promise<MsgReturnStablecoinResponse>;
|
|
@@ -695,6 +744,7 @@ export declare class MsgClientImpl implements Msg {
|
|
|
695
744
|
SetSmallLiquidationSize(request: MsgSetSmallLiquidationSize): Promise<MsgSetSmallLiquidationSizeResponse>;
|
|
696
745
|
LiquidateCollateralWithCdpTokens(request: MsgLiquidateCollateralWithCdpTokens): Promise<MsgLiquidateCollateralWithCdpTokensResponse>;
|
|
697
746
|
LiquidateCollateralWithCollateral(request: MsgLiquidateCollateralWithCollateral): Promise<MsgLiquidateCollateralWithCollateralResponse>;
|
|
747
|
+
LiquidateCollateralWithStablecoin(request: MsgLiquidateCollateralWithStablecoin): Promise<MsgLiquidateCollateralWithStablecoinResponse>;
|
|
698
748
|
}
|
|
699
749
|
interface Rpc {
|
|
700
750
|
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|