Struct DerivClient

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

The main client for interacting with the Deriv API

Implementations§

Source§

impl DerivClient

Source

pub async fn p_2_p_order_create( &self, request: P2pOrderCreateRequest, ) -> Result<P2pOrderCreateResponse>

Creates a P2P order for the specified advert.

Source

pub async fn unsubscribe_email( &self, request: UnsubscribeEmailRequest, ) -> Result<UnsubscribeEmailResponse>

It unsubscribe user from the email subscription.

Source

pub async fn p_2_p_advert_create( &self, request: P2pAdvertCreateRequest, ) -> Result<P2pAdvertCreateResponse>

Creates a P2P (Peer to Peer) advert. Can only be used by an approved P2P advertiser.

Source

pub async fn p_2_p_advertiser_payment_methods( &self, request: P2pAdvertiserPaymentMethods, ) -> Result<P2pAdvertiserPaymentMethods>

Manage or list P2P advertiser payment methods.

Source

pub async fn copytrading_statistics( &self, request: CopytradingStatisticsRequest, ) -> Result<CopytradingStatisticsResponse>

Retrieve performance, trading, risk and copiers statistics of trader.

Source

pub async fn cashier(&self, request: CashierRequest) -> Result<CashierResponse>

Request the cashier info for the specified type.

Source

pub async fn cancel(&self, request: CancelRequest) -> Result<CancelResponse>

Cancel contract with contract id

Source

pub async fn paymentagent_transfer( &self, request: PaymentagentTransferRequest, ) -> Result<PaymentagentTransferResponse>

Payment Agent Transfer - this call is available only to accounts that are approved Payment Agents.

Source

pub async fn transaction( &self, request: TransactionRequest, ) -> Result<TransactionResponse>

Subscribe to transaction notifications

Source

pub async fn website_config( &self, request: WebsiteConfigRequest, ) -> Result<WebsiteConfigResponse>

Request server config.

Source

pub async fn p_2_p_ping( &self, request: P2pPingRequest, ) -> Result<P2pPingResponse>

Keeps the connection alive and updates the P2P advertiser's online status. The advertiser will be considered offline 60 seconds after a call is made.

Source

pub async fn trading_platform_investor_password_reset( &self, request: TradingPlatformInvestorPasswordResetRequest, ) -> Result<TradingPlatformInvestorPasswordResetResponse>

Reset the investor password of a Trading Platform Account

Source

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

Sell a Contract as identified from a previous `portfolio` call.

Source

pub async fn mt_5_password_reset( &self, request: Mt5PasswordResetRequest, ) -> Result<Mt5PasswordResetResponse>

To reset the password of MT5 account.

Source

pub async fn p_2_p_advertiser_adverts( &self, request: P2pAdvertiserAdvertsRequest, ) -> Result<P2pAdvertiserAdvertsResponse>

Returns all P2P adverts created by the authorized client. Can only be used by a registered P2P advertiser.

Source

pub async fn p_2_p_advert_list( &self, request: P2pAdvertListRequest, ) -> Result<P2pAdvertListResponse>

Returns available adverts for use with `p2p_order_create` .

Source

pub async fn buy_contract_for_multiple_accounts( &self, request: BuyContractForMultipleAccountsRequest, ) -> Result<BuyContractForMultipleAccountsResponse>

Buy a Contract for multiple Accounts specified by the `tokens` parameter. Note, although this is an authorized call, the contract is not bought for the authorized account.

Source

pub async fn ping(&self, request: PingRequest) -> Result<PingResponse>

To send the ping request to the server. Mostly used to test the connection or to keep it alive.

Source

pub async fn partner_account_creation( &self, request: PartnerAccountCreationRequest, ) -> Result<PartnerAccountCreationResponse>

This call initiates the state machine for account creation process

Source

pub async fn p_2_p_advertiser_update( &self, request: P2pAdvertiserUpdateRequest, ) -> Result<P2pAdvertiserUpdateResponse>

