tooling

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address    string `json:"address"`
	PrivateKey string `json:"privateKey"`
	SigAlgo    string `json:"sigAlgorithm"`
	HashAlgo   string `json:"hashAlgorithm"`
}

Account represents a Flow account

func NewFlowAccount

func NewFlowAccount(path string) (*Account, error)

NewFlowAccount will read the flow.json file and fetch the service account from there.

func NewFlowAccountDefault

func NewFlowAccountDefault() (*Account, error)

NewFlowAccountDefault will read the flow.json file from the default location

type Flow

type Flow struct {
	Accounts struct {
		Service Account
	}
}

Flow represents the contents of the flow.json file with an addition of host

type FlowConfig

type FlowConfig struct {
	Service *Account
	Wallet  *Wallet
	Host    string
}

FlowConfig holds all information to work on flow with a given set of accounts in a wallet

func NewFlowConfigLocalhost

func NewFlowConfigLocalhost() *FlowConfig

NewFlowConfigLocalhost will create a flow configuration from local emulator and default files

func (*FlowConfig) CreateAccount

func (f *FlowConfig) CreateAccount(accountName string)

CreateAccount will create an account for running transactions without a contract

func (*FlowConfig) DeployContract

func (f *FlowConfig) DeployContract(contractName string)

DeployContract will deploy a contract with the given name to an account with the same name from wallet.json

type Wallet

type Wallet struct {
	Accounts map[string]Account
}

Wallet represents the accounts in a Flow wallet

func NewWallet

func NewWallet(path string) (*Wallet, error)

NewWallet will creat a wallet from the given path

func NewWalletDefault

func NewWalletDefault() (*Wallet, error)

NewWalletDefault will create a default wallet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL