@uniswap/client-trading 0.5.18 → 0.6.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.
@@ -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, 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, 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
  */
@@ -308,3 +308,17 @@ export declare const getPlans: {
308
308
  readonly typeName: "trading.v1.tradingService";
309
309
  };
310
310
  };
311
+ /**
312
+ * @generated from rpc trading.v1.tradingService.MarginMarkets
313
+ */
314
+ export declare const marginMarkets: {
315
+ readonly localName: "marginMarkets";
316
+ readonly name: "MarginMarkets";
317
+ readonly kind: MethodKind.Unary;
318
+ readonly I: typeof MarginMarketsRequest;
319
+ readonly O: typeof MarginMarketsResponse;
320
+ readonly idempotency: MethodIdempotency.NoSideEffects;
321
+ readonly service: {
322
+ readonly typeName: "trading.v1.tradingService";
323
+ };
324
+ };
@@ -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, 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, 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
  */
@@ -312,3 +312,17 @@ export const getPlans = {
312
312
  typeName: "trading.v1.tradingService"
313
313
  }
314
314
  };
315
+ /**
316
+ * @generated from rpc trading.v1.tradingService.MarginMarkets
317
+ */
318
+ export const marginMarkets = {
319
+ localName: "marginMarkets",
320
+ name: "MarginMarkets",
321
+ kind: MethodKind.Unary,
322
+ I: MarginMarketsRequest,
323
+ O: MarginMarketsResponse,
324
+ idempotency: MethodIdempotency.NoSideEffects,
325
+ service: {
326
+ typeName: "trading.v1.tradingService"
327
+ }
328
+ };
@@ -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, 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, 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
@@ -226,5 +226,15 @@ export declare const tradingService: {
226
226
  readonly kind: MethodKind.Unary;
227
227
  readonly idempotency: MethodIdempotency.NoSideEffects;
228
228
  };
229
+ /**
230
+ * @generated from rpc trading.v1.tradingService.MarginMarkets
231
+ */
232
+ readonly marginMarkets: {
233
+ readonly name: "MarginMarkets";
234
+ readonly I: typeof MarginMarketsRequest;
235
+ readonly O: typeof MarginMarketsResponse;
236
+ readonly kind: MethodKind.Unary;
237
+ readonly idempotency: MethodIdempotency.NoSideEffects;
238
+ };
229
239
  };
230
240
  };
@@ -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, 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, 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
@@ -230,5 +230,15 @@ export const tradingService = {
230
230
  kind: MethodKind.Unary,
231
231
  idempotency: MethodIdempotency.NoSideEffects,
232
232
  },
233
+ /**
234
+ * @generated from rpc trading.v1.tradingService.MarginMarkets
235
+ */
236
+ marginMarkets: {
237
+ name: "MarginMarkets",
238
+ I: MarginMarketsRequest,
239
+ O: MarginMarketsResponse,
240
+ kind: MethodKind.Unary,
241
+ idempotency: MethodIdempotency.NoSideEffects,
242
+ },
233
243
  }
234
244
  };
@@ -476,7 +476,14 @@ export declare enum PlanStepType {
476
476
  *
477
477
  * @generated from enum value: PLAN_STEP_TYPE_MARGIN_EXECUTE = 16;
478
478
  */
479
- MARGIN_EXECUTE = 16
479
+ MARGIN_EXECUTE = 16,
480
+ /**
481
+ * Fused Swap→Bridge: one Universal Router transaction that swaps on the
482
+ * source chain and deposits the output into the Across SpokePool.
483
+ *
484
+ * @generated from enum value: PLAN_STEP_TYPE_SWAP_BRIDGE = 17;
485
+ */
486
+ SWAP_BRIDGE = 17
480
487
  }
481
488
  /**
482
489
  * Set when the output is a fee taken from the swap; unset for the swapper's
@@ -673,6 +680,39 @@ export declare enum AllowanceUnit {
673
680
  */
674
681
  USD_CENT = 2
675
682
  }
