0.6.0 • Published 2 years ago

@account-abstraction/sdk v0.6.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

SDK to create and send UserOperation

This package provides 2 APIs for using UserOperations:

  • Low-level "walletAPI"
  • High-level Provider

LowLevel API:

BaseWalletAPI

An abstract base-class to create UserOperation for a contract wallet.

SimpleAccountAPI

An implementation of the BaseWalletAPI, for the SimpleWallet sample of account-abstraction.

owner = provider.getSigner()
const walletAPI = new SimpleAccountAPI({
    provider, 
    entryPointAddress,
    owner,
    factoryAddress
})
const op = await walletAPI.createSignedUserOp({
  target: recipient.address,
  data: recipient.interface.encodeFunctionData('something', ['hello'])
})

High-Level Provider API

A simplified mode that doesn't require a different wallet extension. Instead, the current provider's account is used as wallet owner by calling its "Sign Message" operation.

This can only work for wallets that use an EIP-191 ("Ethereum Signed Message") signature (like our sample SimpleWallet) Also, the UX is not great (the user is asked to sign a hash, and even the wallet address is not mentioned, only the signer)

import { wrapProvider } from '@account-abstraction/sdk'

//use this account as wallet-owner (which will be used to sign the requests)
const aaSigner = provider.getSigner()
const config = {
  chainId: await provider.getNetwork().then(net => net.chainId),
  entryPointAddress,
  bundlerUrl: 'http://localhost:3000/rpc'
} 
const aaProvider = await wrapProvider(provider, config, aaSigner)
const walletAddress = await aaProvider.getSigner().getAddress()

// send some eth to the wallet Address: wallet should have some balance to pay for its own creation, and for calling methods.

const myContract = new Contract(abi, aaProvider)

// this method will get called from the wallet address, through account-abstraction EntryPoint
await myContract.someMethod()
@fun-wallet/sdkscw-contracts@everything-registry/sub-chunk-24stash-aa-tsstash-fe-scripthexlink-contractjvault.next.jshardhat-aahardhat-arphardhat-arpzhh-acc-abs-toolkitphuoc-test-account-abstraction-bundlerpasskeys_aa_contractsqngsnap@anonydev2/bundler@anonydev2/validation-manager@bananahq/banana-sdk@bananahq/banana-sdk-test@bananahq/banana-sdk-tg-bot@bananahq/banana-sdk-tg-bot-modified@bananahq/react-native-sdk@bananahq/react-native-sdk-test@blockapex-labs/stash-aa-sdk@biconomy/account-contracts@biconomy/fallback-gastank-contracts@biconomy-devx/smart-account-contracts@biconomy-devx/wallet-contracts@biconomy-devx/fallback-gastank@biconomy-devx/fallback-gastank-contracts@biconomy-devx/account-contracts4337-snap@a42/aasnap@fun-wallet-dev/sdk@lewiskim/zkauth-sdk@linji668/jvault.js@maueth/aa-passkeys-client@maueth/aa-passkeys-wallet@jaspervault/jvault.js@klaytn/zkauth-sdk@kaiachain/zkauth-sdk@rize-labs/banana-rainbowkit-plugin@rize-labs/banana-rainbowkit-plugin-astar-test@rize-labs/banana-rainbowkit-plugin-test@rize-labs/banana-temp@rize-labs/banana-wallet-demo-sdk@rize-labs/banana-wallet-sdk@rize-labs/banana-wallet-sdk-1@rize-labs/banana-wallet-sdk-astar-test@rize-labs/banana-wallet-sdk-demo@rize-labs/banana-wallet-sdk-site@rize-labs/banana-wallet-sdk-test@rize-labs/banana-wallet-test@rize-labs/banana-wallet-web-sdk@pandamc/hypha@prifilabs/zk-team@thirdweb-dev/checkoutsaa-passkeys-clientaa-passkeys-walletaa-snap37@unipasswallet/eip4337-hook@uptsmart/jvault.jscontract-test-packagedarwin-corediamond-ledger-sdkcrossfuel-fantom-snapcrossfuel-snapethdkethpaymaster_sdk_tsfallback-gastankfun-wallet-paymaster-test
0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago