0.0.1 • Published 10 months ago

@morpher-io/dd-abstractionkit v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

A modified version of the AbstractionKit library to enable support for data-dependent user operations.

Docs

For full detailed documentation visit the Candide docs page.

Installation todo

npm install abstractionkit

Quickstart

The kit is used exaclty as the original one, refer to the original readme for a quickstart.

The only difference is the management of data dependent user operations. If a contract the user is interacting with requires data, the kit will make use of contract calls and special bundler endpoints to manage that. Make sure that the bundler you're connecting to supports data-dependency.

Creating and sending a data-dependent user operation

const transaction : MetaTransaction = {
        to: yourDataDepndentContract,
        value: 0n,
        data: transactionCallData,
    }

// bundler will provide gas estimation on data-dependent endpoints
// the userOperation object is also containing the data requirements
const userOperation = await smartAccount.createUserOperation(
        [transaction],
        jsonRpcNodeProvider, // regular ethereum rpc for your chain
        bundlerUrl, // must be a dd-bundler
    )

userOperation.signature = smartAccount.signUserOperation(
        userOperation,
        [ownerPrivateKey],
        chainId,
    )

// correct bundler endpoint will be used according to data-dependecy
const sendUserOperationResponse = await smartAccount.sendUserOperation(
        userOperation, bundlerUrl
    )

npm package todo

npm

License

MIT