Skip to main content

ApiClient

Struct ApiClient 

Source
pub struct ApiClient { /* private fields */ }

Implementations§

Source§

impl ApiClient

Source

pub fn new(network: &NetworkConfig) -> Self

Source

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

Source

pub async fn get_call_result( &self, call_id: &str, payment_key: &str, ) -> Result<HttpsCallResponse>

GET /calls/{call_id} — poll async call status

Source

pub async fn get_payment_key_balance( &self, owner: &str, nonce: u32, ) -> Result<PaymentKeyBalanceResponse>

GET /public/payment-keys/{owner}/{nonce}/balance

Source

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

Source

pub async fn get_project_owner_earnings( &self, owner: &str, ) -> Result<ProjectOwnerEarningsResponse>

GET /public/project-earnings/{project_owner}

Source

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

Source

pub async fn add_generated_secret( &self, req: &Value, ) -> Result<AddGeneratedSecretResponse>

POST /secrets/add_generated_secret — generate PROTECTED_* in TEE

Source

pub async fn update_user_secrets( &self, payload: &Value, ) -> Result<UpdateUserSecretsResponse>

POST /secrets/update_user_secrets — merge/update secrets with NEP-413 auth

Source

pub async fn get_secrets_pubkey( &self, request: &GetPubkeyRequest, ) -> Result<String>

POST /secrets/pubkey — get keystore pubkey for encryption

Source

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

Source

pub async fn batch_create_payment_checks( &self, api_key: &str, checks: &[Value], ) -> Result<PaymentCheckBatchCreateResponse>

POST /wallet/v1/payment-check/batch-create

Source

pub async fn claim_payment_check( &self, api_key: &str, check_key: &str, amount: Option<&str>, ) -> Result<PaymentCheckClaimResponse>

POST /wallet/v1/payment-check/claim

Source

pub async fn reclaim_payment_check( &self, api_key: &str, check_id: &str, amount: Option<&str>, ) -> Result<PaymentCheckReclaimResponse>

POST /wallet/v1/payment-check/reclaim

Source

pub async fn get_payment_check_status( &self, api_key: &str, check_id: &str, ) -> Result<PaymentCheckStatusResponse>

GET /wallet/v1/payment-check/status?check_id=…

Source

pub async fn list_payment_checks( &self, api_key: &str, status_filter: Option<&str>, limit: i64, ) -> Result<PaymentCheckListResponse>

GET /wallet/v1/payment-check/list

Source

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

Source

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

Source

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

Source

pub async fn peek_payment_check( &self, api_key: &str, check_key: &str, ) -> Result<PaymentCheckPeekResponse>

POST /wallet/v1/payment-check/peek

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more