Documentation
¶
Overview ¶
Package emulator provides helpful wrappers around flow-cli packages and types, providing a high-level interface for common flow development tasks such as running an emulator with non-default configuration settings, creating accounts, deploying contracts, replacing import statements in cadence files, and sending transactions and script executions to the emulator.
Index ¶
- Variables
- func GetProjectAccount(proj *project.Project, name string) (*project.Account, error)
- func NewServer(cfg *Config) *server.EmulatorServer
- func NewServerWithOpts(opts *Opts) (*server.EmulatorServer, error)
- func ServerConf(cfg *Config) *server.Config
- type Account
- type Client
- func (emu *Client) CreateAccount(name string) (*Account, error)
- func (emu *Client) ResolveCode(code string, codepath string) ([]byte, error)
- func (emu *Client) ResolveImports(code []byte, codepath string) ([]byte, error)
- func (emu *Client) ScriptExec(req ScriptExecReq) (cadence.Value, error)
- func (emu *Client) TxBuild(accountName string, gasLimit uint64) (*project.Transaction, *project.Account, error)
- func (emu *Client) TxSend(req TxSendReq) (*flow.Transaction, *flow.TransactionResult, error)
- type Config
- type Emu
- type Opts
- type ScriptExecReq
- type TxSendReq
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetProjectAccount ¶
func NewServer ¶ added in v0.1.2
func NewServer(cfg *Config) *server.EmulatorServer
func NewServerWithOpts ¶ added in v0.1.2
func NewServerWithOpts(opts *Opts) (*server.EmulatorServer, error)
func ServerConf ¶
Types ¶
type Account ¶ added in v0.1.2
type Account struct {
Name string
Key crypto.PrivateKey
Account *flow.Account
}
type Client ¶ added in v0.1.2
type Client struct {
Net *config.Network
Gateway *gateway.GrpcGateway
Services *services.Services
Logger output.Logger
Config *Config
}
func (*Client) CreateAccount ¶ added in v0.1.2
func (*Client) ResolveCode ¶ added in v0.1.2
func (*Client) ResolveImports ¶ added in v0.1.2
func (*Client) ScriptExec ¶ added in v0.1.2
func (emu *Client) ScriptExec(req ScriptExecReq) (cadence.Value, error)
func (*Client) TxSend ¶ added in v0.1.2
func (emu *Client) TxSend(req TxSendReq) (*flow.Transaction, *flow.TransactionResult, error)
type Config ¶ added in v0.1.2
type Config struct {
Opts *Opts
Proj *project.Project
Emulator *config.Emulator
ServiceAccount *project.Account
PrivateKey crypto.PrivateKey
SigAlgo crypto.SignatureAlgorithm
HashAlgo crypto.HashAlgorithm
}
func LoadConfig ¶ added in v0.1.2
type ScriptExecReq ¶ added in v0.1.1
Click to show internal directories.
Click to hide internal directories.