pub struct QuickStart { /* private fields */ }Expand description
Ultra-simple API for rapid development (matching Dart SDK QuickStart)
Implementations§
Source§impl QuickStart
impl QuickStart
Sourcepub async fn devnet() -> Result<Self, JsonRpcError>
pub async fn devnet() -> Result<Self, JsonRpcError>
Connect to local DevNet
Sourcepub async fn kermit() -> Result<Self, JsonRpcError>
pub async fn kermit() -> Result<Self, JsonRpcError>
Connect to Kermit testnet
Sourcepub async fn custom(
v2_endpoint: &str,
v3_endpoint: &str,
) -> Result<Self, JsonRpcError>
pub async fn custom( v2_endpoint: &str, v3_endpoint: &str, ) -> Result<Self, JsonRpcError>
Connect to custom endpoints
Sourcepub fn client(&self) -> &AccumulateClient
pub fn client(&self) -> &AccumulateClient
Get the underlying client
Sourcepub fn create_wallet(&self) -> Wallet
pub fn create_wallet(&self) -> Wallet
Create a new wallet with lite identity and token account
Sourcepub async fn fund_wallet(
&self,
wallet: &Wallet,
times: u32,
) -> Result<(), JsonRpcError>
pub async fn fund_wallet( &self, wallet: &Wallet, times: u32, ) -> Result<(), JsonRpcError>
Fund wallet from faucet (multiple requests) using V3 API
Sourcepub async fn get_balance(&self, wallet: &Wallet) -> Option<u64>
pub async fn get_balance(&self, wallet: &Wallet) -> Option<u64>
Get account balance (polls up to 30 times)
Sourcepub async fn get_oracle_price(&self) -> Result<u64, JsonRpcError>
pub async fn get_oracle_price(&self) -> Result<u64, JsonRpcError>
Get oracle price from network status
Sourcepub fn calculate_credits_amount(credits: u64, oracle: u64) -> u64
pub fn calculate_credits_amount(credits: u64, oracle: u64) -> u64
Calculate ACME amount for desired credits
Sourcepub async fn setup_adi(
&self,
wallet: &Wallet,
adi_name: &str,
) -> Result<AdiInfo, JsonRpcError>
pub async fn setup_adi( &self, wallet: &Wallet, adi_name: &str, ) -> Result<AdiInfo, JsonRpcError>
Set up an ADI (handles all the complexity)
Sourcepub async fn buy_credits_for_adi(
&self,
wallet: &Wallet,
adi: &AdiInfo,
credits: u64,
) -> Result<TxResult, JsonRpcError>
pub async fn buy_credits_for_adi( &self, wallet: &Wallet, adi: &AdiInfo, credits: u64, ) -> Result<TxResult, JsonRpcError>
Buy credits for ADI key page (auto-fetches oracle)
Sourcepub async fn get_key_page_info(&self, key_page_url: &str) -> Option<KeyPageInfo>
pub async fn get_key_page_info(&self, key_page_url: &str) -> Option<KeyPageInfo>
Get key page information
Sourcepub async fn create_token_account(
&self,
adi: &AdiInfo,
account_name: &str,
) -> Result<TxResult, JsonRpcError>
pub async fn create_token_account( &self, adi: &AdiInfo, account_name: &str, ) -> Result<TxResult, JsonRpcError>
Create a token account under an ADI
Sourcepub async fn create_data_account(
&self,
adi: &AdiInfo,
account_name: &str,
) -> Result<TxResult, JsonRpcError>
pub async fn create_data_account( &self, adi: &AdiInfo, account_name: &str, ) -> Result<TxResult, JsonRpcError>
Create a data account under an ADI
Sourcepub async fn write_data(
&self,
adi: &AdiInfo,
account_name: &str,
entries: &[&str],
) -> Result<TxResult, JsonRpcError>
pub async fn write_data( &self, adi: &AdiInfo, account_name: &str, entries: &[&str], ) -> Result<TxResult, JsonRpcError>
Write data to a data account
Sourcepub async fn add_key_to_adi(
&self,
adi: &AdiInfo,
new_keypair: &SigningKey,
) -> Result<TxResult, JsonRpcError>
pub async fn add_key_to_adi( &self, adi: &AdiInfo, new_keypair: &SigningKey, ) -> Result<TxResult, JsonRpcError>
Add a key to the ADI’s key page
Sourcepub async fn set_multi_sig_threshold(
&self,
adi: &AdiInfo,
threshold: u64,
) -> Result<TxResult, JsonRpcError>
pub async fn set_multi_sig_threshold( &self, adi: &AdiInfo, threshold: u64, ) -> Result<TxResult, JsonRpcError>
Set multi-sig threshold for the ADI’s key page
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuickStart
impl !RefUnwindSafe for QuickStart
impl Send for QuickStart
impl Sync for QuickStart
impl Unpin for QuickStart
impl UnsafeUnpin for QuickStart
impl !UnwindSafe for QuickStart
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