@uniswap/client-trading 0.11.22 → 0.12.0
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/dist/trading/v1/api_pb.d.ts +63 -27
- package/dist/trading/v1/api_pb.js +58 -30
- package/package.json +1 -1
|
@@ -2966,6 +2966,10 @@ export declare class V4PoolInRoute extends Message<V4PoolInRoute> {
|
|
|
2966
2966
|
* @generated from field: optional string min_hop_price_x36 = 13;
|
|
2967
2967
|
*/
|
|
2968
2968
|
minHopPriceX36?: string;
|
|
2969
|
+
/**
|
|
2970
|
+
* @generated from field: optional bool settle_before_swap = 14;
|
|
2971
|
+
*/
|
|
2972
|
+
settleBeforeSwap?: boolean;
|
|
2969
2973
|
constructor(data?: PartialMessage<V4PoolInRoute>);
|
|
2970
2974
|
static readonly runtime: typeof proto3;
|
|
2971
2975
|
static readonly typeName = "trading.v1.V4PoolInRoute";
|
|
@@ -8242,13 +8246,15 @@ export declare class MarginTokenMetadata extends Message<MarginTokenMetadata> {
|
|
|
8242
8246
|
static equals(a: MarginTokenMetadata | PlainMessage<MarginTokenMetadata> | undefined, b: MarginTokenMetadata | PlainMessage<MarginTokenMetadata> | undefined): boolean;
|
|
8243
8247
|
}
|
|
8244
8248
|
/**
|
|
8245
|
-
*
|
|
8246
|
-
*
|
|
8247
|
-
*
|
|
8249
|
+
* One market serving the pair, for the advanced breakdown. A venue can list
|
|
8250
|
+
* several, each its own entry under its own market_id. The row's max_leverage
|
|
8251
|
+
* is the HEADLINE market's: the `venue_markets` entry with the greatest
|
|
8252
|
+
* max_leverage, the first listed on a tie. `headline_market_id` names it, and
|
|
8253
|
+
* `headline_venue` names only its venue, which several entries can share.
|
|
8248
8254
|
*
|
|
8249
|
-
* @generated from message trading.v1.
|
|
8255
|
+
* @generated from message trading.v1.MarginVenueMarket
|
|
8250
8256
|
*/
|
|
8251
|
-
export declare class
|
|
8257
|
+
export declare class MarginVenueMarket extends Message<MarginVenueMarket> {
|
|
8252
8258
|
/**
|
|
8253
8259
|
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
8254
8260
|
*/
|
|
@@ -8292,14 +8298,25 @@ export declare class MarginMarketVenue extends Message<MarginMarketVenue> {
|
|
|
8292
8298
|
* @generated from field: optional string available_borrow_liquidity = 7;
|
|
8293
8299
|
*/
|
|
8294
8300
|
availableBorrowLiquidity?: string;
|
|
8295
|
-
|
|
8301
|
+
/**
|
|
8302
|
+
* The market's id, what `open.market_id` names on POST /margin/quote: "0x"
|
|
8303
|
+
* and the lowercase hex sha256 of the UTF-8 string
|
|
8304
|
+
* "<chain_id>:<venue>:<venue market id>". The venue is morpho_blue, aave_v3
|
|
8305
|
+
* or aave_v4, and the venue market id is the venue's own id for the market
|
|
8306
|
+
* in lowercase: Morpho's market id, "<collateral>:<debt>" on Aave v3, and
|
|
8307
|
+
* "<spoke>:<collateral reserve id>:<debt reserve id>" on Aave v4.
|
|
8308
|
+
*
|
|
8309
|
+
* @generated from field: string market_id = 8;
|
|
8310
|
+
*/
|
|
8311
|
+
marketId: string;
|
|
8312
|
+
constructor(data?: PartialMessage<MarginVenueMarket>);
|
|
8296
8313
|
static readonly runtime: typeof proto3;
|
|
8297
|
-
static readonly typeName = "trading.v1.
|
|
8314
|
+
static readonly typeName = "trading.v1.MarginVenueMarket";
|
|
8298
8315
|
static readonly fields: FieldList;
|
|
8299
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>):
|
|
8300
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>):
|
|
8301
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>):
|
|
8302
|
-
static equals(a:
|
|
8316
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginVenueMarket;
|
|
8317
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginVenueMarket;
|
|
8318
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginVenueMarket;
|
|
8319
|
+
static equals(a: MarginVenueMarket | PlainMessage<MarginVenueMarket> | undefined, b: MarginVenueMarket | PlainMessage<MarginVenueMarket> | undefined): boolean;
|
|
8303
8320
|
}
|
|
8304
8321
|
/**
|
|
8305
8322
|
* One row per (exposure_token, counter_token, direction).
|
|
@@ -8320,26 +8337,35 @@ export declare class MarginMarketRow extends Message<MarginMarketRow> {
|
|
|
8320
8337
|
*/
|
|
8321
8338
|
direction: MarginDirection;
|
|
8322
8339
|
/**
|
|
8323
|
-
* The venue
|
|
8324
|
-
*
|
|
8325
|
-
* requested leverage and lend the required amount.
|
|
8340
|
+
* The venue of the headline market, the one behind max_leverage. Several
|
|
8341
|
+
* `venue_markets` entries can share it, so it does not name the market.
|
|
8326
8342
|
*
|
|
8327
8343
|
* @generated from field: trading.v1.MarginVenue headline_venue = 4;
|
|
8328
8344
|
*/
|
|
8329
8345
|
headlineVenue: MarginVenue;
|
|
8330
8346
|
/**
|
|
8331
|
-
* The
|
|
8332
|
-
*
|
|
8333
|
-
*
|
|
8334
|
-
*
|
|
8347
|
+
* The market_id of the headline market, the one behind max_leverage: always
|
|
8348
|
+
* the market_id of one of `venue_markets`. A quote opens on the market its
|
|
8349
|
+
* `open.market_id` names, which need not be this one.
|
|
8350
|
+
*
|
|
8351
|
+
* @generated from field: string headline_market_id = 7;
|
|
8352
|
+
*/
|
|
8353
|
+
headlineMarketId: string;
|
|
8354
|
+
/**
|
|
8355
|
+
* The furthest any market on the row goes. Each market's own ceiling, the
|
|
8356
|
+
* one its quote refuses above, is on `venue_markets` beside its rate and
|
|
8357
|
+
* LTV. A quote under it can still refuse once its swap is priced.
|
|
8335
8358
|
*
|
|
8336
8359
|
* @generated from field: string max_leverage = 5;
|
|
8337
8360
|
*/
|
|
8338
8361
|
maxLeverage: string;
|
|
8339
8362
|
/**
|
|
8340
|
-
*
|
|
8363
|
+
* Every market serving the pair that is open to new positions, one entry per
|
|
8364
|
+
* market: a venue with several markets on the pair appears once for each.
|
|
8365
|
+
*
|
|
8366
|
+
* @generated from field: repeated trading.v1.MarginVenueMarket venue_markets = 6;
|
|
8341
8367
|
*/
|
|
8342
|
-
|
|
8368
|
+
venueMarkets: MarginVenueMarket[];
|
|
8343
8369
|
constructor(data?: PartialMessage<MarginMarketRow>);
|
|
8344
8370
|
static readonly runtime: typeof proto3;
|
|
8345
8371
|
static readonly typeName = "trading.v1.MarginMarketRow";
|
|
@@ -8633,17 +8659,19 @@ export declare class MarginOpenAction extends Message<MarginOpenAction> {
|
|
|
8633
8659
|
* @generated from field: string leverage_target = 1;
|
|
8634
8660
|
*/
|
|
8635
8661
|
leverageTarget: string;
|
|
8636
|
-
/**
|
|
8637
|
-
* The LENDING allowlist, distinct from `swap_config.protocols` (the AMM
|
|
8638
|
-
* allowlist for the wallet-side swap).
|
|
8639
|
-
*
|
|
8640
|
-
* @generated from field: repeated trading.v1.MarginVenue venues = 2;
|
|
8641
|
-
*/
|
|
8642
|
-
venues: MarginVenue[];
|
|
8643
8662
|
/**
|
|
8644
8663
|
* @generated from field: string amount = 3;
|
|
8645
8664
|
*/
|
|
8646
8665
|
amount: string;
|
|
8666
|
+
/**
|
|
8667
|
+
* The market to open on, as GET /margin/markets lists it in
|
|
8668
|
+
* `venue_markets[].market_id`: "0x" and the sha256 of
|
|
8669
|
+
* "<chain_id>:<venue>:<venue market id>", 32 bytes of hex. The quote prices
|
|
8670
|
+
* this market alone and never falls back to another.
|
|
8671
|
+
*
|
|
8672
|
+
* @generated from field: string market_id = 4;
|
|
8673
|
+
*/
|
|
8674
|
+
marketId: string;
|
|
8647
8675
|
constructor(data?: PartialMessage<MarginOpenAction>);
|
|
8648
8676
|
static readonly runtime: typeof proto3;
|
|
8649
8677
|
static readonly typeName = "trading.v1.MarginOpenAction";
|
|
@@ -8925,6 +8953,14 @@ export declare class MarginExecutionLeg extends Message<MarginExecutionLeg> {
|
|
|
8925
8953
|
* @generated from field: repeated trading.v1.MarginOperation operations = 3;
|
|
8926
8954
|
*/
|
|
8927
8955
|
operations: MarginOperation[];
|
|
8956
|
+
/**
|
|
8957
|
+
* Open only: the market the quote priced, which POST /plan opens on, by the
|
|
8958
|
+
* sha256 id `open.market_id` names it by, in lowercase. Absent on manage
|
|
8959
|
+
* actions, whose market is the position's.
|
|
8960
|
+
*
|
|
8961
|
+
* @generated from field: optional string market_id = 4;
|
|
8962
|
+
*/
|
|
8963
|
+
marketId?: string;
|
|
8928
8964
|
constructor(data?: PartialMessage<MarginExecutionLeg>);
|
|
8929
8965
|
static readonly runtime: typeof proto3;
|
|
8930
8966
|
static readonly typeName = "trading.v1.MarginExecutionLeg";
|
|
@@ -3538,6 +3538,7 @@ V4PoolInRoute.fields = proto3.util.newFieldList(() => [
|
|
|
3538
3538
|
{ no: 11, name: "amount_in", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3539
3539
|
{ no: 12, name: "amount_out", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3540
3540
|
{ no: 13, name: "min_hop_price_x36", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3541
|
+
{ no: 14, name: "settle_before_swap", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
3541
3542
|
]);
|
|
3542
3543
|
/**
|
|
3543
3544
|
* @generated from message trading.v1.TokenInRoute
|
|
@@ -9578,13 +9579,15 @@ MarginTokenMetadata.fields = proto3.util.newFieldList(() => [
|
|
|
9578
9579
|
{ no: 3, name: "decimals", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
9579
9580
|
]);
|
|
9580
9581
|
/**
|
|
9581
|
-
*
|
|
9582
|
-
*
|
|
9583
|
-
*
|
|
9582
|
+
* One market serving the pair, for the advanced breakdown. A venue can list
|
|
9583
|
+
* several, each its own entry under its own market_id. The row's max_leverage
|
|
9584
|
+
* is the HEADLINE market's: the `venue_markets` entry with the greatest
|
|
9585
|
+
* max_leverage, the first listed on a tie. `headline_market_id` names it, and
|
|
9586
|
+
* `headline_venue` names only its venue, which several entries can share.
|
|
9584
9587
|
*
|
|
9585
|
-
* @generated from message trading.v1.
|
|
9588
|
+
* @generated from message trading.v1.MarginVenueMarket
|
|
9586
9589
|
*/
|
|
9587
|
-
export class
|
|
9590
|
+
export class MarginVenueMarket extends Message {
|
|
9588
9591
|
constructor(data) {
|
|
9589
9592
|
super();
|
|
9590
9593
|
/**
|
|
@@ -9609,24 +9612,35 @@ export class MarginMarketVenue extends Message {
|
|
|
9609
9612
|
* @generated from field: string lltv = 5;
|
|
9610
9613
|
*/
|
|
9611
9614
|
this.lltv = "";
|
|
9615
|
+
/**
|
|
9616
|
+
* The market's id, what `open.market_id` names on POST /margin/quote: "0x"
|
|
9617
|
+
* and the lowercase hex sha256 of the UTF-8 string
|
|
9618
|
+
* "<chain_id>:<venue>:<venue market id>". The venue is morpho_blue, aave_v3
|
|
9619
|
+
* or aave_v4, and the venue market id is the venue's own id for the market
|
|
9620
|
+
* in lowercase: Morpho's market id, "<collateral>:<debt>" on Aave v3, and
|
|
9621
|
+
* "<spoke>:<collateral reserve id>:<debt reserve id>" on Aave v4.
|
|
9622
|
+
*
|
|
9623
|
+
* @generated from field: string market_id = 8;
|
|
9624
|
+
*/
|
|
9625
|
+
this.marketId = "";
|
|
9612
9626
|
proto3.util.initPartial(data, this);
|
|
9613
9627
|
}
|
|
9614
9628
|
static fromBinary(bytes, options) {
|
|
9615
|
-
return new
|
|
9629
|
+
return new MarginVenueMarket().fromBinary(bytes, options);
|
|
9616
9630
|
}
|
|
9617
9631
|
static fromJson(jsonValue, options) {
|
|
9618
|
-
return new
|
|
9632
|
+
return new MarginVenueMarket().fromJson(jsonValue, options);
|
|
9619
9633
|
}
|
|
9620
9634
|
static fromJsonString(jsonString, options) {
|
|
9621
|
-
return new
|
|
9635
|
+
return new MarginVenueMarket().fromJsonString(jsonString, options);
|
|
9622
9636
|
}
|
|
9623
9637
|
static equals(a, b) {
|
|
9624
|
-
return proto3.util.equals(
|
|
9638
|
+
return proto3.util.equals(MarginVenueMarket, a, b);
|
|
9625
9639
|
}
|
|
9626
9640
|
}
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9641
|
+
MarginVenueMarket.runtime = proto3;
|
|
9642
|
+
MarginVenueMarket.typeName = "trading.v1.MarginVenueMarket";
|
|
9643
|
+
MarginVenueMarket.fields = proto3.util.newFieldList(() => [
|
|
9630
9644
|
{ no: 1, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
9631
9645
|
{ no: 2, name: "adapter", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9632
9646
|
{ no: 3, name: "venue_market_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
@@ -9634,6 +9648,7 @@ MarginMarketVenue.fields = proto3.util.newFieldList(() => [
|
|
|
9634
9648
|
{ no: 5, name: "lltv", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9635
9649
|
{ no: 6, name: "borrow_rate", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
9636
9650
|
{ no: 7, name: "available_borrow_liquidity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
9651
|
+
{ no: 8, name: "market_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9637
9652
|
]);
|
|
9638
9653
|
/**
|
|
9639
9654
|
* One row per (exposure_token, counter_token, direction).
|
|
@@ -9648,26 +9663,35 @@ export class MarginMarketRow extends Message {
|
|
|
9648
9663
|
*/
|
|
9649
9664
|
this.direction = MarginDirection.LONG;
|
|
9650
9665
|
/**
|
|
9651
|
-
* The venue
|
|
9652
|
-
*
|
|
9653
|
-
* requested leverage and lend the required amount.
|
|
9666
|
+
* The venue of the headline market, the one behind max_leverage. Several
|
|
9667
|
+
* `venue_markets` entries can share it, so it does not name the market.
|
|
9654
9668
|
*
|
|
9655
9669
|
* @generated from field: trading.v1.MarginVenue headline_venue = 4;
|
|
9656
9670
|
*/
|
|
9657
9671
|
this.headlineVenue = MarginVenue.MORPHO;
|
|
9658
9672
|
/**
|
|
9659
|
-
* The
|
|
9660
|
-
*
|
|
9661
|
-
*
|
|
9662
|
-
*
|
|
9673
|
+
* The market_id of the headline market, the one behind max_leverage: always
|
|
9674
|
+
* the market_id of one of `venue_markets`. A quote opens on the market its
|
|
9675
|
+
* `open.market_id` names, which need not be this one.
|
|
9676
|
+
*
|
|
9677
|
+
* @generated from field: string headline_market_id = 7;
|
|
9678
|
+
*/
|
|
9679
|
+
this.headlineMarketId = "";
|
|
9680
|
+
/**
|
|
9681
|
+
* The furthest any market on the row goes. Each market's own ceiling, the
|
|
9682
|
+
* one its quote refuses above, is on `venue_markets` beside its rate and
|
|
9683
|
+
* LTV. A quote under it can still refuse once its swap is priced.
|
|
9663
9684
|
*
|
|
9664
9685
|
* @generated from field: string max_leverage = 5;
|
|
9665
9686
|
*/
|
|
9666
9687
|
this.maxLeverage = "";
|
|
9667
9688
|
/**
|
|
9668
|
-
*
|
|
9689
|
+
* Every market serving the pair that is open to new positions, one entry per
|
|
9690
|
+
* market: a venue with several markets on the pair appears once for each.
|
|
9691
|
+
*
|
|
9692
|
+
* @generated from field: repeated trading.v1.MarginVenueMarket venue_markets = 6;
|
|
9669
9693
|
*/
|
|
9670
|
-
this.
|
|
9694
|
+
this.venueMarkets = [];
|
|
9671
9695
|
proto3.util.initPartial(data, this);
|
|
9672
9696
|
}
|
|
9673
9697
|
static fromBinary(bytes, options) {
|
|
@@ -9690,8 +9714,9 @@ MarginMarketRow.fields = proto3.util.newFieldList(() => [
|
|
|
9690
9714
|
{ no: 2, name: "counter_token", kind: "message", T: MarginTokenMetadata },
|
|
9691
9715
|
{ no: 3, name: "direction", kind: "enum", T: proto3.getEnumType(MarginDirection) },
|
|
9692
9716
|
{ no: 4, name: "headline_venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
9717
|
+
{ no: 7, name: "headline_market_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9693
9718
|
{ no: 5, name: "max_leverage", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9694
|
-
{ no: 6, name: "
|
|
9719
|
+
{ no: 6, name: "venue_markets", kind: "message", T: MarginVenueMarket, repeated: true },
|
|
9695
9720
|
]);
|
|
9696
9721
|
/**
|
|
9697
9722
|
* Discovery for the market picker. Indicative by construction: rates move every
|
|
@@ -10067,17 +10092,19 @@ export class MarginOpenAction extends Message {
|
|
|
10067
10092
|
* @generated from field: string leverage_target = 1;
|
|
10068
10093
|
*/
|
|
10069
10094
|
this.leverageTarget = "";
|
|
10070
|
-
/**
|
|
10071
|
-
* The LENDING allowlist, distinct from `swap_config.protocols` (the AMM
|
|
10072
|
-
* allowlist for the wallet-side swap).
|
|
10073
|
-
*
|
|
10074
|
-
* @generated from field: repeated trading.v1.MarginVenue venues = 2;
|
|
10075
|
-
*/
|
|
10076
|
-
this.venues = [];
|
|
10077
10095
|
/**
|
|
10078
10096
|
* @generated from field: string amount = 3;
|
|
10079
10097
|
*/
|
|
10080
10098
|
this.amount = "";
|
|
10099
|
+
/**
|
|
10100
|
+
* The market to open on, as GET /margin/markets lists it in
|
|
10101
|
+
* `venue_markets[].market_id`: "0x" and the sha256 of
|
|
10102
|
+
* "<chain_id>:<venue>:<venue market id>", 32 bytes of hex. The quote prices
|
|
10103
|
+
* this market alone and never falls back to another.
|
|
10104
|
+
*
|
|
10105
|
+
* @generated from field: string market_id = 4;
|
|
10106
|
+
*/
|
|
10107
|
+
this.marketId = "";
|
|
10081
10108
|
proto3.util.initPartial(data, this);
|
|
10082
10109
|
}
|
|
10083
10110
|
static fromBinary(bytes, options) {
|
|
@@ -10097,8 +10124,8 @@ MarginOpenAction.runtime = proto3;
|
|
|
10097
10124
|
MarginOpenAction.typeName = "trading.v1.MarginOpenAction";
|
|
10098
10125
|
MarginOpenAction.fields = proto3.util.newFieldList(() => [
|
|
10099
10126
|
{ no: 1, name: "leverage_target", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10100
|
-
{ no: 2, name: "venues", kind: "enum", T: proto3.getEnumType(MarginVenue), repeated: true },
|
|
10101
10127
|
{ no: 3, name: "amount", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10128
|
+
{ no: 4, name: "market_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10102
10129
|
]);
|
|
10103
10130
|
/**
|
|
10104
10131
|
* EXECUTION POLICY for the wallet-side swap, and nothing else. It names no
|
|
@@ -10296,6 +10323,7 @@ MarginExecutionLeg.fields = proto3.util.newFieldList(() => [
|
|
|
10296
10323
|
{ no: 1, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
10297
10324
|
{ no: 2, name: "sub_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10298
10325
|
{ no: 3, name: "operations", kind: "message", T: MarginOperation, repeated: true },
|
|
10326
|
+
{ no: 4, name: "market_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10299
10327
|
]);
|
|
10300
10328
|
/**
|
|
10301
10329
|
* The wallet-side funding as priced, in the same shape /quote uses for an
|