Struct ZebedeeClient

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

Implementations§

Source§

impl ZebedeeClient

Source

pub fn new<'a>(apikey: impl Into<Cow<'a, str>>) -> Self

Source

pub fn domain(self, domain: String) -> Self

Zebedee REST API url

Source

pub fn reqw_cli(self, reqw_cli: Client) -> Self

Source

pub fn oauth( self, client_id: String, secret: String, redirect_uri: String, state: String, scope: String, ) -> Self

Source

pub async fn get_wallet_details(&self) -> Result<WalletInfoResponse>

Retrieves the total balance of a given Project Wallet.

Source

pub async fn keysend( &self, keysend_payload: &Keysend, ) -> Result<KeysendResponse>

Make payment directly to a Lightning Network node Public Key, without the need for a Payment Request / Charge.

Source

pub async fn create_charge( &self, charge: &Charge, ) -> Result<FetchOneChargeResponse>

Creates a new Charge / Payment Request in the Bitcoin Lightning Network, payable by any Lightning Network wallet. These payment requests are single-use, fixed-amount QR codes. If you’re looking for multi-use and multi-amount payment requests you want Static Charges.

Source

pub async fn get_charges(&self) -> Result<FetchChargesResponse>

Source

pub async fn get_charge<T>( &self, charge_id: T, ) -> Result<FetchOneChargeResponse>
where T: AsRef<str>,

Retrieves all information relating a specific Charge / Payment Request.

Source

pub async fn pay_gamertag( &self, payment: &GamertagPayment, ) -> Result<GamertagPayResponse>

Send Bitcoin payments directly to a user’s ZBD Gamertag

Source

pub async fn fetch_charge_from_gamertag( &self, payment: &GamertagPayment, ) -> Result<GamertagChargeResponse>

Create a bolt 11 invoice so you can pay a specified gamertag

Source

pub async fn get_gamertag_tx<T>( &self, transaction_id: T, ) -> Result<GamertagTxResponse>
where T: AsRef<str>,

Get data on payments sent to ZBD Gamertags. The data payload returned will inform you of the status of that transaction as well as any associated fees.

Source

pub async fn get_userid_by_gamertag<T>( &self, gamertag: T, ) -> Result<IdFromGamertagResponse>
where T: AsRef<str>,

Get a given User’s ID when provided with a ZBD Gamertag.

Source

pub async fn get_gamertag_by_userid<T>( &self, user_id: T, ) -> Result<GamertagUserIdResponse>
where T: AsRef<str>,

Get a given user’s ZBD Gamertag from user id

Source

pub async fn internal_transfer( &self, internal_transfer_payload: &InternalTransfer, ) -> Result<InternalTransferResponse>

Initiates a transfer of funds between two Project Wallets you own.

Source

pub async fn pay_ln_address( &self, payment: &LnPayment, ) -> Result<PayLnAddressResponse>

Send Bitcoin payments directly to a Lightning Address.

Source

pub async fn fetch_charge_ln_address( &self, payment: &LnFetchCharge, ) -> Result<FetchLnChargeResponse>

Create a Charge / Payment Request QR code for a Lightning Address

Source

pub async fn validate_ln_address( &self, lightning_address: &LnAddress, ) -> Result<ValidateLnAddrResponse>

Validate whether a user’s entered Lightning Address is indeed a real Lightning Address

Source

pub async fn pay_invoice( &self, payment: &Payment, ) -> Result<PaymentInvoiceResponse>

Pays a Charge / Payment Request in the Bitcoin Lightning Network

Source

pub async fn get_payments(&self) -> Result<FetchPaymentsResponse>

Source

pub async fn get_payment<T>( &self, payment_id: T, ) -> Result<FetchOnePaymentsResponse>
where T: AsRef<str>,

Retrieves all the information related to a specific Payment

Source

pub async fn get_is_supported_region_by_ip<T>( &self, ip: T, ) -> Result<SupportedIpResponse>
where T: AsRef<str>,

Check if provided ip address will be supported by Zebedee REST API

Source

pub async fn get_prod_ips(&self) -> Result<ProdIpsResponse>

Check if callback response is from legit Zebedee ip address

Source

pub async fn get_btc_usd(&self) -> Result<BtcToUsdResponse>

Get the latest price for Bitcoin in US Dollars. The exchange rate feed is refreshed every 5 seconds and is based upon a combination of industry-leading partner exchange providers’s price feeds.

Source

pub async fn create_withdrawal_request( &self, withdrawal_request: &WithdrawalReqest, ) -> Result<CreateWithdrawalResponse>

Withdrawal Requests can be thought of as exact opposites to Charges. Charges in the ZEBEDEE API are QR codes that represent Payment Requests in the Bitcoin Lightning Network. These QR codes expect that a payer will scan and perform a payment against it.


Charges: Lightning QR codes that YOU SPEND


Withdrawal Requests: Lightning QR codes that YOU RECEIVE

Source

pub async fn get_withdrawal_requests(&self) -> Result<FetchWithdrawalsResponse>

Source

pub async fn get_withdrawal_request<T>( &self, withdrawal_id: T, ) -> Result<FetchOneWithdrawalResponse>
where T: AsRef<str>,

Retrieves details about a specific Withdrawal Request.

Source

pub async fn pay_email( &self, email_payment_request: &EmailPaymentReqest, ) -> Result<EmailPaymentResponse>

Send instant Bitcoin payments to any email.

Source

pub async fn create_auth_url<T>(&self, challenge: T) -> Result<String>
where T: AsRef<str>,

Source

pub async fn fetch_token<A, B>( &self, code: A, verifier: B, ) -> Result<FetchAccessTokenRes>
where A: AsRef<str>, B: AsRef<str>,

Source

pub async fn refresh_token<T>(&self, refresh_token: T) -> Result<FetchPostRes>
where T: AsRef<str>,

In order to fetch a new accessToken for a given ZBD User, make sure to use the refreshToken using the token endpoint.

Source

pub async fn fetch_user_data<T>(&self, token: T) -> Result<StdResp<ZBDUserData>>
where T: AsRef<str>,

You can use this API endpoint to fetch information about a given ZBD User, granted you can pass the provided accessToken.

Source

pub async fn fetch_user_wallet_data<T>( &self, token: T, ) -> Result<StdResp<ZBDUserWalletData>>
where T: AsRef<str>,

You can use this API endpoint to fetch information about a given ZBD User’s Wallet, granted you can pass the provided accessToken.

Trait Implementations§

Source§

impl Clone for ZebedeeClient

Source§

fn clone(&self) -> ZebedeeClient

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

impl Debug for ZebedeeClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> 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<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
Source§

impl<T> ErasedDestructor for T
where T: 'static,