@@ -13,6 +13,9 @@ pub struct SwapRequest {
1313 /// Rquired. The public key of the user initiating the swap.
1414 pub user_public_key : String ,
1515
16+ /// Allow a custom payer to pay for the transaction
17+ pub payer : String ,
18+
1619 /// Automatically wrap/unwrap native SOL to/from WSOL Default (true)
1720 /// When true, uses SOL and unwraps WSOL post-swap.
1821 /// When false, uses WSOL only and leaves it wrapped.
@@ -113,6 +116,7 @@ impl SwapRequest {
113116 ///
114117 /// # Arguments
115118 /// * `input_wallet` - The user's public key as a string.
119+ /// * `payer` - payer to pay for the transaction
116120 /// * `quote` - The `QuoteResponse` obtained from a quoting endpoint.
117121 ///
118122 /// # Returns
@@ -122,9 +126,14 @@ impl SwapRequest {
122126 /// ```
123127 /// let payload = SwapRequest::new("YourPubKey...", quote);
124128 /// ```
125- pub fn new ( input_wallet : & str , quote : QuoteResponse ) -> Self {
129+ pub fn new (
130+ input_wallet : impl Into < String > ,
131+ payer : impl Into < String > ,
132+ quote : QuoteResponse ,
133+ ) -> Self {
126134 Self {
127- user_public_key : input_wallet. to_string ( ) ,
135+ user_public_key : input_wallet. into ( ) ,
136+ payer : payer. into ( ) ,
128137 wrap_and_unwrap_sol : None ,
129138 use_shared_accounts : None ,
130139 fee_account : None ,
0 commit comments