Function get_access_key

Source
pub async fn get_access_key(
    provider: Arc<dyn Provider>,
    account_id: AccountId,
) -> Result<AccessKeyList, Box<dyn Error>>
Expand description

Retrieves the list of access keys for a given account.

§Arguments

  • provider - The provider through which to query the blockchain.
  • account_id - The account ID for which to retrieve access keys.

§Returns

A Result containing a list of access keys for the specified account, or an error if the operation fails.

Examples found in repository?
examples/get_access_key.rs (line 14)
7async fn main() -> Result<(), Box<dyn std::error::Error>> {
8    env_logger::init();
9
10    let account_id: AccountId = "near-api-rs.testnet".parse::<AccountId>()?;
11
12    let provider = Arc::new(JsonRpcProvider::new("https://rpc.testnet.near.org"));
13
14    let result = get_access_key(provider, account_id).await;
15
16    println!("response: {:#?}", result);
17
18    Ok(())
19}