pub struct Client { /* private fields */ }Expand description
HTTP client for the Interveil execution node.
Usage: let client = Client::new(“http://localhost:3030”); let response = client.submit(&signed_intent)?; println!(“{}”, response.tx_hash);
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(base_url: &str) -> Self
pub fn new(base_url: &str) -> Self
Create a new client pointing to an Interveil node.
base_url should NOT have a trailing slash.
Example: “http://localhost:3030”
Sourcepub fn submit(
&self,
signed_intent: &SignedIntent,
) -> Result<SubmitResponse, VeilError>
pub fn submit( &self, signed_intent: &SignedIntent, ) -> Result<SubmitResponse, VeilError>
Submit a signed intent to the node for execution on Solana.
POST {base_url}/intents Content-Type: application/json Body: output of signed_intent.to_json()
Returns SubmitResponse with tx_hash on success. Returns VeilError::Http on failure.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more