Documentation ¶
Index ¶
- Constants
- Variables
- func AddressFromImageHash(imageHash string, context WalletContext) (common.Address, error)
- func AddressFromWalletConfig(walletConfig core.WalletConfig, context WalletContext) (common.Address, error)
- func BuildProxy(addr common.Address) string
- func ComputeGuestExecDigest(txns Transactions) (common.Hash, error)
- func ComputeSelfExecDigest(txns Transactions) (common.Hash, error)
- func ComputeWalletExecDigest(nonce *big.Int, txns Transactions) (common.Hash, error)
- func ContextWithAuxData(ctx context.Context, auxData *AuxData) context.Context
- func DecodeNonce(raw *big.Int) (*big.Int, *big.Int)
- func DecodeNonceChangeEvent(log *types.Log) (*big.Int, *big.Int, error)
- func DecodeRevertReason(logs []*types.Log) []string
- func DecodeSignature(sequenceSignature []byte) (core.Signature[*v2.WalletConfig], error)
- func DecodeTxFailedEvent(log *types.Log) (common.Hash, string, uint, error)
- func DecompressCalldata(ctx context.Context, provider *ethrpc.Provider, transaction *types.Transaction) (common.Address, []byte, error)
- func DeploySequenceWallet(sender *ethwallet.Wallet, walletConfig core.WalletConfig, ...) (common.Address, *types.Transaction, ethtxn.WaitReceipt, error)
- func EIP6492Signature(signature []byte, config core.WalletConfig) ([]byte, error)
- func EIP6492SignatureWithMultipleDeployments(signature []byte, configs []core.WalletConfig) ([]byte, error)
- func EIP6492ValidateSignature() ethauth.ValidatorFunc
- func EncodeNonce(space *big.Int, nonce *big.Int) (*big.Int, error)
- func EncodeTransactionsForRelaying(relayer Relayer, walletAddress common.Address, walletConfig core.WalletConfig, ...) (common.Address, []byte, error)
- func EncodeWalletDeployment(walletConfig core.WalletConfig, walletContext WalletContext) (common.Address, common.Address, []byte, error)
- func FilterMetaTransactionAny() ethreceipts.FilterQuery
- func FilterMetaTransactionID(metaTxnID ethkit.Hash) ethreceipts.FilterQuery
- func GeneralIsValidSignature(walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func GeneralValidateSequenceAccountProof() ethauth.ValidatorFunc
- func GeneralValidateSequenceAccountProofWith(walletContexts WalletContexts) ethauth.ValidatorFunc
- func GenerateRandomNonce() (*big.Int, error)
- func GenericDecodeSignature[C core.WalletConfig](sequenceSignature []byte) (core.Signature[C], error)
- func GenericIsValidSignature[C core.WalletConfig](walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func GenericIsValidUndeployedSignature[C core.WalletConfig](walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func GenericRecoverWalletConfigFromDigest[C core.WalletConfig](digest, seqSig []byte, walletAddress common.Address, ...) (C, *big.Int, error)
- func GenericValidateSequenceAccountProof[C core.WalletConfig]() ethauth.ValidatorFunc
- func GenericValidateSequenceAccountProofWith[C core.WalletConfig](walletContexts WalletContext) ethauth.ValidatorFunc
- func GetWalletNonce(provider *ethrpc.Provider, walletConfig core.WalletConfig, ...) (*big.Int, error)
- func IsEIP191Message(msg []byte) bool
- func IsTxExecutedEvent(log *types.Log, hash common.Hash) bool
- func IsTxFailedEvent(log *types.Log, hash common.Hash) bool
- func IsValidMessageSignature(address common.Address, message []byte, signature []byte, chainID *big.Int, ...) (bool, error)
- func IsValidSignature(log logger.Logger, walletAddress common.Address, digest common.Hash, ...) (bool, error)
- func IsValidUndeployedSignature(walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func IsWalletConfigEqual(walletConfigA, walletConfigB core.WalletConfig) bool
- func IsWalletDeployed(provider *ethrpc.Provider, walletAddress common.Address) (bool, error)
- func MessageDigest(message []byte) common.Hash
- func MessageToEIP191(msg []byte) []byte
- func MustEncodeSig(str string) common.Hash
- func PackMessageData(chainID *big.Int, address common.Address, digest common.Hash) ([]byte, error)
- func ParseHexOrDec(s string) (*big.Int, bool)
- func RecoverWalletConfigFromDigest(digest, seqSig []byte, walletAddress common.Address, ...) (*v2.WalletConfig, *big.Int, error)
- func ReduceExecdataSignatures(chainID *big.Int, data []byte) ([]byte, error)
- func Sign[C core.WalletConfig](wallet *Wallet[C], input common.Hash) ([]byte, error)
- func SubDigest(chainID *big.Int, address common.Address, digest common.Hash) ([]byte, error)
- func UnwrapEIP6492Signature(signature []byte) ([]byte, error)
- func V1DecodeSignature(sequenceSignature []byte) (core.Signature[*v1.WalletConfig], error)
- func V1DecodeTxFailedEvent(log *types.Log) (common.Hash, string, error)
- func V1IsTxExecutedEvent(log *types.Log, hash common.Hash) bool
- func V1IsTxFailedEvent(log *types.Log, hash common.Hash) bool
- func V1IsValidSignature(walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func V1IsValidUndeployedSignature(walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func V1RecoverWalletConfigFromDigest(digest, seqSig []byte, walletAddress common.Address, ...) (*v1.WalletConfig, *big.Int, error)
- func V1SortWalletConfig(walletConfig *v1.WalletConfig) error
- func V1ValidateSequenceAccountProof() ethauth.ValidatorFunc
- func V1ValidateSequenceAccountProofWith(walletContext WalletContext) ethauth.ValidatorFunc
- func V2DecodeSignature(sequenceSignature []byte) (core.Signature[*v2.WalletConfig], error)
- func V2DecodeTxFailedEvent(log *types.Log) (common.Hash, string, uint, error)
- func V2IsTxExecutedEvent(log *types.Log, hash common.Hash) bool
- func V2IsTxFailedEvent(log *types.Log, hash common.Hash) bool
- func V2IsValidSignature(walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func V2IsValidUndeployedSignature(walletAddress common.Address, digest common.Hash, seqSig []byte, ...) (bool, error)
- func V2RecoverWalletConfigFromDigest(digest, seqSig []byte, walletAddress common.Address, ...) (*v2.WalletConfig, *big.Int, error)
- func V2ValidateSequenceAccountProof() ethauth.ValidatorFunc
- func V2ValidateSequenceAccountProofWith(walletContext WalletContext) ethauth.ValidatorFunc
- func ValidateSequenceAccountProof(log logger.Logger) ethauth.ValidatorFunc
- func ValidateSequenceAccountProofWith(walletContext WalletContext) ethauth.ValidatorFunc
- type AuxData
- type CallOverride
- type DigestSigner
- type EstimateTransaction
- type Estimator
- func (e *Estimator) AreEOAs(ctx context.Context, provider *ethrpc.Provider, walletConfig core.WalletConfig) (map[common.Address]bool, error)
- func (e *Estimator) BuildStubSignature(walletConfig core.WalletConfig, willSign, isEoa map[common.Address]bool) []byte
- func (e *Estimator) CalldataCost(data []byte) uint64
- func (e *Estimator) Estimate(ctx context.Context, provider *ethrpc.Provider, address common.Address, ...) (uint64, error)
- func (e *Estimator) EstimateCall(ctx context.Context, provider *ethrpc.Provider, call *EstimateTransaction, ...) (*big.Int, error)
- func (e *Estimator) PickSigners(ctx context.Context, walletConfig core.WalletConfig, ...) (map[common.Address]bool, error)
- func (e *Estimator) SetCache(cache cachestore.Store[[]byte]) *Estimator
- type MessageSigner
- type MetaTxnExecType
- type MetaTxnID
- type MetaTxnResult
- type MetaTxnStatus
- type NetworkConfig
- type Networks
- type Receipt
- type Relayer
- type RelayerFeeOption
- type RelayerFeeQuote
- type RelayerFeeToken
- type RelayerFeeTokenType
- type RelayerSimulateResult
- type SignedTransactions
- type Signer
- type SignerDigestSigner
- type SignerMessageSigner
- type SimulateResult
- func Simulate(provider *ethrpc.Provider, wallet common.Address, transactions Transactions, ...) ([]SimulateResult, error)
- func V1Simulate(provider *ethrpc.Provider, wallet common.Address, transactions Transactions, ...) ([]SimulateResult, error)
- func V2Simulate(provider *ethrpc.Provider, wallet common.Address, transactions Transactions, ...) ([]SimulateResult, error)
- type StateOverride
- type Transaction
- func (t *Transaction) AddToBundle(txns Transactions)
- func (t *Transaction) Bundle() Transactions
- func (t *Transaction) Clone() *Transaction
- func (t *Transaction) Digest() (common.Hash, error)
- func (t *Transaction) Execdata() ([]byte, error)
- func (t *Transaction) GuestDigest() (common.Hash, error)
- func (t *Transaction) IsBundle() bool
- func (t *Transaction) IsEncoded() bool
- func (t *Transaction) IsValid() error
- func (t *Transaction) ReduceSignatures(chainID *big.Int) error
- type Transactions
- func DecodeExecdata(data []byte) (Transactions, *big.Int, []byte, error)
- func DecodeRawTransactions(data []byte) (Transactions, error)
- func NewTransactionsFromValues(values []Transaction) Transactions
- func TryDecodeCalldata(ctx context.Context, provider *ethrpc.Provider, transaction *types.Transaction) (common.Address, Transactions, *big.Int, []byte, error)
- func (t *Transactions) Append(txns Transactions)
- func (t Transactions) AppendBundle(txns Transactions)
- func (t Transactions) AsValues() []Transaction
- func (t Transactions) Clone() Transactions
- func (t Transactions) EncodeRaw() ([]byte, error)
- func (t Transactions) EncodedTransactions() ([]Transaction, error)
- func (t Transactions) Nonce() (*big.Int, error)
- func (t *Transactions) Prepend(txns Transactions)
- func (t Transactions) PrependBundle(txns Transactions)
- type Wallet
- func GenericNewWallet[C core.WalletConfig](walletOptions WalletOptions[C], signers ...Signer) (*Wallet[C], error)
- func GenericNewWalletSingleOwner[C core.WalletConfig](owner Signer, optContext ...WalletContext) (*Wallet[C], error)
- func GenericNewWalletWithCoreWalletConfig[C core.WalletConfig](wallet *Wallet[C]) *Wallet[core.WalletConfig]
- func NewWallet(walletOptions WalletOptions[*v2.WalletConfig], signers ...Signer) (*Wallet[*v2.WalletConfig], error)
- func NewWalletSingleOwner(owner Signer, optContext ...WalletContext) (*Wallet[*v2.WalletConfig], error)
- func NewWalletWithCoreWalletConfig(wallet *Wallet[*v2.WalletConfig]) *Wallet[core.WalletConfig]
- func V1NewWallet(walletOptions WalletOptions[*v1.WalletConfig], signers ...Signer) (*Wallet[*v1.WalletConfig], error)
- func V1NewWalletSingleOwner(owner Signer, optContext ...WalletContext) (*Wallet[*v1.WalletConfig], error)deprecated
- func V1NewWalletWithCoreWalletConfig(wallet *Wallet[*v1.WalletConfig]) *Wallet[core.WalletConfig]
- func V2NewWallet(walletOptions WalletOptions[*v2.WalletConfig], signers ...Signer) (*Wallet[*v2.WalletConfig], error)
- func V2NewWalletSingleOwner(owner Signer, optContext ...WalletContext) (*Wallet[*v2.WalletConfig], error)
- func V2NewWalletWithCoreWalletConfig(wallet *Wallet[*v2.WalletConfig]) *Wallet[core.WalletConfig]
- func (w *Wallet[C]) Address() common.Address
- func (w *Wallet[C]) Connect(provider *ethrpc.Provider, relayer Relayer) error
- func (w *Wallet[C]) Deploy(ctx context.Context) (MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
- func (w *Wallet[C]) FeeOptions(ctx context.Context, txs Transactions) ([]*RelayerFeeOption, *RelayerFeeQuote, error)
- func (w *Wallet[C]) GetChainID() *big.Int
- func (w *Wallet[C]) GetNonce(optBlockNum ...*big.Int) (*big.Int, error)
- func (w *Wallet[C]) GetProvider() *ethrpc.Provider
- func (w *Wallet[C]) GetRelayer() Relayer
- func (w *Wallet[C]) GetSigner(address common.Address) (Signer, bool)
- func (w *Wallet[C]) GetSignerAddresses() []common.Address
- func (w *Wallet[C]) GetSignerWeight() *big.Int
- func (w *Wallet[C]) GetTransactionCount(optBlockNum ...*big.Int) (*big.Int, error)
- func (w *Wallet[C]) GetWalletConfig() C
- func (w *Wallet[C]) GetWalletContext() WalletContext
- func (w *Wallet[C]) ImageHash() (common.Hash, error)
- func (w *Wallet[C]) IsDeployed() (bool, error)
- func (w *Wallet[C]) IsSignerAvailable(address common.Address) bool
- func (w *Wallet[C]) IsValidSignature(digest common.Hash, signature []byte) (bool, error)
- func (w *Wallet[C]) SendTransaction(ctx context.Context, signedTxns *SignedTransactions, ...) (MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
- func (w *Wallet[C]) SendTransactions(ctx context.Context, signedTxns *SignedTransactions, ...) (MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
- func (w *Wallet[C]) SetChainID(chainID *big.Int)
- func (w *Wallet[C]) SetProvider(provider *ethrpc.Provider) error
- func (w *Wallet[C]) SetRelayer(relayer Relayer) error
- func (w *Wallet[C]) SetSessions(sessions proto.Sessions) error
- func (w *Wallet[C]) SignDigest(ctx context.Context, digest common.Hash, optChainID ...*big.Int) ([]byte, error)
- func (w *Wallet[C]) SignMessage(msg []byte) ([]byte, error)
- func (w *Wallet[C]) SignTransaction(ctx context.Context, txn *Transaction) (*SignedTransactions, error)
- func (w *Wallet[C]) SignTransactions(ctx context.Context, txns Transactions) (*SignedTransactions, error)
- func (w *Wallet[C]) UpdateSessionsConfig(ctx context.Context) error
- func (w *Wallet[C]) UpdateSessionsWallet(ctx context.Context) error
- func (w *Wallet[C]) UseConfig(config C) (*Wallet[C], error)
- func (w *Wallet[C]) UseSigners(signers ...Signer) (*Wallet[C], error)
- type WalletContext
- type WalletContexts
- type WalletOptions
Constants ¶
const WalletContractBytecode = "0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"
https://github.com/0xsequence/wallet-contracts/blob/master/src/contracts/Wallet.sol#L57-L59
Variables ¶
var ( // NonceChangeEventSig is the signature event emitted as the first event on the batch execution // 0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881 NonceChangeEventSig = MustEncodeSig("NonceChange(uint256,uint256)") // TxFailedEventSig is the signature event emitted in a failed smart-wallet meta-transaction batch // 0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7 V1TxFailedEventSig = MustEncodeSig("TxFailed(bytes32,bytes)") // TxExecutedEventSig is the signature event emitted in a successful smart-wallet meta-transaction batch (for v2) // 0x5c4eeb02dabf8976016ab414d617f9a162936dcace3cdef8c69ef6e262ad5ae7 // TxExecuted(bytes32 indexed _tx, uint256 _index) V2TxExecutedEventSig = common.HexToHash("0x5c4eeb02dabf8976016ab414d617f9a162936dcace3cdef8c69ef6e262ad5ae7") // TxFailedEventSig is the signature event emitted in a failed smart-wallet meta-transaction batch (for v2) // 0xab46c69f7f32e1bf09b0725853da82a211e5402a0600296ab499a2fb5ea3b419 // TxFailed(bytes32 indexed _tx, uint256 _index, bytes _reason) V2TxFailedEventSig = common.HexToHash("0xab46c69f7f32e1bf09b0725853da82a211e5402a0600296ab499a2fb5ea3b419") )
Transaction events as defined in wallet-contracts IModuleCalls.sol
var ( ErrUnknownChainID = fmt.Errorf("chainID is unknown") ErrProviderNotSet = fmt.Errorf("provider is not set") ErrRelayerNotSet = fmt.Errorf("relayer is not set") )
var ( // ImageHashUpdatedEventSig is emitted anytime wallet config is updated. ImageHashUpdatedEventSig = MustEncodeSig("ImageHashUpdated(bytes32)") // ImplementationUpdatedEventSig is emitted anytime a wallet's mainModule is changed, // this is a rare occurence. ImplementationUpdatedEventSig = MustEncodeSig("ImplementationUpdated(address)") )
Functions ¶
func AddressFromImageHash ¶
func AddressFromImageHash(imageHash string, context WalletContext) (common.Address, error)
func AddressFromWalletConfig ¶
func AddressFromWalletConfig(walletConfig core.WalletConfig, context WalletContext) (common.Address, error)
func BuildProxy ¶ added in v0.4.4
BuildProxy for address based on https://eips.ethereum.org/EIPS/eip-1167 the bytecode contains an aditional SLOAD to mimic the Sequence proxies bytecode:
| 0x00000000 36 calldatasize cds | 0x00000001 3d returndatasize 0 cds | 0x00000002 3d returndatasize 0 0 cds | 0x00000003 37 calldatacopy | 0x00000004 30 address addr | 0x00000005 54 sload stub | 0x00000006 50 pop | 0x00000007 3d returndatasize 0 | 0x00000008 3d returndatasize 0 0 | 0x00000009 3d returndatasize 0 0 0 | 0x0000000a 36 calldatasize cds 0 0 0 | 0x0000000b 3d returndatasize 0 cds 0 0 0 | 0x0000000c 73bebebebebe. push20 0xbebebebe 0xbebe 0 cds 0 0 0 | 0x00000020 5a gas gas 0xbebe 0 cds 0 0 0 | 0x00000021 f4 delegatecall suc 0 | 0x00000022 3d returndatasize rds suc 0 | 0x00000023 82 dup3 0 rds suc 0 | 0x00000024 80 dup1 0 0 rds suc 0 | 0x00000025 3e returndatacopy suc 0 | 0x00000026 90 swap1 0 suc | 0x00000027 3d returndatasize rds 0 suc | 0x00000028 91 swap2 suc 0 rds | 0x00000029 602d push1 0x2e 0x2e suc 0 rds | ,=< 0x0000002b 57 jumpi 0 rds | | 0x0000002c fd revert | `-> 0x0000002d 5b jumpdest 0 rds \ 0x0000002e f3 return
func ComputeGuestExecDigest ¶ added in v0.3.3
func ComputeGuestExecDigest(txns Transactions) (common.Hash, error)
func ComputeSelfExecDigest ¶ added in v0.3.3
func ComputeSelfExecDigest(txns Transactions) (common.Hash, error)
func ComputeWalletExecDigest ¶ added in v0.3.3
func ContextWithAuxData ¶ added in v0.22.0
func DecodeNonce ¶
DecodeNonce raw nonce, returns (space, nonce)
func DecodeNonceChangeEvent ¶ added in v0.3.1
func DecodeRevertReason ¶ added in v0.3.3
func DecodeSignature ¶
func DecodeTxFailedEvent ¶ added in v0.3.1
func DecompressCalldata ¶ added in v0.26.0
func DecompressCalldata(ctx context.Context, provider *ethrpc.Provider, transaction *types.Transaction) (common.Address, []byte, error)
This method is duplicated code from: `compressor/contract.go` can't be used directly, because it would create a circular dependency
func DeploySequenceWallet ¶
func DeploySequenceWallet(sender *ethwallet.Wallet, walletConfig core.WalletConfig, walletContext WalletContext) (common.Address, *types.Transaction, ethtxn.WaitReceipt, error)
func EIP6492Signature ¶ added in v0.22.1
func EIP6492Signature(signature []byte, config core.WalletConfig) ([]byte, error)
func EIP6492SignatureWithMultipleDeployments ¶ added in v0.37.1
func EIP6492SignatureWithMultipleDeployments(signature []byte, configs []core.WalletConfig) ([]byte, error)
func EIP6492ValidateSignature ¶ added in v0.22.0
func EIP6492ValidateSignature() ethauth.ValidatorFunc
func EncodeNonce ¶
EncodeNonce with space
func EncodeTransactionsForRelaying ¶
func EncodeTransactionsForRelaying(relayer Relayer, walletAddress common.Address, walletConfig core.WalletConfig, walletContext WalletContext, txns Transactions, nonce *big.Int, seqSig []byte) (common.Address, []byte, error)
returns `to` address (either guest or wallet) and `data` of signed-metatx-calldata, aka execdata
func EncodeWalletDeployment ¶ added in v0.3.3
func EncodeWalletDeployment(walletConfig core.WalletConfig, walletContext WalletContext) (common.Address, common.Address, []byte, error)
func FilterMetaTransactionAny ¶ added in v0.17.0
func FilterMetaTransactionAny() ethreceipts.FilterQuery
Find any Sequence meta txns
func FilterMetaTransactionID ¶ added in v0.17.0
func FilterMetaTransactionID(metaTxnID ethkit.Hash) ethreceipts.FilterQuery
func GeneralIsValidSignature ¶ added in v0.22.0
func GeneralValidateSequenceAccountProof ¶ added in v0.22.0
func GeneralValidateSequenceAccountProof() ethauth.ValidatorFunc
func GeneralValidateSequenceAccountProofWith ¶ added in v0.22.0
func GeneralValidateSequenceAccountProofWith(walletContexts WalletContexts) ethauth.ValidatorFunc
func GenerateRandomNonce ¶
GenerateRandomNonce returns a random space for a nonce to ensure transactions can be executed in parallel.
func GenericDecodeSignature ¶ added in v0.22.0
func GenericDecodeSignature[C core.WalletConfig](sequenceSignature []byte) (core.Signature[C], error)
GenericDecodeSignature sequence into individual parts
func GenericIsValidSignature ¶ added in v0.22.0
func GenericIsValidUndeployedSignature ¶ added in v0.22.0
func GenericRecoverWalletConfigFromDigest ¶ added in v0.22.0
func GenericValidateSequenceAccountProof ¶ added in v0.22.0
func GenericValidateSequenceAccountProof[C core.WalletConfig]() ethauth.ValidatorFunc
func GenericValidateSequenceAccountProofWith ¶ added in v0.22.0
func GenericValidateSequenceAccountProofWith[C core.WalletConfig](walletContexts WalletContext) ethauth.ValidatorFunc
func GetWalletNonce ¶
func IsEIP191Message ¶ added in v0.29.0
func IsTxExecutedEvent ¶ added in v0.3.1
func IsValidMessageSignature ¶ added in v0.28.3
func IsValidSignature ¶
func IsValidUndeployedSignature ¶ added in v0.22.0
func IsWalletConfigEqual ¶
func IsWalletConfigEqual(walletConfigA, walletConfigB core.WalletConfig) bool
func IsWalletDeployed ¶
func MessageDigest ¶
func MessageToEIP191 ¶ added in v0.29.0
func MustEncodeSig ¶
func PackMessageData ¶
PackMessageData encodes a Sequence contract "message"
func ReduceExecdataSignatures ¶ added in v0.6.6
func UnwrapEIP6492Signature ¶ added in v0.33.0
func V1DecodeSignature ¶ added in v0.22.0
func V1DecodeTxFailedEvent ¶ added in v0.22.0
func V1IsTxExecutedEvent ¶ added in v0.22.0
func V1IsTxFailedEvent ¶ added in v0.22.0
func V1IsValidSignature ¶ added in v0.22.0
func V1IsValidUndeployedSignature ¶ added in v0.22.0
func V1RecoverWalletConfigFromDigest ¶ added in v0.22.0
func V1SortWalletConfig ¶ added in v0.22.0
func V1SortWalletConfig(walletConfig *v1.WalletConfig) error
func V1ValidateSequenceAccountProof ¶ added in v0.22.0
func V1ValidateSequenceAccountProof() ethauth.ValidatorFunc
func V1ValidateSequenceAccountProofWith ¶ added in v0.22.0
func V1ValidateSequenceAccountProofWith(walletContext WalletContext) ethauth.ValidatorFunc
func V2DecodeSignature ¶ added in v0.22.0
func V2DecodeTxFailedEvent ¶ added in v0.22.0
func V2IsTxExecutedEvent ¶ added in v0.22.0
func V2IsTxFailedEvent ¶ added in v0.22.0
func V2IsValidSignature ¶ added in v0.22.0
func V2IsValidUndeployedSignature ¶ added in v0.22.0
func V2RecoverWalletConfigFromDigest ¶ added in v0.22.0
func V2ValidateSequenceAccountProof ¶ added in v0.22.0
func V2ValidateSequenceAccountProof() ethauth.ValidatorFunc
func V2ValidateSequenceAccountProofWith ¶ added in v0.22.0
func V2ValidateSequenceAccountProofWith(walletContext WalletContext) ethauth.ValidatorFunc
func ValidateSequenceAccountProofWith ¶
func ValidateSequenceAccountProofWith(walletContext WalletContext) ethauth.ValidatorFunc
Types ¶
type AuxData ¶ added in v0.22.0
AuxData is the data that is signed by the wallet
func AuxDataFromContext ¶ added in v0.22.0
type CallOverride ¶ added in v0.4.0
type CallOverride struct { Code string Balance *big.Int Nonce *big.Int StateDiff []*StateOverride State []*StateOverride }
type DigestSigner ¶ added in v0.22.0
type EstimateTransaction ¶ added in v0.4.0
type Estimator ¶ added in v0.4.0
type Estimator struct { BaseCost uint64 DataOneCost uint64 DataZeroCost uint64 // contains filtered or unexported fields }
func NewEstimator ¶ added in v0.4.0
func NewEstimator() *Estimator
func (*Estimator) BuildStubSignature ¶ added in v0.4.0
func (*Estimator) CalldataCost ¶ added in v0.4.0
func (*Estimator) Estimate ¶ added in v0.4.0
func (e *Estimator) Estimate(ctx context.Context, provider *ethrpc.Provider, address common.Address, walletConfig core.WalletConfig, walletContext WalletContext, txs Transactions) (uint64, error)
func (*Estimator) EstimateCall ¶ added in v0.4.0
func (*Estimator) PickSigners ¶ added in v0.4.0
type MessageSigner ¶ added in v0.22.0
type MetaTxnExecType ¶ added in v0.3.3
type MetaTxnExecType uint32
MetaTxnExecType represents the kind of execution call for the meta-transaction
const ( MetaTxnWalletExec MetaTxnExecType = iota // MainModule.execute MetaTxnSelfExec // MainModule.selfExecute MetaTxnGuestExec // GuestModule.execute )
type MetaTxnID ¶
type MetaTxnID string
func ComputeMetaTxnID ¶
func ComputeMetaTxnIDFromDigest ¶ added in v0.3.3
type MetaTxnResult ¶ added in v0.10.0
type MetaTxnResult struct { MetaTxnID MetaTxnID Status MetaTxnStatus Reason string }
func FetchMetaTransactionReceipt ¶ added in v0.17.0
func FetchMetaTransactionReceipt(ctx context.Context, receiptListener *ethreceipts.ReceiptsListener, metaTxnID MetaTxnID, optTimeout ...time.Duration) (*MetaTxnResult, *ethreceipts.Receipt, ethreceipts.WaitReceiptFinalityFunc, error)
type MetaTxnStatus ¶ added in v0.2.0
type MetaTxnStatus uint8
const ( MetaTxnStatusUnknown MetaTxnStatus = iota MetaTxnExecuted MetaTxnFailed MetaTxnReverted )
type NetworkConfig ¶
type NetworkConfig struct { Name string ChainID big.Int ENSAddress *common.Address RpcURL string Provider *ethrpc.Provider RelayerURL *string // optional, one of the these should be set Relayer Relayer IndexerURL *string // optional, one of these should be set IsDefaultChain bool IsAuthChain bool SequenceAPIURL string }
type Networks ¶
type Networks []NetworkConfig
type Receipt ¶ added in v0.3.1
type Receipt struct { *types.Receipt MetaTxnID MetaTxnID Status MetaTxnStatus Reason string Logs []*types.Log Index uint Transaction *Transaction Receipts []*Receipt }
func DecodeReceipt ¶ added in v0.3.1
type Relayer ¶
type Relayer interface { // .. GetProvider() *ethrpc.Provider // .. EstimateGasLimits(ctx context.Context, walletConfig core.WalletConfig, walletContext WalletContext, txns Transactions) (Transactions, error) // .. Simulate(ctx context.Context, txs *SignedTransactions) ([]*RelayerSimulateResult, error) // NOTE: nonce space is 160 bits wide GetNonce(ctx context.Context, walletConfig core.WalletConfig, walletContext WalletContext, space *big.Int, blockNum *big.Int) (*big.Int, error) // Relay will submit the Sequence signed meta transaction to the relayer. The method will block until the relayer // responds with the native transaction hash (*types.Transaction), which means the relayer has submitted the transaction // request to the network. Clients can use WaitReceipt to wait until the metaTxnID has been mined. Relay(ctx context.Context, signedTxs *SignedTransactions, quote ...*RelayerFeeQuote) (MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error) // FeeOptions(ctx context.Context, signedTxs *SignedTransactions) ([]*RelayerFeeOption, *RelayerFeeQuote, error) // .. Wait(ctx context.Context, metaTxnID MetaTxnID, optTimeout ...time.Duration) (MetaTxnStatus, *types.Receipt, error) // .. Client() proto.Relayer }
type RelayerFeeOption ¶ added in v0.29.1
type RelayerFeeQuote ¶ added in v0.29.1
type RelayerFeeQuote string
type RelayerFeeToken ¶ added in v0.29.1
type RelayerFeeTokenType ¶ added in v0.29.1
type RelayerFeeTokenType uint32
const ( UNKNOWN RelayerFeeTokenType = iota ERC20_TOKEN ERC1155_TOKEN )
type RelayerSimulateResult ¶ added in v0.29.0
type SignedTransactions ¶
type SignedTransactions struct { ChainID *big.Int WalletAddress common.Address WalletConfig core.WalletConfig WalletContext WalletContext Transactions Transactions // The meta-transactions Nonce *big.Int // Nonce of the transactions Digest common.Hash // Digest of the transactions Signature []byte // Signature (encoded as bytes from *Signature) of the txn digest }
SignedTransactions includes a signed meta-transaction payload intended for the relayer.
func (*SignedTransactions) Execdata ¶ added in v0.2.0
func (t *SignedTransactions) Execdata() ([]byte, error)
type SignerDigestSigner ¶ added in v0.22.0
type SignerDigestSigner interface { Signer DigestSigner }
type SignerMessageSigner ¶ added in v0.22.0
type SignerMessageSigner interface { Signer MessageSigner }
type SimulateResult ¶ added in v0.6.9
type SimulateResult walletgasestimator.MainModuleGasEstimationSimulateResult
func Simulate ¶ added in v0.6.9
func Simulate(provider *ethrpc.Provider, wallet common.Address, transactions Transactions, block string, overrides map[common.Address]*CallOverride) ([]SimulateResult, error)
func V1Simulate ¶ added in v0.22.0
func V1Simulate(provider *ethrpc.Provider, wallet common.Address, transactions Transactions, block string, overrides map[common.Address]*CallOverride) ([]SimulateResult, error)
func V2Simulate ¶ added in v0.22.0
func V2Simulate(provider *ethrpc.Provider, wallet common.Address, transactions Transactions, block string, overrides map[common.Address]*CallOverride) ([]SimulateResult, error)
type StateOverride ¶ added in v0.4.0
type Transaction ¶
type Transaction struct { DelegateCall bool `abi:"delegateCall"` // Performs delegatecall RevertOnError bool `abi:"revertOnError"` // Reverts transaction bundle if tx fails GasLimit *big.Int `abi:"gasLimit"` // Maximum gas to be forwarded To common.Address `abi:"target"` // Address to send transaction, aka target Value *big.Int `abi:"value"` // Amount of ETH to pass with the call Data []byte `abi:"data"` // Calldata to pass Transactions Transactions // Child transactions Nonce *big.Int // Meta-Transaction nonce, with encoded space Signature []byte // Meta-Transaction signature // contains filtered or unexported fields }
Transaction type for Sequence meta-transaction, with encoded calldata.
The fields with abi struct tags match the `Transaction` type as defined in the IModuleCalls interface.
func (*Transaction) AddToBundle ¶ added in v0.2.0
func (t *Transaction) AddToBundle(txns Transactions)
AddToBundle will create a bundle from the passed txns and add it to current transaction
func (*Transaction) Bundle ¶ added in v0.2.0
func (t *Transaction) Bundle() Transactions
func (*Transaction) Clone ¶ added in v0.3.2
func (t *Transaction) Clone() *Transaction
func (*Transaction) Execdata ¶ added in v0.2.0
func (t *Transaction) Execdata() ([]byte, error)
func (*Transaction) GuestDigest ¶ added in v0.3.1
func (t *Transaction) GuestDigest() (common.Hash, error)
func (*Transaction) IsBundle ¶ added in v0.2.0
func (t *Transaction) IsBundle() bool
func (*Transaction) IsEncoded ¶ added in v0.3.3
func (t *Transaction) IsEncoded() bool
func (*Transaction) IsValid ¶ added in v0.2.1
func (t *Transaction) IsValid() error
func (*Transaction) ReduceSignatures ¶ added in v0.6.6
func (t *Transaction) ReduceSignatures(chainID *big.Int) error
type Transactions ¶
type Transactions []*Transaction
func DecodeExecdata ¶ added in v0.3.2
func DecodeRawTransactions ¶ added in v0.4.2
func DecodeRawTransactions(data []byte) (Transactions, error)
func NewTransactionsFromValues ¶ added in v0.2.0
func NewTransactionsFromValues(values []Transaction) Transactions
func TryDecodeCalldata ¶ added in v0.26.0
func (*Transactions) Append ¶ added in v0.2.0
func (t *Transactions) Append(txns Transactions)
Append will append the passed txns to the `t` array (as separate Transaction elements).
func (Transactions) AppendBundle ¶ added in v0.2.0
func (t Transactions) AppendBundle(txns Transactions)
AppendBundle will append the passed txns as *a bundle of txns*. This means, it will be included as a single element at this level of the `t` array.
func (Transactions) AsValues ¶
func (t Transactions) AsValues() []Transaction
func (Transactions) Clone ¶ added in v0.3.2
func (t Transactions) Clone() Transactions
func (Transactions) EncodeRaw ¶ added in v0.4.2
func (t Transactions) EncodeRaw() ([]byte, error)
func (Transactions) EncodedTransactions ¶ added in v0.3.3
func (t Transactions) EncodedTransactions() ([]Transaction, error)
func (*Transactions) Prepend ¶ added in v0.2.0
func (t *Transactions) Prepend(txns Transactions)
Prepend will prepend the passed txns to the `t` array (as separate Transaction elements).
func (Transactions) PrependBundle ¶ added in v0.2.0
func (t Transactions) PrependBundle(txns Transactions)
PrependBundle will prepend the passed txns as *a bundle of txns*. This means, it will be included as a single element at this level of the `t` array.
type Wallet ¶
type Wallet[C core.WalletConfig] struct { // contains filtered or unexported fields }
func GenericNewWallet ¶ added in v0.22.0
func GenericNewWallet[C core.WalletConfig](walletOptions WalletOptions[C], signers ...Signer) (*Wallet[C], error)
func GenericNewWalletSingleOwner ¶ added in v0.22.0
func GenericNewWalletSingleOwner[C core.WalletConfig](owner Signer, optContext ...WalletContext) (*Wallet[C], error)
func GenericNewWalletWithCoreWalletConfig ¶ added in v0.22.0
func GenericNewWalletWithCoreWalletConfig[C core.WalletConfig](wallet *Wallet[C]) *Wallet[core.WalletConfig]
func NewWallet ¶
func NewWallet(walletOptions WalletOptions[*v2.WalletConfig], signers ...Signer) (*Wallet[*v2.WalletConfig], error)
func NewWalletSingleOwner ¶
func NewWalletSingleOwner(owner Signer, optContext ...WalletContext) (*Wallet[*v2.WalletConfig], error)
NewWalletSingleOwner creates a new Sequence v2 wallet with a single owner.
func NewWalletWithCoreWalletConfig ¶ added in v0.22.0
func NewWalletWithCoreWalletConfig(wallet *Wallet[*v2.WalletConfig]) *Wallet[core.WalletConfig]
func V1NewWallet ¶ added in v0.22.0
func V1NewWallet(walletOptions WalletOptions[*v1.WalletConfig], signers ...Signer) (*Wallet[*v1.WalletConfig], error)
func V1NewWalletSingleOwner
deprecated
added in
v0.22.0
func V1NewWalletSingleOwner(owner Signer, optContext ...WalletContext) (*Wallet[*v1.WalletConfig], error)
V1NewWalletSingleOwner creates a new Sequence v1 wallet with a single owner.
Deprecated: use NewWalletSingleOwner instead. V1NewWalletSingleOwner is kept for historical compatibility and should not be used.
func V1NewWalletWithCoreWalletConfig ¶ added in v0.22.0
func V1NewWalletWithCoreWalletConfig(wallet *Wallet[*v1.WalletConfig]) *Wallet[core.WalletConfig]
func V2NewWallet ¶ added in v0.22.0
func V2NewWallet(walletOptions WalletOptions[*v2.WalletConfig], signers ...Signer) (*Wallet[*v2.WalletConfig], error)
func V2NewWalletSingleOwner ¶ added in v0.22.0
func V2NewWalletSingleOwner(owner Signer, optContext ...WalletContext) (*Wallet[*v2.WalletConfig], error)
V2NewWalletSingleOwner creates a new Sequence v2 wallet with a single owner.
func V2NewWalletWithCoreWalletConfig ¶ added in v0.22.0
func V2NewWalletWithCoreWalletConfig(wallet *Wallet[*v2.WalletConfig]) *Wallet[core.WalletConfig]
func (*Wallet[C]) Deploy ¶ added in v0.22.0
func (w *Wallet[C]) Deploy(ctx context.Context) (MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
func (*Wallet[C]) FeeOptions ¶ added in v0.29.1
func (w *Wallet[C]) FeeOptions(ctx context.Context, txs Transactions) ([]*RelayerFeeOption, *RelayerFeeQuote, error)
func (*Wallet[C]) GetChainID ¶
func (*Wallet[C]) GetProvider ¶
func (*Wallet[C]) GetRelayer ¶
func (*Wallet[C]) GetSignerAddresses ¶
func (*Wallet[C]) GetSignerWeight ¶
func (*Wallet[C]) GetTransactionCount ¶
func (*Wallet[C]) GetWalletConfig ¶
func (w *Wallet[C]) GetWalletConfig() C
func (*Wallet[C]) GetWalletContext ¶
func (w *Wallet[C]) GetWalletContext() WalletContext
func (*Wallet[C]) IsDeployed ¶
func (*Wallet[C]) IsSignerAvailable ¶
func (*Wallet[C]) IsValidSignature ¶
func (*Wallet[C]) SendTransaction ¶
func (w *Wallet[C]) SendTransaction(ctx context.Context, signedTxns *SignedTransactions, feeQuote ...*RelayerFeeQuote) (MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
func (*Wallet[C]) SendTransactions ¶
func (w *Wallet[C]) SendTransactions(ctx context.Context, signedTxns *SignedTransactions, feeQuote ...*RelayerFeeQuote) (MetaTxnID, *types.Transaction, ethtxn.WaitReceipt, error)
func (*Wallet[C]) SetChainID ¶
SetChainID will set the wallet's associated chainID. However, for most part, this will automatically be set by the provider rpc.
func (*Wallet[C]) SetRelayer ¶
func (*Wallet[C]) SetSessions ¶ added in v0.29.0
func (*Wallet[C]) SignDigest ¶
func (*Wallet[C]) SignTransaction ¶
func (w *Wallet[C]) SignTransaction(ctx context.Context, txn *Transaction) (*SignedTransactions, error)
func (*Wallet[C]) SignTransactions ¶
func (w *Wallet[C]) SignTransactions(ctx context.Context, txns Transactions) (*SignedTransactions, error)
func (*Wallet[C]) UpdateSessionsConfig ¶ added in v0.29.0
func (*Wallet[C]) UpdateSessionsWallet ¶ added in v0.29.0
type WalletContext ¶
type WalletContext struct { FactoryAddress common.Address `json:"factory" toml:"factory_address"` MainModuleAddress common.Address `json:"mainModule" toml:"main_module_address"` MainModuleUpgradableAddress common.Address `json:"mainModuleUpgradable" toml:"main_module_upgradable_address"` GuestModuleAddress common.Address `json:"guestModule" toml:"guest_module_address"` UtilsAddress common.Address `json:"utils" toml:"utils_address"` }
WalletContext is the module addresses deployed on a network, aka the context / environment of the Sequence Smart Wallet system on Ethereum.
func SequenceContext ¶
func SequenceContext() WalletContext
func SequenceContextForWalletConfig ¶ added in v0.22.0
func SequenceContextForWalletConfig(walletConfig core.WalletConfig) WalletContext
func V1SequenceContext ¶ added in v0.22.0
func V1SequenceContext() WalletContext
V1SequenceContext returns copy of the package-level internal variable, to prevent change by other packages.
func V2SequenceContext ¶ added in v0.22.0
func V2SequenceContext() WalletContext
type WalletContexts ¶ added in v0.21.0
type WalletContexts map[uint16]WalletContext
A map of a wallet context for each version
func SequenceContexts ¶ added in v0.21.0
func SequenceContexts() WalletContexts
type WalletOptions ¶
type WalletOptions[C core.WalletConfig] struct { // Config is the wallet multi-sig configuration. Note: the first config of any wallet // before it is deployed is used to derive it's the account address of the wallet. Config C // Context is the WalletContext of deployed wallet-contract modules for the Smart Wallet. // NOTE: if a WalletContext is not provided, then `V1SequenceContext()` value is used. Context *WalletContext // Skips config sorting and keeps signers order as-is SkipSortSigners bool // Address used for the wallet // if this value is defined, the address derived from the sequence config is ignored Address common.Address }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
_examples
|
|
sequence-api v0.4.0 7578ce7543fbe82fa6e423652b4fa3d384362329 -- Code generated by webrpc-gen@v0.18.7 with golang generator.
|
sequence-api v0.4.0 7578ce7543fbe82fa6e423652b4fa3d384362329 -- Code generated by webrpc-gen@v0.18.7 with golang generator. |
Sequence core primitives
|
Sequence core primitives |
v1
Sequence v1 core primitives
|
Sequence v1 core primitives |
v2
Sequence v2 core primitives
|
Sequence v2 core primitives |
sequence-indexer v0.4.0 604761d36d9ef082fa97d028f8315ccdedf19838 -- Code generated by webrpc-gen@v0.18.6 with golang generator.
|
sequence-indexer v0.4.0 604761d36d9ef082fa97d028f8315ccdedf19838 -- Code generated by webrpc-gen@v0.18.6 with golang generator. |
sequence-waas-intents v0.1.0 1fe0a24abef81231c54c0886157c65ef738d5ed6 -- Code generated by webrpc-gen@v0.19.3 with golang generator.
|
sequence-waas-intents v0.1.0 1fe0a24abef81231c54c0886157c65ef738d5ed6 -- Code generated by webrpc-gen@v0.19.3 with golang generator. |
lib
|
|
marketplace-api 8569918d27ddb43b484dbd057b83e8855acfdb05 -- Code generated by webrpc-gen@v0.18.3 with golang generator.
|
marketplace-api 8569918d27ddb43b484dbd057b83e8855acfdb05 -- Code generated by webrpc-gen@v0.18.3 with golang generator. |
sequence-metadata v0.4.0 16b30ae85e42fc4c25342f7c43e04d7070597f21 -- Code generated by webrpc-gen@v0.18.6 with golang generator.
|
sequence-metadata v0.4.0 16b30ae85e42fc4c25342f7c43e04d7070597f21 -- Code generated by webrpc-gen@v0.18.6 with golang generator. |
proto
sequence-relayer v0.4.1 e4df7ceb0987a6b6fd6a61d65e57a0a072b101aa -- Code generated by webrpc-gen@v0.18.7 with golang generator.
|
sequence-relayer v0.4.1 e4df7ceb0987a6b6fd6a61d65e57a0a072b101aa -- Code generated by webrpc-gen@v0.18.7 with golang generator. |
sessions
|
|
proto
sessions v0.0.1 d81ea64cbe41c1ab8b0107bce2f118817b34ebc0 -- Code generated by webrpc-gen@v0.18.6 with golang generator.
|
sessions v0.0.1 d81ea64cbe41c1ab8b0107bce2f118817b34ebc0 -- Code generated by webrpc-gen@v0.18.6 with golang generator. |