@derachain/aa-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.20 • Public • Published

Account Abstraction SDK

SDK for Account Abstraction integration on DERA chain with support for smart accounts, user operations, bundler service, paymaster service that comply with ERC-4337.

License

Installing

Install by yarn

yarn add @derachain/aa-sdk

or using npm

npm i @derachain/aa-sdk

Note: node version should be greater than v20 LTS

Quick start

import {createSmartAccountClient, sendUserOps} from '@derachain/aa-sdk';

const smartAccount = await createSmartAccountClient(
  index, // Index to create new Smart Account
  privateKey, // Private key for the account
  true // Optional default true: Set to true if using paymaster
);

// Send transaction
const userOpResponse = await sendUserOps(
  smartAccount,
  {to: '0x...', value: 1},
  false // Optional default false: Set to true if using paymaster
);

const userOpReceipt = await userOpResponse.wait();

const {
  receipt: {transactionHash},
  success,
} = userOpReceipt;

Package Sidebar

Install

npm i @derachain/aa-sdk

Weekly Downloads

19

Version

1.0.20

License

MIT

Unpacked Size

13.6 kB

Total Files

11

Last publish

Collaborators

  • annguyen-darenft
  • duc.vu.derachain
  • thomasdare