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.QueryClientImpl = exports.QueryAllPoolRouteAddressResponse_AddressesEntry = exports.QueryAllPoolRouteAddressResponse = exports.QueryAllPoolRouteAddressRequest = exports.QueryAllPoolRouteResponse = exports.QueryAllPoolRouteRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryClaimableRewardsResponse = exports.QueryClaimableRewardsRequest = exports.QueryAllTotalCommitmentResponse = exports.QueryAllTotalCommitmentRequest = exports.QueryTotalCommitmentResponse = exports.QueryTotalCommitmentRequest = exports.QueryRewardCurveResponse = exports.QueryRewardCurveRequest = exports.QueryCommitmentCurveResponse = exports.QueryCommitmentCurveRequest = exports.
|
|
6
|
+
exports.QueryClientImpl = exports.QueryAllPoolRouteAddressResponse_AddressesEntry = exports.QueryAllPoolRouteAddressResponse = exports.QueryAllPoolRouteAddressRequest = exports.QueryAllPoolRouteResponse = exports.QueryAllPoolRouteRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryClaimableRewardsResponse = exports.QueryClaimableRewardsRequest = exports.QueryAllTotalCommitmentResponse = exports.QueryAllTotalCommitmentRequest = exports.QueryTotalCommitmentResponse = exports.QueryTotalCommitmentRequest = exports.QueryRewardCurveResponse = exports.QueryRewardCurveRequest = exports.QueryCommitmentCurveResponse = exports.QueryCommitmentCurveRequest = exports.QueryAllCommitmentResponse = exports.QueryAllCommitmentRequest = exports.QueryCommitmentResponse = exports.QueryCommitmentRequest = exports.ExtendedPool = exports.QueryAllPoolAddressResponse_AddressesEntry = exports.QueryAllPoolAddressResponse = exports.QueryAllPoolAddressRequest = exports.QueryAllPoolResponse = exports.QueryAllPoolRequest = exports.QueryGetPoolResponse = exports.QueryGetPoolRequest = 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"));
|
|
@@ -412,85 +412,6 @@ exports.QueryAllPoolAddressResponse_AddressesEntry = {
|
|
|
412
412
|
return message;
|
|
413
413
|
},
|
|
414
414
|
};
|
|
415
|
-
const baseQueryRewardHistoryRequest = {
|
|
416
|
-
poolId: "",
|
|
417
|
-
startBlockHeight: "",
|
|
418
|
-
};
|
|
419
|
-
exports.QueryRewardHistoryRequest = {
|
|
420
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
421
|
-
if (message.poolId !== "") {
|
|
422
|
-
writer.uint32(10).string(message.poolId);
|
|
423
|
-
}
|
|
424
|
-
if (message.startBlockHeight !== "") {
|
|
425
|
-
writer.uint32(18).string(message.startBlockHeight);
|
|
426
|
-
}
|
|
427
|
-
if (message.pagination !== undefined) {
|
|
428
|
-
pagination_1.PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim();
|
|
429
|
-
}
|
|
430
|
-
return writer;
|
|
431
|
-
},
|
|
432
|
-
decode(input, length) {
|
|
433
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
434
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
435
|
-
const message = Object.assign({}, baseQueryRewardHistoryRequest);
|
|
436
|
-
while (reader.pos < end) {
|
|
437
|
-
const tag = reader.uint32();
|
|
438
|
-
switch (tag >>> 3) {
|
|
439
|
-
case 1:
|
|
440
|
-
message.poolId = reader.string();
|
|
441
|
-
break;
|
|
442
|
-
case 2:
|
|
443
|
-
message.startBlockHeight = reader.string();
|
|
444
|
-
break;
|
|
445
|
-
case 3:
|
|
446
|
-
message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
|
|
447
|
-
break;
|
|
448
|
-
default:
|
|
449
|
-
reader.skipType(tag & 7);
|
|
450
|
-
break;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
return message;
|
|
454
|
-
},
|
|
455
|
-
fromJSON(object) {
|
|
456
|
-
const message = Object.assign({}, baseQueryRewardHistoryRequest);
|
|
457
|
-
message.poolId =
|
|
458
|
-
object.poolId !== undefined && object.poolId !== null
|
|
459
|
-
? String(object.poolId)
|
|
460
|
-
: "";
|
|
461
|
-
message.startBlockHeight =
|
|
462
|
-
object.startBlockHeight !== undefined && object.startBlockHeight !== null
|
|
463
|
-
? String(object.startBlockHeight)
|
|
464
|
-
: "";
|
|
465
|
-
message.pagination =
|
|
466
|
-
object.pagination !== undefined && object.pagination !== null
|
|
467
|
-
? pagination_1.PageRequest.fromJSON(object.pagination)
|
|
468
|
-
: undefined;
|
|
469
|
-
return message;
|
|
470
|
-
},
|
|
471
|
-
toJSON(message) {
|
|
472
|
-
const obj = {};
|
|
473
|
-
message.poolId !== undefined && (obj.poolId = message.poolId);
|
|
474
|
-
message.startBlockHeight !== undefined &&
|
|
475
|
-
(obj.startBlockHeight = message.startBlockHeight);
|
|
476
|
-
message.pagination !== undefined &&
|
|
477
|
-
(obj.pagination = message.pagination
|
|
478
|
-
? pagination_1.PageRequest.toJSON(message.pagination)
|
|
479
|
-
: undefined);
|
|
480
|
-
return obj;
|
|
481
|
-
},
|
|
482
|
-
fromPartial(object) {
|
|
483
|
-
var _a, _b;
|
|
484
|
-
const message = Object.assign({}, baseQueryRewardHistoryRequest);
|
|
485
|
-
message.poolId = (_a = object.poolId) !== null && _a !== void 0 ? _a : "";
|
|
486
|
-
message.startBlockHeight = (_b = object.startBlockHeight) !== null && _b !== void 0 ? _b : "";
|
|
487
|
-
message.pagination =
|
|
488
|
-
object.pagination !== undefined && object.pagination !== null
|
|
489
|
-
? pagination_1.PageRequest.fromPartial(object.pagination)
|
|
490
|
-
: undefined;
|
|
491
|
-
return message;
|
|
492
|
-
},
|
|
493
|
-
};
|
|
494
415
|
const baseExtendedPool = { rewardsWeight: "", totalCommitment: "" };
|
|
495
416
|
exports.ExtendedPool = {
|
|
496
417
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
@@ -503,12 +424,16 @@ exports.ExtendedPool = {
|
|
|
503
424
|
if (message.totalCommitment !== "") {
|
|
504
425
|
writer.uint32(26).string(message.totalCommitment);
|
|
505
426
|
}
|
|
427
|
+
for (const v of message.rewardPerCommitmentShare) {
|
|
428
|
+
coin_1.DecCoin.encode(v, writer.uint32(34).fork()).ldelim();
|
|
429
|
+
}
|
|
506
430
|
return writer;
|
|
507
431
|
},
|
|
508
432
|
decode(input, length) {
|
|
509
433
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
510
434
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
511
435
|
const message = Object.assign({}, baseExtendedPool);
|
|
436
|
+
message.rewardPerCommitmentShare = [];
|
|
512
437
|
while (reader.pos < end) {
|
|
513
438
|
const tag = reader.uint32();
|
|
514
439
|
switch (tag >>> 3) {
|
|
@@ -521,6 +446,9 @@ exports.ExtendedPool = {
|
|
|
521
446
|
case 3:
|
|
522
447
|
message.totalCommitment = reader.string();
|
|
523
448
|
break;
|
|
449
|
+
case 4:
|
|
450
|
+
message.rewardPerCommitmentShare.push(coin_1.DecCoin.decode(reader, reader.uint32()));
|
|
451
|
+
break;
|
|
524
452
|
default:
|
|
525
453
|
reader.skipType(tag & 7);
|
|
526
454
|
break;
|
|
@@ -529,6 +457,7 @@ exports.ExtendedPool = {
|
|
|
529
457
|
return message;
|
|
530
458
|
},
|
|
531
459
|
fromJSON(object) {
|
|
460
|
+
var _a;
|
|
532
461
|
const message = Object.assign({}, baseExtendedPool);
|
|
533
462
|
message.pool =
|
|
534
463
|
object.pool !== undefined && object.pool !== null
|
|
@@ -542,6 +471,7 @@ exports.ExtendedPool = {
|
|
|
542
471
|
object.totalCommitment !== undefined && object.totalCommitment !== null
|
|
543
472
|
? String(object.totalCommitment)
|
|
544
473
|
: "";
|
|
474
|
+
message.rewardPerCommitmentShare = ((_a = object.rewardPerCommitmentShare) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.DecCoin.fromJSON(e));
|
|
545
475
|
return message;
|
|
546
476
|
},
|
|
547
477
|
toJSON(message) {
|
|
@@ -552,10 +482,16 @@ exports.ExtendedPool = {
|
|
|
552
482
|
(obj.rewardsWeight = message.rewardsWeight);
|
|
553
483
|
message.totalCommitment !== undefined &&
|
|
554
484
|
(obj.totalCommitment = message.totalCommitment);
|
|
485
|
+
if (message.rewardPerCommitmentShare) {
|
|
486
|
+
obj.rewardPerCommitmentShare = message.rewardPerCommitmentShare.map((e) => e ? coin_1.DecCoin.toJSON(e) : undefined);
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
obj.rewardPerCommitmentShare = [];
|
|
490
|
+
}
|
|
555
491
|
return obj;
|
|
556
492
|
},
|
|
557
493
|
fromPartial(object) {
|
|
558
|
-
var _a, _b;
|
|
494
|
+
var _a, _b, _c;
|
|
559
495
|
const message = Object.assign({}, baseExtendedPool);
|
|
560
496
|
message.pool =
|
|
561
497
|
object.pool !== undefined && object.pool !== null
|
|
@@ -563,73 +499,7 @@ exports.ExtendedPool = {
|
|
|
563
499
|
: undefined;
|
|
564
500
|
message.rewardsWeight = (_a = object.rewardsWeight) !== null && _a !== void 0 ? _a : "";
|
|
565
501
|
message.totalCommitment = (_b = object.totalCommitment) !== null && _b !== void 0 ? _b : "";
|
|
566
|
-
|
|
567
|
-
},
|
|
568
|
-
};
|
|
569
|
-
const baseQueryRewardHistoryResponse = {};
|
|
570
|
-
exports.QueryRewardHistoryResponse = {
|
|
571
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
572
|
-
for (const v of message.rewardHistories) {
|
|
573
|
-
reward_1.RewardHistoryRecord.encode(v, writer.uint32(10).fork()).ldelim();
|
|
574
|
-
}
|
|
575
|
-
if (message.pagination !== undefined) {
|
|
576
|
-
pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
|
|
577
|
-
}
|
|
578
|
-
return writer;
|
|
579
|
-
},
|
|
580
|
-
decode(input, length) {
|
|
581
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
582
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
583
|
-
const message = Object.assign({}, baseQueryRewardHistoryResponse);
|
|
584
|
-
message.rewardHistories = [];
|
|
585
|
-
while (reader.pos < end) {
|
|
586
|
-
const tag = reader.uint32();
|
|
587
|
-
switch (tag >>> 3) {
|
|
588
|
-
case 1:
|
|
589
|
-
message.rewardHistories.push(reward_1.RewardHistoryRecord.decode(reader, reader.uint32()));
|
|
590
|
-
break;
|
|
591
|
-
case 2:
|
|
592
|
-
message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
|
|
593
|
-
break;
|
|
594
|
-
default:
|
|
595
|
-
reader.skipType(tag & 7);
|
|
596
|
-
break;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
return message;
|
|
600
|
-
},
|
|
601
|
-
fromJSON(object) {
|
|
602
|
-
var _a;
|
|
603
|
-
const message = Object.assign({}, baseQueryRewardHistoryResponse);
|
|
604
|
-
message.rewardHistories = ((_a = object.rewardHistories) !== null && _a !== void 0 ? _a : []).map((e) => reward_1.RewardHistoryRecord.fromJSON(e));
|
|
605
|
-
message.pagination =
|
|
606
|
-
object.pagination !== undefined && object.pagination !== null
|
|
607
|
-
? pagination_1.PageResponse.fromJSON(object.pagination)
|
|
608
|
-
: undefined;
|
|
609
|
-
return message;
|
|
610
|
-
},
|
|
611
|
-
toJSON(message) {
|
|
612
|
-
const obj = {};
|
|
613
|
-
if (message.rewardHistories) {
|
|
614
|
-
obj.rewardHistories = message.rewardHistories.map((e) => e ? reward_1.RewardHistoryRecord.toJSON(e) : undefined);
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
obj.rewardHistories = [];
|
|
618
|
-
}
|
|
619
|
-
message.pagination !== undefined &&
|
|
620
|
-
(obj.pagination = message.pagination
|
|
621
|
-
? pagination_1.PageResponse.toJSON(message.pagination)
|
|
622
|
-
: undefined);
|
|
623
|
-
return obj;
|
|
624
|
-
},
|
|
625
|
-
fromPartial(object) {
|
|
626
|
-
var _a;
|
|
627
|
-
const message = Object.assign({}, baseQueryRewardHistoryResponse);
|
|
628
|
-
message.rewardHistories = ((_a = object.rewardHistories) !== null && _a !== void 0 ? _a : []).map((e) => reward_1.RewardHistoryRecord.fromPartial(e));
|
|
629
|
-
message.pagination =
|
|
630
|
-
object.pagination !== undefined && object.pagination !== null
|
|
631
|
-
? pagination_1.PageResponse.fromPartial(object.pagination)
|
|
632
|
-
: undefined;
|
|
502
|
+
message.rewardPerCommitmentShare = ((_c = object.rewardPerCommitmentShare) !== null && _c !== void 0 ? _c : []).map((e) => coin_1.DecCoin.fromPartial(e));
|
|
633
503
|
return message;
|
|
634
504
|
},
|
|
635
505
|
};
|
|
@@ -883,111 +753,6 @@ exports.QueryAllCommitmentResponse = {
|
|
|
883
753
|
return message;
|
|
884
754
|
},
|
|
885
755
|
};
|
|
886
|
-
const baseQueryLastClaimRequest = { poolId: "", address: "" };
|
|
887
|
-
exports.QueryLastClaimRequest = {
|
|
888
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
889
|
-
if (message.poolId !== "") {
|
|
890
|
-
writer.uint32(10).string(message.poolId);
|
|
891
|
-
}
|
|
892
|
-
if (message.address !== "") {
|
|
893
|
-
writer.uint32(18).string(message.address);
|
|
894
|
-
}
|
|
895
|
-
return writer;
|
|
896
|
-
},
|
|
897
|
-
decode(input, length) {
|
|
898
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
899
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
900
|
-
const message = Object.assign({}, baseQueryLastClaimRequest);
|
|
901
|
-
while (reader.pos < end) {
|
|
902
|
-
const tag = reader.uint32();
|
|
903
|
-
switch (tag >>> 3) {
|
|
904
|
-
case 1:
|
|
905
|
-
message.poolId = reader.string();
|
|
906
|
-
break;
|
|
907
|
-
case 2:
|
|
908
|
-
message.address = reader.string();
|
|
909
|
-
break;
|
|
910
|
-
default:
|
|
911
|
-
reader.skipType(tag & 7);
|
|
912
|
-
break;
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
return message;
|
|
916
|
-
},
|
|
917
|
-
fromJSON(object) {
|
|
918
|
-
const message = Object.assign({}, baseQueryLastClaimRequest);
|
|
919
|
-
message.poolId =
|
|
920
|
-
object.poolId !== undefined && object.poolId !== null
|
|
921
|
-
? String(object.poolId)
|
|
922
|
-
: "";
|
|
923
|
-
message.address =
|
|
924
|
-
object.address !== undefined && object.address !== null
|
|
925
|
-
? String(object.address)
|
|
926
|
-
: "";
|
|
927
|
-
return message;
|
|
928
|
-
},
|
|
929
|
-
toJSON(message) {
|
|
930
|
-
const obj = {};
|
|
931
|
-
message.poolId !== undefined && (obj.poolId = message.poolId);
|
|
932
|
-
message.address !== undefined && (obj.address = message.address);
|
|
933
|
-
return obj;
|
|
934
|
-
},
|
|
935
|
-
fromPartial(object) {
|
|
936
|
-
var _a, _b;
|
|
937
|
-
const message = Object.assign({}, baseQueryLastClaimRequest);
|
|
938
|
-
message.poolId = (_a = object.poolId) !== null && _a !== void 0 ? _a : "";
|
|
939
|
-
message.address = (_b = object.address) !== null && _b !== void 0 ? _b : "";
|
|
940
|
-
return message;
|
|
941
|
-
},
|
|
942
|
-
};
|
|
943
|
-
const baseQueryLastClaimResponse = { lastClaim: long_1.default.ZERO };
|
|
944
|
-
exports.QueryLastClaimResponse = {
|
|
945
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
946
|
-
if (!message.lastClaim.isZero()) {
|
|
947
|
-
writer.uint32(8).int64(message.lastClaim);
|
|
948
|
-
}
|
|
949
|
-
return writer;
|
|
950
|
-
},
|
|
951
|
-
decode(input, length) {
|
|
952
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
953
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
954
|
-
const message = Object.assign({}, baseQueryLastClaimResponse);
|
|
955
|
-
while (reader.pos < end) {
|
|
956
|
-
const tag = reader.uint32();
|
|
957
|
-
switch (tag >>> 3) {
|
|
958
|
-
case 1:
|
|
959
|
-
message.lastClaim = reader.int64();
|
|
960
|
-
break;
|
|
961
|
-
default:
|
|
962
|
-
reader.skipType(tag & 7);
|
|
963
|
-
break;
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
return message;
|
|
967
|
-
},
|
|
968
|
-
fromJSON(object) {
|
|
969
|
-
const message = Object.assign({}, baseQueryLastClaimResponse);
|
|
970
|
-
message.lastClaim =
|
|
971
|
-
object.lastClaim !== undefined && object.lastClaim !== null
|
|
972
|
-
? long_1.default.fromString(object.lastClaim)
|
|
973
|
-
: long_1.default.ZERO;
|
|
974
|
-
return message;
|
|
975
|
-
},
|
|
976
|
-
toJSON(message) {
|
|
977
|
-
const obj = {};
|
|
978
|
-
message.lastClaim !== undefined &&
|
|
979
|
-
(obj.lastClaim = (message.lastClaim || long_1.default.ZERO).toString());
|
|
980
|
-
return obj;
|
|
981
|
-
},
|
|
982
|
-
fromPartial(object) {
|
|
983
|
-
const message = Object.assign({}, baseQueryLastClaimResponse);
|
|
984
|
-
message.lastClaim =
|
|
985
|
-
object.lastClaim !== undefined && object.lastClaim !== null
|
|
986
|
-
? long_1.default.fromValue(object.lastClaim)
|
|
987
|
-
: long_1.default.ZERO;
|
|
988
|
-
return message;
|
|
989
|
-
},
|
|
990
|
-
};
|
|
991
756
|
const baseQueryCommitmentCurveRequest = {};
|
|
992
757
|
exports.QueryCommitmentCurveRequest = {
|
|
993
758
|
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
@@ -1865,10 +1630,8 @@ class QueryClientImpl {
|
|
|
1865
1630
|
this.PoolAddressAll = this.PoolAddressAll.bind(this);
|
|
1866
1631
|
this.Pool = this.Pool.bind(this);
|
|
1867
1632
|
this.PoolAll = this.PoolAll.bind(this);
|
|
1868
|
-
this.RewardHistory = this.RewardHistory.bind(this);
|
|
1869
1633
|
this.Commitment = this.Commitment.bind(this);
|
|
1870
1634
|
this.CommitmentAll = this.CommitmentAll.bind(this);
|
|
1871
|
-
this.LastClaim = this.LastClaim.bind(this);
|
|
1872
1635
|
this.CommitmentCurve = this.CommitmentCurve.bind(this);
|
|
1873
1636
|
this.RewardCurve = this.RewardCurve.bind(this);
|
|
1874
1637
|
this.TotalCommitment = this.TotalCommitment.bind(this);
|
|
@@ -1893,11 +1656,6 @@ class QueryClientImpl {
|
|
|
1893
1656
|
const promise = this.rpc.request("Switcheo.carbon.liquiditypool.Query", "PoolAll", data);
|
|
1894
1657
|
return promise.then((data) => exports.QueryAllPoolResponse.decode(new minimal_1.default.Reader(data)));
|
|
1895
1658
|
}
|
|
1896
|
-
RewardHistory(request) {
|
|
1897
|
-
const data = exports.QueryRewardHistoryRequest.encode(request).finish();
|
|
1898
|
-
const promise = this.rpc.request("Switcheo.carbon.liquiditypool.Query", "RewardHistory", data);
|
|
1899
|
-
return promise.then((data) => exports.QueryRewardHistoryResponse.decode(new minimal_1.default.Reader(data)));
|
|
1900
|
-
}
|
|
1901
1659
|
Commitment(request) {
|
|
1902
1660
|
const data = exports.QueryCommitmentRequest.encode(request).finish();
|
|
1903
1661
|
const promise = this.rpc.request("Switcheo.carbon.liquiditypool.Query", "Commitment", data);
|
|
@@ -1908,11 +1666,6 @@ class QueryClientImpl {
|
|
|
1908
1666
|
const promise = this.rpc.request("Switcheo.carbon.liquiditypool.Query", "CommitmentAll", data);
|
|
1909
1667
|
return promise.then((data) => exports.QueryAllCommitmentResponse.decode(new minimal_1.default.Reader(data)));
|
|
1910
1668
|
}
|
|
1911
|
-
LastClaim(request) {
|
|
1912
|
-
const data = exports.QueryLastClaimRequest.encode(request).finish();
|
|
1913
|
-
const promise = this.rpc.request("Switcheo.carbon.liquiditypool.Query", "LastClaim", data);
|
|
1914
|
-
return promise.then((data) => exports.QueryLastClaimResponse.decode(new minimal_1.default.Reader(data)));
|
|
1915
|
-
}
|
|
1916
1669
|
CommitmentCurve(request) {
|
|
1917
1670
|
const data = exports.QueryCommitmentCurveRequest.encode(request).finish();
|
|
1918
1671
|
const promise = this.rpc.request("Switcheo.carbon.liquiditypool.Query", "CommitmentCurve", data);
|
|
@@ -27,6 +27,7 @@ export interface Commitment {
|
|
|
27
27
|
liquidity?: Coin;
|
|
28
28
|
startTime?: Date;
|
|
29
29
|
duration: Long;
|
|
30
|
+
rewardDebt: DecCoin[];
|
|
30
31
|
}
|
|
31
32
|
export interface CommitmentRecord {
|
|
32
33
|
address: string;
|
|
@@ -49,14 +50,18 @@ export interface CommitmentResponse {
|
|
|
49
50
|
commitmentPower: string;
|
|
50
51
|
boostFactor: string;
|
|
51
52
|
}
|
|
53
|
+
/** Deprecated: use AccumulatedRewards */
|
|
52
54
|
export interface RewardHistory {
|
|
53
55
|
poolId: Long;
|
|
54
56
|
rewards: DecCoin[];
|
|
55
57
|
totalCommitment: string;
|
|
56
58
|
}
|
|
57
|
-
export interface
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
export interface AccumulatedRewards {
|
|
60
|
+
rewardPerCommitmentShare: DecCoin[];
|
|
61
|
+
}
|
|
62
|
+
export interface AccumulatedRewardsRecord {
|
|
63
|
+
poolId: Long;
|
|
64
|
+
accumulatedRewards?: AccumulatedRewards;
|
|
60
65
|
}
|
|
61
66
|
export interface CommitmentExpiry {
|
|
62
67
|
poolId: Long;
|
|
@@ -69,11 +74,6 @@ export interface CommitmentExpiriesRecord {
|
|
|
69
74
|
expiryTime: Long;
|
|
70
75
|
commitmentExpiries?: CommitmentExpiries;
|
|
71
76
|
}
|
|
72
|
-
export interface LastClaimRecord {
|
|
73
|
-
address: string;
|
|
74
|
-
poolId: Long;
|
|
75
|
-
height: Long;
|
|
76
|
-
}
|
|
77
77
|
export interface AllocatedRewards {
|
|
78
78
|
coins: DecCoin[];
|
|
79
79
|
}
|
|
@@ -147,12 +147,19 @@ export declare const RewardHistory: {
|
|
|
147
147
|
toJSON(message: RewardHistory): unknown;
|
|
148
148
|
fromPartial(object: DeepPartial<RewardHistory>): RewardHistory;
|
|
149
149
|
};
|
|
150
|
-
export declare const
|
|
151
|
-
encode(message:
|
|
152
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined):
|
|
153
|
-
fromJSON(object: any):
|
|
154
|
-
toJSON(message:
|
|
155
|
-
fromPartial(object: DeepPartial<
|
|
150
|
+
export declare const AccumulatedRewards: {
|
|
151
|
+
encode(message: AccumulatedRewards, writer?: _m0.Writer): _m0.Writer;
|
|
152
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AccumulatedRewards;
|
|
153
|
+
fromJSON(object: any): AccumulatedRewards;
|
|
154
|
+
toJSON(message: AccumulatedRewards): unknown;
|
|
155
|
+
fromPartial(object: DeepPartial<AccumulatedRewards>): AccumulatedRewards;
|
|
156
|
+
};
|
|
157
|
+
export declare const AccumulatedRewardsRecord: {
|
|
158
|
+
encode(message: AccumulatedRewardsRecord, writer?: _m0.Writer): _m0.Writer;
|
|
159
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AccumulatedRewardsRecord;
|
|
160
|
+
fromJSON(object: any): AccumulatedRewardsRecord;
|
|
161
|
+
toJSON(message: AccumulatedRewardsRecord): unknown;
|
|
162
|
+
fromPartial(object: DeepPartial<AccumulatedRewardsRecord>): AccumulatedRewardsRecord;
|
|
156
163
|
};
|
|
157
164
|
export declare const CommitmentExpiry: {
|
|
158
165
|
encode(message: CommitmentExpiry, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -175,13 +182,6 @@ export declare const CommitmentExpiriesRecord: {
|
|
|
175
182
|
toJSON(message: CommitmentExpiriesRecord): unknown;
|
|
176
183
|
fromPartial(object: DeepPartial<CommitmentExpiriesRecord>): CommitmentExpiriesRecord;
|
|
177
184
|
};
|
|
178
|
-
export declare const LastClaimRecord: {
|
|
179
|
-
encode(message: LastClaimRecord, writer?: _m0.Writer): _m0.Writer;
|
|
180
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): LastClaimRecord;
|
|
181
|
-
fromJSON(object: any): LastClaimRecord;
|
|
182
|
-
toJSON(message: LastClaimRecord): unknown;
|
|
183
|
-
fromPartial(object: DeepPartial<LastClaimRecord>): LastClaimRecord;
|
|
184
|
-
};
|
|
185
185
|
export declare const AllocatedRewards: {
|
|
186
186
|
encode(message: AllocatedRewards, writer?: _m0.Writer): _m0.Writer;
|
|
187
187
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AllocatedRewards;
|