
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@instadapp/vue-web3
Advanced tools
Vue 2/3 wrapper for web3 built on top of react-web3@v6.
# npm
npm i @instadapp/vue-web3
# yarn
yarn add @instadapp/vue-web3
import { useWeb3, setWeb3LibraryCallback } from '@instadapp/vue-web3'
import { InjectedConnector } from '@web3-react/injected-connector'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
import Web3 from 'web3'
const injected = new InjectedConnector({
supportedChainIds: [1, 137],
})
const walletconnect = new WalletConnectConnector({
rpc: { 1: 'https://mainnet.infura.io/v3/YOUR_API_KEY' },
qrcode: true,
})
// web3.js v1
setWeb3LibraryCallback((provider) => new Web3(provider))
// ethers.js v5
setWeb3LibraryCallback((provider) => new Web3Provider(provider, "any"))
// viem
setWeb3LibraryCallback((provider, _connector, account) => ({
public: createPublicClient({
transport: custom(provider),
}),
wallet: createWalletClient({
account,
chain: null as unknown as Chain,
transport: custom(provider),
}),
}))
defineComponent({
setup() {
const { active, activate, account, library } = useWeb3()
const connectUsingMetamask = async () => {
await activate(injected)
}
const connectUsingWalletConnect = async () => {
await activate(walletconnect)
}
return {
active,
connect,
connectUsingMetamask,
connectUsingWalletConnect,
}
},
})
using generic:
import Web3 from 'web3'
const { library } = useWeb3<Web3>()
import { Web3Provider } from "@ethersproject/providers";
const { library } = useWeb3<Web3Provider>()
using global types:
// global.d.ts
import type Web3 from 'web3'
declare module '@instadapp/vue-web3' {
interface IVueWeb3Library extends Web3 {}
}
yarn add @instadapp/vue-web3-nuxt -D
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@instadapp/vue-web3-nuxt'],
web3: {
autoImport: false, // default `true`
},
})
If you disabled @instadapp/vue-web3-nuxt
auto import:
//composables/useWeb3.ts
import Web3 from 'web3'
// import { Web3Provider } from "@ethersproject/providers";
import { useWeb3 as useWeb3Generic } from '@instadapp/vue-web3'
const useWeb3 = () => useWeb3Generic<Web3>()
// const useWeb3 = () => useWeb3Generic<Web3Provider>();
export { useWeb3 }
Demo (Nuxt 2): https://github.com/KABBOUCHI/nuxt-vue-web3
Demo (Nuxt 3): https://github.com/KABBOUCHI/nuxt3-vue-web3
FAQs
Vue web3 composition api
We found that @instadapp/vue-web3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.