Struct avalanche_sdk::wallet::Wallet
source · [−]pub struct Wallet<T: ReadOnly + SignOnly> {Show 20 fields
pub http_rpc: String,
pub network_id: u32,
pub network_name: String,
pub keychain: Keychain<T>,
pub ethers_signing_key: SigningKey,
pub local_wallet: LocalWallet,
pub evm_provider: Provider<Http>,
pub evm_url_path: String,
pub h160_address: H160,
pub x_address: String,
pub p_address: String,
pub c_address: String,
pub short_address: Id,
pub eth_address: String,
pub x_chain_id: Id,
pub p_chain_id: Id,
pub c_chain_id: Id,
pub evm_chain_id_u256: U256,
pub tx_fee: u64,
pub avax_asset_id: Id,
}
Fields
http_rpc: String
network_id: u32
network_name: String
keychain: Keychain<T>
ethers_signing_key: SigningKey
local_wallet: LocalWallet
evm_provider: Provider<Http>
evm_url_path: String
h160_address: H160
x_address: String
p_address: String
c_address: String
short_address: Id
eth_address: String
x_chain_id: Id
p_chain_id: Id
c_chain_id: Id
evm_chain_id_u256: U256
tx_fee: u64
avax_asset_id: Id
Implementations
sourceimpl<T> Wallet<T>where
T: ReadOnly + SignOnly + Clone,
impl<T> Wallet<T>where
T: ReadOnly + SignOnly + Clone,
sourcepub async fn get_utxos_p(&self) -> Result<Vec<Utxo>>
pub async fn get_utxos_p(&self) -> Result<Vec<Utxo>>
Fetches UTXOs for “P” chain. TODO: cache this like avalanchego
pub async fn get_balance_p(&self) -> Result<u64>
sourcepub async fn add_validator(
&self,
node_id: Id,
stake_amount: u64,
validate_start: DateTime<Utc>,
validate_end: DateTime<Utc>,
validate_reward_fee_percent: u32
) -> Result<()>
pub async fn add_validator(
&self,
node_id: Id,
stake_amount: u64,
validate_start: DateTime<Utc>,
validate_end: DateTime<Utc>,
validate_reward_fee_percent: u32
) -> Result<()>
Adds a node as a validator. ref. https://github.com/ava-labs/avalanchego/blob/v1.7.9/vms/platformvm/add_validator_tx.go ref. https://github.com/ava-labs/avalanchego/blob/v1.7.9/vms/platformvm/spend.go ref. https://github.com/ava-labs/avalanchego/blob/v1.7.9/wallet/chain/p/builder.go ref. https://github.com/ava-labs/subnet-cli/blob/6bbe9f4aff353b812822af99c08133af35dbc6bd/client/p.go “AddValidator”
sourceimpl<T> Wallet<T>where
T: ReadOnly + SignOnly + Clone,
impl<T> Wallet<T>where
T: ReadOnly + SignOnly + Clone,
sourcepub async fn get_utxos_x(&self) -> Result<Vec<Utxo>>
pub async fn get_utxos_x(&self) -> Result<Vec<Utxo>>
Fetches UTXOs for “X” chain. TODO: cache this like avalanchego
pub async fn get_balance_x(&self) -> Result<u64>
pub async fn transfer_x_avax(
&self,
http_rpc: Option<String>,
receiver_short_addr: Id,
amount_to_transfer: u64,
check_acceptance: bool
) -> Result<()>
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Wallet<T>
impl<T> Send for Wallet<T>where
T: Send,
impl<T> Sync for Wallet<T>where
T: Sync,
impl<T> Unpin for Wallet<T>where
T: Unpin,
impl<T> !UnwindSafe for Wallet<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request