carbon-js-sdk 0.2.13 → 0.2.14-dev.2
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 +345 -22
- package/lib/codec/cdp/event.js +2247 -81
- 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 +696 -96
- package/lib/codec/cdp/tx.js +3392 -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 +73 -23
- package/lib/codec/index.js +597 -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 +105 -13
- package/lib/modules/cdp.js +628 -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 +60 -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 +180 -21
- package/lib/websocket/types.d.ts +69 -3
- package/lib/websocket/types.js +27 -0
- package/package.json +1 -1
package/lib/codec/misc/trade.js
CHANGED
|
@@ -19,6 +19,7 @@ const baseAccountTrade = {
|
|
|
19
19
|
feeDenom: "",
|
|
20
20
|
address: "",
|
|
21
21
|
blockHeight: long_1.default.ZERO,
|
|
22
|
+
tradeId: long_1.default.UZERO,
|
|
22
23
|
};
|
|
23
24
|
exports.AccountTrade = {
|
|
24
25
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
@@ -52,6 +53,9 @@ exports.AccountTrade = {
|
|
|
52
53
|
if (message.blockCreatedAt !== undefined) {
|
|
53
54
|
timestamp_1.Timestamp.encode(toTimestamp(message.blockCreatedAt), writer.uint32(82).fork()).ldelim();
|
|
54
55
|
}
|
|
56
|
+
if (!message.tradeId.isZero()) {
|
|
57
|
+
writer.uint32(88).uint64(message.tradeId);
|
|
58
|
+
}
|
|
55
59
|
return writer;
|
|
56
60
|
},
|
|
57
61
|
decode(input, length) {
|
|
@@ -91,6 +95,9 @@ exports.AccountTrade = {
|
|
|
91
95
|
case 10:
|
|
92
96
|
message.blockCreatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
93
97
|
break;
|
|
98
|
+
case 11:
|
|
99
|
+
message.tradeId = reader.uint64();
|
|
100
|
+
break;
|
|
94
101
|
default:
|
|
95
102
|
reader.skipType(tag & 7);
|
|
96
103
|
break;
|
|
@@ -140,6 +147,10 @@ exports.AccountTrade = {
|
|
|
140
147
|
object.blockCreatedAt !== undefined && object.blockCreatedAt !== null
|
|
141
148
|
? fromJsonTimestamp(object.blockCreatedAt)
|
|
142
149
|
: undefined;
|
|
150
|
+
message.tradeId =
|
|
151
|
+
object.tradeId !== undefined && object.tradeId !== null
|
|
152
|
+
? long_1.default.fromString(object.tradeId)
|
|
153
|
+
: long_1.default.UZERO;
|
|
143
154
|
return message;
|
|
144
155
|
},
|
|
145
156
|
toJSON(message) {
|
|
@@ -156,6 +167,8 @@ exports.AccountTrade = {
|
|
|
156
167
|
(obj.blockHeight = (message.blockHeight || long_1.default.ZERO).toString());
|
|
157
168
|
message.blockCreatedAt !== undefined &&
|
|
158
169
|
(obj.blockCreatedAt = message.blockCreatedAt.toISOString());
|
|
170
|
+
message.tradeId !== undefined &&
|
|
171
|
+
(obj.tradeId = (message.tradeId || long_1.default.UZERO).toString());
|
|
159
172
|
return obj;
|
|
160
173
|
},
|
|
161
174
|
fromPartial(object) {
|
|
@@ -174,6 +187,10 @@ exports.AccountTrade = {
|
|
|
174
187
|
? long_1.default.fromValue(object.blockHeight)
|
|
175
188
|
: long_1.default.ZERO;
|
|
176
189
|
message.blockCreatedAt = (_j = object.blockCreatedAt) !== null && _j !== void 0 ? _j : undefined;
|
|
190
|
+
message.tradeId =
|
|
191
|
+
object.tradeId !== undefined && object.tradeId !== null
|
|
192
|
+
? long_1.default.fromValue(object.tradeId)
|
|
193
|
+
: long_1.default.UZERO;
|
|
177
194
|
return message;
|
|
178
195
|
},
|
|
179
196
|
};
|
|
@@ -8,7 +8,7 @@ exports.APITransaction = exports.Transaction = exports.protobufPackage = void 0;
|
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
10
|
const timestamp_1 = require("../google/protobuf/timestamp");
|
|
11
|
-
const message_1 = require("
|
|
11
|
+
const message_1 = require("./message");
|
|
12
12
|
exports.protobufPackage = "Switcheo.carbon.misc";
|
|
13
13
|
const baseTransaction = {
|
|
14
14
|
hash: "",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Vote, Result } from "
|
|
3
|
+
import { Vote, Result } from "./oracle";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.oracle";
|
|
5
5
|
export interface NewVoteEvent {
|
|
6
6
|
voterAccount: string;
|
|
@@ -7,7 +7,7 @@ exports.OracleSlashEvent = exports.ResultEvent = exports.VoteEvent = exports.Rec
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const oracle_1 = require("
|
|
10
|
+
const oracle_1 = require("./oracle");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.oracle";
|
|
12
12
|
const baseNewVoteEvent = { voterAccount: "" };
|
|
13
13
|
exports.NewVoteEvent = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Params, Oracle, Result, Vote } from "
|
|
3
|
+
import { Params, Oracle, Result, Vote } from "./oracle";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.oracle";
|
|
5
5
|
/** GenesisState defines the oracle 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 oracle_1 = require("
|
|
10
|
+
const oracle_1 = require("./oracle");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.oracle";
|
|
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 { CreateOracleParams } from "
|
|
3
|
+
import { CreateOracleParams } from "./tx";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.oracle";
|
|
5
5
|
export interface CreateOracleProposal {
|
|
6
6
|
title: string;
|
|
@@ -7,7 +7,7 @@ exports.CreateOracleProposal = 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 tx_1 = require("
|
|
10
|
+
const tx_1 = require("./tx");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.oracle";
|
|
12
12
|
const baseCreateOracleProposal = { title: "", description: "" };
|
|
13
13
|
exports.CreateOracleProposal = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Oracle, Params, Result, Vote } from "
|
|
3
|
+
import { Oracle, Params, Result, Vote } from "./oracle";
|
|
4
4
|
import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
|
|
5
|
-
import { SlashCounter, OracleVotesWindow } from "
|
|
5
|
+
import { SlashCounter, OracleVotesWindow } from "./slashing";
|
|
6
6
|
export declare const protobufPackage = "Switcheo.carbon.oracle";
|
|
7
7
|
/** this line is used by starport scaffolding # 3 */
|
|
8
8
|
export interface QueryOracleRequest {
|
|
@@ -7,9 +7,9 @@ exports.QueryClientImpl = exports.QueryParamsResponse = exports.QueryParamsReque
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const oracle_1 = require("
|
|
10
|
+
const oracle_1 = require("./oracle");
|
|
11
11
|
const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
|
|
12
|
-
const slashing_1 = require("
|
|
12
|
+
const slashing_1 = require("./slashing");
|
|
13
13
|
exports.protobufPackage = "Switcheo.carbon.oracle";
|
|
14
14
|
const baseQueryOracleRequest = { id: "" };
|
|
15
15
|
exports.QueryOracleRequest = {
|
package/lib/codec/order/event.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.OrderEvent = 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 order_1 = require("
|
|
10
|
+
const order_1 = require("./order");
|
|
11
11
|
const timestamp_1 = require("../google/protobuf/timestamp");
|
|
12
12
|
exports.protobufPackage = "Switcheo.carbon.order";
|
|
13
13
|
const baseOrderEvent = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Params, OrderIDs, Order } from "
|
|
3
|
+
import { Params, OrderIDs, Order } from "./order";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.order";
|
|
5
5
|
/** GenesisState defines the order module's genesis state. */
|
|
6
6
|
export interface GenesisState {
|
|
@@ -7,7 +7,7 @@ exports.GenesisFlag = exports.GenesisAccountSequence = exports.GenesisAccountOrd
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const order_1 = require("
|
|
10
|
+
const order_1 = require("./order");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.order";
|
|
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 { Order, Params, DBOrder } from "
|
|
3
|
+
import { Order, Params, DBOrder } from "./order";
|
|
4
4
|
import { PageRequest, PageResponse } from "../query/pagination";
|
|
5
5
|
export declare const protobufPackage = "Switcheo.carbon.order";
|
|
6
6
|
/** this line is used by starport scaffolding # 3 */
|
package/lib/codec/order/query.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryOrderAllocatedMarginResponse = exports.Qu
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const order_1 = require("
|
|
10
|
+
const order_1 = require("./order");
|
|
11
11
|
const pagination_1 = require("../query/pagination");
|
|
12
12
|
exports.protobufPackage = "Switcheo.carbon.order";
|
|
13
13
|
const baseQueryGetOrderRequest = { id: "" };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Position } from "
|
|
3
|
+
import { Position } from "./position";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.position";
|
|
5
5
|
export interface PositionEvent {
|
|
6
6
|
position?: Position;
|
|
@@ -7,7 +7,7 @@ exports.PositionEvent = 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 position_1 = require("
|
|
10
|
+
const position_1 = require("./position");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.position";
|
|
12
12
|
const basePositionEvent = {
|
|
13
13
|
id: long_1.default.UZERO,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Position } from "
|
|
3
|
+
import { Position } from "./position";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.position";
|
|
5
5
|
/** GenesisState defines the position 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 position_1 = require("
|
|
10
|
+
const position_1 = require("./position");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.position";
|
|
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 { Position, APIPosition, PositionAllocatedMargin } from "
|
|
3
|
+
import { Position, APIPosition, PositionAllocatedMargin } from "./position";
|
|
4
4
|
import { PageRequest, PageResponse } from "../query/pagination";
|
|
5
5
|
export declare const protobufPackage = "Switcheo.carbon.position";
|
|
6
6
|
export interface QueryGetPositionRequest {
|
|
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryPositionAllocatedMarginResponse = exports
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const position_1 = require("
|
|
10
|
+
const position_1 = require("./position");
|
|
11
11
|
const pagination_1 = require("../query/pagination");
|
|
12
12
|
exports.protobufPackage = "Switcheo.carbon.position";
|
|
13
13
|
const baseQueryGetPositionRequest = { address: "", market: "" };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { PriceSet } from "
|
|
3
|
+
import { PriceSet, TokenPrice } from "./pricing";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.pricing";
|
|
5
5
|
export interface PriceUpdateEvent {
|
|
6
6
|
prices?: PriceSet;
|
|
7
7
|
}
|
|
8
|
+
export interface TokenPriceUpdateEvent {
|
|
9
|
+
price?: TokenPrice;
|
|
10
|
+
}
|
|
8
11
|
export declare const PriceUpdateEvent: {
|
|
9
12
|
encode(message: PriceUpdateEvent, writer?: _m0.Writer): _m0.Writer;
|
|
10
13
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PriceUpdateEvent;
|
|
@@ -12,6 +15,13 @@ export declare const PriceUpdateEvent: {
|
|
|
12
15
|
toJSON(message: PriceUpdateEvent): unknown;
|
|
13
16
|
fromPartial(object: DeepPartial<PriceUpdateEvent>): PriceUpdateEvent;
|
|
14
17
|
};
|
|
18
|
+
export declare const TokenPriceUpdateEvent: {
|
|
19
|
+
encode(message: TokenPriceUpdateEvent, writer?: _m0.Writer): _m0.Writer;
|
|
20
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TokenPriceUpdateEvent;
|
|
21
|
+
fromJSON(object: any): TokenPriceUpdateEvent;
|
|
22
|
+
toJSON(message: TokenPriceUpdateEvent): unknown;
|
|
23
|
+
fromPartial(object: DeepPartial<TokenPriceUpdateEvent>): TokenPriceUpdateEvent;
|
|
24
|
+
};
|
|
15
25
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
16
26
|
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 {} ? {
|
|
17
27
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,11 +3,11 @@ 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.PriceUpdateEvent = exports.protobufPackage = void 0;
|
|
6
|
+
exports.TokenPriceUpdateEvent = exports.PriceUpdateEvent = 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 pricing_1 = require("
|
|
10
|
+
const pricing_1 = require("./pricing");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.pricing";
|
|
12
12
|
const basePriceUpdateEvent = {};
|
|
13
13
|
exports.PriceUpdateEvent = {
|
|
@@ -59,6 +59,56 @@ exports.PriceUpdateEvent = {
|
|
|
59
59
|
return message;
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
|
+
const baseTokenPriceUpdateEvent = {};
|
|
63
|
+
exports.TokenPriceUpdateEvent = {
|
|
64
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
65
|
+
if (message.price !== undefined) {
|
|
66
|
+
pricing_1.TokenPrice.encode(message.price, writer.uint32(10).fork()).ldelim();
|
|
67
|
+
}
|
|
68
|
+
return writer;
|
|
69
|
+
},
|
|
70
|
+
decode(input, length) {
|
|
71
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
72
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
73
|
+
const message = Object.assign({}, baseTokenPriceUpdateEvent);
|
|
74
|
+
while (reader.pos < end) {
|
|
75
|
+
const tag = reader.uint32();
|
|
76
|
+
switch (tag >>> 3) {
|
|
77
|
+
case 1:
|
|
78
|
+
message.price = pricing_1.TokenPrice.decode(reader, reader.uint32());
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
reader.skipType(tag & 7);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return message;
|
|
86
|
+
},
|
|
87
|
+
fromJSON(object) {
|
|
88
|
+
const message = Object.assign({}, baseTokenPriceUpdateEvent);
|
|
89
|
+
message.price =
|
|
90
|
+
object.price !== undefined && object.price !== null
|
|
91
|
+
? pricing_1.TokenPrice.fromJSON(object.price)
|
|
92
|
+
: undefined;
|
|
93
|
+
return message;
|
|
94
|
+
},
|
|
95
|
+
toJSON(message) {
|
|
96
|
+
const obj = {};
|
|
97
|
+
message.price !== undefined &&
|
|
98
|
+
(obj.price = message.price
|
|
99
|
+
? pricing_1.TokenPrice.toJSON(message.price)
|
|
100
|
+
: undefined);
|
|
101
|
+
return obj;
|
|
102
|
+
},
|
|
103
|
+
fromPartial(object) {
|
|
104
|
+
const message = Object.assign({}, baseTokenPriceUpdateEvent);
|
|
105
|
+
message.price =
|
|
106
|
+
object.price !== undefined && object.price !== null
|
|
107
|
+
? pricing_1.TokenPrice.fromPartial(object.price)
|
|
108
|
+
: undefined;
|
|
109
|
+
return message;
|
|
110
|
+
},
|
|
111
|
+
};
|
|
62
112
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
63
113
|
minimal_1.default.util.Long = long_1.default;
|
|
64
114
|
minimal_1.default.configure();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Params, PriceSet } from "
|
|
3
|
+
import { Params, PriceSet, TokenPrice } from "./pricing";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.pricing";
|
|
5
5
|
/** GenesisState defines the pricing module's genesis state. */
|
|
6
6
|
export interface GenesisState {
|
|
@@ -9,6 +9,7 @@ export interface GenesisState {
|
|
|
9
9
|
* this line is used by starport scaffolding # ibc/genesis/proto
|
|
10
10
|
*/
|
|
11
11
|
prices: PriceSet[];
|
|
12
|
+
tokenPrice: TokenPrice[];
|
|
12
13
|
params?: Params;
|
|
13
14
|
}
|
|
14
15
|
export declare const 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 pricing_1 = require("
|
|
10
|
+
const pricing_1 = require("./pricing");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.pricing";
|
|
12
12
|
const baseGenesisState = {};
|
|
13
13
|
exports.GenesisState = {
|
|
@@ -15,8 +15,11 @@ 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.tokenPrice) {
|
|
19
|
+
pricing_1.TokenPrice.encode(v, writer.uint32(18).fork()).ldelim();
|
|
20
|
+
}
|
|
18
21
|
if (message.params !== undefined) {
|
|
19
|
-
pricing_1.Params.encode(message.params, writer.uint32(
|
|
22
|
+
pricing_1.Params.encode(message.params, writer.uint32(26).fork()).ldelim();
|
|
20
23
|
}
|
|
21
24
|
return writer;
|
|
22
25
|
},
|
|
@@ -25,13 +28,17 @@ exports.GenesisState = {
|
|
|
25
28
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
26
29
|
const message = Object.assign({}, baseGenesisState);
|
|
27
30
|
message.prices = [];
|
|
31
|
+
message.tokenPrice = [];
|
|
28
32
|
while (reader.pos < end) {
|
|
29
33
|
const tag = reader.uint32();
|
|
30
34
|
switch (tag >>> 3) {
|
|
31
35
|
case 1:
|
|
32
36
|
message.prices.push(pricing_1.PriceSet.decode(reader, reader.uint32()));
|
|
33
37
|
break;
|
|
34
|
-
case
|
|
38
|
+
case 2:
|
|
39
|
+
message.tokenPrice.push(pricing_1.TokenPrice.decode(reader, reader.uint32()));
|
|
40
|
+
break;
|
|
41
|
+
case 3:
|
|
35
42
|
message.params = pricing_1.Params.decode(reader, reader.uint32());
|
|
36
43
|
break;
|
|
37
44
|
default:
|
|
@@ -42,9 +49,10 @@ exports.GenesisState = {
|
|
|
42
49
|
return message;
|
|
43
50
|
},
|
|
44
51
|
fromJSON(object) {
|
|
45
|
-
var _a;
|
|
52
|
+
var _a, _b;
|
|
46
53
|
const message = Object.assign({}, baseGenesisState);
|
|
47
54
|
message.prices = ((_a = object.prices) !== null && _a !== void 0 ? _a : []).map((e) => pricing_1.PriceSet.fromJSON(e));
|
|
55
|
+
message.tokenPrice = ((_b = object.tokenPrice) !== null && _b !== void 0 ? _b : []).map((e) => pricing_1.TokenPrice.fromJSON(e));
|
|
48
56
|
message.params =
|
|
49
57
|
object.params !== undefined && object.params !== null
|
|
50
58
|
? pricing_1.Params.fromJSON(object.params)
|
|
@@ -59,14 +67,21 @@ exports.GenesisState = {
|
|
|
59
67
|
else {
|
|
60
68
|
obj.prices = [];
|
|
61
69
|
}
|
|
70
|
+
if (message.tokenPrice) {
|
|
71
|
+
obj.tokenPrice = message.tokenPrice.map((e) => e ? pricing_1.TokenPrice.toJSON(e) : undefined);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
obj.tokenPrice = [];
|
|
75
|
+
}
|
|
62
76
|
message.params !== undefined &&
|
|
63
77
|
(obj.params = message.params ? pricing_1.Params.toJSON(message.params) : undefined);
|
|
64
78
|
return obj;
|
|
65
79
|
},
|
|
66
80
|
fromPartial(object) {
|
|
67
|
-
var _a;
|
|
81
|
+
var _a, _b;
|
|
68
82
|
const message = Object.assign({}, baseGenesisState);
|
|
69
83
|
message.prices = ((_a = object.prices) !== null && _a !== void 0 ? _a : []).map((e) => pricing_1.PriceSet.fromPartial(e));
|
|
84
|
+
message.tokenPrice = ((_b = object.tokenPrice) !== null && _b !== void 0 ? _b : []).map((e) => pricing_1.TokenPrice.fromPartial(e));
|
|
70
85
|
message.params =
|
|
71
86
|
object.params !== undefined && object.params !== null
|
|
72
87
|
? pricing_1.Params.fromPartial(object.params)
|
|
@@ -24,6 +24,12 @@ export interface PriceSet {
|
|
|
24
24
|
premiumRateCounter: string;
|
|
25
25
|
lastFundingAt?: Date;
|
|
26
26
|
}
|
|
27
|
+
export interface TokenPrice {
|
|
28
|
+
denom: string;
|
|
29
|
+
index: string;
|
|
30
|
+
twap: string;
|
|
31
|
+
indexUpdatedAt?: Date;
|
|
32
|
+
}
|
|
27
33
|
export declare const Params: {
|
|
28
34
|
encode(message: Params, writer?: _m0.Writer): _m0.Writer;
|
|
29
35
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
|
|
@@ -38,6 +44,13 @@ export declare const PriceSet: {
|
|
|
38
44
|
toJSON(message: PriceSet): unknown;
|
|
39
45
|
fromPartial(object: DeepPartial<PriceSet>): PriceSet;
|
|
40
46
|
};
|
|
47
|
+
export declare const TokenPrice: {
|
|
48
|
+
encode(message: TokenPrice, writer?: _m0.Writer): _m0.Writer;
|
|
49
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TokenPrice;
|
|
50
|
+
fromJSON(object: any): TokenPrice;
|
|
51
|
+
toJSON(message: TokenPrice): unknown;
|
|
52
|
+
fromPartial(object: DeepPartial<TokenPrice>): TokenPrice;
|
|
53
|
+
};
|
|
41
54
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
42
55
|
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 {} ? {
|
|
43
56
|
[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.PriceSet = exports.Params = exports.protobufPackage = void 0;
|
|
6
|
+
exports.TokenPrice = exports.PriceSet = exports.Params = 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"));
|
|
@@ -312,6 +312,88 @@ exports.PriceSet = {
|
|
|
312
312
|
return message;
|
|
313
313
|
},
|
|
314
314
|
};
|
|
315
|
+
const baseTokenPrice = { denom: "", index: "", twap: "" };
|
|
316
|
+
exports.TokenPrice = {
|
|
317
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
318
|
+
if (message.denom !== "") {
|
|
319
|
+
writer.uint32(10).string(message.denom);
|
|
320
|
+
}
|
|
321
|
+
if (message.index !== "") {
|
|
322
|
+
writer.uint32(18).string(message.index);
|
|
323
|
+
}
|
|
324
|
+
if (message.twap !== "") {
|
|
325
|
+
writer.uint32(26).string(message.twap);
|
|
326
|
+
}
|
|
327
|
+
if (message.indexUpdatedAt !== undefined) {
|
|
328
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.indexUpdatedAt), writer.uint32(34).fork()).ldelim();
|
|
329
|
+
}
|
|
330
|
+
return writer;
|
|
331
|
+
},
|
|
332
|
+
decode(input, length) {
|
|
333
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
334
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
335
|
+
const message = Object.assign({}, baseTokenPrice);
|
|
336
|
+
while (reader.pos < end) {
|
|
337
|
+
const tag = reader.uint32();
|
|
338
|
+
switch (tag >>> 3) {
|
|
339
|
+
case 1:
|
|
340
|
+
message.denom = reader.string();
|
|
341
|
+
break;
|
|
342
|
+
case 2:
|
|
343
|
+
message.index = reader.string();
|
|
344
|
+
break;
|
|
345
|
+
case 3:
|
|
346
|
+
message.twap = reader.string();
|
|
347
|
+
break;
|
|
348
|
+
case 4:
|
|
349
|
+
message.indexUpdatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
350
|
+
break;
|
|
351
|
+
default:
|
|
352
|
+
reader.skipType(tag & 7);
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return message;
|
|
357
|
+
},
|
|
358
|
+
fromJSON(object) {
|
|
359
|
+
const message = Object.assign({}, baseTokenPrice);
|
|
360
|
+
message.denom =
|
|
361
|
+
object.denom !== undefined && object.denom !== null
|
|
362
|
+
? String(object.denom)
|
|
363
|
+
: "";
|
|
364
|
+
message.index =
|
|
365
|
+
object.index !== undefined && object.index !== null
|
|
366
|
+
? String(object.index)
|
|
367
|
+
: "";
|
|
368
|
+
message.twap =
|
|
369
|
+
object.twap !== undefined && object.twap !== null
|
|
370
|
+
? String(object.twap)
|
|
371
|
+
: "";
|
|
372
|
+
message.indexUpdatedAt =
|
|
373
|
+
object.indexUpdatedAt !== undefined && object.indexUpdatedAt !== null
|
|
374
|
+
? fromJsonTimestamp(object.indexUpdatedAt)
|
|
375
|
+
: undefined;
|
|
376
|
+
return message;
|
|
377
|
+
},
|
|
378
|
+
toJSON(message) {
|
|
379
|
+
const obj = {};
|
|
380
|
+
message.denom !== undefined && (obj.denom = message.denom);
|
|
381
|
+
message.index !== undefined && (obj.index = message.index);
|
|
382
|
+
message.twap !== undefined && (obj.twap = message.twap);
|
|
383
|
+
message.indexUpdatedAt !== undefined &&
|
|
384
|
+
(obj.indexUpdatedAt = message.indexUpdatedAt.toISOString());
|
|
385
|
+
return obj;
|
|
386
|
+
},
|
|
387
|
+
fromPartial(object) {
|
|
388
|
+
var _a, _b, _c, _d;
|
|
389
|
+
const message = Object.assign({}, baseTokenPrice);
|
|
390
|
+
message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
|
|
391
|
+
message.index = (_b = object.index) !== null && _b !== void 0 ? _b : "";
|
|
392
|
+
message.twap = (_c = object.twap) !== null && _c !== void 0 ? _c : "";
|
|
393
|
+
message.indexUpdatedAt = (_d = object.indexUpdatedAt) !== null && _d !== void 0 ? _d : undefined;
|
|
394
|
+
return message;
|
|
395
|
+
},
|
|
396
|
+
};
|
|
315
397
|
function toTimestamp(date) {
|
|
316
398
|
const seconds = numberToLong(date.getTime() / 1000);
|
|
317
399
|
const nanos = (date.getTime() % 1000) * 1000000;
|