Documentation ¶
Index ¶
- type Accounts
- func (a *Accounts) AddContract(account *flowkit.Account, contractName string, contractSource []byte, ...) (*flow.Account, 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.Account, 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
- type Project
- type Scripts
- type Services
- type Snapshot
- type Status
- type Transactions
- func (t *Transactions) Build(proposer flow.Address, authorizers []flow.Address, payer flow.Address, ...) (*flowkit.Transaction, error)
- func (t *Transactions) GetStatus(id flow.Identifier, waitSeal bool) (*flow.Transaction, *flow.TransactionResult, error)
- func (t *Transactions) Send(signer *flowkit.Account, code []byte, codeFilename string, gasLimit uint64, ...) (*flow.Transaction, *flow.TransactionResult, error)
- func (t *Transactions) SendSigned(payload []byte, approveSend bool) (*flow.Transaction, *flow.TransactionResult, error)
- func (t *Transactions) Sign(signer *flowkit.Account, payload []byte, approveSigning bool) (*flowkit.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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, contractName string, contractSource []byte, updateExisting bool, ) (*flow.Account, 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 ¶ added in v0.30.3
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, []client.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 ¶ added in v0.27.0
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 ¶ added in v0.27.0
type EventWorkerResult struct { Events []client.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) 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.
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) 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 address 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.
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 }
Services is a collection of services that provide domain-specific functionality for the different components of a Flow state.
type Snapshot ¶ added in v0.30.3
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 ¶ added in v0.30.3
NewSnapshot returns a new snapshot service.
func (*Snapshot) GetLatestProtocolStateSnapshot ¶ added in v0.30.3
GetLatestProtocolStateSnapshot returns the latest finalized protocol snapshot
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is a service that handles status of access node.
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( proposer flow.Address, authorizers []flow.Address, payer flow.Address, proposerKeyIndex int, code []byte, codeFilename string, gasLimit uint64, args []cadence.Value, network string, approveBuild bool, ) (*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) Send ¶
func (t *Transactions) Send( signer *flowkit.Account, code []byte, codeFilename string, gasLimit uint64, args []cadence.Value, 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( payload []byte, approveSend bool, ) (*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, approveSigning bool, ) (*flowkit.Transaction, error)
Sign transaction payload using the signer account.