carbon-js-sdk 0.6.2 → 0.6.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/CarbonSDK.d.ts +1 -0
- package/lib/CarbonSDK.js +8 -6
- package/lib/clients/BatchQueryClient.js +4 -4
- package/lib/clients/CarbonQueryClient.js +1 -1
- package/lib/clients/ETHClient.d.ts +1 -0
- package/lib/clients/ETHClient.js +17 -17
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/InsightsQueryClient.js +3 -3
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.js +2 -2
- package/lib/clients/ZILClient.js +17 -17
- package/lib/codec/book/book.d.ts +14 -2
- package/lib/codec/book/book.js +80 -13
- package/lib/codec/book/legacy.d.ts +22 -0
- package/lib/codec/book/legacy.js +120 -0
- package/lib/codec/book/query.d.ts +48 -1
- package/lib/codec/book/query.js +224 -1
- package/lib/codec/cdp/event.d.ts +12 -6
- package/lib/codec/cdp/event.js +146 -68
- package/lib/codec/cdp/params.d.ts +0 -2
- package/lib/codec/cdp/params.js +8 -23
- package/lib/codec/cdp/query.d.ts +22 -1
- package/lib/codec/cdp/query.js +104 -17
- package/lib/codec/cosmos/gov/v1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1/tx.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/group/v1/events.js +2 -2
- package/lib/codec/cosmos/group/v1/tx.js +4 -4
- package/lib/codec/cosmos/tx/v1beta1/tx.js +4 -4
- package/lib/codec/index.d.ts +11 -9
- package/lib/codec/index.js +405 -133
- package/lib/codec/liquiditypool/event.d.ts +25 -1
- package/lib/codec/liquiditypool/event.js +147 -1
- package/lib/codec/liquiditypool/genesis.d.ts +4 -5
- package/lib/codec/liquiditypool/genesis.js +34 -49
- package/lib/codec/liquiditypool/query.d.ts +2 -51
- package/lib/codec/liquiditypool/query.js +18 -265
- package/lib/codec/liquiditypool/reward.d.ts +21 -21
- package/lib/codec/liquiditypool/reward.js +97 -111
- package/lib/codec/oracle/query.d.ts +37 -34
- package/lib/codec/oracle/query.js +37 -31
- package/lib/codec/position/position.d.ts +2 -0
- package/lib/codec/position/position.js +34 -0
- package/lib/codec/subaccount/genesis.d.ts +5 -1
- package/lib/codec/subaccount/genesis.js +48 -2
- package/lib/codec/subaccount/query.d.ts +110 -21
- package/lib/codec/subaccount/query.js +503 -47
- package/lib/codec/subaccount/subaccount.d.ts +29 -3
- package/lib/codec/subaccount/subaccount.js +234 -31
- package/lib/codec/subaccount/tx.d.ts +7 -1
- package/lib/codec/subaccount/tx.js +101 -16
- package/lib/constant/generic.js +1 -1
- package/lib/modules/cdp.js +45 -45
- package/lib/modules/cosmwasm.js +2 -2
- package/lib/modules/evm.js +5 -5
- package/lib/modules/gov.js +12 -12
- package/lib/modules/liquiditypool.js +1 -1
- package/lib/modules/order.js +2 -2
- package/lib/modules/subaccount.js +1 -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 +27 -27
- 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 +25 -25
- package/lib/provider/amino/types/coin.js +4 -4
- package/lib/provider/amino/types/evm.js +2 -2
- package/lib/provider/amino/types/evmmerge.js +1 -1
- package/lib/provider/amino/types/feemarket.js +1 -1
- package/lib/provider/amino/types/gov.js +5 -5
- 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 +7 -7
- package/lib/provider/amino/types/market.js +6 -6
- package/lib/provider/amino/types/oracle.js +2 -2
- 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/KeplrAccount.js +2 -2
- package/lib/provider/ledger/ledger.js +2 -2
- package/lib/provider/metamask/MetaMask.js +13 -13
- package/lib/provider/o3/O3Wallet.js +2 -2
- package/lib/util/address.js +14 -14
- package/lib/util/api.js +4 -4
- package/lib/util/blockchain.d.ts +1 -1
- package/lib/util/blockchain.js +4 -4
- package/lib/util/eip712.js +3 -3
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/legacyEIP712.js +2 -2
- package/lib/util/network.js +3 -3
- package/lib/util/number.js +5 -5
- package/lib/wallet/CarbonSigner.js +2 -2
- package/lib/wallet/CarbonSigningClient.js +15 -15
- package/lib/wallet/CarbonWallet.js +9 -9
- package/lib/websocket/connector.js +3 -3
- package/package.json +1 -1
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +0 -76
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +0 -424
|
@@ -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.AllocatedRewards = exports.
|
|
6
|
+
exports.AllocatedRewards = exports.CommitmentExpiriesRecord = exports.CommitmentExpiries = exports.CommitmentExpiry = exports.AccumulatedRewardsRecord = exports.AccumulatedRewards = exports.RewardHistory = exports.CommitmentResponse = exports.TotalCommitmentRecord = exports.TotalCommitment = exports.CommitmentRecord = exports.Commitment = exports.RewardWeights = exports.RewardWeight = exports.CommitmentCurve = exports.RewardCurve = 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"));
|
|
@@ -337,12 +337,16 @@ exports.Commitment = {
|
|
|
337
337
|
if (!message.duration.isZero()) {
|
|
338
338
|
writer.uint32(32).uint64(message.duration);
|
|
339
339
|
}
|
|
340
|
+
for (const v of message.rewardDebt) {
|
|
341
|
+
coin_1.DecCoin.encode(v, writer.uint32(42).fork()).ldelim();
|
|
342
|
+
}
|
|
340
343
|
return writer;
|
|
341
344
|
},
|
|
342
345
|
decode(input, length) {
|
|
343
346
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
344
347
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
345
348
|
const message = Object.assign({}, baseCommitment);
|
|
349
|
+
message.rewardDebt = [];
|
|
346
350
|
while (reader.pos < end) {
|
|
347
351
|
const tag = reader.uint32();
|
|
348
352
|
switch (tag >>> 3) {
|
|
@@ -358,6 +362,9 @@ exports.Commitment = {
|
|
|
358
362
|
case 4:
|
|
359
363
|
message.duration = reader.uint64();
|
|
360
364
|
break;
|
|
365
|
+
case 5:
|
|
366
|
+
message.rewardDebt.push(coin_1.DecCoin.decode(reader, reader.uint32()));
|
|
367
|
+
break;
|
|
361
368
|
default:
|
|
362
369
|
reader.skipType(tag & 7);
|
|
363
370
|
break;
|
|
@@ -366,6 +373,7 @@ exports.Commitment = {
|
|
|
366
373
|
return message;
|
|
367
374
|
},
|
|
368
375
|
fromJSON(object) {
|
|
376
|
+
var _a;
|
|
369
377
|
const message = Object.assign({}, baseCommitment);
|
|
370
378
|
message.poolId =
|
|
371
379
|
object.poolId !== undefined && object.poolId !== null
|
|
@@ -383,6 +391,7 @@ exports.Commitment = {
|
|
|
383
391
|
object.duration !== undefined && object.duration !== null
|
|
384
392
|
? long_1.default.fromString(object.duration)
|
|
385
393
|
: long_1.default.UZERO;
|
|
394
|
+
message.rewardDebt = ((_a = object.rewardDebt) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.DecCoin.fromJSON(e));
|
|
386
395
|
return message;
|
|
387
396
|
},
|
|
388
397
|
toJSON(message) {
|
|
@@ -397,10 +406,16 @@ exports.Commitment = {
|
|
|
397
406
|
(obj.startTime = message.startTime.toISOString());
|
|
398
407
|
message.duration !== undefined &&
|
|
399
408
|
(obj.duration = (message.duration || long_1.default.UZERO).toString());
|
|
409
|
+
if (message.rewardDebt) {
|
|
410
|
+
obj.rewardDebt = message.rewardDebt.map((e) => e ? coin_1.DecCoin.toJSON(e) : undefined);
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
obj.rewardDebt = [];
|
|
414
|
+
}
|
|
400
415
|
return obj;
|
|
401
416
|
},
|
|
402
417
|
fromPartial(object) {
|
|
403
|
-
var _a;
|
|
418
|
+
var _a, _b;
|
|
404
419
|
const message = Object.assign({}, baseCommitment);
|
|
405
420
|
message.poolId =
|
|
406
421
|
object.poolId !== undefined && object.poolId !== null
|
|
@@ -415,6 +430,7 @@ exports.Commitment = {
|
|
|
415
430
|
object.duration !== undefined && object.duration !== null
|
|
416
431
|
? long_1.default.fromValue(object.duration)
|
|
417
432
|
: long_1.default.UZERO;
|
|
433
|
+
message.rewardDebt = ((_b = object.rewardDebt) !== null && _b !== void 0 ? _b : []).map((e) => coin_1.DecCoin.fromPartial(e));
|
|
418
434
|
return message;
|
|
419
435
|
},
|
|
420
436
|
};
|
|
@@ -814,29 +830,78 @@ exports.RewardHistory = {
|
|
|
814
830
|
return message;
|
|
815
831
|
},
|
|
816
832
|
};
|
|
817
|
-
const
|
|
818
|
-
exports.
|
|
833
|
+
const baseAccumulatedRewards = {};
|
|
834
|
+
exports.AccumulatedRewards = {
|
|
819
835
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
820
|
-
|
|
821
|
-
writer.uint32(
|
|
836
|
+
for (const v of message.rewardPerCommitmentShare) {
|
|
837
|
+
coin_1.DecCoin.encode(v, writer.uint32(10).fork()).ldelim();
|
|
822
838
|
}
|
|
823
|
-
|
|
824
|
-
|
|
839
|
+
return writer;
|
|
840
|
+
},
|
|
841
|
+
decode(input, length) {
|
|
842
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
843
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
844
|
+
const message = Object.assign({}, baseAccumulatedRewards);
|
|
845
|
+
message.rewardPerCommitmentShare = [];
|
|
846
|
+
while (reader.pos < end) {
|
|
847
|
+
const tag = reader.uint32();
|
|
848
|
+
switch (tag >>> 3) {
|
|
849
|
+
case 1:
|
|
850
|
+
message.rewardPerCommitmentShare.push(coin_1.DecCoin.decode(reader, reader.uint32()));
|
|
851
|
+
break;
|
|
852
|
+
default:
|
|
853
|
+
reader.skipType(tag & 7);
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
return message;
|
|
858
|
+
},
|
|
859
|
+
fromJSON(object) {
|
|
860
|
+
var _a;
|
|
861
|
+
const message = Object.assign({}, baseAccumulatedRewards);
|
|
862
|
+
message.rewardPerCommitmentShare = ((_a = object.rewardPerCommitmentShare) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.DecCoin.fromJSON(e));
|
|
863
|
+
return message;
|
|
864
|
+
},
|
|
865
|
+
toJSON(message) {
|
|
866
|
+
const obj = {};
|
|
867
|
+
if (message.rewardPerCommitmentShare) {
|
|
868
|
+
obj.rewardPerCommitmentShare = message.rewardPerCommitmentShare.map((e) => e ? coin_1.DecCoin.toJSON(e) : undefined);
|
|
869
|
+
}
|
|
870
|
+
else {
|
|
871
|
+
obj.rewardPerCommitmentShare = [];
|
|
872
|
+
}
|
|
873
|
+
return obj;
|
|
874
|
+
},
|
|
875
|
+
fromPartial(object) {
|
|
876
|
+
var _a;
|
|
877
|
+
const message = Object.assign({}, baseAccumulatedRewards);
|
|
878
|
+
message.rewardPerCommitmentShare = ((_a = object.rewardPerCommitmentShare) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.DecCoin.fromPartial(e));
|
|
879
|
+
return message;
|
|
880
|
+
},
|
|
881
|
+
};
|
|
882
|
+
const baseAccumulatedRewardsRecord = { poolId: long_1.default.UZERO };
|
|
883
|
+
exports.AccumulatedRewardsRecord = {
|
|
884
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
885
|
+
if (!message.poolId.isZero()) {
|
|
886
|
+
writer.uint32(8).uint64(message.poolId);
|
|
887
|
+
}
|
|
888
|
+
if (message.accumulatedRewards !== undefined) {
|
|
889
|
+
exports.AccumulatedRewards.encode(message.accumulatedRewards, writer.uint32(18).fork()).ldelim();
|
|
825
890
|
}
|
|
826
891
|
return writer;
|
|
827
892
|
},
|
|
828
893
|
decode(input, length) {
|
|
829
894
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
830
895
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
831
|
-
const message = Object.assign({},
|
|
896
|
+
const message = Object.assign({}, baseAccumulatedRewardsRecord);
|
|
832
897
|
while (reader.pos < end) {
|
|
833
898
|
const tag = reader.uint32();
|
|
834
899
|
switch (tag >>> 3) {
|
|
835
900
|
case 1:
|
|
836
|
-
message.
|
|
901
|
+
message.poolId = reader.uint64();
|
|
837
902
|
break;
|
|
838
903
|
case 2:
|
|
839
|
-
message.
|
|
904
|
+
message.accumulatedRewards = exports.AccumulatedRewards.decode(reader, reader.uint32());
|
|
840
905
|
break;
|
|
841
906
|
default:
|
|
842
907
|
reader.skipType(tag & 7);
|
|
@@ -846,36 +911,38 @@ exports.RewardHistoryRecord = {
|
|
|
846
911
|
return message;
|
|
847
912
|
},
|
|
848
913
|
fromJSON(object) {
|
|
849
|
-
const message = Object.assign({},
|
|
850
|
-
message.
|
|
851
|
-
object.
|
|
852
|
-
? long_1.default.fromString(object.
|
|
914
|
+
const message = Object.assign({}, baseAccumulatedRewardsRecord);
|
|
915
|
+
message.poolId =
|
|
916
|
+
object.poolId !== undefined && object.poolId !== null
|
|
917
|
+
? long_1.default.fromString(object.poolId)
|
|
853
918
|
: long_1.default.UZERO;
|
|
854
|
-
message.
|
|
855
|
-
object.
|
|
856
|
-
|
|
919
|
+
message.accumulatedRewards =
|
|
920
|
+
object.accumulatedRewards !== undefined &&
|
|
921
|
+
object.accumulatedRewards !== null
|
|
922
|
+
? exports.AccumulatedRewards.fromJSON(object.accumulatedRewards)
|
|
857
923
|
: undefined;
|
|
858
924
|
return message;
|
|
859
925
|
},
|
|
860
926
|
toJSON(message) {
|
|
861
927
|
const obj = {};
|
|
862
|
-
message.
|
|
863
|
-
(obj.
|
|
864
|
-
message.
|
|
865
|
-
(obj.
|
|
866
|
-
? exports.
|
|
928
|
+
message.poolId !== undefined &&
|
|
929
|
+
(obj.poolId = (message.poolId || long_1.default.UZERO).toString());
|
|
930
|
+
message.accumulatedRewards !== undefined &&
|
|
931
|
+
(obj.accumulatedRewards = message.accumulatedRewards
|
|
932
|
+
? exports.AccumulatedRewards.toJSON(message.accumulatedRewards)
|
|
867
933
|
: undefined);
|
|
868
934
|
return obj;
|
|
869
935
|
},
|
|
870
936
|
fromPartial(object) {
|
|
871
|
-
const message = Object.assign({},
|
|
872
|
-
message.
|
|
873
|
-
object.
|
|
874
|
-
? long_1.default.fromValue(object.
|
|
937
|
+
const message = Object.assign({}, baseAccumulatedRewardsRecord);
|
|
938
|
+
message.poolId =
|
|
939
|
+
object.poolId !== undefined && object.poolId !== null
|
|
940
|
+
? long_1.default.fromValue(object.poolId)
|
|
875
941
|
: long_1.default.UZERO;
|
|
876
|
-
message.
|
|
877
|
-
object.
|
|
878
|
-
|
|
942
|
+
message.accumulatedRewards =
|
|
943
|
+
object.accumulatedRewards !== undefined &&
|
|
944
|
+
object.accumulatedRewards !== null
|
|
945
|
+
? exports.AccumulatedRewards.fromPartial(object.accumulatedRewards)
|
|
879
946
|
: undefined;
|
|
880
947
|
return message;
|
|
881
948
|
},
|
|
@@ -1058,87 +1125,6 @@ exports.CommitmentExpiriesRecord = {
|
|
|
1058
1125
|
return message;
|
|
1059
1126
|
},
|
|
1060
1127
|
};
|
|
1061
|
-
const baseLastClaimRecord = {
|
|
1062
|
-
address: "",
|
|
1063
|
-
poolId: long_1.default.UZERO,
|
|
1064
|
-
height: long_1.default.UZERO,
|
|
1065
|
-
};
|
|
1066
|
-
exports.LastClaimRecord = {
|
|
1067
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1068
|
-
if (message.address !== "") {
|
|
1069
|
-
writer.uint32(10).string(message.address);
|
|
1070
|
-
}
|
|
1071
|
-
if (!message.poolId.isZero()) {
|
|
1072
|
-
writer.uint32(16).uint64(message.poolId);
|
|
1073
|
-
}
|
|
1074
|
-
if (!message.height.isZero()) {
|
|
1075
|
-
writer.uint32(24).uint64(message.height);
|
|
1076
|
-
}
|
|
1077
|
-
return writer;
|
|
1078
|
-
},
|
|
1079
|
-
decode(input, length) {
|
|
1080
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1081
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1082
|
-
const message = Object.assign({}, baseLastClaimRecord);
|
|
1083
|
-
while (reader.pos < end) {
|
|
1084
|
-
const tag = reader.uint32();
|
|
1085
|
-
switch (tag >>> 3) {
|
|
1086
|
-
case 1:
|
|
1087
|
-
message.address = reader.string();
|
|
1088
|
-
break;
|
|
1089
|
-
case 2:
|
|
1090
|
-
message.poolId = reader.uint64();
|
|
1091
|
-
break;
|
|
1092
|
-
case 3:
|
|
1093
|
-
message.height = reader.uint64();
|
|
1094
|
-
break;
|
|
1095
|
-
default:
|
|
1096
|
-
reader.skipType(tag & 7);
|
|
1097
|
-
break;
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
return message;
|
|
1101
|
-
},
|
|
1102
|
-
fromJSON(object) {
|
|
1103
|
-
const message = Object.assign({}, baseLastClaimRecord);
|
|
1104
|
-
message.address =
|
|
1105
|
-
object.address !== undefined && object.address !== null
|
|
1106
|
-
? String(object.address)
|
|
1107
|
-
: "";
|
|
1108
|
-
message.poolId =
|
|
1109
|
-
object.poolId !== undefined && object.poolId !== null
|
|
1110
|
-
? long_1.default.fromString(object.poolId)
|
|
1111
|
-
: long_1.default.UZERO;
|
|
1112
|
-
message.height =
|
|
1113
|
-
object.height !== undefined && object.height !== null
|
|
1114
|
-
? long_1.default.fromString(object.height)
|
|
1115
|
-
: long_1.default.UZERO;
|
|
1116
|
-
return message;
|
|
1117
|
-
},
|
|
1118
|
-
toJSON(message) {
|
|
1119
|
-
const obj = {};
|
|
1120
|
-
message.address !== undefined && (obj.address = message.address);
|
|
1121
|
-
message.poolId !== undefined &&
|
|
1122
|
-
(obj.poolId = (message.poolId || long_1.default.UZERO).toString());
|
|
1123
|
-
message.height !== undefined &&
|
|
1124
|
-
(obj.height = (message.height || long_1.default.UZERO).toString());
|
|
1125
|
-
return obj;
|
|
1126
|
-
},
|
|
1127
|
-
fromPartial(object) {
|
|
1128
|
-
var _a;
|
|
1129
|
-
const message = Object.assign({}, baseLastClaimRecord);
|
|
1130
|
-
message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
|
|
1131
|
-
message.poolId =
|
|
1132
|
-
object.poolId !== undefined && object.poolId !== null
|
|
1133
|
-
? long_1.default.fromValue(object.poolId)
|
|
1134
|
-
: long_1.default.UZERO;
|
|
1135
|
-
message.height =
|
|
1136
|
-
object.height !== undefined && object.height !== null
|
|
1137
|
-
? long_1.default.fromValue(object.height)
|
|
1138
|
-
: long_1.default.UZERO;
|
|
1139
|
-
return message;
|
|
1140
|
-
},
|
|
1141
|
-
};
|
|
1142
1128
|
const baseAllocatedRewards = {};
|
|
1143
1129
|
exports.AllocatedRewards = {
|
|
1144
1130
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
@@ -18,21 +18,21 @@ export interface QueryAllOracleResponse {
|
|
|
18
18
|
oracles: Oracle[];
|
|
19
19
|
pagination?: PageResponse;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface QueryResultsRequest {
|
|
22
22
|
oracleId: string;
|
|
23
23
|
pagination?: PageRequest;
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
25
|
+
export interface QueryResultsResponse {
|
|
26
26
|
results: Result[];
|
|
27
27
|
pagination?: PageResponse;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
29
|
+
export interface QueryVotesRequest {
|
|
30
30
|
oracleId: string;
|
|
31
31
|
timestamp: Long;
|
|
32
32
|
voter: string;
|
|
33
33
|
pagination?: PageRequest;
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
35
|
+
export interface QueryVotesResponse {
|
|
36
36
|
votes: Vote[];
|
|
37
37
|
pagination?: PageResponse;
|
|
38
38
|
}
|
|
@@ -127,33 +127,33 @@ export declare const QueryAllOracleResponse: {
|
|
|
127
127
|
toJSON(message: QueryAllOracleResponse): unknown;
|
|
128
128
|
fromPartial(object: DeepPartial<QueryAllOracleResponse>): QueryAllOracleResponse;
|
|
129
129
|
};
|
|
130
|
-
export declare const
|
|
131
|
-
encode(message:
|
|
132
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined):
|
|
133
|
-
fromJSON(object: any):
|
|
134
|
-
toJSON(message:
|
|
135
|
-
fromPartial(object: DeepPartial<
|
|
130
|
+
export declare const QueryResultsRequest: {
|
|
131
|
+
encode(message: QueryResultsRequest, writer?: _m0.Writer): _m0.Writer;
|
|
132
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryResultsRequest;
|
|
133
|
+
fromJSON(object: any): QueryResultsRequest;
|
|
134
|
+
toJSON(message: QueryResultsRequest): unknown;
|
|
135
|
+
fromPartial(object: DeepPartial<QueryResultsRequest>): QueryResultsRequest;
|
|
136
136
|
};
|
|
137
|
-
export declare const
|
|
138
|
-
encode(message:
|
|
139
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined):
|
|
140
|
-
fromJSON(object: any):
|
|
141
|
-
toJSON(message:
|
|
142
|
-
fromPartial(object: DeepPartial<
|
|
137
|
+
export declare const QueryResultsResponse: {
|
|
138
|
+
encode(message: QueryResultsResponse, writer?: _m0.Writer): _m0.Writer;
|
|
139
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryResultsResponse;
|
|
140
|
+
fromJSON(object: any): QueryResultsResponse;
|
|
141
|
+
toJSON(message: QueryResultsResponse): unknown;
|
|
142
|
+
fromPartial(object: DeepPartial<QueryResultsResponse>): QueryResultsResponse;
|
|
143
143
|
};
|
|
144
|
-
export declare const
|
|
145
|
-
encode(message:
|
|
146
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined):
|
|
147
|
-
fromJSON(object: any):
|
|
148
|
-
toJSON(message:
|
|
149
|
-
fromPartial(object: DeepPartial<
|
|
144
|
+
export declare const QueryVotesRequest: {
|
|
145
|
+
encode(message: QueryVotesRequest, writer?: _m0.Writer): _m0.Writer;
|
|
146
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryVotesRequest;
|
|
147
|
+
fromJSON(object: any): QueryVotesRequest;
|
|
148
|
+
toJSON(message: QueryVotesRequest): unknown;
|
|
149
|
+
fromPartial(object: DeepPartial<QueryVotesRequest>): QueryVotesRequest;
|
|
150
150
|
};
|
|
151
|
-
export declare const
|
|
152
|
-
encode(message:
|
|
153
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined):
|
|
154
|
-
fromJSON(object: any):
|
|
155
|
-
toJSON(message:
|
|
156
|
-
fromPartial(object: DeepPartial<
|
|
151
|
+
export declare const QueryVotesResponse: {
|
|
152
|
+
encode(message: QueryVotesResponse, writer?: _m0.Writer): _m0.Writer;
|
|
153
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryVotesResponse;
|
|
154
|
+
fromJSON(object: any): QueryVotesResponse;
|
|
155
|
+
toJSON(message: QueryVotesResponse): unknown;
|
|
156
|
+
fromPartial(object: DeepPartial<QueryVotesResponse>): QueryVotesResponse;
|
|
157
157
|
};
|
|
158
158
|
export declare const QueryVoterPowerRequest: {
|
|
159
159
|
encode(message: QueryVoterPowerRequest, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -287,10 +287,12 @@ export interface Query {
|
|
|
287
287
|
Oracle(request: QueryOracleRequest): Promise<QueryOracleResponse>;
|
|
288
288
|
/** Get details for all oracles */
|
|
289
289
|
OracleAll(request: QueryAllOracleRequest): Promise<QueryAllOracleResponse>;
|
|
290
|
-
/** Get all oracle
|
|
291
|
-
|
|
292
|
-
/** Get all
|
|
293
|
-
|
|
290
|
+
/** Get results for all oracles, or a specific oracle */
|
|
291
|
+
Results(request: QueryResultsRequest): Promise<QueryResultsResponse>;
|
|
292
|
+
/** Get latest result for all oracles */
|
|
293
|
+
ResultsLatest(request: QueryResultsRequest): Promise<QueryResultsResponse>;
|
|
294
|
+
/** Get votes for all oracles, or a specific oracle */
|
|
295
|
+
Votes(request: QueryVotesRequest): Promise<QueryVotesResponse>;
|
|
294
296
|
/** Get voting power for an address */
|
|
295
297
|
VoterPower(request: QueryVoterPowerRequest): Promise<QueryVoterPowerResponse>;
|
|
296
298
|
/** Get all slash counters */
|
|
@@ -311,8 +313,9 @@ export declare class QueryClientImpl implements Query {
|
|
|
311
313
|
constructor(rpc: Rpc);
|
|
312
314
|
Oracle(request: QueryOracleRequest): Promise<QueryOracleResponse>;
|
|
313
315
|
OracleAll(request: QueryAllOracleRequest): Promise<QueryAllOracleResponse>;
|
|
314
|
-
|
|
315
|
-
|
|
316
|
+
Results(request: QueryResultsRequest): Promise<QueryResultsResponse>;
|
|
317
|
+
ResultsLatest(request: QueryResultsRequest): Promise<QueryResultsResponse>;
|
|
318
|
+
Votes(request: QueryVotesRequest): Promise<QueryVotesResponse>;
|
|
316
319
|
VoterPower(request: QueryVoterPowerRequest): Promise<QueryVoterPowerResponse>;
|
|
317
320
|
SlashCounterAll(request: QueryAllSlashCounterRequest): Promise<QueryAllSlashCounterResponse>;
|
|
318
321
|
SlashCounter(request: QuerySlashCounterRequest): Promise<QuerySlashCounterResponse>;
|
|
@@ -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.QueryClientImpl = exports.QueryContractParamsResponse = exports.QueryContractParamsRequest = exports.QueryContractAllResponse = exports.QueryContractAllRequest = exports.QueryContractAddressResponse = exports.QueryContractAddressRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryOracleVotesWindowResponse = exports.QueryOracleVotesWindowRequest = exports.QueryAllOracleVotesWindowResponse = exports.QueryAllOracleVotesWindowRequest = exports.QuerySlashCounterResponse = exports.QuerySlashCounterRequest = exports.QueryAllSlashCounterResponse = exports.QueryAllSlashCounterRequest = exports.QueryVoterPowerResponse = exports.QueryVoterPowerRequest = exports.
|
|
6
|
+
exports.QueryClientImpl = exports.QueryContractParamsResponse = exports.QueryContractParamsRequest = exports.QueryContractAllResponse = exports.QueryContractAllRequest = exports.QueryContractAddressResponse = exports.QueryContractAddressRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryOracleVotesWindowResponse = exports.QueryOracleVotesWindowRequest = exports.QueryAllOracleVotesWindowResponse = exports.QueryAllOracleVotesWindowRequest = exports.QuerySlashCounterResponse = exports.QuerySlashCounterRequest = exports.QueryAllSlashCounterResponse = exports.QueryAllSlashCounterRequest = exports.QueryVoterPowerResponse = exports.QueryVoterPowerRequest = exports.QueryVotesResponse = exports.QueryVotesRequest = exports.QueryResultsResponse = exports.QueryResultsRequest = exports.QueryAllOracleResponse = exports.QueryAllOracleRequest = exports.QueryOracleResponse = exports.QueryOracleRequest = 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"));
|
|
@@ -219,8 +219,8 @@ exports.QueryAllOracleResponse = {
|
|
|
219
219
|
return message;
|
|
220
220
|
},
|
|
221
221
|
};
|
|
222
|
-
const
|
|
223
|
-
exports.
|
|
222
|
+
const baseQueryResultsRequest = { oracleId: "" };
|
|
223
|
+
exports.QueryResultsRequest = {
|
|
224
224
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
225
225
|
if (message.oracleId !== "") {
|
|
226
226
|
writer.uint32(10).string(message.oracleId);
|
|
@@ -233,7 +233,7 @@ exports.QueryAllResultRequest = {
|
|
|
233
233
|
decode(input, length) {
|
|
234
234
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
235
235
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
236
|
-
const message = Object.assign({},
|
|
236
|
+
const message = Object.assign({}, baseQueryResultsRequest);
|
|
237
237
|
while (reader.pos < end) {
|
|
238
238
|
const tag = reader.uint32();
|
|
239
239
|
switch (tag >>> 3) {
|
|
@@ -251,7 +251,7 @@ exports.QueryAllResultRequest = {
|
|
|
251
251
|
return message;
|
|
252
252
|
},
|
|
253
253
|
fromJSON(object) {
|
|
254
|
-
const message = Object.assign({},
|
|
254
|
+
const message = Object.assign({}, baseQueryResultsRequest);
|
|
255
255
|
message.oracleId =
|
|
256
256
|
object.oracleId !== undefined && object.oracleId !== null
|
|
257
257
|
? String(object.oracleId)
|
|
@@ -273,7 +273,7 @@ exports.QueryAllResultRequest = {
|
|
|
273
273
|
},
|
|
274
274
|
fromPartial(object) {
|
|
275
275
|
var _a;
|
|
276
|
-
const message = Object.assign({},
|
|
276
|
+
const message = Object.assign({}, baseQueryResultsRequest);
|
|
277
277
|
message.oracleId = (_a = object.oracleId) !== null && _a !== void 0 ? _a : "";
|
|
278
278
|
message.pagination =
|
|
279
279
|
object.pagination !== undefined && object.pagination !== null
|
|
@@ -282,8 +282,8 @@ exports.QueryAllResultRequest = {
|
|
|
282
282
|
return message;
|
|
283
283
|
},
|
|
284
284
|
};
|
|
285
|
-
const
|
|
286
|
-
exports.
|
|
285
|
+
const baseQueryResultsResponse = {};
|
|
286
|
+
exports.QueryResultsResponse = {
|
|
287
287
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
288
288
|
for (const v of message.results) {
|
|
289
289
|
oracle_1.Result.encode(v, writer.uint32(10).fork()).ldelim();
|
|
@@ -296,7 +296,7 @@ exports.QueryAllResultResponse = {
|
|
|
296
296
|
decode(input, length) {
|
|
297
297
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
298
298
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
299
|
-
const message = Object.assign({},
|
|
299
|
+
const message = Object.assign({}, baseQueryResultsResponse);
|
|
300
300
|
message.results = [];
|
|
301
301
|
while (reader.pos < end) {
|
|
302
302
|
const tag = reader.uint32();
|
|
@@ -316,7 +316,7 @@ exports.QueryAllResultResponse = {
|
|
|
316
316
|
},
|
|
317
317
|
fromJSON(object) {
|
|
318
318
|
var _a;
|
|
319
|
-
const message = Object.assign({},
|
|
319
|
+
const message = Object.assign({}, baseQueryResultsResponse);
|
|
320
320
|
message.results = ((_a = object.results) !== null && _a !== void 0 ? _a : []).map((e) => oracle_1.Result.fromJSON(e));
|
|
321
321
|
message.pagination =
|
|
322
322
|
object.pagination !== undefined && object.pagination !== null
|
|
@@ -340,7 +340,7 @@ exports.QueryAllResultResponse = {
|
|
|
340
340
|
},
|
|
341
341
|
fromPartial(object) {
|
|
342
342
|
var _a;
|
|
343
|
-
const message = Object.assign({},
|
|
343
|
+
const message = Object.assign({}, baseQueryResultsResponse);
|
|
344
344
|
message.results = ((_a = object.results) !== null && _a !== void 0 ? _a : []).map((e) => oracle_1.Result.fromPartial(e));
|
|
345
345
|
message.pagination =
|
|
346
346
|
object.pagination !== undefined && object.pagination !== null
|
|
@@ -349,12 +349,12 @@ exports.QueryAllResultResponse = {
|
|
|
349
349
|
return message;
|
|
350
350
|
},
|
|
351
351
|
};
|
|
352
|
-
const
|
|
352
|
+
const baseQueryVotesRequest = {
|
|
353
353
|
oracleId: "",
|
|
354
354
|
timestamp: long_1.default.ZERO,
|
|
355
355
|
voter: "",
|
|
356
356
|
};
|
|
357
|
-
exports.
|
|
357
|
+
exports.QueryVotesRequest = {
|
|
358
358
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
359
359
|
if (message.oracleId !== "") {
|
|
360
360
|
writer.uint32(10).string(message.oracleId);
|
|
@@ -373,7 +373,7 @@ exports.QueryAllVoteRequest = {
|
|
|
373
373
|
decode(input, length) {
|
|
374
374
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
375
375
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
376
|
-
const message = Object.assign({},
|
|
376
|
+
const message = Object.assign({}, baseQueryVotesRequest);
|
|
377
377
|
while (reader.pos < end) {
|
|
378
378
|
const tag = reader.uint32();
|
|
379
379
|
switch (tag >>> 3) {
|
|
@@ -397,7 +397,7 @@ exports.QueryAllVoteRequest = {
|
|
|
397
397
|
return message;
|
|
398
398
|
},
|
|
399
399
|
fromJSON(object) {
|
|
400
|
-
const message = Object.assign({},
|
|
400
|
+
const message = Object.assign({}, baseQueryVotesRequest);
|
|
401
401
|
message.oracleId =
|
|
402
402
|
object.oracleId !== undefined && object.oracleId !== null
|
|
403
403
|
? String(object.oracleId)
|
|
@@ -430,7 +430,7 @@ exports.QueryAllVoteRequest = {
|
|
|
430
430
|
},
|
|
431
431
|
fromPartial(object) {
|
|
432
432
|
var _a, _b;
|
|
433
|
-
const message = Object.assign({},
|
|
433
|
+
const message = Object.assign({}, baseQueryVotesRequest);
|
|
434
434
|
message.oracleId = (_a = object.oracleId) !== null && _a !== void 0 ? _a : "";
|
|
435
435
|
message.timestamp =
|
|
436
436
|
object.timestamp !== undefined && object.timestamp !== null
|
|
@@ -444,8 +444,8 @@ exports.QueryAllVoteRequest = {
|
|
|
444
444
|
return message;
|
|
445
445
|
},
|
|
446
446
|
};
|
|
447
|
-
const
|
|
448
|
-
exports.
|
|
447
|
+
const baseQueryVotesResponse = {};
|
|
448
|
+
exports.QueryVotesResponse = {
|
|
449
449
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
450
450
|
for (const v of message.votes) {
|
|
451
451
|
oracle_1.Vote.encode(v, writer.uint32(10).fork()).ldelim();
|
|
@@ -458,7 +458,7 @@ exports.QueryAllVoteResponse = {
|
|
|
458
458
|
decode(input, length) {
|
|
459
459
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
460
460
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
461
|
-
const message = Object.assign({},
|
|
461
|
+
const message = Object.assign({}, baseQueryVotesResponse);
|
|
462
462
|
message.votes = [];
|
|
463
463
|
while (reader.pos < end) {
|
|
464
464
|
const tag = reader.uint32();
|
|
@@ -478,7 +478,7 @@ exports.QueryAllVoteResponse = {
|
|
|
478
478
|
},
|
|
479
479
|
fromJSON(object) {
|
|
480
480
|
var _a;
|
|
481
|
-
const message = Object.assign({},
|
|
481
|
+
const message = Object.assign({}, baseQueryVotesResponse);
|
|
482
482
|
message.votes = ((_a = object.votes) !== null && _a !== void 0 ? _a : []).map((e) => oracle_1.Vote.fromJSON(e));
|
|
483
483
|
message.pagination =
|
|
484
484
|
object.pagination !== undefined && object.pagination !== null
|
|
@@ -502,7 +502,7 @@ exports.QueryAllVoteResponse = {
|
|
|
502
502
|
},
|
|
503
503
|
fromPartial(object) {
|
|
504
504
|
var _a;
|
|
505
|
-
const message = Object.assign({},
|
|
505
|
+
const message = Object.assign({}, baseQueryVotesResponse);
|
|
506
506
|
message.votes = ((_a = object.votes) !== null && _a !== void 0 ? _a : []).map((e) => oracle_1.Vote.fromPartial(e));
|
|
507
507
|
message.pagination =
|
|
508
508
|
object.pagination !== undefined && object.pagination !== null
|
|
@@ -1460,8 +1460,9 @@ class QueryClientImpl {
|
|
|
1460
1460
|
this.rpc = rpc;
|
|
1461
1461
|
this.Oracle = this.Oracle.bind(this);
|
|
1462
1462
|
this.OracleAll = this.OracleAll.bind(this);
|
|
1463
|
-
this.
|
|
1464
|
-
this.
|
|
1463
|
+
this.Results = this.Results.bind(this);
|
|
1464
|
+
this.ResultsLatest = this.ResultsLatest.bind(this);
|
|
1465
|
+
this.Votes = this.Votes.bind(this);
|
|
1465
1466
|
this.VoterPower = this.VoterPower.bind(this);
|
|
1466
1467
|
this.SlashCounterAll = this.SlashCounterAll.bind(this);
|
|
1467
1468
|
this.SlashCounter = this.SlashCounter.bind(this);
|
|
@@ -1482,15 +1483,20 @@ class QueryClientImpl {
|
|
|
1482
1483
|
const promise = this.rpc.request("Switcheo.carbon.oracle.Query", "OracleAll", data);
|
|
1483
1484
|
return promise.then((data) => exports.QueryAllOracleResponse.decode(new minimal_1.default.Reader(data)));
|
|
1484
1485
|
}
|
|
1485
|
-
|
|
1486
|
-
const data = exports.
|
|
1487
|
-
const promise = this.rpc.request("Switcheo.carbon.oracle.Query", "
|
|
1488
|
-
return promise.then((data) => exports.
|
|
1486
|
+
Results(request) {
|
|
1487
|
+
const data = exports.QueryResultsRequest.encode(request).finish();
|
|
1488
|
+
const promise = this.rpc.request("Switcheo.carbon.oracle.Query", "Results", data);
|
|
1489
|
+
return promise.then((data) => exports.QueryResultsResponse.decode(new minimal_1.default.Reader(data)));
|
|
1489
1490
|
}
|
|
1490
|
-
|
|
1491
|
-
const data = exports.
|
|
1492
|
-
const promise = this.rpc.request("Switcheo.carbon.oracle.Query", "
|
|
1493
|
-
return promise.then((data) => exports.
|
|
1491
|
+
ResultsLatest(request) {
|
|
1492
|
+
const data = exports.QueryResultsRequest.encode(request).finish();
|
|
1493
|
+
const promise = this.rpc.request("Switcheo.carbon.oracle.Query", "ResultsLatest", data);
|
|
1494
|
+
return promise.then((data) => exports.QueryResultsResponse.decode(new minimal_1.default.Reader(data)));
|
|
1495
|
+
}
|
|
1496
|
+
Votes(request) {
|
|
1497
|
+
const data = exports.QueryVotesRequest.encode(request).finish();
|
|
1498
|
+
const promise = this.rpc.request("Switcheo.carbon.oracle.Query", "Votes", data);
|
|
1499
|
+
return promise.then((data) => exports.QueryVotesResponse.decode(new minimal_1.default.Reader(data)));
|
|
1494
1500
|
}
|
|
1495
1501
|
VoterPower(request) {
|
|
1496
1502
|
const data = exports.QueryVoterPowerRequest.encode(request).finish();
|