Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateSigner() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func MnemonicToPrivateKey(mnemonic string) (*ecdsa.PrivateKey, error)
- func RegisterSigner(privKey *ecdsa.PrivateKey, signer ed25519.PublicKey, fid uint64) (string, chan (uint64), error)
- func SignData(privateKey ed25519.PrivateKey, data []byte) (signature []byte, err error)
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.