essential-eth 0.9.2-beta.3 → 0.9.2-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/cjs/classes/Contract.d.ts +81 -11
  2. package/dist/cjs/classes/test/Contract/crv-abi.d.ts +2 -2
  3. package/dist/cjs/classes/test/Contract/ens-abi.d.ts +2 -2
  4. package/dist/cjs/classes/test/Contract/fei-abi.d.ts +2 -2
  5. package/dist/cjs/classes/test/Contract/foo-abi.d.ts +2 -2
  6. package/dist/cjs/classes/test/Contract/uniswap-abi.d.ts +2 -2
  7. package/dist/cjs/classes/utils/clean-block.d.ts +120 -2
  8. package/dist/cjs/classes/utils/clean-log.d.ts +9 -2
  9. package/dist/cjs/classes/utils/clean-transaction-receipt.d.ts +14 -2
  10. package/dist/cjs/classes/utils/clean-transaction.d.ts +14 -2
  11. package/dist/cjs/classes/utils/encode-decode-transaction.d.ts +16 -4
  12. package/dist/cjs/classes/utils/fetchers.d.ts +53 -15
  13. package/dist/cjs/classes/utils/hex-to-decimal.d.ts +18 -1
  14. package/dist/cjs/classes/utils/prepare-transaction.d.ts +6 -2
  15. package/dist/cjs/index.d.ts +24 -24
  16. package/dist/cjs/logger/logger.d.ts +11 -11
  17. package/dist/cjs/logger/package-version.d.ts +1 -1
  18. package/dist/cjs/logger/package-version.js +1 -1
  19. package/dist/cjs/providers/AlchemyProvider.d.ts +4 -4
  20. package/dist/cjs/providers/BaseProvider.d.ts +374 -26
  21. package/dist/cjs/providers/FallthroughProvider.d.ts +24 -11
  22. package/dist/cjs/providers/JsonRpcProvider.d.ts +33 -7
  23. package/dist/cjs/providers/test/json-rpc-provider/get-logs/mocks.d.ts +14 -14
  24. package/dist/cjs/providers/test/mock-of.d.ts +9 -2
  25. package/dist/cjs/providers/test/rpc-urls.d.ts +12 -12
  26. package/dist/cjs/providers/utils/chains-info.d.ts +24 -24
  27. package/dist/cjs/shared/tiny-big/helpers.d.ts +17 -1
  28. package/dist/cjs/shared/tiny-big/tiny-big.d.ts +58 -10
  29. package/dist/cjs/shared/validate-type.d.ts +3 -3
  30. package/dist/cjs/types/Block.types.d.ts +41 -40
  31. package/dist/cjs/types/Contract.types.d.ts +24 -24
  32. package/dist/cjs/types/FeeData.types.d.ts +7 -7
  33. package/dist/cjs/types/Filter.types.d.ts +16 -12
  34. package/dist/cjs/types/Network.types.d.ts +8 -5
  35. package/dist/cjs/types/Transaction.types.d.ts +123 -113
  36. package/dist/cjs/utils/bytes.d.ts +289 -40
  37. package/dist/cjs/utils/compute-address.d.ts +17 -1
  38. package/dist/cjs/utils/compute-public-key.d.ts +18 -2
  39. package/dist/cjs/utils/ether-to-gwei.d.ts +27 -3
  40. package/dist/cjs/utils/ether-to-wei.d.ts +27 -3
  41. package/dist/cjs/utils/gwei-to-ether.d.ts +27 -3
  42. package/dist/cjs/utils/hash-message.d.ts +14 -2
  43. package/dist/cjs/utils/is-address.d.ts +24 -1
  44. package/dist/cjs/utils/keccak256.d.ts +16 -2
  45. package/dist/cjs/utils/solidity-keccak256.d.ts +39 -2
  46. package/dist/cjs/utils/split-signature.d.ts +24 -2
  47. package/dist/cjs/utils/to-checksum-address.d.ts +17 -1
  48. package/dist/cjs/utils/to-utf8-bytes.d.ts +15 -1
  49. package/dist/cjs/utils/wei-to-ether.d.ts +27 -3
  50. package/dist/esm/classes/Contract.d.ts +11 -11
  51. package/dist/esm/classes/test/Contract/crv-abi.d.ts +2 -2
  52. package/dist/esm/classes/test/Contract/ens-abi.d.ts +2 -2
  53. package/dist/esm/classes/test/Contract/fei-abi.d.ts +2 -2
  54. package/dist/esm/classes/test/Contract/foo-abi.d.ts +2 -2
  55. package/dist/esm/classes/test/Contract/uniswap-abi.d.ts +2 -2
  56. package/dist/esm/classes/utils/clean-block.d.ts +2 -2
  57. package/dist/esm/classes/utils/clean-log.d.ts +2 -2
  58. package/dist/esm/classes/utils/clean-transaction-receipt.d.ts +2 -2
  59. package/dist/esm/classes/utils/clean-transaction.d.ts +2 -2
  60. package/dist/esm/classes/utils/encode-decode-transaction.d.ts +4 -4
  61. package/dist/esm/classes/utils/fetchers.d.ts +15 -15
  62. package/dist/esm/classes/utils/hex-to-decimal.d.ts +1 -1
  63. package/dist/esm/classes/utils/prepare-transaction.d.ts +2 -2
  64. package/dist/esm/index.d.ts +24 -24
  65. package/dist/esm/logger/logger.d.ts +11 -11
  66. package/dist/esm/logger/package-version.d.ts +1 -1
  67. package/dist/esm/logger/package-version.js +1 -1
  68. package/dist/esm/providers/AlchemyProvider.d.ts +4 -4
  69. package/dist/esm/providers/BaseProvider.d.ts +26 -26
  70. package/dist/esm/providers/FallthroughProvider.d.ts +11 -11
  71. package/dist/esm/providers/JsonRpcProvider.d.ts +7 -7
  72. package/dist/esm/providers/test/json-rpc-provider/get-logs/mocks.d.ts +14 -14
  73. package/dist/esm/providers/test/mock-of.d.ts +2 -2
  74. package/dist/esm/providers/test/rpc-urls.d.ts +12 -12
  75. package/dist/esm/providers/utils/chains-info.d.ts +24 -24
  76. package/dist/esm/shared/tiny-big/helpers.d.ts +1 -1
  77. package/dist/esm/shared/tiny-big/tiny-big.d.ts +10 -10
  78. package/dist/esm/shared/validate-type.d.ts +3 -3
  79. package/dist/esm/types/Block.types.d.ts +40 -40
  80. package/dist/esm/types/Contract.types.d.ts +24 -24
  81. package/dist/esm/types/FeeData.types.d.ts +7 -7
  82. package/dist/esm/types/Filter.types.d.ts +12 -12
  83. package/dist/esm/types/Network.types.d.ts +5 -5
  84. package/dist/esm/types/Transaction.types.d.ts +113 -113
  85. package/dist/esm/utils/bytes.d.ts +40 -40
  86. package/dist/esm/utils/compute-address.d.ts +1 -1
  87. package/dist/esm/utils/compute-public-key.d.ts +2 -2
  88. package/dist/esm/utils/ether-to-gwei.d.ts +3 -3
  89. package/dist/esm/utils/ether-to-wei.d.ts +3 -3
  90. package/dist/esm/utils/gwei-to-ether.d.ts +3 -3
  91. package/dist/esm/utils/hash-message.d.ts +2 -2
  92. package/dist/esm/utils/is-address.d.ts +1 -1
  93. package/dist/esm/utils/keccak256.d.ts +2 -2
  94. package/dist/esm/utils/solidity-keccak256.d.ts +2 -2
  95. package/dist/esm/utils/split-signature.d.ts +2 -2
  96. package/dist/esm/utils/to-checksum-address.d.ts +1 -1
  97. package/dist/esm/utils/to-utf8-bytes.d.ts +1 -1
  98. package/dist/esm/utils/wei-to-ether.d.ts +3 -3
  99. package/dist/{cjs/index.umd.js → essential-eth.umd.js} +2 -2
  100. package/dist/essential-eth.umd.js.map +1 -0
  101. package/package.json +6 -7
  102. package/dist/cjs/index.umd.js.map +0 -1
