@uniswap/client-liquidity 1.4.7 → 1.4.9
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
2
2
|
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
3
3
|
import { ChainId, NFTPermitData, PermitBatchData, Protocols, TransactionRequest, V3Position } from "../v1/types_pb.js";
|
|
4
|
-
import { ApprovalTransactionRequest, CreatePoolParameters, CreatePositionExistingPoolParameters, CreateToken, GasUrgency, HistoryDuration, HookEntry, LPAction, LPToken, PoolListCursor, PoolPricePoint, PoolReference, PoolSortBy, PoolSummary, PoolTick, PoolVolumeBucket, Position, PositionListCursor, PositionModifier, PositionPriceBounds, PositionStatus, PositionTickBounds, RangeStatus, V2PoolParameters } from "./types_pb.js";
|
|
4
|
+
import { ApprovalTransactionRequest, CreatePoolParameters, CreatePositionExistingPoolParameters, CreateToken, GasUrgency, HistoryDuration, HookEntry, LPAction, LPToken, PoolListCursor, PoolPricePoint, PoolReference, PoolSortBy, PoolSummary, PoolTick, PoolVolumeBucket, Position, PositionListCursor, PositionModifier, PositionPriceBounds, PositionSortBy, PositionStatus, PositionTickBounds, RangeStatus, V2PoolParameters } from "./types_pb.js";
|
|
5
5
|
/**
|
|
6
6
|
* MigrateV2ToV3LPPosition
|
|
7
7
|
*
|
|
@@ -1164,6 +1164,19 @@ export declare class GetWalletPositionsRequest extends Message<GetWalletPosition
|
|
|
1164
1164
|
* @generated from field: repeated uniswap.liquidity.v2.RangeStatus range_statuses = 8;
|
|
1165
1165
|
*/
|
|
1166
1166
|
rangeStatuses: RangeStatus[];
|
|
1167
|
+
/**
|
|
1168
|
+
* Sort order. Unset/UNSPECIFIED = default (chain, version, key). FEES/APR are
|
|
1169
|
+
* accepted but currently no-op (see PositionSortBy).
|
|
1170
|
+
*
|
|
1171
|
+
* @generated from field: optional uniswap.liquidity.v2.PositionSortBy sort_by = 9;
|
|
1172
|
+
*/
|
|
1173
|
+
sortBy?: PositionSortBy;
|
|
1174
|
+
/**
|
|
1175
|
+
* Sort direction; defaults to descending (newest / largest first).
|
|
1176
|
+
*
|
|
1177
|
+
* @generated from field: optional bool ascending = 10;
|
|
1178
|
+
*/
|
|
1179
|
+
ascending?: boolean;
|
|
1167
1180
|
constructor(data?: PartialMessage<GetWalletPositionsRequest>);
|
|
1168
1181
|
static readonly runtime: typeof proto3;
|
|
1169
1182
|
static readonly typeName = "uniswap.liquidity.v2.GetWalletPositionsRequest";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
6
6
|
import { ChainId, NFTPermitData, PermitBatchData, Protocols, TransactionRequest, V3Position } from "../v1/types_pb.js";
|
|
7
|
-
import { ApprovalTransactionRequest, CreatePoolParameters, CreatePositionExistingPoolParameters, CreateToken, GasUrgency, HistoryDuration, HookEntry, LPAction, LPToken, PoolListCursor, PoolPricePoint, PoolReference, PoolSortBy, PoolSummary, PoolTick, PoolVolumeBucket, Position, PositionListCursor, PositionModifier, PositionPriceBounds, PositionStatus, PositionTickBounds, RangeStatus, V2PoolParameters } from "./types_pb.js";
|
|
7
|
+
import { ApprovalTransactionRequest, CreatePoolParameters, CreatePositionExistingPoolParameters, CreateToken, GasUrgency, HistoryDuration, HookEntry, LPAction, LPToken, PoolListCursor, PoolPricePoint, PoolReference, PoolSortBy, PoolSummary, PoolTick, PoolVolumeBucket, Position, PositionListCursor, PositionModifier, PositionPriceBounds, PositionSortBy, PositionStatus, PositionTickBounds, RangeStatus, V2PoolParameters } from "./types_pb.js";
|
|
8
8
|
/**
|
|
9
9
|
* MigrateV2ToV3LPPosition
|
|
10
10
|
*
|
|
@@ -1223,6 +1223,8 @@ GetWalletPositionsRequest.fields = proto3.util.newFieldList(() => [
|
|
|
1223
1223
|
{ no: 6, name: "statuses", kind: "enum", T: proto3.getEnumType(PositionStatus), repeated: true },
|
|
1224
1224
|
{ no: 7, name: "modifier", kind: "message", T: PositionModifier, opt: true },
|
|
1225
1225
|
{ no: 8, name: "range_statuses", kind: "enum", T: proto3.getEnumType(RangeStatus), repeated: true },
|
|
1226
|
+
{ no: 9, name: "sort_by", kind: "enum", T: proto3.getEnumType(PositionSortBy), opt: true },
|
|
1227
|
+
{ no: 10, name: "ascending", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
1226
1228
|
]);
|
|
1227
1229
|
/**
|
|
1228
1230
|
* @generated from message uniswap.liquidity.v2.GetWalletPositionsResponse
|
|
@@ -185,6 +185,52 @@ export declare enum RangeStatus {
|
|
|
185
185
|
*/
|
|
186
186
|
OUT_OF_RANGE = 2
|
|
187
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Sort order for GetWalletPositions. UNSPECIFIED keeps the default deterministic
|
|
190
|
+
* order (chain asc, version, per-version key). Each real sort still resolves
|
|
191
|
+
* ties by that key so the keyset cursor stays stable.
|
|
192
|
+
*
|
|
193
|
+
* @generated from enum uniswap.liquidity.v2.PositionSortBy
|
|
194
|
+
*/
|
|
195
|
+
export declare enum PositionSortBy {
|
|
196
|
+
/**
|
|
197
|
+
* @generated from enum value: POSITION_SORT_BY_UNSPECIFIED = 0;
|
|
198
|
+
*/
|
|
199
|
+
UNSPECIFIED = 0,
|
|
200
|
+
/**
|
|
201
|
+
* created_at_timestamp — the position's on-chain creation time.
|
|
202
|
+
*
|
|
203
|
+
* @generated from enum value: POSITION_SORT_BY_CREATED_AT = 1;
|
|
204
|
+
*/
|
|
205
|
+
CREATED_AT = 1,
|
|
206
|
+
/**
|
|
207
|
+
* Range proximity, derived purely from ticks (current tick vs the position's
|
|
208
|
+
* [tick_lower, tick_upper)). V3/V4 only; V2 sorts last.
|
|
209
|
+
*
|
|
210
|
+
* @generated from enum value: POSITION_SORT_BY_DISTRIBUTION = 2;
|
|
211
|
+
*/
|
|
212
|
+
DISTRIBUTION = 2,
|
|
213
|
+
/**
|
|
214
|
+
* Position USD value, computed read-time (position amounts * token prices —
|
|
215
|
+
* "sort after join", not materialized). V3/V4 amounts come from pool state +
|
|
216
|
+
* liquidity; V2 from the LP-token share of pair reserves.
|
|
217
|
+
*
|
|
218
|
+
* @generated from enum value: POSITION_SORT_BY_LIQUIDITY = 3;
|
|
219
|
+
*/
|
|
220
|
+
LIQUIDITY = 3,
|
|
221
|
+
/**
|
|
222
|
+
* NO-OP: uncollected-fee data is not ingested yet.
|
|
223
|
+
*
|
|
224
|
+
* @generated from enum value: POSITION_SORT_BY_FEES = 4;
|
|
225
|
+
*/
|
|
226
|
+
FEES = 4,
|
|
227
|
+
/**
|
|
228
|
+
* NO-OP: APR depends on fee data that is not ingested yet.
|
|
229
|
+
*
|
|
230
|
+
* @generated from enum value: POSITION_SORT_BY_APR = 5;
|
|
231
|
+
*/
|
|
232
|
+
APR = 5
|
|
233
|
+
}
|
|
188
234
|
/**
|
|
189
235
|
* @generated from message uniswap.liquidity.v2.LPToken
|
|
190
236
|
*/
|
|
@@ -738,11 +784,16 @@ export declare class PoolReference extends Message<PoolReference> {
|
|
|
738
784
|
*/
|
|
739
785
|
addressOrId: string;
|
|
740
786
|
/**
|
|
741
|
-
*
|
|
787
|
+
* Optional for GetPool: a pool-detail URL has only address + chain, so the
|
|
788
|
+
* service resolves the version from address_or_id (V4 pool ids are 64-hex; a
|
|
789
|
+
* 40-hex address is probed against v3 then v2 metadata). Required by the other
|
|
790
|
+
* pool endpoints (ticks/history), whose callers already have the version from
|
|
791
|
+
* GetPool's response. When set, it's authoritative and skips resolution.
|
|
792
|
+
* Unset (or POOL_PROTOCOL_UNSPECIFIED) means "resolve from the identifier".
|
|
742
793
|
*
|
|
743
|
-
* @generated from field: uniswap.liquidity.v2.PoolProtocol version = 3;
|
|
794
|
+
* @generated from field: optional uniswap.liquidity.v2.PoolProtocol version = 3;
|
|
744
795
|
*/
|
|
745
|
-
version
|
|
796
|
+
version?: PoolProtocol;
|
|
746
797
|
constructor(data?: PartialMessage<PoolReference>);
|
|
747
798
|
static readonly runtime: typeof proto3;
|
|
748
799
|
static readonly typeName = "uniswap.liquidity.v2.PoolReference";
|
|
@@ -1048,6 +1099,8 @@ export declare class Position extends Message<Position> {
|
|
|
1048
1099
|
*/
|
|
1049
1100
|
export declare class PositionListCursor extends Message<PositionListCursor> {
|
|
1050
1101
|
/**
|
|
1102
|
+
* Default (unsorted) order uses a keyset cursor: (chain, version, key).
|
|
1103
|
+
*
|
|
1051
1104
|
* @generated from field: int32 chain_id = 1;
|
|
1052
1105
|
*/
|
|
1053
1106
|
chainId: number;
|
|
@@ -1059,6 +1112,14 @@ export declare class PositionListCursor extends Message<PositionListCursor> {
|
|
|
1059
1112
|
* @generated from field: string position_key = 3;
|
|
1060
1113
|
*/
|
|
1061
1114
|
positionKey: string;
|
|
1115
|
+
/**
|
|
1116
|
+
* Sorted order (sort_by set) uses an offset cursor instead: the count already
|
|
1117
|
+
* returned. A wallet's positions are a bounded set, so sorted requests read +
|
|
1118
|
+
* sort the whole set and page by offset. Unset in default order.
|
|
1119
|
+
*
|
|
1120
|
+
* @generated from field: optional int32 offset = 4;
|
|
1121
|
+
*/
|
|
1122
|
+
offset?: number;
|
|
1062
1123
|
constructor(data?: PartialMessage<PositionListCursor>);
|
|
1063
1124
|
static readonly runtime: typeof proto3;
|
|
1064
1125
|
static readonly typeName = "uniswap.liquidity.v2.PositionListCursor";
|
|
@@ -245,6 +245,62 @@ proto3.util.setEnumType(RangeStatus, "uniswap.liquidity.v2.RangeStatus", [
|
|
|
245
245
|
{ no: 1, name: "RANGE_STATUS_IN_RANGE" },
|
|
246
246
|
{ no: 2, name: "RANGE_STATUS_OUT_OF_RANGE" },
|
|
247
247
|
]);
|
|
248
|
+
/**
|
|
249
|
+
* Sort order for GetWalletPositions. UNSPECIFIED keeps the default deterministic
|
|
250
|
+
* order (chain asc, version, per-version key). Each real sort still resolves
|
|
251
|
+
* ties by that key so the keyset cursor stays stable.
|
|
252
|
+
*
|
|
253
|
+
* @generated from enum uniswap.liquidity.v2.PositionSortBy
|
|
254
|
+
*/
|
|
255
|
+
export var PositionSortBy;
|
|
256
|
+
(function (PositionSortBy) {
|
|
257
|
+
/**
|
|
258
|
+
* @generated from enum value: POSITION_SORT_BY_UNSPECIFIED = 0;
|
|
259
|
+
*/
|
|
260
|
+
PositionSortBy[PositionSortBy["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
261
|
+
/**
|
|
262
|
+
* created_at_timestamp — the position's on-chain creation time.
|
|
263
|
+
*
|
|
264
|
+
* @generated from enum value: POSITION_SORT_BY_CREATED_AT = 1;
|
|
265
|
+
*/
|
|
266
|
+
PositionSortBy[PositionSortBy["CREATED_AT"] = 1] = "CREATED_AT";
|
|
267
|
+
/**
|
|
268
|
+
* Range proximity, derived purely from ticks (current tick vs the position's
|
|
269
|
+
* [tick_lower, tick_upper)). V3/V4 only; V2 sorts last.
|
|
270
|
+
*
|
|
271
|
+
* @generated from enum value: POSITION_SORT_BY_DISTRIBUTION = 2;
|
|
272
|
+
*/
|
|
273
|
+
PositionSortBy[PositionSortBy["DISTRIBUTION"] = 2] = "DISTRIBUTION";
|
|
274
|
+
/**
|
|
275
|
+
* Position USD value, computed read-time (position amounts * token prices —
|
|
276
|
+
* "sort after join", not materialized). V3/V4 amounts come from pool state +
|
|
277
|
+
* liquidity; V2 from the LP-token share of pair reserves.
|
|
278
|
+
*
|
|
279
|
+
* @generated from enum value: POSITION_SORT_BY_LIQUIDITY = 3;
|
|
280
|
+
*/
|
|
281
|
+
PositionSortBy[PositionSortBy["LIQUIDITY"] = 3] = "LIQUIDITY";
|
|
282
|
+
/**
|
|
283
|
+
* NO-OP: uncollected-fee data is not ingested yet.
|
|
284
|
+
*
|
|
285
|
+
* @generated from enum value: POSITION_SORT_BY_FEES = 4;
|
|
286
|
+
*/
|
|
287
|
+
PositionSortBy[PositionSortBy["FEES"] = 4] = "FEES";
|
|
288
|
+
/**
|
|
289
|
+
* NO-OP: APR depends on fee data that is not ingested yet.
|
|
290
|
+
*
|
|
291
|
+
* @generated from enum value: POSITION_SORT_BY_APR = 5;
|
|
292
|
+
*/
|
|
293
|
+
PositionSortBy[PositionSortBy["APR"] = 5] = "APR";
|
|
294
|
+
})(PositionSortBy || (PositionSortBy = {}));
|
|
295
|
+
// Retrieve enum metadata with: proto3.getEnumType(PositionSortBy)
|
|
296
|
+
proto3.util.setEnumType(PositionSortBy, "uniswap.liquidity.v2.PositionSortBy", [
|
|
297
|
+
{ no: 0, name: "POSITION_SORT_BY_UNSPECIFIED" },
|
|
298
|
+
{ no: 1, name: "POSITION_SORT_BY_CREATED_AT" },
|
|
299
|
+
{ no: 2, name: "POSITION_SORT_BY_DISTRIBUTION" },
|
|
300
|
+
{ no: 3, name: "POSITION_SORT_BY_LIQUIDITY" },
|
|
301
|
+
{ no: 4, name: "POSITION_SORT_BY_FEES" },
|
|
302
|
+
{ no: 5, name: "POSITION_SORT_BY_APR" },
|
|
303
|
+
]);
|
|
248
304
|
/**
|
|
249
305
|
* @generated from message uniswap.liquidity.v2.LPToken
|
|
250
306
|
*/
|
|
@@ -973,12 +1029,6 @@ export class PoolReference extends Message {
|
|
|
973
1029
|
* @generated from field: string address_or_id = 2;
|
|
974
1030
|
*/
|
|
975
1031
|
this.addressOrId = "";
|
|
976
|
-
/**
|
|
977
|
-
* POOL_PROTOCOL_UNSPECIFIED rejected as invalid_argument
|
|
978
|
-
*
|
|
979
|
-
* @generated from field: uniswap.liquidity.v2.PoolProtocol version = 3;
|
|
980
|
-
*/
|
|
981
|
-
this.version = PoolProtocol.UNSPECIFIED;
|
|
982
1032
|
proto3.util.initPartial(data, this);
|
|
983
1033
|
}
|
|
984
1034
|
static fromBinary(bytes, options) {
|
|
@@ -999,7 +1049,7 @@ PoolReference.typeName = "uniswap.liquidity.v2.PoolReference";
|
|
|
999
1049
|
PoolReference.fields = proto3.util.newFieldList(() => [
|
|
1000
1050
|
{ no: 1, name: "chain_id", kind: "enum", T: proto3.getEnumType(ChainId) },
|
|
1001
1051
|
{ no: 2, name: "address_or_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
1002
|
-
{ no: 3, name: "version", kind: "enum", T: proto3.getEnumType(PoolProtocol) },
|
|
1052
|
+
{ no: 3, name: "version", kind: "enum", T: proto3.getEnumType(PoolProtocol), opt: true },
|
|
1003
1053
|
]);
|
|
1004
1054
|
/**
|
|
1005
1055
|
* One point of a pool's relative-price history, in raw pool-token
|
|
@@ -1292,6 +1342,8 @@ export class PositionListCursor extends Message {
|
|
|
1292
1342
|
constructor(data) {
|
|
1293
1343
|
super();
|
|
1294
1344
|
/**
|
|
1345
|
+
* Default (unsorted) order uses a keyset cursor: (chain, version, key).
|
|
1346
|
+
*
|
|
1295
1347
|
* @generated from field: int32 chain_id = 1;
|
|
1296
1348
|
*/
|
|
1297
1349
|
this.chainId = 0;
|
|
@@ -1324,6 +1376,7 @@ PositionListCursor.fields = proto3.util.newFieldList(() => [
|
|
|
1324
1376
|
{ no: 1, name: "chain_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
1325
1377
|
{ no: 2, name: "version", kind: "enum", T: proto3.getEnumType(Protocols) },
|
|
1326
1378
|
{ no: 3, name: "position_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
1379
|
+
{ no: 4, name: "offset", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
|
|
1327
1380
|
]);
|
|
1328
1381
|
/**
|
|
1329
1382
|
* One initialized tick of a V3/V4 pool's liquidity distribution.
|