Client

Struct Client 

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

Client for Privy API

Version: 0.0.1

Implementations§

Source§

impl Client

Source

pub fn new(baseurl: &str) -> Self

Create a new client.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source

pub fn new_with_client(baseurl: &str, client: Client) -> Self

Construct a new client with an existing reqwest::Client, allowing more control over its configuration.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source§

impl Client

Source

pub async fn get_wallets<'a>( &'a self, chain_type: Option<GetWalletsChainType>, cursor: Option<&'a GetWalletsCursor>, limit: Option<f64>, user_id: Option<&'a str>, ) -> Result<ResponseValue<GetWalletsResponse>, Error<()>>

Get all wallets

Get all wallets in your app.

Sends a GET request to /v1/wallets

Source

pub async fn create_wallet<'a>( &'a self, privy_idempotency_key: Option<&'a str>, body: &'a CreateWalletBody, ) -> Result<ResponseValue<Wallet>, Error<()>>

Create wallet

Create a new wallet.

Sends a POST request to /v1/wallets

Source

pub async fn get_custodial_wallets<'a>( &'a self, privy_idempotency_key: Option<&'a str>, body: &'a GetCustodialWalletsBody, ) -> Result<ResponseValue<CustodialWallet>, Error<()>>

Create custodial wallet

Create a new wallet custodied by a third-party provider.

Sends a POST request to /v1/custodial_wallets

Source

pub async fn wallet_rpc<'a>( &'a self, wallet_id: &'a str, privy_authorization_signature: Option<&'a str>, privy_idempotency_key: Option<&'a str>, body: &'a WalletRpcBody, ) -> Result<ResponseValue<WalletRpcResponse>, Error<()>>

Create a signature or transaction

Sign a message or transaction with a wallet by wallet ID.

Sends a POST request to /v1/wallets/{wallet_id}/rpc

Source

pub async fn get_wallet<'a>( &'a self, wallet_id: &'a str, ) -> Result<ResponseValue<Wallet>, Error<()>>

Get wallet

Get a wallet by wallet ID.

Sends a GET request to /v1/wallets/{wallet_id}

Source

pub async fn update_wallet<'a>( &'a self, wallet_id: &'a str, privy_authorization_signature: Option<&'a str>, body: &'a UpdateWalletBody, ) -> Result<ResponseValue<Wallet>, Error<()>>

Update wallet

Update a wallet’s policies or authorization key configuration.

Sends a PATCH request to /v1/wallets/{wallet_id}

Source

pub async fn raw_sign<'a>( &'a self, wallet_id: &'a str, privy_authorization_signature: Option<&'a str>, privy_idempotency_key: Option<&'a str>, body: &'a RawSign, ) -> Result<ResponseValue<RawSignResponse>, Error<()>>

Raw sign

Sign a message with a wallet by wallet ID.

Sends a POST request to /v1/wallets/{wallet_id}/raw_sign

Source

pub async fn get_wallet_balance<'a>( &'a self, wallet_id: &'a str, asset: &'a GetWalletBalanceAsset, chain: &'a GetWalletBalanceChain, include_currency: Option<GetWalletBalanceIncludeCurrency>, ) -> Result<ResponseValue<GetWalletBalanceResponse>, Error<()>>

Get balance

Get the balance of a wallet by wallet ID.

Sends a GET request to /v1/wallets/{wallet_id}/balance

Source

pub async fn wallet_transactions<'a>( &'a self, wallet_id: &'a str, asset: &'a WalletTransactionsAsset, chain: WalletTransactionsChain, cursor: Option<&'a WalletTransactionsCursor>, limit: Option<f64>, tx_hash: Option<&'a WalletTransactionsTxHash>, ) -> Result<ResponseValue<WalletTransactionsResponse>, Error<()>>

Get transactions

Get incoming and outgoing transactions of a wallet by wallet ID.

Sends a GET request to /v1/wallets/{wallet_id}/transactions

Source

pub async fn authenticate<'a>( &'a self, body: &'a AuthenticateBody, ) -> Result<ResponseValue<AuthenticateResponse>, Error<()>>

Obtain a session key to enable wallet access

Obtain a session key to enable wallet access.

Sends a POST request to /v1/wallets/authenticate

