Documentation ¶
Index ¶
- func CadenceValueToInterface(field cadence.Value) interface{}
- func EncodeMessageFromVoucher(v *Voucher) string
- func FloatBalanceToUint(balance float64) uint64
- func GetUserCompositeSignatureFromVoucher(v *Voucher) *[]CompositeSignature
- func WaitForSeal(ctx context.Context, c *client.Client, id flow.Identifier) (*flow.TransactionResult, *flow.Transaction, error)
- type Allowlist
- type Choice
- type CompositeSignature
- type Config
- type Contract
- type CustomScript
- type Database
- type FTBalanceResponse
- type FlowAdapter
- func (fa *FlowAdapter) CheckIfUserHasEvent(voterAddr string, c *Contract) (bool, error)
- func (fa *FlowAdapter) EnforceTokenThreshold(scriptPath, creatorAddr string, c *Contract) (bool, error)
- func (fa *FlowAdapter) GetAccountAtBlockHeight(addr string, blockheight uint64) (*flow.Account, error)
- func (fa *FlowAdapter) GetAddressBalanceAtBlockHeight(addr string, blockHeight uint64, balanceResponse *FTBalanceResponse, ...) error
- func (fa *FlowAdapter) GetCurrentBlockHeight() (int, error)
- func (fa *FlowAdapter) GetEventNFT(voterAddr string, c *Contract) (interface{}, error)
- func (fa *FlowAdapter) GetFTBalance(address string, blockHeight uint64, contractName string, ...) (float64, error)
- func (fa *FlowAdapter) GetFloatNFTIds(voterAddr string, c *Contract) ([]interface{}, error)
- func (fa *FlowAdapter) GetFlowBalance(address string, blockHeight uint64) ([]float64, error)
- func (fa *FlowAdapter) GetNFTIds(voterAddr string, c *Contract, path string) ([]interface{}, error)
- func (fa *FlowAdapter) ReplaceContractPlaceholders(code string, c *Contract, isFungible bool) []byte
- func (fa *FlowAdapter) ValidateSignature(address, message string, sigs *[]CompositeSignature, messageType string) error
- type FlowConfig
- type FlowContract
- type IpfsClient
- type MintParams
- type PageParams
- type PaginatedResponse
- type PayloadSig
- type Pin
- type ProposalKey
- type SearchFilter
- type StrategyStruct
- type TimestampSignaturePayload
- type Voucher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CadenceValueToInterface ¶
func FloatBalanceToUint ¶
func GetUserCompositeSignatureFromVoucher ¶
func GetUserCompositeSignatureFromVoucher(v *Voucher) *[]CompositeSignature
Non-custodial wallets will only contain one signer, so payloadSigs will be empty, and only the envelope will be signed. For Custodial wallets (Blocto/Dapper), the user signs the tx payload and envelope is signed by custodian.
This function returns only the signature generated by the user
Types ¶
type Choice ¶
type Choice struct { Choice_text string `json:"choiceText"` Choice_img_url *string `json:"choiceImgUrl"` }
used in models/proposal.go
type CompositeSignature ¶
type Contract ¶
type Contract struct { Name *string `json:"name,omitempty"` Addr *string `json:"addr,omitempty"` Public_path *string `json:"publicPath,omitempty"` Threshold *float64 `json:"threshold,omitempty,string"` MaxWeight *float64 `json:"maxWeight,omitempty,string"` Float_event_id *uint64 `json:"floatEventId,omitempty,string"` Script *string `json:"script,omitempty"` }
type CustomScript ¶
type FTBalanceResponse ¶
type FTBalanceResponse struct { ID string `json:"id,omitempty"` FungibleTokenID string `json:"fungibleTokenId"` Addr string `json:"addr"` PrimaryAccountBalance uint64 `json:"primaryAccountBalance"` SecondaryAddress string `json:"secondaryAddress"` SecondaryAccountBalance uint64 `json:"secondaryAccountBalance"` Balance uint64 `json:"balance"` StakingBalance uint64 `json:"stakingBalance"` ScriptResult string `json:"scriptResult"` Stakes []string `json:"stakes"` BlockHeight uint64 `json:"blockHeight"` Proposal_id int `json:"proposal_id"` NFTCount int `json:"nftCount"` CreatedAt time.Time `json:"createdAt"` }
func (*FTBalanceResponse) NewFTBalance ¶
func (b *FTBalanceResponse) NewFTBalance()
type FlowAdapter ¶
type FlowAdapter struct { Config FlowConfig ArchiveClient *client.Client LiveClient *client.Client Context context.Context CustomScriptsMap map[string]CustomScript URL string ArchiveURL string Env string }
func NewFlowClient ¶
func NewFlowClient(flowEnv string, customScriptsMap map[string]CustomScript) *FlowAdapter
func (*FlowAdapter) CheckIfUserHasEvent ¶
func (fa *FlowAdapter) CheckIfUserHasEvent(voterAddr string, c *Contract) (bool, error)
func (*FlowAdapter) EnforceTokenThreshold ¶
func (fa *FlowAdapter) EnforceTokenThreshold(scriptPath, creatorAddr string, c *Contract) (bool, error)
func (*FlowAdapter) GetAccountAtBlockHeight ¶
func (fa *FlowAdapter) GetAccountAtBlockHeight(addr string, blockheight uint64) (*flow.Account, error)
func (*FlowAdapter) GetAddressBalanceAtBlockHeight ¶
func (fa *FlowAdapter) GetAddressBalanceAtBlockHeight(addr string, blockHeight uint64, balanceResponse *FTBalanceResponse, contract *Contract) error
func (*FlowAdapter) GetCurrentBlockHeight ¶
func (fa *FlowAdapter) GetCurrentBlockHeight() (int, error)
func (*FlowAdapter) GetEventNFT ¶
func (fa *FlowAdapter) GetEventNFT(voterAddr string, c *Contract) (interface{}, error)
func (*FlowAdapter) GetFTBalance ¶
func (fa *FlowAdapter) GetFTBalance(address string, blockHeight uint64, contractName string, contractAddress string, publicPath string) (float64, error)
@bluesign: this is called via archival node now
func (*FlowAdapter) GetFloatNFTIds ¶
func (fa *FlowAdapter) GetFloatNFTIds(voterAddr string, c *Contract) ([]interface{}, error)
func (*FlowAdapter) GetFlowBalance ¶
func (fa *FlowAdapter) GetFlowBalance(address string, blockHeight uint64) ([]float64, error)
func (*FlowAdapter) GetNFTIds ¶
func (fa *FlowAdapter) GetNFTIds(voterAddr string, c *Contract, path string) ([]interface{}, error)
func (*FlowAdapter) ReplaceContractPlaceholders ¶
func (fa *FlowAdapter) ReplaceContractPlaceholders(code string, c *Contract, isFungible bool) []byte
func (*FlowAdapter) ValidateSignature ¶
func (fa *FlowAdapter) ValidateSignature(address, message string, sigs *[]CompositeSignature, messageType string) error
type FlowConfig ¶
type FlowConfig struct { Contracts map[string]FlowContract `json:"contracts"` Networks map[string]string `json:"networks"` }
type FlowContract ¶
type IpfsClient ¶
type IpfsClient struct { BaseURL string HTTPClient *http.Client // contains filtered or unexported fields }
func NewIpfsClient ¶
func NewIpfsClient(apiKey string, apiSecret string) *IpfsClient
func (*IpfsClient) PinJson ¶
func (c *IpfsClient) PinJson(data interface{}) (*Pin, error)
type MintParams ¶
type PaginatedResponse ¶
type PaginatedResponse struct { Data interface{} `json:"data"` Start int `json:"start"` Count int `json:"count"` TotalRecords int `json:"totalRecords"` Next int `json:"next"` }
func GetPaginatedResponseWithPayload ¶
func GetPaginatedResponseWithPayload(payload interface{}, p PageParams) *PaginatedResponse
Underlying value of payload needs to be a slice
type PayloadSig ¶
type ProposalKey ¶
type SearchFilter ¶
type StrategyStruct ¶
type StrategyStruct struct { FlowAdapter *FlowAdapter DB *Database }
type TimestampSignaturePayload ¶
type TimestampSignaturePayload struct { Composite_signatures *[]CompositeSignature `json:"compositeSignatures"` Signing_addr string `json:"signingAddr"` Timestamp string `json:"timestamp"` }
type Voucher ¶
type Voucher struct { Cadence string `json:"cadence"` RefBlock string `json:"refBlock"` ComputeLimit uint `json:"computeLimit"` Arguments []map[string]string `json:"arguments"` Payer string `json:"payer"` Authorizers []string `json:"authorizers"` ProposalKey ProposalKey `json:"proposalKey"` PayloadSigs []PayloadSig `json:"payloadSigs"` EnvelopeSigs []PayloadSig `json:"envelopeSigs"` }
Click to show internal directories.
Click to hide internal directories.