tooling

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForSeal

func WaitForSeal(ctx context.Context, c *client.Client, id flow.Identifier) *flow.TransactionResult

WaitForSeal wait fot the process to seal

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
	Gas     uint64
}

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

func NewFlowConfigDevNet

func NewFlowConfigDevNet() *FlowConfig

NewFlowConfigDevNet setup devnot like in https://www.notion.so/Accessing-Flow-Devnet-ad35623797de48c08d8b88102ea38131

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

func (*FlowConfig) FindAddress added in v0.8.0

func (f *FlowConfig) FindAddress(key string) cadence.Address

FindAddress finds an candence.Address value from a given key in your wallet

func (*FlowConfig) GetAccount added in v0.10.0

func (f *FlowConfig) GetAccount(name string) *flow.Account

GetAccount gets the account

func (*FlowConfig) RunScript

func (f *FlowConfig) RunScript(filename string, arguments ...cadence.Value)

RunScript executes a read only script with a given filename on the blockchain

func (*FlowConfig) RunScriptReturns added in v0.9.0

func (f *FlowConfig) RunScriptReturns(filename string, arguments ...cadence.Value) cadence.Value

RunScriptReturns executes a read only script with a given filename on the blockchain

func (*FlowConfig) SendTransaction

func (f *FlowConfig) SendTransaction(filename string, signerAccountNames ...string)

SendTransaction executes a transaction file with a given name and signs it with the provided account

func (*FlowConfig) SendTransactionWithArguments added in v0.7.0

func (f *FlowConfig) SendTransactionWithArguments(filename string, signer string, arguments ...cadence.Value)

SendTransactionWithArguments executes a transaction file with a given name and signs it with the provided account and send in the provided arguments

func (*FlowConfig) SendTransactionWithMultipleSignersAndArguments added in v0.7.0

func (f *FlowConfig) SendTransactionWithMultipleSignersAndArguments(filename string, signers []string, arguments ...cadence.Value)

SendTransactionWithMultipleSignersAndArguments executes a transaction file with a given name and signs it with the provided accounts and sends in the provided arguments

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