farcaster

package
v0.0.0-...-bab6c82 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionPost         = "post"
	ActionPostRedirect = "post_redirect"
	ActionMint         = "mint"
	ActionLink         = "link"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AspectRatio

type AspectRatio string
const (
	AspectRatio_1_1 AspectRatio = "1:1"
	AspectRatio_2_1 AspectRatio = "1.9:1"
)

func (AspectRatio) String

func (s AspectRatio) String() string

type Button

type Button struct {
	// Label (required) a string to be displayed on the button
	Label string
	// Action must be `post`, `post_redirect`, `mint` or `link`. Defaults to `post` if not specified
	Action string
	// Target (optional) URL to send the Signature Packet to.
	Target string
}

Button represents a button to be displayed in the farcaster client.

func NewLinkButton

func NewLinkButton(label string, URL string) Button

NewLinkButton creates a new button with the action set to `link`.

func NewMintButton

func NewMintButton(label string) Button

NewMintButton creates a new button with the action set to `mint`.

func NewPostButton

func NewPostButton(label string) Button

NewPostButton creates a new button with the action set to `post`.

func NewPostRedirectButton

func NewPostRedirectButton(label string, URL string) Button

NewPostRedirectButton creates a new button with the action set to `post_redirect`.

type CastID

type CastID struct {
	FID  int
	Hash string
}

CastID represents a farcaster account

type Frame

type Frame struct {
	// Version (required) a valid frame version string. The string must be a release date (e.g. 2020-01-01) or vNext.
	Version string
	// Image (required) to be rendered in the frame
	Image Image
	// InputLabel (optional) when set, frame will include an input field with the given label
	InputLabel string
	// Buttons 0 or more buttons to be rendered in the frame
	Buttons []Button
	// PostURL is a 256-byte string which contains a valid URL to send the Signature Packet to
	PostURL string
}

Frame represents a frame to be displayed in the farcaster client.

type FrameAction

type FrameAction struct {
	Url         string
	ButtonIndex int
	InputText   string
	CastID      CastID
}

FrameAction represents an action performed within a frame in the farcaster client.

type Image

type Image struct {
	URL         string
	AspectRatio AspectRatio
}

type Message

type Message struct {
	Data            MessageData
	Hash            string
	HashScheme      string
	Signature       string
	SignatureScheme string
	Signer          string
}

Message represents a message from farcaster to the frame server

type MessageData

type MessageData struct {
	Type            string
	FID             int
	Timestamp       time.Time
	Network         string
	FrameActionBody FrameAction
}

MessageData holds the actual data of a message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL