Implementation of ERC-4337: Account Abstraction in Kotlin
For a high-level overview, read this blog post.
For Swift library, see this.
implementation("org.aakotlin:core:0.1.4")
implementation("org.aakotlin:alchemy:0.1.4")
Send User Operation with Alchemy provider:
val provider = AlchemyProvider(
...
).withAlchemyGasManager(
...
)
val account = LightSmartContractAccount(...)
provider.connect(account)
val function = Function(
"mint", // contract function name
listOf(
org.web3j.abi.datatypes.Address(provider.getAddress().address), // function parameters
),
listOf()
)
val encoded = FunctionEncoder.encode(function)
provider.sendUserOperation(
UserOperationCallData(
contractAddress,
Numeric.hexStringToByteArray(encoded),
)
)
Check the Example app for the full code:
This repository is based on Alchemy's aa-sdk. Going through their Account Kit documentation will give you a good idea of the structure of this library.
Contributions are welcome. Just open a well-structured issue or a PR.