0.0.1 • Published 2 years ago
@roninjin10/ts-sol v0.0.1
babel-plugin-sol
Note this is just a proof of concept and will change heavily in future versions
A babel plugin for transpiling template string solidity from ts-sol
Usage
To use you must add the ts-sol babel plugin
Install dependencies
Currently not published to npm as it's experimental
pnpm i @roninin10/ts-sol @roninjin10/babel-plugin-solAdd to babel.config.js
export default (api) => {
  return {
    plugins: ['@roninjin10/babel-plugin-sol'],
  }
}Now you can write solidity with 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)0.0.1
2 years ago