NoahClient

Struct NoahClient 

Source
pub struct NoahClient { /* private fields */ }
Expand description

Main client for interacting with the Noah API

Implementations§

Source§

impl NoahClient

Source

pub async fn get_balances( &self, page_size: Option<u32>, page_token: Option<&str>, ) -> Result<GetBalancesResponse>

Get balances (async)

Source§

impl NoahClient

Source

pub async fn get_channels_sell( &self, params: GetChannelsSellParams<'_>, ) -> Result<GetChannelsResponse>

Get channels for selling crypto (async)

Source

pub async fn get_channel( &self, channel_id: &ChannelID, crypto_currency: &CryptoCurrencyCode, fiat_amount: Option<&PositiveDecimal>, customer_id: Option<&CustomerID>, ) -> Result<Channel>

Get channel by ID (async)

Source

pub async fn get_channels_sell_countries( &self, customer_id: Option<&CustomerID>, ) -> Result<ChannelsCountriesResponse>

Get countries for sell channels (async)

Source§

impl NoahClient

Source

pub async fn create_crypto_payin_session( &self, request: &CryptoPayinRequest, ) -> Result<CheckoutSessionResponse>

Create crypto payin session (async)

Source

pub async fn create_fiat_payin_session( &self, request: &FiatPayinRequest, ) -> Result<CheckoutSessionResponse>

Create fiat payin session (async)

Source

pub async fn create_fiat_payout_session( &self, request: &FiatPayoutRequest, ) -> Result<CheckoutSessionResponse>

Create fiat payout session (async)

Source§

impl NoahClient

Source

pub async fn get_customer(&self, customer_id: &CustomerID) -> Result<Customer>

Get customer by ID (async)

Source

pub async fn create_or_update_customer( &self, customer_id: &CustomerID, customer: &CustomerInput, ) -> Result<()>

Create or update customer (async)

Source

pub async fn get_customers( &self, page_size: Option<u32>, page_token: Option<&str>, sort_direction: Option<&SortDirection>, ) -> Result<GetCustomersResponse>

Get customers (async)

Source§

impl NoahClient

Source

pub async fn create_onboarding_session( &self, customer_id: &CustomerID, request: &HostedOnboardingRequest, ) -> Result<HostedSessionResponse>

Create onboarding session (async)

Source

pub async fn prefill_onboarding( &self, customer_id: &CustomerID, request: &PrefillOnboardingRequest, ) -> Result<()>

Prefill customer details (async)

Source

pub async fn get_document_upload_url( &self, customer_id: &CustomerID, document_type: &str, country_code: &CountryCode, side: Option<&str>, associate_id: Option<&str>, ) -> Result<PrefillDocumentUploadURLResponse>

Get document upload URL (async)

Source§

impl NoahClient

Source

pub async fn get_payment_methods( &self, customer_id: &CustomerID, page_size: Option<u32>, page_token: Option<&str>, ) -> Result<GetPaymentMethodsResponse>

Get payment methods (async)

Source§

impl NoahClient

Source

pub async fn get_transactions( &self, page_size: Option<u32>, page_token: Option<&str>, sort_direction: Option<&SortDirection>, ) -> Result<GetTransactionsResponse>

Get transactions (async)

Source

pub async fn get_transaction(&self, transaction_id: &str) -> Result<Transaction>

Get transaction by ID (async)

Source

pub async fn prepare_sell( &self, request: &PrepareSellRequest, ) -> Result<PrepareSellResponse>

Prepare sell transaction (async)

Source

pub async fn sell(&self, request: &SellRequest) -> Result<SellResponse>

Create sell transaction (async)

Source§

impl NoahClient

Source

pub async fn create_bank_deposit_to_onchain_address_workflow( &self, request: &BankDepositToOnchainAddressRequest, ) -> Result<BankDepositToOnchainAddressResponse>

Create bank deposit to onchain address workflow (async)

Source§

impl NoahClient

Source

pub fn new(config: Config, auth_config: AuthConfig) -> Result<Self>

Create a new client with the given configuration

Source

pub fn base_url(&self) -> &Url

Get the base URL

Source

pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T>

Make an async GET request

Source

pub async fn post<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T>

Make an async POST request

Source

pub async fn put<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T>

Make an async PUT request

Trait Implementations§

Source§

impl Clone for NoahClient

Source§

fn clone(&self) -> NoahClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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