@@ -1,10 +1,58 @@
1
- import Big from 'big.js';
2
- export declare class TinyBig extends Big {
3
- constructor(value: string | number | TinyBig | Big);
4
- toHexString(): string;
5
- toNumber(): number;
6
- toString(): string;
7
- private padAndChop;
8
- toTwos(bitCount: number): Big;
9
- }
10
- export declare function tinyBig(value: string | number | TinyBig | Big): TinyBig;
1
+ import Big from 'big.js';
2
+ /**
3
+ * A wrapper around [big.js](https://github.com/MikeMcl/big.js) which expands scientific notation and creates a "toHexString" function.
4
+ * This is the return type of every operation on ether, wei, etc.
5
+ */
6
+ export declare class TinyBig extends Big {
7
+ constructor(value: string | number | TinyBig | Big);
8
+ /**
9
+ * Used anytime you're passing in "value" to ethers or web3
10
+ * For now, TypeScript will complain that `TinyBig` is not a `BigNumberish`. You can // @ts-ignore or call this
11
+ *
12
+ * @returns the TinyBig represented as a hex string
13
+ * @example
14
+ * ```javascript
15
+ * tinyBig(293).toHexString();
16
+ * // '0x125'
17
+ * ```
18
+ * @example
19
+ * ```javascript
20
+ * tinyBig(681365874).toHexString();
21
+ * // '0x289cd172'
22
+ */
23
+ toHexString(): string;
24
+ toNumber(): number;
25
+ toString(): string;
26
+ /**
27
+ * Eithers pads or shortens a string to a specified length
28
+ *
29
+ * @param str the string to pad or chop
30
+ * @param padChar the character to pad the string with
31
+ * @param length the desired length of the given string
32
+ * @returns a string of the desired length, either padded with the specified padChar or with the beginning of the string chopped off
33
+ * @example
34
+ * ```javascript
35
+ * padAndChop('essential-eth', 'a', 8);
36
+ * // 'tial-eth'
37
+ * ```
38
+ * @example
39
+ * ```javascript
40
+ * padAndChop('essential-eth', 'A', 20);
41
+ * // 'AAAAAAAessential-eth'
42
+ * ```
43
+ */
44
+ private padAndChop;
45
+ toTwos(bitCount: number): Big;
46
+ }
47
+ /**
48
+ * Helper factory function so that you don't have to type "new" when instantiating a new TinyBig
49
+ *
50
+ * @param value the value to initiate the TinyBig with
51
+ * @returns an initiated {@link TinyBig}
52
+ * @example
53
+ * ```javascript
54
+ * tinyBig(10).times(3).toNumber()
55
+ * // 30
56
+ * ```
57
+ */
58
+ export declare function tinyBig(value: string | number | TinyBig | Big): TinyBig;
@@ -1,3 +1,3 @@
1
- type JSPrimitiveTypes = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
2
- export declare const validateType: (value: unknown, allowedTypes: JSPrimitiveTypes[]) => void;
3
- export {};
1
+ type JSPrimitiveTypes = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
2
+ export declare const validateType: (value: unknown, allowedTypes: JSPrimitiveTypes[]) => void;
3
+ export {};
@@ -1,40 +1,41 @@
1
- import type { TinyBig } from './../shared/tiny-big/tiny-big';
2
- import type { BlockTransactionResponse, RPCTransaction } from './Transaction.types';
3
- type Modify<T, R> = Omit<T, keyof R> & R;
4
- export type BlockResponse = Modify<RPCBlock, {
5
- baseFeePerGas: TinyBig;
6
- difficulty: TinyBig;
7
- gasLimit: TinyBig;
8
- gasUsed: TinyBig;
9
- nonce: TinyBig;
10
- number: number;
11
- size: TinyBig;
12
- timestamp: TinyBig;
13
- totalDifficulty: TinyBig;
14
- transactions: Array<string | BlockTransactionResponse>;
15
- }>;
16
- export interface RPCBlock {
17
- baseFeePerGas: string;
18
- difficulty: string;
19
- extraData: string;
20
- gasLimit: string;
21
- gasUsed: string;
22
- hash: string;
23
- logsBloom: string;
24
- miner: string;
25
- mixHash: string;
26
- nonce: string;
27
- number: string;
28
- parentHash: string;
29
- receiptsRoot: string;
30
- sha3Uncles: string;
31
- size: string;
32
- stateRoot: string;
33
- timestamp: string;
34
- totalDifficulty: string;
35
- transactions: Array<string | RPCTransaction>;
36
- transactionsRoot: string;
37
- uncles: Array<string>;
38
- }
39
- export type BlockTag = 'latest' | 'earliest' | 'pending' | number | string;
40
- export {};
1
+ import type { TinyBig } from './../shared/tiny-big/tiny-big';
2
+ import type { BlockTransactionResponse, RPCTransaction } from './Transaction.types';
3
+ type Modify<T, R> = Omit<T, keyof R> & R;
4
+ export type BlockResponse = Modify<RPCBlock, {
5
+ baseFeePerGas: TinyBig;
6
+ difficulty: TinyBig;
7
+ gasLimit: TinyBig;
8
+ gasUsed: TinyBig;
9
+ nonce: TinyBig;
10
+ number: number;
11
+ size: TinyBig;
12
+ timestamp: TinyBig;
13
+ totalDifficulty: TinyBig;
14
+ transactions: Array<string | BlockTransactionResponse>;
15
+ }>;
16
+ /** Exact response from backend */
17
+ export interface RPCBlock {
18
+ baseFeePerGas: string;
19
+ difficulty: string;
20
+ extraData: string;
21
+ gasLimit: string;
22
+ gasUsed: string;
23
+ hash: string;
24
+ logsBloom: string;
25
+ miner: string;
26
+ mixHash: string;
27
+ nonce: string;
28
+ number: string;
29
+ parentHash: string;
30
+ receiptsRoot: string;
31
+ sha3Uncles: string;
32
+ size: string;
33
+ stateRoot: string;
34
+ timestamp: string;
35
+ totalDifficulty: string;
36
+ transactions: Array<string | RPCTransaction>;
37
+ transactionsRoot: string;
38
+ uncles: Array<string>;
39
+ }
40
+ export type BlockTag = 'latest' | 'earliest' | 'pending' | number | string;
41
+ export {};
@@ -1,24 +1,24 @@
1
- export type ContractTypes = 'bool' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | 'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' | 'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32' | 'bytes32[]' | 'address' | 'address payable' | 'address[4]' | 'address[100]' | 'uint256' | 'uint256[100]' | 'uint8' | 'uint32' | string;
2
- export type ContractInterface = JSONABI;
3
- export type ContractFunction<T = any> = (...args: Array<any>) => Promise<T>;
4
- export interface JSONABIArgument {
5
- anonymous?: false;
6
- inputs: {
7
- internalType?: ContractTypes | string;
8
- name: string;
9
- type: ContractTypes;
10
- indexed?: boolean;
11
- }[];
12
- name?: string;
13
- outputs?: {
14
- internalType?: ContractTypes | string;
15
- name: string;
16
- type: ContractTypes;
17
- }[];
18
- stateMutability?: 'view' | 'nonpayable' | string;
19
- type: 'function' | 'event' | 'constructor' | 'error' | 'fallback';
20
- gas?: number;
21
- constant?: boolean;
22
- payable?: boolean;
23
- }
24
- export type JSONABI = JSONABIArgument[];
1
+ export type ContractTypes = 'bool' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | 'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' | 'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32' | 'bytes32[]' | 'address' | 'address payable' | 'address[4]' | 'address[100]' | 'uint256' | 'uint256[100]' | 'uint8' | 'uint32' | string;
2
+ export type ContractInterface = JSONABI;
3
+ export type ContractFunction<T = any> = (...args: Array<any>) => Promise<T>;
4
+ export interface JSONABIArgument {
5
+ anonymous?: false;
6
+ inputs: {
7
+ internalType?: ContractTypes | string;
8
+ name: string;
9
+ type: ContractTypes;
10
+ indexed?: boolean;
11
+ }[];
12
+ name?: string;
13
+ outputs?: {
14
+ internalType?: ContractTypes | string;
15
+ name: string;
16
+ type: ContractTypes;
17
+ }[];
18
+ stateMutability?: 'view' | 'nonpayable' | string;
19
+ type: 'function' | 'event' | 'constructor' | 'error' | 'fallback';
20
+ gas?: number;
21
+ constant?: boolean;
22
+ payable?: boolean;
23
+ }
24
+ export type JSONABI = JSONABIArgument[];
@@ -1,7 +1,7 @@
1
- import type { TinyBig } from '../shared/tiny-big/tiny-big';
2
- export interface FeeData {
3
- gasPrice: TinyBig;
4
- lastBaseFeePerGas: TinyBig | null;
5
- maxFeePerGas: TinyBig | null;
6
- maxPriorityFeePerGas: TinyBig | null;
7
- }
1
+ import type { TinyBig } from '../shared/tiny-big/tiny-big';
2
+ export interface FeeData {
3
+ gasPrice: TinyBig;
4
+ lastBaseFeePerGas: TinyBig | null;
5
+ maxFeePerGas: TinyBig | null;
6
+ maxPriorityFeePerGas: TinyBig | null;
7
+ }
@@ -1,12 +1,16 @@
1
- import type { BlockTag } from './Block.types';
2
- export interface EventFilter {
3
- address?: string;
4
- topics?: Array<string | Array<string> | null>;
5
- }
6
- export interface Filter extends EventFilter {
7
- fromBlock?: BlockTag;
8
- toBlock?: BlockTag;
9
- }
10
- export interface FilterByBlockHash extends EventFilter {
11
- blockHash?: string;
12
- }
1
+ import type { BlockTag } from './Block.types';
2
+ export interface EventFilter {
3
+ address?: string;
4
+ topics?: Array<string | Array<string> | null>;
5
+ }
6
+ /**
7
+ * @param fromBlock block as starting point for range, inclusive
8
+ * @param toBlock block as ending point for range, inclusive
9
+ */
10
+ export interface Filter extends EventFilter {
11
+ fromBlock?: BlockTag;
12
+ toBlock?: BlockTag;
13
+ }
14
+ export interface FilterByBlockHash extends EventFilter {
15
+ blockHash?: string;
16
+ }
@@ -1,5 +1,8 @@
1
- export interface Network {
2
- chainId: number;
3
- ensAddress: string | null;
4
- name: string;
5
- }
1
+ /**
2
+ * A trimmed version of https://chainid.network/chains.json
3
+ */
4
+ export interface Network {
5
+ chainId: number;
6
+ ensAddress: string | null;
7
+ name: string;
8
+ }
@@ -1,113 +1,123 @@
1
- import type Big from 'big.js';
2
- import type { TinyBig } from '../shared/tiny-big/tiny-big';
3
- import type { BytesLike } from './../utils/bytes';
4
- type Modify<T, R> = Omit<T, keyof R> & R;
5
- export interface RPCTransaction extends RPCBlockTransaction {
6
- maxFeePerGas: string;
7
- maxPriorityFeePerGas: string;
8
- }
9
- export type TransactionResponse = Modify<RPCTransaction, {
10
- blockNumber: number;
11
- chainId: number;
12
- gas: TinyBig;
13
- gasLimit: TinyBig;
14
- gasPrice: TinyBig;
15
- nonce: TinyBig;
16
- transactionIndex: number;
17
- type: number;
18
- v: number;
19
- value: TinyBig;
20
- } & {
21
- maxFeePerGas: TinyBig;
22
- maxPriorityFeePerGas: TinyBig;
23
- confirmations: number;
24
- }>;
25
- export type TransactionReceipt = Modify<RPCTransactionReceipt, {
26
- blockNumber: number;
27
- cumulativeGasUsed: TinyBig;
28
- effectiveGasPrice: TinyBig;
29
- gasUsed: TinyBig;
30
- logs: Array<Log>;
31
- status: number;
32
- transactionIndex: number;
33
- type: number;
34
- } & {
35
- byzantium: boolean;
36
- confirmations: number;
37
- }>;
38
- export interface RPCTransactionRequest {
39
- from?: string;
40
- to: string;
41
- gas?: string;
42
- gasPrice?: string;
43
- value?: string;
44
- data?: BytesLike;
45
- nonce?: string;
46
- maxPriorityFeePerGas?: string;
47
- maxFeePerGas?: string;
48
- }
49
- export interface TransactionRequest {
50
- to?: string;
51
- from?: string;
52
- nonce?: TinyBig | string | Big | number;
53
- gas?: TinyBig | number | Big | string;
54
- gasPrice?: TinyBig | Big | string | number;
55
- data?: BytesLike;
56
- value?: TinyBig | string | Big | number;
57
- chainId?: number;
58
- type?: number;
59
- maxPriorityFeePerGas?: TinyBig | string | Big | number;
60
- maxFeePerGas?: TinyBig | string | Big | number;
61
- }
62
- export type Log = Modify<RPCLog, {
63
- blockNumber: number;
64
- logIndex: number;
65
- transactionIndex: number;
66
- }>;
67
- export type BlockTransactionResponse = Omit<TransactionResponse, 'maxFeePerGas' | 'maxPriorityFeePerGas'>;
68
- export interface RPCBlockTransaction {
69
- blockHash: string;
70
- blockNumber: string;
71
- chainId: string;
72
- from: string;
73
- gas: string;
74
- gasPrice: string;
75
- hash: string;
76
- input: string;
77
- nonce: string;
78
- r: string;
79
- s: string;
80
- to: string;
81
- transactionIndex: string;
82
- type: string;
83
- v: string;
84
- value: string;
85
- }
86
- export interface RPCTransactionReceipt {
87
- blockHash: string;
88
- blockNumber: string;
89
- contractAddress: string;
90
- cumulativeGasUsed: string;
91
- effectiveGasPrice: string;
92
- from: string;
93
- gasUsed: string;
94
- logs: Array<RPCLog>;
95
- logsBloom: string;
96
- status: string;
97
- to: string;
98
- transactionHash: string;
99
- transactionIndex: string;
100
- type: string;
101
- }
102
- export interface RPCLog {
103
- address: string;
104
- blockHash: string;
105
- blockNumber: string;
106
- data: string;
107
- logIndex: string;
108
- removed?: boolean;
109
- topics: Array<string>;
110
- transactionHash: string;
111
- transactionIndex: string;
112
- }
113
- export {};
1
+ import type Big from 'big.js';
2
+ import type { TinyBig } from '../shared/tiny-big/tiny-big';
3
+ import type { BytesLike } from './../utils/bytes';
4
+ type Modify<T, R> = Omit<T, keyof R> & R;
5
+ export interface RPCTransaction extends RPCBlockTransaction {
6
+ maxFeePerGas: string;
7
+ maxPriorityFeePerGas: string;
8
+ }
9
+ export type TransactionResponse = Modify<RPCTransaction, {
10
+ blockNumber: number;
11
+ chainId: number;
12
+ gas: TinyBig;
13
+ gasLimit: TinyBig;
14
+ gasPrice: TinyBig;
15
+ nonce: TinyBig;
16
+ transactionIndex: number;
17
+ type: number;
18
+ v: number;
19
+ value: TinyBig;
20
+ } & {
21
+ maxFeePerGas: TinyBig;
22
+ maxPriorityFeePerGas: TinyBig;
23
+ confirmations: number;
24
+ }>;
25
+ /**
26
+ * Type that contains information from the receipt of a transaction
27
+ *
28
+ * * Similar to [`Type TransactionReceipt on ethers.providers`](https://docs.ethers.io/v5/api/providers/types/#providers-TransactionReceipt)
29
+ */
30
+ export type TransactionReceipt = Modify<RPCTransactionReceipt, {
31
+ blockNumber: number;
32
+ cumulativeGasUsed: TinyBig;
33
+ effectiveGasPrice: TinyBig;
34
+ gasUsed: TinyBig;
35
+ logs: Array<Log>;
36
+ status: number;
37
+ transactionIndex: number;
38
+ type: number;
39
+ } & {
40
+ byzantium: boolean;
41
+ confirmations: number;
42
+ }>;
43
+ export interface RPCTransactionRequest {
44
+ from?: string;
45
+ to: string;
46
+ gas?: string;
47
+ gasPrice?: string;
48
+ value?: string;
49
+ data?: BytesLike;
50
+ nonce?: string;
51
+ maxPriorityFeePerGas?: string;
52
+ maxFeePerGas?: string;
53
+ }
54
+ export interface TransactionRequest {
55
+ to?: string;
56
+ from?: string;
57
+ nonce?: TinyBig | string | Big | number;
58
+ gas?: TinyBig | number | Big | string;
59
+ gasPrice?: TinyBig | Big | string | number;
60
+ data?: BytesLike;
61
+ value?: TinyBig | string | Big | number;
62
+ chainId?: number;
63
+ type?: number;
64
+ maxPriorityFeePerGas?: TinyBig | string | Big | number;
65
+ maxFeePerGas?: TinyBig | string | Big | number;
66
+ }
67
+ /**
68
+ * Type for the logs that are included in transaction receipts
69
+ * Similar to [`Type Log on ethers.providers`](https://docs.ethers.io/v5/api/providers/types/#providers-Log)
70
+ */
71
+ export type Log = Modify<RPCLog, {
72
+ blockNumber: number;
73
+ logIndex: number;
74
+ transactionIndex: number;
75
+ }>;
76
+ export type BlockTransactionResponse = Omit<TransactionResponse, 'maxFeePerGas' | 'maxPriorityFeePerGas'>;
77
+ /** What JSONRPC responds with in getBlock transaction array */
78
+ export interface RPCBlockTransaction {
79
+ blockHash: string;
80
+ blockNumber: string;
81
+ chainId: string;
82
+ from: string;
83
+ gas: string;
84
+ gasPrice: string;
85
+ hash: string;
86
+ input: string;
87
+ nonce: string;
88
+ r: string;
89
+ s: string;
90
+ to: string;
91
+ transactionIndex: string;
92
+ type: string;
93
+ v: string;
94
+ value: string;
95
+ }
96
+ export interface RPCTransactionReceipt {
97
+ blockHash: string;
98
+ blockNumber: string;
99
+ contractAddress: string;
100
+ cumulativeGasUsed: string;
101
+ effectiveGasPrice: string;
102
+ from: string;
103
+ gasUsed: string;
104
+ logs: Array<RPCLog>;
105
+ logsBloom: string;
106
+ status: string;
107
+ to: string;
108
+ transactionHash: string;
109
+ transactionIndex: string;
110
+ type: string;
111
+ }
112
+ export interface RPCLog {
113
+ address: string;
114
+ blockHash: string;
115
+ blockNumber: string;
116
+ data: string;
117
+ logIndex: string;
118
+ removed?: boolean;
119
+ topics: Array<string>;
120
+ transactionHash: string;
121
+ transactionIndex: string;
122
+ }
123
+ export {};