TokenOwnerFinding

Trait TokenOwnerFinding 

Source
pub trait TokenOwnerFinding:
    Send
    + Sync
    + Debug {
    // Required method
    fn find_owner<'life0, 'async_trait>(
        &'life0 self,
        token: Address,
        min_balance: Balance,
    ) -> Pin<Box<dyn Future<Output = Result<Option<(Address, Balance)>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: '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§

Source

fn find_owner<'life0, 'async_trait>( &'life0 self, token: Address, min_balance: Balance, ) -> Pin<Box<dyn Future<Output = Result<Option<(Address, Balance)>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: '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, returns None. On failure, returns a string representing an error message.

Implementors§