Skip to content

iankressin/tx-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TXScript

A simple, non-turing complete, sql-like language for sending EVM transactions.

Sentence structure

TXS supports a simple sentence structure for sending transactions. The sentence structure is as follows:

send <amount> <unit | token> to <address> on <chain>

Example

send 3.1 ether to vitalik.eth on eth
send 10000000 gwei to 0x1234567890abcdef1234567890abcdef12345678 on base

Running transactions

To run a transaction you can use one of the following methods:

.txs files

Write your transactions in a .txs file:

# payments.txs
send 1 ether to vitalik.eth on eth
send 2 ether to joe.eth on base

And run them using the following command:

txs run payments.txs
Untitled.Project.mp4

REPL

TXS comes with a simple REPL sending out transactions. To start the REPL, run the following command:

txs repl

Then you can start sending transactions:

tx-script > send 1 ether to vitalik.eth on eth
📡 Sending transaction  | to: vitalik.eth, value: 1 ETH, chain: Anvil
✅ Transaction included
🔗 Transaction hash: 0x1f9e8b16e4aaaf9b1041859649d84999cb2a831bcacdff3719cd53a6c8e6b52d
🌐 Transaction URL: http://localhost:8545/tx/0x1f9e8b16e4aaaf9b1041859649d84999cb2a831bcacdff3719cd53a6c8e6b52d
Untitled.Project.mov

Installation

First, you should install txsup, the TXScript version manager. You can do this by running the following command:

curl https://raw.githubusercontent.com/iankressin/tx-script/main/txsup/install.sh | sh

Then you can install the latest version of TXScript by running the following command:

txsup

Updating TXScript

To update TXScript to the latest version, you can simply run txsup again:

txsup

Setting up a private key

In order to sign the transactions, TXScript needs to set a private key locally.

txs set-pk <PRIVATE_KEY>

Needless to say that you should never use a private key of a wallet that you care about

Support

Tokens

The following tokens are supported for the production of <unit | token>:

  • ether (wei | gwei | ether)
  • dai
  • usdc
  • usdt
  • wbtc
  • weth

Chains

The following chains are supported for the production of <chain>:

  • Ethereum (eth)
  • Arbitrum (arb)
  • Optimism (op)
  • Base (base)
  • Anvil (anvil)

About

Scripting language for sending EVM transactions

Resources

License

Stars

Watchers

Forks

Packages

No packages published