Source

pub async fn wallet_import_init<'a>( &'a self, body: &'a WalletImportInitializationRequest, ) -> Result<ResponseValue<WalletImportInitializationResponse>, Error<()>>

Initialize import

Initialize a wallet import. Complete by submitting the import.

Sends a POST request to /v1/wallets/import/init

Source

pub async fn wallet_import_submit<'a>( &'a self, body: &'a WalletImportSubmissionRequest, ) -> Result<ResponseValue<Wallet>, Error<()>>

Submit import

Submit a wallet import request.

Sends a POST request to /v1/wallets/import/submit

Source

pub async fn export_wallet<'a>( &'a self, wallet_id: &'a str, privy_authorization_signature: Option<&'a str>, body: &'a WalletExportRequestBody, ) -> Result<ResponseValue<WalletExportResponseBody>, Error<()>>

Export wallet

Export a wallet’s private key

Sends a POST request to /v1/wallets/{wallet_id}/export

Source

pub async fn get_users<'a>( &'a self, cursor: Option<&'a GetUsersCursor>, limit: Option<f64>, ) -> Result<ResponseValue<GetUsersResponse>, Error<()>>

Gets Users

Get all users in your app.

Sends a GET request to /v1/users

Source

pub async fn create_user<'a>( &'a self, body: &'a CreateUserBody, ) -> Result<ResponseValue<User>, Error<()>>

Create User

Create a new user with linked accounts. Optionally pre-generate embedded wallets for the user.

Sends a POST request to /v1/users

Source

pub async fn get_user<'a>( &'a self, user_id: &'a str, ) -> Result<ResponseValue<User>, Error<()>>

Get User

Get a user by user ID.

Sends a GET request to /v1/users/{user_id}

Source

pub async fn delete_user<'a>( &'a self, user_id: &'a str, ) -> Result<ResponseValue<()>, Error<ByteStream>>

Delete User

Delete a user by user ID.

Sends a DELETE request to /v1/users/{user_id}

Source

pub async fn update_user_custom_metadata<'a>( &'a self, user_id: &'a str, body: &'a UpdateUserCustomMetadataBody, ) -> Result<ResponseValue<User>, Error<()>>

Create Custom Metadata

Adds custom metadata to a user by user ID.

Sends a POST request to /v1/users/{user_id}/custom_metadata

Source

pub async fn look_up_user_by_email<'a>( &'a self, body: &'a LookUpUserByEmailBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Email Address

Looks up a user by their email address.

Sends a POST request to /v1/users/email/address

Source

pub async fn look_up_user_by_custom_auth_id<'a>( &'a self, body: &'a LookUpUserByCustomAuthIdBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Custom Auth ID

Looks up a user by their custom auth ID.

Sends a POST request to /v1/users/custom_auth/id

Source

pub async fn look_up_user_by_wallet_address<'a>( &'a self, body: &'a LookUpUserByWalletAddressBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by wallet address

Looks up a user by their wallet address.

Sends a POST request to /v1/users/wallet/address

Source

pub async fn look_up_user_by_farcaster_id<'a>( &'a self, body: &'a LookUpUserByFarcasterIdBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Farcaster ID

Looks up a user by their Farcaster ID.

Sends a POST request to /v1/users/farcaster/fid

Source

pub async fn look_up_user_by_phone_number<'a>( &'a self, body: &'a LookUpUserByPhoneNumberBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Phone Number

Looks up a user by their phone number.

Sends a POST request to /v1/users/phone/number

Source

pub async fn look_up_user_by_smart_wallet_address<'a>( &'a self, body: &'a LookUpUserBySmartWalletAddressBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Smart Wallet Address

Looks up a user by their smart wallet address.

Sends a POST request to /v1/users/smart_wallet/address

Source

pub async fn look_up_user_by_discord_username<'a>( &'a self, body: &'a LookUpUserByDiscordUsernameBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Discord Username

Looks up a user by their Discord username.

Sends a POST request to /v1/users/discord/username

Source

pub async fn look_up_user_by_github_username<'a>( &'a self, body: &'a LookUpUserByGithubUsernameBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Github Username

Looks up a user by their Github username.

Sends a POST request to /v1/users/github/username

