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

Account is directly associated to an account 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 new account with the given path to the credentials JSON file

Grab the current account identifier

Call a contract on the network specified within worker, and return a CallTransaction object that we will make use to populate the rest of the call details.

Transfer NEAR to an account specified by receiver_id with the amount specified by amount. Returns the execution details of this transaction

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

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

Create a new sub account. Returns a CreateAccountTransaction object that we can make use of to fill out the rest of the details. The subaccount id will be in the form of: “{new_account_id}.{parent_account_id}”

Deploy contract code or WASM bytes to the account, and return us a new Contract object that we can use to interact with the contract.

Start a batch transaction, using the current account as the signer and making calls into the contract provided by contract_id. 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.

Store the credentials of this account locally in the directory provided.

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 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