Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@abstraxn/account
Advanced tools
@abstraxn/account: Empower ERC-4337 smart accounts with seamless APIs for enhanced decentralized finance experiences.
Facilitating the integration and deployment of Smart Accounts, as well as constructing and dispatching user operations, stands as a pivotal feature within any toolkit designed for ERC4337. This package seamlessly incorporates the fundamental attributes associated with ERC-4337, streamlining the development process for your Dapp's account and transaction rails while incorporating additional usability features.
The account package accomplishes this by offering a comprehensive set of methods, empowering developers to effortlessly generate UserOperations. Augmented by the sophisticated, developer-friendly, and scalable abstraction layer provided by Abstraxn, it ensures the efficient and reliable transmission of these operations across multiple EVM chains.
In ERC-4337, a smart account is a dedicated smart contract managing assets and generating userOps, pseudo-transaction objects executed on the EVM, replacing traditional Externally Owned Accounts.
The easiest way to use Abstraxn - Account is to install it from npm:
npm install @abstraxn/account
npm install ethers@5.7 @abstraxn/account @abstraxn/bundler @abstraxn/common @abstraxn/core-types @abstraxn/modules
import { Signer, ethers } from "ethers";
import { AbstraxnSmartAccount } from "@abstraxn/account";
import {
DEFAULT_ECDSA_OWNERSHIP_MODULE,
DEFAULT_ENTRYPOINT_ADDRESS,
ECDSAOwnershipValidationModule,
} from "@abstraxn/modules";
import { Bundler, IBundler } from "@abstraxn/bundler";
import { ChainId } from "@abstraxn/core-types";
// Create a new Web3Provider using the 'ethereum' object
const provider = new ethers.providers.Web3Provider(ethereum);
// create instance of bundlers
const bundler: IBundler = new Bundler({
bundlerUrl: "",
chainId: ChainId.POLYGON_MUMBAI, // you can use multiple chains available in chainId object
entryPointAddress: DEFAULT_ENTRYPOINT_ADDRESS,
});
// instance of ownership module
const ownerShipModule = await ECDSAOwnershipValidationModule.create({
signer: provider.getSigner() as Signer, // ethers signer object
moduleAddress: DEFAULT_ECDSA_OWNERSHIP_MODULE,
});
// Note that bundler is optional. You can choose to create new instances of this later and make account API use
const abstraxnSmartAccount = await AbstraxnSmartAccount.create({
chainId: ChainId.POLYGON_MUMBAI, // you can use multiple chains available in chainId object
activeValidationModule: ownerShipModule,
defaultValidationModule: ownerShipModule,
bundler: bundler, // instance of bundler
});
// you can get your smart account wallet address by getAccountAddress()
const address = await abstraxnSmartAccount.getAccountAddress();
//Contract instance
const contract = new ethers.Contract(
contractAddress,
Contract_ABI, // contract abi
provider
);
//contract function
const mint = await contract.populateTransaction.mint(
//walletAddress,
//amount
);
//transaction
const tx1 = {
to: contractAddress,
data: mint.data,
};
// you can create your userOp by buildUserOp()
const userOp = await abstraxnSmartAccount.buildUserOp([tx1, ...], {
overrides: {
...
}
});
// you can send your userOp to bundler by sendUserOp()
const userOpResponse = await abstraxnSmartAccount.sendUserOp(userOp);
//wait for response
const { receipt } = await userOpResponse.wait(1);
//your transaction receipt
console.log(receipt)
create()
- Used for setting the SDK API key on the frontend.
getAccountAddress()
- Deploys a multisig wallet for the user.
buildUserOp()
- Creates signatures for approvers for all transactions.
sendUserOp()
- Executes functions using the multisig wallet.
... and so on
This package is MIT licensed. (c) Antier Solutions 2024.
FAQs
@abstraxn/account: Empower ERC-4337 smart accounts with seamless APIs for enhanced decentralized finance experiences.
We found that @abstraxn/account demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.