pub struct ApiClient { /* private fields */ }Implementations§
Source§impl ApiClient
impl ApiClient
pub fn new(network: &NetworkConfig) -> Self
Sourcepub async fn call_project(
&self,
owner: &str,
project: &str,
payment_key: &str,
body: &HttpsCallRequest,
compute_limit: Option<u64>,
deposit: Option<&str>,
) -> Result<HttpsCallResponse>
pub async fn call_project( &self, owner: &str, project: &str, payment_key: &str, body: &HttpsCallRequest, compute_limit: Option<u64>, deposit: Option<&str>, ) -> Result<HttpsCallResponse>
POST /call/{owner}/{project} — execute agent
Sourcepub async fn get_call_result(
&self,
call_id: &str,
payment_key: &str,
) -> Result<HttpsCallResponse>
pub async fn get_call_result( &self, call_id: &str, payment_key: &str, ) -> Result<HttpsCallResponse>
GET /calls/{call_id} — poll async call status
Sourcepub async fn get_payment_key_balance(
&self,
owner: &str,
nonce: u32,
) -> Result<PaymentKeyBalanceResponse>
pub async fn get_payment_key_balance( &self, owner: &str, nonce: u32, ) -> Result<PaymentKeyBalanceResponse>
GET /public/payment-keys/{owner}/{nonce}/balance
Sourcepub async fn get_payment_key_usage(
&self,
owner: &str,
nonce: u32,
limit: i64,
offset: i64,
) -> Result<PaymentKeyUsageResponse>
pub async fn get_payment_key_usage( &self, owner: &str, nonce: u32, limit: i64, offset: i64, ) -> Result<PaymentKeyUsageResponse>
GET /public/payment-keys/{owner}/{nonce}/usage
Sourcepub async fn get_project_owner_earnings(
&self,
owner: &str,
) -> Result<ProjectOwnerEarningsResponse>
pub async fn get_project_owner_earnings( &self, owner: &str, ) -> Result<ProjectOwnerEarningsResponse>
GET /public/project-earnings/{project_owner}
Sourcepub async fn get_earnings_history(
&self,
owner: &str,
source: Option<&str>,
limit: i64,
offset: i64,
) -> Result<EarningsHistoryResponse>
pub async fn get_earnings_history( &self, owner: &str, source: Option<&str>, limit: i64, offset: i64, ) -> Result<EarningsHistoryResponse>
GET /public/project-earnings/{project_owner}/history
Sourcepub async fn add_generated_secret(
&self,
req: &Value,
) -> Result<AddGeneratedSecretResponse>
pub async fn add_generated_secret( &self, req: &Value, ) -> Result<AddGeneratedSecretResponse>
POST /secrets/add_generated_secret — generate PROTECTED_* in TEE
Sourcepub async fn update_user_secrets(
&self,
payload: &Value,
) -> Result<UpdateUserSecretsResponse>
pub async fn update_user_secrets( &self, payload: &Value, ) -> Result<UpdateUserSecretsResponse>
POST /secrets/update_user_secrets — merge/update secrets with NEP-413 auth
Sourcepub async fn get_secrets_pubkey(
&self,
request: &GetPubkeyRequest,
) -> Result<String>
pub async fn get_secrets_pubkey( &self, request: &GetPubkeyRequest, ) -> Result<String>
POST /secrets/pubkey — get keystore pubkey for encryption
Sourcepub async fn create_payment_check(
&self,
api_key: &str,
token: &str,
amount: &str,
memo: Option<&str>,
expires_in: Option<u64>,
) -> Result<PaymentCheckCreateResponse>
pub async fn create_payment_check( &self, api_key: &str, token: &str, amount: &str, memo: Option<&str>, expires_in: Option<u64>, ) -> Result<PaymentCheckCreateResponse>
POST /wallet/v1/payment-check/create
Sourcepub async fn batch_create_payment_checks(
&self,
api_key: &str,
checks: &[Value],
) -> Result<PaymentCheckBatchCreateResponse>
pub async fn batch_create_payment_checks( &self, api_key: &str, checks: &[Value], ) -> Result<PaymentCheckBatchCreateResponse>
POST /wallet/v1/payment-check/batch-create
Sourcepub async fn claim_payment_check(
&self,
api_key: &str,
check_key: &str,
amount: Option<&str>,
) -> Result<PaymentCheckClaimResponse>
pub async fn claim_payment_check( &self, api_key: &str, check_key: &str, amount: Option<&str>, ) -> Result<PaymentCheckClaimResponse>
POST /wallet/v1/payment-check/claim
Sourcepub async fn reclaim_payment_check(
&self,
api_key: &str,
check_id: &str,
amount: Option<&str>,
) -> Result<PaymentCheckReclaimResponse>
pub async fn reclaim_payment_check( &self, api_key: &str, check_id: &str, amount: Option<&str>, ) -> Result<PaymentCheckReclaimResponse>
POST /wallet/v1/payment-check/reclaim
Sourcepub async fn get_payment_check_status(
&self,
api_key: &str,
check_id: &str,
) -> Result<PaymentCheckStatusResponse>
pub async fn get_payment_check_status( &self, api_key: &str, check_id: &str, ) -> Result<PaymentCheckStatusResponse>
GET /wallet/v1/payment-check/status?check_id=…
Sourcepub async fn list_payment_checks(
&self,
api_key: &str,
status_filter: Option<&str>,
limit: i64,
) -> Result<PaymentCheckListResponse>
pub async fn list_payment_checks( &self, api_key: &str, status_filter: Option<&str>, limit: i64, ) -> Result<PaymentCheckListResponse>
GET /wallet/v1/payment-check/list
Sourcepub async fn sign_message(
&self,
api_key: &str,
message: &str,
recipient: &str,
nonce: Option<&str>,
) -> Result<SignMessageResponse>
pub async fn sign_message( &self, api_key: &str, message: &str, recipient: &str, nonce: Option<&str>, ) -> Result<SignMessageResponse>
POST /wallet/v1/sign-message — NEP-413 message signing for external auth
Sourcepub async fn wallet_call(
&self,
wallet_key: &str,
receiver_id: &str,
method_name: &str,
args: Value,
gas: u64,
deposit: u128,
) -> Result<WalletCallResponse>
pub async fn wallet_call( &self, wallet_key: &str, receiver_id: &str, method_name: &str, args: Value, gas: u64, deposit: u128, ) -> Result<WalletCallResponse>
POST /wallet/v1/call — sign and send a NEAR function call via custody wallet
Sourcepub async fn wallet_call_raw(
&self,
wallet_key: &str,
receiver_id: &str,
method_name: &str,
args_raw: &[u8],
gas: u64,
deposit: u128,
) -> Result<WalletCallResponse>
pub async fn wallet_call_raw( &self, wallet_key: &str, receiver_id: &str, method_name: &str, args_raw: &[u8], gas: u64, deposit: u128, ) -> Result<WalletCallResponse>
POST /wallet/v1/call with raw (Borsh) args as base64
Sourcepub async fn peek_payment_check(
&self,
api_key: &str,
check_key: &str,
) -> Result<PaymentCheckPeekResponse>
pub async fn peek_payment_check( &self, api_key: &str, check_key: &str, ) -> Result<PaymentCheckPeekResponse>
POST /wallet/v1/payment-check/peek
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl UnsafeUnpin for ApiClient
impl !UnwindSafe for ApiClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more