@uniswap/client-trading 0.11.23 → 0.12.1
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 +68 -27
- package/dist/trading/v1/api_pb.js +58 -30
- package/package.json +1 -1
|
@@ -8246,13 +8246,15 @@ export declare class MarginTokenMetadata extends Message<MarginTokenMetadata> {
|
|
|
8246
8246
|
static equals(a: MarginTokenMetadata | PlainMessage<MarginTokenMetadata> | undefined, b: MarginTokenMetadata | PlainMessage<MarginTokenMetadata> | undefined): boolean;
|
|
8247
8247
|
}
|
|
8248
8248
|
/**
|
|
8249
|
-
*
|
|
8250
|
-
*
|
|
8251
|
-
*
|
|
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.
|
|
8252
8254
|
*
|
|
8253
|
-
* @generated from message trading.v1.
|
|
8255
|
+
* @generated from message trading.v1.MarginVenueMarket
|
|
8254
8256
|
*/
|
|
8255
|
-
export declare class
|
|
8257
|
+
export declare class MarginVenueMarket extends Message<MarginVenueMarket> {
|
|
8256
8258
|
/**
|
|
8257
8259
|
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
8258
8260
|
*/
|
|
@@ -8296,14 +8298,25 @@ export declare class MarginMarketVenue extends Message<MarginMarketVenue> {
|
|
|
8296
8298
|
* @generated from field: optional string available_borrow_liquidity = 7;
|
|
8297
8299
|
*/
|
|
8298
8300
|
availableBorrowLiquidity?: string;
|
|
8299
|
-
|
|
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>);
|
|
8300
8313
|
static readonly runtime: typeof proto3;
|
|
8301
|
-
static readonly typeName = "trading.v1.
|
|
8314
|
+
static readonly typeName = "trading.v1.MarginVenueMarket";
|
|
8302
8315
|
static readonly fields: FieldList;
|
|
8303
|
-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>):
|
|
8304
|
-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>):
|
|
8305
|
-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>):
|
|
8306
|
-
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;
|
|
8307
8320
|
}
|
|
8308
8321
|
/**
|
|
8309
8322
|
* One row per (exposure_token, counter_token, direction).
|
|
@@ -8324,26 +8337,35 @@ export declare class MarginMarketRow extends Message<MarginMarketRow> {
|
|
|
8324
8337
|
*/
|
|
8325
8338
|
direction: MarginDirection;
|
|
8326
8339
|
/**
|
|
8327
|
-
* The venue
|
|
8328
|
-
*
|
|
8329
|
-
* 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.
|
|
8330
8342
|
*
|
|
8331
8343
|
* @generated from field: trading.v1.MarginVenue headline_venue = 4;
|
|
8332
8344
|
*/
|
|
8333
8345
|
headlineVenue: MarginVenue;
|
|
8334
8346
|
/**
|
|
8335
|
-
* The
|
|
8336
|
-
*
|
|
8337
|
-
*
|
|
8338
|
-
*
|
|
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.
|
|
8339
8358
|
*
|
|
8340
8359
|
* @generated from field: string max_leverage = 5;
|
|
8341
8360
|
*/
|
|
8342
8361
|
maxLeverage: string;
|
|
8343
8362
|
/**
|
|
8344
|
-
*
|
|
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;
|
|
8345
8367
|
*/
|
|
8346
|
-
|
|
8368
|
+
venueMarkets: MarginVenueMarket[];
|
|
8347
8369
|
constructor(data?: PartialMessage<MarginMarketRow>);
|
|
8348
8370
|
static readonly runtime: typeof proto3;
|
|
8349
8371
|
static readonly typeName = "trading.v1.MarginMarketRow";
|
|
@@ -8637,17 +8659,19 @@ export declare class MarginOpenAction extends Message<MarginOpenAction> {
|
|
|
8637
8659
|
* @generated from field: string leverage_target = 1;
|
|
8638
8660
|
*/
|
|
8639
8661
|
leverageTarget: string;
|
|
8640
|
-
/**
|
|
8641
|
-
* The LENDING allowlist, distinct from `swap_config.protocols` (the AMM
|
|
8642
|
-
* allowlist for the wallet-side swap).
|
|
8643
|
-
*
|
|
8644
|
-
* @generated from field: repeated trading.v1.MarginVenue venues = 2;
|
|
8645
|
-
*/
|
|
8646
|
-
venues: MarginVenue[];
|
|
8647
8662
|
/**
|
|
8648
8663
|
* @generated from field: string amount = 3;
|
|
8649
8664
|
*/
|
|
8650
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;
|
|
8651
8675
|
constructor(data?: PartialMessage<MarginOpenAction>);
|
|
8652
8676
|
static readonly runtime: typeof proto3;
|
|
8653
8677
|
static readonly typeName = "trading.v1.MarginOpenAction";
|
|
@@ -8929,6 +8953,14 @@ export declare class MarginExecutionLeg extends Message<MarginExecutionLeg> {
|
|
|
8929
8953
|
* @generated from field: repeated trading.v1.MarginOperation operations = 3;
|
|
8930
8954
|
*/
|
|
8931
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;
|
|
8932
8964
|
constructor(data?: PartialMessage<MarginExecutionLeg>);
|
|
8933
8965
|
static readonly runtime: typeof proto3;
|
|
8934
8966
|
static readonly typeName = "trading.v1.MarginExecutionLeg";
|
|
@@ -9405,6 +9437,15 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
9405
9437
|
* @generated from field: optional string collateral_at_open = 28;
|
|
9406
9438
|
*/
|
|
9407
9439
|
collateralAtOpen?: string;
|
|
9440
|
+
/**
|
|
9441
|
+
* The collateral held right after the open over the equity deposited at the
|
|
9442
|
+
* open, as a decimal string formatted like `leverage`. Served on every
|
|
9443
|
+
* status. Absent when the store has not indexed the position, or did not
|
|
9444
|
+
* track the open's deposit.
|
|
9445
|
+
*
|
|
9446
|
+
* @generated from field: optional string leverage_at_open = 39;
|
|
9447
|
+
*/
|
|
9448
|
+
leverageAtOpen?: string;
|
|
9408
9449
|
/**
|
|
9409
9450
|
* From the position store: the lifecycle whose every event
|
|
9410
9451
|
* `GET /margin/positions/activity` serves. Absent for a position the store
|
|
@@ -9579,13 +9579,15 @@ MarginTokenMetadata.fields = proto3.util.newFieldList(() => [
|
|
|
9579
9579
|
{ no: 3, name: "decimals", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
9580
9580
|
]);
|
|
9581
9581
|
/**
|
|
9582
|
-
*
|
|
9583
|
-
*
|
|
9584
|
-
*
|
|
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.
|
|
9585
9587
|
*
|
|
9586
|
-
* @generated from message trading.v1.
|
|
9588
|
+
* @generated from message trading.v1.MarginVenueMarket
|
|
9587
9589
|
*/
|
|
9588
|
-
export class
|
|
9590
|
+
export class MarginVenueMarket extends Message {
|
|
9589
9591
|
constructor(data) {
|
|
9590
9592
|
super();
|
|
9591
9593
|
/**
|
|
@@ -9610,24 +9612,35 @@ export class MarginMarketVenue extends Message {
|
|
|
9610
9612
|
* @generated from field: string lltv = 5;
|
|
9611
9613
|
*/
|
|
9612
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 = "";
|
|
9613
9626
|
proto3.util.initPartial(data, this);
|
|
9614
9627
|
}
|
|
9615
9628
|
static fromBinary(bytes, options) {
|
|
9616
|
-
return new
|
|
9629
|
+
return new MarginVenueMarket().fromBinary(bytes, options);
|
|
9617
9630
|
}
|
|
9618
9631
|
static fromJson(jsonValue, options) {
|
|
9619
|
-
return new
|
|
9632
|
+
return new MarginVenueMarket().fromJson(jsonValue, options);
|
|
9620
9633
|
}
|
|
9621
9634
|
static fromJsonString(jsonString, options) {
|
|
9622
|
-
return new
|
|
9635
|
+
return new MarginVenueMarket().fromJsonString(jsonString, options);
|
|
9623
9636
|
}
|
|
9624
9637
|
static equals(a, b) {
|
|
9625
|
-
return proto3.util.equals(
|
|
9638
|
+
return proto3.util.equals(MarginVenueMarket, a, b);
|
|
9626
9639
|
}
|
|
9627
9640
|
}
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9641
|
+
MarginVenueMarket.runtime = proto3;
|
|
9642
|
+
MarginVenueMarket.typeName = "trading.v1.MarginVenueMarket";
|
|
9643
|
+
MarginVenueMarket.fields = proto3.util.newFieldList(() => [
|
|
9631
9644
|
{ no: 1, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
9632
9645
|
{ no: 2, name: "adapter", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9633
9646
|
{ no: 3, name: "venue_market_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
@@ -9635,6 +9648,7 @@ MarginMarketVenue.fields = proto3.util.newFieldList(() => [
|
|
|
9635
9648
|
{ no: 5, name: "lltv", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9636
9649
|
{ no: 6, name: "borrow_rate", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
9637
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 */ },
|
|
9638
9652
|
]);
|
|
9639
9653
|
/**
|
|
9640
9654
|
* One row per (exposure_token, counter_token, direction).
|
|
@@ -9649,26 +9663,35 @@ export class MarginMarketRow extends Message {
|
|
|
9649
9663
|
*/
|
|
9650
9664
|
this.direction = MarginDirection.LONG;
|
|
9651
9665
|
/**
|
|
9652
|
-
* The venue
|
|
9653
|
-
*
|
|
9654
|
-
* 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.
|
|
9655
9668
|
*
|
|
9656
9669
|
* @generated from field: trading.v1.MarginVenue headline_venue = 4;
|
|
9657
9670
|
*/
|
|
9658
9671
|
this.headlineVenue = MarginVenue.MORPHO;
|
|
9659
9672
|
/**
|
|
9660
|
-
* The
|
|
9661
|
-
*
|
|
9662
|
-
*
|
|
9663
|
-
*
|
|
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.
|
|
9664
9684
|
*
|
|
9665
9685
|
* @generated from field: string max_leverage = 5;
|
|
9666
9686
|
*/
|
|
9667
9687
|
this.maxLeverage = "";
|
|
9668
9688
|
/**
|
|
9669
|
-
*
|
|
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;
|
|
9670
9693
|
*/
|
|
9671
|
-
this.
|
|
9694
|
+
this.venueMarkets = [];
|
|
9672
9695
|
proto3.util.initPartial(data, this);
|
|
9673
9696
|
}
|
|
9674
9697
|
static fromBinary(bytes, options) {
|
|
@@ -9691,8 +9714,9 @@ MarginMarketRow.fields = proto3.util.newFieldList(() => [
|
|
|
9691
9714
|
{ no: 2, name: "counter_token", kind: "message", T: MarginTokenMetadata },
|
|
9692
9715
|
{ no: 3, name: "direction", kind: "enum", T: proto3.getEnumType(MarginDirection) },
|
|
9693
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 */ },
|
|
9694
9718
|
{ no: 5, name: "max_leverage", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
9695
|
-
{ no: 6, name: "
|
|
9719
|
+
{ no: 6, name: "venue_markets", kind: "message", T: MarginVenueMarket, repeated: true },
|
|
9696
9720
|
]);
|
|
9697
9721
|
/**
|
|
9698
9722
|
* Discovery for the market picker. Indicative by construction: rates move every
|
|
@@ -10068,17 +10092,19 @@ export class MarginOpenAction extends Message {
|
|
|
10068
10092
|
* @generated from field: string leverage_target = 1;
|
|
10069
10093
|
*/
|
|
10070
10094
|
this.leverageTarget = "";
|
|
10071
|
-
/**
|
|
10072
|
-
* The LENDING allowlist, distinct from `swap_config.protocols` (the AMM
|
|
10073
|
-
* allowlist for the wallet-side swap).
|
|
10074
|
-
*
|
|
10075
|
-
* @generated from field: repeated trading.v1.MarginVenue venues = 2;
|
|
10076
|
-
*/
|
|
10077
|
-
this.venues = [];
|
|
10078
10095
|
/**
|
|
10079
10096
|
* @generated from field: string amount = 3;
|
|
10080
10097
|
*/
|
|
10081
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 = "";
|
|
10082
10108
|
proto3.util.initPartial(data, this);
|
|
10083
10109
|
}
|
|
10084
10110
|
static fromBinary(bytes, options) {
|
|
@@ -10098,8 +10124,8 @@ MarginOpenAction.runtime = proto3;
|
|
|
10098
10124
|
MarginOpenAction.typeName = "trading.v1.MarginOpenAction";
|
|
10099
10125
|
MarginOpenAction.fields = proto3.util.newFieldList(() => [
|
|
10100
10126
|
{ no: 1, name: "leverage_target", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10101
|
-
{ no: 2, name: "venues", kind: "enum", T: proto3.getEnumType(MarginVenue), repeated: true },
|
|
10102
10127
|
{ no: 3, name: "amount", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10128
|
+
{ no: 4, name: "market_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10103
10129
|
]);
|
|
10104
10130
|
/**
|
|
10105
10131
|
* EXECUTION POLICY for the wallet-side swap, and nothing else. It names no
|
|
@@ -10297,6 +10323,7 @@ MarginExecutionLeg.fields = proto3.util.newFieldList(() => [
|
|
|
10297
10323
|
{ no: 1, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
10298
10324
|
{ no: 2, name: "sub_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10299
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 },
|
|
10300
10327
|
]);
|
|
10301
10328
|
/**
|
|
10302
10329
|
* The wallet-side funding as priced, in the same shape /quote uses for an
|
|
@@ -10588,6 +10615,7 @@ MarginPositionRow.fields = proto3.util.newFieldList(() => [
|
|
|
10588
10615
|
{ no: 26, name: "close_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10589
10616
|
{ no: 27, name: "last_liquidation_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10590
10617
|
{ no: 28, name: "collateral_at_open", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10618
|
+
{ no: 39, name: "leverage_at_open", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10591
10619
|
{ no: 37, name: "activity_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10592
10620
|
{ no: 30, name: "cost_basis_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10593
10621
|
{ no: 31, name: "realized_pnl_to_date_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|