Documentation ¶
Index ¶
- func AccountKeyToCadenceCryptoKey(key *flow.AccountKey) (cadence.Value, error)
- func AddAccountContract(address flow.Address, contract Contract) *flow.Transaction
- func AddAccountKey(address flow.Address, accountKey *flow.AccountKey) (*flow.Transaction, error)
- func CreateAccount(accountKeys []*flow.AccountKey, contracts []Contract, payer flow.Address) (*flow.Transaction, error)
- func CreateAccountAndFund(accountKeys []*flow.AccountKey, contracts []Contract, payer flow.Address, ...) (*flow.Transaction, error)
- func RemoveAccountContract(address flow.Address, contractName string) *flow.Transaction
- func RemoveAccountKey(address flow.Address, keyIndex int) *flow.Transaction
- func UpdateAccountContract(address flow.Address, contract Contract) *flow.Transaction
- type Contract
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountKeyToCadenceCryptoKey ¶ added in v0.25.0
AccountKeyToCadenceCryptoKey converts a `flow.AccountKey` key to the Cadence struct `Crypto.KeyListEntry`, so that it can more easily be used as a parameter in scripts and transactions.
example: ```go
key := AccountKeyToCadenceCryptoKey(accountKey) return flow.NewTransaction(). SetScript([]byte(templates.AddAccountKey)). AddRawArgument(jsoncdc.MustEncode(key))
```
func AddAccountContract ¶ added in v0.12.0
func AddAccountContract(address flow.Address, contract Contract) *flow.Transaction
AddAccountContract generates a transaction that deploys a contract to an account.
func AddAccountKey ¶
func AddAccountKey(address flow.Address, accountKey *flow.AccountKey) (*flow.Transaction, error)
AddAccountKey generates a transaction that adds a public key to an account.
func CreateAccount ¶
func CreateAccount(accountKeys []*flow.AccountKey, contracts []Contract, payer flow.Address) (*flow.Transaction, error)
CreateAccount generates a transactions that creates a new account.
This template accepts a list of public keys and a contracts argument, both of which are optional.
The contracts argument is a dictionary of *contract name*: *contract code (in bytes)*. All of the contracts will be deployed to the account.
The final argument is the address of the account that will pay the account creation fee. This account is added as a transaction authorizer and therefore must sign the resulting transaction.
func CreateAccountAndFund ¶ added in v0.33.0
func RemoveAccountContract ¶ added in v0.15.0
func RemoveAccountContract(address flow.Address, contractName string) *flow.Transaction
RemoveAccountContract generates a transaction that removes a contract with the given name
func RemoveAccountKey ¶
func RemoveAccountKey(address flow.Address, keyIndex int) *flow.Transaction
RemoveAccountKey generates a transaction that removes a key from an account.
func UpdateAccountContract ¶ added in v0.12.0
func UpdateAccountContract(address flow.Address, contract Contract) *flow.Transaction
UpdateAccountContract generates a transaction that updates a contract deployed at an account.
Types ¶
type Contract ¶ added in v0.12.0
Contract is a Cadence contract deployed to a Flow account.
Name is the identifier for the contract within the account.
Source is the the Cadence code of the contract.
func (Contract) SourceBytes ¶ added in v0.12.0
SourceBytes returns the UTF-8 encoded source code (Source) of the contract.