signer

package
v0.0.0-...-6cc7e75 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiEndpoint      = "https://api.warpcast.com/v2/signed-key-requests"
	ApiEndpointCheck = "https://api.warpcast.com/v2/signed-key-request"
)

Variables

View Source
var SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = apitypes.TypedDataDomain{
	Name:              "Farcaster SignedKeyRequestValidator",
	Version:           "1",
	ChainId:           math.NewHexOrDecimal256(10),
	VerifyingContract: "0x00000000FC700472606ED4fA22623Acf62c60553",
}
View Source
var SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_TYPES = map[string][]apitypes.Type{
	"EIP712Domain": {
		{Name: "name", Type: "string"},
		{Name: "version", Type: "string"},
		{Name: "chainId", Type: "uint256"},
		{Name: "verifyingContract", Type: "address"},
	},
	"SignedKeyRequest": {
		{Name: "requestFid", Type: "uint256"},
		{Name: "key", Type: "bytes"},
		{Name: "deadline", Type: "uint256"},
	},
}

Functions

func GenerateSigner

func GenerateSigner() (ed25519.PublicKey, ed25519.PrivateKey, error)

GenerateSigner generates an Ed25519 key pair.

func MnemonicToPrivateKey

func MnemonicToPrivateKey(mnemonic string) (*ecdsa.PrivateKey, error)

func RegisterSigner

func RegisterSigner(privKey *ecdsa.PrivateKey, signer ed25519.PublicKey, fid uint64) (string, chan (uint64), error)

RegisterSigner sends a request to WarpCast API and returns the deep link URL to send to the user. It also returns a channel, which will be used to notify when signer registration is processed. The channel will return the FID of the user.

func SignData

func SignData(privateKey ed25519.PrivateKey, data []byte) (signature []byte, err error)

SignData signs the data using the private key.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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