683
+ /**
684
+ * @generated from enum trading.v1.MarginDirection
685
+ */
686
+ export declare enum MarginDirection {
687
+ /**
688
+ * LONG = borrow counter, buy exposure => collateral = exposure, debt = counter
689
+ * SHORT = borrow exposure, sell for counter => collateral = counter, debt = exposure
690
+ *
691
+ * @generated from enum value: LONG = 0;
692
+ */
693
+ LONG = 0,
694
+ /**
695
+ * @generated from enum value: SHORT = 1;
696
+ */
697
+ SHORT = 1
698
+ }
699
+ /**
700
+ * @generated from enum trading.v1.MarginVenue
701
+ */
702
+ export declare enum MarginVenue {
703
+ /**
704
+ * @generated from enum value: MORPHO = 0;
705
+ */
706
+ MORPHO = 0,
707
+ /**
708
+ * @generated from enum value: AAVE_V3 = 1;
709
+ */
710
+ AAVE_V3 = 1,
711
+ /**
712
+ * @generated from enum value: AAVE_V4 = 2;
713
+ */
714
+ AAVE_V4 = 2
715
+ }
676
716
  /**
677
717
  * @generated from message trading.v1.Encode7702Request
678
718
  */
@@ -7676,3 +7716,226 @@ export declare class SponsorshipInfo extends Message<SponsorshipInfo> {
7676
7716
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SponsorshipInfo;
7677
7717
  static equals(a: SponsorshipInfo | PlainMessage<SponsorshipInfo> | undefined, b: SponsorshipInfo | PlainMessage<SponsorshipInfo> | undefined): boolean;
7678
7718
  }
