pub trait TokenOwnerFinding:
Send
+ Sync
+ Debug {
// Required method
fn find_owner<'life0, 'async_trait>(
&'life0 self,
token: Bytes,
min_balance: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, Bytes)>, String>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Trait for finding an address that owns a specific token. This is useful for detecting bad tokens by identifying addresses with enough balance to simulate transactions.
Required Methods§
Sourcefn find_owner<'life0, 'async_trait>(
&'life0 self,
token: Bytes,
min_balance: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, Bytes)>, String>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn find_owner<'life0, 'async_trait>(
&'life0 self,
token: Bytes,
min_balance: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, Bytes)>, String>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Finds an address that holds at least min_balance of the specified token.
§Parameters
token- The address of the token to search for.min_balance- The minimum balance required for the address to be considered.
§Returns
A result containing:
Option<(Address, Balance)>- The address and its actual balance if an owner is found. If no address meets the criteria, returnsNone. On failure, returns a string representing an error message.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".