-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📦 feat: Add @evmts/viem package (#473)
## Description Added new package @evmts/viem for using evmts with viem ## Testing Explain the quality checks that have been done on the code changes ## Additional Information - [ ] I read the [contributing docs](../docs/contributing.md) (if this is your first contribution) Your ENS/address: --------- Co-authored-by: Will Cory <[email protected]>
- Loading branch information
1 parent
dbc2da6
commit 9f44e3f
Showing
19 changed files
with
3,044 additions
and
940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
"@evmts/viem": minor | ||
--- | ||
|
||
Added new package @evmts/viem as a new way to wrap viem with evmts functionality | ||
|
||
# @evmts/viem | ||
|
||
A [viem](https://viem.sh) extension for integrating viem with EVMts. [Extensions](https://viem.sh/docs/clients/custom.html) allow plugins to decorate viem clients with additional functionality. | ||
|
||
## Installation | ||
|
||
#### npm: | ||
|
||
```bash | ||
npm install @viem/evmts-extension | ||
``` | ||
|
||
#### pnpm: | ||
|
||
```bash | ||
pnpm install @viem/evmts-extension | ||
``` | ||
#### bun: | ||
|
||
```bash | ||
bun install @viem/evmts-extension | ||
``` | ||
|
||
#### yarn: | ||
|
||
```bash | ||
yarn add @viem/evmts-extension | ||
``` | ||
## Basic Usage | ||
|
||
```typescript | ||
import { getContractFromEvmts } from '@evmts/viem' | ||
import { publicClient } from './client' | ||
|
||
const contract = getContractFromEvmts({ | ||
evmts: await import('./MyContract.sol'), | ||
publicClient, | ||
}) | ||
|
||
// 2. Call contract methods, listen to events, etc. | ||
const result = await contract.read.totalSupply() | ||
const unwatch = contract.watchEvent.Transfer( | ||
{ from: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e' }, | ||
{ onLogs(logs) { console.log(logs) } } | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9f44e3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
evmts-docs – ./
evmts-docs-evmts.vercel.app
evmts.dev
evmts-docs-git-main-evmts.vercel.app