Source

pub async fn look_up_user_by_twitter_username<'a>( &'a self, body: &'a LookUpUserByTwitterUsernameBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Twitter Username

Looks up a user by their Twitter username.

Sends a POST request to /v1/users/twitter/username

Source

pub async fn look_up_user_by_twitter_subject<'a>( &'a self, body: &'a LookUpUserByTwitterSubjectBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Twitter Subject

Looks up a user by their Twitter subject.

Sends a POST request to /v1/users/twitter/subject

Source

pub async fn look_up_user_by_telegram_user_id<'a>( &'a self, body: &'a LookUpUserByTelegramUserIdBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Telegram User ID

Looks up a user by their Telegram user ID.

Sends a POST request to /v1/users/telegram/telegram_user_id

Source

pub async fn look_up_user_by_telegram_username<'a>( &'a self, body: &'a LookUpUserByTelegramUsernameBody, ) -> Result<ResponseValue<User>, Error<()>>

Lookup User by Telegram Username

Looks up a user by their Telegram username.

Sends a POST request to /v1/users/telegram/username

Source

pub async fn search_users<'a>( &'a self, body: &'a SearchUsersBody, ) -> Result<ResponseValue<User>, Error<()>>

Search Users by Search Term

Search users by search term, emails, phone numbers, or wallet addresses.

Sends a POST request to /v1/users/search

Source

pub async fn create_user_wallet<'a>( &'a self, user_id: &'a str, body: &'a CreateUserWalletBody, ) -> Result<ResponseValue<User>, Error<()>>

Create Embedded Wallet

Creates an embedded wallet for an existing user.

Sends a POST request to /v1/users/{user_id}/wallets

Source

pub async fn add_or_update_user_linked_account<'a>( &'a self, user_id: &'a str, body: &'a LinkedAccountInput, ) -> Result<ResponseValue<User>, Error<()>>

Add or update a user linked account

Adds or updates a linked account for a user. This endpoint is not yet available to all users.

Sends a POST request to /v1/users/{user_id}/accounts

Unlink a user linked account

Unlinks a user linked account.

Sends a POST request to /v1/users/{user_id}/accounts/unlink

Source

pub async fn create_policy<'a>( &'a self, privy_idempotency_key: Option<&'a str>, body: &'a CreatePolicyBody, ) -> Result<ResponseValue<Policy>, Error<()>>

Create Policy

Create a new policy.

Sends a POST request to /v1/policies

Source

pub async fn get_policy<'a>( &'a self, policy_id: &'a GetPolicyPolicyId, ) -> Result<ResponseValue<Policy>, Error<()>>

Get Policy

Get a policy by policy ID.

Sends a GET request to /v1/policies/{policy_id}

Source

pub async fn delete_policy<'a>( &'a self, policy_id: &'a DeletePolicyPolicyId, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<DeletePolicyResponse>, Error<()>>

Delete Policy

Delete a policy by policy ID.

Sends a DELETE request to /v1/policies/{policy_id}

Source

pub async fn update_policy<'a>( &'a self, policy_id: &'a UpdatePolicyPolicyId, privy_authorization_signature: Option<&'a str>, body: &'a UpdatePolicyBody, ) -> Result<ResponseValue<Policy>, Error<()>>

Update Policy

Update a policy by policy ID.

Sends a PATCH request to /v1/policies/{policy_id}

Source

pub async fn create_rule<'a>( &'a self, policy_id: &'a CreateRulePolicyId, privy_authorization_signature: Option<&'a str>, body: &'a PolicyRuleRequestBody, ) -> Result<ResponseValue<PolicyRuleResponse>, Error<()>>

Create Policy Rule

Create a new rule for a policy.

Sends a POST request to /v1/policies/{policy_id}/rules

Source

pub async fn get_rule<'a>( &'a self, policy_id: &'a GetRulePolicyId, rule_id: &'a GetRuleRuleId, ) -> Result<ResponseValue<PolicyRuleResponse>, Error<()>>

Get Policy Rule

Get a rule by policy ID and rule ID.

Sends a GET request to /v1/policies/{policy_id}/rules/{rule_id}

Source