Update the information of the P2P advertiser for the current account. Can only be used by an approved P2P advertiser.

Source

pub async fn topup_virtual( &self, request: TopupVirtualRequest, ) -> Result<TopupVirtualResponse>

When a virtual-money's account balance becomes low, it can be topped up using this call.

Source

pub async fn partner_settings_update( &self, request: PartnerSettingsUpdateRequest, ) -> Result<PartnerSettingsUpdateResponse>

A message with Partner Settings

Source

pub async fn ticks_batch( &self, request: TicksBatchRequest, ) -> Result<TicksBatchResponse>

Initiate a continuous stream of spot price updates for a group symbols.

Source

pub async fn states_list( &self, request: StatesListRequest, ) -> Result<StatesListResponse>

For a given country, returns a list of States of that country. This is useful to populate the account opening form.

Source

pub async fn sell_contract_for_multiple_accounts( &self, request: SellContractForMultipleAccountsRequest, ) -> Result<SellContractForMultipleAccountsResponse>

Sell contracts for multiple accounts simultaneously. Uses the shortcode response from `buy_contract_for_multiple_accounts` to identify the contract, and authorisation tokens to select which accounts to sell those contracts on. Note that only the accounts identified by the tokens will be affected. This will not sell the contract on the currently-authorised account unless you include the token for the current account.

Source

pub async fn transfer_between_accounts( &self, request: TransferBetweenAccountsRequest, ) -> Result<TransferBetweenAccountsResponse>

This call allows transfers between accounts held by a given user. Transfer funds between your fiat and cryptocurrency accounts (for a fee). Please note that account_from should be same as current authorized account.

Source

pub async fn get_settings( &self, request: GetSettingsRequest, ) -> Result<GetSettingsResponse>

Get User Settings (email, date of birth, address etc)

Source

pub async fn ticks(&self, request: TicksRequest) -> Result<TicksResponse>

Initiate a continuous stream of spot price updates for a given symbol.

Source

pub async fn financial_assessment_questions( &self, request: FinancialAssessmentQuestionsRequest, ) -> Result<FinancialAssessmentQuestionsResponse>

This call gets the financial assessment questionnaire structure, which defines the questions, possible answers, and flow logic for the financial assessment form.

Source

pub async fn paymentagent_withdraw_justification( &self, request: PaymentagentWithdrawJustificationRequest, ) -> Result<PaymentagentWithdrawJustificationResponse>

Provide justification to perform withdrawal using a Payment Agent.

Source

pub async fn contract_update( &self, request: ContractUpdateRequest, ) -> Result<ContractUpdateResponse>

Update a contract condition.

Source

pub async fn new_account_real( &self, request: NewAccountRealRequest, ) -> Result<NewAccountRealResponse>

This call opens a new real-money account. This call can be made from a virtual-money or a real-money account. If it is the latter, client information fields in this call will be ignored and data from your existing real-money account will be used.

Source

pub async fn p_2_p_advert_info( &self, request: P2pAdvertInfoRequest, ) -> Result<P2pAdvertInfoResponse>

Retrieve information about a P2P advert.

Source

pub async fn trading_platform_password_reset( &self, request: TradingPlatformPasswordResetRequest, ) -> Result<TradingPlatformPasswordResetResponse>

Reset the password of a Trading Platform Account

Source

pub async fn contract_update_history( &self, request: ContractUpdateHistoryRequest, ) -> Result<ContractUpdateHistoryResponse>

Request for contract update history.

Source

pub async fn get_limits( &self, request: GetLimitsRequest, ) -> Result<GetLimitsResponse>

Trading and Withdrawal Limits for a given user

Source

pub async fn p_2_p_advertiser_list( &self, request: P2pAdvertiserListRequest, ) -> Result<P2pAdvertiserListResponse>

Retrieve advertisers has/had trade with the current advertiser.

Source

