carbon-js-sdk 0.3.53-dev.1 → 0.3.53-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/clients/CarbonQueryClient.d.ts +6 -0
- package/lib/clients/CarbonQueryClient.js +36 -30
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.d.ts +4 -2
- package/lib/clients/TokenClient.js +68 -4
- package/lib/clients/ZILClient.js +17 -17
- package/lib/codec/broker/amm.d.ts +1 -0
- package/lib/codec/broker/amm.js +15 -1
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/tx/v1beta1/tx.js +2 -2
- package/lib/codec/ethermint/crypto/v1/ethsecp256k1/keys.d.ts +39 -0
- package/lib/codec/ethermint/crypto/v1/ethsecp256k1/keys.js +138 -0
- package/lib/codec/ethermint/evm/v1/events.d.ts +72 -0
- package/lib/codec/ethermint/evm/v1/events.js +303 -0
- package/lib/codec/ethermint/evm/v1/evm.d.ts +239 -0
- package/lib/codec/ethermint/evm/v1/evm.js +1140 -0
- package/lib/codec/ethermint/evm/v1/genesis.d.ts +43 -0
- package/lib/codec/ethermint/evm/v1/genesis.js +153 -0
- package/lib/codec/ethermint/evm/v1/query.d.ts +424 -0
- package/lib/codec/ethermint/evm/v1/query.js +1637 -0
- package/lib/codec/ethermint/evm/v1/tx.d.ts +219 -0
- package/lib/codec/ethermint/evm/v1/tx.js +935 -0
- package/lib/codec/ethermint/feemarket/v1/events.d.ts +34 -0
- package/lib/codec/ethermint/feemarket/v1/events.js +116 -0
- package/lib/codec/ethermint/feemarket/v1/feemarket.d.ts +51 -0
- package/lib/codec/ethermint/feemarket/v1/feemarket.js +176 -0
- package/lib/codec/ethermint/feemarket/v1/genesis.d.ts +26 -0
- package/lib/codec/ethermint/feemarket/v1/genesis.js +79 -0
- package/lib/codec/ethermint/feemarket/v1/query.d.ts +100 -0
- package/lib/codec/ethermint/feemarket/v1/query.js +276 -0
- package/lib/codec/ethermint/feemarket/v1/tx.d.ts +55 -0
- package/lib/codec/ethermint/feemarket/v1/tx.js +120 -0
- package/lib/codec/ethermint/types/v1/account.d.ts +26 -0
- package/lib/codec/ethermint/types/v1/account.js +78 -0
- package/lib/codec/ethermint/types/v1/dynamic_fee.d.ts +20 -0
- package/lib/codec/ethermint/types/v1/dynamic_fee.js +60 -0
- package/lib/codec/ethermint/types/v1/indexer.d.ts +41 -0
- package/lib/codec/ethermint/types/v1/indexer.js +153 -0
- package/lib/codec/ethermint/types/v1/web3.d.ts +36 -0
- package/lib/codec/ethermint/types/v1/web3.js +124 -0
- package/lib/codec/evmbank/genesis.d.ts +32 -0
- package/lib/codec/evmbank/genesis.js +152 -0
- package/lib/codec/evmbank/query.d.ts +40 -0
- package/lib/codec/evmbank/query.js +116 -0
- package/lib/codec/evmmerge/event.d.ts +20 -0
- package/lib/codec/evmmerge/event.js +90 -0
- package/lib/codec/evmmerge/genesis.d.ts +48 -0
- package/lib/codec/evmmerge/genesis.js +216 -0
- package/lib/codec/evmmerge/offchain.d.ts +22 -0
- package/lib/codec/evmmerge/offchain.js +105 -0
- package/lib/codec/evmmerge/query.d.ts +43 -0
- package/lib/codec/evmmerge/query.js +117 -0
- package/lib/codec/evmmerge/tx.d.ts +45 -0
- package/lib/codec/evmmerge/tx.js +128 -0
- package/lib/codec/index.d.ts +14 -10
- package/lib/codec/index.js +52 -27
- package/lib/codec/liquiditypool/event.d.ts +12 -0
- package/lib/codec/liquiditypool/event.js +74 -1
- package/lib/codec/liquiditypool/genesis.d.ts +2 -1
- package/lib/codec/liquiditypool/genesis.js +17 -2
- package/lib/codec/liquiditypool/liquiditypool.d.ts +40 -0
- package/lib/codec/liquiditypool/liquiditypool.js +320 -2
- package/lib/codec/liquiditypool/proposal.d.ts +37 -1
- package/lib/codec/liquiditypool/proposal.js +229 -1
- package/lib/codec/liquiditypool/query.d.ts +85 -24
- package/lib/codec/liquiditypool/query.js +338 -23
- package/lib/codec/liquiditypool/tx.d.ts +101 -46
- package/lib/codec/liquiditypool/tx.js +638 -309
- package/lib/codec/order/order.d.ts +1 -0
- package/lib/codec/order/order.js +45 -1
- package/lib/constant/generic.js +1 -1
- package/lib/modules/admin.d.ts +0 -2
- package/lib/modules/admin.js +0 -26
- package/lib/modules/cdp.js +43 -43
- package/lib/modules/coin.d.ts +19 -0
- package/lib/modules/coin.js +39 -0
- package/lib/modules/cosmwasm.js +1 -1
- package/lib/modules/gov.js +12 -26
- package/lib/modules/liquiditypool.d.ts +11 -2
- package/lib/modules/liquiditypool.js +34 -3
- package/lib/modules/market.d.ts +11 -0
- package/lib/modules/market.js +19 -0
- 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 +28 -32
- 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 +22 -22
- package/lib/provider/amino/types/coin.js +4 -4
- package/lib/provider/amino/types/gov.js +4 -40
- 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 -9
- package/lib/provider/amino/types/market.js +1 -1
- package/lib/provider/amino/types/oracle.js +1 -1
- package/lib/provider/amino/types/order.js +4 -4
- package/lib/provider/amino/types/position.js +1 -1
- package/lib/provider/amino/types/profile.js +1 -1
- package/lib/provider/amino/types/staking.js +4 -4
- package/lib/provider/amino/types/subaccount.js +3 -3
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/ledger/ledger.js +2 -2
- package/lib/provider/metamask/MetaMask.js +1 -1
- package/lib/provider/o3/O3Wallet.js +2 -2
- package/lib/util/address.js +13 -13
- package/lib/util/api.js +4 -4
- package/lib/util/blockchain.d.ts +4 -1
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/gov.d.ts +0 -2
- package/lib/util/gov.js +0 -6
- package/lib/util/number.js +5 -5
- package/lib/util/tx.d.ts +9 -4
- package/lib/wallet/CarbonSigner.js +2 -2
- package/lib/wallet/CarbonSigningClient.js +8 -8
- package/lib/wallet/CarbonWallet.js +6 -6
- package/lib/websocket/connector.js +3 -3
- package/lib/websocket/models.d.ts +7 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { RewardCurve, CommitmentCurve, RewardWeights, AllocatedRewards, CommitmentRecord, TotalCommitmentRecord, CommitmentExpiriesRecord, RewardHistoryRecord, LastClaimRecord } from "./reward";
|
|
4
|
-
import { Params, Pool } from "./liquiditypool";
|
|
4
|
+
import { Params, Pool, PoolRoute } from "./liquiditypool";
|
|
5
5
|
export declare const protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
6
6
|
/** GenesisState defines the liquiditypool module's genesis state. */
|
|
7
7
|
export interface GenesisState {
|
|
@@ -17,6 +17,7 @@ export interface GenesisState {
|
|
|
17
17
|
allocatedRewards?: AllocatedRewards;
|
|
18
18
|
/** params defines all the paramaters of the module. */
|
|
19
19
|
params?: Params;
|
|
20
|
+
poolRoutes: PoolRoute[];
|
|
20
21
|
}
|
|
21
22
|
export declare const GenesisState: {
|
|
22
23
|
encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -46,6 +46,9 @@ exports.GenesisState = {
|
|
|
46
46
|
if (message.params !== undefined) {
|
|
47
47
|
liquiditypool_1.Params.encode(message.params, writer.uint32(90).fork()).ldelim();
|
|
48
48
|
}
|
|
49
|
+
for (const v of message.poolRoutes) {
|
|
50
|
+
liquiditypool_1.PoolRoute.encode(v, writer.uint32(98).fork()).ldelim();
|
|
51
|
+
}
|
|
49
52
|
return writer;
|
|
50
53
|
},
|
|
51
54
|
decode(input, length) {
|
|
@@ -58,6 +61,7 @@ exports.GenesisState = {
|
|
|
58
61
|
message.commitmentExpiries = [];
|
|
59
62
|
message.rewardHistories = [];
|
|
60
63
|
message.lastClaims = [];
|
|
64
|
+
message.poolRoutes = [];
|
|
61
65
|
while (reader.pos < end) {
|
|
62
66
|
const tag = reader.uint32();
|
|
63
67
|
switch (tag >>> 3) {
|
|
@@ -94,6 +98,9 @@ exports.GenesisState = {
|
|
|
94
98
|
case 11:
|
|
95
99
|
message.params = liquiditypool_1.Params.decode(reader, reader.uint32());
|
|
96
100
|
break;
|
|
101
|
+
case 12:
|
|
102
|
+
message.poolRoutes.push(liquiditypool_1.PoolRoute.decode(reader, reader.uint32()));
|
|
103
|
+
break;
|
|
97
104
|
default:
|
|
98
105
|
reader.skipType(tag & 7);
|
|
99
106
|
break;
|
|
@@ -102,7 +109,7 @@ exports.GenesisState = {
|
|
|
102
109
|
return message;
|
|
103
110
|
},
|
|
104
111
|
fromJSON(object) {
|
|
105
|
-
var _a, _b, _c, _d, _e, _f;
|
|
112
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
106
113
|
const message = Object.assign({}, baseGenesisState);
|
|
107
114
|
message.pools = ((_a = object.pools) !== null && _a !== void 0 ? _a : []).map((e) => liquiditypool_1.Pool.fromJSON(e));
|
|
108
115
|
message.rewardCurve =
|
|
@@ -130,6 +137,7 @@ exports.GenesisState = {
|
|
|
130
137
|
object.params !== undefined && object.params !== null
|
|
131
138
|
? liquiditypool_1.Params.fromJSON(object.params)
|
|
132
139
|
: undefined;
|
|
140
|
+
message.poolRoutes = ((_g = object.poolRoutes) !== null && _g !== void 0 ? _g : []).map((e) => liquiditypool_1.PoolRoute.fromJSON(e));
|
|
133
141
|
return message;
|
|
134
142
|
},
|
|
135
143
|
toJSON(message) {
|
|
@@ -188,10 +196,16 @@ exports.GenesisState = {
|
|
|
188
196
|
: undefined);
|
|
189
197
|
message.params !== undefined &&
|
|
190
198
|
(obj.params = message.params ? liquiditypool_1.Params.toJSON(message.params) : undefined);
|
|
199
|
+
if (message.poolRoutes) {
|
|
200
|
+
obj.poolRoutes = message.poolRoutes.map((e) => e ? liquiditypool_1.PoolRoute.toJSON(e) : undefined);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
obj.poolRoutes = [];
|
|
204
|
+
}
|
|
191
205
|
return obj;
|
|
192
206
|
},
|
|
193
207
|
fromPartial(object) {
|
|
194
|
-
var _a, _b, _c, _d, _e, _f;
|
|
208
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
195
209
|
const message = Object.assign({}, baseGenesisState);
|
|
196
210
|
message.pools = ((_a = object.pools) !== null && _a !== void 0 ? _a : []).map((e) => liquiditypool_1.Pool.fromPartial(e));
|
|
197
211
|
message.rewardCurve =
|
|
@@ -219,6 +233,7 @@ exports.GenesisState = {
|
|
|
219
233
|
object.params !== undefined && object.params !== null
|
|
220
234
|
? liquiditypool_1.Params.fromPartial(object.params)
|
|
221
235
|
: undefined;
|
|
236
|
+
message.poolRoutes = ((_g = object.poolRoutes) !== null && _g !== void 0 ? _g : []).map((e) => liquiditypool_1.PoolRoute.fromPartial(e));
|
|
222
237
|
return message;
|
|
223
238
|
},
|
|
224
239
|
};
|
|
@@ -4,6 +4,7 @@ export declare const protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
|
4
4
|
/** Params defines the parameters for the liquiditypool module. */
|
|
5
5
|
export interface Params {
|
|
6
6
|
rewardReductionThreshold: Long;
|
|
7
|
+
numQuotes: Long;
|
|
7
8
|
}
|
|
8
9
|
export interface Pool {
|
|
9
10
|
creator: string;
|
|
@@ -19,6 +20,7 @@ export interface Pool {
|
|
|
19
20
|
swapFee: string;
|
|
20
21
|
numQuotes: Long;
|
|
21
22
|
sharesAmount: string;
|
|
23
|
+
/** deprecated to use pool routes */
|
|
22
24
|
market: string;
|
|
23
25
|
ampBps: Long;
|
|
24
26
|
vAmountA: string;
|
|
@@ -27,6 +29,11 @@ export interface Pool {
|
|
|
27
29
|
export interface Pools {
|
|
28
30
|
pools: Pool[];
|
|
29
31
|
}
|
|
32
|
+
export interface PoolRoute {
|
|
33
|
+
market: string;
|
|
34
|
+
poolIds: Long[];
|
|
35
|
+
numQuotes: Long;
|
|
36
|
+
}
|
|
30
37
|
export interface AddLiquidity {
|
|
31
38
|
creator: string;
|
|
32
39
|
id: Long;
|
|
@@ -45,6 +52,18 @@ export interface RemoveLiquidity {
|
|
|
45
52
|
export interface RemoveLiquidities {
|
|
46
53
|
removeLiquidities: RemoveLiquidity[];
|
|
47
54
|
}
|
|
55
|
+
export interface RemovePoolRoutes {
|
|
56
|
+
removePoolRoutes: Uint8Array[];
|
|
57
|
+
}
|
|
58
|
+
export interface PoolReserve {
|
|
59
|
+
id: Long;
|
|
60
|
+
amountA: string;
|
|
61
|
+
weightA: string;
|
|
62
|
+
amountB: string;
|
|
63
|
+
weightB: string;
|
|
64
|
+
vAmountA: string;
|
|
65
|
+
vAmountB: string;
|
|
66
|
+
}
|
|
48
67
|
export declare const Params: {
|
|
49
68
|
encode(message: Params, writer?: _m0.Writer): _m0.Writer;
|
|
50
69
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
|
|
@@ -66,6 +85,13 @@ export declare const Pools: {
|
|
|
66
85
|
toJSON(message: Pools): unknown;
|
|
67
86
|
fromPartial(object: DeepPartial<Pools>): Pools;
|
|
68
87
|
};
|
|
88
|
+
export declare const PoolRoute: {
|
|
89
|
+
encode(message: PoolRoute, writer?: _m0.Writer): _m0.Writer;
|
|
90
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PoolRoute;
|
|
91
|
+
fromJSON(object: any): PoolRoute;
|
|
92
|
+
toJSON(message: PoolRoute): unknown;
|
|
93
|
+
fromPartial(object: DeepPartial<PoolRoute>): PoolRoute;
|
|
94
|
+
};
|
|
69
95
|
export declare const AddLiquidity: {
|
|
70
96
|
encode(message: AddLiquidity, writer?: _m0.Writer): _m0.Writer;
|
|
71
97
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AddLiquidity;
|
|
@@ -94,6 +120,20 @@ export declare const RemoveLiquidities: {
|
|
|
94
120
|
toJSON(message: RemoveLiquidities): unknown;
|
|
95
121
|
fromPartial(object: DeepPartial<RemoveLiquidities>): RemoveLiquidities;
|
|
96
122
|
};
|
|
123
|
+
export declare const RemovePoolRoutes: {
|
|
124
|
+
encode(message: RemovePoolRoutes, writer?: _m0.Writer): _m0.Writer;
|
|
125
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RemovePoolRoutes;
|
|
126
|
+
fromJSON(object: any): RemovePoolRoutes;
|
|
127
|
+
toJSON(message: RemovePoolRoutes): unknown;
|
|
128
|
+
fromPartial(object: DeepPartial<RemovePoolRoutes>): RemovePoolRoutes;
|
|
129
|
+
};
|
|
130
|
+
export declare const PoolReserve: {
|
|
131
|
+
encode(message: PoolReserve, writer?: _m0.Writer): _m0.Writer;
|
|
132
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PoolReserve;
|
|
133
|
+
fromJSON(object: any): PoolReserve;
|
|
134
|
+
toJSON(message: PoolReserve): unknown;
|
|
135
|
+
fromPartial(object: DeepPartial<PoolReserve>): PoolReserve;
|
|
136
|
+
};
|
|
97
137
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
98
138
|
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 {} ? {
|
|
99
139
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,17 +3,23 @@ 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.RemoveLiquidities = exports.RemoveLiquidity = exports.AddLiquidities = exports.AddLiquidity = exports.Pools = exports.Pool = exports.Params = exports.protobufPackage = void 0;
|
|
6
|
+
exports.PoolReserve = exports.RemovePoolRoutes = exports.RemoveLiquidities = exports.RemoveLiquidity = exports.AddLiquidities = exports.AddLiquidity = exports.PoolRoute = exports.Pools = exports.Pool = exports.Params = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
10
|
exports.protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
11
|
-
const baseParams = {
|
|
11
|
+
const baseParams = {
|
|
12
|
+
rewardReductionThreshold: long_1.default.UZERO,
|
|
13
|
+
numQuotes: long_1.default.UZERO,
|
|
14
|
+
};
|
|
12
15
|
exports.Params = {
|
|
13
16
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
14
17
|
if (!message.rewardReductionThreshold.isZero()) {
|
|
15
18
|
writer.uint32(8).uint64(message.rewardReductionThreshold);
|
|
16
19
|
}
|
|
20
|
+
if (!message.numQuotes.isZero()) {
|
|
21
|
+
writer.uint32(16).uint64(message.numQuotes);
|
|
22
|
+
}
|
|
17
23
|
return writer;
|
|
18
24
|
},
|
|
19
25
|
decode(input, length) {
|
|
@@ -26,6 +32,9 @@ exports.Params = {
|
|
|
26
32
|
case 1:
|
|
27
33
|
message.rewardReductionThreshold = reader.uint64();
|
|
28
34
|
break;
|
|
35
|
+
case 2:
|
|
36
|
+
message.numQuotes = reader.uint64();
|
|
37
|
+
break;
|
|
29
38
|
default:
|
|
30
39
|
reader.skipType(tag & 7);
|
|
31
40
|
break;
|
|
@@ -40,12 +49,18 @@ exports.Params = {
|
|
|
40
49
|
object.rewardReductionThreshold !== null
|
|
41
50
|
? long_1.default.fromString(object.rewardReductionThreshold)
|
|
42
51
|
: long_1.default.UZERO;
|
|
52
|
+
message.numQuotes =
|
|
53
|
+
object.numQuotes !== undefined && object.numQuotes !== null
|
|
54
|
+
? long_1.default.fromString(object.numQuotes)
|
|
55
|
+
: long_1.default.UZERO;
|
|
43
56
|
return message;
|
|
44
57
|
},
|
|
45
58
|
toJSON(message) {
|
|
46
59
|
const obj = {};
|
|
47
60
|
message.rewardReductionThreshold !== undefined &&
|
|
48
61
|
(obj.rewardReductionThreshold = (message.rewardReductionThreshold || long_1.default.UZERO).toString());
|
|
62
|
+
message.numQuotes !== undefined &&
|
|
63
|
+
(obj.numQuotes = (message.numQuotes || long_1.default.UZERO).toString());
|
|
49
64
|
return obj;
|
|
50
65
|
},
|
|
51
66
|
fromPartial(object) {
|
|
@@ -55,6 +70,10 @@ exports.Params = {
|
|
|
55
70
|
object.rewardReductionThreshold !== null
|
|
56
71
|
? long_1.default.fromValue(object.rewardReductionThreshold)
|
|
57
72
|
: long_1.default.UZERO;
|
|
73
|
+
message.numQuotes =
|
|
74
|
+
object.numQuotes !== undefined && object.numQuotes !== null
|
|
75
|
+
? long_1.default.fromValue(object.numQuotes)
|
|
76
|
+
: long_1.default.UZERO;
|
|
58
77
|
return message;
|
|
59
78
|
},
|
|
60
79
|
};
|
|
@@ -375,6 +394,97 @@ exports.Pools = {
|
|
|
375
394
|
return message;
|
|
376
395
|
},
|
|
377
396
|
};
|
|
397
|
+
const basePoolRoute = {
|
|
398
|
+
market: "",
|
|
399
|
+
poolIds: long_1.default.UZERO,
|
|
400
|
+
numQuotes: long_1.default.ZERO,
|
|
401
|
+
};
|
|
402
|
+
exports.PoolRoute = {
|
|
403
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
404
|
+
if (message.market !== "") {
|
|
405
|
+
writer.uint32(10).string(message.market);
|
|
406
|
+
}
|
|
407
|
+
writer.uint32(18).fork();
|
|
408
|
+
for (const v of message.poolIds) {
|
|
409
|
+
writer.uint64(v);
|
|
410
|
+
}
|
|
411
|
+
writer.ldelim();
|
|
412
|
+
if (!message.numQuotes.isZero()) {
|
|
413
|
+
writer.uint32(24).int64(message.numQuotes);
|
|
414
|
+
}
|
|
415
|
+
return writer;
|
|
416
|
+
},
|
|
417
|
+
decode(input, length) {
|
|
418
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
419
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
420
|
+
const message = Object.assign({}, basePoolRoute);
|
|
421
|
+
message.poolIds = [];
|
|
422
|
+
while (reader.pos < end) {
|
|
423
|
+
const tag = reader.uint32();
|
|
424
|
+
switch (tag >>> 3) {
|
|
425
|
+
case 1:
|
|
426
|
+
message.market = reader.string();
|
|
427
|
+
break;
|
|
428
|
+
case 2:
|
|
429
|
+
if ((tag & 7) === 2) {
|
|
430
|
+
const end2 = reader.uint32() + reader.pos;
|
|
431
|
+
while (reader.pos < end2) {
|
|
432
|
+
message.poolIds.push(reader.uint64());
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
message.poolIds.push(reader.uint64());
|
|
437
|
+
}
|
|
438
|
+
break;
|
|
439
|
+
case 3:
|
|
440
|
+
message.numQuotes = reader.int64();
|
|
441
|
+
break;
|
|
442
|
+
default:
|
|
443
|
+
reader.skipType(tag & 7);
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
return message;
|
|
448
|
+
},
|
|
449
|
+
fromJSON(object) {
|
|
450
|
+
var _a;
|
|
451
|
+
const message = Object.assign({}, basePoolRoute);
|
|
452
|
+
message.market =
|
|
453
|
+
object.market !== undefined && object.market !== null
|
|
454
|
+
? String(object.market)
|
|
455
|
+
: "";
|
|
456
|
+
message.poolIds = ((_a = object.poolIds) !== null && _a !== void 0 ? _a : []).map((e) => long_1.default.fromString(e));
|
|
457
|
+
message.numQuotes =
|
|
458
|
+
object.numQuotes !== undefined && object.numQuotes !== null
|
|
459
|
+
? long_1.default.fromString(object.numQuotes)
|
|
460
|
+
: long_1.default.ZERO;
|
|
461
|
+
return message;
|
|
462
|
+
},
|
|
463
|
+
toJSON(message) {
|
|
464
|
+
const obj = {};
|
|
465
|
+
message.market !== undefined && (obj.market = message.market);
|
|
466
|
+
if (message.poolIds) {
|
|
467
|
+
obj.poolIds = message.poolIds.map((e) => (e || long_1.default.UZERO).toString());
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
obj.poolIds = [];
|
|
471
|
+
}
|
|
472
|
+
message.numQuotes !== undefined &&
|
|
473
|
+
(obj.numQuotes = (message.numQuotes || long_1.default.ZERO).toString());
|
|
474
|
+
return obj;
|
|
475
|
+
},
|
|
476
|
+
fromPartial(object) {
|
|
477
|
+
var _a, _b;
|
|
478
|
+
const message = Object.assign({}, basePoolRoute);
|
|
479
|
+
message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
|
|
480
|
+
message.poolIds = ((_b = object.poolIds) !== null && _b !== void 0 ? _b : []).map((e) => long_1.default.fromValue(e));
|
|
481
|
+
message.numQuotes =
|
|
482
|
+
object.numQuotes !== undefined && object.numQuotes !== null
|
|
483
|
+
? long_1.default.fromValue(object.numQuotes)
|
|
484
|
+
: long_1.default.ZERO;
|
|
485
|
+
return message;
|
|
486
|
+
},
|
|
487
|
+
};
|
|
378
488
|
const baseAddLiquidity = {
|
|
379
489
|
creator: "",
|
|
380
490
|
id: long_1.default.UZERO,
|
|
@@ -649,6 +759,214 @@ exports.RemoveLiquidities = {
|
|
|
649
759
|
return message;
|
|
650
760
|
},
|
|
651
761
|
};
|
|
762
|
+
const baseRemovePoolRoutes = {};
|
|
763
|
+
exports.RemovePoolRoutes = {
|
|
764
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
765
|
+
for (const v of message.removePoolRoutes) {
|
|
766
|
+
writer.uint32(10).bytes(v);
|
|
767
|
+
}
|
|
768
|
+
return writer;
|
|
769
|
+
},
|
|
770
|
+
decode(input, length) {
|
|
771
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
772
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
773
|
+
const message = Object.assign({}, baseRemovePoolRoutes);
|
|
774
|
+
message.removePoolRoutes = [];
|
|
775
|
+
while (reader.pos < end) {
|
|
776
|
+
const tag = reader.uint32();
|
|
777
|
+
switch (tag >>> 3) {
|
|
778
|
+
case 1:
|
|
779
|
+
message.removePoolRoutes.push(reader.bytes());
|
|
780
|
+
break;
|
|
781
|
+
default:
|
|
782
|
+
reader.skipType(tag & 7);
|
|
783
|
+
break;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
return message;
|
|
787
|
+
},
|
|
788
|
+
fromJSON(object) {
|
|
789
|
+
var _a;
|
|
790
|
+
const message = Object.assign({}, baseRemovePoolRoutes);
|
|
791
|
+
message.removePoolRoutes = ((_a = object.removePoolRoutes) !== null && _a !== void 0 ? _a : []).map((e) => bytesFromBase64(e));
|
|
792
|
+
return message;
|
|
793
|
+
},
|
|
794
|
+
toJSON(message) {
|
|
795
|
+
const obj = {};
|
|
796
|
+
if (message.removePoolRoutes) {
|
|
797
|
+
obj.removePoolRoutes = message.removePoolRoutes.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
|
|
798
|
+
}
|
|
799
|
+
else {
|
|
800
|
+
obj.removePoolRoutes = [];
|
|
801
|
+
}
|
|
802
|
+
return obj;
|
|
803
|
+
},
|
|
804
|
+
fromPartial(object) {
|
|
805
|
+
var _a;
|
|
806
|
+
const message = Object.assign({}, baseRemovePoolRoutes);
|
|
807
|
+
message.removePoolRoutes = ((_a = object.removePoolRoutes) !== null && _a !== void 0 ? _a : []).map((e) => e);
|
|
808
|
+
return message;
|
|
809
|
+
},
|
|
810
|
+
};
|
|
811
|
+
const basePoolReserve = {
|
|
812
|
+
id: long_1.default.UZERO,
|
|
813
|
+
amountA: "",
|
|
814
|
+
weightA: "",
|
|
815
|
+
amountB: "",
|
|
816
|
+
weightB: "",
|
|
817
|
+
vAmountA: "",
|
|
818
|
+
vAmountB: "",
|
|
819
|
+
};
|
|
820
|
+
exports.PoolReserve = {
|
|
821
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
822
|
+
if (!message.id.isZero()) {
|
|
823
|
+
writer.uint32(8).uint64(message.id);
|
|
824
|
+
}
|
|
825
|
+
if (message.amountA !== "") {
|
|
826
|
+
writer.uint32(18).string(message.amountA);
|
|
827
|
+
}
|
|
828
|
+
if (message.weightA !== "") {
|
|
829
|
+
writer.uint32(26).string(message.weightA);
|
|
830
|
+
}
|
|
831
|
+
if (message.amountB !== "") {
|
|
832
|
+
writer.uint32(34).string(message.amountB);
|
|
833
|
+
}
|
|
834
|
+
if (message.weightB !== "") {
|
|
835
|
+
writer.uint32(42).string(message.weightB);
|
|
836
|
+
}
|
|
837
|
+
if (message.vAmountA !== "") {
|
|
838
|
+
writer.uint32(50).string(message.vAmountA);
|
|
839
|
+
}
|
|
840
|
+
if (message.vAmountB !== "") {
|
|
841
|
+
writer.uint32(58).string(message.vAmountB);
|
|
842
|
+
}
|
|
843
|
+
return writer;
|
|
844
|
+
},
|
|
845
|
+
decode(input, length) {
|
|
846
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
847
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
848
|
+
const message = Object.assign({}, basePoolReserve);
|
|
849
|
+
while (reader.pos < end) {
|
|
850
|
+
const tag = reader.uint32();
|
|
851
|
+
switch (tag >>> 3) {
|
|
852
|
+
case 1:
|
|
853
|
+
message.id = reader.uint64();
|
|
854
|
+
break;
|
|
855
|
+
case 2:
|
|
856
|
+
message.amountA = reader.string();
|
|
857
|
+
break;
|
|
858
|
+
case 3:
|
|
859
|
+
message.weightA = reader.string();
|
|
860
|
+
break;
|
|
861
|
+
case 4:
|
|
862
|
+
message.amountB = reader.string();
|
|
863
|
+
break;
|
|
864
|
+
case 5:
|
|
865
|
+
message.weightB = reader.string();
|
|
866
|
+
break;
|
|
867
|
+
case 6:
|
|
868
|
+
message.vAmountA = reader.string();
|
|
869
|
+
break;
|
|
870
|
+
case 7:
|
|
871
|
+
message.vAmountB = reader.string();
|
|
872
|
+
break;
|
|
873
|
+
default:
|
|
874
|
+
reader.skipType(tag & 7);
|
|
875
|
+
break;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return message;
|
|
879
|
+
},
|
|
880
|
+
fromJSON(object) {
|
|
881
|
+
const message = Object.assign({}, basePoolReserve);
|
|
882
|
+
message.id =
|
|
883
|
+
object.id !== undefined && object.id !== null
|
|
884
|
+
? long_1.default.fromString(object.id)
|
|
885
|
+
: long_1.default.UZERO;
|
|
886
|
+
message.amountA =
|
|
887
|
+
object.amountA !== undefined && object.amountA !== null
|
|
888
|
+
? String(object.amountA)
|
|
889
|
+
: "";
|
|
890
|
+
message.weightA =
|
|
891
|
+
object.weightA !== undefined && object.weightA !== null
|
|
892
|
+
? String(object.weightA)
|
|
893
|
+
: "";
|
|
894
|
+
message.amountB =
|
|
895
|
+
object.amountB !== undefined && object.amountB !== null
|
|
896
|
+
? String(object.amountB)
|
|
897
|
+
: "";
|
|
898
|
+
message.weightB =
|
|
899
|
+
object.weightB !== undefined && object.weightB !== null
|
|
900
|
+
? String(object.weightB)
|
|
901
|
+
: "";
|
|
902
|
+
message.vAmountA =
|
|
903
|
+
object.vAmountA !== undefined && object.vAmountA !== null
|
|
904
|
+
? String(object.vAmountA)
|
|
905
|
+
: "";
|
|
906
|
+
message.vAmountB =
|
|
907
|
+
object.vAmountB !== undefined && object.vAmountB !== null
|
|
908
|
+
? String(object.vAmountB)
|
|
909
|
+
: "";
|
|
910
|
+
return message;
|
|
911
|
+
},
|
|
912
|
+
toJSON(message) {
|
|
913
|
+
const obj = {};
|
|
914
|
+
message.id !== undefined &&
|
|
915
|
+
(obj.id = (message.id || long_1.default.UZERO).toString());
|
|
916
|
+
message.amountA !== undefined && (obj.amountA = message.amountA);
|
|
917
|
+
message.weightA !== undefined && (obj.weightA = message.weightA);
|
|
918
|
+
message.amountB !== undefined && (obj.amountB = message.amountB);
|
|
919
|
+
message.weightB !== undefined && (obj.weightB = message.weightB);
|
|
920
|
+
message.vAmountA !== undefined && (obj.vAmountA = message.vAmountA);
|
|
921
|
+
message.vAmountB !== undefined && (obj.vAmountB = message.vAmountB);
|
|
922
|
+
return obj;
|
|
923
|
+
},
|
|
924
|
+
fromPartial(object) {
|
|
925
|
+
var _a, _b, _c, _d, _e, _f;
|
|
926
|
+
const message = Object.assign({}, basePoolReserve);
|
|
927
|
+
message.id =
|
|
928
|
+
object.id !== undefined && object.id !== null
|
|
929
|
+
? long_1.default.fromValue(object.id)
|
|
930
|
+
: long_1.default.UZERO;
|
|
931
|
+
message.amountA = (_a = object.amountA) !== null && _a !== void 0 ? _a : "";
|
|
932
|
+
message.weightA = (_b = object.weightA) !== null && _b !== void 0 ? _b : "";
|
|
933
|
+
message.amountB = (_c = object.amountB) !== null && _c !== void 0 ? _c : "";
|
|
934
|
+
message.weightB = (_d = object.weightB) !== null && _d !== void 0 ? _d : "";
|
|
935
|
+
message.vAmountA = (_e = object.vAmountA) !== null && _e !== void 0 ? _e : "";
|
|
936
|
+
message.vAmountB = (_f = object.vAmountB) !== null && _f !== void 0 ? _f : "";
|
|
937
|
+
return message;
|
|
938
|
+
},
|
|
939
|
+
};
|
|
940
|
+
var globalThis = (() => {
|
|
941
|
+
if (typeof globalThis !== "undefined")
|
|
942
|
+
return globalThis;
|
|
943
|
+
if (typeof self !== "undefined")
|
|
944
|
+
return self;
|
|
945
|
+
if (typeof window !== "undefined")
|
|
946
|
+
return window;
|
|
947
|
+
if (typeof global !== "undefined")
|
|
948
|
+
return global;
|
|
949
|
+
throw "Unable to locate global object";
|
|
950
|
+
})();
|
|
951
|
+
const atob = globalThis.atob ||
|
|
952
|
+
((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
|
|
953
|
+
function bytesFromBase64(b64) {
|
|
954
|
+
const bin = atob(b64);
|
|
955
|
+
const arr = new Uint8Array(bin.length);
|
|
956
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
957
|
+
arr[i] = bin.charCodeAt(i);
|
|
958
|
+
}
|
|
959
|
+
return arr;
|
|
960
|
+
}
|
|
961
|
+
const btoa = globalThis.btoa ||
|
|
962
|
+
((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
|
|
963
|
+
function base64FromBytes(arr) {
|
|
964
|
+
const bin = [];
|
|
965
|
+
for (const byte of arr) {
|
|
966
|
+
bin.push(String.fromCharCode(byte));
|
|
967
|
+
}
|
|
968
|
+
return btoa(bin.join(""));
|
|
969
|
+
}
|
|
652
970
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
653
971
|
minimal_1.default.util.Long = long_1.default;
|
|
654
972
|
minimal_1.default.configure();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { LinkPoolParams, UnlinkPoolParams, SetRewardCurveParams, SetCommitmentCurveParams, SetRewardsWeightsParams, UpdatePoolParams } from "./tx";
|
|
3
|
+
import { LinkPoolParams, UnlinkPoolParams, SetRewardCurveParams, SetCommitmentCurveParams, SetRewardsWeightsParams, UpdatePoolParams, CreatePoolRouteParams, RemovePoolRouteParams, UpdatePoolRouteParams } from "./tx";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.liquiditypool";
|
|
5
5
|
export interface LinkPoolProposal {
|
|
6
6
|
title: string;
|
|
@@ -32,6 +32,21 @@ export interface UpdatePoolProposal {
|
|
|
32
32
|
description: string;
|
|
33
33
|
msg?: UpdatePoolParams;
|
|
34
34
|
}
|
|
35
|
+
export interface CreatePoolRouteProposal {
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
msg?: CreatePoolRouteParams;
|
|
39
|
+
}
|
|
40
|
+
export interface RemovePoolRouteProposal {
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
msg?: RemovePoolRouteParams;
|
|
44
|
+
}
|
|
45
|
+
export interface UpdatePoolRouteProposal {
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
msg?: UpdatePoolRouteParams;
|
|
49
|
+
}
|
|
35
50
|
export declare const LinkPoolProposal: {
|
|
36
51
|
encode(message: LinkPoolProposal, writer?: _m0.Writer): _m0.Writer;
|
|
37
52
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): LinkPoolProposal;
|
|
@@ -74,6 +89,27 @@ export declare const UpdatePoolProposal: {
|
|
|
74
89
|
toJSON(message: UpdatePoolProposal): unknown;
|
|
75
90
|
fromPartial(object: DeepPartial<UpdatePoolProposal>): UpdatePoolProposal;
|
|
76
91
|
};
|
|
92
|
+
export declare const CreatePoolRouteProposal: {
|
|
93
|
+
encode(message: CreatePoolRouteProposal, writer?: _m0.Writer): _m0.Writer;
|
|
94
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CreatePoolRouteProposal;
|
|
95
|
+
fromJSON(object: any): CreatePoolRouteProposal;
|
|
96
|
+
toJSON(message: CreatePoolRouteProposal): unknown;
|
|
97
|
+
fromPartial(object: DeepPartial<CreatePoolRouteProposal>): CreatePoolRouteProposal;
|
|
98
|
+
};
|
|
99
|
+
export declare const RemovePoolRouteProposal: {
|
|
100
|
+
encode(message: RemovePoolRouteProposal, writer?: _m0.Writer): _m0.Writer;
|
|
101
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RemovePoolRouteProposal;
|
|
102
|
+
fromJSON(object: any): RemovePoolRouteProposal;
|
|
103
|
+
toJSON(message: RemovePoolRouteProposal): unknown;
|
|
104
|
+
fromPartial(object: DeepPartial<RemovePoolRouteProposal>): RemovePoolRouteProposal;
|
|
105
|
+
};
|
|
106
|
+
export declare const UpdatePoolRouteProposal: {
|
|
107
|
+
encode(message: UpdatePoolRouteProposal, writer?: _m0.Writer): _m0.Writer;
|
|
108
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UpdatePoolRouteProposal;
|
|
109
|
+
fromJSON(object: any): UpdatePoolRouteProposal;
|
|
110
|
+
toJSON(message: UpdatePoolRouteProposal): unknown;
|
|
111
|
+
fromPartial(object: DeepPartial<UpdatePoolRouteProposal>): UpdatePoolRouteProposal;
|
|
112
|
+
};
|
|
77
113
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
78
114
|
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 {} ? {
|
|
79
115
|
[K in keyof T]?: DeepPartial<T[K]>;
|