Documentation ¶
Index ¶
- func Exists(path string) bool
- func NewStakingInfoFromValue(value cadence.Value) ([]map[string]interface{}, error)
- func ParseArguments(args []string, argsJSON string) (scriptArgs []cadence.Value, err error)
- func ParseArgumentsCommaSplit(input []string) ([]cadence.Value, error)
- func ParseArgumentsJSON(input string) ([]cadence.Value, error)
- func ParseArgumentsWithoutType(fileName string, code []byte, args []string) (scriptArgs []cadence.Value, err error)
- type Account
- type AccountKey
- type Accounts
- type Aliases
- type CadenceArgument
- type Contract
- type Event
- type Events
- type HexAccountKey
- func (a HexAccountKey) HashAlgo() crypto.HashAlgorithm
- func (a HexAccountKey) Index() int
- func (a *HexAccountKey) PrivateKey() (*crypto.PrivateKey, error)
- func (a *HexAccountKey) PrivateKeyHex() string
- func (a HexAccountKey) SigAlgo() crypto.SignatureAlgorithm
- func (a *HexAccountKey) Signer(ctx context.Context) (crypto.Signer, error)
- func (a *HexAccountKey) ToConfig() config.AccountKey
- func (a HexAccountKey) Type() config.KeyType
- func (a *HexAccountKey) Validate() error
- type KmsAccountKey
- func (a KmsAccountKey) HashAlgo() crypto.HashAlgorithm
- func (a KmsAccountKey) Index() int
- func (a *KmsAccountKey) PrivateKey() (*crypto.PrivateKey, error)
- func (a KmsAccountKey) SigAlgo() crypto.SignatureAlgorithm
- func (a *KmsAccountKey) Signer(ctx context.Context) (crypto.Signer, error)
- func (a *KmsAccountKey) ToConfig() config.AccountKey
- func (a KmsAccountKey) Type() config.KeyType
- func (a *KmsAccountKey) Validate() error
- type ReaderWriter
- type State
- func (p *State) AccountNamesForNetwork(network string) []string
- func (p *State) Accounts() *Accounts
- func (p *State) AliasesForNetwork(network string) Aliases
- func (p *State) Config() *config.Config
- func (p *State) ContractConflictExists(network string) bool
- func (p *State) Contracts() *config.Contracts
- func (p *State) DeploymentContractsByNetwork(network string) ([]Contract, error)
- func (p *State) Deployments() *config.Deployments
- func (p *State) EmulatorServiceAccount() (*Account, error)
- func (p *State) Networks() *config.Networks
- func (p *State) ReadFile(source string) ([]byte, error)
- func (p *State) ReaderWriter() ReaderWriter
- func (p *State) Save(path string) error
- func (p *State) SaveDefault() error
- func (p *State) SaveEdited(paths []string) error
- func (p *State) SetEmulatorKey(privateKey crypto.PrivateKey)
- type Transaction
- func NewAddAccountContractTransaction(signer *Account, name string, source string, args []cadence.Value) (*Transaction, error)
- func NewCreateAccountTransaction(signer *Account, keys []*flow.AccountKey, contracts []templates.Contract) (*Transaction, error)
- func NewRemoveAccountContractTransaction(signer *Account, name string) (*Transaction, error)
- func NewTransaction() *Transaction
- func NewTransactionFromPayload(payload []byte) (*Transaction, error)
- func NewUpdateAccountContractTransaction(signer *Account, name string, source string) (*Transaction, error)
- func (t *Transaction) AddArgument(arg cadence.Value) error
- func (t *Transaction) AddArguments(args []cadence.Value) error
- func (t *Transaction) AddAuthorizers(authorizers []flow.Address) (*Transaction, error)
- func (t *Transaction) FlowTransaction() *flow.Transaction
- func (t *Transaction) Proposer() *flow.Account
- func (t *Transaction) SetBlockReference(block *flow.Block) *Transaction
- func (t *Transaction) SetGasLimit(gasLimit uint64) *Transaction
- func (t *Transaction) SetPayer(address flow.Address) *Transaction
- func (t *Transaction) SetProposer(proposer *flow.Account, keyIndex int) error
- func (t *Transaction) SetScriptWithArgs(script []byte, args []cadence.Value) error
- func (t *Transaction) SetSigner(account *Account) error
- func (t *Transaction) Sign() (*Transaction, error)
- func (t *Transaction) Signer() *Account
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStakingInfoFromValue ¶
func ParseArguments ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account is a flowkit specific account implementation.
func (*Account) SetAddress ¶
func (a *Account) SetAddress(address flow.Address)
SetAddress sets account address.
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 Validate() error PrivateKey() (*crypto.PrivateKey, error) }
AccountKey is a flowkit specific account key implementation allowing us to sign the transactions using different implemented methods.
func NewAccountKey ¶
func NewAccountKey(accountKeyConf config.AccountKey) (AccountKey, error)
type Accounts ¶
type Accounts []Account
Accounts is a collection of account.
func (*Accounts) AddOrUpdate ¶
AddOrUpdate add account if missing or updates if present.
type CadenceArgument ¶
func (CadenceArgument) MarshalJSON ¶
func (v CadenceArgument) MarshalJSON() ([]byte, error)
func (*CadenceArgument) UnmarshalJSON ¶
func (v *CadenceArgument) UnmarshalJSON(b []byte) (err error)
type Contract ¶
type Contract struct { Name string Source string AccountAddress flow.Address AccountName string Args []cadence.Value }
Contract is a Cadence contract definition for a project.
type Events ¶
type Events []Event
func EventsFromTransaction ¶
func EventsFromTransaction(tx *flow.TransactionResult) Events
func (*Events) GetAddress ¶
func (e *Events) GetAddress() *flow.Address
type HexAccountKey ¶
type HexAccountKey struct {
// contains filtered or unexported fields
}
HexAccountKey implements account key in hex representation.
func NewHexAccountKeyFromPrivateKey ¶
func NewHexAccountKeyFromPrivateKey( index int, hashAlgo crypto.HashAlgorithm, privateKey crypto.PrivateKey, ) *HexAccountKey
func (HexAccountKey) HashAlgo ¶
func (a HexAccountKey) HashAlgo() crypto.HashAlgorithm
func (*HexAccountKey) PrivateKey ¶
func (a *HexAccountKey) PrivateKey() (*crypto.PrivateKey, error)
func (*HexAccountKey) PrivateKeyHex ¶
func (a *HexAccountKey) PrivateKeyHex() string
func (HexAccountKey) SigAlgo ¶
func (a HexAccountKey) SigAlgo() crypto.SignatureAlgorithm
func (*HexAccountKey) ToConfig ¶
func (a *HexAccountKey) ToConfig() config.AccountKey
func (*HexAccountKey) Validate ¶
func (a *HexAccountKey) Validate() error
type KmsAccountKey ¶
type KmsAccountKey struct {
// contains filtered or unexported fields
}
KmsAccountKey implements Gcloud KMS system for signing.
func (KmsAccountKey) HashAlgo ¶
func (a KmsAccountKey) HashAlgo() crypto.HashAlgorithm
func (*KmsAccountKey) PrivateKey ¶
func (a *KmsAccountKey) PrivateKey() (*crypto.PrivateKey, error)
func (KmsAccountKey) SigAlgo ¶
func (a KmsAccountKey) SigAlgo() crypto.SignatureAlgorithm
func (*KmsAccountKey) ToConfig ¶
func (a *KmsAccountKey) ToConfig() config.AccountKey
ToConfig convert account key to configuration.
func (*KmsAccountKey) Validate ¶
func (a *KmsAccountKey) Validate() error
type ReaderWriter ¶
type ReaderWriter interface { ReadFile(source string) ([]byte, error) WriteFile(filename string, data []byte, perm os.FileMode) error }
ReaderWriter is implemented by any value that has ReadFile and WriteFile and it is used to load and save files.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State manages the state for a Flow project.
func Init ¶
func Init(readerWriter ReaderWriter, sigAlgo crypto.SignatureAlgorithm, hashAlgo crypto.HashAlgorithm) (*State, error)
Init initializes a new Flow project.
func Load ¶
func Load(configFilePaths []string, readerWriter ReaderWriter) (*State, error)
Load loads a project configuration and returns the resulting project.
func (*State) AccountNamesForNetwork ¶
AccountNamesForNetwork returns all configured account names for a network.
func (*State) AliasesForNetwork ¶
AliasesForNetwork returns all deployment aliases for a network.
func (*State) ContractConflictExists ¶
ContractConflictExists 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 (*State) DeploymentContractsByNetwork ¶
DeploymentContractsByNetwork returns all contracts for a network.
func (*State) Deployments ¶
func (p *State) Deployments() *config.Deployments
Deployments get deployments configuration.
func (*State) EmulatorServiceAccount ¶
EmulatorServiceAccount returns the service account for the default emulator profile.
func (*State) ReaderWriter ¶
func (p *State) ReaderWriter() ReaderWriter
ReaderWriter retrieve current file reader writer.
func (*State) SaveEdited ¶ added in v0.28.0
SaveEdited saves configuration to valid path.
func (*State) SetEmulatorKey ¶
func (p *State) SetEmulatorKey(privateKey crypto.PrivateKey)
SetEmulatorKey sets the default emulator service account private key.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction builder of flow transactions.
func NewAddAccountContractTransaction ¶
func NewAddAccountContractTransaction( signer *Account, name string, source string, args []cadence.Value, ) (*Transaction, error)
NewAddAccountContractTransaction add new contract to the account.
func NewCreateAccountTransaction ¶
func NewCreateAccountTransaction( signer *Account, keys []*flow.AccountKey, contracts []templates.Contract, ) (*Transaction, error)
NewCreateAccountTransaction creates new transaction for account.
func NewRemoveAccountContractTransaction ¶
func NewRemoveAccountContractTransaction(signer *Account, name string) (*Transaction, error)
NewRemoveAccountContractTransaction creates new transaction to remove contract.
func NewTransaction ¶
func NewTransaction() *Transaction
NewTransaction create new instance of transaction.
func NewTransactionFromPayload ¶
func NewTransactionFromPayload(payload []byte) (*Transaction, error)
NewTransactionFromPayload build transaction from payload.
func NewUpdateAccountContractTransaction ¶
func NewUpdateAccountContractTransaction(signer *Account, name string, source string) (*Transaction, error)
NewUpdateAccountContractTransaction update account contract.
func (*Transaction) AddArgument ¶
func (t *Transaction) AddArgument(arg cadence.Value) error
AddArgument add cadence typed argument.
func (*Transaction) AddArguments ¶
func (t *Transaction) AddArguments(args []cadence.Value) error
AddArguments add array of cadence arguments.
func (*Transaction) AddAuthorizers ¶
func (t *Transaction) AddAuthorizers(authorizers []flow.Address) (*Transaction, error)
AddAuthorizers add group of authorizers.
func (*Transaction) FlowTransaction ¶
func (t *Transaction) FlowTransaction() *flow.Transaction
FlowTransaction get flow transaction.
func (*Transaction) Proposer ¶
func (t *Transaction) Proposer() *flow.Account
Proposer get proposer.
func (*Transaction) SetBlockReference ¶
func (t *Transaction) SetBlockReference(block *flow.Block) *Transaction
SetBlockReference sets block reference for transaction.
func (*Transaction) SetGasLimit ¶
func (t *Transaction) SetGasLimit(gasLimit uint64) *Transaction
SetGasLimit sets the gas limit for transaction.
func (*Transaction) SetPayer ¶
func (t *Transaction) SetPayer(address flow.Address) *Transaction
SetPayer sets the payer for transaction.
func (*Transaction) SetProposer ¶
func (t *Transaction) SetProposer(proposer *flow.Account, keyIndex int) error
SetProposer sets the proposer for transaction.
func (*Transaction) SetScriptWithArgs ¶
func (t *Transaction) SetScriptWithArgs(script []byte, args []cadence.Value) error
func (*Transaction) SetSigner ¶
func (t *Transaction) SetSigner(account *Account) error
SetSigner sets the signer for transaction.
func (*Transaction) Sign ¶
func (t *Transaction) Sign() (*Transaction, error)
Sign signs transaction using signer account.