pub async fn delete_rule<'a>( &'a self, policy_id: &'a DeleteRulePolicyId, rule_id: &'a DeleteRuleRuleId, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<DeleteRuleResponse>, Error<()>>

Delete Policy Rule

Delete a rule by policy ID and rule ID.

Sends a DELETE request to /v1/policies/{policy_id}/rules/{rule_id}

Source

pub async fn update_rule<'a>( &'a self, policy_id: &'a UpdateRulePolicyId, rule_id: &'a UpdateRuleRuleId, privy_authorization_signature: Option<&'a str>, body: &'a PolicyRuleRequestBody, ) -> Result<ResponseValue<UpdateRuleResponse>, Error<()>>

Update Policy Rule

Update a rule by policy ID and rule ID.

Sends a PATCH request to /v1/policies/{policy_id}/rules/{rule_id}

Source

pub async fn create<'a>( &'a self, body: &'a ConditionSetRequestBody, ) -> Result<ResponseValue<ConditionSet>, Error<()>>

Create Condition Set

Create a new condition set. You must provide either “owner” or “owner_id” (but not both) to specify ownership.

Sends a POST request to /v1/condition_sets

Source

pub async fn get<'a>( &'a self, condition_set_id: &'a GetConditionSetId, ) -> Result<ResponseValue<ConditionSet>, Error<()>>

Get Condition Set

Get a condition set by condition set ID.

Sends a GET request to /v1/condition_sets/{condition_set_id}

Source

pub async fn delete<'a>( &'a self, condition_set_id: &'a DeleteConditionSetId, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<DeleteResponse>, Error<()>>

Delete Condition Set

Delete a condition set by condition set ID.

Sends a DELETE request to /v1/condition_sets/{condition_set_id}

Source

pub async fn update<'a>( &'a self, condition_set_id: &'a UpdateConditionSetId, privy_authorization_signature: Option<&'a str>, body: &'a UpdateConditionSetInput, ) -> Result<ResponseValue<ConditionSet>, Error<()>>

Update Condition Set

Update a condition set by condition set ID.

Sends a PATCH request to /v1/condition_sets/{condition_set_id}

Source

pub async fn get_items<'a>( &'a self, condition_set_id: &'a GetItemsConditionSetId, ) -> Result<ResponseValue<ConditionSetItemsResponse>, Error<()>>

Get Condition Set Items

Get all items in a condition set with pagination support.

Sends a GET request to /v1/condition_sets/{condition_set_id}/condition_set_items

Source

pub async fn update_items<'a>( &'a self, condition_set_id: &'a UpdateItemsConditionSetId, privy_authorization_signature: Option<&'a str>, body: &'a ConditionSetItemsRequestBody, ) -> Result<ResponseValue<ConditionSetItems>, Error<()>>

Create Condition Set Items

Replace all items in a condition set by condition set ID. Can add up to 100 items at once.

Sends a PUT request to /v1/condition_sets/{condition_set_id}/condition_set_items

Source

pub async fn create_items<'a>( &'a self, condition_set_id: &'a CreateItemsConditionSetId, privy_authorization_signature: Option<&'a str>, body: &'a ConditionSetItemsRequestBody, ) -> Result<ResponseValue<ConditionSetItems>, Error<()>>

Create Condition Set Items

Add new items to a condition set. Can add up to 100 items at once.

Sends a POST request to /v1/condition_sets/{condition_set_id}/condition_set_items

Source

pub async fn get_item<'a>( &'a self, condition_set_id: &'a GetItemConditionSetId, condition_set_item_id: &'a GetItemConditionSetItemId, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<ConditionSetItem>, Error<()>>

Get Condition Set Item

Get an item from a condition set by condition set ID and item ID.

Sends a GET request to /v1/condition_sets/{condition_set_id}/condition_set_items/ {condition_set_item_id}

Source

pub async fn delete_item<'a>( &'a self, condition_set_id: &'a DeleteItemConditionSetId, condition_set_item_id: &'a DeleteItemConditionSetItemId, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<DeleteItemResponse>, Error<()>>

Delete Condition Set Item

Delete an item from a condition set by condition set ID and item ID.

Sends a DELETE request to /v1/condition_sets/{condition_set_id}/condition_set_items/ {condition_set_item_id}

Source

