near-api-lib 0.1.0-alpha

A Rust library for seamless NEAR blockchain development, offering tools for account management, transaction operations, and blockchain queries.
Documentation
use near_api_lib::accounts::get_access_key;
use near_api_lib::primitives::types::AccountId;
use near_api_lib::JsonRpcProvider;
use std::sync::Arc;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    env_logger::init();

    let account_id: AccountId = "near-api-rs.testnet".parse::<AccountId>()?;

    let provider = Arc::new(JsonRpcProvider::new("https://rpc.testnet.near.org"));

    let result = get_access_key(provider, account_id).await;

    println!("response: {:#?}", result);

    Ok(())
}