1import { ITxData } from '@walletconnect/types';
2import { Transaction } from '@ethereumjs/tx';
3import { stripHexPrefix } from './utils/address';
5type SignWalletConnectTransactionArgs = {
8 txnSigner: (args: ITxData) => Promise<string>;
11const walletConnectSignTransaction = async ({
15}: SignWalletConnectTransactionArgs) => {
16 let wcFormattedTx = txn.toJSON();
17 wcFormattedTx.from = from;
18 wcFormattedTx.gas = wcFormattedTx.gasLimit;
20 const signature = await txnSigner(wcFormattedTx);
21 const serializedTx = Buffer.from(stripHexPrefix(signature), 'hex');
22 const signedTx = Transaction.fromSerializedTx(serializedTx);
27export { walletConnectSignTransaction };
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