pub struct DeployBuilder {
pub contract: AccountId,
}Fields§
§contract: AccountIdImplementations§
Source§impl DeployBuilder
impl DeployBuilder
pub const fn new(contract: AccountId) -> Self
Sourcepub fn use_code(self, code: Vec<u8>) -> SetDeployActionBuilder
pub fn use_code(self, code: Vec<u8>) -> SetDeployActionBuilder
Prepares a transaction to deploy a contract to the provided account
The code is the wasm bytecode of the contract. For more information on how to compile your contract, please refer to the NEAR documentation.
§Example
use near_api::*;
let code = std::fs::read("path/to/your/contract.wasm")?;
let signer = Signer::new(Signer::from_ledger())?;
let result = Contract::deploy("contract.testnet".parse()?)
.use_code(code)
.without_init_call()
.with_signer(signer)
.send_to_testnet()
.await?;pub fn use_global_hash(self, global_hash: CryptoHash) -> SetDeployActionBuilder
pub fn use_global_account_id( self, global_account_id: AccountId, ) -> SetDeployActionBuilder
Trait Implementations§
Source§impl Clone for DeployBuilder
impl Clone for DeployBuilder
Source§fn clone(&self) -> DeployBuilder
fn clone(&self) -> DeployBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeployBuilder
impl RefUnwindSafe for DeployBuilder
impl Send for DeployBuilder
impl Sync for DeployBuilder
impl Unpin for DeployBuilder
impl UnwindSafe for DeployBuilder
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