Skip to content

Commit

Permalink
docs: a way to get account with more than 100 near on sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
VladasZ committed Feb 23, 2024
1 parent 97d6449 commit f13d16f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions workspaces/src/network/variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ where
(id, sk)
}

/// Creates a top level developement account.
/// On sandbox network it has a balance of 100 Near.
/// If you need more Near for your tests in sandbox consider using `root_account()` method:
///
/// # Examples
/// ```
/// use near_workspaces::{result::Result, Account, network::Sandbox, Worker};
/// fn get_account_with_lots_of_near(worker: &Worker<Sandbox>) -> Result<Account> {
/// worker.root_account()
/// }
/// ```
///
pub async fn dev_create_account(&self) -> Result<Account> {
let (id, sk) = self.dev_generate().await;
let account = self.create_tla(id.clone(), sk).await?;
Expand Down

0 comments on commit f13d16f

Please sign in to comment.