pub async fn p_2_p_settings( &self, request: P2pSettingsRequest, ) -> Result<P2pSettingsResponse>

Request P2P Settings information.

Source

pub async fn paymentagent_list( &self, request: PaymentagentListRequest, ) -> Result<PaymentagentListResponse>

Will return a list of Payment Agents for a given country for a given currency. Payment agents allow users to deposit and withdraw funds using local payment methods that might not be available via the main website's cashier system.

Source

pub async fn mt_5_login_list( &self, request: Mt5LoginListRequest, ) -> Result<Mt5LoginListResponse>

Get list of MT5 accounts for client

Source

pub async fn p_2_p_order_dispute( &self, request: P2pOrderDisputeRequest, ) -> Result<P2pOrderDisputeResponse>

Dispute a P2P order.

Source

pub async fn tin_validations( &self, request: TinValidationsRequest, ) -> Result<TinValidationsResponse>

Get the validations for Tax Identification Numbers (TIN)

Source

pub async fn p_2_p_payment_methods( &self, request: P2pPaymentMethodsRequest, ) -> Result<P2pPaymentMethodsResponse>

List all P2P payment methods.

Source

pub async fn p_2_p_order_review( &self, request: P2pOrderReviewRequest, ) -> Result<P2pOrderReviewResponse>

Creates a review for the specified order.

Source

pub async fn set_settings( &self, request: SetSettingsRequest, ) -> Result<SetSettingsResponse>

Set User Settings (this call should be used in conjunction with `get_settings`)

Source

pub async fn p_2_p_order_list( &self, request: P2pOrderListRequest, ) -> Result<P2pOrderListResponse>

List active orders.

Source

pub async fn contracts_for_company( &self, request: ContractsForCompanyRequest, ) -> Result<ContractsForCompanyResponse>

Get the list of currently available contracts for a given landing company.

Source

pub async fn exchange_verification_code( &self, request: ExchangeVerificationCodeRequest, ) -> Result<ExchangeVerificationCodeResponse>

Verifies the code and returns a new code if verification is successful

Source

pub async fn get_account_status( &self, request: GetAccountStatusRequest, ) -> Result<GetAccountStatusResponse>

Get Account Status

Source

pub async fn mt_5_password_change( &self, request: Mt5PasswordChangeRequest, ) -> Result<Mt5PasswordChangeResponse>

To change passwords of the MT5 account.

Source

pub async fn sell_expired( &self, request: SellExpiredRequest, ) -> Result<SellExpiredResponse>

This call will try to sell any expired contracts and return the number of sold contracts.

Source

pub async fn partner_accounts( &self, request: PartnerAccountsRequest, ) -> Result<PartnerAccountsResponse>

Get All Partner Accounts (Partner account details like website, provider, company details)

Source

pub async fn forget_all( &self, request: ForgetAllRequest, ) -> Result<ForgetAllResponse>

Immediately cancel the real-time streams of messages of given type.

Source

pub async fn website_status( &self, request: WebsiteStatusRequest, ) -> Result<WebsiteStatusResponse>

Request server status.

Source

pub async fn trading_platform_status( &self, request: TradingPlatformStatusRequest, ) -> Result<TradingPlatformStatusResponse>

Request trading platform status

Source

pub async fn p_2_p_order_confirm( &self, request: P2pOrderConfirmRequest, ) -> Result<P2pOrderConfirmResponse>

Confirm a P2P order.

Source

pub async fn p_2_p_chat_create( &self, request: P2pChatCreateRequest, ) -> Result<P2pChatCreateResponse>

Creates a P2P chat for the specified order.

Source

pub async fn asset_index( &self, request: AssetIndexRequest, ) -> Result<AssetIndexResponse>

Retrieve a list of all available underlyings and the corresponding contract types and duration boundaries. If the user is logged in, only the assets available for that user's landing company will be returned.

Source

pub async fn p_2_p_advertiser_info( &self, request: P2pAdvertiserInfoRequest, ) -> Result<P2pAdvertiserInfoResponse>

