project

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigPaths = []string{"flow.json"}
	DefaultConfigPath  = DefaultConfigPaths[0]
)

Functions

func Exists

func Exists(path string) bool

Exists checks if a project configuration exists.

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func AccountFromAddressAndKey

func AccountFromAddressAndKey(address flow.Address, privateKey crypto.PrivateKey) *Account

func AccountFromConfig

func AccountFromConfig(accountConf config.Account) (*Account, error)

func (*Account) Address

func (a *Account) Address() flow.Address

func (*Account) DefaultKey

func (a *Account) DefaultKey() AccountKey

func (*Account) Keys

func (a *Account) Keys() []AccountKey

func (*Account) Name

func (a *Account) Name() string

func (*Account) SetDefaultKey

func (a *Account) SetDefaultKey(key AccountKey)

type AccountKey

type AccountKey interface {
	Type() config.KeyType
	Index() int
	SigAlgo() crypto.SignatureAlgorithm
	HashAlgo() crypto.HashAlgorithm
	Signer(ctx context.Context) (crypto.Signer, error)
	ToConfig() config.AccountKey
}

func NewAccountKey

func NewAccountKey(accountKeyConf config.AccountKey) (AccountKey, error)

type Contract

type Contract struct {
	Name   string
	Source string
	Target flow.Address
}

Contract is a Cadence contract definition for a project.

type HexAccountKey

type HexAccountKey struct {
	// contains filtered or unexported fields
}

func NewHexAccountKeyFromPrivateKey

func NewHexAccountKeyFromPrivateKey(
	index int,
	hashAlgo crypto.HashAlgorithm,
	privateKey crypto.PrivateKey,
) *HexAccountKey

func (HexAccountKey) HashAlgo

func (a HexAccountKey) HashAlgo() crypto.HashAlgorithm

func (HexAccountKey) Index

func (a HexAccountKey) Index() int

func (*HexAccountKey) PrivateKey

func (a *HexAccountKey) PrivateKey() crypto.PrivateKey

func (*HexAccountKey) PrivateKeyHex

func (a *HexAccountKey) PrivateKeyHex() string

func (HexAccountKey) SigAlgo

func (a HexAccountKey) SigAlgo() crypto.SignatureAlgorithm

func (*HexAccountKey) Signer

func (a *HexAccountKey) Signer(ctx context.Context) (crypto.Signer, error)

func (*HexAccountKey) ToConfig

func (a *HexAccountKey) ToConfig() config.AccountKey

func (HexAccountKey) Type

func (a HexAccountKey) Type() config.KeyType

type KmsAccountKey

type KmsAccountKey struct {
	// contains filtered or unexported fields
}

func (KmsAccountKey) HashAlgo

func (a KmsAccountKey) HashAlgo() crypto.HashAlgorithm

func (KmsAccountKey) Index

func (a KmsAccountKey) Index() int

func (KmsAccountKey) SigAlgo

func (a KmsAccountKey) SigAlgo() crypto.SignatureAlgorithm

func (*KmsAccountKey) Signer

func (a *KmsAccountKey) Signer(ctx context.Context) (crypto.Signer, error)

func (*KmsAccountKey) ToConfig

func (a *KmsAccountKey) ToConfig() config.AccountKey

func (KmsAccountKey) Type

func (a KmsAccountKey) Type() config.KeyType

type Project

type Project struct {
	// contains filtered or unexported fields
}

Project contains the configuration for a Flow project.

func Init

func Init(sigAlgo crypto.SignatureAlgorithm, hashAlgo crypto.HashAlgorithm) (*Project, error)

Init initializes a new Flow project.

func Load

func Load(configFilePath []string) (*Project, error)

Load loads a project configuration and returns the resulting project.

func (*Project) AccountByAddress

func (p *Project) AccountByAddress(address string) *Account

AccountByAddress returns an account by address.

func (*Project) AccountByName

func (p *Project) AccountByName(name string) *Account

AccountByName returns an account by name.

func (*Project) AccountNamesForNetwork

func (p *Project) AccountNamesForNetwork(network string) []string

AccountNamesForNetwork returns all configured account names for a network.

func (*Project) AddOrUpdateAccount

func (p *Project) AddOrUpdateAccount(account *Account)

AddOrUpdateAccount adds or updates an account.

func (*Project) AliasesForNetwork

func (p *Project) AliasesForNetwork(network string) map[string]string

AliasesForNetwork returns all deployment aliases for a network.

func (*Project) ContractConflictExists

func (p *Project) ContractConflictExists(network string) bool

CheckContractConflict returns true if the same contract is configured to deploy to more than one account in the same network.

The CLI currently does not allow the same contract to be deployed to multiple accounts in the same network.

func (*Project) ContractsByNetwork

func (p *Project) ContractsByNetwork(network string) []Contract

ContractsByNetwork returns all contracts for a network.

func (*Project) EmulatorServiceAccount

func (p *Project) EmulatorServiceAccount() (*Account, error)

EmulatorServiceAccount returns the service account for the default emulator profilee.

func (*Project) NetworkByName

func (p *Project) NetworkByName(name string) *config.Network

NetworkByName returns a network by name.

func (*Project) Save

func (p *Project) Save(path string) error

Save saves the project configuration to the given path.

func (*Project) SetEmulatorServiceKey

func (p *Project) SetEmulatorServiceKey(privateKey crypto.PrivateKey)

SetEmulatorServiceKey sets the default emulator service account private key.

Jump to

Keyboard shortcuts

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