Versions in this module Expand all Collapse all v0 v0.1.1 Nov 12, 2026 v0.1.0 Oct 14, 2026 Changes in this version + const ClockSkew + const ColAddress + const ColChainID + const ColCreatedAt + const ColID + const ColLastUsed + const ColPrimary + const ColUserID + const DefaultNonceTTL + const EndpointLink + const EndpointNonce + const EndpointUnlink + const EndpointVerify + const EndpointWallets + const MaxMessageLength + const MinNonceLength + const PluginName + const PurposeNonce + const TableAliasWallet + const TableNameWallet + const Version + var ErrAddressInvalid = errors.New("siwe: not an Ethereum address, or its EIP-55 checksum does not match") + var ErrAddressInvalidInput = auth.NewError("siwe.address_invalid", http.StatusBadRequest, ...) + var ErrChainInvalid = auth.NewError("siwe.chain_invalid", http.StatusBadRequest, "This network is not accepted.") + var ErrDomainInvalid = auth.NewError("siwe.domain_invalid", http.StatusBadRequest, ...) + var ErrEmailNotAccepted = auth.NewError("siwe.email_not_accepted", http.StatusBadRequest, ...) + var ErrEmailRequired = auth.NewError("siwe.email_required", http.StatusBadRequest, ...) + var ErrMessageExpired = auth.NewError("siwe.message_expired", http.StatusBadRequest, ...) + var ErrMessageInvalid = auth.NewError("siwe.message_invalid", http.StatusBadRequest, ...) + var ErrMessageMalformed = errors.New("siwe: not an ERC-4361 message") + var ErrNoOrigin = errors.New(...) + var ErrNonceInvalid = auth.NewError("siwe.nonce_invalid", http.StatusBadRequest, ...) + var ErrRequireEmailNoKind = errors.New("siwe: RequireEmail needs the email plugin, which holds the address") + var ErrSignUpDisabled = auth.NewError("siwe.sign_up_disabled", http.StatusForbidden, ...) + var ErrSignatureInvalid = auth.NewError("siwe.signature_invalid", http.StatusUnauthorized, ...) + var ErrSignatureMismatch = errors.New("siwe: the signature is not the address's") + var ErrWalletLinkedElsewhere = auth.NewError("siwe.wallet_linked_elsewhere", http.StatusConflict, ...) + var ErrWalletNotFound = auth.NewError("siwe.wallet_not_found", http.StatusNotFound, "No such wallet.") + var TableWallet = sqlb.Table + var WalletAddress = sqlb.Col[string](TableWallet, ColAddress) + var WalletChainID = sqlb.Col[int64](TableWallet, ColChainID) + var WalletCreatedAt = sqlb.Col[time.Time](TableWallet, ColCreatedAt) + var WalletID = sqlb.Col[string](TableWallet, ColID) + var WalletLastUsed = sqlb.Col[*time.Time](TableWallet, ColLastUsed) + var WalletPrimary = sqlb.Col[bool](TableWallet, ColPrimary) + var WalletUserID = sqlb.Col[string](TableWallet, ColUserID) + func ChecksumAddress(normalized string) string + func DecodeSignature(s string) ([]byte, error) + func NormalizeAddress(s string) (string, error) + func PersonalSignHash(text string) []byte + func RecoverAddress(text string, sig []byte) (string, error) + type LinkRequest struct + Message string + Signature string + type Message struct + Address string + ChainID int64 + Domain string + ExpirationTime *time.Time + IssuedAt time.Time + Nonce string + NotBefore *time.Time + RequestID string + Resources []string + Scheme string + Statement string + URI string + Version string + func ParseMessage(text string) (Message, error) + func (m Message) String() string + type NameResolver interface + LookupName func(ctx context.Context, address string, chainID int64) (WalletName, error) + type NameResolverFunc func(ctx context.Context, address string, chainID int64) (WalletName, error) + func (f NameResolverFunc) LookupName(ctx context.Context, address string, chainID int64) (WalletName, error) + type NonceRequest struct + ChainID int64 + WalletAddress string + type NonceResult struct + Nonce string + type Option func(*Plugin) + func Chains(ids ...int64) Option + func NoSignUp() Option + func Origins(origins ...string) Option + func RequireEmail() Option + func WithNameResolver(r NameResolver) Option + func WithNonceTTL(d time.Duration) Option + func WithVerifier(v Verifier) Option + type PersonalSign struct + func (PersonalSign) VerifySignature(_ context.Context, m SignedMessage) error + type Plugin struct + func New(opts ...Option) *Plugin + func (p *Plugin) Init(a *auth.Auth) error + func (p *Plugin) Link(ctx context.Context, in LinkRequest) (Wallet, error) + func (p *Plugin) Name() string + func (p *Plugin) Nonce(ctx context.Context, address string, chainID int64) (string, error) + func (p *Plugin) Operations() []auth.Operation + func (p *Plugin) OptionErr() error + func (p *Plugin) RateLimits() []auth.RateRule + func (p *Plugin) SignInCredentials(ctx context.Context, userID, exceptID string) (int, error) + func (p *Plugin) SignsIn() bool + func (p *Plugin) Tables() []sqlb.Table + func (p *Plugin) TypedMigrations(engine string, t auth.SQLTypes) ([]auth.Migration, error) + func (p *Plugin) Unlink(ctx context.Context, id string) error + func (p *Plugin) UserTables() []auth.UserTable + func (p *Plugin) Validate(c *auth.Config) error + func (p *Plugin) Verify(ctx context.Context, in VerifyRequest) (SignInResult, error) + func (p *Plugin) Wallets(ctx context.Context) ([]Wallet, error) + type SignInResult struct + Created bool + SecondFactorRequired bool + Token auth.Token + User auth.UserView + Wallet Wallet + type SignedMessage struct + Message Message + Signature []byte + Text string + type UnlinkRequest struct + ID string + type Verifier interface + VerifySignature func(ctx context.Context, m SignedMessage) error + type VerifierFunc func(ctx context.Context, m SignedMessage) error + func (f VerifierFunc) VerifySignature(ctx context.Context, m SignedMessage) error + type VerifyRequest struct + ChainID int64 + Email string + Message string + Signature string + WalletAddress string + type Wallet struct + Address string + ChainID int64 + CreatedAt time.Time + ID string + LastUsedAt *time.Time + Primary bool + type WalletName struct + Avatar string + Name string + type WalletsResult struct + Wallets []Wallet