Retrieve information about a P2P advertiser.

Source

pub async fn trading_durations( &self, request: TradingDurationsRequest, ) -> Result<TradingDurationsResponse>

Retrieve a list of all available underlyings and the corresponding contract types and trading duration boundaries. If the user is logged in, only the assets available for that user's landing company will be returned.

Source

pub async fn statement( &self, request: StatementRequest, ) -> Result<StatementResponse>

Retrieve a summary of account transactions, according to given search criteria

Source

pub async fn landing_company_details( &self, request: LandingCompanyDetailsRequest, ) -> Result<LandingCompanyDetailsResponse>

The company has a number of licensed subsidiaries in various jurisdictions, which are called Landing Companies (and which are wholly owned subsidiaries of the Deriv Group). This call provides information about each Landing Company.

Source

pub async fn tnc_approval( &self, request: TncApprovalRequest, ) -> Result<TncApprovalResponse>

To approve the latest version of terms and conditions.

Source

pub async fn get_third_party_redirect( &self, request: GetThirdPartyRedirectRequest, ) -> Result<GetThirdPartyRedirectResponse>

Get Third Party Redirect URL for sso login.

Source

pub async fn new_account_maltainvest( &self, request: NewAccountMaltainvestRequest, ) -> Result<NewAccountMaltainvestResponse>

This call opens a new real-money account with the `maltainvest` Landing Company. This call can be made from a virtual-money account or real-money account at Deriv (Europe) Limited. If it is the latter, client information fields in this call will be ignored and data from your existing real-money account will be used.

Source

pub async fn balance(&self, request: BalanceRequest) -> Result<BalanceResponse>

Get user account balance

Source

pub async fn app_delete( &self, request: AppDeleteRequest, ) -> Result<AppDeleteResponse>

The request for deleting an application.

Source

pub async fn p_2_p_order_info( &self, request: P2pOrderInfoRequest, ) -> Result<P2pOrderInfoResponse>

Retrieves the information about a P2P order.

Source

pub async fn logout(&self, request: LogoutRequest) -> Result<LogoutResponse>

Logout the session

Source

pub async fn app_update( &self, request: AppUpdateRequest, ) -> Result<AppUpdateResponse>

Update a new OAuth application

Source

pub async fn partner_account_creation_status( &self, request: PartnerAccountCreationStatusRequest, ) -> Result<PartnerAccountCreationStatusResponse>

This call polls the state machine and returns the completion status for each step.

Source

pub async fn set_financial_assessment( &self, request: SetFinancialAssessment, ) -> Result<SetFinancialAssessmentResponse>

This call sets the financial assessment details based on the client's answers to analyze whether they possess the experience and knowledge to understand the risks involved with binary options trading.

Source

pub async fn p_2_p_advertiser_relations( &self, request: P2pAdvertiserRelationsRequest, ) -> Result<P2pAdvertiserRelationsResponse>

Updates and returns favourite and blocked advertisers of the current user.

Source

pub async fn kyc_auth_status( &self, request: KycAuthStatusRequest, ) -> Result<KycAuthStatusResponse>

Get KYC Authentication Status

Source

pub async fn mt_5_get_settings( &self, request: Mt5GetSettingsRequest, ) -> Result<Mt5GetSettingsResponse>

Get MT5 user account settings

Source

pub async fn reality_check( &self, request: RealityCheckRequest, ) -> Result<RealityCheckResponse>

Retrieve summary of client's trades and account for the Reality Check facility. A 'reality check' means a display of time elapsed since the session began, and associated client profit/loss. The Reality Check facility is a regulatory requirement for certain landing companies.

Source

pub async fn app_list(&self, request: AppListRequest) -> Result<AppListResponse>

List all of the account's OAuth applications

Source

pub async fn revoke_oauth_app( &self, request: RevokeOauthAppRequest, ) -> Result<RevokeOauthAppResponse>

