pub struct Worker<T> { /* private fields */ }
Expand description

The Worker type allows us to interact with any NEAR related networks, such as mainnet and testnet. This controls where the environment the worker is running on top of is. Refer to this for all network related actions such as deploying a contract, or interacting with transactions.

Implementations

Call into a contract’s change function.

Call into a contract’s view function.

View the WASM code bytes of a contract on the network.

View the state of a account/contract on the network. This will return the internal state of the account in the form of a map of key-value pairs; where STATE contains info on a contract’s internal data.

View the latest block from the network

Transfer tokens from one account to another. The signer is the account that will be used to to send from.

Deletes an account from the network. The beneficiary will receive the balance of the account deleted.

View account details of a specific account on the network.

Import a contract from the the given network, and return us a [ImportContractTransaction] which allows to specify further details, such as being able to import contract data and how far back in time we wanna grab the contract.

Patch state into the sandbox network, given a key and value. This will allow us to set state that we have acquired in some manner. This allows us to test random cases that are hard to come up naturally as state evolves.

Fast forward to a point in the future. The delta block height is supplied to tell the network to advanced a certain amount of blocks. This comes with the advantage only having to wait a fraction of the time it takes to produce the same number of blocks.

Estimate as to how long it takes: if our delta_height crosses X epochs, then it would roughly take X * 5 seconds for the fast forward request to be processed.

The port being used by RPC

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