Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@funkit/core
Advanced tools
Funkit core SDK provides feature-rich and extensible smart wallets built on account abstraction
FunKit empowers you to create feature-rich and extensible smart wallets built on account abstraction. Leveraging the FunKit, you can customize gas behavior, adopt multi-sig and common authentication method, monetize your application, execute any transactions from smart wallets, and much more.
This repo only covers FunKit Core SDK which does not provide any frontend specific optimizations. Check our Web SDK if you want to further simplify your application with our react hooks.
npm i @funkit/core --save
# or
yarn add @funkit/core
FunKit needs to be configured with an API key. Get a key by logging to our dashboard.
Import all required classes.
import { FunWallet, configureEnvironment, Auth } from "@funkit/core"
Set your environment variables describing how your smart wallets interact with blockchains. This can include chain, apiKey, and optional gasSponsor.
chain
- Each FunWallet exists on an EVM-compatible blockchain.apiKey
- You can get an API key by logging to our dashboard.gasSponsor
- All wallets have to pay gas to execute transactions on a blockchain. You can pre-fund the wallet with native tokens or you can have third parties to pay for gas by specifying a gasSponsor.await configureEnvironment({
chain: CHAIN_ID,
apiKey: API_KEY,
gasSponsor: {
sponsorAddress: SPONSOR_ADDRESS
}
})
Next, you need a way to sign transactions. All authentication in FunKit is handled with the Auth object. You can use privateKey, viem client, web3 provider, ethers.js signer, rpcProvider or windowEth (MetaMask) to build the Auth. Check more examples about how to create auth with different inputs here
const auth = new Auth({ privateKey: PRIVATE_KEY })
With the Auth instance that you just created, you can now initialize your FunWallet. Here are the FunWallet constructor parameters:
users
- This is a User[]
that holds all users
that can access your FunWallet
. For simplicity, we’re only including 1 user here.uniqueId
- This is a random seed that is generated from our Auth
instance. The purpose of this seed is to generate the address
of our FunWallet
.const wallet = new FunWallet({
users: [{ userId: auth.getAddress() }],
uniqueId: auth.getWalletUniqueId()
})
Now we have the wallet object, we will show how to transfer some basic ERC-20 tokens to other addresses. Note that the smart wallet will only be created on the blockchain after executeOperation is finished.
const transferOp = await wallet.transfer(auth, await auth.getUserId(), {
to: RECIPIENT_ADDRESS,
amount: AMOUNT,
token: TOKEN_TO_SEND
})
const receipt = await funWallet.executeOperation(auth, transferOp)
console.log(receipt)
You can test FunKit on Ethereum goerli testnet with the following configuration. We have a gas sponsor that will cover your gas cost for the first 200 operations so you don’t have to worry about pre-funding the wallet or setting up the gas sponsor to start.
await configureEnvironment({
chain: "goerli",
gasSponsor: {
sponsorAddress: "0xCB5D0b4569A39C217c243a436AC3feEe5dFeb9Ad"
},
apiKey: API_KEY
})
FAQs
Funkit core SDK provides feature-rich and extensible smart wallets built on account abstraction
The npm package @funkit/core receives a total of 467 weekly downloads. As such, @funkit/core popularity was classified as not popular.
We found that @funkit/core 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.