Used for revoking access of particular app.

Source

pub async fn time(&self, request: TimeRequest) -> Result<TimeResponse>

Request back-end server epoch time.

Source

pub async fn crypto_config( &self, request: CryptoConfigRequest, ) -> Result<CryptoConfigResponse>

The request for cryptocurrencies configuration.

Source

pub async fn document_upload( &self, request: DocumentUploadRequest, ) -> Result<DocumentUploadResponse>

Request KYC information from client

Source

pub async fn confirm_email( &self, request: ConfirmEmailRequest, ) -> Result<ConfirmEmailResponse>

Verifies the email for the user using verification code passed in the request object

Source

pub async fn landing_company( &self, request: LandingCompanyRequest, ) -> Result<LandingCompanyResponse>

The company has a number of licensed subsidiaries in various jurisdictions, which are called Landing Companies. This call will return the appropriate Landing Company for clients of a given country. The landing company may differ for derived contracts (Synthetic Indices) and Financial contracts (Forex, Stock Indices, Commodities).

Source

pub async fn oauth_apps( &self, request: OauthAppsRequest, ) -> Result<OauthAppsResponse>

List all my used OAuth applications.

Source

pub async fn crypto_estimations( &self, request: CryptoEstimationsRequest, ) -> Result<CryptoEstimations>

Get the current estimations for cryptocurrencies. E.g. Withdrawal fee.

Source

pub async fn copy_start( &self, request: CopyStartRequest, ) -> Result<CopyStartResponse>

Start copy trader bets

Source

pub async fn proposal( &self, request: ProposalRequest, ) -> Result<ProposalResponse>

Gets latest price for a specific contract.

Source

pub async fn login_history( &self, request: LoginHistoryRequest, ) -> Result<LoginHistoryResponse>

Retrieve a summary of login history for user.

Source

pub async fn mt_5_password_check( &self, request: Mt5PasswordCheckRequest, ) -> Result<Mt5PasswordCheckResponse>

This call validates the main password for the MT5 user

Source

pub async fn authorize( &self, request: AuthorizeRequest, ) -> Result<AuthorizeResponse>

Authorize current WebSocket session to act on behalf of the owner of a given token. Must precede requests that need to access client account, for example purchasing and selling contracts or viewing portfolio.

Source

pub async fn p_2_p_country_list( &self, request: P2pCountryListRequest, ) -> Result<P2pCountryListResponse>

List all or specific country and its payment methods.

Source

pub async fn paymentagent_withdraw( &self, request: PaymentagentWithdrawRequest, ) -> Result<PaymentagentWithdrawResponse>

Initiate a withdrawal to an approved Payment Agent.

Source

pub async fn app_register( &self, request: AppRegisterRequest, ) -> Result<AppRegisterResponse>

Register a new OAuth application

Source

pub async fn active_symbols( &self, request: ActiveSymbolsRequest, ) -> Result<ActiveSymbolsResponse>

Retrieve a list of all currently active symbols (underlying markets upon which contracts are available for trading).

Source

pub async fn ticks_history( &self, request: TicksHistoryRequest, ) -> Result<TicksHistoryResponse>

Get historic tick data for a given symbol.

Source

pub async fn mt_5_new_account( &self, request: Mt5NewAccountRequest, ) -> Result<Mt5NewAccountResponse>

This call creates new MT5 user, either demo or real money user.

Source

pub async fn payout_currencies( &self, request: PayoutCurrenciesRequest, ) -> Result<PayoutCurrenciesResponse>

Retrieve a list of available option payout currencies. If a user is logged in, only the currencies available for the account will be returned.

Source

pub async fn portfolio( &self, request: PortfolioRequest, ) -> Result<PortfolioResponse>

Receive information about my current portfolio of outstanding options

Source

pub async fn copy_stop( &self, request: CopyStopRequest, ) -> Result<CopyStopResponse>

Stop copy trader bets

Source

pub async fn copytrading_list( &self, request: CopytradingListRequest, ) -> Result<CopytradingListResponse>

Retrieves a list of active copiers and/or traders for Copy Trading

Source

pub async fn app_markup_details( &self, request: AppMarkupDetailsRequest, ) -> Result<AppMarkupDetailsResponse>

Retrieve details of `app_markup` according to criteria specified.

Source

pub async fn partner_settings( &self, request: PartnerSettingsRequest, ) -> Result<PartnerSettingsResponse>

Get Partner Settings (Partner Type, Company Details etc)

Source

pub async fn paymentagent_details( &self, request: PaymentagentDetailsRequest, ) -> Result<PaymentagentDetailsResponse>

Gets client's payment agent details.

Source

pub async fn residence_list( &self, request: ResidenceListRequest, ) -> Result<ResidenceListResponse>

This call returns a list of countries and 2-letter country codes, suitable for populating the account opening form.

Source

pub async fn forget(&self, request: ForgetRequest) -> Result<ForgetResponse>

Immediately cancel the real-time stream of messages with a specific ID.

Source

pub async fn api_token( &self, request: ApiTokenRequest, ) -> Result<ApiTokenResponse>

This call manages API tokens

Source

pub async fn account_list( &self, request: AccountListRequest, ) -> Result<AccountListResponse>

Returns all accounts belonging to the authorized user.

Source

pub async fn paymentagent_create( &self, request: PaymentagentCreateRequest, ) -> Result<PaymentagentCreateResponse>

Saves client's payment agent details.

Source

pub async fn identity_verification_document_add( &self, request: IdentityVerificationDocumentAddRequest, ) -> Result<IdentityVerificationDocumentAddResponse>

Adds document information such as issuing country, id and type for identity verification processes.

Source

pub async fn get_financial_assessment( &self, request: GetFinancialAssessmentRequest, ) -> Result<GetFinancialAssessmentResponse>

This call gets the financial assessment details. The 'financial assessment' is a questionnaire that clients of certain Landing Companies need to complete, due to regulatory and KYC (know your client) requirements.

Source

pub async fn mt_5_withdrawal( &self, request: Mt5WithdrawalRequest, ) -> Result<Mt5WithdrawalResponse>

This call allows withdrawal from MT5 account to Binary account.

Source

pub async fn app_get(&self, request: AppGetRequest) -> Result<AppGetResponse>

To get the information of the OAuth application specified by 'app_id'

Source

pub async fn profit_table( &self, request: ProfitTableRequest, ) -> Result<ProfitTableResponse>

Retrieve a summary of account Profit Table, according to given search criteria

Source

pub async fn p_2_p_advert_update( &self, request: P2pAdvertUpdateRequest, ) -> Result<P2pAdvertUpdateResponse>

Updates a P2P advert. Can only be used by the advertiser.

Source

pub async fn contracts_for( &self, request: ContractsForRequest, ) -> Result<ContractsForResponse>

For a given symbol, get the list of currently available contracts, and the latest barrier and duration limits for each contract.

Source

pub async fn verify_email( &self, request: VerifyEmailRequest, ) -> Result<VerifyEmailResponse>

Verify an email address for various purposes. The system will send an email to the address containing a security code for verification.

Source

pub async fn trading_servers( &self, request: TradingServersRequest, ) -> Result<TradingServersResponse>

Get the list of servers for a trading platform.

Source

pub async fn new_account_virtual( &self, request: NewAccountVirtualRequest, ) -> Result<NewAccountVirtualResponse>

Create a new virtual-money account.

Source

pub async fn payment_methods( &self, request: PaymentMethodsRequest, ) -> Result<PaymentMethodsResponse>

Will return a list payment methods available for the given country. If the request is authenticated the client's residence country will be used.

Source

pub async fn buy(&self, request: BuyRequest) -> Result<BuyResponse>

Buy a Contract

Source

