Documentation
¶
Overview ¶
Sequence core primitives
DecodeSignature takes raw signature data and returns a Signature. A Signature can Recover the WalletConfig it represents. A WalletConfig describes the configuration of signers that control a wallet.
Index ¶
- Variables
- func RegisterCore[C WalletConfig, S Signature[C]](core Core[C, S])
- func SigningOrchestrator(ctx context.Context, signers map[common.Address]uint16, sign SigningFunction) chan SignerSignature
- type Core
- type Digest
- type ImageHash
- type ImageHashable
- type Signature
- type SignerSignature
- type SignerSignatureType
- type SignerSignatures
- type SigningFunction
- type Subdigest
- type WalletConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSigningFunctionNotReady = fmt.Errorf("signing function not ready")
ErrSigningFunctionNotReady is returned when a signing function is not ready to sign and should be retried later.
Functions ¶
func RegisterCore ¶ added in v0.22.0
func RegisterCore[C WalletConfig, S Signature[C]](core Core[C, S])
func SigningOrchestrator ¶ added in v0.22.0
func SigningOrchestrator(ctx context.Context, signers map[common.Address]uint16, sign SigningFunction) chan SignerSignature
Types ¶
type Core ¶
type Core[C WalletConfig, S Signature[C]] interface { // DecodeSignature takes raw signature data and returns a Signature that can Recover a WalletConfig. DecodeSignature(data []byte) (S, error) // DecodeWalletConfig takes a decoded JSON object and returns a WalletConfig. DecodeWalletConfig(object any) (C, error) }
func GetCoreForWalletConfig ¶ added in v0.22.0
func GetCoreForWalletConfig[C WalletConfig]() (Core[C, Signature[C]], error)
type Digest ¶
type Digest struct {
common.Hash
// Preimage is the preimage of the digest, nil if unknown.
Preimage []byte
}
A Digest is a hash signed by a Sequence wallet. Used for type safety and preimage recovery.
func (Digest) ApprovedImageHash ¶
ApprovedImageHash recovers the ImageHash that the Digest approves for subsequent signatures, if known.
type ImageHash ¶
type ImageHash struct {
common.Hash
// Preimage is the ImageHashable with this ImageHash, nil if unknown.
Preimage ImageHashable
}
An ImageHash is a digest of an ImageHashable. Used for type safety and preimage recovery.
type ImageHashable ¶
type ImageHashable interface {
// ImageHash is the digest of the object.
ImageHash() ImageHash
}
An ImageHashable is an object with an ImageHash.
type Signature ¶
type Signature[C WalletConfig] interface { // Threshold is the minimum signing weight required for a signature to be valid. Threshold() uint16 // Checkpoint is the nonce of the wallet configuration that the signature applies to. Checkpoint() uint32 // Recover derives the wallet configuration that the signature applies to. // Also returns the signature's weight. // If chainID is not provided, provider must be provided. // If provider is not provided, EIP-1271 signatures are assumed to be NOT valid and ignored. // If signerSignatures is provided, it will be populated with the valid signer signatures of this signature. Recover(ctx context.Context, digest Digest, wallet common.Address, chainID *big.Int, provider *ethrpc.Provider, signerSignatures ...SignerSignatures) (C, *big.Int, error) // Recover a signature but only using the subdigest RecoverSubdigest(ctx context.Context, subdigest Subdigest, provider *ethrpc.Provider, signerSignatures ...