carbon-js-sdk 0.2.17 → 0.2.18-dev.0
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/CarbonSDK.d.ts +13 -1
- package/lib/CarbonSDK.js +31 -2
- package/lib/clients/CarbonQueryClient.js +2 -2
- package/lib/clients/ETHClient.d.ts +1 -1
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/N3Client.js +3 -2
- package/lib/clients/NEOClient.d.ts +1 -1
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.d.ts +5 -0
- package/lib/clients/TokenClient.js +38 -10
- package/lib/clients/ZILClient.d.ts +1 -1
- package/lib/clients/ZILClient.js +16 -16
- 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/event.d.ts +389 -22
- package/lib/codec/cdp/event.js +2494 -83
- package/lib/codec/cdp/genesis.d.ts +97 -4
- package/lib/codec/cdp/genesis.js +648 -23
- package/lib/codec/cdp/query.d.ts +439 -89
- package/lib/codec/cdp/query.js +1995 -177
- package/lib/codec/cdp/tx.d.ts +760 -96
- package/lib/codec/cdp/tx.js +3645 -235
- 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 -2
- package/lib/codec/coin/query.js +2 -2
- 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/genesis.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/authz/v1beta1/query.js +2 -2
- 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/genesis.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +3 -3
- package/lib/codec/cosmos/bank/v1beta1/query.js +3 -3
- 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/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 +2 -2
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +2 -2
- 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 +4 -4
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +4 -4
- 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 +1 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/service.js +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.js +5 -5
- 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 +89 -18
- package/lib/codec/index.js +463 -180
- 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/liquiditypool.d.ts +3 -0
- package/lib/codec/liquiditypool/liquiditypool.js +44 -1
- package/lib/codec/liquiditypool/proposal.d.ts +1 -1
- package/lib/codec/liquiditypool/proposal.js +1 -1
- package/lib/codec/liquiditypool/query.d.ts +39 -2
- package/lib/codec/liquiditypool/query.js +195 -3
- package/lib/codec/liquiditypool/tx.d.ts +3 -1
- package/lib/codec/liquiditypool/tx.js +35 -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 +1 -1
- package/lib/codec/market/genesis.js +1 -1
- 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/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 +4 -1
- package/lib/codec/oracle/genesis.js +34 -3
- 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 +56 -1
- package/lib/codec/pricing/event.js +298 -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 +14 -0
- package/lib/codec/pricing/pricing.js +103 -1
- package/lib/codec/pricing/query.d.ts +68 -1
- package/lib/codec/pricing/query.js +321 -2
- package/lib/codec/pricing/tx.d.ts +96 -0
- package/lib/codec/pricing/tx.js +399 -1
- 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/constant/generic.js +1 -1
- package/lib/constant/token.d.ts +4 -0
- package/lib/constant/token.js +5 -1
- package/lib/modules/admin.d.ts +114 -7
- package/lib/modules/admin.js +275 -53
- package/lib/modules/cdp.d.ts +152 -13
- package/lib/modules/cdp.js +800 -20
- package/lib/modules/gov.js +14 -14
- package/lib/modules/liquiditypool.d.ts +3 -0
- package/lib/modules/liquiditypool.js +3 -1
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
- package/lib/provider/amino/types/admin.js +91 -26
- package/lib/provider/amino/types/bank.js +1 -1
- package/lib/provider/amino/types/broker.js +1 -1
- package/lib/provider/amino/types/cdp.js +135 -24
- package/lib/provider/amino/types/coin.js +2 -2
- package/lib/provider/amino/types/gov.js +4 -4
- package/lib/provider/amino/types/ibc.js +1 -1
- package/lib/provider/amino/types/leverage.js +1 -1
- package/lib/provider/amino/types/liquidityPool.js +9 -7
- package/lib/provider/amino/types/market.js +1 -1
- package/lib/provider/amino/types/oracle.js +1 -1
- package/lib/provider/amino/types/order.js +4 -4
- package/lib/provider/amino/types/position.js +1 -1
- package/lib/provider/amino/types/profile.js +1 -1
- package/lib/provider/amino/types/staking.js +4 -4
- package/lib/provider/amino/types/subaccount.js +3 -3
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/keplr/KeplrStore.js +1 -1
- package/lib/provider/ledger/ledger.js +2 -2
- package/lib/provider/metamask/MetaMask.js +1 -1
- package/lib/provider/o3/O3Wallet.js +2 -2
- package/lib/util/address.d.ts +1 -0
- package/lib/util/address.js +21 -13
- package/lib/util/api.js +4 -4
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/number.d.ts +1 -0
- package/lib/util/number.js +7 -6
- package/lib/util/tx.d.ts +74 -10
- package/lib/wallet/CarbonSigner.js +2 -2
- package/lib/wallet/CarbonSigningClient.js +8 -8
- package/lib/wallet/CarbonWallet.js +6 -7
- package/lib/websocket/channel.js +115 -21
- package/lib/websocket/connector.js +3 -3
- package/lib/websocket/models.d.ts +156 -0
- package/lib/websocket/types.d.ts +87 -3
- package/lib/websocket/types.js +31 -0
- package/package.json +1 -1
|
@@ -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"));
|
|
@@ -22,6 +22,9 @@ exports.Params = {
|
|
|
22
22
|
if (message.staleIndexAllowance !== undefined) {
|
|
23
23
|
duration_1.Duration.encode(message.staleIndexAllowance, writer.uint32(26).fork()).ldelim();
|
|
24
24
|
}
|
|
25
|
+
if (message.backfillTimeInterval !== undefined) {
|
|
26
|
+
duration_1.Duration.encode(message.backfillTimeInterval, writer.uint32(34).fork()).ldelim();
|
|
27
|
+
}
|
|
25
28
|
return writer;
|
|
26
29
|
},
|
|
27
30
|
decode(input, length) {
|
|
@@ -40,6 +43,9 @@ exports.Params = {
|
|
|
40
43
|
case 3:
|
|
41
44
|
message.staleIndexAllowance = duration_1.Duration.decode(reader, reader.uint32());
|
|
42
45
|
break;
|
|
46
|
+
case 4:
|
|
47
|
+
message.backfillTimeInterval = duration_1.Duration.decode(reader, reader.uint32());
|
|
48
|
+
break;
|
|
43
49
|
default:
|
|
44
50
|
reader.skipType(tag & 7);
|
|
45
51
|
break;
|
|
@@ -62,6 +68,11 @@ exports.Params = {
|
|
|
62
68
|
object.staleIndexAllowance !== null
|
|
63
69
|
? duration_1.Duration.fromJSON(object.staleIndexAllowance)
|
|
64
70
|
: undefined;
|
|
71
|
+
message.backfillTimeInterval =
|
|
72
|
+
object.backfillTimeInterval !== undefined &&
|
|
73
|
+
object.backfillTimeInterval !== null
|
|
74
|
+
? duration_1.Duration.fromJSON(object.backfillTimeInterval)
|
|
75
|
+
: undefined;
|
|
65
76
|
return message;
|
|
66
77
|
},
|
|
67
78
|
toJSON(message) {
|
|
@@ -73,6 +84,10 @@ exports.Params = {
|
|
|
73
84
|
(obj.staleIndexAllowance = message.staleIndexAllowance
|
|
74
85
|
? duration_1.Duration.toJSON(message.staleIndexAllowance)
|
|
75
86
|
: undefined);
|
|
87
|
+
message.backfillTimeInterval !== undefined &&
|
|
88
|
+
(obj.backfillTimeInterval = message.backfillTimeInterval
|
|
89
|
+
? duration_1.Duration.toJSON(message.backfillTimeInterval)
|
|
90
|
+
: undefined);
|
|
76
91
|
return obj;
|
|
77
92
|
},
|
|
78
93
|
fromPartial(object) {
|
|
@@ -85,6 +100,11 @@ exports.Params = {
|
|
|
85
100
|
object.staleIndexAllowance !== null
|
|
86
101
|
? duration_1.Duration.fromPartial(object.staleIndexAllowance)
|
|
87
102
|
: undefined;
|
|
103
|
+
message.backfillTimeInterval =
|
|
104
|
+
object.backfillTimeInterval !== undefined &&
|
|
105
|
+
object.backfillTimeInterval !== null
|
|
106
|
+
? duration_1.Duration.fromPartial(object.backfillTimeInterval)
|
|
107
|
+
: undefined;
|
|
88
108
|
return message;
|
|
89
109
|
},
|
|
90
110
|
};
|
|
@@ -312,6 +332,88 @@ exports.PriceSet = {
|
|
|
312
332
|
return message;
|
|
313
333
|
},
|
|
314
334
|
};
|
|
335
|
+
const baseTokenPrice = { denom: "", index: "", twap: "" };
|
|
336
|
+
exports.TokenPrice = {
|
|
337
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
338
|
+
if (message.denom !== "") {
|
|
339
|
+
writer.uint32(10).string(message.denom);
|
|
340
|
+
}
|
|
341
|
+
if (message.index !== "") {
|
|
342
|
+
writer.uint32(18).string(message.index);
|
|
343
|
+
}
|
|
344
|
+
if (message.twap !== "") {
|
|
345
|
+
writer.uint32(26).string(message.twap);
|
|
346
|
+
}
|
|
347
|
+
if (message.indexUpdatedAt !== undefined) {
|
|
348
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.indexUpdatedAt), writer.uint32(34).fork()).ldelim();
|
|
349
|
+
}
|
|
350
|
+
return writer;
|
|
351
|
+
},
|
|
352
|
+
decode(input, length) {
|
|
353
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
354
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
355
|
+
const message = Object.assign({}, baseTokenPrice);
|
|
356
|
+
while (reader.pos < end) {
|
|
357
|
+
const tag = reader.uint32();
|
|
358
|
+
switch (tag >>> 3) {
|
|
359
|
+
case 1:
|
|
360
|
+
message.denom = reader.string();
|
|
361
|
+
break;
|
|
362
|
+
case 2:
|
|
363
|
+
message.index = reader.string();
|
|
364
|
+
break;
|
|
365
|
+
case 3:
|
|
366
|
+
message.twap = reader.string();
|
|
367
|
+
break;
|
|
368
|
+
case 4:
|
|
369
|
+
message.indexUpdatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
370
|
+
break;
|
|
371
|
+
default:
|
|
372
|
+
reader.skipType(tag & 7);
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return message;
|
|
377
|
+
},
|
|
378
|
+
fromJSON(object) {
|
|
379
|
+
const message = Object.assign({}, baseTokenPrice);
|
|
380
|
+
message.denom =
|
|
381
|
+
object.denom !== undefined && object.denom !== null
|
|
382
|
+
? String(object.denom)
|
|
383
|
+
: "";
|
|
384
|
+
message.index =
|
|
385
|
+
object.index !== undefined && object.index !== null
|
|
386
|
+
? String(object.index)
|
|
387
|
+
: "";
|
|
388
|
+
message.twap =
|
|
389
|
+
object.twap !== undefined && object.twap !== null
|
|
390
|
+
? String(object.twap)
|
|
391
|
+
: "";
|
|
392
|
+
message.indexUpdatedAt =
|
|
393
|
+
object.indexUpdatedAt !== undefined && object.indexUpdatedAt !== null
|
|
394
|
+
? fromJsonTimestamp(object.indexUpdatedAt)
|
|
395
|
+
: undefined;
|
|
396
|
+
return message;
|
|
397
|
+
},
|
|
398
|
+
toJSON(message) {
|
|
399
|
+
const obj = {};
|
|
400
|
+
message.denom !== undefined && (obj.denom = message.denom);
|
|
401
|
+
message.index !== undefined && (obj.index = message.index);
|
|
402
|
+
message.twap !== undefined && (obj.twap = message.twap);
|
|
403
|
+
message.indexUpdatedAt !== undefined &&
|
|
404
|
+
(obj.indexUpdatedAt = message.indexUpdatedAt.toISOString());
|
|
405
|
+
return obj;
|
|
406
|
+
},
|
|
407
|
+
fromPartial(object) {
|
|
408
|
+
var _a, _b, _c, _d;
|
|
409
|
+
const message = Object.assign({}, baseTokenPrice);
|
|
410
|
+
message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
|
|
411
|
+
message.index = (_b = object.index) !== null && _b !== void 0 ? _b : "";
|
|
412
|
+
message.twap = (_c = object.twap) !== null && _c !== void 0 ? _c : "";
|
|
413
|
+
message.indexUpdatedAt = (_d = object.indexUpdatedAt) !== null && _d !== void 0 ? _d : undefined;
|
|
414
|
+
return message;
|
|
415
|
+
},
|
|
416
|
+
};
|
|
315
417
|
function toTimestamp(date) {
|
|
316
418
|
const seconds = numberToLong(date.getTime() / 1000);
|
|
317
419
|
const nanos = (date.getTime() % 1000) * 1000000;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { PriceSet, Params } from "
|
|
3
|
+
import { TokenPrice, PriceSet, Params } from "./pricing";
|
|
4
4
|
import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
|
|
5
5
|
export declare const protobufPackage = "Switcheo.carbon.pricing";
|
|
6
|
+
export interface QueryPriceTokenRequest {
|
|
7
|
+
denom: string;
|
|
8
|
+
}
|
|
9
|
+
export interface QueryPriceTokenResponse {
|
|
10
|
+
tokenPrice?: TokenPrice;
|
|
11
|
+
}
|
|
6
12
|
export interface QueryPriceSetRequest {
|
|
7
13
|
market: string;
|
|
8
14
|
}
|
|
@@ -31,6 +37,33 @@ export interface QueryParamsResponse {
|
|
|
31
37
|
/** params holds all the parameters of this module. */
|
|
32
38
|
params?: Params;
|
|
33
39
|
}
|
|
40
|
+
export interface QueryTokenPriceRequest {
|
|
41
|
+
denom: string;
|
|
42
|
+
}
|
|
43
|
+
export interface QueryTokenPriceResponse {
|
|
44
|
+
tokenPrice?: TokenPrice;
|
|
45
|
+
}
|
|
46
|
+
export interface QueryTokenPriceAllRequest {
|
|
47
|
+
pagination?: PageRequest;
|
|
48
|
+
}
|
|
49
|
+
export interface QueryTokenPriceAllResponse {
|
|
50
|
+
tokenPrices: TokenPrice[];
|
|
51
|
+
pagination?: PageResponse;
|
|
52
|
+
}
|
|
53
|
+
export declare const QueryPriceTokenRequest: {
|
|
54
|
+
encode(message: QueryPriceTokenRequest, writer?: _m0.Writer): _m0.Writer;
|
|
55
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPriceTokenRequest;
|
|
56
|
+
fromJSON(object: any): QueryPriceTokenRequest;
|
|
57
|
+
toJSON(message: QueryPriceTokenRequest): unknown;
|
|
58
|
+
fromPartial(object: DeepPartial<QueryPriceTokenRequest>): QueryPriceTokenRequest;
|
|
59
|
+
};
|
|
60
|
+
export declare const QueryPriceTokenResponse: {
|
|
61
|
+
encode(message: QueryPriceTokenResponse, writer?: _m0.Writer): _m0.Writer;
|
|
62
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPriceTokenResponse;
|
|
63
|
+
fromJSON(object: any): QueryPriceTokenResponse;
|
|
64
|
+
toJSON(message: QueryPriceTokenResponse): unknown;
|
|
65
|
+
fromPartial(object: DeepPartial<QueryPriceTokenResponse>): QueryPriceTokenResponse;
|
|
66
|
+
};
|
|
34
67
|
export declare const QueryPriceSetRequest: {
|
|
35
68
|
encode(message: QueryPriceSetRequest, writer?: _m0.Writer): _m0.Writer;
|
|
36
69
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryPriceSetRequest;
|
|
@@ -87,6 +120,34 @@ export declare const QueryParamsResponse: {
|
|
|
87
120
|
toJSON(message: QueryParamsResponse): unknown;
|
|
88
121
|
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse;
|
|
89
122
|
};
|
|
123
|
+
export declare const QueryTokenPriceRequest: {
|
|
124
|
+
encode(message: QueryTokenPriceRequest, writer?: _m0.Writer): _m0.Writer;
|
|
125
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryTokenPriceRequest;
|
|
126
|
+
fromJSON(object: any): QueryTokenPriceRequest;
|
|
127
|
+
toJSON(message: QueryTokenPriceRequest): unknown;
|
|
128
|
+
fromPartial(object: DeepPartial<QueryTokenPriceRequest>): QueryTokenPriceRequest;
|
|
129
|
+
};
|
|
130
|
+
export declare const QueryTokenPriceResponse: {
|
|
131
|
+
encode(message: QueryTokenPriceResponse, writer?: _m0.Writer): _m0.Writer;
|
|
132
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryTokenPriceResponse;
|
|
133
|
+
fromJSON(object: any): QueryTokenPriceResponse;
|
|
134
|
+
toJSON(message: QueryTokenPriceResponse): unknown;
|
|
135
|
+
fromPartial(object: DeepPartial<QueryTokenPriceResponse>): QueryTokenPriceResponse;
|
|
136
|
+
};
|
|
137
|
+
export declare const QueryTokenPriceAllRequest: {
|
|
138
|
+
encode(message: QueryTokenPriceAllRequest, writer?: _m0.Writer): _m0.Writer;
|
|
139
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryTokenPriceAllRequest;
|
|
140
|
+
fromJSON(object: any): QueryTokenPriceAllRequest;
|
|
141
|
+
toJSON(message: QueryTokenPriceAllRequest): unknown;
|
|
142
|
+
fromPartial(object: DeepPartial<QueryTokenPriceAllRequest>): QueryTokenPriceAllRequest;
|
|
143
|
+
};
|
|
144
|
+
export declare const QueryTokenPriceAllResponse: {
|
|
145
|
+
encode(message: QueryTokenPriceAllResponse, writer?: _m0.Writer): _m0.Writer;
|
|
146
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryTokenPriceAllResponse;
|
|
147
|
+
fromJSON(object: any): QueryTokenPriceAllResponse;
|
|
148
|
+
toJSON(message: QueryTokenPriceAllResponse): unknown;
|
|
149
|
+
fromPartial(object: DeepPartial<QueryTokenPriceAllResponse>): QueryTokenPriceAllResponse;
|
|
150
|
+
};
|
|
90
151
|
/** Query defines the gRPC querier service. */
|
|
91
152
|
export interface Query {
|
|
92
153
|
/** Get prices for a market */
|
|
@@ -97,6 +158,10 @@ export interface Query {
|
|
|
97
158
|
Rate(request: QueryRateRequest): Promise<QueryRateResponse>;
|
|
98
159
|
/** Parameters queries the pricing parameters. */
|
|
99
160
|
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
|
|
161
|
+
/** Get index price and twap for a token */
|
|
162
|
+
TokenPrice(request: QueryTokenPriceRequest): Promise<QueryTokenPriceResponse>;
|
|
163
|
+
/** Get index price and twap for all tokens */
|
|
164
|
+
TokenPriceAll(request: QueryTokenPriceAllRequest): Promise<QueryTokenPriceAllResponse>;
|
|
100
165
|
}
|
|
101
166
|
export declare class QueryClientImpl implements Query {
|
|
102
167
|
private readonly rpc;
|
|
@@ -105,6 +170,8 @@ export declare class QueryClientImpl implements Query {
|
|
|
105
170
|
PriceSetAll(request: QueryAllPriceSetRequest): Promise<QueryAllPriceSetResponse>;
|
|
106
171
|
Rate(request: QueryRateRequest): Promise<QueryRateResponse>;
|
|
107
172
|
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
|
|
173
|
+
TokenPrice(request: QueryTokenPriceRequest): Promise<QueryTokenPriceResponse>;
|
|
174
|
+
TokenPriceAll(request: QueryTokenPriceAllRequest): Promise<QueryTokenPriceAllResponse>;
|
|
108
175
|
}
|
|
109
176
|
interface Rpc {
|
|
110
177
|
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
@@ -3,13 +3,108 @@ 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.QueryClientImpl = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryRateResponse = exports.QueryRateRequest = exports.QueryAllPriceSetResponse = exports.QueryAllPriceSetRequest = exports.QueryPriceSetResponse = exports.QueryPriceSetRequest = exports.protobufPackage = void 0;
|
|
6
|
+
exports.QueryClientImpl = exports.QueryTokenPriceAllResponse = exports.QueryTokenPriceAllRequest = exports.QueryTokenPriceResponse = exports.QueryTokenPriceRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryRateResponse = exports.QueryRateRequest = exports.QueryAllPriceSetResponse = exports.QueryAllPriceSetRequest = exports.QueryPriceSetResponse = exports.QueryPriceSetRequest = exports.QueryPriceTokenResponse = exports.QueryPriceTokenRequest = 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
|
const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
|
|
12
12
|
exports.protobufPackage = "Switcheo.carbon.pricing";
|
|
13
|
+
const baseQueryPriceTokenRequest = { denom: "" };
|
|
14
|
+
exports.QueryPriceTokenRequest = {
|
|
15
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
16
|
+
if (message.denom !== "") {
|
|
17
|
+
writer.uint32(10).string(message.denom);
|
|
18
|
+
}
|
|
19
|
+
return writer;
|
|
20
|
+
},
|
|
21
|
+
decode(input, length) {
|
|
22
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
23
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
24
|
+
const message = Object.assign({}, baseQueryPriceTokenRequest);
|
|
25
|
+
while (reader.pos < end) {
|
|
26
|
+
const tag = reader.uint32();
|
|
27
|
+
switch (tag >>> 3) {
|
|
28
|
+
case 1:
|
|
29
|
+
message.denom = reader.string();
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
reader.skipType(tag & 7);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return message;
|
|
37
|
+
},
|
|
38
|
+
fromJSON(object) {
|
|
39
|
+
const message = Object.assign({}, baseQueryPriceTokenRequest);
|
|
40
|
+
message.denom =
|
|
41
|
+
object.denom !== undefined && object.denom !== null
|
|
42
|
+
? String(object.denom)
|
|
43
|
+
: "";
|
|
44
|
+
return message;
|
|
45
|
+
},
|
|
46
|
+
toJSON(message) {
|
|
47
|
+
const obj = {};
|
|
48
|
+
message.denom !== undefined && (obj.denom = message.denom);
|
|
49
|
+
return obj;
|
|
50
|
+
},
|
|
51
|
+
fromPartial(object) {
|
|
52
|
+
var _a;
|
|
53
|
+
const message = Object.assign({}, baseQueryPriceTokenRequest);
|
|
54
|
+
message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
|
|
55
|
+
return message;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
const baseQueryPriceTokenResponse = {};
|
|
59
|
+
exports.QueryPriceTokenResponse = {
|
|
60
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
61
|
+
if (message.tokenPrice !== undefined) {
|
|
62
|
+
pricing_1.TokenPrice.encode(message.tokenPrice, writer.uint32(10).fork()).ldelim();
|
|
63
|
+
}
|
|
64
|
+
return writer;
|
|
65
|
+
},
|
|
66
|
+
decode(input, length) {
|
|
67
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
68
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
69
|
+
const message = Object.assign({}, baseQueryPriceTokenResponse);
|
|
70
|
+
while (reader.pos < end) {
|
|
71
|
+
const tag = reader.uint32();
|
|
72
|
+
switch (tag >>> 3) {
|
|
73
|
+
case 1:
|
|
74
|
+
message.tokenPrice = pricing_1.TokenPrice.decode(reader, reader.uint32());
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
reader.skipType(tag & 7);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return message;
|
|
82
|
+
},
|
|
83
|
+
fromJSON(object) {
|
|
84
|
+
const message = Object.assign({}, baseQueryPriceTokenResponse);
|
|
85
|
+
message.tokenPrice =
|
|
86
|
+
object.tokenPrice !== undefined && object.tokenPrice !== null
|
|
87
|
+
? pricing_1.TokenPrice.fromJSON(object.tokenPrice)
|
|
88
|
+
: undefined;
|
|
89
|
+
return message;
|
|
90
|
+
},
|
|
91
|
+
toJSON(message) {
|
|
92
|
+
const obj = {};
|
|
93
|
+
message.tokenPrice !== undefined &&
|
|
94
|
+
(obj.tokenPrice = message.tokenPrice
|
|
95
|
+
? pricing_1.TokenPrice.toJSON(message.tokenPrice)
|
|
96
|
+
: undefined);
|
|
97
|
+
return obj;
|
|
98
|
+
},
|
|
99
|
+
fromPartial(object) {
|
|
100
|
+
const message = Object.assign({}, baseQueryPriceTokenResponse);
|
|
101
|
+
message.tokenPrice =
|
|
102
|
+
object.tokenPrice !== undefined && object.tokenPrice !== null
|
|
103
|
+
? pricing_1.TokenPrice.fromPartial(object.tokenPrice)
|
|
104
|
+
: undefined;
|
|
105
|
+
return message;
|
|
106
|
+
},
|
|
107
|
+
};
|
|
13
108
|
const baseQueryPriceSetRequest = { market: "" };
|
|
14
109
|
exports.QueryPriceSetRequest = {
|
|
15
110
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
@@ -404,6 +499,218 @@ exports.QueryParamsResponse = {
|
|
|
404
499
|
return message;
|
|
405
500
|
},
|
|
406
501
|
};
|
|
502
|
+
const baseQueryTokenPriceRequest = { denom: "" };
|
|
503
|
+
exports.QueryTokenPriceRequest = {
|
|
504
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
505
|
+
if (message.denom !== "") {
|
|
506
|
+
writer.uint32(10).string(message.denom);
|
|
507
|
+
}
|
|
508
|
+
return writer;
|
|
509
|
+
},
|
|
510
|
+
decode(input, length) {
|
|
511
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
512
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
513
|
+
const message = Object.assign({}, baseQueryTokenPriceRequest);
|
|
514
|
+
while (reader.pos < end) {
|
|
515
|
+
const tag = reader.uint32();
|
|
516
|
+
switch (tag >>> 3) {
|
|
517
|
+
case 1:
|
|
518
|
+
message.denom = reader.string();
|
|
519
|
+
break;
|
|
520
|
+
default:
|
|
521
|
+
reader.skipType(tag & 7);
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
return message;
|
|
526
|
+
},
|
|
527
|
+
fromJSON(object) {
|
|
528
|
+
const message = Object.assign({}, baseQueryTokenPriceRequest);
|
|
529
|
+
message.denom =
|
|
530
|
+
object.denom !== undefined && object.denom !== null
|
|
531
|
+
? String(object.denom)
|
|
532
|
+
: "";
|
|
533
|
+
return message;
|
|
534
|
+
},
|
|
535
|
+
toJSON(message) {
|
|
536
|
+
const obj = {};
|
|
537
|
+
message.denom !== undefined && (obj.denom = message.denom);
|
|
538
|
+
return obj;
|
|
539
|
+
},
|
|
540
|
+
fromPartial(object) {
|
|
541
|
+
var _a;
|
|
542
|
+
const message = Object.assign({}, baseQueryTokenPriceRequest);
|
|
543
|
+
message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
|
|
544
|
+
return message;
|
|
545
|
+
},
|
|
546
|
+
};
|
|
547
|
+
const baseQueryTokenPriceResponse = {};
|
|
548
|
+
exports.QueryTokenPriceResponse = {
|
|
549
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
550
|
+
if (message.tokenPrice !== undefined) {
|
|
551
|
+
pricing_1.TokenPrice.encode(message.tokenPrice, writer.uint32(10).fork()).ldelim();
|
|
552
|
+
}
|
|
553
|
+
return writer;
|
|
554
|
+
},
|
|
555
|
+
decode(input, length) {
|
|
556
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
557
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
558
|
+
const message = Object.assign({}, baseQueryTokenPriceResponse);
|
|
559
|
+
while (reader.pos < end) {
|
|
560
|
+
const tag = reader.uint32();
|
|
561
|
+
switch (tag >>> 3) {
|
|
562
|
+
case 1:
|
|
563
|
+
message.tokenPrice = pricing_1.TokenPrice.decode(reader, reader.uint32());
|
|
564
|
+
break;
|
|
565
|
+
default:
|
|
566
|
+
reader.skipType(tag & 7);
|
|
567
|
+
break;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
return message;
|
|
571
|
+
},
|
|
572
|
+
fromJSON(object) {
|
|
573
|
+
const message = Object.assign({}, baseQueryTokenPriceResponse);
|
|
574
|
+
message.tokenPrice =
|
|
575
|
+
object.tokenPrice !== undefined && object.tokenPrice !== null
|
|
576
|
+
? pricing_1.TokenPrice.fromJSON(object.tokenPrice)
|
|
577
|
+
: undefined;
|
|
578
|
+
return message;
|
|
579
|
+
},
|
|
580
|
+
toJSON(message) {
|
|
581
|
+
const obj = {};
|
|
582
|
+
message.tokenPrice !== undefined &&
|
|
583
|
+
(obj.tokenPrice = message.tokenPrice
|
|
584
|
+
? pricing_1.TokenPrice.toJSON(message.tokenPrice)
|
|
585
|
+
: undefined);
|
|
586
|
+
return obj;
|
|
587
|
+
},
|
|
588
|
+
fromPartial(object) {
|
|
589
|
+
const message = Object.assign({}, baseQueryTokenPriceResponse);
|
|
590
|
+
message.tokenPrice =
|
|
591
|
+
object.tokenPrice !== undefined && object.tokenPrice !== null
|
|
592
|
+
? pricing_1.TokenPrice.fromPartial(object.tokenPrice)
|
|
593
|
+
: undefined;
|
|
594
|
+
return message;
|
|
595
|
+
},
|
|
596
|
+
};
|
|
597
|
+
const baseQueryTokenPriceAllRequest = {};
|
|
598
|
+
exports.QueryTokenPriceAllRequest = {
|
|
599
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
600
|
+
if (message.pagination !== undefined) {
|
|
601
|
+
pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
|
|
602
|
+
}
|
|
603
|
+
return writer;
|
|
604
|
+
},
|
|
605
|
+
decode(input, length) {
|
|
606
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
607
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
608
|
+
const message = Object.assign({}, baseQueryTokenPriceAllRequest);
|
|
609
|
+
while (reader.pos < end) {
|
|
610
|
+
const tag = reader.uint32();
|
|
611
|
+
switch (tag >>> 3) {
|
|
612
|
+
case 1:
|
|
613
|
+
message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
|
|
614
|
+
break;
|
|
615
|
+
default:
|
|
616
|
+
reader.skipType(tag & 7);
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return message;
|
|
621
|
+
},
|
|
622
|
+
fromJSON(object) {
|
|
623
|
+
const message = Object.assign({}, baseQueryTokenPriceAllRequest);
|
|
624
|
+
message.pagination =
|
|
625
|
+
object.pagination !== undefined && object.pagination !== null
|
|
626
|
+
? pagination_1.PageRequest.fromJSON(object.pagination)
|
|
627
|
+
: undefined;
|
|
628
|
+
return message;
|
|
629
|
+
},
|
|
630
|
+
toJSON(message) {
|
|
631
|
+
const obj = {};
|
|
632
|
+
message.pagination !== undefined &&
|
|
633
|
+
(obj.pagination = message.pagination
|
|
634
|
+
? pagination_1.PageRequest.toJSON(message.pagination)
|
|
635
|
+
: undefined);
|
|
636
|
+
return obj;
|
|
637
|
+
},
|
|
638
|
+
fromPartial(object) {
|
|
639
|
+
const message = Object.assign({}, baseQueryTokenPriceAllRequest);
|
|
640
|
+
message.pagination =
|
|
641
|
+
object.pagination !== undefined && object.pagination !== null
|
|
642
|
+
? pagination_1.PageRequest.fromPartial(object.pagination)
|
|
643
|
+
: undefined;
|
|
644
|
+
return message;
|
|
645
|
+
},
|
|
646
|
+
};
|
|
647
|
+
const baseQueryTokenPriceAllResponse = {};
|
|
648
|
+
exports.QueryTokenPriceAllResponse = {
|
|
649
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
650
|
+
for (const v of message.tokenPrices) {
|
|
651
|
+
pricing_1.TokenPrice.encode(v, writer.uint32(10).fork()).ldelim();
|
|
652
|
+
}
|
|
653
|
+
if (message.pagination !== undefined) {
|
|
654
|
+
pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
|
|
655
|
+
}
|
|
656
|
+
return writer;
|
|
657
|
+
},
|
|
658
|
+
decode(input, length) {
|
|
659
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
660
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
661
|
+
const message = Object.assign({}, baseQueryTokenPriceAllResponse);
|
|
662
|
+
message.tokenPrices = [];
|
|
663
|
+
while (reader.pos < end) {
|
|
664
|
+
const tag = reader.uint32();
|
|
665
|
+
switch (tag >>> 3) {
|
|
666
|
+
case 1:
|
|
667
|
+
message.tokenPrices.push(pricing_1.TokenPrice.decode(reader, reader.uint32()));
|
|
668
|
+
break;
|
|
669
|
+
case 2:
|
|
670
|
+
message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
|
|
671
|
+
break;
|
|
672
|
+
default:
|
|
673
|
+
reader.skipType(tag & 7);
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return message;
|
|
678
|
+
},
|
|
679
|
+
fromJSON(object) {
|
|
680
|
+
var _a;
|
|
681
|
+
const message = Object.assign({}, baseQueryTokenPriceAllResponse);
|
|
682
|
+
message.tokenPrices = ((_a = object.tokenPrices) !== null && _a !== void 0 ? _a : []).map((e) => pricing_1.TokenPrice.fromJSON(e));
|
|
683
|
+
message.pagination =
|
|
684
|
+
object.pagination !== undefined && object.pagination !== null
|
|
685
|
+
? pagination_1.PageResponse.fromJSON(object.pagination)
|
|
686
|
+
: undefined;
|
|
687
|
+
return message;
|
|
688
|
+
},
|
|
689
|
+
toJSON(message) {
|
|
690
|
+
const obj = {};
|
|
691
|
+
if (message.tokenPrices) {
|
|
692
|
+
obj.tokenPrices = message.tokenPrices.map((e) => e ? pricing_1.TokenPrice.toJSON(e) : undefined);
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
obj.tokenPrices = [];
|
|
696
|
+
}
|
|
697
|
+
message.pagination !== undefined &&
|
|
698
|
+
(obj.pagination = message.pagination
|
|
699
|
+
? pagination_1.PageResponse.toJSON(message.pagination)
|
|
700
|
+
: undefined);
|
|
701
|
+
return obj;
|
|
702
|
+
},
|
|
703
|
+
fromPartial(object) {
|
|
704
|
+
var _a;
|
|
705
|
+
const message = Object.assign({}, baseQueryTokenPriceAllResponse);
|
|
706
|
+
message.tokenPrices = ((_a = object.tokenPrices) !== null && _a !== void 0 ? _a : []).map((e) => pricing_1.TokenPrice.fromPartial(e));
|
|
707
|
+
message.pagination =
|
|
708
|
+
object.pagination !== undefined && object.pagination !== null
|
|
709
|
+
? pagination_1.PageResponse.fromPartial(object.pagination)
|
|
710
|
+
: undefined;
|
|
711
|
+
return message;
|
|
712
|
+
},
|
|
713
|
+
};
|
|
407
714
|
class QueryClientImpl {
|
|
408
715
|
constructor(rpc) {
|
|
409
716
|
this.rpc = rpc;
|
|
@@ -411,6 +718,8 @@ class QueryClientImpl {
|
|
|
411
718
|
this.PriceSetAll = this.PriceSetAll.bind(this);
|
|
412
719
|
this.Rate = this.Rate.bind(this);
|
|
413
720
|
this.Params = this.Params.bind(this);
|
|
721
|
+
this.TokenPrice = this.TokenPrice.bind(this);
|
|
722
|
+
this.TokenPriceAll = this.TokenPriceAll.bind(this);
|
|
414
723
|
}
|
|
415
724
|
PriceSet(request) {
|
|
416
725
|
const data = exports.QueryPriceSetRequest.encode(request).finish();
|
|
@@ -432,6 +741,16 @@ class QueryClientImpl {
|
|
|
432
741
|
const promise = this.rpc.request("Switcheo.carbon.pricing.Query", "Params", data);
|
|
433
742
|
return promise.then((data) => exports.QueryParamsResponse.decode(new minimal_1.default.Reader(data)));
|
|
434
743
|
}
|
|
744
|
+
TokenPrice(request) {
|
|
745
|
+
const data = exports.QueryTokenPriceRequest.encode(request).finish();
|
|
746
|
+
const promise = this.rpc.request("Switcheo.carbon.pricing.Query", "TokenPrice", data);
|
|
747
|
+
return promise.then((data) => exports.QueryTokenPriceResponse.decode(new minimal_1.default.Reader(data)));
|
|
748
|
+
}
|
|
749
|
+
TokenPriceAll(request) {
|
|
750
|
+
const data = exports.QueryTokenPriceAllRequest.encode(request).finish();
|
|
751
|
+
const promise = this.rpc.request("Switcheo.carbon.pricing.Query", "TokenPriceAll", data);
|
|
752
|
+
return promise.then((data) => exports.QueryTokenPriceAllResponse.decode(new minimal_1.default.Reader(data)));
|
|
753
|
+
}
|
|
435
754
|
}
|
|
436
755
|
exports.QueryClientImpl = QueryClientImpl;
|
|
437
756
|
if (minimal_1.default.util.Long !== long_1.default) {
|