@uniswap/client-trading 0.11.3 → 0.11.7
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 +256 -3
- package/dist/trading/v1/api_pb.js +192 -0
- package/package.json +1 -1
|
@@ -501,6 +501,37 @@ export declare enum AggregatedOutputFee {
|
|
|
501
501
|
*/
|
|
502
502
|
INTEGRATOR = 1
|
|
503
503
|
}
|
|
504
|
+
/**
|
|
505
|
+
* @generated from enum trading.v1.RouteGraphProtocol
|
|
506
|
+
*/
|
|
507
|
+
export declare enum RouteGraphProtocol {
|
|
508
|
+
/**
|
|
509
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_UNSPECIFIED = 0;
|
|
510
|
+
*/
|
|
511
|
+
UNSPECIFIED = 0,
|
|
512
|
+
/**
|
|
513
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_V2 = 1;
|
|
514
|
+
*/
|
|
515
|
+
V2 = 1,
|
|
516
|
+
/**
|
|
517
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_V3 = 2;
|
|
518
|
+
*/
|
|
519
|
+
V3 = 2,
|
|
520
|
+
/**
|
|
521
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_V4 = 3;
|
|
522
|
+
*/
|
|
523
|
+
V4 = 3,
|
|
524
|
+
/**
|
|
525
|
+
* Native <-> wrapped-native conversion step.
|
|
526
|
+
*
|
|
527
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_WRAP = 4;
|
|
528
|
+
*/
|
|
529
|
+
WRAP = 4,
|
|
530
|
+
/**
|
|
531
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_OTHER = 5;
|
|
532
|
+
*/
|
|
533
|
+
OTHER = 5
|
|
534
|
+
}
|
|
504
535
|
/**
|
|
505
536
|
* @generated from enum trading.v1.PoolType
|
|
506
537
|
*/
|
|
@@ -3103,6 +3134,13 @@ export declare class ClassicQuote extends Message<ClassicQuote> {
|
|
|
3103
3134
|
* @generated from field: optional double price_difference = 28;
|
|
3104
3135
|
*/
|
|
3105
3136
|
priceDifference?: number;
|
|
3137
|
+
/**
|
|
3138
|
+
* Pool-level graph of the quoted route: one entry per pool hop, in swap
|
|
3139
|
+
* direction. Omitted whenever it cannot be built completely.
|
|
3140
|
+
*
|
|
3141
|
+
* @generated from field: optional trading.v1.RouteGraph route_graph = 29;
|
|
3142
|
+
*/
|
|
3143
|
+
routeGraph?: RouteGraph;
|
|
3106
3144
|
constructor(data?: PartialMessage<ClassicQuote>);
|
|
3107
3145
|
static readonly runtime: typeof proto3;
|
|
3108
3146
|
static readonly typeName = "trading.v1.ClassicQuote";
|
|
@@ -3112,6 +3150,110 @@ export declare class ClassicQuote extends Message<ClassicQuote> {
|
|
|
3112
3150
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ClassicQuote;
|
|
3113
3151
|
static equals(a: ClassicQuote | PlainMessage<ClassicQuote> | undefined, b: ClassicQuote | PlainMessage<ClassicQuote> | undefined): boolean;
|
|
3114
3152
|
}
|
|
3153
|
+
/**
|
|
3154
|
+
* One pool hop of the quoted route, oriented in swap direction (input ->
|
|
3155
|
+
* output) regardless of trade type. The same pool traversed in both
|
|
3156
|
+
* directions appears twice.
|
|
3157
|
+
*
|
|
3158
|
+
* @generated from message trading.v1.RouteGraphPool
|
|
3159
|
+
*/
|
|
3160
|
+
export declare class RouteGraphPool extends Message<RouteGraphPool> {
|
|
3161
|
+
/**
|
|
3162
|
+
* @generated from field: trading.v1.RouteGraphProtocol protocol = 1;
|
|
3163
|
+
*/
|
|
3164
|
+
protocol: RouteGraphProtocol;
|
|
3165
|
+
/**
|
|
3166
|
+
* V2/V3 pool address, V4 pool id (bytes32); unset for WRAP.
|
|
3167
|
+
*
|
|
3168
|
+
* @generated from field: optional string address = 2;
|
|
3169
|
+
*/
|
|
3170
|
+
address?: string;
|
|
3171
|
+
/**
|
|
3172
|
+
* V4 hook contract; unset when the pool has no hook.
|
|
3173
|
+
*
|
|
3174
|
+
* @generated from field: optional string hooks = 3;
|
|
3175
|
+
*/
|
|
3176
|
+
hooks?: string;
|
|
3177
|
+
/**
|
|
3178
|
+
* Same units as V3PoolInRoute.fee (hundredths of a bip); unset for WRAP
|
|
3179
|
+
* and for dynamic-fee pools.
|
|
3180
|
+
*
|
|
3181
|
+
* @generated from field: optional string fee = 4;
|
|
3182
|
+
*/
|
|
3183
|
+
fee?: string;
|
|
3184
|
+
/**
|
|
3185
|
+
* @generated from field: optional bool is_dynamic_fee = 5;
|
|
3186
|
+
*/
|
|
3187
|
+
isDynamicFee?: boolean;
|
|
3188
|
+
/**
|
|
3189
|
+
* Native currency is the zero address, as in V4 routes. decimals is set
|
|
3190
|
+
* only for the native currency and its wrapped token; do not do amount
|
|
3191
|
+
* math on it.
|
|
3192
|
+
*
|
|
3193
|
+
* @generated from field: trading.v1.TokenInRoute token_in = 6;
|
|
3194
|
+
*/
|
|
3195
|
+
tokenIn?: TokenInRoute;
|
|
3196
|
+
/**
|
|
3197
|
+
* @generated from field: trading.v1.TokenInRoute token_out = 7;
|
|
3198
|
+
*/
|
|
3199
|
+
tokenOut?: TokenInRoute;
|
|
3200
|
+
/**
|
|
3201
|
+
* Share of the trade's total input VALUE routed through this pool, in bps
|
|
3202
|
+
* (0-10000). Downstream pools trade a different token, so this is a value
|
|
3203
|
+
* share, not an amount share.
|
|
3204
|
+
*
|
|
3205
|
+
* @generated from field: uint32 share_of_input_bps = 8;
|
|
3206
|
+
*/
|
|
3207
|
+
shareOfInputBps: number;
|
|
3208
|
+
/**
|
|
3209
|
+
* USD value entering/leaving the pool as decimal strings; unset when no
|
|
3210
|
+
* USD valuation is available.
|
|
3211
|
+
*
|
|
3212
|
+
* @generated from field: optional string usd_in = 9;
|
|
3213
|
+
*/
|
|
3214
|
+
usdIn?: string;
|
|
3215
|
+
/**
|
|
3216
|
+
* @generated from field: optional string usd_out = 10;
|
|
3217
|
+
*/
|
|
3218
|
+
usdOut?: string;
|
|
3219
|
+
/**
|
|
3220
|
+
* Disambiguates repeated visits of the same token within the graph; unset
|
|
3221
|
+
* means the first visit. Two pools share a node only when token and visit
|
|
3222
|
+
* both match.
|
|
3223
|
+
*
|
|
3224
|
+
* @generated from field: optional uint32 token_in_visit = 11;
|
|
3225
|
+
*/
|
|
3226
|
+
tokenInVisit?: number;
|
|
3227
|
+
/**
|
|
3228
|
+
* @generated from field: optional uint32 token_out_visit = 12;
|
|
3229
|
+
*/
|
|
3230
|
+
tokenOutVisit?: number;
|
|
3231
|
+
constructor(data?: PartialMessage<RouteGraphPool>);
|
|
3232
|
+
static readonly runtime: typeof proto3;
|
|
3233
|
+
static readonly typeName = "trading.v1.RouteGraphPool";
|
|
3234
|
+
static readonly fields: FieldList;
|
|
3235
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RouteGraphPool;
|
|
3236
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): RouteGraphPool;
|
|
3237
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RouteGraphPool;
|
|
3238
|
+
static equals(a: RouteGraphPool | PlainMessage<RouteGraphPool> | undefined, b: RouteGraphPool | PlainMessage<RouteGraphPool> | undefined): boolean;
|
|
3239
|
+
}
|
|
3240
|
+
/**
|
|
3241
|
+
* @generated from message trading.v1.RouteGraph
|
|
3242
|
+
*/
|
|
3243
|
+
export declare class RouteGraph extends Message<RouteGraph> {
|
|
3244
|
+
/**
|
|
3245
|
+
* @generated from field: repeated trading.v1.RouteGraphPool pools = 1;
|
|
3246
|
+
*/
|
|
3247
|
+
pools: RouteGraphPool[];
|
|
3248
|
+
constructor(data?: PartialMessage<RouteGraph>);
|
|
3249
|
+
static readonly runtime: typeof proto3;
|
|
3250
|
+
static readonly typeName = "trading.v1.RouteGraph";
|
|
3251
|
+
static readonly fields: FieldList;
|
|
3252
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RouteGraph;
|
|
3253
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): RouteGraph;
|
|
3254
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RouteGraph;
|
|
3255
|
+
static equals(a: RouteGraph | PlainMessage<RouteGraph> | undefined, b: RouteGraph | PlainMessage<RouteGraph> | undefined): boolean;
|
|
3256
|
+
}
|
|
3115
3257
|
/**
|
|
3116
3258
|
* A quoted route candidate with its whole-route (not per-hop) amounts.
|
|
3117
3259
|
* quote_amount is the output amount for EXACT_INPUT and the required input
|
|
@@ -8907,8 +9049,8 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
8907
9049
|
*/
|
|
8908
9050
|
legs: MarginPositionLeg[];
|
|
8909
9051
|
/**
|
|
8910
|
-
* COST BASIS
|
|
8911
|
-
*
|
|
9052
|
+
* COST BASIS, from the position store. Absent rather than zero for a leg the
|
|
9053
|
+
* store has not indexed.
|
|
8912
9054
|
*
|
|
8913
9055
|
* @generated from field: optional string entry_price = 7;
|
|
8914
9056
|
*/
|
|
@@ -8918,10 +9060,16 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
8918
9060
|
*/
|
|
8919
9061
|
openedAt?: bigint;
|
|
8920
9062
|
/**
|
|
9063
|
+
* Raw debt-token units. ACTIVE: stored interest plus live growth since the
|
|
9064
|
+
* last position event; terminal: lifetime interest.
|
|
9065
|
+
*
|
|
8921
9066
|
* @generated from field: optional string accrued_interest = 9;
|
|
8922
9067
|
*/
|
|
8923
9068
|
accruedInterest?: string;
|
|
8924
9069
|
/**
|
|
9070
|
+
* ACTIVE only. Raw collateral-token units: current equity plus collateral
|
|
9071
|
+
* already returned, minus collateral deposited.
|
|
9072
|
+
*
|
|
8925
9073
|
* @generated from field: optional string unrealized_pnl = 10;
|
|
8926
9074
|
*/
|
|
8927
9075
|
unrealizedPnl?: string;
|
|
@@ -8971,7 +9119,8 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
8971
9119
|
*/
|
|
8972
9120
|
maxWithdrawable?: string;
|
|
8973
9121
|
/**
|
|
8974
|
-
* TERMINAL only, and likewise cost-basis derived.
|
|
9122
|
+
* TERMINAL only, and likewise cost-basis derived. `realized_pnl` is raw
|
|
9123
|
+
* collateral-token units: collateral returned minus collateral deposited.
|
|
8975
9124
|
*
|
|
8976
9125
|
* @generated from field: optional int64 closed_at = 20;
|
|
8977
9126
|
*/
|
|
@@ -8984,6 +9133,68 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
8984
9133
|
* @generated from field: optional string realized_pnl = 22;
|
|
8985
9134
|
*/
|
|
8986
9135
|
realizedPnl?: string;
|
|
9136
|
+
/**
|
|
9137
|
+
* The PnL fields above, in raw DEBT-token units, with each deposit and return
|
|
9138
|
+
* valued at the venue's oracle mark at its event and a liquidation's leftover
|
|
9139
|
+
* at the liquidation's price; `entry_price` and `exit_price` are the swap
|
|
9140
|
+
* fills. The dollar figure is whichever of the two is in a stablecoin: this
|
|
9141
|
+
* one on a LONG against USDC, `unrealized_pnl` / `realized_pnl` on a SHORT
|
|
9142
|
+
* with USDC collateral. Absent when any deposit or return could not be
|
|
9143
|
+
* priced.
|
|
9144
|
+
*
|
|
9145
|
+
* @generated from field: optional string unrealized_pnl_in_debt = 23;
|
|
9146
|
+
*/
|
|
9147
|
+
unrealizedPnlInDebt?: string;
|
|
9148
|
+
/**
|
|
9149
|
+
* @generated from field: optional string realized_pnl_in_debt = 24;
|
|
9150
|
+
*/
|
|
9151
|
+
realizedPnlInDebt?: string;
|
|
9152
|
+
/**
|
|
9153
|
+
* The txs that opened and closed the position. `close_tx_hash` is TERMINAL
|
|
9154
|
+
* only; a full liquidation is its own close.
|
|
9155
|
+
*
|
|
9156
|
+
* @generated from field: optional string open_tx_hash = 25;
|
|
9157
|
+
*/
|
|
9158
|
+
openTxHash?: string;
|
|
9159
|
+
/**
|
|
9160
|
+
* @generated from field: optional string close_tx_hash = 26;
|
|
9161
|
+
*/
|
|
9162
|
+
closeTxHash?: string;
|
|
9163
|
+
/**
|
|
9164
|
+
* The latest liquidation, partial or full. On an ACTIVE row it means the
|
|
9165
|
+
* position survived a partial liquidation.
|
|
9166
|
+
*
|
|
9167
|
+
* @generated from field: optional string last_liquidation_tx_hash = 27;
|
|
9168
|
+
*/
|
|
9169
|
+
lastLiquidationTxHash?: string;
|
|
9170
|
+
/**
|
|
9171
|
+
* Raw collateral-token units held right after the open, summed over legs.
|
|
9172
|
+
*
|
|
9173
|
+
* @generated from field: optional string collateral_at_open = 28;
|
|
9174
|
+
*/
|
|
9175
|
+
collateralAtOpen?: string;
|
|
9176
|
+
/**
|
|
9177
|
+
* Partial decreases, oldest first, the newest 50 per leg.
|
|
9178
|
+
*
|
|
9179
|
+
* @generated from field: repeated trading.v1.MarginDecreaseActivity decreases = 29;
|
|
9180
|
+
*/
|
|
9181
|
+
decreases: MarginDecreaseActivity[];
|
|
9182
|
+
/**
|
|
9183
|
+
* ACTIVE only, raw DEBT-token units. The basis of the equity still in the
|
|
9184
|
+
* position, each deposit valued at the venue's oracle mark at its event: each
|
|
9185
|
+
* withdrawal removes the share of the basis it takes of the equity, both at
|
|
9186
|
+
* the withdrawal's price. Absent like `unrealized_pnl_in_debt`.
|
|
9187
|
+
*
|
|
9188
|
+
* @generated from field: optional string cost_basis_in_debt = 30;
|
|
9189
|
+
*/
|
|
9190
|
+
costBasisInDebt?: string;
|
|
9191
|
+
/**
|
|
9192
|
+
* ACTIVE only, raw DEBT-token units, signed: what withdrawals so far fetched
|
|
9193
|
+
* above the basis they removed.
|
|
9194
|
+
*
|
|
9195
|
+
* @generated from field: optional string realized_pnl_to_date_in_debt = 31;
|
|
9196
|
+
*/
|
|
9197
|
+
realizedPnlToDateInDebt?: string;
|
|
8987
9198
|
constructor(data?: PartialMessage<MarginPositionRow>);
|
|
8988
9199
|
static readonly runtime: typeof proto3;
|
|
8989
9200
|
static readonly typeName = "trading.v1.MarginPositionRow";
|
|
@@ -8993,6 +9204,48 @@ export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
|
8993
9204
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionRow;
|
|
8994
9205
|
static equals(a: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined, b: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined): boolean;
|
|
8995
9206
|
}
|
|
9207
|
+
/**
|
|
9208
|
+
* @generated from message trading.v1.MarginDecreaseActivity
|
|
9209
|
+
*/
|
|
9210
|
+
export declare class MarginDecreaseActivity extends Message<MarginDecreaseActivity> {
|
|
9211
|
+
/**
|
|
9212
|
+
* @generated from field: string tx_hash = 1;
|
|
9213
|
+
*/
|
|
9214
|
+
txHash: string;
|
|
9215
|
+
/**
|
|
9216
|
+
* Epoch milliseconds, like `opened_at`.
|
|
9217
|
+
*
|
|
9218
|
+
* @generated from field: int64 at = 2;
|
|
9219
|
+
*/
|
|
9220
|
+
at: bigint;
|
|
9221
|
+
/**
|
|
9222
|
+
* Raw debt-token units.
|
|
9223
|
+
*
|
|
9224
|
+
* @generated from field: string debt_repaid = 3;
|
|
9225
|
+
*/
|
|
9226
|
+
debtRepaid: string;
|
|
9227
|
+
/**
|
|
9228
|
+
* Raw collateral-token units.
|
|
9229
|
+
*
|
|
9230
|
+
* @generated from field: string collateral_sold = 4;
|
|
9231
|
+
*/
|
|
9232
|
+
collateralSold: string;
|
|
9233
|
+
/**
|
|
9234
|
+
* Raw debt per raw collateral, 1e18-scaled, like `entry_price`. Absent when
|
|
9235
|
+
* nothing was sold.
|
|
9236
|
+
*
|
|
9237
|
+
* @generated from field: optional string exit_price = 5;
|
|
9238
|
+
*/
|
|
9239
|
+
exitPrice?: string;
|
|
9240
|
+
constructor(data?: PartialMessage<MarginDecreaseActivity>);
|
|
9241
|
+
static readonly runtime: typeof proto3;
|
|
9242
|
+
static readonly typeName = "trading.v1.MarginDecreaseActivity";
|
|
9243
|
+
static readonly fields: FieldList;
|
|
9244
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginDecreaseActivity;
|
|
9245
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginDecreaseActivity;
|
|
9246
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginDecreaseActivity;
|
|
9247
|
+
static equals(a: MarginDecreaseActivity | PlainMessage<MarginDecreaseActivity> | undefined, b: MarginDecreaseActivity | PlainMessage<MarginDecreaseActivity> | undefined): boolean;
|
|
9248
|
+
}
|
|
8996
9249
|
/**
|
|
8997
9250
|
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|
|
8998
9251
|
* this response: session-scoped and TTL-bound, so absent rather than wrong once
|
|
@@ -673,6 +673,47 @@ proto3.util.setEnumType(AggregatedOutputFee, "trading.v1.AggregatedOutputFee", [
|
|
|
673
673
|
{ no: 0, name: "AGGREGATED_OUTPUT_FEE_UNSPECIFIED" },
|
|
674
674
|
{ no: 1, name: "INTEGRATOR" },
|
|
675
675
|
]);
|
|
676
|
+
/**
|
|
677
|
+
* @generated from enum trading.v1.RouteGraphProtocol
|
|
678
|
+
*/
|
|
679
|
+
export var RouteGraphProtocol;
|
|
680
|
+
(function (RouteGraphProtocol) {
|
|
681
|
+
/**
|
|
682
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_UNSPECIFIED = 0;
|
|
683
|
+
*/
|
|
684
|
+
RouteGraphProtocol[RouteGraphProtocol["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
685
|
+
/**
|
|
686
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_V2 = 1;
|
|
687
|
+
*/
|
|
688
|
+
RouteGraphProtocol[RouteGraphProtocol["V2"] = 1] = "V2";
|
|
689
|
+
/**
|
|
690
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_V3 = 2;
|
|
691
|
+
*/
|
|
692
|
+
RouteGraphProtocol[RouteGraphProtocol["V3"] = 2] = "V3";
|
|
693
|
+
/**
|
|
694
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_V4 = 3;
|
|
695
|
+
*/
|
|
696
|
+
RouteGraphProtocol[RouteGraphProtocol["V4"] = 3] = "V4";
|
|
697
|
+
/**
|
|
698
|
+
* Native <-> wrapped-native conversion step.
|
|
699
|
+
*
|
|
700
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_WRAP = 4;
|
|
701
|
+
*/
|
|
702
|
+
RouteGraphProtocol[RouteGraphProtocol["WRAP"] = 4] = "WRAP";
|
|
703
|
+
/**
|
|
704
|
+
* @generated from enum value: ROUTE_GRAPH_PROTOCOL_OTHER = 5;
|
|
705
|
+
*/
|
|
706
|
+
RouteGraphProtocol[RouteGraphProtocol["OTHER"] = 5] = "OTHER";
|
|
707
|
+
})(RouteGraphProtocol || (RouteGraphProtocol = {}));
|
|
708
|
+
// Retrieve enum metadata with: proto3.getEnumType(RouteGraphProtocol)
|
|
709
|
+
proto3.util.setEnumType(RouteGraphProtocol, "trading.v1.RouteGraphProtocol", [
|
|
710
|
+
{ no: 0, name: "ROUTE_GRAPH_PROTOCOL_UNSPECIFIED" },
|
|
711
|
+
{ no: 1, name: "ROUTE_GRAPH_PROTOCOL_V2" },
|
|
712
|
+
{ no: 2, name: "ROUTE_GRAPH_PROTOCOL_V3" },
|
|
713
|
+
{ no: 3, name: "ROUTE_GRAPH_PROTOCOL_V4" },
|
|
714
|
+
{ no: 4, name: "ROUTE_GRAPH_PROTOCOL_WRAP" },
|
|
715
|
+
{ no: 5, name: "ROUTE_GRAPH_PROTOCOL_OTHER" },
|
|
716
|
+
]);
|
|
676
717
|
/**
|
|
677
718
|
* @generated from enum trading.v1.PoolType
|
|
678
719
|
*/
|
|
@@ -3667,6 +3708,90 @@ ClassicQuote.fields = proto3.util.newFieldList(() => [
|
|
|
3667
3708
|
{ no: 26, name: "swap_steps", kind: "message", T: SwapStep, repeated: true },
|
|
3668
3709
|
{ no: 27, name: "route_candidates", kind: "message", T: RouteCandidate, repeated: true },
|
|
3669
3710
|
{ no: 28, name: "price_difference", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true },
|
|
3711
|
+
{ no: 29, name: "route_graph", kind: "message", T: RouteGraph, opt: true },
|
|
3712
|
+
]);
|
|
3713
|
+
/**
|
|
3714
|
+
* One pool hop of the quoted route, oriented in swap direction (input ->
|
|
3715
|
+
* output) regardless of trade type. The same pool traversed in both
|
|
3716
|
+
* directions appears twice.
|
|
3717
|
+
*
|
|
3718
|
+
* @generated from message trading.v1.RouteGraphPool
|
|
3719
|
+
*/
|
|
3720
|
+
export class RouteGraphPool extends Message {
|
|
3721
|
+
constructor(data) {
|
|
3722
|
+
super();
|
|
3723
|
+
/**
|
|
3724
|
+
* @generated from field: trading.v1.RouteGraphProtocol protocol = 1;
|
|
3725
|
+
*/
|
|
3726
|
+
this.protocol = RouteGraphProtocol.UNSPECIFIED;
|
|
3727
|
+
/**
|
|
3728
|
+
* Share of the trade's total input VALUE routed through this pool, in bps
|
|
3729
|
+
* (0-10000). Downstream pools trade a different token, so this is a value
|
|
3730
|
+
* share, not an amount share.
|
|
3731
|
+
*
|
|
3732
|
+
* @generated from field: uint32 share_of_input_bps = 8;
|
|
3733
|
+
*/
|
|
3734
|
+
this.shareOfInputBps = 0;
|
|
3735
|
+
proto3.util.initPartial(data, this);
|
|
3736
|
+
}
|
|
3737
|
+
static fromBinary(bytes, options) {
|
|
3738
|
+
return new RouteGraphPool().fromBinary(bytes, options);
|
|
3739
|
+
}
|
|
3740
|
+
static fromJson(jsonValue, options) {
|
|
3741
|
+
return new RouteGraphPool().fromJson(jsonValue, options);
|
|
3742
|
+
}
|
|
3743
|
+
static fromJsonString(jsonString, options) {
|
|
3744
|
+
return new RouteGraphPool().fromJsonString(jsonString, options);
|
|
3745
|
+
}
|
|
3746
|
+
static equals(a, b) {
|
|
3747
|
+
return proto3.util.equals(RouteGraphPool, a, b);
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3750
|
+
RouteGraphPool.runtime = proto3;
|
|
3751
|
+
RouteGraphPool.typeName = "trading.v1.RouteGraphPool";
|
|
3752
|
+
RouteGraphPool.fields = proto3.util.newFieldList(() => [
|
|
3753
|
+
{ no: 1, name: "protocol", kind: "enum", T: proto3.getEnumType(RouteGraphProtocol) },
|
|
3754
|
+
{ no: 2, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3755
|
+
{ no: 3, name: "hooks", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3756
|
+
{ no: 4, name: "fee", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3757
|
+
{ no: 5, name: "is_dynamic_fee", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
3758
|
+
{ no: 6, name: "token_in", kind: "message", T: TokenInRoute },
|
|
3759
|
+
{ no: 7, name: "token_out", kind: "message", T: TokenInRoute },
|
|
3760
|
+
{ no: 8, name: "share_of_input_bps", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
3761
|
+
{ no: 9, name: "usd_in", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3762
|
+
{ no: 10, name: "usd_out", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
3763
|
+
{ no: 11, name: "token_in_visit", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
|
|
3764
|
+
{ no: 12, name: "token_out_visit", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
|
|
3765
|
+
]);
|
|
3766
|
+
/**
|
|
3767
|
+
* @generated from message trading.v1.RouteGraph
|
|
3768
|
+
*/
|
|
3769
|
+
export class RouteGraph extends Message {
|
|
3770
|
+
constructor(data) {
|
|
3771
|
+
super();
|
|
3772
|
+
/**
|
|
3773
|
+
* @generated from field: repeated trading.v1.RouteGraphPool pools = 1;
|
|
3774
|
+
*/
|
|
3775
|
+
this.pools = [];
|
|
3776
|
+
proto3.util.initPartial(data, this);
|
|
3777
|
+
}
|
|
3778
|
+
static fromBinary(bytes, options) {
|
|
3779
|
+
return new RouteGraph().fromBinary(bytes, options);
|
|
3780
|
+
}
|
|
3781
|
+
static fromJson(jsonValue, options) {
|
|
3782
|
+
return new RouteGraph().fromJson(jsonValue, options);
|
|
3783
|
+
}
|
|
3784
|
+
static fromJsonString(jsonString, options) {
|
|
3785
|
+
return new RouteGraph().fromJsonString(jsonString, options);
|
|
3786
|
+
}
|
|
3787
|
+
static equals(a, b) {
|
|
3788
|
+
return proto3.util.equals(RouteGraph, a, b);
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
RouteGraph.runtime = proto3;
|
|
3792
|
+
RouteGraph.typeName = "trading.v1.RouteGraph";
|
|
3793
|
+
RouteGraph.fields = proto3.util.newFieldList(() => [
|
|
3794
|
+
{ no: 1, name: "pools", kind: "message", T: RouteGraphPool, repeated: true },
|
|
3670
3795
|
]);
|
|
3671
3796
|
/**
|
|
3672
3797
|
* A quoted route candidate with its whole-route (not per-hop) amounts.
|
|
@@ -10230,6 +10355,12 @@ export class MarginPositionRow extends Message {
|
|
|
10230
10355
|
* @generated from field: repeated trading.v1.MarginPositionLeg legs = 6;
|
|
10231
10356
|
*/
|
|
10232
10357
|
this.legs = [];
|
|
10358
|
+
/**
|
|
10359
|
+
* Partial decreases, oldest first, the newest 50 per leg.
|
|
10360
|
+
*
|
|
10361
|
+
* @generated from field: repeated trading.v1.MarginDecreaseActivity decreases = 29;
|
|
10362
|
+
*/
|
|
10363
|
+
this.decreases = [];
|
|
10233
10364
|
proto3.util.initPartial(data, this);
|
|
10234
10365
|
}
|
|
10235
10366
|
static fromBinary(bytes, options) {
|
|
@@ -10270,6 +10401,67 @@ MarginPositionRow.fields = proto3.util.newFieldList(() => [
|
|
|
10270
10401
|
{ no: 20, name: "closed_at", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
|
|
10271
10402
|
{ no: 21, name: "exit_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10272
10403
|
{ no: 22, name: "realized_pnl", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10404
|
+
{ no: 23, name: "unrealized_pnl_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10405
|
+
{ no: 24, name: "realized_pnl_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10406
|
+
{ no: 25, name: "open_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10407
|
+
{ no: 26, name: "close_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10408
|
+
{ no: 27, name: "last_liquidation_tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10409
|
+
{ no: 28, name: "collateral_at_open", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10410
|
+
{ no: 29, name: "decreases", kind: "message", T: MarginDecreaseActivity, repeated: true },
|
|
10411
|
+
{ no: 30, name: "cost_basis_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10412
|
+
{ no: 31, name: "realized_pnl_to_date_in_debt", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10413
|
+
]);
|
|
10414
|
+
/**
|
|
10415
|
+
* @generated from message trading.v1.MarginDecreaseActivity
|
|
10416
|
+
*/
|
|
10417
|
+
export class MarginDecreaseActivity extends Message {
|
|
10418
|
+
constructor(data) {
|
|
10419
|
+
super();
|
|
10420
|
+
/**
|
|
10421
|
+
* @generated from field: string tx_hash = 1;
|
|
10422
|
+
*/
|
|
10423
|
+
this.txHash = "";
|
|
10424
|
+
/**
|
|
10425
|
+
* Epoch milliseconds, like `opened_at`.
|
|
10426
|
+
*
|
|
10427
|
+
* @generated from field: int64 at = 2;
|
|
10428
|
+
*/
|
|
10429
|
+
this.at = protoInt64.zero;
|
|
10430
|
+
/**
|
|
10431
|
+
* Raw debt-token units.
|
|
10432
|
+
*
|
|
10433
|
+
* @generated from field: string debt_repaid = 3;
|
|
10434
|
+
*/
|
|
10435
|
+
this.debtRepaid = "";
|
|
10436
|
+
/**
|
|
10437
|
+
* Raw collateral-token units.
|
|
10438
|
+
*
|
|
10439
|
+
* @generated from field: string collateral_sold = 4;
|
|
10440
|
+
*/
|
|
10441
|
+
this.collateralSold = "";
|
|
10442
|
+
proto3.util.initPartial(data, this);
|
|
10443
|
+
}
|
|
10444
|
+
static fromBinary(bytes, options) {
|
|
10445
|
+
return new MarginDecreaseActivity().fromBinary(bytes, options);
|
|
10446
|
+
}
|
|
10447
|
+
static fromJson(jsonValue, options) {
|
|
10448
|
+
return new MarginDecreaseActivity().fromJson(jsonValue, options);
|
|
10449
|
+
}
|
|
10450
|
+
static fromJsonString(jsonString, options) {
|
|
10451
|
+
return new MarginDecreaseActivity().fromJsonString(jsonString, options);
|
|
10452
|
+
}
|
|
10453
|
+
static equals(a, b) {
|
|
10454
|
+
return proto3.util.equals(MarginDecreaseActivity, a, b);
|
|
10455
|
+
}
|
|
10456
|
+
}
|
|
10457
|
+
MarginDecreaseActivity.runtime = proto3;
|
|
10458
|
+
MarginDecreaseActivity.typeName = "trading.v1.MarginDecreaseActivity";
|
|
10459
|
+
MarginDecreaseActivity.fields = proto3.util.newFieldList(() => [
|
|
10460
|
+
{ no: 1, name: "tx_hash", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10461
|
+
{ no: 2, name: "at", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
10462
|
+
{ no: 3, name: "debt_repaid", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10463
|
+
{ no: 4, name: "collateral_sold", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10464
|
+
{ no: 5, name: "exit_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10273
10465
|
]);
|
|
10274
10466
|
/**
|
|
10275
10467
|
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|