accountabstraction

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "any-ns.aa"

Variables

This section is empty.

Functions

func GetCallDataForAprove

func GetCallDataForAprove(userAddr common.Address, destAddress common.Address, fullTokensToAllow *big.Int, tokenDecimals uint8) ([]byte, error)

func GetCallDataForBatchExecute

func GetCallDataForBatchExecute(targets []common.Address, originalCallDatas [][]byte) ([]byte, error)

in reality we call "execute" method

func GetCallDataForCommit

func GetCallDataForCommit(commitment [32]byte) ([]byte, error)

func GetCallDataForMint

func GetCallDataForMint(smartAccountAddress common.Address, fullTokensToMint *big.Int, tokenDecimals uint8) ([]byte, error)

func GetCallDataForRegister

func GetCallDataForRegister(
	nameFirstPart string,
	registrantAccount common.Address,
	registrationTime big.Int,
	secret [32]byte,
	resolver common.Address,
	callData [][]byte,
	isReverseRecord bool,
	ownerControlledFuses uint16) ([]byte, error)

func New

func New() app.Component

Types

type AccountAbstractionService

type AccountAbstractionService interface {
	GetOperation(ctx context.Context, operationID string) (info *OperationInfo, err error)

	// each EOA has an associated smart wallet address
	// even if it is not deployed yet - we can determine it
	GetSmartWalletAddress(ctx context.Context, eoa common.Address) (address common.Address, err error)
	IsScwDeployed(ctx context.Context, scw common.Address) (bool, error)
	GetNamesCountLeft(ctx context.Context, scw common.Address) (count uint64, err error)

	// will return error if signature is invalid
	AdminVerifyIdentity(payload []byte, signature []byte) (err error)
	// will mint + approve tokens to the specified smart wallet
	AdminMintAccessTokens(ctx context.Context, scw common.Address, amount *big.Int) (operationID string, err error)

	// get data to sign with your PK:
	GetDataNameRegister(ctx context.Context, in *nsp.NameRegisterRequest) (dataOut []byte, contextData []byte, err error)
	GetDataNameRegisterForSpace(ctx context.Context, in *nsp.NameRegisterForSpaceRequest) (dataOut []byte, contextData []byte, err error)

	// after data is signed - now you are ready to send it
	// contextData was received from functions like GetDataNameRegister and should be left intact
	SendUserOperation(ctx context.Context, contextData []byte, signedByUserData []byte) (operationID string, err error)

	app.Component
}

type OperationInfo

type OperationInfo struct {
	OperationState nsp.OperationState
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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