Documentation ¶
Index ¶
- func EventsToWebhookParams(events []*FormatedEvent) *discordgo.WebhookParams
- type FlowScriptBuilder
- func (t FlowScriptBuilder) AccountArgument(key string) FlowScriptBuilder
- func (t FlowScriptBuilder) Argument(value cadence.Value) FlowScriptBuilder
- func (t FlowScriptBuilder) Run()
- func (t FlowScriptBuilder) RunReturns() cadence.Value
- func (t FlowScriptBuilder) StringArgument(value string) FlowScriptBuilder
- func (t FlowScriptBuilder) UFix64Argument(key string) FlowScriptBuilder
- type FlowTransactionBuilder
- func (t FlowTransactionBuilder) AccountArgument(key string) FlowTransactionBuilder
- func (t FlowTransactionBuilder) Argument(value cadence.Value) FlowTransactionBuilder
- func (t FlowTransactionBuilder) PayloadSigner(value string) FlowTransactionBuilder
- func (t FlowTransactionBuilder) Run()
- func (t FlowTransactionBuilder) SignProposeAndPayAs(signer string) FlowTransactionBuilder
- func (t FlowTransactionBuilder) StringArgument(value string) FlowTransactionBuilder
- func (t FlowTransactionBuilder) UFix64Argument(key string) FlowTransactionBuilder
- type FormatedEvent
- type GoWithTheFlow
- func (f *GoWithTheFlow) CreateAccount(accountName string)
- func (f *GoWithTheFlow) DeployContract(contractName string)
- func (f *GoWithTheFlow) FetchEvents(query client.EventRangeQuery) ([]*FormatedEvent, error)
- func (f *GoWithTheFlow) FindAddress(key string) cadence.Address
- func (f *GoWithTheFlow) ScriptFromFile(filename string) FlowScriptBuilder
- func (f *GoWithTheFlow) TransactionFromFile(filename string) FlowTransactionBuilder
- type GoWithTheFlowAccount
- type RawAccount
- type RawFlowConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventsToWebhookParams ¶
func EventsToWebhookParams(events []*FormatedEvent) *discordgo.WebhookParams
EventsToWebhookParams convert events to rich webhook
Types ¶
type FlowScriptBuilder ¶
type FlowScriptBuilder struct { GoWithTheFlow *GoWithTheFlow FileName string Arguments []cadence.Value }
FlowScriptBuilder is a struct to hold information for running a script
func (FlowScriptBuilder) AccountArgument ¶
func (t FlowScriptBuilder) AccountArgument(key string) FlowScriptBuilder
AccountArgument add an account as an argument
func (FlowScriptBuilder) Argument ¶
func (t FlowScriptBuilder) Argument(value cadence.Value) FlowScriptBuilder
Argument add an argument to the transaction
func (FlowScriptBuilder) RunReturns ¶
func (t FlowScriptBuilder) RunReturns() cadence.Value
RunReturns executes a read only script
func (FlowScriptBuilder) StringArgument ¶
func (t FlowScriptBuilder) StringArgument(value string) FlowScriptBuilder
StringArgument add an argument to the transaction
func (FlowScriptBuilder) UFix64Argument ¶
func (t FlowScriptBuilder) UFix64Argument(key string) FlowScriptBuilder
UFix64Argument add an account as an argument
type FlowTransactionBuilder ¶
type FlowTransactionBuilder struct { GoWithTheFlow *GoWithTheFlow FileName string Arguments []cadence.Value MainSigner *GoWithTheFlowAccount PayloadSigners []*GoWithTheFlowAccount }
FlowTransactionBuilder used to create a builder pattern for a transaction
func (FlowTransactionBuilder) AccountArgument ¶
func (t FlowTransactionBuilder) AccountArgument(key string) FlowTransactionBuilder
AccountArgument add an account as an argument
func (FlowTransactionBuilder) Argument ¶
func (t FlowTransactionBuilder) Argument(value cadence.Value) FlowTransactionBuilder
Argument add an argument to the transaction
func (FlowTransactionBuilder) PayloadSigner ¶
func (t FlowTransactionBuilder) PayloadSigner(value string) FlowTransactionBuilder
PayloadSigner set a signer for the payload
func (FlowTransactionBuilder) SignProposeAndPayAs ¶
func (t FlowTransactionBuilder) SignProposeAndPayAs(signer string) FlowTransactionBuilder
SignProposeAndPayAs set the payer, proposer and envelope signer
func (FlowTransactionBuilder) StringArgument ¶
func (t FlowTransactionBuilder) StringArgument(value string) FlowTransactionBuilder
StringArgument add an argument to the transaction
func (FlowTransactionBuilder) UFix64Argument ¶
func (t FlowTransactionBuilder) UFix64Argument(key string) FlowTransactionBuilder
UFix64Argument add an account as an argument
type FormatedEvent ¶
type FormatedEvent struct { Name string `json:"name"` BlockHeight uint64 `json:"blockHeight,omitempty"` Time time.Time `json:"time,omitempty"` Fields map[string]string `json:"fields"` }
FormatedEvent event in a more condensed formated form
func ParseEvent ¶
func ParseEvent(ev flow.Event) (*FormatedEvent, error)
Not really happy with this code, would love something simpler ParseEvent parses a flow.Event into a more condensed form without type info for viewing
type GoWithTheFlow ¶
type GoWithTheFlow struct { Service GoWithTheFlowAccount Accounts map[string]GoWithTheFlowAccount Address string Gas uint64 }
GoWithTheFlow Entire configuration to work with Go With the Flow
func NewGoWithTheFlowDevNet ¶
func NewGoWithTheFlowDevNet() *GoWithTheFlow
NewGoWithTheFlowDevNet setup devnot like in https://www.notion.so/Accessing-Flow-Devnet-ad35623797de48c08d8b88102ea38131
func NewGoWithTheFlowEmulator ¶
func NewGoWithTheFlowEmulator() *GoWithTheFlow
NewGoWithTheFlowEmulator create a new client
func NewGoWithTheFlowError ¶
func NewGoWithTheFlowError(fileName string) (*GoWithTheFlow, error)
NewGoWithTheFlowError creates a new local go with the flow client
func (*GoWithTheFlow) CreateAccount ¶ added in v2.0.3
func (f *GoWithTheFlow) CreateAccount(accountName string)
CreateAccount will create an account for running transactions without a contract
func (*GoWithTheFlow) DeployContract ¶ added in v2.0.3
func (f *GoWithTheFlow) DeployContract(contractName string)
DeployContract will deploy a contract with the given name to an account with the same name from wallet.json
func (*GoWithTheFlow) FetchEvents ¶ added in v2.0.3
func (f *GoWithTheFlow) FetchEvents(query client.EventRangeQuery) ([]*FormatedEvent, error)
FetchEvents fetches events for the given query and formats them
func (*GoWithTheFlow) FindAddress ¶ added in v2.0.3
func (f *GoWithTheFlow) FindAddress(key string) cadence.Address
FindAddress finds an candence.Address value from a given key in your wallet
func (*GoWithTheFlow) ScriptFromFile ¶
func (f *GoWithTheFlow) ScriptFromFile(filename string) FlowScriptBuilder
ScriptFromFile will start a flow script builder
func (*GoWithTheFlow) TransactionFromFile ¶
func (f *GoWithTheFlow) TransactionFromFile(filename string) FlowTransactionBuilder
TransactionFromFile will start a flow transaction builder
type GoWithTheFlowAccount ¶ added in v2.0.3
type GoWithTheFlowAccount struct { Address flow.Address SigAlgo crypto.SignatureAlgorithm HashAlgo crypto.HashAlgorithm PrivateKey crypto.PrivateKey //These three are set the first time they are accessed Signer *crypto.InMemorySigner Account *flow.Account Key *flow.AccountKey }
GoWithTheFlowAccount represents an account for flow with resolves types
func (*GoWithTheFlowAccount) EnrichWithAccountSignerAndKey ¶ added in v2.0.3
func (a *GoWithTheFlowAccount) EnrichWithAccountSignerAndKey(c *client.Client) (*GoWithTheFlowAccount, error)
EnrichWithAccountSignerAndKey enriches and Account
func (*GoWithTheFlowAccount) NewAccountKey ¶ added in v2.0.3
func (a *GoWithTheFlowAccount) NewAccountKey() *flow.AccountKey
NewAccountKey creates a NewFlowAccountKey
type RawAccount ¶ added in v2.0.3
type RawAccount struct { Address string `json:"address"` PrivateKey string `json:"privateKey"` SigAlgo string `json:"sigAlgorithm"` HashAlgo string `json:"hashAlgorithm"` }
RawAccount flow accounts struct for marshalling into primitive types
type RawFlowConfig ¶ added in v2.0.3
type RawFlowConfig struct { Address string GasLimit uint64 Accounts map[string]RawAccount EmulatorAccounts map[string]string }
RawFlowConfig for marshalling into simple types
func NewRawFlowConfig ¶ added in v2.0.3
func NewRawFlowConfig(path string) (*RawFlowConfig, error)
NewRawFlowConfig will read the flow.json file