essential-eth 0.5.6 → 0.5.10-next.2

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 (196) hide show
  1. package/{lib/esm → dist}/classes/Contract.d.ts +11 -11
  2. package/dist/classes/test/Contract/crv-abi.d.ts +2 -0
  3. package/dist/classes/test/Contract/ens-abi.d.ts +2 -0
  4. package/dist/classes/test/Contract/fei-abi.d.ts +2 -0
  5. package/dist/classes/test/Contract/foo-abi.d.ts +2 -0
  6. package/dist/classes/test/Contract/uniswap-abi.d.ts +2 -0
  7. package/dist/classes/utils/clean-block.d.ts +3 -0
  8. package/dist/classes/utils/clean-log.d.ts +2 -0
  9. package/{lib/esm → dist}/classes/utils/clean-transaction-receipt.d.ts +2 -2
  10. package/{lib/esm → dist}/classes/utils/clean-transaction.d.ts +2 -2
  11. package/{lib/cjs → dist}/classes/utils/encode-decode-transaction.d.ts +4 -4
  12. package/{lib/cjs → dist}/classes/utils/fetchers.d.ts +9 -9
  13. package/{lib/esm → dist}/classes/utils/hex-to-decimal.d.ts +1 -1
  14. package/dist/classes/utils/prepare-transaction.d.ts +2 -0
  15. package/dist/index.cjs +2 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/{lib/cjs → dist}/index.d.ts +25 -25
  18. package/dist/index.js +2 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/index.modern.js +2 -0
  21. package/dist/index.modern.js.map +1 -0
  22. package/dist/index.modern.mjs +2 -0
  23. package/dist/index.modern.mjs.map +1 -0
  24. package/dist/index.module.js +2 -0
  25. package/dist/index.module.js.map +1 -0
  26. package/dist/index.umd.js +2 -0
  27. package/dist/index.umd.js.map +1 -0
  28. package/{lib/esm → dist}/logger/logger.d.ts +11 -11
  29. package/dist/logger/package-version.d.ts +1 -0
  30. package/{lib/esm → dist}/providers/BaseProvider.d.ts +24 -21
  31. package/{lib/esm → dist}/providers/FallthroughProvider.d.ts +11 -11
  32. package/{lib/esm → dist}/providers/JsonRpcProvider.d.ts +7 -7
  33. package/{lib/cjs → dist}/providers/test/rpc-urls.d.ts +11 -11
  34. package/{lib/esm → dist}/providers/utils/chains-info.d.ts +467 -412
  35. package/{lib/cjs → dist}/shared/tiny-big/helpers.d.ts +1 -1
  36. package/{lib/esm → dist}/shared/tiny-big/tiny-big.d.ts +10 -10
  37. package/{lib/cjs → dist}/shared/validate-type.d.ts +3 -3
  38. package/{lib/cjs → dist}/types/Block.types.d.ts +40 -37
  39. package/{lib/cjs → dist}/types/Contract.types.d.ts +24 -24
  40. package/dist/types/Filter.types.d.ts +12 -0
  41. package/{lib/esm → dist}/types/Network.types.d.ts +5 -5
  42. package/{lib/cjs → dist}/types/Transaction.types.d.ts +113 -96
  43. package/{lib/esm → dist}/utils/bytes.d.ts +40 -40
  44. package/{lib/esm → dist}/utils/compute-address.d.ts +1 -1
  45. package/{lib/esm → dist}/utils/compute-public-key.d.ts +2 -2
  46. package/{lib/esm → dist}/utils/ether-to-gwei.d.ts +3 -3
  47. package/dist/utils/ether-to-wei.d.ts +3 -0
  48. package/dist/utils/gwei-to-ether.d.ts +3 -0
  49. package/{lib/esm → dist}/utils/hash-message.d.ts +2 -2
  50. package/{lib/esm → dist}/utils/is-address.d.ts +1 -1
  51. package/dist/utils/keccak256.d.ts +2 -0
  52. package/{lib/esm → dist}/utils/solidity-keccak256.d.ts +2 -2
  53. package/{lib/esm → dist}/utils/split-signature.d.ts +2 -2
  54. package/{lib/esm → dist}/utils/to-checksum-address.d.ts +1 -1
  55. package/{lib/cjs → dist}/utils/to-utf8-bytes.d.ts +1 -1
  56. package/dist/utils/wei-to-ether.d.ts +3 -0
  57. package/package.json +66 -19
  58. package/readme.md +643 -291
  59. package/lib/cjs/classes/Contract.d.ts +0 -72
  60. package/lib/cjs/classes/Contract.js +0 -129
  61. package/lib/cjs/classes/test/Contract/crv-abi.d.ts +0 -2
  62. package/lib/cjs/classes/test/Contract/crv-abi.js +0 -488
  63. package/lib/cjs/classes/test/Contract/ens-abi.d.ts +0 -2
  64. package/lib/cjs/classes/test/Contract/ens-abi.js +0 -453
  65. package/lib/cjs/classes/test/Contract/fei-abi.d.ts +0 -2
  66. package/lib/cjs/classes/test/Contract/fei-abi.js +0 -526
  67. package/lib/cjs/classes/test/Contract/foo-abi.d.ts +0 -2
  68. package/lib/cjs/classes/test/Contract/foo-abi.js +0 -42
  69. package/lib/cjs/classes/test/Contract/uniswap-abi.d.ts +0 -2
  70. package/lib/cjs/classes/test/Contract/uniswap-abi.js +0 -121
  71. package/lib/cjs/classes/utils/clean-block.d.ts +0 -6
  72. package/lib/cjs/classes/utils/clean-block.js +0 -47
  73. package/lib/cjs/classes/utils/clean-transaction-receipt.d.ts +0 -5
  74. package/lib/cjs/classes/utils/clean-transaction-receipt.js +0 -55
  75. package/lib/cjs/classes/utils/clean-transaction.d.ts +0 -5
  76. package/lib/cjs/classes/utils/clean-transaction.js +0 -42
  77. package/lib/cjs/classes/utils/encode-decode-transaction.js +0 -113
  78. package/lib/cjs/classes/utils/fetchers.js +0 -51
  79. package/lib/cjs/classes/utils/hex-to-decimal.d.ts +0 -5
  80. package/lib/cjs/classes/utils/hex-to-decimal.js +0 -11
  81. package/lib/cjs/index.js +0 -55
  82. package/lib/cjs/logger/logger.d.ts +0 -11
  83. package/lib/cjs/logger/logger.js +0 -36
  84. package/lib/cjs/logger/package-version.d.ts +0 -1
  85. package/lib/cjs/logger/package-version.js +0 -5
  86. package/lib/cjs/providers/BaseProvider.d.ts +0 -304
  87. package/lib/cjs/providers/BaseProvider.js +0 -405
  88. package/lib/cjs/providers/FallthroughProvider.d.ts +0 -24
  89. package/lib/cjs/providers/FallthroughProvider.js +0 -65
  90. package/lib/cjs/providers/JsonRpcProvider.d.ts +0 -27
  91. package/lib/cjs/providers/JsonRpcProvider.js +0 -40
  92. package/lib/cjs/providers/test/rpc-urls.js +0 -14
  93. package/lib/cjs/providers/types.d.ts +0 -7
  94. package/lib/cjs/providers/types.js +0 -2
  95. package/lib/cjs/providers/utils/chains-info.d.ts +0 -412
  96. package/lib/cjs/providers/utils/chains-info.js +0 -1237
  97. package/lib/cjs/shared/tiny-big/helpers.js +0 -71
  98. package/lib/cjs/shared/tiny-big/tiny-big.d.ts +0 -32
  99. package/lib/cjs/shared/tiny-big/tiny-big.js +0 -71
  100. package/lib/cjs/shared/validate-type.js +0 -9
  101. package/lib/cjs/types/Block.types.js +0 -2
  102. package/lib/cjs/types/Contract.types.js +0 -2
  103. package/lib/cjs/types/Network.types.d.ts +0 -8
  104. package/lib/cjs/types/Network.types.js +0 -2
  105. package/lib/cjs/types/Transaction.types.js +0 -2
  106. package/lib/cjs/utils/bytes.d.ts +0 -172
  107. package/lib/cjs/utils/bytes.js +0 -564
  108. package/lib/cjs/utils/compute-address.d.ts +0 -8
  109. package/lib/cjs/utils/compute-address.js +0 -24
  110. package/lib/cjs/utils/compute-public-key.d.ts +0 -9
  111. package/lib/cjs/utils/compute-public-key.js +0 -17
  112. package/lib/cjs/utils/ether-to-gwei.d.ts +0 -26
  113. package/lib/cjs/utils/ether-to-gwei.js +0 -34
  114. package/lib/cjs/utils/ether-to-wei.d.ts +0 -26
  115. package/lib/cjs/utils/ether-to-wei.js +0 -34
  116. package/lib/cjs/utils/gwei-to-ether.d.ts +0 -26
  117. package/lib/cjs/utils/gwei-to-ether.js +0 -34
  118. package/lib/cjs/utils/hash-message.d.ts +0 -12
  119. package/lib/cjs/utils/hash-message.js +0 -26
  120. package/lib/cjs/utils/is-address.d.ts +0 -24
  121. package/lib/cjs/utils/is-address.js +0 -39
  122. package/lib/cjs/utils/keccak256.d.ts +0 -2
  123. package/lib/cjs/utils/keccak256.js +0 -17
  124. package/lib/cjs/utils/solidity-keccak256.d.ts +0 -29
  125. package/lib/cjs/utils/solidity-keccak256.js +0 -118
  126. package/lib/cjs/utils/split-signature.d.ts +0 -26
  127. package/lib/cjs/utils/split-signature.js +0 -165
  128. package/lib/cjs/utils/to-checksum-address.d.ts +0 -17
  129. package/lib/cjs/utils/to-checksum-address.js +0 -46
  130. package/lib/cjs/utils/to-utf8-bytes.js +0 -7
  131. package/lib/cjs/utils/wei-to-ether.d.ts +0 -26
  132. package/lib/cjs/utils/wei-to-ether.js +0 -44
  133. package/lib/esm/classes/Contract.js +0 -65
  134. package/lib/esm/classes/test/Contract/crv-abi.d.ts +0 -2
  135. package/lib/esm/classes/test/Contract/crv-abi.js +0 -470
  136. package/lib/esm/classes/test/Contract/ens-abi.d.ts +0 -2
  137. package/lib/esm/classes/test/Contract/ens-abi.js +0 -435
  138. package/lib/esm/classes/test/Contract/fei-abi.d.ts +0 -2
  139. package/lib/esm/classes/test/Contract/fei-abi.js +0 -521
  140. package/lib/esm/classes/test/Contract/foo-abi.d.ts +0 -2
  141. package/lib/esm/classes/test/Contract/foo-abi.js +0 -33
  142. package/lib/esm/classes/test/Contract/uniswap-abi.d.ts +0 -2
  143. package/lib/esm/classes/test/Contract/uniswap-abi.js +0 -116
  144. package/lib/esm/classes/utils/clean-block.d.ts +0 -3
  145. package/lib/esm/classes/utils/clean-block.js +0 -36
  146. package/lib/esm/classes/utils/clean-transaction-receipt.js +0 -48
  147. package/lib/esm/classes/utils/clean-transaction.js +0 -33
  148. package/lib/esm/classes/utils/encode-decode-transaction.d.ts +0 -4
  149. package/lib/esm/classes/utils/encode-decode-transaction.js +0 -98
  150. package/lib/esm/classes/utils/fetchers.d.ts +0 -9
  151. package/lib/esm/classes/utils/fetchers.js +0 -43
  152. package/lib/esm/classes/utils/hex-to-decimal.js +0 -3
  153. package/lib/esm/index.d.ts +0 -25
  154. package/lib/esm/index.js +0 -21
  155. package/lib/esm/logger/logger.js +0 -33
  156. package/lib/esm/logger/package-version.d.ts +0 -1
  157. package/lib/esm/logger/package-version.js +0 -1
  158. package/lib/esm/providers/BaseProvider.js +0 -114
  159. package/lib/esm/providers/FallthroughProvider.js +0 -41
  160. package/lib/esm/providers/JsonRpcProvider.js +0 -15
  161. package/lib/esm/providers/test/rpc-urls.d.ts +0 -11
  162. package/lib/esm/providers/test/rpc-urls.js +0 -11
  163. package/lib/esm/providers/types.d.ts +0 -7
  164. package/lib/esm/providers/types.js +0 -1
  165. package/lib/esm/providers/utils/chains-info.js +0 -1233
  166. package/lib/esm/shared/tiny-big/helpers.d.ts +0 -1
  167. package/lib/esm/shared/tiny-big/helpers.js +0 -58
  168. package/lib/esm/shared/tiny-big/tiny-big.js +0 -41
  169. package/lib/esm/shared/validate-type.d.ts +0 -3
  170. package/lib/esm/shared/validate-type.js +0 -5
  171. package/lib/esm/types/Block.types.d.ts +0 -36
  172. package/lib/esm/types/Block.types.js +0 -1
  173. package/lib/esm/types/Contract.types.d.ts +0 -24
  174. package/lib/esm/types/Contract.types.js +0 -1
  175. package/lib/esm/types/Network.types.js +0 -1
  176. package/lib/esm/types/Transaction.types.d.ts +0 -87
  177. package/lib/esm/types/Transaction.types.js +0 -1
  178. package/lib/esm/utils/bytes.js +0 -245
  179. package/lib/esm/utils/compute-address.js +0 -11
  180. package/lib/esm/utils/compute-public-key.js +0 -6
  181. package/lib/esm/utils/ether-to-gwei.js +0 -7
  182. package/lib/esm/utils/ether-to-wei.d.ts +0 -3
  183. package/lib/esm/utils/ether-to-wei.js +0 -7
  184. package/lib/esm/utils/gwei-to-ether.d.ts +0 -3
  185. package/lib/esm/utils/gwei-to-ether.js +0 -7
  186. package/lib/esm/utils/hash-message.js +0 -12
  187. package/lib/esm/utils/is-address.js +0 -12
  188. package/lib/esm/utils/keccak256.d.ts +0 -2
  189. package/lib/esm/utils/keccak256.js +0 -13
  190. package/lib/esm/utils/solidity-keccak256.js +0 -85
  191. package/lib/esm/utils/split-signature.js +0 -126
  192. package/lib/esm/utils/to-checksum-address.js +0 -25
  193. package/lib/esm/utils/to-utf8-bytes.d.ts +0 -1
  194. package/lib/esm/utils/to-utf8-bytes.js +0 -3
  195. package/lib/esm/utils/wei-to-ether.d.ts +0 -3
  196. package/lib/esm/utils/wei-to-ether.js +0 -16
