pub struct Sdk {
pub network: Network,
/* private fields */
}Expand description
Dash Platform SDK
This is the main entry point for interacting with Dash Platform. It can be initialized in two modes:
Normal: Connects to a remote Dash Platform node.Mock: Uses a mock implementation of Dash Platform.
Recommended method of initialization is to use SdkBuilder. There are also some helper
methods:
SdkBuilder::new_testnet()Create a SdkBuilder that connects to testnet.SdkBuilder::new_mainnet()Create a SdkBuilder that connects to mainnet.SdkBuilder::new_mock()Create a mock SdkBuilder.Sdk::new_mock()Create a mock Sdk.
§Thread safety
Sdk is thread safe and can be shared between threads. It uses internal locking when needed.
It is also safe to clone the Sdk.
§Examples
See tests/ for examples of using the SDK.
Fields§
§network: NetworkThe network that the sdk is configured for (Dash (mainnet), Testnet, Devnet, Regtest)
Implementations§
Source§impl Sdk
impl Sdk
Sourcepub async fn start_instant_send_lock_stream(
&self,
from_block_hash: Vec<u8>,
address: &Address,
) -> Result<Streaming<TransactionsWithProofsResponse>, Error>
pub async fn start_instant_send_lock_stream( &self, from_block_hash: Vec<u8>, address: &Address, ) -> Result<Streaming<TransactionsWithProofsResponse>, Error>
Starts the stream to listen for instant send lock messages
Sourcepub async fn wait_for_asset_lock_proof_for_transaction(
&self,
stream: Streaming<TransactionsWithProofsResponse>,
transaction: &Transaction,
time_out: Option<Duration>,
) -> Result<AssetLockProof, Error>
pub async fn wait_for_asset_lock_proof_for_transaction( &self, stream: Streaming<TransactionsWithProofsResponse>, transaction: &Transaction, time_out: Option<Duration>, ) -> Result<AssetLockProof, Error>
Waits for a response for the asset lock proof
Source§impl Sdk
impl Sdk
Sourcepub async fn sync_address_balances<P: AddressProvider>(
&self,
provider: &mut P,
config: Option<AddressSyncConfig>,
last_sync_timestamp: Option<u64>,
) -> Result<AddressSyncResult, Error>
pub async fn sync_address_balances<P: AddressProvider>( &self, provider: &mut P, config: Option<AddressSyncConfig>, last_sync_timestamp: Option<u64>, ) -> Result<AddressSyncResult, Error>
Synchronize address balances using privacy-preserving trunk/branch chunk queries with incremental block-based catch-up.
This method discovers address balances for addresses supplied by the provider, using an iterative query process that fetches chunks of the address tree rather than individual addresses. This provides privacy by making it unclear which specific addresses are being queried.
After the tree scan, incremental catch-up fetches balance changes from the checkpoint height to chain tip so the result is as fresh as possible.
On subsequent calls, pass AddressSyncResult::new_sync_timestamp as
last_sync_timestamp so the function can decide whether a full tree
rescan is needed or incremental-only catch-up suffices. The provider
should implement AddressProvider::last_sync_height (returning the
stored AddressSyncResult::new_sync_height) and
AddressProvider::current_balances to supply state from the previous
sync.
§Arguments
provider: An implementation ofAddressProviderthat supplies addresses and handles callbacks when addresses are found or proven absent.config: Optional configuration; uses defaults ifNone.last_sync_timestamp: Optional block time (Unix seconds) from the previous sync’sAddressSyncResult::new_sync_timestamp. PassNoneto always perform a full tree scan.
§Returns
Ok(AddressSyncResult): Contains found addresses with balances/nonces, absent addresses,new_sync_heightandnew_sync_timestampto store for the next call.Err(Error): If the sync fails after exhausting retries.
§Example
use dash_sdk::{Sdk, platform::address_sync::{AddressProvider, AddressSyncConfig}};
// First sync — full tree scan + catch-up (no timestamp)
let result = sdk.sync_address_balances(&mut wallet, None, None).await?;
let saved_height = result.new_sync_height; // → provider.last_sync_height()
let saved_timestamp = result.new_sync_timestamp; // → last_sync_timestamp param
// Subsequent sync — incremental only if within threshold
let result = sdk.sync_address_balances(&mut wallet, None, Some(saved_timestamp)).await?;Source§impl Sdk
impl Sdk
Sourcepub async fn create_contact_request<F, Fut, G, Gut, H, Hut>(
&self,
input: ContactRequestInput,
ecdh_provider: EcdhProvider<F, Fut, G, Gut>,
get_extended_public_key: H,
) -> Result<ContactRequestResult, Error>
pub async fn create_contact_request<F, Fut, G, Gut, H, Hut>( &self, input: ContactRequestInput, ecdh_provider: EcdhProvider<F, Fut, G, Gut>, get_extended_public_key: H, ) -> Result<ContactRequestResult, Error>
Create a contact request document
This creates a local contact request document according to DIP-15 specification. The document is not yet submitted to the platform. This method automatically handles ECDH key derivation and encryption of the extended public key and account label.
§Arguments
input- The contact request input containing sender/recipient information and unencrypted dataecdh_provider- Provider for ECDH key exchange (client-side or SDK-side)get_extended_public_key- Async function to retrieve the extended public key to share with recipient- Parameters:
(account_reference: u32) - Returns: The unencrypted extended public key bytes (typically 78 bytes)
- Parameters:
§Returns
Returns a ContactRequestResult containing the created document
§Errors
Returns an error if:
- The DashPay contract cannot be fetched
- The contactRequest document type is not found
- The sender or recipient doesn’t have the required encryption keys
- ECDH encryption fails
- The shared secret, private key, or extended public key cannot be retrieved
Sourcepub async fn send_contact_request<S: Signer<IdentityPublicKey>, F, Fut, G, Gut, H, Hut>(
&self,
input: SendContactRequestInput<S>,
ecdh_provider: EcdhProvider<F, Fut, G, Gut>,
get_extended_public_key: H,
) -> Result<SendContactRequestResult, Error>
pub async fn send_contact_request<S: Signer<IdentityPublicKey>, F, Fut, G, Gut, H, Hut>( &self, input: SendContactRequestInput<S>, ecdh_provider: EcdhProvider<F, Fut, G, Gut>, get_extended_public_key: H, ) -> Result<SendContactRequestResult, Error>
Send a contact request to the platform
This creates a contact request document with automatic ECDH encryption and submits it to the platform as a state transition.
§Arguments
input- The send contact request input containing document data, key, and signerecdh_provider- Provider for ECDH key exchange (client-side or SDK-side)get_extended_public_key- Async function to retrieve the extended public key to share with recipient- Parameters:
(account_reference: u32) - Returns: The unencrypted extended public key bytes (typically 78 bytes)
- Parameters:
§Returns
Returns a SendContactRequestResult containing the submitted document
§Errors
Returns an error if:
- Document creation fails (including ECDH encryption)
- State transition submission fails
Source§impl Sdk
impl Sdk
Sourcepub async fn fetch_sent_contact_requests(
&self,
identity_id: Identifier,
limit: Option<u32>,
) -> Result<ContactRequestDocuments, Error>
pub async fn fetch_sent_contact_requests( &self, identity_id: Identifier, limit: Option<u32>, ) -> Result<ContactRequestDocuments, Error>
Fetch all contact requests sent by a specific identity
This queries the DashPay contract for contactRequest documents where the given identity is the owner (sender).
§Arguments
identity_id- The identity ID of the senderlimit- Maximum number of contact requests to fetch (default: 100)
§Returns
Returns a map of document IDs to optional contact request documents
Sourcepub async fn fetch_received_contact_requests(
&self,
identity_id: Identifier,
limit: Option<u32>,
) -> Result<ContactRequestDocuments, Error>
pub async fn fetch_received_contact_requests( &self, identity_id: Identifier, limit: Option<u32>, ) -> Result<ContactRequestDocuments, Error>
Fetch all contact requests received by a specific identity
This queries the DashPay contract for contactRequest documents where the given identity is the recipient (toUserId field).
§Arguments
identity_id- The identity ID of the recipientlimit- Maximum number of contact requests to fetch (default: 100)
§Returns
Returns a map of document IDs to optional contact request documents
Sourcepub async fn fetch_all_contact_requests_for_identity(
&self,
identity: &Identity,
limit: Option<u32>,
) -> Result<(ContactRequestDocuments, ContactRequestDocuments), Error>
pub async fn fetch_all_contact_requests_for_identity( &self, identity: &Identity, limit: Option<u32>, ) -> Result<(ContactRequestDocuments, ContactRequestDocuments), Error>
Fetch all contact requests for a specific identity (both sent and received)
This is a convenience method that fetches both sent and received contact requests for a given identity.
§Arguments
identity- The identity to fetch contact requests forlimit- Maximum number of contact requests to fetch per query (default: 100)
§Returns
Returns a tuple of (sent_requests, received_requests)
Source§impl Sdk
impl Sdk
Sourcepub async fn document_create<S: Signer<IdentityPublicKey>>(
&self,
create_document_transition_builder: DocumentCreateTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DocumentCreateResult, Error>
pub async fn document_create<S: Signer<IdentityPublicKey>>( &self, create_document_transition_builder: DocumentCreateTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DocumentCreateResult, Error>
Creates a new document on the platform.
This method broadcasts a document creation transition to add a new document to the specified data contract. The result contains the created document.
§Arguments
create_document_transition_builder- Builder containing document creation parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DocumentCreateResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Document validation fails
Source§impl Sdk
impl Sdk
Sourcepub async fn document_delete<S: Signer<IdentityPublicKey>>(
&self,
delete_document_transition_builder: DocumentDeleteTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DocumentDeleteResult, Error>
pub async fn document_delete<S: Signer<IdentityPublicKey>>( &self, delete_document_transition_builder: DocumentDeleteTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DocumentDeleteResult, Error>
Deletes an existing document from the platform.
This method broadcasts a document deletion transition to permanently remove a document from the platform. The result confirms the deletion.
§Arguments
delete_document_transition_builder- Builder containing document deletion parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DocumentDeleteResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Document not found or already deleted
- Insufficient permissions to delete the document
Source§impl Sdk
impl Sdk
Sourcepub async fn document_purchase<S: Signer<IdentityPublicKey>>(
&self,
purchase_document_transition_builder: DocumentPurchaseTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DocumentPurchaseResult, Error>
pub async fn document_purchase<S: Signer<IdentityPublicKey>>( &self, purchase_document_transition_builder: DocumentPurchaseTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DocumentPurchaseResult, Error>
Purchases a document from its current owner.
This method broadcasts a document purchase transition to buy a document at its set price and transfer ownership to the purchaser. The result contains the purchased document with updated ownership.
§Arguments
purchase_document_transition_builder- Builder containing purchase parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DocumentPurchaseResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Document not found or not for sale
- Insufficient funds to complete the purchase
- Price mismatch (document price changed)
- Invalid purchaser identity
Source§impl Sdk
impl Sdk
Sourcepub async fn document_replace<S: Signer<IdentityPublicKey>>(
&self,
replace_document_transition_builder: DocumentReplaceTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DocumentReplaceResult, Error>
pub async fn document_replace<S: Signer<IdentityPublicKey>>( &self, replace_document_transition_builder: DocumentReplaceTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DocumentReplaceResult, Error>
Replaces an existing document on the platform.
This method broadcasts a document replacement transition to update an existing document with new data. The result contains the updated document.
§Arguments
replace_document_transition_builder- Builder containing document replacement parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DocumentReplaceResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Document validation fails
- Document not found or revision mismatch
Source§impl Sdk
impl Sdk
Sourcepub async fn document_set_price<S: Signer<IdentityPublicKey>>(
&self,
set_price_document_transition_builder: DocumentSetPriceTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DocumentSetPriceResult, Error>
pub async fn document_set_price<S: Signer<IdentityPublicKey>>( &self, set_price_document_transition_builder: DocumentSetPriceTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DocumentSetPriceResult, Error>
Sets the price for a document on the platform.
This method broadcasts a document price update transition to set or change the price of an existing document. The result contains the updated document.
§Arguments
set_price_document_transition_builder- Builder containing price update parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DocumentSetPriceResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Document not found
- Insufficient permissions to set price
- Invalid price value
Source§impl Sdk
impl Sdk
Sourcepub async fn document_transfer<S: Signer<IdentityPublicKey>>(
&self,
transfer_document_transition_builder: DocumentTransferTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DocumentTransferResult, Error>
pub async fn document_transfer<S: Signer<IdentityPublicKey>>( &self, transfer_document_transition_builder: DocumentTransferTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DocumentTransferResult, Error>
Transfers ownership of a document to another identity.
This method broadcasts a document transfer transition to change the ownership of an existing document to a new identity. The result contains the transferred document.
§Arguments
transfer_document_transition_builder- Builder containing transfer parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DocumentTransferResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Document not found
- Insufficient permissions to transfer the document
- Invalid recipient identity
Source§impl Sdk
impl Sdk
Sourcepub async fn get_contested_dpns_normalized_usernames(
&self,
limit: Option<u32>,
start_after: Option<String>,
) -> Result<Vec<String>, Error>
pub async fn get_contested_dpns_normalized_usernames( &self, limit: Option<u32>, start_after: Option<String>, ) -> Result<Vec<String>, Error>
Sourcepub async fn get_contested_dpns_vote_state(
&self,
label: &str,
limit: Option<u32>,
) -> Result<Contenders, Error>
pub async fn get_contested_dpns_vote_state( &self, label: &str, limit: Option<u32>, ) -> Result<Contenders, Error>
Sourcepub async fn get_contested_dpns_voters_for_identity(
&self,
label: &str,
contestant_id: Identifier,
limit: Option<u32>,
) -> Result<(), Error>
pub async fn get_contested_dpns_voters_for_identity( &self, label: &str, contestant_id: Identifier, limit: Option<u32>, ) -> Result<(), Error>
Sourcepub async fn get_contested_dpns_identity_votes(
&self,
identity_id: Identifier,
limit: Option<u32>,
offset: Option<u16>,
) -> Result<Vec<ContestedDpnsUsername>, Error>
pub async fn get_contested_dpns_identity_votes( &self, identity_id: Identifier, limit: Option<u32>, offset: Option<u16>, ) -> Result<Vec<ContestedDpnsUsername>, Error>
Sourcepub async fn get_contested_dpns_usernames_by_identity(
&self,
identity_id: Identifier,
limit: Option<u32>,
) -> Result<Vec<ContestedDpnsUsername>, Error>
pub async fn get_contested_dpns_usernames_by_identity( &self, identity_id: Identifier, limit: Option<u32>, ) -> Result<Vec<ContestedDpnsUsername>, Error>
Sourcepub async fn get_contested_non_resolved_usernames(
&self,
limit: Option<u32>,
) -> Result<BTreeMap<String, ContestInfo>, Error>
pub async fn get_contested_non_resolved_usernames( &self, limit: Option<u32>, ) -> Result<BTreeMap<String, ContestInfo>, Error>
Get contested usernames that are not yet resolved
This method fetches all currently contested DPNS usernames that haven’t been resolved yet. It gets current contests and returns the contenders and end time for each unresolved name.
§Arguments
limit- Maximum number of results to return
§Returns
Returns a map of contested but unresolved DPNS usernames to their contest info (contenders and end time)
Sourcepub async fn get_non_resolved_dpns_contests_for_identity(
&self,
identity_id: Identifier,
limit: Option<u32>,
) -> Result<BTreeMap<String, ContestInfo>, Error>
pub async fn get_non_resolved_dpns_contests_for_identity( &self, identity_id: Identifier, limit: Option<u32>, ) -> Result<BTreeMap<String, ContestInfo>, Error>
Get non-resolved DPNS contests for a specific identity
This method fetches all currently contested DPNS usernames that haven’t been resolved yet and filters them to only include contests where the specified identity is a contender.
§Arguments
identity_id- The identity ID to filter contests forlimit- Maximum number of results to return
§Returns
Returns a map of contested but unresolved DPNS usernames (where the identity is a contender) to their contenders
Sourcepub async fn get_current_dpns_contests(
&self,
start_time: Option<TimestampMillis>,
end_time: Option<TimestampMillis>,
limit: Option<u16>,
) -> Result<BTreeMap<String, TimestampMillis>, Error>
pub async fn get_current_dpns_contests( &self, start_time: Option<TimestampMillis>, end_time: Option<TimestampMillis>, limit: Option<u16>, ) -> Result<BTreeMap<String, TimestampMillis>, Error>
Get current DPNS contests (active vote polls)
This method fetches all currently active DPNS username contests by querying vote polls by their end date. It automatically paginates through all results if there are more than the limit.
§Arguments
start_time- Optional start time to filter contests (in milliseconds)end_time- Optional end time to filter contests (in milliseconds)limit- Maximum number of results per query (defaults to 100)
§Returns
Returns a map of contested DPNS names to their end timestamps
Source§impl Sdk
impl Sdk
Sourcepub async fn get_dpns_usernames_by_identity(
&self,
identity_id: Identifier,
limit: Option<u32>,
) -> Result<Vec<DpnsUsername>, Error>
pub async fn get_dpns_usernames_by_identity( &self, identity_id: Identifier, limit: Option<u32>, ) -> Result<Vec<DpnsUsername>, Error>
Get DPNS usernames owned by a specific identity
This searches for domains where the identity is listed in records.identity. Note: This does not search for domains owned by the identity (no index on $ownerId)
§Arguments
identity_id- The identity ID to search forlimit- Maximum number of results to return (default: 10)
§Returns
Returns a list of DPNS usernames associated with the identity
Sourcepub async fn resolve_dpns_name_to_identity(
&self,
name: &str,
) -> Result<Option<Identifier>, Error>
pub async fn resolve_dpns_name_to_identity( &self, name: &str, ) -> Result<Option<Identifier>, Error>
Sourcepub async fn search_dpns_names(
&self,
prefix: &str,
limit: Option<u32>,
) -> Result<Vec<DpnsUsername>, Error>
pub async fn search_dpns_names( &self, prefix: &str, limit: Option<u32>, ) -> Result<Vec<DpnsUsername>, Error>
Source§impl Sdk
impl Sdk
Sourcepub async fn register_dpns_name<S: Signer<IdentityPublicKey>>(
&self,
input: RegisterDpnsNameInput<S>,
) -> Result<RegisterDpnsNameResult, Error>
pub async fn register_dpns_name<S: Signer<IdentityPublicKey>>( &self, input: RegisterDpnsNameInput<S>, ) -> Result<RegisterDpnsNameResult, Error>
Register a DPNS username in a single operation
This method handles both the preorder and domain registration steps automatically. It generates the necessary entropy, creates both documents, and submits them in order.
§Arguments
input- The registration input containing label, identity, public key, and signer
§Returns
Returns a RegisterDpnsNameResult containing both created documents and the full domain name
§Errors
Returns an error if:
- The DPNS contract cannot be fetched
- Document types are not found in the contract
- Document creation or submission fails
Sourcepub async fn resolve_dpns_name(
&self,
name: &str,
) -> Result<Option<Identifier>, Error>
pub async fn resolve_dpns_name( &self, name: &str, ) -> Result<Option<Identifier>, Error>
Source§impl Sdk
impl Sdk
Sourcepub async fn sync_nullifiers<P: NullifierProvider>(
&self,
provider: &P,
config: Option<NullifierSyncConfig>,
last_sync: Option<NullifierSyncCheckpoint>,
) -> Result<NullifierSyncResult, Error>
pub async fn sync_nullifiers<P: NullifierProvider>( &self, provider: &P, config: Option<NullifierSyncConfig>, last_sync: Option<NullifierSyncCheckpoint>, ) -> Result<NullifierSyncResult, Error>
Synchronize nullifier statuses with incremental catch-up support.
This is the main entry point for nullifier synchronization. It handles both full tree scans and incremental block-based catch-up, depending on the parameters.
On subsequent calls, construct a NullifierSyncCheckpoint from the
previous NullifierSyncResult::new_sync_height and
NullifierSyncResult::new_sync_timestamp so the function can decide
whether a full tree rescan is needed or incremental-only catch-up
suffices.
§Arguments
provider: An implementation ofNullifierProviderthat supplies nullifier keys.config: Optional configuration; uses defaults ifNone.last_sync: Optional checkpoint from the previous sync. PassNoneto always perform a full tree scan.
§Returns
Ok(NullifierSyncResult): Contains found (spent) and absent (unspent) nullifiers,new_sync_heightandnew_sync_timestampto store for the next call.Err(Error): If the sync fails after exhausting retries.
§Example
use dash_sdk::Sdk;
use dash_sdk::platform::nullifier_sync::NullifierSyncCheckpoint;
let sdk = Sdk::new(/* ... */);
let nullifiers: Vec<[u8; 32]> = vec![/* known nullifiers */];
// First call — full scan
let result = sdk.sync_nullifiers(&nullifiers, None, None).await?;
let checkpoint = NullifierSyncCheckpoint {
height: result.new_sync_height,
timestamp: result.new_sync_timestamp,
};
// Next call — incremental only if within threshold
let result = sdk.sync_nullifiers(&nullifiers, None, Some(checkpoint)).await?;Source§impl Sdk
impl Sdk
Sourcepub async fn token_burn<S: Signer<IdentityPublicKey>>(
&self,
burn_tokens_transition_builder: TokenBurnTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<BurnResult, Error>
pub async fn token_burn<S: Signer<IdentityPublicKey>>( &self, burn_tokens_transition_builder: TokenBurnTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<BurnResult, Error>
Burns tokens to permanently remove them from circulation.
This method broadcasts a burn transition to destroy a specified amount of tokens. The result varies based on token configuration:
- Standard tokens return the owner’s remaining balance
- Tokens with history tracking return documents
- Group-managed tokens include group power and action status
§Arguments
burn_tokens_transition_builder- Builder containing burn parameters including amountsigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a BurnResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Insufficient token balance for burning
Source§impl Sdk
impl Sdk
Sourcepub async fn token_claim<S: Signer<IdentityPublicKey>>(
&self,
claim_tokens_transition_builder: TokenClaimTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<ClaimResult, Error>
pub async fn token_claim<S: Signer<IdentityPublicKey>>( &self, claim_tokens_transition_builder: TokenClaimTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<ClaimResult, Error>
Claims tokens for a specific identity.
This method broadcasts a claim transition to acquire ownership of tokens that have been allocated or made available for claiming. The result includes a document that records the claim details.
§Arguments
claim_tokens_transition_builder- Builder containing claim parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a ClaimResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- A group action result is missing the expected document
Source§impl Sdk
impl Sdk
Sourcepub async fn token_update_contract_token_configuration<S: Signer<IdentityPublicKey>>(
&self,
config_update_transition_builder: TokenConfigUpdateTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<ConfigUpdateResult, Error>
pub async fn token_update_contract_token_configuration<S: Signer<IdentityPublicKey>>( &self, config_update_transition_builder: TokenConfigUpdateTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<ConfigUpdateResult, Error>
Updates the configuration of a token contract.
This method broadcasts a configuration update transition to modify token settings such as minting rules, transfer restrictions, or other contract parameters. The result always includes a document with the updated configuration details.
§Arguments
config_update_transition_builder- Builder containing configuration update parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a ConfigUpdateResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- A group action result is missing the expected document
Source§impl Sdk
impl Sdk
Sourcepub async fn token_destroy_frozen_funds<S: Signer<IdentityPublicKey>>(
&self,
destroy_frozen_funds_transition_builder: TokenDestroyFrozenFundsTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DestroyFrozenFundsResult, Error>
pub async fn token_destroy_frozen_funds<S: Signer<IdentityPublicKey>>( &self, destroy_frozen_funds_transition_builder: TokenDestroyFrozenFundsTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DestroyFrozenFundsResult, Error>
Destroys frozen tokens permanently.
This method broadcasts a destroy frozen funds transition to permanently remove frozen tokens from circulation. This operation always maintains a historical record of the destruction.
§Arguments
destroy_frozen_funds_transition_builder- Builder containing destruction parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DestroyFrozenFundsResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
Source§impl Sdk
impl Sdk
Sourcepub async fn token_purchase<S: Signer<IdentityPublicKey>>(
&self,
purchase_tokens_transition_builder: TokenDirectPurchaseTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<DirectPurchaseResult, Error>
pub async fn token_purchase<S: Signer<IdentityPublicKey>>( &self, purchase_tokens_transition_builder: TokenDirectPurchaseTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<DirectPurchaseResult, Error>
Purchases tokens directly at the configured price.
This method broadcasts a direct purchase transition to buy tokens at the price set by the token owner. The purchase uses platform credits as payment. The result varies based on token configuration:
- Standard tokens return the purchaser’s new balance
- Tokens with history tracking return documents
- Group-managed tokens include group power information
§Arguments
purchase_tokens_transition_builder- Builder containing purchase parameters including amountsigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a DirectPurchaseResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- Insufficient credits for the purchase
Source§impl Sdk
impl Sdk
Sourcepub async fn token_emergency_action<S: Signer<IdentityPublicKey>>(
&self,
emergency_action_transition_builder: TokenEmergencyActionTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<EmergencyActionResult, Error>
pub async fn token_emergency_action<S: Signer<IdentityPublicKey>>( &self, emergency_action_transition_builder: TokenEmergencyActionTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<EmergencyActionResult, Error>
Executes an emergency action on a token contract.
This method broadcasts an emergency action transition for critical token management operations that require group authorization. Emergency actions are typically used for scenarios like halting trading, recovering from critical bugs, or other urgent interventions.
§Arguments
emergency_action_transition_builder- Builder containing emergency action parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing an EmergencyActionResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
- The group authorization is insufficient
Source§impl Sdk
impl Sdk
Sourcepub async fn token_freeze<S: Signer<IdentityPublicKey>>(
&self,
freeze_tokens_transition_builder: TokenFreezeTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<FreezeResult, Error>
pub async fn token_freeze<S: Signer<IdentityPublicKey>>( &self, freeze_tokens_transition_builder: TokenFreezeTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<FreezeResult, Error>
Freezes tokens for a specific identity.
This method broadcasts a freeze transition to temporarily lock tokens, preventing their transfer until they are unfrozen. The result varies based on token configuration:
- Standard tokens return identity info
- Tokens with history tracking return documents
- Group-managed tokens include group power information
§Arguments
freeze_tokens_transition_builder- Builder containing freeze parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a FreezeResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
Source§impl Sdk
impl Sdk
Sourcepub async fn token_mint<S: Signer<IdentityPublicKey>>(
&self,
mint_tokens_transition_builder: TokenMintTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<MintResult, Error>
pub async fn token_mint<S: Signer<IdentityPublicKey>>( &self, mint_tokens_transition_builder: TokenMintTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<MintResult, Error>
Mints new tokens according to the token’s configuration.
This method broadcasts a mint transition to create new tokens and allocate them to the specified recipient. The result varies based on token configuration:
- Standard tokens return the recipient’s new balance
- Tokens with history tracking return documents
- Group-managed tokens include group power and action status
§Arguments
mint_tokens_transition_builder- Builder containing mint parameters including amount and recipientsigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a MintResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
Source§impl Sdk
impl Sdk
Sourcepub async fn token_set_price_for_direct_purchase<S: Signer<IdentityPublicKey>>(
&self,
set_price_transition_builder: TokenChangeDirectPurchasePriceTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<SetPriceResult, Error>
pub async fn token_set_price_for_direct_purchase<S: Signer<IdentityPublicKey>>( &self, set_price_transition_builder: TokenChangeDirectPurchasePriceTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<SetPriceResult, Error>
Sets or updates the pricing schedule for direct token purchases.
This method broadcasts a set price transition to define how tokens can be purchased directly. The pricing schedule can include fixed prices or dynamic pricing rules. The result varies based on token configuration:
- Standard tokens return the pricing schedule
- Tokens with history tracking return documents
- Group-managed tokens include group power and action status
§Arguments
set_price_transition_builder- Builder containing pricing parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a SetPriceResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
Source§impl Sdk
impl Sdk
Sourcepub async fn token_transfer<S: Signer<IdentityPublicKey>>(
&self,
transfer_tokens_transition_builder: TokenTransferTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<TransferResult, Error>
pub async fn token_transfer<S: Signer<IdentityPublicKey>>( &self, transfer_tokens_transition_builder: TokenTransferTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<TransferResult, Error>
Transfers tokens from one identity to another.
This method broadcasts a transfer transition to move tokens between identities. The result varies based on token configuration:
- Standard tokens return updated balances for the affected identities
- Tokens with history tracking return documents
- Group-managed tokens include group power information
§Arguments
transfer_tokens_transition_builder- Builder containing transfer parameters including recipient and amountsigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing a TransferResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
Source§impl Sdk
impl Sdk
Sourcepub async fn token_unfreeze_identity<S: Signer<IdentityPublicKey>>(
&self,
unfreeze_tokens_transition_builder: TokenUnfreezeTransitionBuilder,
signing_key: &IdentityPublicKey,
signer: &S,
) -> Result<UnfreezeResult, Error>
pub async fn token_unfreeze_identity<S: Signer<IdentityPublicKey>>( &self, unfreeze_tokens_transition_builder: TokenUnfreezeTransitionBuilder, signing_key: &IdentityPublicKey, signer: &S, ) -> Result<UnfreezeResult, Error>
Unfreezes tokens for a specific identity.
This method broadcasts an unfreeze transition to restore transfer capabilities for previously frozen tokens. The result varies based on token configuration:
- Standard tokens return identity info
- Tokens with history tracking return documents
- Group-managed tokens include group power information
§Arguments
unfreeze_tokens_transition_builder- Builder containing unfreeze parameterssigning_key- The identity public key for signing the transitionsigner- Implementation of the Signer trait for cryptographic signing
§Returns
Returns a Result containing an UnfreezeResult on success, or an Error on failure.
§Errors
This function will return an error if:
- The transition signing fails
- Broadcasting the transition fails
- The proof verification returns an unexpected result type
Source§impl Sdk
impl Sdk
Sourcepub fn new_mock() -> Self
pub fn new_mock() -> Self
Initialize Dash Platform SDK in mock mode.
This is a helper method that uses SdkBuilder to initialize the SDK in mock mode.
See also SdkBuilder.
Sourcepub fn verify_response_metadata(
&self,
method_name: &str,
metadata: &ResponseMetadata,
) -> Result<(), Error>
pub fn verify_response_metadata( &self, method_name: &str, metadata: &ResponseMetadata, ) -> Result<(), Error>
Verify response metadata against the current state of the SDK.
Sourcepub fn context_provider(&self) -> Option<impl ContextProvider>
pub fn context_provider(&self) -> Option<impl ContextProvider>
Return ContextProvider used by the SDK.
Sourcepub fn mock(&mut self) -> MutexGuard<'_, MockDashPlatformSdk>
pub fn mock(&mut self) -> MutexGuard<'_, MockDashPlatformSdk>
Returns a mutable reference to the MockDashPlatformSdk instance.
Use returned object to configure mock responses with methods like expect_fetch.
§Panics
Panics when:
- the
selfinstance is not aMockvariant, - the
selfinstance is in use by another thread.
Sourcepub async fn get_identity_nonce(
&self,
identity_id: Identifier,
bump_first: bool,
settings: Option<PutSettings>,
) -> Result<IdentityNonce, Error>
pub async fn get_identity_nonce( &self, identity_id: Identifier, bump_first: bool, settings: Option<PutSettings>, ) -> Result<IdentityNonce, Error>
Get or fetch identity nonce, querying Platform when stale or absent.
Treats a missing nonce as 0 before applying the optional bump; on first
interaction this may return 0 or 1 depending on bump_first. Does not
verify identity existence.
Sourcepub async fn get_identity_contract_nonce(
&self,
identity_id: Identifier,
contract_id: Identifier,
bump_first: bool,
settings: Option<PutSettings>,
) -> Result<IdentityNonce, Error>
pub async fn get_identity_contract_nonce( &self, identity_id: Identifier, contract_id: Identifier, bump_first: bool, settings: Option<PutSettings>, ) -> Result<IdentityNonce, Error>
Get or fetch identity-contract nonce, querying Platform when stale or absent.
Treats a missing nonce as 0 before applying the optional bump; on first
interaction this may return 0 or 1 depending on bump_first. Does not
verify identity or contract existence.
Sourcepub async fn refresh_identity_nonce(&self, identity_id: &Identifier)
pub async fn refresh_identity_nonce(&self, identity_id: &Identifier)
Marks identity nonce cache entries as stale so they are re-fetched from
Platform on the next call to [get_identity_nonce] or
[get_identity_contract_nonce].
Sourcepub fn version<'v>(&self) -> &'v PlatformVersion
pub fn version<'v>(&self) -> &'v PlatformVersion
Return Dash Platform version information used by this SDK.
This is the version configured in SdkBuilder.
Useful whenever you need to provide PlatformVersion to other SDK and DPP methods.
Sourcepub fn set_context_provider<C: ContextProvider + 'static>(
&self,
context_provider: C,
)
pub fn set_context_provider<C: ContextProvider + 'static>( &self, context_provider: C, )
Set the ContextProvider to use.
ContextProvider is used to access state information, like data contracts and quorum public keys.
Note that this will overwrite any previous context provider.
Sourcepub fn cancelled(&self) -> WaitForCancellationFuture<'_>
pub fn cancelled(&self) -> WaitForCancellationFuture<'_>
Returns a future that resolves when the Sdk is cancelled (e.g. shutdown was requested).
Sourcepub fn address_list(&self) -> &AddressList
pub fn address_list(&self) -> &AddressList
Return the DapiClient address list
Trait Implementations§
Source§impl DapiRequestExecutor for Sdk
impl DapiRequestExecutor for Sdk
Source§fn execute<'life0, 'async_trait, R>(
&'life0 self,
request: R,
settings: RequestSettings,
) -> Pin<Box<dyn Future<Output = ExecutionResult<R::Response, DapiClientError>> + Send + 'async_trait>>where
R: 'async_trait + TransportRequest,
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait, R>(
&'life0 self,
request: R,
settings: RequestSettings,
) -> Pin<Box<dyn Future<Output = ExecutionResult<R::Response, DapiClientError>> + Send + 'async_trait>>where
R: 'async_trait + TransportRequest,
Self: 'async_trait,
'life0: 'async_trait,
Source§impl ShieldFromAssetLock for Sdk
impl ShieldFromAssetLock for Sdk
Source§fn shield_from_asset_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
asset_lock_proof: AssetLockProof,
asset_lock_proof_private_key: &'life1 [u8],
bundle: OrchardBundleParams,
value_balance: u64,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn shield_from_asset_lock<'life0, 'life1, 'async_trait>(
&'life0 self,
asset_lock_proof: AssetLockProof,
asset_lock_proof_private_key: &'life1 [u8],
bundle: OrchardBundleParams,
value_balance: u64,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<S: Signer<PlatformAddress>> ShieldFunds<S> for Sdk
impl<S: Signer<PlatformAddress>> ShieldFunds<S> for Sdk
Source§fn shield_funds<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, Credits>,
bundle: OrchardBundleParams,
amount: u64,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn shield_funds<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, Credits>,
bundle: OrchardBundleParams,
amount: u64,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn shield_funds_with_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, (AddressNonce, Credits)>,
bundle: OrchardBundleParams,
amount: u64,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn shield_funds_with_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, (AddressNonce, Credits)>,
bundle: OrchardBundleParams,
amount: u64,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<S: Signer<PlatformAddress>> TransferAddressFunds<S> for Sdk
impl<S: Signer<PlatformAddress>> TransferAddressFunds<S> for Sdk
Source§fn transfer_address_funds<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, Credits>,
outputs: BTreeMap<PlatformAddress, Credits>,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transfer_address_funds<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, Credits>,
outputs: BTreeMap<PlatformAddress, Credits>,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn transfer_address_funds_with_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, (AddressNonce, Credits)>,
outputs: BTreeMap<PlatformAddress, Credits>,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transfer_address_funds_with_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, (AddressNonce, Credits)>,
outputs: BTreeMap<PlatformAddress, Credits>,
fee_strategy: AddressFundsFeeStrategy,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl TransferShielded for Sdk
impl TransferShielded for Sdk
Source§fn transfer_shielded<'life0, 'async_trait>(
&'life0 self,
bundle: OrchardBundleParams,
value_balance: u64,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transfer_shielded<'life0, 'async_trait>(
&'life0 self,
bundle: OrchardBundleParams,
value_balance: u64,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl UnshieldFunds for Sdk
impl UnshieldFunds for Sdk
Source§fn unshield_funds<'life0, 'async_trait>(
&'life0 self,
output_address: PlatformAddress,
unshielding_amount: u64,
bundle: OrchardBundleParams,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unshield_funds<'life0, 'async_trait>(
&'life0 self,
output_address: PlatformAddress,
unshielding_amount: u64,
bundle: OrchardBundleParams,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl<S: Signer<PlatformAddress>> WithdrawAddressFunds<S> for Sdk
impl<S: Signer<PlatformAddress>> WithdrawAddressFunds<S> for Sdk
Source§fn withdraw_address_funds<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, Credits>,
change_output: Option<(PlatformAddress, Credits)>,
fee_strategy: AddressFundsFeeStrategy,
core_fee_per_byte: u32,
pooling: Pooling,
output_script: CoreScript,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn withdraw_address_funds<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, Credits>,
change_output: Option<(PlatformAddress, Credits)>,
fee_strategy: AddressFundsFeeStrategy,
core_fee_per_byte: u32,
pooling: Pooling,
output_script: CoreScript,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn withdraw_address_funds_with_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, (AddressNonce, Credits)>,
change_output: Option<(PlatformAddress, Credits)>,
fee_strategy: AddressFundsFeeStrategy,
core_fee_per_byte: u32,
pooling: Pooling,
output_script: CoreScript,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn withdraw_address_funds_with_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: BTreeMap<PlatformAddress, (AddressNonce, Credits)>,
change_output: Option<(PlatformAddress, Credits)>,
fee_strategy: AddressFundsFeeStrategy,
core_fee_per_byte: u32,
pooling: Pooling,
output_script: CoreScript,
signer: &'life1 S,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<AddressInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl WithdrawShielded for Sdk
impl WithdrawShielded for Sdk
Source§fn withdraw_shielded<'life0, 'async_trait>(
&'life0 self,
unshielding_amount: u64,
bundle: OrchardBundleParams,
core_fee_per_byte: u32,
pooling: Pooling,
output_script: CoreScript,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn withdraw_shielded<'life0, 'async_trait>(
&'life0 self,
unshielding_amount: u64,
bundle: OrchardBundleParams,
core_fee_per_byte: u32,
pooling: Pooling,
output_script: CoreScript,
settings: Option<PutSettings>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for Sdk
impl !RefUnwindSafe for Sdk
impl Send for Sdk
impl Sync for Sdk
impl Unpin for Sdk
impl !UnwindSafe for Sdk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> CostsExt for T
impl<T> CostsExt for T
§fn wrap_with_cost(self, cost: OperationCost) -> CostContext<Self>where
Self: Sized,
fn wrap_with_cost(self, cost: OperationCost) -> CostContext<Self>where
Self: Sized,
CostContext object with provided costs.§fn wrap_fn_cost(
self,
f: impl FnOnce(&Self) -> OperationCost,
) -> CostContext<Self>where
Self: Sized,
fn wrap_fn_cost(
self,
f: impl FnOnce(&Self) -> OperationCost,
) -> CostContext<Self>where
Self: Sized,
CostContext object with costs computed using the
value getting wrapped.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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§impl<T, U> IntoOnNetwork<U> for Twhere
U: FromOnNetwork<T>,
impl<T, U> IntoOnNetwork<U> for Twhere
U: FromOnNetwork<T>,
§fn into_on_network(self, network: Network) -> U
fn into_on_network(self, network: Network) -> U
Calls U::from_on_network(self).
Source§impl<T, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
impl<T, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
Source§fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.