pub async fn init_passkey_authentication<'a>( &'a self, body: &'a AuthPasskeyInitRequestBody, ) -> Result<ResponseValue<AuthPasskeyAuthenticationInitResponseBody>, Error<()>>

Initiate Passkey Authentication

Request a passkey authentication challenge.

Sends a POST request to /v1/user-accounts/passkeys/authenticate/init

Source

pub async fn authenticate_with_passkey<'a>( &'a self, body: &'a AuthPasskeyAuthenticationRequestBody, ) -> Result<ResponseValue<AuthenticatedUser>, Error<()>>

Authenticate With Passkey

Authenticate a user account with a passkey.

Sends a POST request to /v1/user-accounts/passkeys/authenticate

Source

pub async fn init_passkey_registration<'a>( &'a self, body: &'a AuthPasskeyInitRequestBody, ) -> Result<ResponseValue<AuthPasskeyRegistrationInitResponseBody>, Error<()>>

Initiate Passkey Registration

Request a passkey registration challenge

Sends a POST request to /v1/user-accounts/passkeys/register/init

Source

pub async fn register_with_passkey<'a>( &'a self, body: &'a AuthPasskeyRegistrationRequestBody, ) -> Result<ResponseValue<AuthenticatedUser>, Error<()>>

Register With Passkey

Register a new user account with a passkey.

Sends a POST request to /v1/user-accounts/passkeys/register

Initiate Passkey Link

Request a passkey registration challenge linked to a user account.

Sends a POST request to /v1/user-accounts/passkeys/link/init

Link Passkey

Link a passkey to an existing user account.

Sends a POST request to /v1/user-accounts/passkeys/link

Unlink Passkey

Unlink a passkey from a user account.

Sends a POST request to /v1/user-accounts/passkeys/unlink

Source

pub async fn send_code_to_email<'a>( &'a self, body: &'a SendCodeToEmailRequestBody, ) -> Result<ResponseValue<SendCodeToEmailResponseBody>, Error<()>>

Initiate Passwordless Authentication

Request a one time code to be sent to the user’s email.

Sends a POST request to /v1/user-accounts/passwordless/init

Source

pub async fn authenticate_with_email<'a>( &'a self, body: &'a AuthenticateWithEmailRequestBody, ) -> Result<ResponseValue<AuthenticatedUser>, Error<()>>

Authenticate With Passwordless

Authenticate a user account with an email and code.

Sends a POST request to /v1/user-accounts/passwordless/authenticate

Link Passwordless

Link an email to an existing user account.

Sends a POST request to /v1/user-accounts/passwordless/link

Unlink Passwordless

Unlink an email from a user account.

Sends a POST request to /v1/user-accounts/passwordless/unlink

Source

pub async fn update_email<'a>( &'a self, body: &'a UpdateEmailRequestBody, ) -> Result<ResponseValue<User>, Error<()>>

Update Passwordless

Update a user’s linked email account.

Sends a POST request to /v1/user-accounts/passwordless/update

Source

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

Get Transaction

Get a transaction by transaction ID.

Sends a GET request to /v1/transactions/{transaction_id}

Source

pub async fn get_key_quorum<'a>( &'a self, key_quorum_id: &'a str, ) -> Result<ResponseValue<KeyQuorum>, Error<()>>

Get key quorum

Get a key quorum by ID.

Sends a GET request to /v1/key_quorums/{key_quorum_id}

Source

pub async fn delete_key_quorum<'a>( &'a self, key_quorum_id: &'a str, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<DeleteKeyQuorumResponse>, Error<()>>

Delete key quorum

Delete a key quorum by key quorum ID.

Sends a DELETE request to /v1/key_quorums/{key_quorum_id}

Source

pub async fn update_key_quorum<'a>( &'a self, key_quorum_id: &'a str, privy_authorization_signature: Option<&'a str>, body: &'a UpdateKeyQuorumBody, ) -> Result<ResponseValue<KeyQuorum>, Error<()>>

Update key quorum

Update a key quorum by key quorum ID.

Sends a PATCH request to /v1/key_quorums/{key_quorum_id}

Source

pub async fn create_key_quorum<'a>( &'a self, body: &'a CreateKeyQuorumBody, ) -> Result<ResponseValue<KeyQuorum>, Error<()>>

