Documentation ¶
Index ¶
- func NewSingleTransactionAccount(account *flowkit.Account) *transactionAccountRoles
- func NewTransactionAccountRoles(proposer *flowkit.Account, payer *flowkit.Account, ...) (*transactionAccountRoles, error)
- func NewTransactionAddresses(proposer flow.Address, payer flow.Address, authorizers []flow.Address) *transactionAddresses
- type Accounts
- func (a *Accounts) AddContract(account *flowkit.Account, contract *flowkit.Script, network string, ...) (flow.Identifier, bool, error)
- func (a *Accounts) Create(signer *flowkit.Account, pubKeys []crypto.PublicKey, keyWeights []int, ...) (*flow.Account, error)
- func (a *Accounts) Get(address flow.Address) (*flow.Account, error)
- func (a *Accounts) NodeTotalStake(nodeId string, chain flow.ChainID) (*cadence.Value, error)
- func (a *Accounts) RemoveContract(account *flowkit.Account, contractName string) (flow.Identifier, error)
- func (a *Accounts) StakingInfo(address flow.Address) ([]map[string]interface{}, []map[string]interface{}, error)
- type Blocks
- type Collections
- type EventWorkerResult
- type Events
- type Keys
- func (k *Keys) DecodePEM(key string, sigAlgo crypto.SignatureAlgorithm) (*flow.AccountKey, error)
- func (k *Keys) DecodeRLP(publicKey string) (*flow.AccountKey, error)
- func (k *Keys) DerivePrivateKeyFromMnemonic(mnemonic string, sigAlgo crypto.SignatureAlgorithm, derivationPath string) (crypto.PrivateKey, error)
- func (k *Keys) Generate(inputSeed string, sigAlgo crypto.SignatureAlgorithm) (crypto.PrivateKey, error)
- func (k *Keys) GetMnemonic() (string, error)
- func (k *Keys) ParsePrivateKey(inputPrivateKey string, sigAlgo crypto.SignatureAlgorithm) (crypto.PrivateKey, error)
- type Project
- func (p *Project) CheckForStandardContractUsageOnMainnet() error
- func (p *Project) Deploy(network string, update Update) ([]*project.Contract, error)
- func (p *Project) Init(readerWriter flowkit.ReaderWriter, reset bool, global bool, ...) (*flowkit.State, error)
- func (p *Project) ReplaceStandardContractReferenceToAlias(standardContract StandardContract) error
- type ProjectDeploymentError
- type Scripts
- type Services
- type Snapshot
- type StandardContract
- type Status
- type Tests
- type Transactions
- func (t *Transactions) Build(addresses *transactionAddresses, proposerKeyIndex int, script *flowkit.Script, ...) (*flowkit.Transaction, error)
- func (t *Transactions) GetRLP(rlpUrl string) ([]byte, error)
- func (t *Transactions) GetStatus(id flow.Identifier, waitSeal bool) (*flow.Transaction, *flow.TransactionResult, error)
- func (t *Transactions) GetTransactionResultsByBlockID(id flow.Identifier) ([]*flow.TransactionResult, error)
- func (t *Transactions) GetTransactionsByBlockID(id flow.Identifier) ([]*flow.Transaction, error)
- func (t *Transactions) PostRLP(rlpUrl string, tx *flow.Transaction) error
- func (t *Transactions) Send(accounts *transactionAccountRoles, script *flowkit.Script, gasLimit uint64, ...) (*flow.Transaction, *flow.TransactionResult, error)
- func (t *Transactions) SendSigned(tx *flowkit.Transaction) (*flow.Transaction, *flow.TransactionResult, error)
- func (t *Transactions) Sign(signer *flowkit.Account, payload []byte) (*flowkit.Transaction, error)
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSingleTransactionAccount ¶
NewSingleTransactionAccount creates transaction accounts from a single provided account fulfilling all the roles (proposer, payer, authorizer).
func NewTransactionAccountRoles ¶
func NewTransactionAccountRoles( proposer *flowkit.Account, payer *flowkit.Account, authorizers []*flowkit.Account, ) (*transactionAccountRoles, error)
NewTransactionAccountRoles defines transaction roles by accounts.
You can read more about roles here: https://developers.flow.com/learn/concepts/accounts-and-keys
func NewTransactionAddresses ¶
func NewTransactionAddresses( proposer flow.Address, payer flow.Address, authorizers []flow.Address, ) *transactionAddresses
NewTransactionAddresses defines transaction roles by account addresses.
You can read more about roles here: https://developers.flow.com/learn/concepts/accounts-and-keys
Types ¶
type Accounts ¶
type Accounts struct {
// contains filtered or unexported fields
}
Accounts is a service that handles all account-related interactions.
func NewAccounts ¶
NewAccounts returns a new accounts service.
func (*Accounts) AddContract ¶
func (a *Accounts) AddContract( account *flowkit.Account, contract *flowkit.Script, network string, update Update, ) (flow.Identifier, bool, error)
AddContract deploys a contract code to the account provided with possible update flag.
func (*Accounts) Create ¶
func (a *Accounts) Create( signer *flowkit.Account, pubKeys []crypto.PublicKey, keyWeights []int, sigAlgo []crypto.SignatureAlgorithm, hashAlgo []crypto.HashAlgorithm, contractArgs []string, ) (*flow.Account, error)
Create creates and returns a new account.
The new account is created with the given public keys and contracts.
The account creation transaction is signed by the specified signer.
func (*Accounts) NodeTotalStake ¶
NodeTotalStake returns the total stake including delegations of a node.
type Blocks ¶
type Blocks struct {
// contains filtered or unexported fields
}
Blocks is a service that handles all block-related interactions.
func (*Blocks) GetBlock ¶
func (e *Blocks) GetBlock( query string, eventType string, verbose bool, ) (*flow.Block, []flow.BlockEvents, []*flow.Collection, error)
GetBlock returns a block based on the provided query string.
Query string options: - "latest" : return the latest block - height (e.g. 123456789) : return block at this height - ID : return block with this ID
func (*Blocks) GetLatestBlockHeight ¶
GetLatestBlockHeight returns the latest block height
type Collections ¶
type Collections struct {
// contains filtered or unexported fields
}
Collections is aa service that handles all collection-related interactions.
func NewCollections ¶
func NewCollections( gateway gateway.Gateway, state *flowkit.State, logger output.Logger, ) *Collections
NewCollections returns a new collections service.
func (*Collections) Get ¶
func (c *Collections) Get(id flow.Identifier) (*flow.Collection, error)
Get returns a collection by ID.
type EventWorkerResult ¶
type EventWorkerResult struct { Events []flow.BlockEvents Error error }
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events is a service that handles all event-related interactions.
type Keys ¶
type Keys struct {
// contains filtered or unexported fields
}
Keys is a service that handles all key-related interactions.
func (*Keys) DecodePEM ¶
func (k *Keys) DecodePEM(key string, sigAlgo crypto.SignatureAlgorithm) (*flow.AccountKey, error)
DecodePEM decodes a PEM encoded public key with specified signature algorithm.
func (*Keys) DerivePrivateKeyFromMnemonic ¶
func (k *Keys) DerivePrivateKeyFromMnemonic(mnemonic string, sigAlgo crypto.SignatureAlgorithm, derivationPath string) (crypto.PrivateKey, error)
func (*Keys) Generate ¶
func (k *Keys) Generate(inputSeed string, sigAlgo crypto.SignatureAlgorithm) (crypto.PrivateKey, error)
Generate generates a new private key from the given seed and signature algorithm.
func (*Keys) GetMnemonic ¶
func (*Keys) ParsePrivateKey ¶
func (k *Keys) ParsePrivateKey(inputPrivateKey string, sigAlgo crypto.SignatureAlgorithm) (crypto.PrivateKey, error)
Parses private key
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project is a service that handles all interactions for a state.
func NewProject ¶
NewProject returns a new state service.
func (*Project) CheckForStandardContractUsageOnMainnet ¶
func (*Project) Deploy ¶
Deploy the project for the provided network.
Retrieve all the contracts for specified network, sort them for deployment deploy one by one and replace the imports in the contract source so it corresponds to the account name the contract was deployed to.
func (*Project) Init ¶
func (p *Project) Init( readerWriter flowkit.ReaderWriter, reset bool, global bool, sigAlgo crypto.SignatureAlgorithm, hashAlgo crypto.HashAlgorithm, serviceKey crypto.PrivateKey, ) (*flowkit.State, error)
Init initializes a new project using the properties provided.
func (*Project) ReplaceStandardContractReferenceToAlias ¶
func (p *Project) ReplaceStandardContractReferenceToAlias(standardContract StandardContract) error
type ProjectDeploymentError ¶
type ProjectDeploymentError struct {
// contains filtered or unexported fields
}
func (*ProjectDeploymentError) Contracts ¶
func (d *ProjectDeploymentError) Contracts() map[string]error
func (*ProjectDeploymentError) Error ¶
func (d *ProjectDeploymentError) Error() string
type Scripts ¶
type Scripts struct {
// contains filtered or unexported fields
}
Scripts is a service that handles all script-related interactions.
func NewScripts ¶
NewScripts returns a new scripts service.
type Services ¶
type Services struct { Accounts *Accounts Scripts *Scripts Transactions *Transactions Keys *Keys Events *Events Collections *Collections Project *Project Blocks *Blocks Status *Status Snapshot *Snapshot Tests *Tests }
Services is a collection of services that provide domain-specific functionality for the different components of a Flow state.
func NewServices ¶
NewServices returns a new services collection for a state, initialized with a gateway and logger.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is a service that handles downloading the latest finalized root protocol snapshot from the gateway.
func NewSnapshot ¶
NewSnapshot returns a new snapshot service.
func (*Snapshot) GetLatestProtocolStateSnapshot ¶
GetLatestProtocolStateSnapshot returns the latest finalized protocol snapshot
type StandardContract ¶
Defines a Mainnet Standard Contract ( e.g Core Deployments, FungibleToken, NonFungibleToken )
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is a service that handles status of access node.
type Tests ¶
type Tests struct {
// contains filtered or unexported fields
}
Tests is a service that handles all tests-related interactions.
type Transactions ¶
type Transactions struct {
// contains filtered or unexported fields
}
Transactions is a service that handles all transaction-related interactions.
func NewTransactions ¶
func NewTransactions( gateway gateway.Gateway, state *flowkit.State, logger output.Logger, ) *Transactions
NewTransactions returns a new transactions service.
func (*Transactions) Build ¶
func (t *Transactions) Build( addresses *transactionAddresses, proposerKeyIndex int, script *flowkit.Script, gasLimit uint64, network string, ) (*flowkit.Transaction, error)
Build builds a transaction with specified payer, proposer and authorizer.
func (*Transactions) GetStatus ¶
func (t *Transactions) GetStatus( id flow.Identifier, waitSeal bool, ) (*flow.Transaction, *flow.TransactionResult, error)
GetStatus of transaction.
func (*Transactions) GetTransactionResultsByBlockID ¶
func (t *Transactions) GetTransactionResultsByBlockID(id flow.Identifier) ([]*flow.TransactionResult, error)
func (*Transactions) GetTransactionsByBlockID ¶
func (t *Transactions) GetTransactionsByBlockID(id flow.Identifier) ([]*flow.Transaction, error)
func (*Transactions) PostRLP ¶
func (t *Transactions) PostRLP(rlpUrl string, tx *flow.Transaction) error
func (*Transactions) Send ¶
func (t *Transactions) Send( accounts *transactionAccountRoles, script *flowkit.Script, gasLimit uint64, network string, ) (*flow.Transaction, *flow.TransactionResult, error)
Send a transaction code using the signer account and arguments for the specified network.
func (*Transactions) SendSigned ¶
func (t *Transactions) SendSigned(tx *flowkit.Transaction) (*flow.Transaction, *flow.TransactionResult, error)
SendSigned sends the transaction that is already signed.
func (*Transactions) Sign ¶
func (t *Transactions) Sign( signer *flowkit.Account, payload []byte, ) (*flowkit.Transaction, error)
Sign transaction payload using the signer account.