0.11.2 • Published 6 months ago

@evmts/bun-plugin v0.11.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@evmts/plugin-bun

A bun plugin for importing solidity files.

Installation

Install build dependencies

bun install -D bun-types @evmts/bun-plugin @evmts/ts-plugin @evmts/core solc

Setup

first create a plugins.ts file

import { evmtsBunPlugin } from "@evmts/bun-plugin";
import { plugin } from 'bun'

plugin(evmtsBunPlugin())

Next load your plugin.ts file in your bunfig.toml

preload = ["./plugins.ts"]

# add to [test] to use plugin in bun test too
[test]
preload = ["./plugins.ts"]

Usage

Once set up you can import solidity files directly from node modules such as openzepplin/contracts or your source code. You can use with viem ethersjs or any other library.

import { http, createPublicClient } from 'viem'
import { optimismGoerli } from 'viem/chains'
import { ExampleContract } from './ExampleContract.sol'

export const publicClient = createPublicClient({
  chain: optimismGoerli,
  transport: http('https://goerli.optimism.io'),
})

const owner = '0x8f0ebdaa1cf7106be861753b0f9f5c0250fe0819'

publicClient.readContract(
  ExampleContract.read({ chainId: optimismGoerli.id }).balanceOf(owner)
).then(console.log)

License 📄

1.0.0-next.18

6 months ago

1.0.0-next.17

6 months ago

1.0.0-next.15

6 months ago

1.0.0-next.13

6 months ago

1.0.0-next.12

6 months ago

1.0.0-next.11

6 months ago

1.0.0-next.9

6 months ago

1.0.0-next.8

6 months ago

1.0.0-next.6

6 months ago

1.0.0-next.5

6 months ago

1.0.0-next.4

6 months ago

1.0.0-next.3

6 months ago

1.0.0-next.2

6 months ago

1.0.0-next.0

6 months ago

0.11.2

8 months ago

0.10.0

8 months ago

0.9.0

8 months ago