Create key quorum

Create a new key quorum.

Sends a POST request to /v1/key_quorums

Source

pub async fn user_fiat_statuses<'a>( &'a self, user_id: &'a str, body: &'a UserFiatStatusesBody, ) -> Result<ResponseValue<UserFiatStatusesResponse>, Error<()>>

Get a list of fiat transactions and their statuses

Returns a list of fiat transactions and their statuses

Sends a POST request to /v1/users/{user_id}/fiat/status

Source

pub async fn create_user_fiat_tos<'a>( &'a self, user_id: &'a str, body: &'a CreateUserFiatTosBody, ) -> Result<ResponseValue<CreateUserFiatTosResponse>, Error<()>>

Create a terms of service agreement for a user

Creates a terms of service agreement for a user

Sends a POST request to /v1/users/{user_id}/fiat/tos

Source

pub async fn get_user_fiat_kyc_status<'a>( &'a self, user_id: &'a str, provider: GetUserFiatKycStatusProvider, ) -> Result<ResponseValue<GetUserFiatKycStatusResponse>, Error<()>>

Get KYC status for a user

Get the current KYC verification status for a user from the configured provider

Sends a GET request to /v1/users/{user_id}/fiat/kyc

Source

pub async fn initiate_user_fiat_kyc<'a>( &'a self, user_id: &'a str, body: &'a InitiateUserFiatKycBody, ) -> Result<ResponseValue<InitiateUserFiatKycResponse>, Error<()>>

Initiate KYC verification for a user

Initiates KYC verification process for a user with the configured provider

Sends a POST request to /v1/users/{user_id}/fiat/kyc

Source

pub async fn update_user_fiat_kyc_status<'a>( &'a self, user_id: &'a str, body: &'a UpdateUserFiatKycStatusBody, ) -> Result<ResponseValue<UpdateUserFiatKycStatusResponse>, Error<()>>

Update KYC status for a user

Update the KYC verification status for a user from the configured provider

Sends a PATCH request to /v1/users/{user_id}/fiat/kyc

Get a KYC link for a user

Returns a KYC link for a user

Sends a POST request to /v1/users/{user_id}/fiat/kyc_link

Source

pub async fn get_user_fiat_accounts<'a>( &'a self, user_id: &'a str, provider: GetUserFiatAccountsProvider, ) -> Result<ResponseValue<GetUserFiatAccountsResponse>, Error<()>>

Get user’s fiat accounts

Returns the IDs of all external fiat accounts (used for offramping) for the user

Sends a GET request to /v1/users/{user_id}/fiat/accounts

Source

pub async fn create_user_fiat_account<'a>( &'a self, user_id: &'a str, body: &'a CreateUserFiatAccountBody, ) -> Result<ResponseValue<CreateUserFiatAccountResponse>, Error<()>>

Create a fiat account

Sets up external bank account object for the user through the configured default provider. Requires the user to already be KYC’ed.

Sends a POST request to /v1/users/{user_id}/fiat/accounts

Source

pub async fn initiate_user_fiat_offramp<'a>( &'a self, user_id: &'a str, body: &'a InitiateUserFiatOfframpBody, ) -> Result<ResponseValue<InitiateUserFiatOfframpResponse>, Error<()>>

Initiate an offramp transaction

Triggers the offramp flow and gets the on-chain address to send funds to

Sends a POST request to /v1/users/{user_id}/fiat/offramp

Source

pub async fn initiate_user_fiat_onramp<'a>( &'a self, user_id: &'a str, body: &'a InitiateUserFiatOnrampBody, ) -> Result<ResponseValue<InitiateUserFiatOnrampResponse>, Error<()>>

Initiate an onramp transaction

Triggers an onramp to the specified recipient blockchain address, returns the bank deposit instructions

Sends a POST request to /v1/users/{user_id}/fiat/onramp

Source

pub async fn configure_app_for_fiat_on_off_ramping<'a>( &'a self, app_id: &'a str, body: &'a ConfigureAppForFiatOnOffRampingBody, ) -> Result<ResponseValue<ConfigureAppForFiatOnOffRampingResponse>, Error<()>>

Configure app for fiat onramping and offramping

