0.1.25 • Published 8 years ago
contract-utils v0.1.25
contract-utils
Contract utility library for Ethereum, to easily sign and send raw transactions
Installation:
npm install contract-utils --save
How to use:
const { Transaction } = require('contract-utils');
const contracts = {
'erc20': { // contract name
address: '', // contract address
abi: [], // contract abi
},
};
const Transaction = new Transaction('http://localhost:8545', contracts);
// Example signing and sending transaction to a custom ERC20 contract
const txData = {
contractName: 'erc20', // contract name from 'contracts' object
privateKey: 'privateKey', // private key to sign the transaction
gasLimit: 200000, // optional: (default: 200000)
value: 0, // optional value sent in ether (wei) if function is 'payable' (default: 0)
};
Transaction.send(
txData,
'transfer', // method to be called in the contract
'0x...', // @param1
1000000000000000000, // @param2
// ...other params
)
.then(console.log);0.1.25
8 years ago
0.1.24
8 years ago
0.1.23
8 years ago
0.1.21
8 years ago
0.1.20
8 years ago
0.1.19
8 years ago
0.1.18
8 years ago
0.1.17
8 years ago
0.1.16
8 years ago
0.1.14
8 years ago
0.1.13
8 years ago
0.1.12
8 years ago
0.1.11
8 years ago
0.1.10
8 years ago
0.1.9
8 years ago
0.1.8
8 years ago
0.1.7
8 years ago
0.1.6
8 years ago
0.1.5
8 years ago
0.1.4
8 years ago
0.1.3
8 years ago
0.1.2
8 years ago
0.1.1
8 years ago
0.1.0
8 years ago