0.0.1 • Published 11 months ago

@roninjin10/babel-plugin-sol v0.0.1

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

babel-plugin-sol

A babel plugin for transpiling template string solidity from ts-sol

Usage

Install this package

Currently not published to npm

pnpm i @roninjin10/babel-plugin-sol

Add to babel.config.js

export default (api) => {
  return {
    plugins: ['@roninjin10/babel-plugin-sol'],
  }
}

Now you can write solidity with ts-sol

ts-sol contains the code that runs at runtime

pnpm i @roninjin10/ts-sol
import { run, tsSol } from '@roninjin10/ts-sol'
import { useState } from 'react'

const forgeScript = tsSol`
contract Script {
    function run() external returns (string memory) {
        return "Hello, World!";
    }
}
`
const sayHello = (): Promise<string> => run(forgeScript)