Updates the app configuration for the specified onramp provider. This is used to set up the app for fiat onramping and offramping.

Sends a POST request to /v1/apps/{app_id}/fiat

Source

pub async fn request_quote<'a>( &'a self, body: &'a RequestQuoteBody, ) -> Result<ResponseValue<RequestQuoteResponse>, Error<()>>

Request Quote

Request a price quote for an asset that may be used to execute a trade later on. The quote will be valid for a limited time as specified in the response.

Sends a POST request to /v1/kraken_embed/quotes

Source

pub async fn get_quote<'a>( &'a self, quote_id: &'a str, user_id: &'a GetQuoteUserId, ) -> Result<ResponseValue<GetQuoteResponse>, Error<()>>

Get Quote

Gets the status of a quote that was previously requested.

Sends a GET request to /v1/kraken_embed/quotes/{quote_id}

Source

pub async fn execute_quote<'a>( &'a self, quote_id: &'a str, body: &'a ExecuteQuoteBody, ) -> Result<ResponseValue<ExecuteQuoteResponse>, Error<()>>

Execute Quote

Execute a previously requested quote to complete the trade. The quote must be in “new” status and not expired.

Sends a PUT request to /v1/kraken_embed/quotes/{quote_id}

Source

pub async fn get_kraken_user<'a>( &'a self, user_id: &'a str, ) -> Result<ResponseValue<GetKrakenUserResponse>, Error<()>>

Get Kraken User

Retrieve information about a Kraken Embed user including their status and required actions.

Sends a GET request to /v1/kraken_embed/users/{user_id}

Source

pub async fn create_kraken_user<'a>( &'a self, user_id: &'a str, body: &'a CreateKrakenUserBody, ) -> Result<ResponseValue<CreateKrakenUserResponse>, Error<()>>

Create Kraken User

Create a new Kraken Embed user associated with a Privy user. This establishes the mapping between the Privy user and the Kraken IIBAN.

Sends a POST request to /v1/kraken_embed/users/{user_id}

Source

pub async fn submit_user_verification<'a>( &'a self, user_id: &'a str, ) -> Result<ResponseValue<Map<String, Value>>, Error<()>>

Submit User Verification

Submit identity verification details for a Kraken Embed user. Supports various verification types including identity documents, residence documents, tax IDs, selfies, watchlists, and KYC reports.

Sends a POST request to /v1/kraken_embed/users/{user_id}/verifications

Source

pub async fn submit_user_verification_from_url<'a>( &'a self, user_id: &'a str, body: &'a SubmitUserVerificationFromUrlBody, ) -> Result<ResponseValue<SubmitUserVerificationFromUrlResponse>, Error<()>>

Submit User Verification from URLs

Submit identity verification details for a Kraken Embed user using presigned URLs to documents. This endpoint accepts JSON payloads with URLs to verification documents instead of multipart file uploads. Supports identity documents, residence documents, tax IDs, selfies, and watchlists.

Sends a POST request to /v1/kraken_embed/users/{user_id}/verification_urls

Source

pub async fn list_assets<'a>( &'a self, filter_assets: Option<&'a Vec<ListAssetsFilterAssetsItem>>, filter_platform_statuses: Option<&'a Vec<ListAssetsFilterPlatformStatusesItem>>, filter_tradable_only: Option<bool>, filter_user: Option<&'a str>, lang: Option<&'a ListAssetsLang>, page_number: Option<NonZeroU64>, page_size: Option<NonZeroU64>, quote: Option<&'a ListAssetsQuote>, sort: Option<ListAssetsSort>, ) -> Result<ResponseValue<ListAssetsResponse>, Error<()>>

List Assets

Get a list of all available assets for trading on Kraken Embed, with optional filtering and pagination.

Sends a GET request to /v1/kraken_embed/assets

Source

pub async fn get_kraken_embed_assets<'a>( &'a self, asset_id: &'a GetKrakenEmbedAssetsAssetId, lang: Option<&'a GetKrakenEmbedAssetsLang>, quote: Option<&'a GetKrakenEmbedAssetsQuote>, ) -> Result<ResponseValue<GetKrakenEmbedAssetsResponse>, Error<()>>

Get Asset Details

