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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { Pool } from "./liquiditypool";
|
|
4
|
-
import { CommitmentCurve, Commitment } from "./reward";
|
|
4
|
+
import { CommitmentCurve, Commitment, AccumulatedRewards } from "./reward";
|
|
5
|
+
import { Coin } from "../cosmos/base/v1beta1/coin";
|
|
5
6
|
export declare const protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
6
7
|
export interface PoolEvent {
|
|
7
8
|
creator: string;
|
|
@@ -66,6 +67,15 @@ export interface UnstakePoolTokenEvent {
|
|
|
66
67
|
amount: string;
|
|
67
68
|
creator: string;
|
|
68
69
|
}
|
|
70
|
+
export interface RewardsAccumulatedEvent {
|
|
71
|
+
poolId: Long;
|
|
72
|
+
accumulatedRewards?: AccumulatedRewards;
|
|
73
|
+
}
|
|
74
|
+
export interface ClaimEvent {
|
|
75
|
+
poolId: Long;
|
|
76
|
+
address: string;
|
|
77
|
+
rewards: Coin[];
|
|
78
|
+
}
|
|
69
79
|
export declare const PoolEvent: {
|
|
70
80
|
encode(message: PoolEvent, writer?: _m0.Writer): _m0.Writer;
|
|
71
81
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PoolEvent;
|
|
@@ -136,6 +146,20 @@ export declare const UnstakePoolTokenEvent: {
|
|
|
136
146
|
toJSON(message: UnstakePoolTokenEvent): unknown;
|
|
137
147
|
fromPartial(object: DeepPartial<UnstakePoolTokenEvent>): UnstakePoolTokenEvent;
|
|
138
148
|
};
|
|
149
|
+
export declare const RewardsAccumulatedEvent: {
|
|
150
|
+
encode(message: RewardsAccumulatedEvent, writer?: _m0.Writer): _m0.Writer;
|
|
151
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RewardsAccumulatedEvent;
|
|
152
|
+
fromJSON(object: any): RewardsAccumulatedEvent;
|
|
153
|
+
toJSON(message: RewardsAccumulatedEvent): unknown;
|
|
154
|
+
fromPartial(object: DeepPartial<RewardsAccumulatedEvent>): RewardsAccumulatedEvent;
|
|
155
|
+
};
|
|
156
|
+
export declare const ClaimEvent: {
|
|
157
|
+
encode(message: ClaimEvent, writer?: _m0.Writer): _m0.Writer;
|
|
158
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ClaimEvent;
|
|
159
|
+
fromJSON(object: any): ClaimEvent;
|
|
160
|
+
toJSON(message: ClaimEvent): unknown;
|
|
161
|
+
fromPartial(object: DeepPartial<ClaimEvent>): ClaimEvent;
|
|
162
|
+
};
|
|
139
163
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
140
164
|
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
141
165
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,12 +3,13 @@ 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.UnstakePoolTokenEvent = exports.StakePoolTokenEvent = exports.WithdrawFromPoolEvent = exports.DepositToPoolEvent = exports.SwapEvent = exports.CommitmentEvent = exports.CommitmentCurveEvent = exports.RewardsWeightChangeEvent = exports.TotalCommitmentChangeEvent = exports.PoolEvent = exports.protobufPackage = void 0;
|
|
6
|
+
exports.ClaimEvent = exports.RewardsAccumulatedEvent = exports.UnstakePoolTokenEvent = exports.StakePoolTokenEvent = exports.WithdrawFromPoolEvent = exports.DepositToPoolEvent = exports.SwapEvent = exports.CommitmentEvent = exports.CommitmentCurveEvent = exports.RewardsWeightChangeEvent = exports.TotalCommitmentChangeEvent = exports.PoolEvent = 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
10
|
const liquiditypool_1 = require("./liquiditypool");
|
|
11
11
|
const reward_1 = require("./reward");
|
|
12
|
+
const coin_1 = require("../cosmos/base/v1beta1/coin");
|
|
12
13
|
exports.protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
13
14
|
const basePoolEvent = {
|
|
14
15
|
creator: "",
|
|
@@ -969,6 +970,151 @@ exports.UnstakePoolTokenEvent = {
|
|
|
969
970
|
return message;
|
|
970
971
|
},
|
|
971
972
|
};
|
|
973
|
+
const baseRewardsAccumulatedEvent = { poolId: long_1.default.UZERO };
|
|
974
|
+
exports.RewardsAccumulatedEvent = {
|
|
975
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
976
|
+
if (!message.poolId.isZero()) {
|
|
977
|
+
writer.uint32(8).uint64(message.poolId);
|
|
978
|
+
}
|
|
979
|
+
if (message.accumulatedRewards !== undefined) {
|
|
980
|
+
reward_1.AccumulatedRewards.encode(message.accumulatedRewards, writer.uint32(18).fork()).ldelim();
|
|
981
|
+
}
|
|
982
|
+
return writer;
|
|
983
|
+
},
|
|
984
|
+
decode(input, length) {
|
|
985
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
986
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
987
|
+
const message = Object.assign({}, baseRewardsAccumulatedEvent);
|
|
988
|
+
while (reader.pos < end) {
|
|
989
|
+
const tag = reader.uint32();
|
|
990
|
+
switch (tag >>> 3) {
|
|
991
|
+
case 1:
|
|
992
|
+
message.poolId = reader.uint64();
|
|
993
|
+
break;
|
|
994
|
+
case 2:
|
|
995
|
+
message.accumulatedRewards = reward_1.AccumulatedRewards.decode(reader, reader.uint32());
|
|
996
|
+
break;
|
|
997
|
+
default:
|
|
998
|
+
reader.skipType(tag & 7);
|
|
999
|
+
break;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
return message;
|
|
1003
|
+
},
|
|
1004
|
+
fromJSON(object) {
|
|
1005
|
+
const message = Object.assign({}, baseRewardsAccumulatedEvent);
|
|
1006
|
+
message.poolId =
|
|
1007
|
+
object.poolId !== undefined && object.poolId !== null
|
|
1008
|
+
? long_1.default.fromString(object.poolId)
|
|
1009
|
+
: long_1.default.UZERO;
|
|
1010
|
+
message.accumulatedRewards =
|
|
1011
|
+
object.accumulatedRewards !== undefined &&
|
|
1012
|
+
object.accumulatedRewards !== null
|
|
1013
|
+
? reward_1.AccumulatedRewards.fromJSON(object.accumulatedRewards)
|
|
1014
|
+
: undefined;
|
|
1015
|
+
return message;
|
|
1016
|
+
},
|
|
1017
|
+
toJSON(message) {
|
|
1018
|
+
const obj = {};
|
|
1019
|
+
message.poolId !== undefined &&
|
|
1020
|
+
(obj.poolId = (message.poolId || long_1.default.UZERO).toString());
|
|
1021
|
+
message.accumulatedRewards !== undefined &&
|
|
1022
|
+
(obj.accumulatedRewards = message.accumulatedRewards
|
|
1023
|
+
? reward_1.AccumulatedRewards.toJSON(message.accumulatedRewards)
|
|
1024
|
+
: undefined);
|
|
1025
|
+
return obj;
|
|
1026
|
+
},
|
|
1027
|
+
fromPartial(object) {
|
|
1028
|
+
const message = Object.assign({}, baseRewardsAccumulatedEvent);
|
|
1029
|
+
message.poolId =
|
|
1030
|
+
object.poolId !== undefined && object.poolId !== null
|
|
1031
|
+
? long_1.default.fromValue(object.poolId)
|
|
1032
|
+
: long_1.default.UZERO;
|
|
1033
|
+
message.accumulatedRewards =
|
|
1034
|
+
object.accumulatedRewards !== undefined &&
|
|
1035
|
+
object.accumulatedRewards !== null
|
|
1036
|
+
? reward_1.AccumulatedRewards.fromPartial(object.accumulatedRewards)
|
|
1037
|
+
: undefined;
|
|
1038
|
+
return message;
|
|
1039
|
+
},
|
|
1040
|
+
};
|
|
1041
|
+
const baseClaimEvent = { poolId: long_1.default.UZERO, address: "" };
|
|
1042
|
+
exports.ClaimEvent = {
|
|
1043
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1044
|
+
if (!message.poolId.isZero()) {
|
|
1045
|
+
writer.uint32(8).uint64(message.poolId);
|
|
1046
|
+
}
|
|
1047
|
+
if (message.address !== "") {
|
|
1048
|
+
writer.uint32(18).string(message.address);
|
|
1049
|
+
}
|
|
1050
|
+
for (const v of message.rewards) {
|
|
1051
|
+
coin_1.Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
1052
|
+
}
|
|
1053
|
+
return writer;
|
|
1054
|
+
},
|
|
1055
|
+
decode(input, length) {
|
|
1056
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1057
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1058
|
+
const message = Object.assign({}, baseClaimEvent);
|
|
1059
|
+
message.rewards = [];
|
|
1060
|
+
while (reader.pos < end) {
|
|
1061
|
+
const tag = reader.uint32();
|
|
1062
|
+
switch (tag >>> 3) {
|
|
1063
|
+
case 1:
|
|
1064
|
+
message.poolId = reader.uint64();
|
|
1065
|
+
break;
|
|
1066
|
+
case 2:
|
|
1067
|
+
message.address = reader.string();
|
|
1068
|
+
break;
|
|
1069
|
+
case 3:
|
|
1070
|
+
message.rewards.push(coin_1.Coin.decode(reader, reader.uint32()));
|
|
1071
|
+
break;
|
|
1072
|
+
default:
|
|
1073
|
+
reader.skipType(tag & 7);
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
return message;
|
|
1078
|
+
},
|
|
1079
|
+
fromJSON(object) {
|
|
1080
|
+
var _a;
|
|
1081
|
+
const message = Object.assign({}, baseClaimEvent);
|
|
1082
|
+
message.poolId =
|
|
1083
|
+
object.poolId !== undefined && object.poolId !== null
|
|
1084
|
+
? long_1.default.fromString(object.poolId)
|
|
1085
|
+
: long_1.default.UZERO;
|
|
1086
|
+
message.address =
|
|
1087
|
+
object.address !== undefined && object.address !== null
|
|
1088
|
+
? String(object.address)
|
|
1089
|
+
: "";
|
|
1090
|
+
message.rewards = ((_a = object.rewards) !== null && _a !== void 0 ? _a : []).map((e) => coin_1.Coin.fromJSON(e));
|
|
1091
|
+
return message;
|
|
1092
|
+
},
|
|
1093
|
+
toJSON(message) {
|
|
1094
|
+
const obj = {};
|
|
1095
|
+
message.poolId !== undefined &&
|
|
1096
|
+
(obj.poolId = (message.poolId || long_1.default.UZERO).toString());
|
|
1097
|
+
message.address !== undefined && (obj.address = message.address);
|
|
1098
|
+
if (message.rewards) {
|
|
1099
|
+
obj.rewards = message.rewards.map((e) => e ? coin_1.Coin.toJSON(e) : undefined);
|
|
1100
|
+
}
|
|
1101
|
+
else {
|
|
1102
|
+
obj.rewards = [];
|
|
1103
|
+
}
|
|
1104
|
+
return obj;
|
|
1105
|
+
},
|
|
1106
|
+
fromPartial(object) {
|
|
1107
|
+
var _a, _b;
|
|
1108
|
+
const message = Object.assign({}, baseClaimEvent);
|
|
1109
|
+
message.poolId =
|
|
1110
|
+
object.poolId !== undefined && object.poolId !== null
|
|
1111
|
+
? long_1.default.fromValue(object.poolId)
|
|
1112
|
+
: long_1.default.UZERO;
|
|
1113
|
+
message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
|
|
1114
|
+
message.rewards = ((_b = object.rewards) !== null && _b !== void 0 ? _b : []).map((e) => coin_1.Coin.fromPartial(e));
|
|
1115
|
+
return message;
|
|
1116
|
+
},
|
|
1117
|
+
};
|
|
972
1118
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
973
1119
|
minimal_1.default.util.Long = long_1.default;
|
|
974
1120
|
minimal_1.default.configure();
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { RewardCurve, CommitmentCurve, RewardWeights, AllocatedRewards, CommitmentRecord, TotalCommitmentRecord, CommitmentExpiriesRecord, RewardHistoryRecord, LastClaimRecord } from "./reward";
|
|
4
3
|
import { Params, Pool, PoolRoute } from "./liquiditypool";
|
|
4
|
+
import { RewardCurve, CommitmentCurve, RewardWeights, AllocatedRewards, CommitmentRecord, TotalCommitmentRecord, CommitmentExpiriesRecord, AccumulatedRewardsRecord } from "./reward";
|
|
5
5
|
export declare const protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
6
6
|
/** GenesisState defines the liquiditypool module's genesis state. */
|
|
7
7
|
export interface GenesisState {
|
|
8
|
+
/** params defines all the paramaters of the module. */
|
|
9
|
+
params?: Params;
|
|
8
10
|
pools: Pool[];
|
|
9
11
|
rewardCurve?: RewardCurve;
|
|
10
12
|
commitmentCurve?: CommitmentCurve;
|
|
@@ -12,11 +14,8 @@ export interface GenesisState {
|
|
|
12
14
|
commitments: CommitmentRecord[];
|
|
13
15
|
totalCommitments: TotalCommitmentRecord[];
|
|
14
16
|
commitmentExpiries: CommitmentExpiriesRecord[];
|
|
15
|
-
rewardHistories: RewardHistoryRecord[];
|
|
16
|
-
lastClaims: LastClaimRecord[];
|
|
17
17
|
allocatedRewards?: AllocatedRewards;
|
|
18
|
-
|
|
19
|
-
params?: Params;
|
|
18
|
+
accumulatedRewards: AccumulatedRewardsRecord[];
|
|
20
19
|
poolRoutes: PoolRoute[];
|
|
21
20
|
}
|
|
22
21
|
export declare const GenesisState: {
|
|
@@ -7,12 +7,15 @@ exports.GenesisState = exports.protobufPackage = void 0;
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const reward_1 = require("./reward");
|
|
11
10
|
const liquiditypool_1 = require("./liquiditypool");
|
|
11
|
+
const reward_1 = require("./reward");
|
|
12
12
|
exports.protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
13
13
|
const baseGenesisState = {};
|
|
14
14
|
exports.GenesisState = {
|
|
15
15
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
16
|
+
if (message.params !== undefined) {
|
|
17
|
+
liquiditypool_1.Params.encode(message.params, writer.uint32(90).fork()).ldelim();
|
|
18
|
+
}
|
|
16
19
|
for (const v of message.pools) {
|
|
17
20
|
liquiditypool_1.Pool.encode(v, writer.uint32(10).fork()).ldelim();
|
|
18
21
|
}
|
|
@@ -34,17 +37,11 @@ exports.GenesisState = {
|
|
|
34
37
|
for (const v of message.commitmentExpiries) {
|
|
35
38
|
reward_1.CommitmentExpiriesRecord.encode(v, writer.uint32(58).fork()).ldelim();
|
|
36
39
|
}
|
|
37
|
-
for (const v of message.rewardHistories) {
|
|
38
|
-
reward_1.RewardHistoryRecord.encode(v, writer.uint32(66).fork()).ldelim();
|
|
39
|
-
}
|
|
40
|
-
for (const v of message.lastClaims) {
|
|
41
|
-
reward_1.LastClaimRecord.encode(v, writer.uint32(74).fork()).ldelim();
|
|
42
|
-
}
|
|
43
40
|
if (message.allocatedRewards !== undefined) {
|
|
44
41
|
reward_1.AllocatedRewards.encode(message.allocatedRewards, writer.uint32(82).fork()).ldelim();
|
|
45
42
|
}
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
for (const v of message.accumulatedRewards) {
|
|
44
|
+
reward_1.AccumulatedRewardsRecord.encode(v, writer.uint32(106).fork()).ldelim();
|
|
48
45
|
}
|
|
49
46
|
for (const v of message.poolRoutes) {
|
|
50
47
|
liquiditypool_1.PoolRoute.encode(v, writer.uint32(98).fork()).ldelim();
|
|
@@ -59,12 +56,14 @@ exports.GenesisState = {
|
|
|
59
56
|
message.commitments = [];
|
|
60
57
|
message.totalCommitments = [];
|
|
61
58
|
message.commitmentExpiries = [];
|
|
62
|
-
message.
|
|
63
|
-
message.lastClaims = [];
|
|
59
|
+
message.accumulatedRewards = [];
|
|
64
60
|
message.poolRoutes = [];
|
|
65
61
|
while (reader.pos < end) {
|
|
66
62
|
const tag = reader.uint32();
|
|
67
63
|
switch (tag >>> 3) {
|
|
64
|
+
case 11:
|
|
65
|
+
message.params = liquiditypool_1.Params.decode(reader, reader.uint32());
|
|
66
|
+
break;
|
|
68
67
|
case 1:
|
|
69
68
|
message.pools.push(liquiditypool_1.Pool.decode(reader, reader.uint32()));
|
|
70
69
|
break;
|
|
@@ -86,17 +85,11 @@ exports.GenesisState = {
|
|
|
86
85
|
case 7:
|
|
87
86
|
message.commitmentExpiries.push(reward_1.CommitmentExpiriesRecord.decode(reader, reader.uint32()));
|
|
88
87
|
break;
|
|
89
|
-
case 8:
|
|
90
|
-
message.rewardHistories.push(reward_1.RewardHistoryRecord.decode(reader, reader.uint32()));
|
|
91
|
-
break;
|
|
92
|
-
case 9:
|
|
93
|
-
message.lastClaims.push(reward_1.LastClaimRecord.decode(reader, reader.uint32()));
|
|
94
|
-
break;
|
|
95
88
|
case 10:
|
|
96
89
|
message.allocatedRewards = reward_1.AllocatedRewards.decode(reader, reader.uint32());
|
|
97
90
|
break;
|
|
98
|
-
case
|
|
99
|
-
message.
|
|
91
|
+
case 13:
|
|
92
|
+
message.accumulatedRewards.push(reward_1.AccumulatedRewardsRecord.decode(reader, reader.uint32()));
|
|
100
93
|
break;
|
|
101
94
|
case 12:
|
|
102
95
|
message.poolRoutes.push(liquiditypool_1.PoolRoute.decode(reader, reader.uint32()));
|
|
@@ -109,8 +102,12 @@ exports.GenesisState = {
|
|
|
109
102
|
return message;
|
|
110
103
|
},
|
|
111
104
|
fromJSON(object) {
|
|
112
|
-
var _a, _b, _c, _d, _e, _f
|
|
105
|
+
var _a, _b, _c, _d, _e, _f;
|
|
113
106
|
const message = Object.assign({}, baseGenesisState);
|
|
107
|
+
message.params =
|
|
108
|
+
object.params !== undefined && object.params !== null
|
|
109
|
+
? liquiditypool_1.Params.fromJSON(object.params)
|
|
110
|
+
: undefined;
|
|
114
111
|
message.pools = ((_a = object.pools) !== null && _a !== void 0 ? _a : []).map((e) => liquiditypool_1.Pool.fromJSON(e));
|
|
115
112
|
message.rewardCurve =
|
|
116
113
|
object.rewardCurve !== undefined && object.rewardCurve !== null
|
|
@@ -127,21 +124,18 @@ exports.GenesisState = {
|
|
|
127
124
|
message.commitments = ((_b = object.commitments) !== null && _b !== void 0 ? _b : []).map((e) => reward_1.CommitmentRecord.fromJSON(e));
|
|
128
125
|
message.totalCommitments = ((_c = object.totalCommitments) !== null && _c !== void 0 ? _c : []).map((e) => reward_1.TotalCommitmentRecord.fromJSON(e));
|
|
129
126
|
message.commitmentExpiries = ((_d = object.commitmentExpiries) !== null && _d !== void 0 ? _d : []).map((e) => reward_1.CommitmentExpiriesRecord.fromJSON(e));
|
|
130
|
-
message.rewardHistories = ((_e = object.rewardHistories) !== null && _e !== void 0 ? _e : []).map((e) => reward_1.RewardHistoryRecord.fromJSON(e));
|
|
131
|
-
message.lastClaims = ((_f = object.lastClaims) !== null && _f !== void 0 ? _f : []).map((e) => reward_1.LastClaimRecord.fromJSON(e));
|
|
132
127
|
message.allocatedRewards =
|
|
133
128
|
object.allocatedRewards !== undefined && object.allocatedRewards !== null
|
|
134
129
|
? reward_1.AllocatedRewards.fromJSON(object.allocatedRewards)
|
|
135
130
|
: undefined;
|
|
136
|
-
message.
|
|
137
|
-
|
|
138
|
-
? liquiditypool_1.Params.fromJSON(object.params)
|
|
139
|
-
: undefined;
|
|
140
|
-
message.poolRoutes = ((_g = object.poolRoutes) !== null && _g !== void 0 ? _g : []).map((e) => liquiditypool_1.PoolRoute.fromJSON(e));
|
|
131
|
+
message.accumulatedRewards = ((_e = object.accumulatedRewards) !== null && _e !== void 0 ? _e : []).map((e) => reward_1.AccumulatedRewardsRecord.fromJSON(e));
|
|
132
|
+
message.poolRoutes = ((_f = object.poolRoutes) !== null && _f !== void 0 ? _f : []).map((e) => liquiditypool_1.PoolRoute.fromJSON(e));
|
|
141
133
|
return message;
|
|
142
134
|
},
|
|
143
135
|
toJSON(message) {
|
|
144
136
|
const obj = {};
|
|
137
|
+
message.params !== undefined &&
|
|
138
|
+
(obj.params = message.params ? liquiditypool_1.Params.toJSON(message.params) : undefined);
|
|
145
139
|
if (message.pools) {
|
|
146
140
|
obj.pools = message.pools.map((e) => (e ? liquiditypool_1.Pool.toJSON(e) : undefined));
|
|
147
141
|
}
|
|
@@ -178,24 +172,16 @@ exports.GenesisState = {
|
|
|
178
172
|
else {
|
|
179
173
|
obj.commitmentExpiries = [];
|
|
180
174
|
}
|
|
181
|
-
if (message.rewardHistories) {
|
|
182
|
-
obj.rewardHistories = message.rewardHistories.map((e) => e ? reward_1.RewardHistoryRecord.toJSON(e) : undefined);
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
obj.rewardHistories = [];
|
|
186
|
-
}
|
|
187
|
-
if (message.lastClaims) {
|
|
188
|
-
obj.lastClaims = message.lastClaims.map((e) => e ? reward_1.LastClaimRecord.toJSON(e) : undefined);
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
obj.lastClaims = [];
|
|
192
|
-
}
|
|
193
175
|
message.allocatedRewards !== undefined &&
|
|
194
176
|
(obj.allocatedRewards = message.allocatedRewards
|
|
195
177
|
? reward_1.AllocatedRewards.toJSON(message.allocatedRewards)
|
|
196
178
|
: undefined);
|
|
197
|
-
message.
|
|
198
|
-
|
|
179
|
+
if (message.accumulatedRewards) {
|
|
180
|
+
obj.accumulatedRewards = message.accumulatedRewards.map((e) => e ? reward_1.AccumulatedRewardsRecord.toJSON(e) : undefined);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
obj.accumulatedRewards = [];
|
|
184
|
+
}
|
|
199
185
|
if (message.poolRoutes) {
|
|
200
186
|
obj.poolRoutes = message.poolRoutes.map((e) => e ? liquiditypool_1.PoolRoute.toJSON(e) : undefined);
|
|
201
187
|
}
|
|
@@ -205,8 +191,12 @@ exports.GenesisState = {
|
|
|
205
191
|
return obj;
|
|
206
192
|
},
|
|
207
193
|
fromPartial(object) {
|
|
208
|
-
var _a, _b, _c, _d, _e, _f
|
|
194
|
+
var _a, _b, _c, _d, _e, _f;
|
|
209
195
|
const message = Object.assign({}, baseGenesisState);
|
|
196
|
+
message.params =
|
|
197
|
+
object.params !== undefined && object.params !== null
|
|
198
|
+
? liquiditypool_1.Params.fromPartial(object.params)
|
|
199
|
+
: undefined;
|
|
210
200
|
message.pools = ((_a = object.pools) !== null && _a !== void 0 ? _a : []).map((e) => liquiditypool_1.Pool.fromPartial(e));
|
|
211
201
|
message.rewardCurve =
|
|
212
202
|
object.rewardCurve !== undefined && object.rewardCurve !== null
|
|
@@ -223,17 +213,12 @@ exports.GenesisState = {
|
|
|
223
213
|
message.commitments = ((_b = object.commitments) !== null && _b !== void 0 ? _b : []).map((e) => reward_1.CommitmentRecord.fromPartial(e));
|
|
224
214
|
message.totalCommitments = ((_c = object.totalCommitments) !== null && _c !== void 0 ? _c : []).map((e) => reward_1.TotalCommitmentRecord.fromPartial(e));
|
|
225
215
|
message.commitmentExpiries = ((_d = object.commitmentExpiries) !== null && _d !== void 0 ? _d : []).map((e) => reward_1.CommitmentExpiriesRecord.fromPartial(e));
|
|
226
|
-
message.rewardHistories = ((_e = object.rewardHistories) !== null && _e !== void 0 ? _e : []).map((e) => reward_1.RewardHistoryRecord.fromPartial(e));
|
|
227
|
-
message.lastClaims = ((_f = object.lastClaims) !== null && _f !== void 0 ? _f : []).map((e) => reward_1.LastClaimRecord.fromPartial(e));
|
|
228
216
|
message.allocatedRewards =
|
|
229
217
|
object.allocatedRewards !== undefined && object.allocatedRewards !== null
|
|
230
218
|
? reward_1.AllocatedRewards.fromPartial(object.allocatedRewards)
|
|
231
219
|
: undefined;
|
|
232
|
-
message.
|
|
233
|
-
|
|
234
|
-
? liquiditypool_1.Params.fromPartial(object.params)
|
|
235
|
-
: undefined;
|
|
236
|
-
message.poolRoutes = ((_g = object.poolRoutes) !== null && _g !== void 0 ? _g : []).map((e) => liquiditypool_1.PoolRoute.fromPartial(e));
|
|
220
|
+
message.accumulatedRewards = ((_e = object.accumulatedRewards) !== null && _e !== void 0 ? _e : []).map((e) => reward_1.AccumulatedRewardsRecord.fromPartial(e));
|
|
221
|
+
message.poolRoutes = ((_f = object.poolRoutes) !== null && _f !== void 0 ? _f : []).map((e) => liquiditypool_1.PoolRoute.fromPartial(e));
|
|
237
222
|
return message;
|
|
238
223
|
},
|
|
239
224
|
};
|
|
@@ -2,7 +2,7 @@ import Long from "long";
|
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
|
|
4
4
|
import { Pool, Params, PoolRoute } from "./liquiditypool";
|
|
5
|
-
import { CommitmentResponse, CommitmentCurve, RewardCurve,
|
|
5
|
+
import { CommitmentResponse, CommitmentCurve, RewardCurve, Commitment, TotalCommitmentRecord } from "./reward";
|
|
6
6
|
import { DecCoin } from "../cosmos/base/v1beta1/coin";
|
|
7
7
|
export declare const protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
8
8
|
/** this line is used by starport scaffolding # 3 */
|
|
@@ -32,19 +32,11 @@ export interface QueryAllPoolAddressResponse_AddressesEntry {
|
|
|
32
32
|
key: string;
|
|
33
33
|
value: string;
|
|
34
34
|
}
|
|
35
|
-
export interface QueryRewardHistoryRequest {
|
|
36
|
-
poolId: string;
|
|
37
|
-
startBlockHeight: string;
|
|
38
|
-
pagination?: PageRequest;
|
|
39
|
-
}
|
|
40
35
|
export interface ExtendedPool {
|
|
41
36
|
pool?: Pool;
|
|
42
37
|
rewardsWeight: string;
|
|
43
38
|
totalCommitment: string;
|
|
44
|
-
|
|
45
|
-
export interface QueryRewardHistoryResponse {
|
|
46
|
-
rewardHistories: RewardHistoryRecord[];
|
|
47
|
-
pagination?: PageResponse;
|
|
39
|
+
rewardPerCommitmentShare: DecCoin[];
|
|
48
40
|
}
|
|
49
41
|
export interface QueryCommitmentRequest {
|
|
50
42
|
poolId: string;
|
|
@@ -62,13 +54,6 @@ export interface QueryAllCommitmentResponse {
|
|
|
62
54
|
pagination?: PageResponse;
|
|
63
55
|
blockTime?: Date;
|
|
64
56
|
}
|
|
65
|
-
export interface QueryLastClaimRequest {
|
|
66
|
-
poolId: string;
|
|
67
|
-
address: string;
|
|
68
|
-
}
|
|
69
|
-
export interface QueryLastClaimResponse {
|
|
70
|
-
lastClaim: Long;
|
|
71
|
-
}
|
|
72
57
|
export interface QueryCommitmentCurveRequest {
|
|
73
58
|
}
|
|
74
59
|
export interface QueryCommitmentCurveResponse {
|
|
@@ -176,13 +161,6 @@ export declare const QueryAllPoolAddressResponse_AddressesEntry: {
|
|
|
176
161
|
toJSON(message: QueryAllPoolAddressResponse_AddressesEntry): unknown;
|
|
177
162
|
fromPartial(object: DeepPartial<QueryAllPoolAddressResponse_AddressesEntry>): QueryAllPoolAddressResponse_AddressesEntry;
|
|
178
163
|
};
|
|
179
|
-
export declare const QueryRewardHistoryRequest: {
|
|
180
|
-
encode(message: QueryRewardHistoryRequest, writer?: _m0.Writer): _m0.Writer;
|
|
181
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRewardHistoryRequest;
|
|
182
|
-
fromJSON(object: any): QueryRewardHistoryRequest;
|
|
183
|
-
toJSON(message: QueryRewardHistoryRequest): unknown;
|
|
184
|
-
fromPartial(object: DeepPartial<QueryRewardHistoryRequest>): QueryRewardHistoryRequest;
|
|
185
|
-
};
|
|
186
164
|
export declare const ExtendedPool: {
|
|
187
165
|
encode(message: ExtendedPool, writer?: _m0.Writer): _m0.Writer;
|
|
188
166
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ExtendedPool;
|
|
@@ -190,13 +168,6 @@ export declare const ExtendedPool: {
|
|
|
190
168
|
toJSON(message: ExtendedPool): unknown;
|
|
191
169
|
fromPartial(object: DeepPartial<ExtendedPool>): ExtendedPool;
|
|
192
170
|
};
|
|
193
|
-
export declare const QueryRewardHistoryResponse: {
|
|
194
|
-
encode(message: QueryRewardHistoryResponse, writer?: _m0.Writer): _m0.Writer;
|
|
195
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRewardHistoryResponse;
|
|
196
|
-
fromJSON(object: any): QueryRewardHistoryResponse;
|
|
197
|
-
toJSON(message: QueryRewardHistoryResponse): unknown;
|
|
198
|
-
fromPartial(object: DeepPartial<QueryRewardHistoryResponse>): QueryRewardHistoryResponse;
|
|
199
|
-
};
|
|
200
171
|
export declare const QueryCommitmentRequest: {
|
|
201
172
|
encode(message: QueryCommitmentRequest, writer?: _m0.Writer): _m0.Writer;
|
|
202
173
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCommitmentRequest;
|
|
@@ -225,20 +196,6 @@ export declare const QueryAllCommitmentResponse: {
|
|
|
225
196
|
toJSON(message: QueryAllCommitmentResponse): unknown;
|
|
226
197
|
fromPartial(object: DeepPartial<QueryAllCommitmentResponse>): QueryAllCommitmentResponse;
|
|
227
198
|
};
|
|
228
|
-
export declare const QueryLastClaimRequest: {
|
|
229
|
-
encode(message: QueryLastClaimRequest, writer?: _m0.Writer): _m0.Writer;
|
|
230
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryLastClaimRequest;
|
|
231
|
-
fromJSON(object: any): QueryLastClaimRequest;
|
|
232
|
-
toJSON(message: QueryLastClaimRequest): unknown;
|
|
233
|
-
fromPartial(object: DeepPartial<QueryLastClaimRequest>): QueryLastClaimRequest;
|
|
234
|
-
};
|
|
235
|
-
export declare const QueryLastClaimResponse: {
|
|
236
|
-
encode(message: QueryLastClaimResponse, writer?: _m0.Writer): _m0.Writer;
|
|
237
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryLastClaimResponse;
|
|
238
|
-
fromJSON(object: any): QueryLastClaimResponse;
|
|
239
|
-
toJSON(message: QueryLastClaimResponse): unknown;
|
|
240
|
-
fromPartial(object: DeepPartial<QueryLastClaimResponse>): QueryLastClaimResponse;
|
|
241
|
-
};
|
|
242
199
|
export declare const QueryCommitmentCurveRequest: {
|
|
243
200
|
encode(_: QueryCommitmentCurveRequest, writer?: _m0.Writer): _m0.Writer;
|
|
244
201
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCommitmentCurveRequest;
|
|
@@ -366,14 +323,10 @@ export interface Query {
|
|
|
366
323
|
Pool(request: QueryGetPoolRequest): Promise<QueryGetPoolResponse>;
|
|
367
324
|
/** Get details for all pools */
|
|
368
325
|
PoolAll(request: QueryAllPoolRequest): Promise<QueryAllPoolResponse>;
|
|
369
|
-
/** Get reward history for a pool from the given height */
|
|
370
|
-
RewardHistory(request: QueryRewardHistoryRequest): Promise<QueryRewardHistoryResponse>;
|
|
371
326
|
/** Get LP commitment for a pool and address */
|
|
372
327
|
Commitment(request: QueryCommitmentRequest): Promise<QueryCommitmentResponse>;
|
|
373
328
|
/** Get all LP commitments for an address */
|
|
374
329
|
CommitmentAll(request: QueryAllCommitmentRequest): Promise<QueryAllCommitmentResponse>;
|
|
375
|
-
/** Get block where an address last claimed from a pool */
|
|
376
|
-
LastClaim(request: QueryLastClaimRequest): Promise<QueryLastClaimResponse>;
|
|
377
330
|
/** Get the current commitment reward boost curve */
|
|
378
331
|
CommitmentCurve(request: QueryCommitmentCurveRequest): Promise<QueryCommitmentCurveResponse>;
|
|
379
332
|
/** Get the current LP reward curve */
|
|
@@ -396,10 +349,8 @@ export declare class QueryClientImpl implements Query {
|
|
|
396
349
|
PoolAddressAll(request: QueryAllPoolAddressRequest): Promise<QueryAllPoolAddressResponse>;
|
|
397
350
|
Pool(request: QueryGetPoolRequest): Promise<QueryGetPoolResponse>;
|
|
398
351
|
PoolAll(request: QueryAllPoolRequest): Promise<QueryAllPoolResponse>;
|
|
399
|
-
RewardHistory(request: QueryRewardHistoryRequest): Promise<QueryRewardHistoryResponse>;
|
|
400
352
|
Commitment(request: QueryCommitmentRequest): Promise<QueryCommitmentResponse>;
|
|
401
353
|
CommitmentAll(request: QueryAllCommitmentRequest): Promise<QueryAllCommitmentResponse>;
|
|
402
|
-
LastClaim(request: QueryLastClaimRequest): Promise<QueryLastClaimResponse>;
|
|
403
354
|
CommitmentCurve(request: QueryCommitmentCurveRequest): Promise<QueryCommitmentCurveResponse>;
|
|
404
355
|
RewardCurve(request: QueryRewardCurveRequest): Promise<QueryRewardCurveResponse>;
|
|
405
356
|
TotalCommitment(request: QueryTotalCommitmentRequest): Promise<QueryTotalCommitmentResponse>;
|