pub struct PagedClient {
pub client: Arc<Client>,
}
Fields§
§client: Arc<Client>
Implementations§
Source§impl PagedClient
impl PagedClient
pub const fn new(client: Arc<Client>) -> Self
Sourcepub fn vaults(&self, batch_size: u16) -> VaultStream
pub fn vaults(&self, batch_size: u16) -> VaultStream
Stream the vault accounts based on batch size
use {
fireblocks_sdk::{Client, PagedClient},
futures::TryStreamExt,
std::sync::Arc,
};
async fn vault_accounts(c: Client) -> anyhow::Result<()> {
let pc = PagedClient::new(Arc::new(c));
let mut vault_stream = pc.vaults(100);
while let Ok(Some(result)) = vault_stream.try_next().await {
tracing::info!("accounts {}", result.accounts.len());
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
}
Ok(())
}
see [Client::vaults
]
Sourcepub fn transactions_from_source(
&self,
vault_id: i32,
batch_size: u16,
after: Option<Epoch>,
) -> TransactionStream
pub fn transactions_from_source( &self, vault_id: i32, batch_size: u16, after: Option<Epoch>, ) -> TransactionStream
Stream all the transactions from source vault account id and after some date
Default date is 2022-04-06 if None provided
use {
fireblocks_sdk::{Client, PagedClient},
futures::TryStreamExt,
std::sync::Arc,
};
async fn transactions_paged(c: Client) -> anyhow::Result<()> {
let pc = PagedClient::new(Arc::new(c));
let mut ts = pc.transactions_from_source(0, 100, None);
while let Ok(Some(result)) = ts.try_next().await {
tracing::info!("transactions {}", result.len());
}
Ok(())
}
see
- [
Client::transactions
]
Sourcepub fn transactions_from_destination(
&self,
vault_id: i32,
batch_size: u16,
after: Option<Epoch>,
) -> TransactionStream
pub fn transactions_from_destination( &self, vault_id: i32, batch_size: u16, after: Option<Epoch>, ) -> TransactionStream
Stream all the transactions from destination vault account id
See [self.transactions_from_source
]
Trait Implementations§
Source§impl Clone for PagedClient
impl Clone for PagedClient
Source§fn clone(&self) -> PagedClient
fn clone(&self) -> PagedClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PagedClient
impl !RefUnwindSafe for PagedClient
impl Send for PagedClient
impl Sync for PagedClient
impl Unpin for PagedClient
impl !UnwindSafe for PagedClient
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