@@ -1 +1 @@
1
- export declare function scientificStrToDecimalStr(scientificString: string): string;
1
+ export declare function scientificStrToDecimalStr(scientificString: string): string;
@@ -1,10 +1,10 @@
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
+ 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,3 +1,3 @@
1
- declare type JSPrimitiveTypes = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
2
- export declare const validateType: (value: unknown, allowedTypes: JSPrimitiveTypes[]) => void;
3
- export {};
1
+ declare type JSPrimitiveTypes = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
2
+ export declare const validateType: (value: unknown, allowedTypes: JSPrimitiveTypes[]) => void;
3
+ export {};
@@ -1,37 +1,40 @@
1
- import { BlockTransactionResponse, RPCTransaction } from './Transaction.types';
2
- declare type Modify<T, R> = Omit<T, keyof R> & R;
3
- export declare type BlockResponse = Modify<RPCBlock, {
4
- gasLimit: number;
5
- gasUsed: number;
6
- number: number;
7
- size: number;
8
- timestamp: number;
9
- baseFeePerGas: number;
10
- transactions: Array<string | BlockTransactionResponse>;
11
- }>;
12
- /** Exact response from backend */
13
- export interface RPCBlock {
14
- baseFeePerGas: string;
15
- difficulty: string;
16
- extraData: string;
17
- gasLimit: string;
18
- gasUsed: string;
19
- hash: string;
20
- logsBloom: string;
21
- miner: string;
22
- mixHash: string;
23
- nonce: string;
24
- number: string;
25
- parentHash: string;
26
- receiptsRoot: string;
27
- sha3Uncles: string;
28
- size: string;
29
- stateRoot: string;
30
- timestamp: string;
31
- totalDifficulty: string;
32
- transactions: Array<string> | Array<RPCTransaction>;
33
- transactionsRoot: string;
34
- uncles: unknown[];
35
- }
36
- export declare type BlockTag = 'latest' | 'earliest' | 'pending' | number | string;
37
- export {};
1
+ import type { TinyBig } from './../shared/tiny-big/tiny-big';
2
+ import type { BlockTransactionResponse, RPCTransaction } from './Transaction.types';
3
+ declare type Modify<T, R> = Omit<T, keyof R> & R;
4
+ export declare 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 declare type BlockTag = 'latest' | 'earliest' | 'pending' | number | string;
40
+ export {};
@@ -1,24 +1,24 @@
1
- export declare 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 declare type ContractInterface = JSONABI;
3
- export declare 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 declare type JSONABI = JSONABIArgument[];
1
+ export declare 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 declare type ContractInterface = JSONABI;
3
+ export declare 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 declare type JSONABI = JSONABIArgument[];
@@ -0,0 +1,12 @@
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,5 +1,5 @@
1
- export interface Network {
2
- chainId: number;
3
- ensAddress: string | null;
4
- name: string;
5
- }
1
+ export interface Network {
2
+ chainId: number;
3
+ ensAddress: string | null;
4
+ name: string;
5
+ }
@@ -1,96 +1,113 @@
1
- import { TinyBig } from '../shared/tiny-big/tiny-big';
2
- declare type Modify<T, R> = Omit<T, keyof R> & R;
3
- export interface RPCTransaction extends RPCBlockTransaction {
4
- maxFeePerGas: string;
5
- maxPriorityFeePerGas: string;
6
- }
7
- export declare type TransactionResponse = Modify<RPCTransaction, {
8
- blockNumber: number;
9
- chainId: number;
10
- nonce: number;
11
- transactionIndex: number;
12
- type: number;
13
- v: number;
14
- value: TinyBig;
15
- gasPrice: TinyBig;
16
- gas: TinyBig;
17
- gasLimit: TinyBig;
18
- } & {
19
- maxFeePerGas: TinyBig;
20
- maxPriorityFeePerGas: TinyBig;
21
- confirmations: number;
22
- }>;
23
- /**
24
- * Type that contains information from the receipt of a transaction
25
- * * Similar to [`Type TransactionReceipt on ethers.providers`](https://docs.ethers.io/v5/api/providers/types/#providers-TransactionReceipt)
26
- */
27
- export declare type TransactionReceipt = Modify<RPCTransactionReceipt, {
28
- blockNumber: number;
29
- cumulativeGasUsed: TinyBig;
30
- effectiveGasPrice: TinyBig;
31
- gasUsed: TinyBig;
32
- logs: Array<Log>;
33
- status: number;
34
- transactionIndex: number;
35
- type: number;
36
- } & {
37
- byzantium: boolean;
38
- confirmations: number;
39
- }>;
40
- /**
41
- * Type for the logs that are included in transaction receipts
42
- * * Similar to [`Type Log on ethers.providers`](https://docs.ethers.io/v5/api/providers/types/#providers-Log)
43
- */
44
- export declare type Log = Modify<Omit<RPCLog, 'removed'>, {
45
- blockNumber: number;
46
- logIndex: number;
47
- transactionIndex: number;
48
- }>;
49
- export declare type BlockTransactionResponse = Omit<TransactionResponse, 'maxFeePerGas' | 'maxPriorityFeePerGas'>;
50
- /** What JSONRPC responds with in getBlock transaction array */
51
- export interface RPCBlockTransaction {
52
- blockHash: string;
53
- blockNumber: string;
54
- chainId: string;
55
- from: string;
56
- gas: string;
57
- gasPrice: string;
58
- hash: string;
59
- input: string;
60
- nonce: string;
61
- r: string;
62
- s: string;
63
- to: string;
64
- transactionIndex: string;
65
- type: string;
66
- v: string;
67
- value: string;
68
- }
69
- export interface RPCTransactionReceipt {
70
- blockHash: string;
71
- blockNumber: string;
72
- contractAddress: string;
73
- cumulativeGasUsed: string;
74
- effectiveGasPrice: string;
75
- from: string;
76
- gasUsed: string;
77
- logs: Array<RPCLog>;
78
- logsBloom: string;
79
- status: string;
80
- to: string;
81
- transactionHash: string;
82
- transactionIndex: string;
83
- type: string;
84
- }
85
- export interface RPCLog {
86
- address: string;
87
- blockHash: string;
88
- blockNumber: string;
89
- data: string;
90
- logIndex: string;
91
- removed?: boolean;
92
- topics: Array<string>;
93
- transactionHash: string;
94
- transactionIndex: string;
95
- }
96
- 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
+ declare type Modify<T, R> = Omit<T, keyof R> & R;
5
+ export interface RPCTransaction extends RPCBlockTransaction {
6
+ maxFeePerGas: string;
7
+ maxPriorityFeePerGas: string;
8
+ }
9
+ export declare 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 declare 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 declare type Log = Modify<RPCLog, {
63
+ blockNumber: number;
64
+ logIndex: number;
65
+ transactionIndex: number;
66
+ }>;
67
+ export declare 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,40 +1,40 @@
1
- export declare type Bytes = ArrayLike<number>;
2
- export declare type BytesLike = Bytes | string;
3
- export declare type BytesLikeWithNumber = BytesLike | number;
4
- export interface DataOptions {
5
- allowMissingPrefix?: boolean;
6
- hexPad?: 'left' | 'right' | null;
7
- }
8
- export interface Hexable {
9
- toHexString(): string;
10
- }
11
- export declare type SignatureLike = {
12
- r: string;
13
- s?: string;
14
- _vs?: string;
15
- recoveryParam?: number;
16
- v?: number;
17
- } | BytesLike;
18
- export interface Signature {
19
- r: string;
20
- s: string;
21
- _vs: string;
22
- recoveryParam: number;
23
- v: number;
24
- yParityAndS: string;
25
- compact: string;
26
- }
27
- export declare function isBytesLike(value: any): value is BytesLike;
28
- export declare function isBytes(value: any): value is Bytes;
29
- export declare function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array;
30
- export declare function concat(arrayOfBytesLike: ReadonlyArray<BytesLikeWithNumber>): Uint8Array;
31
- export declare function stripZeros(value: BytesLike): Uint8Array;
32
- export declare function zeroPad(value: BytesLike, length: number): Uint8Array;
33
- export declare function isHexString(value: any, length?: number): boolean;
34
- export declare function hexlify(value: BytesLike | Hexable | number | bigint, options?: DataOptions): string;
35
- export declare function hexDataLength(data: BytesLike): number | null;
36
- export declare function hexDataSlice(data: BytesLikeWithNumber, offset: number, endOffset?: number): string;
37
- export declare function hexConcat(items: ReadonlyArray<BytesLike>): string;
38
- export declare function hexValue(value: BytesLike | Hexable | number | bigint): string;
39
- export declare function hexStripZeros(value: BytesLike): string;
40
- export declare function hexZeroPad(value: BytesLikeWithNumber, length: number): string;
1
+ export declare type Bytes = ArrayLike<number>;
2
+ export declare type BytesLike = Bytes | string;
3
+ export declare type BytesLikeWithNumber = BytesLike | number;
4
+ export interface DataOptions {
5
+ allowMissingPrefix?: boolean;
6
+ hexPad?: 'left' | 'right' | null;
7
+ }
8
+ export interface Hexable {
9
+ toHexString(): string;
10
+ }
11
+ export declare type SignatureLike = {
12
+ r: string;
13
+ s?: string;
14
+ _vs?: string;
15
+ recoveryParam?: number;
16
+ v?: number;
17
+ } | BytesLike;
18
+ export interface Signature {
19
+ r: string;
20
+ s: string;
21
+ _vs: string;
22
+ recoveryParam: number;
23
+ v: number;
24
+ yParityAndS: string;
25
+ compact: string;
26
+ }
27
+ export declare function isBytesLike(value: any): value is BytesLike;
28
+ export declare function isBytes(value: any): value is Bytes;
29
+ export declare function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array;
30
+ export declare function concat(arrayOfBytesLike: ReadonlyArray<BytesLikeWithNumber>): Uint8Array;
31
+ export declare function stripZeros(value: BytesLike): Uint8Array;
32
+ export declare function zeroPad(value: BytesLike, length: number): Uint8Array;
33
+ export declare function isHexString(value: any, length?: number): boolean;
34
+ export declare function hexlify(value: BytesLike | Hexable | number | bigint, options?: DataOptions): string;
35
+ export declare function hexDataLength(data: BytesLike): number | null;
36
+ export declare function hexDataSlice(data: BytesLikeWithNumber, offset: number, endOffset?: number): string;
37
+ export declare function hexConcat(items: ReadonlyArray<BytesLike>): string;
38
+ export declare function hexValue(value: BytesLike | Hexable | number | bigint): string;
39
+ export declare function hexStripZeros(value: BytesLike): string;
40
+ export declare function hexZeroPad(value: BytesLikeWithNumber, length: number): string;
@@ -1 +1 @@
1
- export declare function computeAddress(key: string): string;
1
+ export declare function computeAddress(key: string): string;
@@ -1,2 +1,2 @@
1
- import { BytesLike } from './bytes';
2
- export declare function computePublicKey(privKey: BytesLike): string;
1
+ import type { BytesLike } from './bytes';
2
+ export declare function computePublicKey(privKey: BytesLike): string;
@@ -1,3 +1,3 @@
1
- import Big from 'big.js';
2
- import { TinyBig } from '../shared/tiny-big/tiny-big';
3
- export declare function etherToGwei(etherQuantity: string | number | TinyBig | Big): TinyBig;
1
+ import type Big from 'big.js';
2
+ import type { TinyBig } from '../shared/tiny-big/tiny-big';
3
+ export declare function etherToGwei(etherQuantity: string | number | TinyBig | Big): TinyBig;
@@ -0,0 +1,3 @@
1
+ import type Big from 'big.js';
2
+ import type { TinyBig } from '../shared/tiny-big/tiny-big';
3
+ export declare function etherToWei(etherQuantity: string | number | TinyBig | Big): TinyBig;
@@ -0,0 +1,3 @@
1
+ import type Big from 'big.js';
2
+ import type { TinyBig } from './../shared/tiny-big/tiny-big';
3
+ export declare function gweiToEther(gweiQuantity: string | number | TinyBig | Big): TinyBig;
@@ -1,2 +1,2 @@
1
- import { Bytes } from '../index';
2
- export declare function hashMessage(message: Bytes | string): string;
1
+ import type { Bytes } from '../index';
2
+ export declare function hashMessage(message: Bytes | string): string;
@@ -1 +1 @@
1
- export declare function isAddress(address: string): boolean;
1
+ export declare function isAddress(address: string): boolean;
@@ -0,0 +1,2 @@
1
+ import type { BytesLike } from './bytes';
2
+ export declare function keccak256(data: BytesLike): string;
@@ -1,2 +1,2 @@
1
- export declare function pack(types: ReadonlyArray<string>, values: ReadonlyArray<any>): string;
2
- export declare function solidityKeccak256(types: ReadonlyArray<string>, values: ReadonlyArray<any>): string;
1
+ export declare function pack(types: ReadonlyArray<string>, values: ReadonlyArray<any>): string;
2
+ export declare function solidityKeccak256(types: ReadonlyArray<string>, values: ReadonlyArray<any>): string;
@@ -1,2 +1,2 @@
1
- import { Signature, SignatureLike } from './bytes';
2
- export declare function splitSignature(signature: SignatureLike): Signature;
1
+ import type { Signature, SignatureLike } from './bytes';
2
+ export declare function splitSignature(signature: SignatureLike): Signature;
@@ -1 +1 @@
1
- export declare function toChecksumAddress(address: string): string;
1
+ export declare function toChecksumAddress(address: string): string;
@@ -1 +1 @@
1
- export declare function toUtf8Bytes(data: string): Uint8Array;
1
+ export declare function toUtf8Bytes(data: string): Uint8Array;
@@ -0,0 +1,3 @@
1
+ import type Big from 'big.js';
2
+ import type { TinyBig } from '../shared/tiny-big/tiny-big';
3
+ export declare function weiToEther(weiQuantity: string | number | TinyBig | Big): TinyBig;