pub struct CallBuilder { /* private fields */ }Expand description
Builder for configuring a function call within a transaction.
Created via TransactionBuilder::call. Allows setting args, gas, and deposit
before continuing to chain more actions or sending.
Implementations§
Source§impl CallBuilder
impl CallBuilder
Sourcepub fn args_borsh<A: BorshSerialize>(self, args: A) -> Self
pub fn args_borsh<A: BorshSerialize>(self, args: A) -> Self
Set Borsh-encoded arguments.
Sourcepub fn deposit(self, amount: impl IntoNearToken) -> Self
pub fn deposit(self, amount: impl IntoNearToken) -> Self
Sourcepub fn call(self, method: &str) -> CallBuilder
pub fn call(self, method: &str) -> CallBuilder
Add another function call.
Sourcepub fn create_account(self) -> TransactionBuilder
pub fn create_account(self) -> TransactionBuilder
Add a create account action.
Sourcepub fn transfer(self, amount: impl IntoNearToken) -> TransactionBuilder
pub fn transfer(self, amount: impl IntoNearToken) -> TransactionBuilder
Add a transfer action.
Sourcepub fn deploy(self, code: impl Into<Vec<u8>>) -> TransactionBuilder
pub fn deploy(self, code: impl Into<Vec<u8>>) -> TransactionBuilder
Add a deploy contract action.
Sourcepub fn add_full_access_key(self, public_key: PublicKey) -> TransactionBuilder
pub fn add_full_access_key(self, public_key: PublicKey) -> TransactionBuilder
Add a full access key.
Sourcepub fn add_function_call_key(
self,
public_key: PublicKey,
receiver_id: impl AsRef<str>,
method_names: Vec<String>,
allowance: Option<NearToken>,
) -> TransactionBuilder
pub fn add_function_call_key( self, public_key: PublicKey, receiver_id: impl AsRef<str>, method_names: Vec<String>, allowance: Option<NearToken>, ) -> TransactionBuilder
Add a function call access key.
Sourcepub fn delete_key(self, public_key: PublicKey) -> TransactionBuilder
pub fn delete_key(self, public_key: PublicKey) -> TransactionBuilder
Delete an access key.
Sourcepub fn delete_account(
self,
beneficiary_id: impl AsRef<str>,
) -> TransactionBuilder
pub fn delete_account( self, beneficiary_id: impl AsRef<str>, ) -> TransactionBuilder
Delete the account.
Sourcepub fn stake(
self,
amount: impl IntoNearToken,
public_key: PublicKey,
) -> TransactionBuilder
pub fn stake( self, amount: impl IntoNearToken, public_key: PublicKey, ) -> TransactionBuilder
Add a stake action.
Sourcepub fn publish_contract(
self,
code: impl Into<Vec<u8>>,
by_hash: bool,
) -> TransactionBuilder
pub fn publish_contract( self, code: impl Into<Vec<u8>>, by_hash: bool, ) -> TransactionBuilder
Publish a contract to the global registry.
Sourcepub fn deploy_from_hash(self, code_hash: CryptoHash) -> TransactionBuilder
pub fn deploy_from_hash(self, code_hash: CryptoHash) -> TransactionBuilder
Deploy a contract from the global registry by code hash.
Sourcepub fn deploy_from_publisher(
self,
publisher_id: impl AsRef<str>,
) -> TransactionBuilder
pub fn deploy_from_publisher( self, publisher_id: impl AsRef<str>, ) -> TransactionBuilder
Deploy a contract from the global registry by publisher account.
Sourcepub fn state_init_by_hash(
self,
code_hash: CryptoHash,
data: BTreeMap<Vec<u8>, Vec<u8>>,
deposit: impl IntoNearToken,
) -> TransactionBuilder
pub fn state_init_by_hash( self, code_hash: CryptoHash, data: BTreeMap<Vec<u8>, Vec<u8>>, deposit: impl IntoNearToken, ) -> TransactionBuilder
Create a NEP-616 deterministic state init action with code hash reference.
Sourcepub fn state_init_by_publisher(
self,
publisher_id: impl AsRef<str>,
data: BTreeMap<Vec<u8>, Vec<u8>>,
deposit: impl IntoNearToken,
) -> TransactionBuilder
pub fn state_init_by_publisher( self, publisher_id: impl AsRef<str>, data: BTreeMap<Vec<u8>, Vec<u8>>, deposit: impl IntoNearToken, ) -> TransactionBuilder
Create a NEP-616 deterministic state init action with publisher account reference.
Sourcepub fn sign_with(self, signer: impl Signer + 'static) -> TransactionBuilder
pub fn sign_with(self, signer: impl Signer + 'static) -> TransactionBuilder
Override the signer.
Sourcepub fn wait_until(self, status: TxExecutionStatus) -> TransactionBuilder
pub fn wait_until(self, status: TxExecutionStatus) -> TransactionBuilder
Set the execution wait level.
Sourcepub async fn delegate(
self,
options: DelegateOptions,
) -> Result<DelegateResult, Error>
pub async fn delegate( self, options: DelegateOptions, ) -> Result<DelegateResult, Error>
Build and sign a delegate action for meta-transactions (NEP-366).
This finishes the current function call and then creates a delegate action.
Sourcepub async fn sign_offline(
self,
block_hash: CryptoHash,
nonce: u64,
) -> Result<SignedTransaction, Error>
pub async fn sign_offline( self, block_hash: CryptoHash, nonce: u64, ) -> Result<SignedTransaction, Error>
Sign the transaction offline without network access.
See TransactionBuilder::sign_offline for details.
Sourcepub async fn sign(self) -> Result<SignedTransaction, Error>
pub async fn sign(self) -> Result<SignedTransaction, Error>
Sign the transaction without sending it.
See TransactionBuilder::sign for details.
Sourcepub fn send(self) -> TransactionSend
pub fn send(self) -> TransactionSend
Send the transaction.