@uniswap/client-trading 0.7.0 → 0.8.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-tradingService_connectquery.d.ts +15 -1
- package/dist/trading/v1/api-tradingService_connectquery.js +15 -1
- package/dist/trading/v1/api_connect.d.ts +11 -1
- package/dist/trading/v1/api_connect.js +11 -1
- package/dist/trading/v1/api_pb.d.ts +337 -0
- package/dist/trading/v1/api_pb.js +341 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf";
|
|
2
|
-
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
2
|
+
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginPositionsRequest, MarginPositionsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
3
3
|
/**
|
|
4
4
|
* @generated from rpc trading.v1.tradingService.Quote
|
|
5
5
|
*/
|
|
@@ -336,3 +336,17 @@ export declare const marginMarkets: {
|
|
|
336
336
|
readonly typeName: "trading.v1.tradingService";
|
|
337
337
|
};
|
|
338
338
|
};
|
|
339
|
+
/**
|
|
340
|
+
* @generated from rpc trading.v1.tradingService.MarginPositions
|
|
341
|
+
*/
|
|
342
|
+
export declare const marginPositions: {
|
|
343
|
+
readonly localName: "marginPositions";
|
|
344
|
+
readonly name: "MarginPositions";
|
|
345
|
+
readonly kind: MethodKind.Unary;
|
|
346
|
+
readonly I: typeof MarginPositionsRequest;
|
|
347
|
+
readonly O: typeof MarginPositionsResponse;
|
|
348
|
+
readonly idempotency: MethodIdempotency.NoSideEffects;
|
|
349
|
+
readonly service: {
|
|
350
|
+
readonly typeName: "trading.v1.tradingService";
|
|
351
|
+
};
|
|
352
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf";
|
|
6
|
-
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
6
|
+
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginPositionsRequest, MarginPositionsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
7
7
|
/**
|
|
8
8
|
* @generated from rpc trading.v1.tradingService.Quote
|
|
9
9
|
*/
|
|
@@ -340,3 +340,17 @@ export const marginMarkets = {
|
|
|
340
340
|
typeName: "trading.v1.tradingService"
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
+
/**
|
|
344
|
+
* @generated from rpc trading.v1.tradingService.MarginPositions
|
|
345
|
+
*/
|
|
346
|
+
export const marginPositions = {
|
|
347
|
+
localName: "marginPositions",
|
|
348
|
+
name: "MarginPositions",
|
|
349
|
+
kind: MethodKind.Unary,
|
|
350
|
+
I: MarginPositionsRequest,
|
|
351
|
+
O: MarginPositionsResponse,
|
|
352
|
+
idempotency: MethodIdempotency.NoSideEffects,
|
|
353
|
+
service: {
|
|
354
|
+
typeName: "trading.v1.tradingService"
|
|
355
|
+
}
|
|
356
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
1
|
+
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginPositionsRequest, MarginPositionsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
2
2
|
import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf";
|
|
3
3
|
/**
|
|
4
4
|
* @generated from service trading.v1.tradingService
|
|
@@ -246,5 +246,15 @@ export declare const tradingService: {
|
|
|
246
246
|
readonly kind: MethodKind.Unary;
|
|
247
247
|
readonly idempotency: MethodIdempotency.NoSideEffects;
|
|
248
248
|
};
|
|
249
|
+
/**
|
|
250
|
+
* @generated from rpc trading.v1.tradingService.MarginPositions
|
|
251
|
+
*/
|
|
252
|
+
readonly marginPositions: {
|
|
253
|
+
readonly name: "MarginPositions";
|
|
254
|
+
readonly I: typeof MarginPositionsRequest;
|
|
255
|
+
readonly O: typeof MarginPositionsResponse;
|
|
256
|
+
readonly kind: MethodKind.Unary;
|
|
257
|
+
readonly idempotency: MethodIdempotency.NoSideEffects;
|
|
258
|
+
};
|
|
249
259
|
};
|
|
250
260
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @generated from file trading/v1/api.proto (package trading.v1, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
|
-
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
5
|
+
import { CheckApproval4337Request, CheckApproval4337Response, CheckApprovalRequest, CheckApprovalResponse, CheckWalletDelegationRequest, CheckWalletDelegationResponse, CreatePlanRequest, DocsRequest, DocsResponse, Encode4337Request, Encode4337Response, Encode7702Request, Encode7702Response, GetOrdersRequest, GetOrdersResponse, GetPlanRequest, GetPlansRequest, GetPlansResponse, GetSwapsRequest, GetSwapsResponse, GetTokensRequest, GetTokensResponse, MarginMarketsRequest, MarginMarketsResponse, MarginPositionsRequest, MarginPositionsResponse, MarginQuoteRequest, MarginQuoteResponse, OrderRequest, OrderResponse, PermissionsRequest, PermissionsResponse, PlanResponse, QuoteRequest, QuoteResponse, SupportedChainsRequest, SupportedChainsResponse, Swap4337Request, Swap4337Response, Swap5792Request, Swap5792Response, Swap7702Request, Swap7702Response, SwappableTokensRequest, SwappableTokensResponse, SwapRequest, SwapResponse, UpdatePlanRequest } from "./api_pb.js";
|
|
6
6
|
import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf";
|
|
7
7
|
/**
|
|
8
8
|
* @generated from service trading.v1.tradingService
|
|
@@ -250,5 +250,15 @@ export const tradingService = {
|
|
|
250
250
|
kind: MethodKind.Unary,
|
|
251
251
|
idempotency: MethodIdempotency.NoSideEffects,
|
|
252
252
|
},
|
|
253
|
+
/**
|
|
254
|
+
* @generated from rpc trading.v1.tradingService.MarginPositions
|
|
255
|
+
*/
|
|
256
|
+
marginPositions: {
|
|
257
|
+
name: "MarginPositions",
|
|
258
|
+
I: MarginPositionsRequest,
|
|
259
|
+
O: MarginPositionsResponse,
|
|
260
|
+
kind: MethodKind.Unary,
|
|
261
|
+
idempotency: MethodIdempotency.NoSideEffects,
|
|
262
|
+
},
|
|
253
263
|
}
|
|
254
264
|
};
|
|
@@ -791,6 +791,27 @@ export declare enum MarginOperationType {
|
|
|
791
791
|
*/
|
|
792
792
|
SWEEP = 4
|
|
793
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* @generated from enum trading.v1.MarginPositionStatus
|
|
796
|
+
*/
|
|
797
|
+
export declare enum MarginPositionStatus {
|
|
798
|
+
/**
|
|
799
|
+
* @generated from enum value: ACTIVE = 0;
|
|
800
|
+
*/
|
|
801
|
+
ACTIVE = 0,
|
|
802
|
+
/**
|
|
803
|
+
* @generated from enum value: COMPLETED = 1;
|
|
804
|
+
*/
|
|
805
|
+
COMPLETED = 1,
|
|
806
|
+
/**
|
|
807
|
+
* @generated from enum value: LIQUIDATED = 2;
|
|
808
|
+
*/
|
|
809
|
+
LIQUIDATED = 2,
|
|
810
|
+
/**
|
|
811
|
+
* @generated from enum value: PARTIALLY_LIQUIDATED = 3;
|
|
812
|
+
*/
|
|
813
|
+
PARTIALLY_LIQUIDATED = 3
|
|
814
|
+
}
|
|
794
815
|
/**
|
|
795
816
|
* @generated from message trading.v1.Encode7702Request
|
|
796
817
|
*/
|
|
@@ -8667,3 +8688,319 @@ export declare class MarginQuoteResponse extends Message<MarginQuoteResponse> {
|
|
|
8667
8688
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginQuoteResponse;
|
|
8668
8689
|
static equals(a: MarginQuoteResponse | PlainMessage<MarginQuoteResponse> | undefined, b: MarginQuoteResponse | PlainMessage<MarginQuoteResponse> | undefined): boolean;
|
|
8669
8690
|
}
|
|
8691
|
+
/**
|
|
8692
|
+
* One venue's share of a position. Legs are the unit of truth: a logical
|
|
8693
|
+
* position is an aggregation performed at read time, and legs liquidate
|
|
8694
|
+
* independently, so the row's risk numbers are the NEAREST leg's.
|
|
8695
|
+
*
|
|
8696
|
+
* @generated from message trading.v1.MarginPositionLeg
|
|
8697
|
+
*/
|
|
8698
|
+
export declare class MarginPositionLeg extends Message<MarginPositionLeg> {
|
|
8699
|
+
/**
|
|
8700
|
+
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
8701
|
+
*/
|
|
8702
|
+
venue: MarginVenue;
|
|
8703
|
+
/**
|
|
8704
|
+
* The `positionId` handle every action key echoes back. Returned whether or
|
|
8705
|
+
* not a screen renders it.
|
|
8706
|
+
*
|
|
8707
|
+
* @generated from field: string sub_id = 2;
|
|
8708
|
+
*/
|
|
8709
|
+
subId: string;
|
|
8710
|
+
/**
|
|
8711
|
+
* The MarginAccount this leg lives at, derived offchain from (owner, subId).
|
|
8712
|
+
*
|
|
8713
|
+
* @generated from field: string account = 3;
|
|
8714
|
+
*/
|
|
8715
|
+
account: string;
|
|
8716
|
+
/**
|
|
8717
|
+
* @generated from field: string debt = 4;
|
|
8718
|
+
*/
|
|
8719
|
+
debt: string;
|
|
8720
|
+
/**
|
|
8721
|
+
* Best effort, like the markets feed: absent when the venue's rate read did
|
|
8722
|
+
* not return, never zero, because an unread rate and a zero rate differ.
|
|
8723
|
+
*
|
|
8724
|
+
* @generated from field: optional string borrow_rate = 5;
|
|
8725
|
+
*/
|
|
8726
|
+
borrowRate?: string;
|
|
8727
|
+
constructor(data?: PartialMessage<MarginPositionLeg>);
|
|
8728
|
+
static readonly runtime: typeof proto3;
|
|
8729
|
+
static readonly typeName = "trading.v1.MarginPositionLeg";
|
|
8730
|
+
static readonly fields: FieldList;
|
|
8731
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionLeg;
|
|
8732
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionLeg;
|
|
8733
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionLeg;
|
|
8734
|
+
static equals(a: MarginPositionLeg | PlainMessage<MarginPositionLeg> | undefined, b: MarginPositionLeg | PlainMessage<MarginPositionLeg> | undefined): boolean;
|
|
8735
|
+
}
|
|
8736
|
+
/**
|
|
8737
|
+
* One logical position, keyed (exposure_token, counter_token, direction) — the
|
|
8738
|
+
* same key the markets cursor orders on, which is why both endpoints page
|
|
8739
|
+
* through `marginMarketCursor`.
|
|
8740
|
+
*
|
|
8741
|
+
* @generated from message trading.v1.MarginPositionRow
|
|
8742
|
+
*/
|
|
8743
|
+
export declare class MarginPositionRow extends Message<MarginPositionRow> {
|
|
8744
|
+
/**
|
|
8745
|
+
* @generated from field: trading.v1.MarginPositionStatus status = 1;
|
|
8746
|
+
*/
|
|
8747
|
+
status: MarginPositionStatus;
|
|
8748
|
+
/**
|
|
8749
|
+
* @generated from field: trading.v1.MarginDirection direction = 2;
|
|
8750
|
+
*/
|
|
8751
|
+
direction: MarginDirection;
|
|
8752
|
+
/**
|
|
8753
|
+
* @generated from field: trading.v1.MarginTokenMetadata exposure_token = 3;
|
|
8754
|
+
*/
|
|
8755
|
+
exposureToken?: MarginTokenMetadata;
|
|
8756
|
+
/**
|
|
8757
|
+
* @generated from field: trading.v1.MarginTokenMetadata counter_token = 4;
|
|
8758
|
+
*/
|
|
8759
|
+
counterToken?: MarginTokenMetadata;
|
|
8760
|
+
/**
|
|
8761
|
+
* @generated from field: string size = 5;
|
|
8762
|
+
*/
|
|
8763
|
+
size: string;
|
|
8764
|
+
/**
|
|
8765
|
+
* @generated from field: repeated trading.v1.MarginPositionLeg legs = 6;
|
|
8766
|
+
*/
|
|
8767
|
+
legs: MarginPositionLeg[];
|
|
8768
|
+
/**
|
|
8769
|
+
* COST BASIS. Needs the margin event consumer, which is not on the launch
|
|
8770
|
+
* path, so every field here is absent in v1 rather than zero.
|
|
8771
|
+
*
|
|
8772
|
+
* @generated from field: optional string entry_price = 7;
|
|
8773
|
+
*/
|
|
8774
|
+
entryPrice?: string;
|
|
8775
|
+
/**
|
|
8776
|
+
* @generated from field: optional int64 opened_at = 8;
|
|
8777
|
+
*/
|
|
8778
|
+
openedAt?: bigint;
|
|
8779
|
+
/**
|
|
8780
|
+
* @generated from field: optional string accrued_interest = 9;
|
|
8781
|
+
*/
|
|
8782
|
+
accruedInterest?: string;
|
|
8783
|
+
/**
|
|
8784
|
+
* @generated from field: optional string unrealized_pnl = 10;
|
|
8785
|
+
*/
|
|
8786
|
+
unrealizedPnl?: string;
|
|
8787
|
+
/**
|
|
8788
|
+
* @generated from field: optional string roe = 11;
|
|
8789
|
+
*/
|
|
8790
|
+
roe?: string;
|
|
8791
|
+
/**
|
|
8792
|
+
* ACTIVE only. Read on chain per request, never cached: a stale health factor
|
|
8793
|
+
* is the one number a caller must not act on.
|
|
8794
|
+
*
|
|
8795
|
+
* @generated from field: optional string equity = 12;
|
|
8796
|
+
*/
|
|
8797
|
+
equity?: string;
|
|
8798
|
+
/**
|
|
8799
|
+
* @generated from field: optional string leverage = 13;
|
|
8800
|
+
*/
|
|
8801
|
+
leverage?: string;
|
|
8802
|
+
/**
|
|
8803
|
+
* @generated from field: optional string oracle_price = 14;
|
|
8804
|
+
*/
|
|
8805
|
+
oraclePrice?: string;
|
|
8806
|
+
/**
|
|
8807
|
+
* Nearest leg. In TRADER terms, so a short's mark and liquidation price are
|
|
8808
|
+
* both reciprocated; see `displayRiskPrices`.
|
|
8809
|
+
*
|
|
8810
|
+
* @generated from field: optional string liquidation_price = 15;
|
|
8811
|
+
*/
|
|
8812
|
+
liquidationPrice?: string;
|
|
8813
|
+
/**
|
|
8814
|
+
* @generated from field: optional string buffer = 16;
|
|
8815
|
+
*/
|
|
8816
|
+
buffer?: string;
|
|
8817
|
+
/**
|
|
8818
|
+
* @generated from field: optional string health_factor = 17;
|
|
8819
|
+
*/
|
|
8820
|
+
healthFactor?: string;
|
|
8821
|
+
/**
|
|
8822
|
+
* @generated from field: optional string borrow_rate = 18;
|
|
8823
|
+
*/
|
|
8824
|
+
borrowRate?: string;
|
|
8825
|
+
/**
|
|
8826
|
+
* Health-floor bounded, server-computed. There is no on-chain guard on a
|
|
8827
|
+
* withdraw, so the ceiling has to come from here rather than from a quote.
|
|
8828
|
+
*
|
|
8829
|
+
* @generated from field: optional string max_withdrawable = 19;
|
|
8830
|
+
*/
|
|
8831
|
+
maxWithdrawable?: string;
|
|
8832
|
+
/**
|
|
8833
|
+
* TERMINAL only, and likewise cost-basis derived.
|
|
8834
|
+
*
|
|
8835
|
+
* @generated from field: optional int64 closed_at = 20;
|
|
8836
|
+
*/
|
|
8837
|
+
closedAt?: bigint;
|
|
8838
|
+
/**
|
|
8839
|
+
* @generated from field: optional string exit_price = 21;
|
|
8840
|
+
*/
|
|
8841
|
+
exitPrice?: string;
|
|
8842
|
+
/**
|
|
8843
|
+
* @generated from field: optional string realized_pnl = 22;
|
|
8844
|
+
*/
|
|
8845
|
+
realizedPnl?: string;
|
|
8846
|
+
constructor(data?: PartialMessage<MarginPositionRow>);
|
|
8847
|
+
static readonly runtime: typeof proto3;
|
|
8848
|
+
static readonly typeName = "trading.v1.MarginPositionRow";
|
|
8849
|
+
static readonly fields: FieldList;
|
|
8850
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionRow;
|
|
8851
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionRow;
|
|
8852
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionRow;
|
|
8853
|
+
static equals(a: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined, b: MarginPositionRow | PlainMessage<MarginPositionRow> | undefined): boolean;
|
|
8854
|
+
}
|
|
8855
|
+
/**
|
|
8856
|
+
* Collateral parked at a MarginAccount whose open never completed. Derived from
|
|
8857
|
+
* the chain rather than the plan store, so it survives plan-row expiry and is
|
|
8858
|
+
* visible from any device.
|
|
8859
|
+
*
|
|
8860
|
+
* @generated from message trading.v1.MarginIncompleteOpen
|
|
8861
|
+
*/
|
|
8862
|
+
export declare class MarginIncompleteOpen extends Message<MarginIncompleteOpen> {
|
|
8863
|
+
/**
|
|
8864
|
+
* @generated from field: string account = 1;
|
|
8865
|
+
*/
|
|
8866
|
+
account: string;
|
|
8867
|
+
/**
|
|
8868
|
+
* @generated from field: string sub_id = 2;
|
|
8869
|
+
*/
|
|
8870
|
+
subId: string;
|
|
8871
|
+
/**
|
|
8872
|
+
* False when the account holds a balance but was never deployed, which is the
|
|
8873
|
+
* window this surface exists for: pre-swap delivered, position not opened.
|
|
8874
|
+
*
|
|
8875
|
+
* @generated from field: bool deployed = 3;
|
|
8876
|
+
*/
|
|
8877
|
+
deployed: boolean;
|
|
8878
|
+
/**
|
|
8879
|
+
* @generated from field: trading.v1.MarginTokenMetadata token = 4;
|
|
8880
|
+
*/
|
|
8881
|
+
token?: MarginTokenMetadata;
|
|
8882
|
+
/**
|
|
8883
|
+
* @generated from field: string amount = 5;
|
|
8884
|
+
*/
|
|
8885
|
+
amount: string;
|
|
8886
|
+
constructor(data?: PartialMessage<MarginIncompleteOpen>);
|
|
8887
|
+
static readonly runtime: typeof proto3;
|
|
8888
|
+
static readonly typeName = "trading.v1.MarginIncompleteOpen";
|
|
8889
|
+
static readonly fields: FieldList;
|
|
8890
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginIncompleteOpen;
|
|
8891
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginIncompleteOpen;
|
|
8892
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginIncompleteOpen;
|
|
8893
|
+
static equals(a: MarginIncompleteOpen | PlainMessage<MarginIncompleteOpen> | undefined, b: MarginIncompleteOpen | PlainMessage<MarginIncompleteOpen> | undefined): boolean;
|
|
8894
|
+
}
|
|
8895
|
+
/**
|
|
8896
|
+
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|
|
8897
|
+
* this response: session-scoped and TTL-bound, so absent rather than wrong once
|
|
8898
|
+
* a row ages out. Acceptable only because no funds are at risk in that state.
|
|
8899
|
+
*
|
|
8900
|
+
* @generated from message trading.v1.MarginPendingPlan
|
|
8901
|
+
*/
|
|
8902
|
+
export declare class MarginPendingPlan extends Message<MarginPendingPlan> {
|
|
8903
|
+
/**
|
|
8904
|
+
* @generated from field: string plan_id = 1;
|
|
8905
|
+
*/
|
|
8906
|
+
planId: string;
|
|
8907
|
+
/**
|
|
8908
|
+
* @generated from field: int64 created_at = 2;
|
|
8909
|
+
*/
|
|
8910
|
+
createdAt: bigint;
|
|
8911
|
+
/**
|
|
8912
|
+
* @generated from field: int32 current_step = 3;
|
|
8913
|
+
*/
|
|
8914
|
+
currentStep: number;
|
|
8915
|
+
/**
|
|
8916
|
+
* @generated from field: bool cancellable = 4;
|
|
8917
|
+
*/
|
|
8918
|
+
cancellable: boolean;
|
|
8919
|
+
constructor(data?: PartialMessage<MarginPendingPlan>);
|
|
8920
|
+
static readonly runtime: typeof proto3;
|
|
8921
|
+
static readonly typeName = "trading.v1.MarginPendingPlan";
|
|
8922
|
+
static readonly fields: FieldList;
|
|
8923
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPendingPlan;
|
|
8924
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPendingPlan;
|
|
8925
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPendingPlan;
|
|
8926
|
+
static equals(a: MarginPendingPlan | PlainMessage<MarginPendingPlan> | undefined, b: MarginPendingPlan | PlainMessage<MarginPendingPlan> | undefined): boolean;
|
|
8927
|
+
}
|
|
8928
|
+
/**
|
|
8929
|
+
* @generated from message trading.v1.MarginPositionsRequest
|
|
8930
|
+
*/
|
|
8931
|
+
export declare class MarginPositionsRequest extends Message<MarginPositionsRequest> {
|
|
8932
|
+
/**
|
|
8933
|
+
* @generated from field: string swapper = 1;
|
|
8934
|
+
*/
|
|
8935
|
+
swapper: string;
|
|
8936
|
+
/**
|
|
8937
|
+
* @generated from field: int32 chain_id = 2;
|
|
8938
|
+
*/
|
|
8939
|
+
chainId: number;
|
|
8940
|
+
/**
|
|
8941
|
+
* Selects the tab. Unset is ACTIVE; explicit presence so the server can tell
|
|
8942
|
+
* "not asked" from "asked for ACTIVE".
|
|
8943
|
+
*
|
|
8944
|
+
* @generated from field: optional trading.v1.MarginPositionStatus status = 3;
|
|
8945
|
+
*/
|
|
8946
|
+
status?: MarginPositionStatus;
|
|
8947
|
+
/**
|
|
8948
|
+
* Opaque; echo `next_cursor` back verbatim. Keyset over the row order, the
|
|
8949
|
+
* same contract `GET /margin/markets` uses.
|
|
8950
|
+
*
|
|
8951
|
+
* @generated from field: optional string cursor = 4;
|
|
8952
|
+
*/
|
|
8953
|
+
cursor?: string;
|
|
8954
|
+
/**
|
|
8955
|
+
* @generated from field: optional int32 limit = 5;
|
|
8956
|
+
*/
|
|
8957
|
+
limit?: number;
|
|
8958
|
+
constructor(data?: PartialMessage<MarginPositionsRequest>);
|
|
8959
|
+
static readonly runtime: typeof proto3;
|
|
8960
|
+
static readonly typeName = "trading.v1.MarginPositionsRequest";
|
|
8961
|
+
static readonly fields: FieldList;
|
|
8962
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionsRequest;
|
|
8963
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionsRequest;
|
|
8964
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionsRequest;
|
|
8965
|
+
static equals(a: MarginPositionsRequest | PlainMessage<MarginPositionsRequest> | undefined, b: MarginPositionsRequest | PlainMessage<MarginPositionsRequest> | undefined): boolean;
|
|
8966
|
+
}
|
|
8967
|
+
/**
|
|
8968
|
+
* @generated from message trading.v1.MarginPositionsResponse
|
|
8969
|
+
*/
|
|
8970
|
+
export declare class MarginPositionsResponse extends Message<MarginPositionsResponse> {
|
|
8971
|
+
/**
|
|
8972
|
+
* @generated from field: string request_id = 1;
|
|
8973
|
+
*/
|
|
8974
|
+
requestId: string;
|
|
8975
|
+
/**
|
|
8976
|
+
* @generated from field: repeated trading.v1.MarginPositionRow positions = 2;
|
|
8977
|
+
*/
|
|
8978
|
+
positions: MarginPositionRow[];
|
|
8979
|
+
/**
|
|
8980
|
+
* Absent on the last page. Present means more rows exist, never that the next
|
|
8981
|
+
* page is non-empty.
|
|
8982
|
+
*
|
|
8983
|
+
* @generated from field: optional string next_cursor = 3;
|
|
8984
|
+
*/
|
|
8985
|
+
nextCursor?: string;
|
|
8986
|
+
/**
|
|
8987
|
+
* Both recovery surfaces serialize as [] when the read ran and found nothing.
|
|
8988
|
+
* They cannot express "not read": a degraded read logs a warning and reports
|
|
8989
|
+
* empty, matching how the markets feed degrades a failed venue.
|
|
8990
|
+
*
|
|
8991
|
+
* @generated from field: repeated trading.v1.MarginIncompleteOpen incomplete_opens = 4;
|
|
8992
|
+
*/
|
|
8993
|
+
incompleteOpens: MarginIncompleteOpen[];
|
|
8994
|
+
/**
|
|
8995
|
+
* @generated from field: repeated trading.v1.MarginPendingPlan pending_plans = 5;
|
|
8996
|
+
*/
|
|
8997
|
+
pendingPlans: MarginPendingPlan[];
|
|
8998
|
+
constructor(data?: PartialMessage<MarginPositionsResponse>);
|
|
8999
|
+
static readonly runtime: typeof proto3;
|
|
9000
|
+
static readonly typeName = "trading.v1.MarginPositionsResponse";
|
|
9001
|
+
static readonly fields: FieldList;
|
|
9002
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginPositionsResponse;
|
|
9003
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginPositionsResponse;
|
|
9004
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginPositionsResponse;
|
|
9005
|
+
static equals(a: MarginPositionsResponse | PlainMessage<MarginPositionsResponse> | undefined, b: MarginPositionsResponse | PlainMessage<MarginPositionsResponse> | undefined): boolean;
|
|
9006
|
+
}
|
|
@@ -1068,6 +1068,35 @@ proto3.util.setEnumType(MarginOperationType, "trading.v1.MarginOperationType", [
|
|
|
1068
1068
|
{ no: 3, name: "WITHDRAW" },
|
|
1069
1069
|
{ no: 4, name: "SWEEP" },
|
|
1070
1070
|
]);
|
|
1071
|
+
/**
|
|
1072
|
+
* @generated from enum trading.v1.MarginPositionStatus
|
|
1073
|
+
*/
|
|
1074
|
+
export var MarginPositionStatus;
|
|
1075
|
+
(function (MarginPositionStatus) {
|
|
1076
|
+
/**
|
|
1077
|
+
* @generated from enum value: ACTIVE = 0;
|
|
1078
|
+
*/
|
|
1079
|
+
MarginPositionStatus[MarginPositionStatus["ACTIVE"] = 0] = "ACTIVE";
|
|
1080
|
+
/**
|
|
1081
|
+
* @generated from enum value: COMPLETED = 1;
|
|
1082
|
+
*/
|
|
1083
|
+
MarginPositionStatus[MarginPositionStatus["COMPLETED"] = 1] = "COMPLETED";
|
|
1084
|
+
/**
|
|
1085
|
+
* @generated from enum value: LIQUIDATED = 2;
|
|
1086
|
+
*/
|
|
1087
|
+
MarginPositionStatus[MarginPositionStatus["LIQUIDATED"] = 2] = "LIQUIDATED";
|
|
1088
|
+
/**
|
|
1089
|
+
* @generated from enum value: PARTIALLY_LIQUIDATED = 3;
|
|
1090
|
+
*/
|
|
1091
|
+
MarginPositionStatus[MarginPositionStatus["PARTIALLY_LIQUIDATED"] = 3] = "PARTIALLY_LIQUIDATED";
|
|
1092
|
+
})(MarginPositionStatus || (MarginPositionStatus = {}));
|
|
1093
|
+
// Retrieve enum metadata with: proto3.getEnumType(MarginPositionStatus)
|
|
1094
|
+
proto3.util.setEnumType(MarginPositionStatus, "trading.v1.MarginPositionStatus", [
|
|
1095
|
+
{ no: 0, name: "ACTIVE" },
|
|
1096
|
+
{ no: 1, name: "COMPLETED" },
|
|
1097
|
+
{ no: 2, name: "LIQUIDATED" },
|
|
1098
|
+
{ no: 3, name: "PARTIALLY_LIQUIDATED" },
|
|
1099
|
+
]);
|
|
1071
1100
|
/**
|
|
1072
1101
|
* @generated from message trading.v1.Encode7702Request
|
|
1073
1102
|
*/
|
|
@@ -10019,3 +10048,315 @@ MarginQuoteResponse.fields = proto3.util.newFieldList(() => [
|
|
|
10019
10048
|
{ no: 3, name: "display", kind: "message", T: MarginDisplay },
|
|
10020
10049
|
{ no: 4, name: "gas_estimate", kind: "message", T: GasEstimate, opt: true },
|
|
10021
10050
|
]);
|
|
10051
|
+
/**
|
|
10052
|
+
* One venue's share of a position. Legs are the unit of truth: a logical
|
|
10053
|
+
* position is an aggregation performed at read time, and legs liquidate
|
|
10054
|
+
* independently, so the row's risk numbers are the NEAREST leg's.
|
|
10055
|
+
*
|
|
10056
|
+
* @generated from message trading.v1.MarginPositionLeg
|
|
10057
|
+
*/
|
|
10058
|
+
export class MarginPositionLeg extends Message {
|
|
10059
|
+
constructor(data) {
|
|
10060
|
+
super();
|
|
10061
|
+
/**
|
|
10062
|
+
* @generated from field: trading.v1.MarginVenue venue = 1;
|
|
10063
|
+
*/
|
|
10064
|
+
this.venue = MarginVenue.MORPHO;
|
|
10065
|
+
/**
|
|
10066
|
+
* The `positionId` handle every action key echoes back. Returned whether or
|
|
10067
|
+
* not a screen renders it.
|
|
10068
|
+
*
|
|
10069
|
+
* @generated from field: string sub_id = 2;
|
|
10070
|
+
*/
|
|
10071
|
+
this.subId = "";
|
|
10072
|
+
/**
|
|
10073
|
+
* The MarginAccount this leg lives at, derived offchain from (owner, subId).
|
|
10074
|
+
*
|
|
10075
|
+
* @generated from field: string account = 3;
|
|
10076
|
+
*/
|
|
10077
|
+
this.account = "";
|
|
10078
|
+
/**
|
|
10079
|
+
* @generated from field: string debt = 4;
|
|
10080
|
+
*/
|
|
10081
|
+
this.debt = "";
|
|
10082
|
+
proto3.util.initPartial(data, this);
|
|
10083
|
+
}
|
|
10084
|
+
static fromBinary(bytes, options) {
|
|
10085
|
+
return new MarginPositionLeg().fromBinary(bytes, options);
|
|
10086
|
+
}
|
|
10087
|
+
static fromJson(jsonValue, options) {
|
|
10088
|
+
return new MarginPositionLeg().fromJson(jsonValue, options);
|
|
10089
|
+
}
|
|
10090
|
+
static fromJsonString(jsonString, options) {
|
|
10091
|
+
return new MarginPositionLeg().fromJsonString(jsonString, options);
|
|
10092
|
+
}
|
|
10093
|
+
static equals(a, b) {
|
|
10094
|
+
return proto3.util.equals(MarginPositionLeg, a, b);
|
|
10095
|
+
}
|
|
10096
|
+
}
|
|
10097
|
+
MarginPositionLeg.runtime = proto3;
|
|
10098
|
+
MarginPositionLeg.typeName = "trading.v1.MarginPositionLeg";
|
|
10099
|
+
MarginPositionLeg.fields = proto3.util.newFieldList(() => [
|
|
10100
|
+
{ no: 1, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
|
|
10101
|
+
{ no: 2, name: "sub_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10102
|
+
{ no: 3, name: "account", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10103
|
+
{ no: 4, name: "debt", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10104
|
+
{ no: 5, name: "borrow_rate", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10105
|
+
]);
|
|
10106
|
+
/**
|
|
10107
|
+
* One logical position, keyed (exposure_token, counter_token, direction) — the
|
|
10108
|
+
* same key the markets cursor orders on, which is why both endpoints page
|
|
10109
|
+
* through `marginMarketCursor`.
|
|
10110
|
+
*
|
|
10111
|
+
* @generated from message trading.v1.MarginPositionRow
|
|
10112
|
+
*/
|
|
10113
|
+
export class MarginPositionRow extends Message {
|
|
10114
|
+
constructor(data) {
|
|
10115
|
+
super();
|
|
10116
|
+
/**
|
|
10117
|
+
* @generated from field: trading.v1.MarginPositionStatus status = 1;
|
|
10118
|
+
*/
|
|
10119
|
+
this.status = MarginPositionStatus.ACTIVE;
|
|
10120
|
+
/**
|
|
10121
|
+
* @generated from field: trading.v1.MarginDirection direction = 2;
|
|
10122
|
+
*/
|
|
10123
|
+
this.direction = MarginDirection.LONG;
|
|
10124
|
+
/**
|
|
10125
|
+
* @generated from field: string size = 5;
|
|
10126
|
+
*/
|
|
10127
|
+
this.size = "";
|
|
10128
|
+
/**
|
|
10129
|
+
* @generated from field: repeated trading.v1.MarginPositionLeg legs = 6;
|
|
10130
|
+
*/
|
|
10131
|
+
this.legs = [];
|
|
10132
|
+
proto3.util.initPartial(data, this);
|
|
10133
|
+
}
|
|
10134
|
+
static fromBinary(bytes, options) {
|
|
10135
|
+
return new MarginPositionRow().fromBinary(bytes, options);
|
|
10136
|
+
}
|
|
10137
|
+
static fromJson(jsonValue, options) {
|
|
10138
|
+
return new MarginPositionRow().fromJson(jsonValue, options);
|
|
10139
|
+
}
|
|
10140
|
+
static fromJsonString(jsonString, options) {
|
|
10141
|
+
return new MarginPositionRow().fromJsonString(jsonString, options);
|
|
10142
|
+
}
|
|
10143
|
+
static equals(a, b) {
|
|
10144
|
+
return proto3.util.equals(MarginPositionRow, a, b);
|
|
10145
|
+
}
|
|
10146
|
+
}
|
|
10147
|
+
MarginPositionRow.runtime = proto3;
|
|
10148
|
+
MarginPositionRow.typeName = "trading.v1.MarginPositionRow";
|
|
10149
|
+
MarginPositionRow.fields = proto3.util.newFieldList(() => [
|
|
10150
|
+
{ no: 1, name: "status", kind: "enum", T: proto3.getEnumType(MarginPositionStatus) },
|
|
10151
|
+
{ no: 2, name: "direction", kind: "enum", T: proto3.getEnumType(MarginDirection) },
|
|
10152
|
+
{ no: 3, name: "exposure_token", kind: "message", T: MarginTokenMetadata },
|
|
10153
|
+
{ no: 4, name: "counter_token", kind: "message", T: MarginTokenMetadata },
|
|
10154
|
+
{ no: 5, name: "size", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10155
|
+
{ no: 6, name: "legs", kind: "message", T: MarginPositionLeg, repeated: true },
|
|
10156
|
+
{ no: 7, name: "entry_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10157
|
+
{ no: 8, name: "opened_at", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
|
|
10158
|
+
{ no: 9, name: "accrued_interest", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10159
|
+
{ no: 10, name: "unrealized_pnl", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10160
|
+
{ no: 11, name: "roe", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10161
|
+
{ no: 12, name: "equity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10162
|
+
{ no: 13, name: "leverage", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10163
|
+
{ no: 14, name: "oracle_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10164
|
+
{ no: 15, name: "liquidation_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10165
|
+
{ no: 16, name: "buffer", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10166
|
+
{ no: 17, name: "health_factor", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10167
|
+
{ no: 18, name: "borrow_rate", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10168
|
+
{ no: 19, name: "max_withdrawable", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10169
|
+
{ no: 20, name: "closed_at", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
|
|
10170
|
+
{ no: 21, name: "exit_price", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10171
|
+
{ no: 22, name: "realized_pnl", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10172
|
+
]);
|
|
10173
|
+
/**
|
|
10174
|
+
* Collateral parked at a MarginAccount whose open never completed. Derived from
|
|
10175
|
+
* the chain rather than the plan store, so it survives plan-row expiry and is
|
|
10176
|
+
* visible from any device.
|
|
10177
|
+
*
|
|
10178
|
+
* @generated from message trading.v1.MarginIncompleteOpen
|
|
10179
|
+
*/
|
|
10180
|
+
export class MarginIncompleteOpen extends Message {
|
|
10181
|
+
constructor(data) {
|
|
10182
|
+
super();
|
|
10183
|
+
/**
|
|
10184
|
+
* @generated from field: string account = 1;
|
|
10185
|
+
*/
|
|
10186
|
+
this.account = "";
|
|
10187
|
+
/**
|
|
10188
|
+
* @generated from field: string sub_id = 2;
|
|
10189
|
+
*/
|
|
10190
|
+
this.subId = "";
|
|
10191
|
+
/**
|
|
10192
|
+
* False when the account holds a balance but was never deployed, which is the
|
|
10193
|
+
* window this surface exists for: pre-swap delivered, position not opened.
|
|
10194
|
+
*
|
|
10195
|
+
* @generated from field: bool deployed = 3;
|
|
10196
|
+
*/
|
|
10197
|
+
this.deployed = false;
|
|
10198
|
+
/**
|
|
10199
|
+
* @generated from field: string amount = 5;
|
|
10200
|
+
*/
|
|
10201
|
+
this.amount = "";
|
|
10202
|
+
proto3.util.initPartial(data, this);
|
|
10203
|
+
}
|
|
10204
|
+
static fromBinary(bytes, options) {
|
|
10205
|
+
return new MarginIncompleteOpen().fromBinary(bytes, options);
|
|
10206
|
+
}
|
|
10207
|
+
static fromJson(jsonValue, options) {
|
|
10208
|
+
return new MarginIncompleteOpen().fromJson(jsonValue, options);
|
|
10209
|
+
}
|
|
10210
|
+
static fromJsonString(jsonString, options) {
|
|
10211
|
+
return new MarginIncompleteOpen().fromJsonString(jsonString, options);
|
|
10212
|
+
}
|
|
10213
|
+
static equals(a, b) {
|
|
10214
|
+
return proto3.util.equals(MarginIncompleteOpen, a, b);
|
|
10215
|
+
}
|
|
10216
|
+
}
|
|
10217
|
+
MarginIncompleteOpen.runtime = proto3;
|
|
10218
|
+
MarginIncompleteOpen.typeName = "trading.v1.MarginIncompleteOpen";
|
|
10219
|
+
MarginIncompleteOpen.fields = proto3.util.newFieldList(() => [
|
|
10220
|
+
{ no: 1, name: "account", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10221
|
+
{ no: 2, name: "sub_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10222
|
+
{ no: 3, name: "deployed", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
10223
|
+
{ no: 4, name: "token", kind: "message", T: MarginTokenMetadata },
|
|
10224
|
+
{ no: 5, name: "amount", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10225
|
+
]);
|
|
10226
|
+
/**
|
|
10227
|
+
* The one plan-store read, and a deliberately weaker guarantee than the rest of
|
|
10228
|
+
* this response: session-scoped and TTL-bound, so absent rather than wrong once
|
|
10229
|
+
* a row ages out. Acceptable only because no funds are at risk in that state.
|
|
10230
|
+
*
|
|
10231
|
+
* @generated from message trading.v1.MarginPendingPlan
|
|
10232
|
+
*/
|
|
10233
|
+
export class MarginPendingPlan extends Message {
|
|
10234
|
+
constructor(data) {
|
|
10235
|
+
super();
|
|
10236
|
+
/**
|
|
10237
|
+
* @generated from field: string plan_id = 1;
|
|
10238
|
+
*/
|
|
10239
|
+
this.planId = "";
|
|
10240
|
+
/**
|
|
10241
|
+
* @generated from field: int64 created_at = 2;
|
|
10242
|
+
*/
|
|
10243
|
+
this.createdAt = protoInt64.zero;
|
|
10244
|
+
/**
|
|
10245
|
+
* @generated from field: int32 current_step = 3;
|
|
10246
|
+
*/
|
|
10247
|
+
this.currentStep = 0;
|
|
10248
|
+
/**
|
|
10249
|
+
* @generated from field: bool cancellable = 4;
|
|
10250
|
+
*/
|
|
10251
|
+
this.cancellable = false;
|
|
10252
|
+
proto3.util.initPartial(data, this);
|
|
10253
|
+
}
|
|
10254
|
+
static fromBinary(bytes, options) {
|
|
10255
|
+
return new MarginPendingPlan().fromBinary(bytes, options);
|
|
10256
|
+
}
|
|
10257
|
+
static fromJson(jsonValue, options) {
|
|
10258
|
+
return new MarginPendingPlan().fromJson(jsonValue, options);
|
|
10259
|
+
}
|
|
10260
|
+
static fromJsonString(jsonString, options) {
|
|
10261
|
+
return new MarginPendingPlan().fromJsonString(jsonString, options);
|
|
10262
|
+
}
|
|
10263
|
+
static equals(a, b) {
|
|
10264
|
+
return proto3.util.equals(MarginPendingPlan, a, b);
|
|
10265
|
+
}
|
|
10266
|
+
}
|
|
10267
|
+
MarginPendingPlan.runtime = proto3;
|
|
10268
|
+
MarginPendingPlan.typeName = "trading.v1.MarginPendingPlan";
|
|
10269
|
+
MarginPendingPlan.fields = proto3.util.newFieldList(() => [
|
|
10270
|
+
{ no: 1, name: "plan_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10271
|
+
{ no: 2, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
10272
|
+
{ no: 3, name: "current_step", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
10273
|
+
{ no: 4, name: "cancellable", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
10274
|
+
]);
|
|
10275
|
+
/**
|
|
10276
|
+
* @generated from message trading.v1.MarginPositionsRequest
|
|
10277
|
+
*/
|
|
10278
|
+
export class MarginPositionsRequest extends Message {
|
|
10279
|
+
constructor(data) {
|
|
10280
|
+
super();
|
|
10281
|
+
/**
|
|
10282
|
+
* @generated from field: string swapper = 1;
|
|
10283
|
+
*/
|
|
10284
|
+
this.swapper = "";
|
|
10285
|
+
/**
|
|
10286
|
+
* @generated from field: int32 chain_id = 2;
|
|
10287
|
+
*/
|
|
10288
|
+
this.chainId = 0;
|
|
10289
|
+
proto3.util.initPartial(data, this);
|
|
10290
|
+
}
|
|
10291
|
+
static fromBinary(bytes, options) {
|
|
10292
|
+
return new MarginPositionsRequest().fromBinary(bytes, options);
|
|
10293
|
+
}
|
|
10294
|
+
static fromJson(jsonValue, options) {
|
|
10295
|
+
return new MarginPositionsRequest().fromJson(jsonValue, options);
|
|
10296
|
+
}
|
|
10297
|
+
static fromJsonString(jsonString, options) {
|
|
10298
|
+
return new MarginPositionsRequest().fromJsonString(jsonString, options);
|
|
10299
|
+
}
|
|
10300
|
+
static equals(a, b) {
|
|
10301
|
+
return proto3.util.equals(MarginPositionsRequest, a, b);
|
|
10302
|
+
}
|
|
10303
|
+
}
|
|
10304
|
+
MarginPositionsRequest.runtime = proto3;
|
|
10305
|
+
MarginPositionsRequest.typeName = "trading.v1.MarginPositionsRequest";
|
|
10306
|
+
MarginPositionsRequest.fields = proto3.util.newFieldList(() => [
|
|
10307
|
+
{ no: 1, name: "swapper", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10308
|
+
{ no: 2, name: "chain_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
10309
|
+
{ no: 3, name: "status", kind: "enum", T: proto3.getEnumType(MarginPositionStatus), opt: true },
|
|
10310
|
+
{ no: 4, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10311
|
+
{ no: 5, name: "limit", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
|
|
10312
|
+
]);
|
|
10313
|
+
/**
|
|
10314
|
+
* @generated from message trading.v1.MarginPositionsResponse
|
|
10315
|
+
*/
|
|
10316
|
+
export class MarginPositionsResponse extends Message {
|
|
10317
|
+
constructor(data) {
|
|
10318
|
+
super();
|
|
10319
|
+
/**
|
|
10320
|
+
* @generated from field: string request_id = 1;
|
|
10321
|
+
*/
|
|
10322
|
+
this.requestId = "";
|
|
10323
|
+
/**
|
|
10324
|
+
* @generated from field: repeated trading.v1.MarginPositionRow positions = 2;
|
|
10325
|
+
*/
|
|
10326
|
+
this.positions = [];
|
|
10327
|
+
/**
|
|
10328
|
+
* Both recovery surfaces serialize as [] when the read ran and found nothing.
|
|
10329
|
+
* They cannot express "not read": a degraded read logs a warning and reports
|
|
10330
|
+
* empty, matching how the markets feed degrades a failed venue.
|
|
10331
|
+
*
|
|
10332
|
+
* @generated from field: repeated trading.v1.MarginIncompleteOpen incomplete_opens = 4;
|
|
10333
|
+
*/
|
|
10334
|
+
this.incompleteOpens = [];
|
|
10335
|
+
/**
|
|
10336
|
+
* @generated from field: repeated trading.v1.MarginPendingPlan pending_plans = 5;
|
|
10337
|
+
*/
|
|
10338
|
+
this.pendingPlans = [];
|
|
10339
|
+
proto3.util.initPartial(data, this);
|
|
10340
|
+
}
|
|
10341
|
+
static fromBinary(bytes, options) {
|
|
10342
|
+
return new MarginPositionsResponse().fromBinary(bytes, options);
|
|
10343
|
+
}
|
|
10344
|
+
static fromJson(jsonValue, options) {
|
|
10345
|
+
return new MarginPositionsResponse().fromJson(jsonValue, options);
|
|
10346
|
+
}
|
|
10347
|
+
static fromJsonString(jsonString, options) {
|
|
10348
|
+
return new MarginPositionsResponse().fromJsonString(jsonString, options);
|
|
10349
|
+
}
|
|
10350
|
+
static equals(a, b) {
|
|
10351
|
+
return proto3.util.equals(MarginPositionsResponse, a, b);
|
|
10352
|
+
}
|
|
10353
|
+
}
|
|
10354
|
+
MarginPositionsResponse.runtime = proto3;
|
|
10355
|
+
MarginPositionsResponse.typeName = "trading.v1.MarginPositionsResponse";
|
|
10356
|
+
MarginPositionsResponse.fields = proto3.util.newFieldList(() => [
|
|
10357
|
+
{ no: 1, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
10358
|
+
{ no: 2, name: "positions", kind: "message", T: MarginPositionRow, repeated: true },
|
|
10359
|
+
{ no: 3, name: "next_cursor", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
10360
|
+
{ no: 4, name: "incomplete_opens", kind: "message", T: MarginIncompleteOpen, repeated: true },
|
|
10361
|
+
{ no: 5, name: "pending_plans", kind: "message", T: MarginPendingPlan, repeated: true },
|
|
10362
|
+
]);
|