pub struct GlobalWasmBuilder;Expand description
Builder for querying contract code from the global contract code storage defined in NEP-591.
Implementations§
Source§impl GlobalWasmBuilder
impl GlobalWasmBuilder
Sourcepub fn by_account_id(
&self,
account_id: AccountId,
) -> RequestBuilder<ViewCodeHandler>
pub fn by_account_id( &self, account_id: AccountId, ) -> RequestBuilder<ViewCodeHandler>
Prepares a query to fetch global contract code (Data<ContractCodeView>) by account ID.
§Example
use near_api::*;
let code = Contract::global_wasm()
.by_account_id("nft-contract.testnet".parse()?)
.fetch_from_testnet()
.await?;
println!("Code: {}", code.data.code_base64);Sourcepub fn by_hash(&self, code_hash: CryptoHash) -> RequestBuilder<ViewCodeHandler>
pub fn by_hash(&self, code_hash: CryptoHash) -> RequestBuilder<ViewCodeHandler>
Prepares a query to fetch global contract code (Data<ContractCodeView>) by hash.
§Example
use near_api::*;
let code = Contract::global_wasm()
.by_hash("DxfRbrjT3QPmoANMDYTR6iXPGJr7xRUyDnQhcAWjcoFF".parse()?)
.fetch_from_testnet()
.await?;
println!("Code: {}", code.data.code_base64);Auto Trait Implementations§
impl Freeze for GlobalWasmBuilder
impl RefUnwindSafe for GlobalWasmBuilder
impl Send for GlobalWasmBuilder
impl Sync for GlobalWasmBuilder
impl Unpin for GlobalWasmBuilder
impl UnwindSafe for GlobalWasmBuilder
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