MCPcopy Create free account
hub / github.com/base/base / new_with_headers

Method new_with_headers

crates/execution/rpc/src/sequencer.rs:66–79  ·  view source on GitHub ↗

Creates a new `SequencerClient` for the given URL with the given headers This expects headers in the form: `header=value`

(
        sequencer_endpoint: impl Into<String>,
        headers: Vec<String>,
    )

Source from the content-addressed store, hash-verified

64 ///
65 /// This expects headers in the form: `header=value`
66 pub async fn new_with_headers(
67 sequencer_endpoint: impl Into<String>,
68 headers: Vec<String>,
69 ) -> Result<Self, Error> {
70 let sequencer_endpoint = sequencer_endpoint.into();
71 let endpoint = BuiltInConnectionString::from_str(&sequencer_endpoint)?;
72 if matches!(&endpoint, BuiltInConnectionString::Http(_)) {
73 Self::new_http_with_headers(sequencer_endpoint, headers)
74 } else {
75 let client = ClientBuilder::default().connect_with(endpoint).await?;
76 let inner = SequencerClientInner::new(sequencer_endpoint, client);
77 Ok(Self { inner: Arc::new(inner) })
78 }
79 }
80
81 /// Creates an HTTP sequencer client synchronously, with optional `header=value` headers.
82 ///

Callers

nothing calls this directly

Calls 1

newFunction · 0.50

Tested by

no test coverage detected