1export function MetamaskWallet(address) {
2 this.address = address;
5export function FakeMetamaskTransaction(txnData) {
6 this.txnData = txnData;
8 this.serialize = function() {
13// Cheat a bit and pretend to sign transaction
14// Sign it actually when sending
15export const metamaskSignTransaction = async (txn, from) => {
16 const metamaskFormattedTxn = {
17 to: txn.to.toString('hex'),
18 value: txn.value.toString('hex'),
19 data: txn.data.toString('hex'),
20 gasLimit: txn.gasLimit.toString('hex'),
21 gasPrice: txn.gasPrice.toString('hex'),
22 nonce: txn.nonce.length === 0 ? '00' : txn.nonce.toString('hex'),
26 return new FakeMetamaskTransaction(metamaskFormattedTxn);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list