1- // Request body for assemble external match endpoint
2- export type AssembleExternalMatchRequest = {
3- signed_quote : SignedExternalQuote ;
4- do_gas_estimation ?: boolean ;
5- allow_shared ?: boolean ;
6- matching_pool ?: string ;
7- relayer_fee_rate ?: number ;
8- receiver_address ?: string | null ;
9- updated_order ?: ExternalOrder | null ;
1+ export type QuoteQueryParams = {
2+ disable_gas_sponsorship ?: boolean ;
3+ refund_address ?: string ;
4+ refund_native_eth ?: boolean ;
105} ;
116
12- // External order structure for Renegade match requests
137export type ExternalOrder = {
14- quote_mint : string ;
15- base_mint : string ;
16- side : 'Buy' | 'Sell' ;
17- base_amount : string ;
18- quote_amount : string ;
19- exact_base_output : string ;
20- exact_quote_output : string ;
8+ input_mint : string ;
9+ output_mint : string ;
10+ input_amount : string ;
11+ output_amount : string ;
12+ use_exact_output_amount : boolean ;
2113 min_fill_size : string ;
2214} ;
2315
24- // Request body for quote endpoint
2516export type ExternalQuoteRequest = {
2617 external_order : ExternalOrder ;
27- matching_pool ?: string ;
28- relayer_fee_rate ?: number ;
29- } ;
30-
31- // Quote with signature binding it to the relayer
32- export type SignedExternalQuote = {
33- quote : ApiExternalQuote ;
34- signature : string ;
35- } ;
36-
37- // Response from assemble endpoint
38- export type SponsoredMatchResponse = {
39- match_bundle : AtomicMatchApiBundle ;
40- is_sponsored : boolean ;
41- gas_sponsorship_info ?: GasSponsorshipInfo | null ;
42- } ;
43-
44- // Response from quote endpoint with signed quote and optional sponsorship
45- export type SponsoredQuoteResponse = {
46- signed_quote : SignedExternalQuote ;
47- gas_sponsorship_info ?: SignedGasSponsorshipInfo | null ;
4818} ;
4919
50- // Optional query parameters for quote and assembly endpoints
51- export type QuoteQueryParams = {
52- disable_gas_sponsorship ?: boolean ;
53- refund_address ?: string ;
54- refund_native_eth ?: boolean ;
55- use_gas_sponsorship ?: boolean ;
56- } ;
57-
58- // Represents a token transfer with mint address and amount
59- type ApiExternalAssetTransfer = {
20+ type AssetTransfer = {
6021 mint : string ;
6122 amount : string ;
6223} ;
6324
64- // Match result with quote/base mints, amounts, and direction
65- type ApiExternalMatchResult = {
66- quote_mint : string ;
67- base_mint : string ;
68- quote_amount : string ;
69- base_amount : string ;
70- direction : 'Buy' | 'Sell' ;
25+ type ExternalQuote = {
26+ order : ExternalOrder ;
27+ send : AssetTransfer ;
28+ receive : AssetTransfer ;
7129} ;
7230
73- // Price with timestamp
74- type ApiTimestampedPrice = {
75- price : string ;
76- timestamp : number ;
31+ export type SignedExternalQuote = {
32+ quote : ExternalQuote ;
33+ signature : string ;
34+ deadline : number | string ;
7735} ;
7836
79- // Complete match bundle with settlement transaction
80- type AtomicMatchApiBundle = {
81- match_result : ApiExternalMatchResult ;
82- fees : FeeTake ;
83- receive : ApiExternalAssetTransfer ;
84- send : ApiExternalAssetTransfer ;
85- settlement_tx : TransactionRequest ;
37+ export type SponsoredQuoteResponse = {
38+ signed_quote : SignedExternalQuote ;
39+ gas_sponsorship_info ?: {
40+ refund_amount : string ;
41+ refund_native_eth : boolean ;
42+ refund_address : string | null ;
43+ } | null ;
8644} ;
8745
88- // Complete quote structure with order, match result, fees, and pricing
89- type ApiExternalQuote = {
90- order : ExternalOrder ;
91- match_result : ApiExternalMatchResult ;
92- fees : FeeTake ;
93- send : ApiExternalAssetTransfer ;
94- receive : ApiExternalAssetTransfer ;
95- price : ApiTimestampedPrice ;
96- timestamp : number ;
46+ type QuotedOrderAssembly = {
47+ type : 'quoted-order' ;
48+ signed_quote : SignedExternalQuote ;
49+ updated_order ?: ExternalOrder | null ;
9750} ;
9851
99- // Relayer and protocol fees
100- type FeeTake = {
101- relayer_fee : string ;
102- protocol_fee : string ;
52+ type DirectOrderAssembly = {
53+ type : 'direct-order' ;
54+ external_order : ExternalOrder ;
10355} ;
10456
105- // Gas refund details
106- type GasSponsorshipInfo = {
107- refund_amount : string ;
108- refund_native_eth : boolean ;
109- refund_address : string | null ;
57+ export type AssembleExternalMatchRequest = {
58+ do_gas_estimation ?: boolean ;
59+ receiver_address ?: string | null ;
60+ order : QuotedOrderAssembly | DirectOrderAssembly ;
11061} ;
11162
112- // Signed gas sponsorship info (deprecated signature field)
113- type SignedGasSponsorshipInfo = {
114- gas_sponsorship_info : GasSponsorshipInfo ;
115- signature : string ; // deprecated
63+ export type SponsoredMatchResponse = {
64+ match_bundle : {
65+ min_receive : AssetTransfer ;
66+ max_receive : AssetTransfer ;
67+ min_send : AssetTransfer ;
68+ max_send : AssetTransfer ;
69+ deadline : number | string ;
70+ settlement_tx : TransactionRequest ;
71+ } ;
72+ input_amount ?: string | null ;
73+ gas_sponsorship_info ?: {
74+ refund_amount : string ;
75+ refund_native_eth : boolean ;
76+ refund_address : string | null ;
77+ } | null ;
11678} ;
11779
118- // EIP-1559 / EIP-4844 aware transaction request
11980type TransactionRequest = {
12081 from ?: string | null ;
12182 to ?: string | null ;
@@ -135,6 +96,6 @@ type TransactionRequest = {
13596 } > ;
13697 type ?: string ;
13798 blobVersionedHashes ?: string [ ] ;
138- sidecar ?: Record < string , any > ;
139- authorizationList ?: Array < Record < string , any > > ;
99+ sidecar ?: Record < string , unknown > ;
100+ authorizationList ?: Array < Record < string , unknown > > ;
140101} ;
0 commit comments