1 | /// <reference types="node" />
|
2 | import Common from 'ethereumjs-common';
|
3 | /**
|
4 | * Any object that can be transformed into a `Buffer`
|
5 | */
|
6 | export interface TransformableToBuffer {
|
7 | toBuffer(): Buffer;
|
8 | }
|
9 | /**
|
10 | * A hex string prefixed with `0x`.
|
11 | */
|
12 | export declare type PrefixedHexString = string;
|
13 | /**
|
14 | * A Buffer, hex string prefixed with `0x`, Number, or an object with a toBuffer method such as BN.
|
15 | */
|
16 | export declare type BufferLike = Buffer | TransformableToBuffer | PrefixedHexString | number;
|
17 | /**
|
18 | * A transaction's data.
|
19 | */
|
20 | export interface TxData {
|
21 | /**
|
22 | * The transaction's gas limit.
|
23 | */
|
24 | gasLimit?: BufferLike;
|
25 | /**
|
26 | * The transaction's gas price.
|
27 | */
|
28 | gasPrice?: BufferLike;
|
29 | /**
|
30 | * The transaction's the address is sent to.
|
31 | */
|
32 | to?: BufferLike;
|
33 | /**
|
34 | * The transaction's nonce.
|
35 | */
|
36 | nonce?: BufferLike;
|
37 | /**
|
38 | * This will contain the data of the message or the init of a contract
|
39 | */
|
40 | data?: BufferLike;
|
41 | /**
|
42 | * EC recovery ID.
|
43 | */
|
44 | v?: BufferLike;
|
45 | /**
|
46 | * EC signature parameter.
|
47 | */
|
48 | r?: BufferLike;
|
49 | /**
|
50 | * EC signature parameter.
|
51 | */
|
52 | s?: BufferLike;
|
53 | /**
|
54 | * The amount of Ether sent.
|
55 | */
|
56 | value?: BufferLike;
|
57 | }
|
58 | /**
|
59 | * The data of a fake (self-signing) transaction.
|
60 | */
|
61 | export interface FakeTxData extends TxData {
|
62 | /**
|
63 | * The sender of the Tx.
|
64 | */
|
65 | from?: BufferLike;
|
66 | }
|
67 | /**
|
68 | * The transaction's options. This could be specified using a Common object, or `chain` and `hardfork`. Defaults to
|
69 | * mainnet.
|
70 | */
|
71 | export interface TransactionOptions {
|
72 | /**
|
73 | * A Common object defining the chain and the hardfork a transaction belongs to.
|
74 | */
|
75 | common?: Common;
|
76 | /**
|
77 | * The chain of the transaction, default: 'mainnet'
|
78 | */
|
79 | chain?: number | string;
|
80 | /**
|
81 | * The hardfork of the transaction, default: 'petersburg'
|
82 | */
|
83 | hardfork?: string;
|
84 | }
|