Documentation ¶
Index ¶
- func Exists(path string) bool
- type Account
- type AccountKey
- type Aliases
- type Contract
- type HexAccountKey
- func (a HexAccountKey) HashAlgo() crypto.HashAlgorithm
- func (a HexAccountKey) Index() int
- func (a *HexAccountKey) PrivateKey() crypto.PrivateKey
- 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) 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 Project
- func (p *Project) AccountByAddress(address string) *Account
- func (p *Project) AccountByName(name string) *Account
- func (p *Project) AccountNamesForNetwork(network string) []string
- func (p *Project) AddOrUpdateAccount(account *Account)
- func (p *Project) AliasesForNetwork(network string) Aliases
- func (p *Project) Config() *config.Config
- func (p *Project) ContractConflictExists(network string) bool
- func (p *Project) DeploymentContractsByNetwork(network string) ([]Contract, error)
- func (p *Project) EmulatorServiceAccount() (*Account, error)
- func (p *Project) NetworkByName(name string) *config.Network
- func (p *Project) RemoveAccount(name string) error
- func (p *Project) Save(path string) error
- func (p *Project) SaveDefault() error
- func (p *Project) SetEmulatorServiceKey(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, contractArgs []string) (*Transaction, error)
- func NewRemoveAccountContractTransaction(signer *Account, name string) (*Transaction, error)
- func NewTransaction() *Transaction
- func NewTransactionFromPayload(filename string) (*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
- func (t *Transaction) AddRawArguments(args []string, argsJSON string) 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) *Transaction
- func (t *Transaction) SetScriptWithArgs(script []byte, args []string, argsJSON string) 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 ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func AccountFromAddressAndKey ¶
func AccountFromAddressAndKey(address flow.Address, privateKey crypto.PrivateKey) *Account
func (*Account) DefaultKey ¶
func (a *Account) DefaultKey() AccountKey
func (*Account) Keys ¶
func (a *Account) Keys() []AccountKey
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 Validate() error }
func NewAccountKey ¶
func NewAccountKey(accountKeyConf config.AccountKey) (AccountKey, error)
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) 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) ToConfig ¶
func (a *HexAccountKey) ToConfig() config.AccountKey
type KmsAccountKey ¶
type KmsAccountKey struct {
// contains filtered or unexported fields
}
func (KmsAccountKey) HashAlgo ¶
func (a KmsAccountKey) HashAlgo() crypto.HashAlgorithm
func (KmsAccountKey) SigAlgo ¶
func (a KmsAccountKey) SigAlgo() crypto.SignatureAlgorithm
func (*KmsAccountKey) ToConfig ¶
func (a *KmsAccountKey) ToConfig() config.AccountKey
func (*KmsAccountKey) Validate ¶ added in v0.18.0
func (a *KmsAccountKey) Validate() error
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 (*Project) AccountByAddress ¶
AccountByAddress returns an account by address.
func (*Project) AccountByName ¶
AccountByName returns an account by name.
func (*Project) AccountNamesForNetwork ¶
AccountNamesForNetwork returns all configured account names for a network.
func (*Project) AddOrUpdateAccount ¶
AddOrUpdateAccount adds or updates an account.
func (*Project) AliasesForNetwork ¶
AliasesForNetwork returns all deployment aliases for a network.
func (*Project) ContractConflictExists ¶
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) DeploymentContractsByNetwork ¶ added in v0.19.0
DeploymentContractsByNetwork returns all contracts for a network.
func (*Project) EmulatorServiceAccount ¶
EmulatorServiceAccount returns the service account for the default emulator profilee.
func (*Project) NetworkByName ¶
NetworkByName returns a network by name.
func (*Project) RemoveAccount ¶ added in v0.19.0
RemoveAccount removes an account from configuration
func (*Project) SaveDefault ¶ added in v0.19.0
SaveDefault saves configuration to default path
func (*Project) SetEmulatorServiceKey ¶
func (p *Project) SetEmulatorServiceKey(privateKey crypto.PrivateKey)
SetEmulatorServiceKey sets the default emulator service account private key.
type Transaction ¶ added in v0.18.0
type Transaction struct {
// contains filtered or unexported fields
}
Transaction builder of flow transactions
func NewAddAccountContractTransaction ¶ added in v0.18.0
func NewAddAccountContractTransaction( signer *Account, name string, source string, args []cadence.Value, ) (*Transaction, error)
NewAddAccountContractTransaction add new contract to the account
func NewCreateAccountTransaction ¶ added in v0.18.0
func NewCreateAccountTransaction( signer *Account, keys []*flow.AccountKey, contractArgs []string, ) (*Transaction, error)
NewCreateAccountTransaction creates new transaction for account
func NewRemoveAccountContractTransaction ¶ added in v0.18.0
func NewRemoveAccountContractTransaction(signer *Account, name string) (*Transaction, error)
NewRemoveAccountContractTransaction creates new transaction to remove contract
func NewTransaction ¶ added in v0.18.0
func NewTransaction() *Transaction
NewTransaction create new instance of transaction
func NewTransactionFromPayload ¶ added in v0.18.0
func NewTransactionFromPayload(filename string) (*Transaction, error)
NewTransactionFromPayload build transaction from payload
func NewUpdateAccountContractTransaction ¶ added in v0.18.0
func NewUpdateAccountContractTransaction(signer *Account, name string, source string) (*Transaction, error)
NewUpdateAccountContractTransaction update account contract
func (*Transaction) AddArgument ¶ added in v0.18.0
func (t *Transaction) AddArgument(arg cadence.Value) error
AddArgument add cadence typed argument
func (*Transaction) AddArguments ¶ added in v0.18.0
func (t *Transaction) AddArguments(args []cadence.Value) error
AddArguments add array of cadence arguments
func (*Transaction) AddAuthorizers ¶ added in v0.18.0
func (t *Transaction) AddAuthorizers(authorizers []flow.Address) *Transaction
AddAuthorizers add group of authorizers
func (*Transaction) AddRawArguments ¶ added in v0.18.0
func (t *Transaction) AddRawArguments(args []string, argsJSON string) error
AddRawArguments add raw arguments to tx
func (*Transaction) FlowTransaction ¶ added in v0.18.0
func (t *Transaction) FlowTransaction() *flow.Transaction
FlowTransaction get flow transaction
func (*Transaction) Proposer ¶ added in v0.18.0
func (t *Transaction) Proposer() *flow.Account
Proposer get proposer
func (*Transaction) SetBlockReference ¶ added in v0.18.0
func (t *Transaction) SetBlockReference(block *flow.Block) *Transaction
SetBlockReference sets block reference for transaction
func (*Transaction) SetGasLimit ¶ added in v0.20.1
func (t *Transaction) SetGasLimit(gasLimit uint64) *Transaction
SetGasLimit sets the gas limit for transaction
func (*Transaction) SetPayer ¶ added in v0.18.0
func (t *Transaction) SetPayer(address flow.Address) *Transaction
SetPayer sets the payer for transaction
func (*Transaction) SetProposer ¶ added in v0.18.0
func (t *Transaction) SetProposer(proposer *flow.Account, keyIndex int) *Transaction
SetProposer sets the proposer for transaction
func (*Transaction) SetScriptWithArgs ¶ added in v0.18.0
func (t *Transaction) SetScriptWithArgs(script []byte, args []string, argsJSON string) error
func (*Transaction) SetSigner ¶ added in v0.18.0
func (t *Transaction) SetSigner(account *Account) error
SetSigner sets the signer for transaction
func (*Transaction) Sign ¶ added in v0.18.0
func (t *Transaction) Sign() (*Transaction, error)
Sign signs transaction using signer account
func (*Transaction) Signer ¶ added in v0.18.0
func (t *Transaction) Signer() *Account
Signer get signer