pub struct Jib { /* private fields */ }
Expand description
The Jib struct is the main entry point for the library. It is used to create a new Jib instance, set the RPC URL, set the instructions, pack the instructions into transactions and finally submit the transactions to the network.
Implementations§
source§impl Jib
impl Jib
sourcepub fn new(signers: Vec<Keypair>, network: Network) -> Result<Self, JibError>
pub fn new(signers: Vec<Keypair>, network: Network) -> Result<Self, JibError>
Create a new Jib instance. You should pass in all the signers you want to use for the transactions.
sourcepub fn set_rpc_url(&mut self, url: &str)
pub fn set_rpc_url(&mut self, url: &str)
Set the RPC URL to use for the transactions. This defaults to the public devnet URL.
sourcepub fn set_instructions(&mut self, ixes: Vec<Instruction>)
pub fn set_instructions(&mut self, ixes: Vec<Instruction>)
Set the instructions to use for the transactions. This should be a vector of instructions that you wish to submit to the network.
sourcepub fn set_signers(&mut self, signers: Vec<Keypair>)
pub fn set_signers(&mut self, signers: Vec<Keypair>)
Set the signers to use for the transactions. This should be a vector of signers that you wish to use to sign the transactions.
sourcepub fn rpc_client(&self) -> &RpcClient
pub fn rpc_client(&self) -> &RpcClient
Get the RPC client that is being used by the Jib instance.
sourcepub fn payer(&self) -> &Keypair
pub fn payer(&self) -> &Keypair
Get the first signer that is being used by the Jib instance, the transaction fee payer.
sourcepub fn pack(&mut self) -> Result<Vec<Transaction>, JibError>
pub fn pack(&mut self) -> Result<Vec<Transaction>, JibError>
Pack the instructions into transactions. This will return a vector of transactions that can be submitted to the network.
sourcepub fn hoist(&mut self) -> Result<Vec<JibResult>, JibError>
pub fn hoist(&mut self) -> Result<Vec<JibResult>, JibError>
Pack the instructions into transactions and submit them to the network via the TPU client. This will display a spinner while the transactions are being submitted.
sourcepub fn submit_packed_transactions(
self,
transactions: Vec<Transaction>
) -> Result<Vec<JibResult>, JibError>
pub fn submit_packed_transactions( self, transactions: Vec<Transaction> ) -> Result<Vec<JibResult>, JibError>
Submit pre-packed transactions to the network via the TPU client. This will display a spinner while the transactions are being submitted.