Get detailed information about a specific asset including pricing, market data, and trading capabilities.

Sends a GET request to /v1/kraken_embed/assets/{asset_id}

Source

pub async fn list_asset_rates<'a>( &'a self, asset_id: &'a ListAssetRatesAssetId, end_time: Option<&'a DateTime<Utc>>, interval: Option<&'a str>, quote: Option<&'a ListAssetRatesQuote>, start_time: Option<&'a DateTime<Utc>>, ) -> Result<ResponseValue<ListAssetRatesResponse>, Error<()>>

Get Asset Historical Rates

Get historical price rates for a specific asset with optional time range and interval filtering.

Sends a GET request to /v1/kraken_embed/assets/{asset_id}/rates

Source

pub async fn get_portfolio_details<'a>( &'a self, user_id: &'a str, quote: Option<&'a GetPortfolioDetailsQuote>, ) -> Result<ResponseValue<GetPortfolioDetailsResponse>, Error<()>>

Get Portfolio Details

Get detailed portfolio information for a user including asset balances, values, and positions.

Sends a GET request to /v1/kraken_embed/users/{user_id}/details

Source

pub async fn get_protfolio_history_for_user<'a>( &'a self, user_id: &'a str, cursor: Option<&'a str>, end_date: Option<&'a str>, include_assets: Option<&'a GetProtfolioHistoryForUserIncludeAssets>, include_total_balance: Option<GetProtfolioHistoryForUserIncludeTotalBalance>, include_total_pnl: Option<GetProtfolioHistoryForUserIncludeTotalPnl>, quote: Option<&'a GetProtfolioHistoryForUserQuote>, resolution: Option<u64>, start_date: Option<&'a str>, ) -> Result<ResponseValue<GetProtfolioHistoryForUserResponse>, Error<()>>

Get Portfolio History

Get historical balances and valuations over time for a user’s portfolio with optional filtering by assets and date range.

Sends a GET request to /v1/kraken_embed/users/{user_id}/history

Source

pub async fn get_portfolio_transactions<'a>( &'a self, user_id: &'a str, assets: Option<&'a Vec<GetPortfolioTransactionsAssetsItem>>, cursor: Option<&'a str>, from_time: Option<&'a DateTime<Utc>>, ids: Option<&'a Vec<String>>, page_size: Option<NonZeroU64>, quote: Option<&'a GetPortfolioTransactionsQuote>, ref_ids: Option<&'a Vec<GetPortfolioTransactionsRefIdsItem>>, sorting: Option<GetPortfolioTransactionsSorting>, statuses: Option<&'a Vec<GetPortfolioTransactionsStatusesItem>>, types: Option<&'a Vec<GetPortfolioTransactionsTypesItem>>, until_time: Option<&'a DateTime<Utc>>, ) -> Result<ResponseValue<GetPortfolioTransactionsResponse>, Error<()>>

Get Portfolio Transactions

Get transaction history for a user’s portfolio with filtering and pagination options.

Sends a GET request to /v1/kraken_embed/users/{user_id}/transactions

Source

pub async fn withdraw_funds<'a>( &'a self, body: &'a WithdrawFundsBody, ) -> Result<ResponseValue<WithdrawFundsResponse>, Error<()>>

Withdraw funds

Currently, this is a master-only operation. Therefore, no User parameter exists.

Sends a POST request to /v1/kraken_embed/funds/withdrawals

Trait Implementations§

Source§

impl ClientHooks for &Client

Source§

async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs prior to the execution of the request. This may be used to modify the request before it is transmitted.
Source§

async fn post<E>( &self, result: &Result<Response, Error>, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs after completion of the request.
Source§

async fn exec( &self, request: Request, info: &OperationInfo, ) -> Result<Response, Error>

Execute the request. Note that for almost any reasonable implementation this will include code equivalent to this: Read more
Source§

impl ClientInfo<()> for Client

Source§

fn api_version() -> &'static str

Get the version of this API. Read more
Source§

fn baseurl(&self) -> &str

Get the base URL to which requests are made.
Source§

fn client(&self) -> &Client

Get the internal reqwest::Client used to make requests.
Source§

fn inner(&self) -> &()

Get the inner value of type T if one is specified.
Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

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 Client

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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