pub struct Contract { /* private fields */ }
Expand description

Contract is directly associated to a contract in the network provided by the Worker that creates it. This type offers methods to interact with any network, such as creating transactions and calling into contract functions.

Implementations

Create a Contract object from an AccountId and SecretKey.

Grab the current contract’s account identifier

Treat this Contract object as an Account type. This does nothing on chain/network, and is merely allowing Account::* functions to be used from this Contract.

Treat this Contract object as an Account type. This does nothing on chain/network, and is merely allowing Account::* functions to be used from this Contract.

Call the current contract’s function using the contract’s own account secret key to do the signing. Returns a CallTransaction object that we will make use to populate the rest of the call details.

If we want to make use of the contract’s secret key as a signer to call into another contract, use contract.as_account().call instead.

Call a view function into the current contract. Returns a result that yields a JSON string object.

View the WASM code bytes of this contract.

View a contract’s state map of key value pairs.

Views the current contract’s details such as balance and storage usage.

Deletes the current contract, and returns the execution details of this transaction. The beneciary will receive the funds of the account deleted

Start a batch transaction, using the current contract’s secret key as the signer, making calls into itself. Returns a Transaction object that we can use to add Actions to the batched transaction. Call transact to send the batched transaction to the network.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more