Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@actalink/sdk
Advanced tools
import { SmartAccount, type SmartAccountConfig } from "@actalink/sdk";
...
...
// define configurations for smart account
const config: SmartAccountConfig = {
chainId,
provider,
owner: wallet,
bundlerUrl: "<bundler URL>",
paymasterUrl: "<paymaster URL>"
};
const smartWallet = new SmartAccount(config);
// send transaction
const userOpHash = await smartWallet.sendTransaction({
to: "<contract address>", // Address of contract which we are interacting to. Here USDC contract address.
data: "<transaction data>",
value: 0n,
});
Note: if you are using SDK in React or Next.js app and using wagmi connector for connecting with wallets then you should configure your provider and signer in ethers.js format.
// hook.ts
import * as React from "react";
import {
type PublicClient,
usePublicClient,
useWalletClient,
type WalletClient,
} from "wagmi";
import {
FallbackProvider,
JsonRpcProvider,
BrowserProvider,
JsonRpcSigner,
} from "ethers"; //use ethersv6
import { type HttpTransport } from "viem";
function publicClientToProvider(publicClient: PublicClient) {
const { chain, transport } = publicClient;
const network = {
chainId: chain.id,
name: chain.name,
ensAddress: chain.contracts?.ensRegistry?.address,
};
if (transport.type === "fallback") {
const providers = (transport.transports as ReturnType<HttpTransport>[]).map(
({ value }) => new JsonRpcProvider(value?.url, network)
);
if (providers.length === 1) return providers[0];
return new FallbackProvider(providers);
}
return new JsonRpcProvider(transport.url, network);
}
/**
* Hook to use a viem Public Client with ethers.js Provider.
*/
export function useEthersProvider({ chainId }: { chainId?: number } = {}) {
const publicClient = usePublicClient({ chainId });
return React.useMemo(
() => publicClientToProvider(publicClient),
[publicClient]
);
}
function walletClientToSigner(walletClient: WalletClient) {
const { account, chain, transport } = walletClient;
const network = {
chainId: chain.id,
name: chain.name,
ensAddress: chain.contracts?.ensRegistry?.address,
};
const provider = new BrowserProvider(transport, network);
const signer = new JsonRpcSigner(provider, account.address);
return signer;
}
/**
* Hook to use a viem Wallet Client with ethers.js Signer.
*/
export function useEthersSigner({ chainId }: { chainId?: number } = {}) {
const { data: walletClient } = useWalletClient({ chainId });
return React.useMemo(
() => (walletClient ? walletClientToSigner(walletClient) : undefined),
[walletClient]
);
}
// App.tsx
import {
useEthersProvider,
useEthersSigner,
} from "./hooks.ts"; // import hooks from above file
...
const provider = useEthersProvider();
const signer = useEthersSigner();
const config: SmartAccountConfig = {
chainId,
provider,
owner: signer,
bundlerUrl: "<bundler URL>",
paymasterUrl: "<paymaster URL>"
};
const smartAccount = new SmartAccount(config);
FAQs
ActaLink Account Abstraction SDK
The npm package @actalink/sdk receives a total of 9 weekly downloads. As such, @actalink/sdk popularity was classified as not popular.
We found that @actalink/sdk 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.