7719
+ /**
7720
+ * A token as a RESPONSE carries it. No symbol or name: this endpoint resolves
7721
+ * markets, not token metadata, and the client merges display fields from its own
7722
+ * token lists by address.
7723
+ *
7724
+ * @generated from message trading.v1.MarginTokenMetadata
7725
+ */
7726
+ export declare class MarginTokenMetadata extends Message<MarginTokenMetadata> {
7727
+ /**
7728
+ * @generated from field: string address = 1;
7729
+ */
7730
+ address: string;
7731
+ /**
7732
+ * @generated from field: int32 chain_id = 2;
7733
+ */
7734
+ chainId: number;
7735
+ /**
7736
+ * @generated from field: int32 decimals = 3;
7737
+ */
7738
+ decimals: number;
7739
+ constructor(data?: PartialMessage<MarginTokenMetadata>);
7740
+ static readonly runtime: typeof proto3;
7741
+ static readonly typeName = "trading.v1.MarginTokenMetadata";
7742
+ static readonly fields: FieldList;
7743
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginTokenMetadata;
7744
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginTokenMetadata;
7745
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginTokenMetadata;
7746
+ static equals(a: MarginTokenMetadata | PlainMessage<MarginTokenMetadata> | undefined, b: MarginTokenMetadata | PlainMessage<MarginTokenMetadata> | undefined): boolean;
7747
+ }
7748
+ /**
7749
+ * What one venue offers for a pair, for the advanced breakdown. The scalars
7750
+ * beside `venues` on the row are the HEADLINE venue's; read `headline_venue`
7751
+ * rather than matching them back.
7752
+ *
7753
+ * @generated from message trading.v1.MarginMarketVenue
7754
+ */
7755
+ export declare class MarginMarketVenue extends Message<MarginMarketVenue> {
7756
+ /**
7757
+ * @generated from field: trading.v1.MarginVenue venue = 1;
7758
+ */
7759
+ venue: MarginVenue;
7760
+ /**
7761
+ * @generated from field: string adapter = 2;
7762
+ */
7763
+ adapter: string;
7764
+ /**
7765
+ * Morpho's market id. Absent where the (adapter, pair) IS the market.
7766
+ *
7767
+ * @generated from field: optional string venue_market_id = 3;
7768
+ */
7769
+ venueMarketId?: string;
7770
+ /**
7771
+ * Decimal string, derived from the venue's BORROW-side LTV with the cliff
7772
+ * buffer already applied. Server-authored: a client must not compute this
7773
+ * from lltv, or its ceiling and the quote's refusal disagree.
7774
+ *
7775
+ * @generated from field: string max_leverage = 4;
7776
+ */
7777
+ maxLeverage: string;
7778
+ /**
7779
+ * The liquidation boundary itself, 18-dec. Shown, never used for the ceiling.
7780
+ *
7781
+ * @generated from field: string lltv = 5;
7782
+ */
7783
+ lltv: string;
7784
+ /**
7785
+ * Annual, 18-dec. Absent when the venue's rate read failed, which is not the
7786
+ * same as a rate of zero.
7787
+ *
7788
+ * @generated from field: optional string borrow_rate = 6;
7789
+ */
7790
+ borrowRate?: string;
7791
+ /**
7792
+ * Absent until the venue's liquidity is read, which is NOT the same as a
7793
+ * market with nothing left to lend.
7794
+ *
7795
+ * @generated from field: optional string available_borrow_liquidity = 7;
7796
+ */
7797
+ availableBorrowLiquidity?: string;
7798
+ constructor(data?: PartialMessage<MarginMarketVenue>);
7799
+ static readonly runtime: typeof proto3;
7800
+ static readonly typeName = "trading.v1.MarginMarketVenue";
7801
+ static readonly fields: FieldList;
7802
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginMarketVenue;
7803
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginMarketVenue;
7804
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginMarketVenue;
7805
+ static equals(a: MarginMarketVenue | PlainMessage<MarginMarketVenue> | undefined, b: MarginMarketVenue | PlainMessage<MarginMarketVenue> | undefined): boolean;
7806
+ }
7807
+ /**
7808
+ * One row per (exposure_token, counter_token, direction).
7809
+ *
7810
+ * @generated from message trading.v1.MarginMarketRow
7811
+ */
7812
+ export declare class MarginMarketRow extends Message<MarginMarketRow> {
7813
+ /**
7814
+ * @generated from field: trading.v1.MarginTokenMetadata exposure_token = 1;
7815
+ */
7816
+ exposureToken?: MarginTokenMetadata;
7817
+ /**
7818
+ * @generated from field: trading.v1.MarginTokenMetadata counter_token = 2;
7819
+ */
7820
+ counterToken?: MarginTokenMetadata;
7821
+ /**
7822
+ * @generated from field: trading.v1.MarginDirection direction = 3;
7823
+ */
7824
+ direction: MarginDirection;
7825
+ /**
7826
+ * The venue behind max_leverage, decided by the same code path the quote
7827
+ * uses so the picker and the quote cannot disagree.
7828
+ *
7829
+ * @generated from field: trading.v1.MarginVenue headline_venue = 4;
7830
+ */
7831
+ headlineVenue: MarginVenue;
7832
+ /**
7833
+ * The furthest this market goes, across every venue carrying it. The only
7834
+ * scalar here, because it is the only one whose best is also achievable:
7835
+ * rates and LTVs differ per venue and the cheapest rate is not necessarily
7836
+ * available at this leverage, so both live on `venues` beside the ceiling
7837
+ * they come with.
7838
+ *
7839
+ * @generated from field: string max_leverage = 5;
7840
+ */
7841
+ maxLeverage: string;
7842
+ /**
7843
+ * @generated from field: repeated trading.v1.MarginMarketVenue venues = 6;
7844
+ */
7845
+ venues: MarginMarketVenue[];
7846
+ constructor(data?: PartialMessage<MarginMarketRow>);
7847
+ static readonly runtime: typeof proto3;
7848
+ static readonly typeName = "trading.v1.MarginMarketRow";
7849
+ static readonly fields: FieldList;
7850
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginMarketRow;
7851
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginMarketRow;
7852
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginMarketRow;
7853
+ static equals(a: MarginMarketRow | PlainMessage<MarginMarketRow> | undefined, b: MarginMarketRow | PlainMessage<MarginMarketRow> | undefined): boolean;
7854
+ }
7855
+ /**
7856
+ * Discovery for the market picker. Indicative by construction: rates move every
7857
+ * block, so no response agrees with a quote taken seconds later. The quote
7858
+ * re-reads on chain and its bounds are enforced in calldata, so a stale row
7859
+ * costs a re-quote and never a bad execution.
7860
+ *
7861
+ * @generated from message trading.v1.MarginMarketsRequest
7862
+ */
7863
+ export declare class MarginMarketsRequest extends Message<MarginMarketsRequest> {
7864
+ /**
7865
+ * @generated from field: int32 chain_id = 1;
7866
+ */
7867
+ chainId: number;
7868
+ /**
7869
+ * All optional, and each one narrows the rows returned.
7870
+ *
7871
+ * @generated from field: optional string exposure_token = 2;
7872
+ */
7873
+ exposureToken?: string;
7874
+ /**
7875
+ * @generated from field: optional string counter_token = 3;
7876
+ */
7877
+ counterToken?: string;
7878
+ /**
7879
+ * @generated from field: optional trading.v1.MarginDirection direction = 4;
7880
+ */
7881
+ direction?: MarginDirection;
7882
+ /**
7883
+ * The LENDING allowlist. A named subset also re-decides `headline_venue` over
7884
+ * that subset, so it is a filter on the answer and not only on the search.
7885
+ *
7886
+ * @generated from field: repeated trading.v1.MarginVenue venues = 5;
7887
+ */
7888
+ venues: MarginVenue[];
7889
+ /**
7890
+ * Opaque; echo `next_cursor` back verbatim. A KEYSET cursor over the row
7891
+ * order, not an offset: the catalogue is rebuilt on a timer, and an offset
7892
+ * taken against one build silently skips or repeats rows against the next.
7893
+ *
7894
+ * @generated from field: optional string cursor = 6;
7895
+ */
7896
+ cursor?: string;
7897
+ /**
7898
+ * Rows per page. Defaulted and hard-capped, so no caller receives an
7899
+ * unbounded set: nothing about this endpoint bounds its own size, and the
7900
+ * row count grows whenever governance allows a market.
7901
+ *
7902
+ * @generated from field: optional int32 limit = 7;
7903
+ */
7904
+ limit?: number;
7905
+ constructor(data?: PartialMessage<MarginMarketsRequest>);
7906
+ static readonly runtime: typeof proto3;
7907
+ static readonly typeName = "trading.v1.MarginMarketsRequest";
7908
+ static readonly fields: FieldList;
7909
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginMarketsRequest;
7910
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginMarketsRequest;
7911
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginMarketsRequest;
7912
+ static equals(a: MarginMarketsRequest | PlainMessage<MarginMarketsRequest> | undefined, b: MarginMarketsRequest | PlainMessage<MarginMarketsRequest> | undefined): boolean;
7913
+ }
7914
+ /**
7915
+ * @generated from message trading.v1.MarginMarketsResponse
7916
+ */
7917
+ export declare class MarginMarketsResponse extends Message<MarginMarketsResponse> {
7918
+ /**
7919
+ * @generated from field: string request_id = 1;
7920
+ */
7921
+ requestId: string;
7922
+ /**
7923
+ * @generated from field: repeated trading.v1.MarginMarketRow markets = 2;
7924
+ */
7925
+ markets: MarginMarketRow[];
7926
+ /**
7927
+ * Absent on the last page, which is how a client knows to stop. Present means
7928
+ * more rows exist, never that the next page is non-empty.
7929
+ *
7930
+ * @generated from field: optional string next_cursor = 3;
7931
+ */
7932
+ nextCursor?: string;
7933
+ constructor(data?: PartialMessage<MarginMarketsResponse>);
7934
+ static readonly runtime: typeof proto3;
7935
+ static readonly typeName = "trading.v1.MarginMarketsResponse";
7936
+ static readonly fields: FieldList;
7937
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MarginMarketsResponse;
7938
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MarginMarketsResponse;
7939
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MarginMarketsResponse;
7940
+ static equals(a: MarginMarketsResponse | PlainMessage<MarginMarketsResponse> | undefined, b: MarginMarketsResponse | PlainMessage<MarginMarketsResponse> | undefined): boolean;
7941
+ }
@@ -622,6 +622,13 @@ export var PlanStepType;
622
622
  * @generated from enum value: PLAN_STEP_TYPE_MARGIN_EXECUTE = 16;
