pub struct DataAnchorClient { /* private fields */ }
Implementations§
Source§impl DataAnchorClient
impl DataAnchorClient
Sourcepub async fn get_blobs<T>(
&self,
slot: u64,
identifier: BloberIdentifier,
) -> DataAnchorClientResult<Option<Vec<T>>>where
T: Decodable,
pub async fn get_blobs<T>(
&self,
slot: u64,
identifier: BloberIdentifier,
) -> DataAnchorClientResult<Option<Vec<T>>>where
T: Decodable,
Fetches all blobs for a given slot from the IndexerRpcClient
.
Sourcepub async fn get_blobs_by_blober<T>(
&self,
identifier: BloberIdentifier,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
pub async fn get_blobs_by_blober<T>(
&self,
identifier: BloberIdentifier,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
Fetches blobs for a given blober and time range from the IndexerRpcClient
.
Sourcepub async fn get_blobs_by_payer<T>(
&self,
payer: Pubkey,
network_name: String,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
pub async fn get_blobs_by_payer<T>(
&self,
payer: Pubkey,
network_name: String,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
Fetches blobs for a given payer, network name and time range from the IndexerRpcClient
.
Sourcepub async fn get_blobs_by_network<T>(
&self,
network_name: String,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
pub async fn get_blobs_by_network<T>(
&self,
network_name: String,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
Fetches blobs for a given network and time range from the IndexerRpcClient
.
Sourcepub async fn get_blobs_by_namespace_for_payer<T>(
&self,
namespace: String,
payer_pubkey: Option<Pubkey>,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
pub async fn get_blobs_by_namespace_for_payer<T>(
&self,
namespace: String,
payer_pubkey: Option<Pubkey>,
time_range: Option<TimeRange>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
Fetches blobs for a given namespace and time range from the IndexerRpcClient
.
Sourcepub async fn get_payers_by_network(
&self,
network: String,
) -> DataAnchorClientResult<Vec<PubkeyFromStr>>
pub async fn get_payers_by_network( &self, network: String, ) -> DataAnchorClientResult<Vec<PubkeyFromStr>>
Fetches payers for a given network from the IndexerRpcClient
.
Sourcepub async fn get_proof(
&self,
slot: u64,
identifier: BloberIdentifier,
) -> DataAnchorClientResult<Option<CompoundInclusionProof>>
pub async fn get_proof( &self, slot: u64, identifier: BloberIdentifier, ) -> DataAnchorClientResult<Option<CompoundInclusionProof>>
Fetches compound proof for a given slot from the IndexerRpcClient
.
Sourcepub async fn get_proof_for_blob(
&self,
blob: Pubkey,
) -> DataAnchorClientResult<Option<CompoundInclusionProof>>
pub async fn get_proof_for_blob( &self, blob: Pubkey, ) -> DataAnchorClientResult<Option<CompoundInclusionProof>>
Fetches compound proof for a given blob PDA Pubkey
from the IndexerRpcClient
.
Source§impl DataAnchorClient
impl DataAnchorClient
Sourcepub async fn get_ledger_blobs_from_signatures<T>(
&self,
identifier: BloberIdentifier,
signatures: Vec<Signature>,
) -> DataAnchorClientResult<T>where
T: Decodable,
pub async fn get_ledger_blobs_from_signatures<T>(
&self,
identifier: BloberIdentifier,
signatures: Vec<Signature>,
) -> DataAnchorClientResult<T>where
T: Decodable,
Returns the raw blob data from the ledger for the given signatures.
Sourcepub async fn get_ledger_blobs<T>(
&self,
slot: u64,
identifier: BloberIdentifier,
lookback_slots: Option<u64>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
pub async fn get_ledger_blobs<T>(
&self,
slot: u64,
identifier: BloberIdentifier,
lookback_slots: Option<u64>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
Fetches all blobs finalized in a given slot from the ledger.
Sourcepub async fn get_blob_messages(
&self,
slot: u64,
identifier: BloberIdentifier,
) -> DataAnchorClientResult<Vec<(Pubkey, VersionedMessage)>>
pub async fn get_blob_messages( &self, slot: u64, identifier: BloberIdentifier, ) -> DataAnchorClientResult<Vec<(Pubkey, VersionedMessage)>>
Fetches blob messages for a given slot
Returns a tuple of (Pubkey
, VersionedMessage
) where the Pubkey is the address of
the data_anchor_blober::state::blob::Blob
account and the VersionedMessage is the message
that included the data_anchor_blober::instruction::FinalizeBlob
instruction.
Sourcepub async fn list_blobers(
&self,
) -> DataAnchorClientResult<Vec<BloberWithNamespace>>
pub async fn list_blobers( &self, ) -> DataAnchorClientResult<Vec<BloberWithNamespace>>
Lists all blober accounts owned by the payer.
Sourcepub async fn get_blober(
&self,
identifier: BloberIdentifier,
) -> DataAnchorClientResult<Option<Blober>>
pub async fn get_blober( &self, identifier: BloberIdentifier, ) -> DataAnchorClientResult<Option<Blober>>
Retrieves a blober account by its identifier.
Sourcepub async fn get_checkpoint(
&self,
blober: BloberIdentifier,
) -> DataAnchorClientResult<Option<Checkpoint>>
pub async fn get_checkpoint( &self, blober: BloberIdentifier, ) -> DataAnchorClientResult<Option<Checkpoint>>
Retrieves the checkpoint containing the Groth16 proof for a given blober account.
Source§impl DataAnchorClient
impl DataAnchorClient
Sourcepub async fn checkpoint_custom_proof(
&self,
slot: Slot,
identifier: BloberIdentifier,
customer_elf: CustomerElf,
) -> DataAnchorClientResult<String>
pub async fn checkpoint_custom_proof( &self, slot: Slot, identifier: BloberIdentifier, customer_elf: CustomerElf, ) -> DataAnchorClientResult<String>
Requests ZK proof generation on the proof RPC for a given blober, slot and proof type.
Sourcepub async fn get_proof_request_status(
&self,
request_id: String,
) -> DataAnchorClientResult<RequestStatus>
pub async fn get_proof_request_status( &self, request_id: String, ) -> DataAnchorClientResult<RequestStatus>
Returns the status of a proof request by its request ID.
Source§impl DataAnchorClient
impl DataAnchorClient
Sourcepub fn builder() -> DataAnchorClientBuilder
pub fn builder() -> DataAnchorClientBuilder
Create an instance of DataAnchorClient
using the builder syntax
Source§impl DataAnchorClient
impl DataAnchorClient
Sourcepub fn rpc_client(&self) -> Arc<RpcClient>
pub fn rpc_client(&self) -> Arc<RpcClient>
Returns the underlaying RpcClient
.
pub async fn encode_and_compress<T>(
&self,
data: &T,
) -> DataAnchorClientResult<Vec<u8>>where
T: Encodable,
pub async fn decompress_and_decode<T>(
&self,
bytes: &[u8],
) -> DataAnchorClientResult<T>where
T: Decodable,
pub async fn decompress_and_decode_vec<T>(
&self,
slice_of_bytes: impl Iterator<Item = &[u8]>,
) -> DataAnchorClientResult<Vec<T>>where
T: Decodable,
Sourcepub async fn initialize_blober(
&self,
fee_strategy: FeeStrategy,
identifier: BloberIdentifier,
timeout: Option<Duration>,
) -> DataAnchorClientResult<Vec<SuccessfulTransaction<TransactionType>>>
pub async fn initialize_blober( &self, fee_strategy: FeeStrategy, identifier: BloberIdentifier, timeout: Option<Duration>, ) -> DataAnchorClientResult<Vec<SuccessfulTransaction<TransactionType>>>
Initializes a new Blober
PDA account.
Sourcepub async fn close_blober(
&self,
fee_strategy: FeeStrategy,
identifier: BloberIdentifier,
timeout: Option<Duration>,
) -> DataAnchorClientResult<Vec<SuccessfulTransaction<TransactionType>>>
pub async fn close_blober( &self, fee_strategy: FeeStrategy, identifier: BloberIdentifier, timeout: Option<Duration>, ) -> DataAnchorClientResult<Vec<SuccessfulTransaction<TransactionType>>>
Closes a Blober
PDA account.
Sourcepub async fn upload_blob<T>(
&self,
blob_data: &T,
fee_strategy: FeeStrategy,
namespace: &str,
timeout: Option<Duration>,
) -> DataAnchorClientResult<(Vec<SuccessfulTransaction<TransactionType>>, Pubkey)>where
T: Encodable,
pub async fn upload_blob<T>(
&self,
blob_data: &T,
fee_strategy: FeeStrategy,
namespace: &str,
timeout: Option<Duration>,
) -> DataAnchorClientResult<(Vec<SuccessfulTransaction<TransactionType>>, Pubkey)>where
T: Encodable,
Uploads a blob of data with the given Blober
PDA account.
Under the hood it creates a new data_anchor_blober::state::blob::Blob
PDA which stores a
incremental hash of the chunks from the blob data. On completion of the blob upload, the
blob PDA gets closed sending it’s funds back to the DataAnchorClient::payer
.
If the blob upload fails, the blob PDA gets discarded and the funds also get sent to the
DataAnchorClient::payer
.
Sourcepub async fn discard_blob(
&self,
fee_strategy: FeeStrategy,
blob: Pubkey,
namespace: &str,
timeout: Option<Duration>,
) -> DataAnchorClientResult<(Vec<SuccessfulTransaction<TransactionType>>, Pubkey)>
pub async fn discard_blob( &self, fee_strategy: FeeStrategy, blob: Pubkey, namespace: &str, timeout: Option<Duration>, ) -> DataAnchorClientResult<(Vec<SuccessfulTransaction<TransactionType>>, Pubkey)>
Discards a data_anchor_blober::state::blob::Blob
PDA account registered with the provided
Blober
PDA account.
Sourcepub async fn configure_checkpoint(
&self,
fee_strategy: FeeStrategy,
identifier: BloberIdentifier,
authority: Pubkey,
timeout: Option<Duration>,
) -> DataAnchorClientResult<(Vec<SuccessfulTransaction<TransactionType>>, Pubkey)>
pub async fn configure_checkpoint( &self, fee_strategy: FeeStrategy, identifier: BloberIdentifier, authority: Pubkey, timeout: Option<Duration>, ) -> DataAnchorClientResult<(Vec<SuccessfulTransaction<TransactionType>>, Pubkey)>
Configures a checkpoint for a given blober with the given authority. This allows the authority to create checkpoints for the blober.
Sourcepub async fn estimate_fees(
&self,
blob_size: usize,
blober: Pubkey,
fee_strategy: FeeStrategy,
) -> DataAnchorClientResult<Fee>
pub async fn estimate_fees( &self, blob_size: usize, blober: Pubkey, fee_strategy: FeeStrategy, ) -> DataAnchorClientResult<Fee>
Estimates fees for uploading a blob of the size blob_size
with the given priority
.
This whole functions is basically a simulation that doesn’t run anything. Instead of executing transactions,
it just sums the expected fees and number of signatures.
The data_anchor_blober::state::blob::Blob
PDA account is always newly created, so for estimating compute fees
we don’t even need the real keypair, any unused pubkey will do.
Trait Implementations§
Source§impl Clone for DataAnchorClient
impl Clone for DataAnchorClient
Source§fn clone(&self) -> DataAnchorClient
fn clone(&self) -> DataAnchorClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for DataAnchorClient
impl !RefUnwindSafe for DataAnchorClient
impl Send for DataAnchorClient
impl Sync for DataAnchorClient
impl Unpin for DataAnchorClient
impl !UnwindSafe for DataAnchorClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more