pub struct NearBuilder { /* private fields */ }Expand description
Builder for creating a Near client.
§Example
ⓘ
use near_kit::*;
// Read-only client
let near = Near::testnet().build();
// Client with credentials (secret key + account)
let near = Near::testnet()
.credentials("ed25519:...", "alice.testnet")?
.build();
// Client with keystore
let keystore = std::sync::Arc::new(InMemoryKeyStore::new());
// ... add keys to keystore ...
let near = Near::testnet()
.keystore(keystore, "alice.testnet")?
.build();Implementations§
Source§impl NearBuilder
impl NearBuilder
Sourcepub fn signer(self, signer: impl Signer + 'static) -> Self
pub fn signer(self, signer: impl Signer + 'static) -> Self
Set the signer for transactions.
The signer determines which account will sign transactions.
Sourcepub fn credentials(
self,
private_key: impl AsRef<str>,
account_id: impl AsRef<str>,
) -> Result<Self, Error>
pub fn credentials( self, private_key: impl AsRef<str>, account_id: impl AsRef<str>, ) -> Result<Self, Error>
Sourcepub fn retry_config(self, config: RetryConfig) -> Self
pub fn retry_config(self, config: RetryConfig) -> Self
Set the retry configuration.
Trait Implementations§
Source§impl From<NearBuilder> for Near
impl From<NearBuilder> for Near
Source§fn from(builder: NearBuilder) -> Self
fn from(builder: NearBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NearBuilder
impl !RefUnwindSafe for NearBuilder
impl Send for NearBuilder
impl Sync for NearBuilder
impl Unpin for NearBuilder
impl UnsafeUnpin for NearBuilder
impl !UnwindSafe for NearBuilder
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