pub struct NodeProvider {
pub base_url: String,
/* private fields */
}Expand description
Node provider for interacting with Alephium node
Fields§
§base_url: StringImplementations§
Source§impl NodeProvider
impl NodeProvider
Sourcepub fn with_api_key(
base_url: impl Into<String>,
api_key: impl Into<String>,
) -> Result<Self>
pub fn with_api_key( base_url: impl Into<String>, api_key: impl Into<String>, ) -> Result<Self>
Create a new node provider with API key
Sourcepub async fn get_node_info(&self) -> Result<NodeInfo>
pub async fn get_node_info(&self) -> Result<NodeInfo>
Get node info
Sourcepub async fn get_blockchain_info(&self) -> Result<BlockchainInfo>
pub async fn get_blockchain_info(&self) -> Result<BlockchainInfo>
Get blockchain info
Sourcepub async fn get_address_balance(
&self,
address: &Address,
) -> Result<AddressBalance>
pub async fn get_address_balance( &self, address: &Address, ) -> Result<AddressBalance>
Get address balance
Sourcepub async fn get_address_group(&self, address: &Address) -> Result<AddressGroup>
pub async fn get_address_group(&self, address: &Address) -> Result<AddressGroup>
Get address group
Sourcepub async fn get_address_utxos(&self, address: &Address) -> Result<AddressUtxos>
pub async fn get_address_utxos(&self, address: &Address) -> Result<AddressUtxos>
Get UTXOs for an address
Sourcepub async fn get_transaction_status(
&self,
tx_id: &str,
) -> Result<TransactionStatus>
pub async fn get_transaction_status( &self, tx_id: &str, ) -> Result<TransactionStatus>
Get transaction status
Sourcepub async fn submit_transaction(&self, tx: &Transaction) -> Result<SubmitResult>
pub async fn submit_transaction(&self, tx: &Transaction) -> Result<SubmitResult>
Submit a signed transaction
Sourcepub async fn build_transfer_transaction(
&self,
params: BuildTransferTxParams,
) -> Result<UnsignedTransaction>
pub async fn build_transfer_transaction( &self, params: BuildTransferTxParams, ) -> Result<UnsignedTransaction>
Build transfer transaction
Sourcepub async fn compile_contract(&self, code: &str) -> Result<CompileResult>
pub async fn compile_contract(&self, code: &str) -> Result<CompileResult>
Compile contract
Sourcepub async fn compile_script(&self, code: &str) -> Result<CompileResult>
pub async fn compile_script(&self, code: &str) -> Result<CompileResult>
Compile script
Sourcepub async fn get_contract_events(
&self,
contract_address: &Address,
) -> Result<ContractEvents>
pub async fn get_contract_events( &self, contract_address: &Address, ) -> Result<ContractEvents>
Get contract events
Sourcepub async fn call_contract(
&self,
params: CallContractParams,
) -> Result<CallContractResult>
pub async fn call_contract( &self, params: CallContractParams, ) -> Result<CallContractResult>
Call contract method (read-only)
Auto Trait Implementations§
impl !RefUnwindSafe for NodeProvider
impl !UnwindSafe for NodeProvider
impl Freeze for NodeProvider
impl Send for NodeProvider
impl Sync for NodeProvider
impl Unpin for NodeProvider
impl UnsafeUnpin for NodeProvider
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
Mutably borrows from an owned value. Read more