623
623
  */
624
624
  PlanStepType[PlanStepType["MARGIN_EXECUTE"] = 16] = "MARGIN_EXECUTE";
625
+ /**
626
+ * Fused Swap→Bridge: one Universal Router transaction that swaps on the
627
+ * source chain and deposits the output into the Across SpokePool.
628
+ *
629
+ * @generated from enum value: PLAN_STEP_TYPE_SWAP_BRIDGE = 17;
630
+ */
631
+ PlanStepType[PlanStepType["SWAP_BRIDGE"] = 17] = "SWAP_BRIDGE";
625
632
  })(PlanStepType || (PlanStepType = {}));
626
633
  // Retrieve enum metadata with: proto3.getEnumType(PlanStepType)
627
634
  proto3.util.setEnumType(PlanStepType, "trading.v1.PlanStepType", [
@@ -642,6 +649,7 @@ proto3.util.setEnumType(PlanStepType, "trading.v1.PlanStepType", [
642
649
  { no: 14, name: "PLAN_STEP_TYPE_VAULT_DEPOSIT" },
643
650
  { no: 15, name: "PLAN_STEP_TYPE_VAULT_WITHDRAW" },
644
651
  { no: 16, name: "PLAN_STEP_TYPE_MARGIN_EXECUTE" },
652
+ { no: 17, name: "PLAN_STEP_TYPE_SWAP_BRIDGE" },
645
653
  ]);
646
654
  /**
647
655
  * Set when the output is a fee taken from the swap; unset for the swapper's
@@ -913,6 +921,52 @@ proto3.util.setEnumType(AllowanceUnit, "trading.v1.AllowanceUnit", [
913
921
  { no: 1, name: "ALLOWANCE_UNIT_FREE_SWAPS" },
914
922
  { no: 2, name: "ALLOWANCE_UNIT_USD_CENT" },
915
923
  ]);
924
+ /**
925
+ * @generated from enum trading.v1.MarginDirection
926
+ */
927
+ export var MarginDirection;
928
+ (function (MarginDirection) {
929
+ /**
930
+ * LONG = borrow counter, buy exposure => collateral = exposure, debt = counter
931
+ * SHORT = borrow exposure, sell for counter => collateral = counter, debt = exposure
932
+ *
933
+ * @generated from enum value: LONG = 0;
934
+ */
935
+ MarginDirection[MarginDirection["LONG"] = 0] = "LONG";
936
+ /**
937
+ * @generated from enum value: SHORT = 1;
938
+ */
939
+ MarginDirection[MarginDirection["SHORT"] = 1] = "SHORT";
940
+ })(MarginDirection || (MarginDirection = {}));
941
+ // Retrieve enum metadata with: proto3.getEnumType(MarginDirection)
942
+ proto3.util.setEnumType(MarginDirection, "trading.v1.MarginDirection", [
943
+ { no: 0, name: "LONG" },
944
+ { no: 1, name: "SHORT" },
945
+ ]);
946
+ /**
947
+ * @generated from enum trading.v1.MarginVenue
948
+ */
949
+ export var MarginVenue;
950
+ (function (MarginVenue) {
951
+ /**
952
+ * @generated from enum value: MORPHO = 0;
953
+ */
954
+ MarginVenue[MarginVenue["MORPHO"] = 0] = "MORPHO";
955
+ /**
956
+ * @generated from enum value: AAVE_V3 = 1;
957
+ */
958
+ MarginVenue[MarginVenue["AAVE_V3"] = 1] = "AAVE_V3";
959
+ /**
960
+ * @generated from enum value: AAVE_V4 = 2;
961
+ */
962
+ MarginVenue[MarginVenue["AAVE_V4"] = 2] = "AAVE_V4";
963
+ })(MarginVenue || (MarginVenue = {}));
964
+ // Retrieve enum metadata with: proto3.getEnumType(MarginVenue)
965
+ proto3.util.setEnumType(MarginVenue, "trading.v1.MarginVenue", [
966
+ { no: 0, name: "MORPHO" },
967
+ { no: 1, name: "AAVE_V3" },
968
+ { no: 2, name: "AAVE_V4" },
969
+ ]);
916
970
  /**
917
971
  * @generated from message trading.v1.Encode7702Request
918
972
  */
@@ -9027,3 +9081,247 @@ SponsorshipInfo.fields = proto3.util.newFieldList(() => [
9027
9081
  { no: 3, name: "sponsor_metadata", kind: "message", T: SponsorMetadata, opt: true },
9028
9082
  { no: 4, name: "campaign", kind: "message", T: CampaignDetails, opt: true },
9029
9083
  ]);
9084
+ /**
9085
+ * A token as a RESPONSE carries it. No symbol or name: this endpoint resolves
9086
+ * markets, not token metadata, and the client merges display fields from its own
9087
+ * token lists by address.
9088
+ *
9089
+ * @generated from message trading.v1.MarginTokenMetadata
9090
+ */
9091
+ export class MarginTokenMetadata extends Message {
9092
+ constructor(data) {
9093
+ super();
9094
+ /**
9095
+ * @generated from field: string address = 1;
9096
+ */
9097
+ this.address = "";
9098
+ /**
9099
+ * @generated from field: int32 chain_id = 2;
9100
+ */
9101
+ this.chainId = 0;
9102
+ /**
9103
+ * @generated from field: int32 decimals = 3;
9104
+ */
9105
+ this.decimals = 0;
9106
+ proto3.util.initPartial(data, this);
9107
+ }
9108
+ static fromBinary(bytes, options) {
9109
+ return new MarginTokenMetadata().fromBinary(bytes, options);
9110
+ }
9111
+ static fromJson(jsonValue, options) {
9112
+ return new MarginTokenMetadata().fromJson(jsonValue, options);
9113
+ }
9114
+ static fromJsonString(jsonString, options) {
9115
+ return new MarginTokenMetadata().fromJsonString(jsonString, options);
9116
+ }
9117
+ static equals(a, b) {
9118
+ return proto3.util.equals(MarginTokenMetadata, a, b);
9119
+ }
9120
+ }
9121
+ MarginTokenMetadata.runtime = proto3;
9122
+ MarginTokenMetadata.typeName = "trading.v1.MarginTokenMetadata";
9123
+ MarginTokenMetadata.fields = proto3.util.newFieldList(() => [
9124
+ { no: 1, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */ },
9125
+ { no: 2, name: "chain_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
9126
+ { no: 3, name: "decimals", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
9127
+ ]);
9128
+ /**
9129
+ * What one venue offers for a pair, for the advanced breakdown. The scalars
9130
+ * beside `venues` on the row are the HEADLINE venue's; read `headline_venue`
9131
+ * rather than matching them back.
9132
+ *
9133
+ * @generated from message trading.v1.MarginMarketVenue
9134
+ */
9135
+ export class MarginMarketVenue extends Message {
9136
+ constructor(data) {
9137
+ super();
9138
+ /**
9139
+ * @generated from field: trading.v1.MarginVenue venue = 1;
9140
+ */
9141
+ this.venue = MarginVenue.MORPHO;
9142
+ /**
9143
+ * @generated from field: string adapter = 2;
9144
+ */
9145
+ this.adapter = "";
9146
+ /**
9147
+ * Decimal string, derived from the venue's BORROW-side LTV with the cliff
9148
+ * buffer already applied. Server-authored: a client must not compute this
9149
+ * from lltv, or its ceiling and the quote's refusal disagree.
9150
+ *
9151
+ * @generated from field: string max_leverage = 4;
9152
+ */
9153
+ this.maxLeverage = "";
9154
+ /**
9155
+ * The liquidation boundary itself, 18-dec. Shown, never used for the ceiling.
9156
+ *
9157
+ * @generated from field: string lltv = 5;
9158
+ */
9159
+ this.lltv = "";
9160
+ proto3.util.initPartial(data, this);
9161
+ }
9162
+ static fromBinary(bytes, options) {
9163
+ return new MarginMarketVenue().fromBinary(bytes, options);
9164
+ }
9165
+ static fromJson(jsonValue, options) {
9166
+ return new MarginMarketVenue().fromJson(jsonValue, options);
9167
+ }
9168
+ static fromJsonString(jsonString, options) {
9169
+ return new MarginMarketVenue().fromJsonString(jsonString, options);
9170
+ }
9171
+ static equals(a, b) {
9172
+ return proto3.util.equals(MarginMarketVenue, a, b);
9173
+ }
9174
+ }
9175
+ MarginMarketVenue.runtime = proto3;
9176
+ MarginMarketVenue.typeName = "trading.v1.MarginMarketVenue";
9177
+ MarginMarketVenue.fields = proto3.util.newFieldList(() => [
9178
+ { no: 1, name: "venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
9179
+ { no: 2, name: "adapter", kind: "scalar", T: 9 /* ScalarType.STRING */ },
9180
+ { no: 3, name: "venue_market_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
9181
+ { no: 4, name: "max_leverage", kind: "scalar", T: 9 /* ScalarType.STRING */ },
9182
+ { no: 5, name: "lltv", kind: "scalar", T: 9 /* ScalarType.STRING */ },
9183
+ { no: 6, name: "borrow_rate", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
9184
+ { no: 7, name: "available_borrow_liquidity", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
9185
+ ]);
9186
+ /**
9187
+ * One row per (exposure_token, counter_token, direction).
9188
+ *
9189
+ * @generated from message trading.v1.MarginMarketRow
9190
+ */
9191
+ export class MarginMarketRow extends Message {
9192
+ constructor(data) {
9193
+ super();
9194
+ /**
9195
+ * @generated from field: trading.v1.MarginDirection direction = 3;
9196
+ */
9197
+ this.direction = MarginDirection.LONG;
9198
+ /**
9199
+ * The venue behind max_leverage, decided by the same code path the quote
9200
+ * uses so the picker and the quote cannot disagree.
9201
+ *
9202
+ * @generated from field: trading.v1.MarginVenue headline_venue = 4;
9203
+ */
9204
+ this.headlineVenue = MarginVenue.MORPHO;
9205
+ /**
9206
+ * The furthest this market goes, across every venue carrying it. The only
9207
+ * scalar here, because it is the only one whose best is also achievable:
9208
+ * rates and LTVs differ per venue and the cheapest rate is not necessarily
9209
+ * available at this leverage, so both live on `venues` beside the ceiling
9210
+ * they come with.
9211
+ *
9212
+ * @generated from field: string max_leverage = 5;
9213
+ */
9214
+ this.maxLeverage = "";
9215
+ /**
9216
+ * @generated from field: repeated trading.v1.MarginMarketVenue venues = 6;
9217
+ */
9218
+ this.venues = [];
9219
+ proto3.util.initPartial(data, this);
9220
+ }
9221
+ static fromBinary(bytes, options) {
9222
+ return new MarginMarketRow().fromBinary(bytes, options);
9223
+ }
9224
+ static fromJson(jsonValue, options) {
9225
+ return new MarginMarketRow().fromJson(jsonValue, options);
9226
+ }
9227
+ static fromJsonString(jsonString, options) {
9228
+ return new MarginMarketRow().fromJsonString(jsonString, options);
9229
+ }
9230
+ static equals(a, b) {
9231
+ return proto3.util.equals(MarginMarketRow, a, b);
9232
+ }
9233
+ }
9234
+ MarginMarketRow.runtime = proto3;
9235
+ MarginMarketRow.typeName = "trading.v1.MarginMarketRow";
9236
+ MarginMarketRow.fields = proto3.util.newFieldList(() => [
9237
+ { no: 1, name: "exposure_token", kind: "message", T: MarginTokenMetadata },
9238
+ { no: 2, name: "counter_token", kind: "message", T: MarginTokenMetadata },
9239
+ { no: 3, name: "direction", kind: "enum", T: proto3.getEnumType(MarginDirection) },
9240
+ { no: 4, name: "headline_venue", kind: "enum", T: proto3.getEnumType(MarginVenue) },
9241
+ { no: 5, name: "max_leverage", kind: "scalar", T: 9 /* ScalarType.STRING */ },
9242
+ { no: 6, name: "venues", kind: "message", T: MarginMarketVenue, repeated: true },
9243
+ ]);
9244
+ /**
9245
+ * Discovery for the market picker. Indicative by construction: rates move every
9246
+ * block, so no response agrees with a quote taken seconds later. The quote
9247
+ * re-reads on chain and its bounds are enforced in calldata, so a stale row
9248
+ * costs a re-quote and never a bad execution.
9249
+ *
9250
+ * @generated from message trading.v1.MarginMarketsRequest
9251
+ */
9252
+ export class MarginMarketsRequest extends Message {
9253
+ constructor(data) {
9254
+ super();
9255
+ /**
9256
+ * @generated from field: int32 chain_id = 1;
9257
+ */
9258
+ this.chainId = 0;
9259
+ /**
9260
+ * The LENDING allowlist. A named subset also re-decides `headline_venue` over
9261
+ * that subset, so it is a filter on the answer and not only on the search.
9262
+ *
9263
+ * @generated from field: repeated trading.v1.MarginVenue venues = 5;
9264
+ */
9265
+ this.venues = [];
9266
+ proto3.util.initPartial(data, this);
9267
+ }
9268
+ static fromBinary(bytes, options) {
9269
+ return new MarginMarketsRequest().fromBinary(bytes, options);
9270
+ }
9271
+ static fromJson(jsonValue, options) {
9272
+ return new MarginMarketsRequest().fromJson(jsonValue, options);
9273
+ }
9274
+ static fromJsonString(jsonString, options) {
9275
+ return new MarginMarketsRequest().fromJsonString(jsonString, options);
9276
+ }
9277
+ static equals(a, b) {
9278
+ return proto3.util.equals(MarginMarketsRequest, a, b);
9279
+ }
9280
+ }
9281
+ MarginMarketsRequest.runtime = proto3;
9282
+ MarginMarketsRequest.typeName = "trading.v1.MarginMarketsRequest";
9283
+ MarginMarketsRequest.fields = proto3.util.newFieldList(() => [
9284
+ { no: 1, name: "chain_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
9285
+ { no: 2, name: "exposure_token", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
9286
+ { no: 3, name: "counter_token", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
9287
+ { no: 4, name: "direction", kind: "enum", T: proto3.getEnumType(MarginDirection), opt: true },
9288
+ { no: 5, name: "venues", kind: "enum", T: proto3.getEnumType(MarginVenue), repeated: true },
9289
+ { no: 6, name: "cursor", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
9290
+ { no: 7, name: "limit", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
9291
+ ]);
9292
+ /**
9293
+ * @generated from message trading.v1.MarginMarketsResponse
9294
+ */
9295
+ export class MarginMarketsResponse extends Message {
9296
+ constructor(data) {
9297
+ super();
9298
+ /**
9299
+ * @generated from field: string request_id = 1;
9300
+ */
9301
+ this.requestId = "";
9302
+ /**
9303
+ * @generated from field: repeated trading.v1.MarginMarketRow markets = 2;
9304
+ */
9305
+ this.markets = [];
9306
+ proto3.util.initPartial(data, this);
9307
+ }
9308
+ static fromBinary(bytes, options) {
9309
+ return new MarginMarketsResponse().fromBinary(bytes, options);
9310
+ }
9311
+ static fromJson(jsonValue, options) {
9312
+ return new MarginMarketsResponse().fromJson(jsonValue, options);
9313
+ }
9314
+ static fromJsonString(jsonString, options) {
9315
+ return new MarginMarketsResponse().fromJsonString(jsonString, options);
9316
+ }
9317
+ static equals(a, b) {
9318
+ return proto3.util.equals(MarginMarketsResponse, a, b);
9319
+ }
9320
+ }
9321
+ MarginMarketsResponse.runtime = proto3;
9322
+ MarginMarketsResponse.typeName = "trading.v1.MarginMarketsResponse";
9323
+ MarginMarketsResponse.fields = proto3.util.newFieldList(() => [
9324
+ { no: 1, name: "request_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
9325
+ { no: 2, name: "markets", kind: "message", T: MarginMarketRow, repeated: true },
9326
+ { no: 3, name: "next_cursor", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
9327
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniswap/client-trading",
3
- "version": "0.5.18",
3
+ "version": "0.6.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },