farcaster

package
v0.0.0-...-0177554 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserNotOnFarcaster = errors.New("user is not on farcaster")

Functions

This section is empty.

Types

type EIP712Domain

type EIP712Domain struct {
	Name              string   `json:"name"`
	Version           string   `json:"version"`
	ChainID           *big.Int `json:"chainId"`
	VerifyingContract string   `json:"verifyingContract"`
}

type NeynarAPI

type NeynarAPI struct {
	// contains filtered or unexported fields
}

func NewNeynarAPI

func NewNeynarAPI(httpClient *http.Client, redisCache *redis.Cache, q *db.Queries) *NeynarAPI

func (*NeynarAPI) CreateSignerForUser

func (n *NeynarAPI) CreateSignerForUser(ctx context.Context, fid NeynarID) (NeynarSigner, error)

func (*NeynarAPI) FarcasterIDByUserID

func (n *NeynarAPI) FarcasterIDByUserID(ctx context.Context, userID persist.DBID) (NeynarID, error)

FarcasterIDByUserID returns the FID of a user via the user's Gallery ID. ErrUserNotOnFarcaster is returned if the user is not on Farcaster based off their connected wallets.

func (*NeynarAPI) FollowersByUserID

func (n *NeynarAPI) FollowersByUserID(ctx context.Context, fid NeynarID) ([]NeynarUser, error)

func (*NeynarAPI) FollowingByUserID

func (n *NeynarAPI) FollowingByUserID(ctx context.Context, fid string) ([]NeynarUser, error)

func (*NeynarAPI) GetSignerByUUID

func (n *NeynarAPI) GetSignerByUUID(ctx context.Context, uuid string) (NeynarSigner, error)

func (*NeynarAPI) UserByAddress

func (n *NeynarAPI) UserByAddress(ctx context.Context, address persist.Address) (NeynarUser, error)

func (*NeynarAPI) UsersByAddresses

func (n *NeynarAPI) UsersByAddresses(ctx context.Context, addresses []persist.Address, custodyAddressesOnly bool) (map[persist.Address][]NeynarUser, error)

type NeynarFollowsReponse

type NeynarFollowsReponse struct {
	Result struct {
		Users []NeynarUser `json:"users"`
		Next  struct {
			Cursor string `json:"cursor"`
		} `json:"next"`
	} `json:"result"`
}

type NeynarID

type NeynarID string

func (NeynarID) MarshalJSON

func (n NeynarID) MarshalJSON() ([]byte, error)

func (NeynarID) String

func (n NeynarID) String() string

func (*NeynarID) UnmarshalJSON

func (n *NeynarID) UnmarshalJSON(b []byte) error

could be a string or a number

type NeynarSigner

type NeynarSigner struct {
	SignerUUID        string `json:"signer_uuid"`
	PublicKey         string `json:"public_key"`
	Status            string `json:"status"`
	SignerApprovalURL string `json:"signer_approval_url"`
	SignerApprovalFID any    `json:"fid"`
}

type NeynarUser

type NeynarUser struct {
	Fid         NeynarID `json:"fid"`
	Username    string   `json:"username"`
	DisplayName string   `json:"displayName"`
	Pfp         struct {
		URL string `json:"url"`
	} `json:"pfp"`
	Profile struct {
		Bio struct {
			Text string `json:"text"`
		} `json:"bio"`
	} `json:"profile"`
	VerifiedAddresses struct {
		EthAddresses []persist.Address `json:"eth_addresses"`
		SolAddresses []persist.Address `json:"sol_addresses"`
	} `json:"verified_addresses"`
}

type NeynarUserByVerificationResponse

type NeynarUserByVerificationResponse struct {
	Result *struct {
		User NeynarUser `json:"user"`
	} `json:"result"`
}

type SignedKeyRequest

type SignedKeyRequest struct {
	RequestFid *big.Int `json:"requestFid"`
	Key        []byte   `json:"key"`
	Deadline   *big.Int `json:"deadline"`
}

Jump to

Keyboard shortcuts

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