pub async fn trading_times( &self, request: TradingTimesRequest, ) -> Result<TradingTimesResponse>

Receive a list of market opening times for a given date.

Source

pub async fn proposal_open_contract( &self, request: ProposalOpenContractRequest, ) -> Result<ProposalOpenContractResponse>

Get latest price (and other information) for a contract in the user's portfolio

Source

pub async fn mt_5_deposit( &self, request: Mt5DepositRequest, ) -> Result<Mt5DepositResponse>

This call allows deposit into MT5 account from Binary account.

Source

pub async fn p_2_p_order_cancel( &self, request: P2pOrderCancelRequest, ) -> Result<P2pOrderCancelResponse>

Cancel a P2P order.

Source

pub async fn new_partner_account( &self, request: NewPartnerAccountRequest, ) -> Result<NewPartnerAccountResponse>

This call opens a new Real-Partner Account

Source

pub async fn exchange_rates( &self, request: ExchangeRatesRequest, ) -> Result<ExchangeRatesResponse>

Retrieves the exchange rate from a base currency to a target currency supported by the system.

Source

pub async fn app_markup_statistics( &self, request: AppMarkupStatisticsRequest, ) -> Result<AppMarkupStatisticsResponse>

Retrieve statistics of `app_markup`.

Source

pub async fn p_2_p_advertiser_create( &self, request: P2pAdvertiserCreateRequest, ) -> Result<P2pAdvertiserCreateResponse>

Registers the client as a P2P advertiser.

Source

pub async fn set_self_exclusion( &self, request: SetSelfExclusionRequest, ) -> Result<SetSelfExclusionResponse>

Set Self-Exclusion (this call should be used in conjunction with `get_self_exclusion`)

Source

pub async fn economic_calendar( &self, request: EconomicCalendarRequest, ) -> Result<EconomicCalendarResponse>

Specify a currency to receive a list of events related to that specific currency. For example, specifying USD will return a list of USD-related events. If the currency is omitted, you will receive a list for all currencies.

Source

pub async fn get_self_exclusion( &self, request: GetSelfExclusionRequest, ) -> Result<GetSelfExclusionResponse>

Allows users to exclude themselves from the website for certain periods of time, or to set limits on their trading activities. This facility is a regulatory requirement for certain Landing Companies.

Source

pub async fn set_account_currency( &self, request: SetAccountCurrencyRequest, ) -> Result<SetAccountCurrencyResponse>

Set account currency, this will be default currency for your account i.e currency for trading, deposit. Please note that account currency can only be set once, and then can never be changed.

Source§

impl DerivClient

Source

pub async fn subscribe_p_2_p_order_create( &self, request: P2pOrderCreateRequest, ) -> Result<(P2pOrderCreateResponse, Subscription<P2pOrderInfoResponse>)>

Subscribe to Creates a P2P order for the specified advert.

Source

pub async fn subscribe_transaction( &self, request: TransactionRequest, ) -> Result<(TransactionResponse, Subscription<TransactionResponse>)>

Subscribe to Subscribe to transaction notifications

Source

pub async fn subscribe_ticks_batch( &self, request: TicksBatchRequest, ) -> Result<(TicksBatchResponse, Subscription<TicksBatchResponse>)>

Subscribe to Initiate a continuous stream of spot price updates for a group symbols.

Source

pub async fn subscribe_ticks( &self, request: TicksRequest, ) -> Result<(TicksResponse, Subscription<TicksResponse>)>

Subscribe to Initiate a continuous stream of spot price updates for a given symbol.

Source

pub async fn subscribe_p_2_p_advert_info( &self, request: P2pAdvertInfoRequest, ) -> Result<(P2pAdvertInfoResponse, Subscription<P2pAdvertInfoResponse>)>

Subscribe to Retrieve information about a P2P advert.

Source

pub async fn subscribe_p_2_p_settings( &self, request: P2pSettingsRequest, ) -> Result<(P2pSettingsResponse, Subscription<P2pSettingsResponse>)>

Subscribe to Request P2P Settings information.

Source

pub async fn subscribe_p_2_p_order_list( &self, request: P2pOrderListRequest, ) -> Result<(P2pOrderListResponse, Subscription<P2pOrderInfoResponse>)>

Subscribe to List active orders.

Source

pub async fn subscribe_website_status( &self, request: WebsiteStatusRequest, ) -> Result<(WebsiteStatusResponse, Subscription<WebsiteStatusResponse>)>

Subscribe to Request server status.

Source

pub async fn subscribe_p_2_p_advertiser_info( &self, request: P2pAdvertiserInfoRequest, ) -> Result<(P2pAdvertiserInfoResponse, Subscription<P2pAdvertiserInfoResponse>)>

Subscribe to Retrieve information about a P2P advertiser.

Source

pub async fn subscribe_balance( &self, request: BalanceRequest, ) -> Result<(BalanceResponse, Subscription<BalanceResponse>)>

Subscribe to Get user account balance

Source

pub async fn subscribe_p_2_p_order_info( &self, request: P2pOrderInfoRequest, ) -> Result<(P2pOrderInfoResponse, Subscription<P2pOrderInfoResponse>)>

Subscribe to Retrieves the information about a P2P order.

Source

pub async fn subscribe_crypto_estimations( &self, request: CryptoEstimationsRequest, ) -> Result<(CryptoEstimations, Subscription<CryptoEstimations>)>

Subscribe to Get the current estimations for cryptocurrencies. E.g. Withdrawal fee.

Source

pub async fn subscribe_proposal( &self, request: ProposalRequest, ) -> Result<(ProposalResponse, Subscription<ProposalResponse>)>

Subscribe to Gets latest price for a specific contract.

Source

pub async fn subscribe_ticks_history( &self, request: TicksHistoryRequest, ) -> Result<(TicksHistoryResponse, Subscription<TicksHistoryResponse>)>

Subscribe to Get historic tick data for a given symbol.

Source

pub async fn subscribe_buy( &self, request: BuyRequest, ) -> Result<(BuyResponse, Subscription<ProposalOpenContractResponse>)>

Subscribe to Buy a Contract

Source

pub async fn subscribe_proposal_open_contract( &self, request: ProposalOpenContractRequest, ) -> Result<(ProposalOpenContractResponse, Subscription<ProposalOpenContractResponse>)>

Subscribe to Get latest price (and other information) for a contract in the user’s portfolio

Source

pub async fn subscribe_exchange_rates( &self, request: ExchangeRatesRequest, ) -> Result<(ExchangeRatesResponse, Subscription<ExchangeRatesResponse>)>

Subscribe to Retrieves the exchange rate from a base currency to a target currency supported by the system.

Source

pub async fn subscribe_p_2_p_advertiser_create( &self, request: P2pAdvertiserCreateRequest, ) -> Result<(P2pAdvertiserCreateResponse, Subscription<P2pAdvertInfoResponse>)>

Subscribe to Registers the client as a P2P advertiser.

Source§

impl DerivClient

Source

pub fn new( endpoint: &str, app_id: i32, language: &str, origin: &str, config: Option<ClientConfig>, ) -> Result<Self>

Creates a new instance of DerivClient

Source

pub async fn connect(&mut self) -> Result<()>

Connects to the Deriv WebSocket API

Source

pub async fn disconnect(&mut self)

Disconnects from the Deriv WebSocket API

Source

pub async fn send_request<T, R>(&self, request: &T) -> Result<R>

Sends a request to the Deriv API and receives a response

Source

pub async fn create_subscription<T, R, S>( &self, request: &mut T, msg_type: &str, ) -> Result<(R, Subscription<S>)>

Creates a subscription from a subscription-enabled API

Trait Implementations§

Source§

impl Clone for DerivClient

Source§

fn clone(&self) -> DerivClient

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 DerivClient

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, 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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T