@actalink/modules
TypeScript icon, indicating that this package has built-in type declarations

0.0.15 • Public • Published

Use validation module with actalink SDK

import { SmartAccount, type SmartAccountConfig } from "@actalink/sdk";
import { addMinutes, getCurrentTimestamp, ScheduleopValidationModule } from "@actalink/modules";

const config: SmartAccountConfig = {
  chainId,
  provider,
  owner: wallet,
  bundlerUrl: "<bundler URL>",
  paymasterUrl: "<paymaster URL>"
};

const smartWallet = new SmartAccount(config);

const validationClient = new ScheduleopValidationModule({
  chainId,
  provider,
  owner: wallet,
  bundlerUrl: "<bundler URL>",
  paymasterUrl: "https://goerli-paymaster.acta.link", // Supported paymaster for ScheduleopValidationModule
});
const executionTimes = [
  addMinutes(getCurrentTimestamp(), { amount: 5 }),
  addMinutes(getCurrentTimestamp(), { amount: 7 }),
];
const userOpHashes = await validationClient.createScheduleOps(
  "<Address of contract which we are interacting with.For ERC20 payments use ERC20 contract address.>",
  transferData,
  0n,
  2, // number of times to repeat the payments
  [...executionTimes] // array of execution times in miliseconds
)

Readme

Keywords

none

Package Sidebar

Install

npm i @actalink/modules

Weekly Downloads

2

Version

0.0.15

License

GPL-3.0-or-later

Unpacked Size

51.6 kB

Total Files

14

Last publish

Collaborators

  • iamyxsh
  • 0mkar