Documentation ¶
Index ¶
- type AccountRoles
- type AddressesRoles
- type Transaction
- func New() *Transaction
- func NewAddAccountContract(signer *accounts.Account, name string, source []byte, args []cadence.Value) (*Transaction, error)
- func NewCreateAccount(signer *accounts.Account, keys []*flow.AccountKey, ...) (*Transaction, error)
- func NewFromPayload(payload []byte) (*Transaction, error)
- func NewRemoveAccountContract(signer *accounts.Account, name string) (*Transaction, error)
- func NewUpdateAccountContract(signer *accounts.Account, name string, source []byte) (*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) SetComputeLimit(limit uint64) *Transaction
- func (t *Transaction) SetPayer(address flow.Address) *Transaction
- func (t *Transaction) SetProposer(proposer *flow.Account, keyIndex uint32) error
- func (t *Transaction) SetScriptWithArgs(script []byte, args []cadence.Value) error
- func (t *Transaction) SetSigner(account *accounts.Account) error
- func (t *Transaction) Sign() (*Transaction, error)
- func (t *Transaction) Signer() *accounts.Account
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRoles ¶
type AccountRoles struct { Proposer accounts.Account Authorizers []accounts.Account Payer accounts.Account }
AccountRoles define all the accounts for different transaction roles.
You can read more about roles here: https://developers.flow.com/learn/concepts/accounts-and-keys
func SingleAccountRole ¶
func SingleAccountRole(account accounts.Account) AccountRoles
SingleAccountRole creates transaction accounts from a single provided account fulfilling all the roles (proposer, payer, authorizer).
func (AccountRoles) AddressRoles ¶
func (t AccountRoles) AddressRoles() AddressesRoles
AddressRoles returns address roles using the provided accounts.
func (AccountRoles) Signers ¶
func (t AccountRoles) Signers() []*accounts.Account
Signers for signing the transaction, detect if all accounts are same so only return the one account.
type AddressesRoles ¶
type AddressesRoles struct { Proposer flow.Address Authorizers []flow.Address Payer flow.Address }
AddressesRoles defines transaction roles by account addresses.
You can read more about roles here: https://developers.flow.com/learn/concepts/accounts-and-keys
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction builder of flow transactions.
func NewAddAccountContract ¶
func NewAddAccountContract( signer *accounts.Account, name string, source []byte, args []cadence.Value, ) (*Transaction, error)
NewAddAccountContract add new contract to the account.
func NewCreateAccount ¶
func NewCreateAccount( signer *accounts.Account, keys []*flow.AccountKey, contracts []templates.Contract, ) (*Transaction, error)
NewCreateAccount creates new transaction for account.
func NewFromPayload ¶
func NewFromPayload(payload []byte) (*Transaction, error)
NewFromPayload build transaction from payload.
func NewRemoveAccountContract ¶
func NewRemoveAccountContract(signer *accounts.Account, name string) (*Transaction, error)
NewRemoveAccountContract creates new transaction to remove contract.
func NewUpdateAccountContract ¶
func NewUpdateAccountContract(signer *accounts.Account, name string, source []byte) (*Transaction, error)
NewUpdateAccountContract 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) SetComputeLimit ¶
func (t *Transaction) SetComputeLimit(limit uint64) *Transaction
SetComputeLimit 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 uint32) 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 *accounts.Account) error
SetSigner sets the signer for transaction.
func (*Transaction) Sign ¶
func (t *Transaction) Sign() (*Transaction, error)
Sign signs transaction using signer account.