@matterlabs/composables
@matterlabs/composables
Collection of essential Vue.js composables for zkSync
Usage
npm install @matterlabs/composables
-
useWallet- used to setup a connection to MetaMask walletimport { useWallet } from "@matterlabs/composables"; const { initialize } = useWallet(context); initialize().then(() => { /* application bootstrap */ })const { getL1Signer, getL2Signer } = useWallet(context);const l1Signer = await getL1Signer(); const tx = await l1signer.deposit({ to, token, amount, })const l2Signer = await getL2Signer(); const tx = await l2Signer.transfer({ to, token, amount });
Logging
You can override default existing logging behavior via attachLogger:
import { attachLogger } from "@matterlabs/composables";
attachLogger(logger);
Type definition for logger:
type LoggerLike = {
log(...data: unknown[]): void;
error(e: unknown, ...data: unknown[]): void;
warn(message: string, ...data: unknown[]): void;
};
Peer dependencies
- vue
- @vueuse/core
- zksync-web3
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.3.0 | ^3.2.41 | ISC | |
| 1.2.0 | ^3.2.41 | ISC | |
| 1.1.12 | ^3.2.41 | ISC | |
| 1.1.11 | ^3.2.41 | ISC | |
| 1.1.10 | ^3.2.41 | ISC | |
| 1.1.9 | ^3.2.41 | ISC | |
| 1.1.8 | ^3.2.41 | ISC | |
| 1.1.7 | ^3.2.41 | ISC | |
| 1.1.6 | ^3.2.41 | ISC | |
| 1.1.5 | ^3.2.41 | ISC | |
| 1.1.4 | ^3.2.41 | ISC | |
| 1.1.3 | ^3.2.41 | ISC | |
| 1.1.2 | ^3.2.41 | ISC | |
| 1.1.1 | ^3.2.41 | ISC | |
| 1.1.0 | ^3.2.41 | ISC | |
| 1.0.7 | ^3.2.41 | ISC | |
| 1.0.6 | ^3.2.41 | ISC | |
| 1.0.5 | ^3.2.41 | ISC | |
| 1.0.4 | ^3.2.41 | ISC | |
| 1.0.3 | ^3.2.41 | ISC | |
| 1.0.2 | ^3.2.41 | ISC | |
| 1.0.1 | ^3.2.41 | ISC | |
| 1.0.0 | ^3.2.41 | ISC |