0.2.0 • Published 2 years ago

@solidstate/hardhat-txn-dot-xyz v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Hardhat txn.xyz Client

Format and trigger secure on-chain transactions via txn.xyz.

Installation

npm install --save-dev @solidstate/hardhat-txn-dot-xyz
# or
yarn add --dev @solidstate/hardhat-txn-dot-xyz

Usage

Load plugin in Hardhat config:

require('@solidstate/hardhat-txn-dot-xyz');

Output usage information via Hardhat:

npx hardhat txn-dot-xyz-send --help
# or
yarn run hardhat txn-dot-xyz-send --help

Example

This example will encode a Mainnet transaction which revokes the sender's approval to spend DAI from vitalik.eth.

npx hardhat txn-dot-xyz-send --chain-id 1 --contract-address 0x6b175474e89094c44da98b954eedeac495271d0f --fn approve --fn-params '["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", 0]'
# or
yarn run hardhat txn-dot-xyz-send --chain-id 1 --contract-address 0x6b175474e89094c44da98b954eedeac495271d0f --fn approve --fn-params '["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", 0]'

It may also be run from within the Hardhat environment:

await hre.run('txn-dot-xyz-send', {
  chainId: 1,
  contractAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
  fn: 'approve',
  fnParams: ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", 0],
});

Optional Flags

FlagDescription
promptwhether to block execution until use confirms that transaction has been mined
browserwhether to automatically open generated URL in the default browser