viem 1.0.7 → 1.1.1

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 (252) hide show
  1. package/chains/package.json +3 -3
  2. package/dist/cjs/accounts/privateKeyToAccount.js +2 -2
  3. package/dist/cjs/accounts/privateKeyToAccount.js.map +1 -1
  4. package/dist/cjs/accounts/utils/signTransaction.js +3 -3
  5. package/dist/cjs/accounts/utils/signTransaction.js.map +1 -1
  6. package/dist/cjs/actions/getContract.js.map +1 -1
  7. package/dist/cjs/actions/public/call.js +4 -6
  8. package/dist/cjs/actions/public/call.js.map +1 -1
  9. package/dist/cjs/actions/public/estimateContractGas.js.map +1 -1
  10. package/dist/cjs/actions/public/estimateGas.js +4 -6
  11. package/dist/cjs/actions/public/estimateGas.js.map +1 -1
  12. package/dist/cjs/actions/public/getBlock.js +2 -4
  13. package/dist/cjs/actions/public/getBlock.js.map +1 -1
  14. package/dist/cjs/actions/public/getTransaction.js +2 -4
  15. package/dist/cjs/actions/public/getTransaction.js.map +1 -1
  16. package/dist/cjs/actions/public/getTransactionConfirmations.js.map +1 -1
  17. package/dist/cjs/actions/public/getTransactionReceipt.js +3 -4
  18. package/dist/cjs/actions/public/getTransactionReceipt.js.map +1 -1
  19. package/dist/cjs/actions/public/simulateContract.js.map +1 -1
  20. package/dist/cjs/actions/public/watchBlocks.js +3 -1
  21. package/dist/cjs/actions/public/watchBlocks.js.map +1 -1
  22. package/dist/cjs/actions/test/sendUnsignedTransaction.js +4 -6
  23. package/dist/cjs/actions/test/sendUnsignedTransaction.js.map +1 -1
  24. package/dist/cjs/actions/wallet/sendTransaction.js +5 -7
  25. package/dist/cjs/actions/wallet/sendTransaction.js.map +1 -1
  26. package/dist/cjs/actions/wallet/writeContract.js.map +1 -1
  27. package/dist/cjs/chains/formatters/celo.js +62 -0
  28. package/dist/cjs/chains/formatters/celo.js.map +1 -0
  29. package/dist/cjs/chains/formatters/optimism.js +42 -0
  30. package/dist/cjs/chains/formatters/optimism.js.map +1 -0
  31. package/dist/cjs/{chains.js → chains/index.js} +16 -50
  32. package/dist/cjs/chains/index.js.map +1 -0
  33. package/dist/cjs/errors/version.js +1 -1
  34. package/dist/cjs/index.js +7 -3
  35. package/dist/cjs/index.js.map +1 -1
  36. package/dist/cjs/types/serializer.js +3 -0
  37. package/dist/cjs/types/serializer.js.map +1 -0
  38. package/dist/cjs/utils/chain.js +6 -2
  39. package/dist/cjs/utils/chain.js.map +1 -1
  40. package/dist/cjs/utils/formatters/block.js +2 -4
  41. package/dist/cjs/utils/formatters/block.js.map +1 -1
  42. package/dist/cjs/utils/formatters/extract.js +3 -3
  43. package/dist/cjs/utils/formatters/extract.js.map +1 -1
  44. package/dist/cjs/utils/formatters/formatter.js +24 -0
  45. package/dist/cjs/utils/formatters/formatter.js.map +1 -0
  46. package/dist/cjs/utils/formatters/transaction.js +3 -4
  47. package/dist/cjs/utils/formatters/transaction.js.map +1 -1
  48. package/dist/cjs/utils/formatters/transactionReceipt.js +3 -5
  49. package/dist/cjs/utils/formatters/transactionReceipt.js.map +1 -1
  50. package/dist/cjs/utils/formatters/transactionRequest.js +2 -4
  51. package/dist/cjs/utils/formatters/transactionRequest.js.map +1 -1
  52. package/dist/cjs/utils/index.js +8 -5
  53. package/dist/cjs/utils/index.js.map +1 -1
  54. package/dist/cjs/utils/transaction/getTransactionType.js.map +1 -1
  55. package/dist/cjs/utils/transaction/serializeAccessList.js +26 -0
  56. package/dist/cjs/utils/transaction/serializeAccessList.js.map +1 -0
  57. package/dist/cjs/utils/transaction/serializeTransaction.js +3 -22
  58. package/dist/cjs/utils/transaction/serializeTransaction.js.map +1 -1
  59. package/dist/cjs/wallet.js.map +1 -1
  60. package/dist/esm/accounts/privateKeyToAccount.js +2 -2
  61. package/dist/esm/accounts/privateKeyToAccount.js.map +1 -1
  62. package/dist/esm/accounts/utils/signTransaction.js +4 -4
  63. package/dist/esm/accounts/utils/signTransaction.js.map +1 -1
  64. package/dist/esm/actions/getContract.js.map +1 -1
  65. package/dist/esm/actions/public/call.js +4 -6
  66. package/dist/esm/actions/public/call.js.map +1 -1
  67. package/dist/esm/actions/public/estimateContractGas.js.map +1 -1
  68. package/dist/esm/actions/public/estimateGas.js +4 -6
  69. package/dist/esm/actions/public/estimateGas.js.map +1 -1
  70. package/dist/esm/actions/public/getBlock.js +2 -4
  71. package/dist/esm/actions/public/getBlock.js.map +1 -1
  72. package/dist/esm/actions/public/getTransaction.js +2 -4
  73. package/dist/esm/actions/public/getTransaction.js.map +1 -1
  74. package/dist/esm/actions/public/getTransactionConfirmations.js.map +1 -1
  75. package/dist/esm/actions/public/getTransactionReceipt.js +3 -4
  76. package/dist/esm/actions/public/getTransactionReceipt.js.map +1 -1
  77. package/dist/esm/actions/public/simulateContract.js.map +1 -1
  78. package/dist/esm/actions/public/watchBlocks.js +3 -1
  79. package/dist/esm/actions/public/watchBlocks.js.map +1 -1
  80. package/dist/esm/actions/test/sendUnsignedTransaction.js +4 -6
  81. package/dist/esm/actions/test/sendUnsignedTransaction.js.map +1 -1
  82. package/dist/esm/actions/wallet/sendTransaction.js +5 -7
  83. package/dist/esm/actions/wallet/sendTransaction.js.map +1 -1
  84. package/dist/esm/actions/wallet/writeContract.js.map +1 -1
  85. package/dist/esm/chains/formatters/celo.js +60 -0
  86. package/dist/esm/chains/formatters/celo.js.map +1 -0
  87. package/dist/esm/chains/formatters/optimism.js +40 -0
  88. package/dist/esm/chains/formatters/optimism.js.map +1 -0
  89. package/dist/esm/{chains.js → chains/index.js} +13 -47
  90. package/dist/esm/chains/index.js.map +1 -0
  91. package/dist/esm/errors/version.js +1 -1
  92. package/dist/esm/index.js +3 -1
  93. package/dist/esm/index.js.map +1 -1
  94. package/dist/esm/types/serializer.js +2 -0
  95. package/dist/esm/types/serializer.js.map +1 -0
  96. package/dist/esm/utils/chain.js +6 -2
  97. package/dist/esm/utils/chain.js.map +1 -1
  98. package/dist/esm/utils/formatters/block.js +2 -5
  99. package/dist/esm/utils/formatters/block.js.map +1 -1
  100. package/dist/esm/utils/formatters/extract.js +3 -3
  101. package/dist/esm/utils/formatters/extract.js.map +1 -1
  102. package/dist/esm/utils/formatters/formatter.js +20 -0
  103. package/dist/esm/utils/formatters/formatter.js.map +1 -0
  104. package/dist/esm/utils/formatters/transaction.js +3 -4
  105. package/dist/esm/utils/formatters/transaction.js.map +1 -1
  106. package/dist/esm/utils/formatters/transactionReceipt.js +3 -5
  107. package/dist/esm/utils/formatters/transactionReceipt.js.map +1 -1
  108. package/dist/esm/utils/formatters/transactionRequest.js +2 -4
  109. package/dist/esm/utils/formatters/transactionRequest.js.map +1 -1
  110. package/dist/esm/utils/index.js +4 -2
  111. package/dist/esm/utils/index.js.map +1 -1
  112. package/dist/esm/utils/transaction/getTransactionType.js.map +1 -1
  113. package/dist/esm/utils/transaction/serializeAccessList.js +32 -0
  114. package/dist/esm/utils/transaction/serializeAccessList.js.map +1 -0
  115. package/dist/esm/utils/transaction/serializeTransaction.js +2 -21
  116. package/dist/esm/utils/transaction/serializeTransaction.js.map +1 -1
  117. package/dist/esm/wallet.js.map +1 -1
  118. package/dist/types/accounts/types.d.ts +7 -2
  119. package/dist/types/accounts/types.d.ts.map +1 -1
  120. package/dist/types/accounts/utils/signTransaction.d.ts +5 -3
  121. package/dist/types/accounts/utils/signTransaction.d.ts.map +1 -1
  122. package/dist/types/actions/public/call.d.ts +3 -7
  123. package/dist/types/actions/public/call.d.ts.map +1 -1
  124. package/dist/types/actions/public/estimateContractGas.d.ts +1 -1
  125. package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -1
  126. package/dist/types/actions/public/estimateGas.d.ts +3 -7
  127. package/dist/types/actions/public/estimateGas.d.ts.map +1 -1
  128. package/dist/types/actions/public/getBlock.d.ts +2 -2
  129. package/dist/types/actions/public/getBlock.d.ts.map +1 -1
  130. package/dist/types/actions/public/getTransaction.d.ts +2 -2
  131. package/dist/types/actions/public/getTransaction.d.ts.map +1 -1
  132. package/dist/types/actions/public/getTransactionConfirmations.d.ts +2 -2
  133. package/dist/types/actions/public/getTransactionConfirmations.d.ts.map +1 -1
  134. package/dist/types/actions/public/getTransactionReceipt.d.ts +3 -3
  135. package/dist/types/actions/public/getTransactionReceipt.d.ts.map +1 -1
  136. package/dist/types/actions/public/simulateContract.d.ts +1 -1
  137. package/dist/types/actions/public/simulateContract.d.ts.map +1 -1
  138. package/dist/types/actions/public/verifyHash.d.ts +1 -1
  139. package/dist/types/actions/public/verifyHash.d.ts.map +1 -1
  140. package/dist/types/actions/public/verifyMessage.d.ts +1 -1
  141. package/dist/types/actions/public/verifyMessage.d.ts.map +1 -1
  142. package/dist/types/actions/public/verifyTypedData.d.ts +1 -1
  143. package/dist/types/actions/public/verifyTypedData.d.ts.map +1 -1
  144. package/dist/types/actions/public/watchBlocks.d.ts.map +1 -1
  145. package/dist/types/actions/test/sendUnsignedTransaction.d.ts +2 -8
  146. package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
  147. package/dist/types/actions/wallet/sendTransaction.d.ts +3 -7
  148. package/dist/types/actions/wallet/sendTransaction.d.ts.map +1 -1
  149. package/dist/types/actions/wallet/writeContract.d.ts +1 -1
  150. package/dist/types/actions/wallet/writeContract.d.ts.map +1 -1
  151. package/dist/types/chains/formatters/celo.d.ts +247 -0
  152. package/dist/types/chains/formatters/celo.d.ts.map +1 -0
  153. package/dist/types/chains/formatters/optimism.d.ts +286 -0
  154. package/dist/types/chains/formatters/optimism.d.ts.map +1 -0
  155. package/dist/types/chains/index.d.ts +5278 -0
  156. package/dist/types/chains/index.d.ts.map +1 -0
  157. package/dist/types/errors/version.d.ts +1 -1
  158. package/dist/types/index.d.ts +8 -6
  159. package/dist/types/index.d.ts.map +1 -1
  160. package/dist/types/types/chain.d.ts +3 -1
  161. package/dist/types/types/chain.d.ts.map +1 -1
  162. package/dist/types/types/fee.d.ts +1 -0
  163. package/dist/types/types/fee.d.ts.map +1 -1
  164. package/dist/types/types/formatter.d.ts +11 -10
  165. package/dist/types/types/formatter.d.ts.map +1 -1
  166. package/dist/types/types/rpc.d.ts +1 -1
  167. package/dist/types/types/rpc.d.ts.map +1 -1
  168. package/dist/types/types/serializer.d.ts +7 -0
  169. package/dist/types/types/serializer.d.ts.map +1 -0
  170. package/dist/types/types/transaction.d.ts +14 -3
  171. package/dist/types/types/transaction.d.ts.map +1 -1
  172. package/dist/types/types/utils.d.ts +5 -5
  173. package/dist/types/types/utils.d.ts.map +1 -1
  174. package/dist/types/utils/chain.d.ts +4 -1
  175. package/dist/types/utils/chain.d.ts.map +1 -1
  176. package/dist/types/utils/formatters/block.d.ts +8 -11
  177. package/dist/types/utils/formatters/block.d.ts.map +1 -1
  178. package/dist/types/utils/formatters/extract.d.ts +2 -2
  179. package/dist/types/utils/formatters/extract.d.ts.map +1 -1
  180. package/dist/types/utils/formatters/formatter.d.ts +9 -0
  181. package/dist/types/utils/formatters/formatter.d.ts.map +1 -0
  182. package/dist/types/utils/formatters/transaction.d.ts +8 -11
  183. package/dist/types/utils/formatters/transaction.d.ts.map +1 -1
  184. package/dist/types/utils/formatters/transactionReceipt.d.ts +8 -11
  185. package/dist/types/utils/formatters/transactionReceipt.d.ts.map +1 -1
  186. package/dist/types/utils/formatters/transactionRequest.d.ts +8 -11
  187. package/dist/types/utils/formatters/transactionRequest.d.ts.map +1 -1
  188. package/dist/types/utils/index.d.ts +8 -6
  189. package/dist/types/utils/index.d.ts.map +1 -1
  190. package/dist/types/utils/transaction/getTransactionType.d.ts +2 -2
  191. package/dist/types/utils/transaction/getTransactionType.d.ts.map +1 -1
  192. package/dist/types/utils/transaction/serializeAccessList.d.ts +5 -0
  193. package/dist/types/utils/transaction/serializeAccessList.d.ts.map +1 -0
  194. package/dist/types/utils/transaction/serializeTransaction.d.ts +1 -0
  195. package/dist/types/utils/transaction/serializeTransaction.d.ts.map +1 -1
  196. package/dist/types/wallet.d.ts +1 -1
  197. package/dist/types/wallet.d.ts.map +1 -1
  198. package/package.json +5 -5
  199. package/src/accounts/privateKeyToAccount.ts +2 -2
  200. package/src/accounts/types.ts +20 -2
  201. package/src/accounts/utils/signTransaction.ts +9 -6
  202. package/src/actions/getContract.ts +1 -1
  203. package/src/actions/public/call.ts +21 -30
  204. package/src/actions/public/estimateContractGas.ts +7 -1
  205. package/src/actions/public/estimateGas.ts +22 -31
  206. package/src/actions/public/getBlock.ts +3 -6
  207. package/src/actions/public/getTransaction.ts +4 -6
  208. package/src/actions/public/getTransactionConfirmations.ts +2 -7
  209. package/src/actions/public/getTransactionReceipt.ts +5 -7
  210. package/src/actions/public/simulateContract.ts +7 -1
  211. package/src/actions/public/verifyHash.ts +1 -1
  212. package/src/actions/public/verifyMessage.ts +1 -1
  213. package/src/actions/public/verifyTypedData.ts +1 -1
  214. package/src/actions/public/watchBlocks.ts +4 -1
  215. package/src/actions/test/sendUnsignedTransaction.ts +19 -32
  216. package/src/actions/wallet/sendTransaction.ts +33 -36
  217. package/src/actions/wallet/writeContract.ts +11 -1
  218. package/src/chains/formatters/celo.ts +103 -0
  219. package/src/chains/formatters/optimism.ts +91 -0
  220. package/src/{chains.ts → chains/index.ts} +13 -56
  221. package/src/errors/version.ts +1 -1
  222. package/src/index.ts +7 -9
  223. package/src/types/chain.ts +8 -1
  224. package/src/types/fee.ts +1 -0
  225. package/src/types/formatter.ts +29 -19
  226. package/src/types/rpc.ts +1 -1
  227. package/src/types/serializer.ts +19 -0
  228. package/src/types/transaction.ts +24 -4
  229. package/src/types/utils.ts +5 -5
  230. package/src/utils/chain.ts +11 -4
  231. package/src/utils/formatters/block.ts +5 -17
  232. package/src/utils/formatters/extract.ts +3 -3
  233. package/src/utils/formatters/formatter.ts +36 -0
  234. package/src/utils/formatters/transaction.ts +9 -21
  235. package/src/utils/formatters/transactionReceipt.ts +11 -22
  236. package/src/utils/formatters/transactionRequest.ts +8 -22
  237. package/src/utils/index.ts +7 -11
  238. package/src/utils/transaction/getTransactionType.ts +10 -9
  239. package/src/utils/transaction/serializeAccessList.ts +39 -0
  240. package/src/utils/transaction/serializeTransaction.ts +11 -34
  241. package/src/wallet.ts +0 -1
  242. package/dist/cjs/chains.js.map +0 -1
  243. package/dist/cjs/utils/formatters/format.js +0 -23
  244. package/dist/cjs/utils/formatters/format.js.map +0 -1
  245. package/dist/esm/chains.js.map +0 -1
  246. package/dist/esm/utils/formatters/format.js +0 -21
  247. package/dist/esm/utils/formatters/format.js.map +0 -1
  248. package/dist/types/chains.d.ts +0 -2834
  249. package/dist/types/chains.d.ts.map +0 -1
  250. package/dist/types/utils/formatters/format.d.ts +0 -38
  251. package/dist/types/utils/formatters/format.d.ts.map +0 -1
  252. package/src/utils/formatters/format.ts +0 -99
@@ -0,0 +1,247 @@
1
+ import type { Address } from 'abitype';
2
+ import type { Hash, Hex } from '../../types/misc.js';
3
+ import type { RpcTransaction } from '../../types/rpc.js';
4
+ import type { Transaction } from '../../types/transaction.js';
5
+ export type CeloOverrides = {
6
+ RpcBlock: {
7
+ randomness: {
8
+ committed: Hex;
9
+ revealed: Hex;
10
+ };
11
+ transactions: Hash[] | (RpcTransaction & {
12
+ feeCurrency: Address | null;
13
+ gatewayFee: Hex | null;
14
+ gatewayFeeRecipient: Address | null;
15
+ })[];
16
+ };
17
+ RpcTransaction: {
18
+ feeCurrency: Address | null;
19
+ gatewayFee: Hex | null;
20
+ gatewayFeeRecipient: Address | null;
21
+ };
22
+ RpcTransactionReceipt: {
23
+ feeCurrency: Address | null;
24
+ gatewayFee: Hex | null;
25
+ gatewayFeeRecipient: Address | null;
26
+ };
27
+ TransactionRequest: {
28
+ feeCurrency?: Address;
29
+ gatewayFee?: bigint;
30
+ gatewayFeeRecipient?: Address;
31
+ };
32
+ Transaction: {
33
+ feeCurrency: Address | null;
34
+ gatewayFee: bigint | null;
35
+ gatewayFeeRecipient: Address | null;
36
+ };
37
+ };
38
+ export declare const celoFormatters: {
39
+ readonly block: {
40
+ format: (args: Partial<import("../../types/rpc.js").RpcBlock> & {
41
+ randomness: {
42
+ committed: Hex;
43
+ revealed: Hex;
44
+ };
45
+ transactions: Hash[] | (RpcTransaction & {
46
+ feeCurrency: Address | null;
47
+ gatewayFee: Hex | null;
48
+ gatewayFeeRecipient: Address | null;
49
+ })[];
50
+ }) => {
51
+ baseFeePerGas: bigint | null;
52
+ difficulty: bigint;
53
+ extraData: `0x${string}`;
54
+ gasLimit: bigint;
55
+ gasUsed: bigint;
56
+ hash: `0x${string}` | null;
57
+ logsBloom: `0x${string}` | null;
58
+ miner: `0x${string}`;
59
+ mixHash: `0x${string}`;
60
+ nonce: `0x${string}` | null;
61
+ number: bigint | null;
62
+ parentHash: `0x${string}`;
63
+ receiptsRoot: `0x${string}`;
64
+ sealFields: `0x${string}`[];
65
+ sha3Uncles: `0x${string}`;
66
+ size: bigint;
67
+ stateRoot: `0x${string}`;
68
+ timestamp: bigint;
69
+ totalDifficulty: bigint | null;
70
+ transactions: `0x${string}`[] | (Transaction & {
71
+ feeCurrency: Address | null;
72
+ gatewayFee: bigint | null;
73
+ gatewayFeeRecipient: Address | null;
74
+ })[];
75
+ transactionsRoot: `0x${string}`;
76
+ uncles: `0x${string}`[];
77
+ randomness: {
78
+ committed: Hex;
79
+ revealed: Hex;
80
+ };
81
+ } & {
82
+ nonce: never;
83
+ difficulty: never;
84
+ gasLimit: never;
85
+ mixHash: never;
86
+ uncles: never;
87
+ };
88
+ type: "block";
89
+ };
90
+ readonly transaction: {
91
+ format: (args: Partial<RpcTransaction> & {
92
+ feeCurrency: Address | null;
93
+ gatewayFee: Hex | null;
94
+ gatewayFeeRecipient: Address | null;
95
+ }) => ({
96
+ blockHash: `0x${string}` | null;
97
+ blockNumber: bigint | null;
98
+ from: `0x${string}`;
99
+ gas: bigint;
100
+ hash: `0x${string}`;
101
+ input: `0x${string}`;
102
+ nonce: number;
103
+ r: `0x${string}`;
104
+ s: `0x${string}`;
105
+ to: `0x${string}` | null;
106
+ transactionIndex: number | null;
107
+ typeHex: `0x${string}` | null;
108
+ v: bigint;
109
+ value: bigint;
110
+ gasPrice: bigint;
111
+ maxFeePerGas?: undefined;
112
+ maxPriorityFeePerGas?: undefined;
113
+ accessList?: undefined;
114
+ chainId?: number | undefined;
115
+ type: "legacy";
116
+ feeCurrency: `0x${string}` | null;
117
+ gatewayFee: bigint | null;
118
+ gatewayFeeRecipient: `0x${string}` | null;
119
+ } | {
120
+ blockHash: `0x${string}` | null;
121
+ blockNumber: bigint | null;
122
+ from: `0x${string}`;
123
+ gas: bigint;
124
+ hash: `0x${string}`;
125
+ input: `0x${string}`;
126
+ nonce: number;
127
+ r: `0x${string}`;
128
+ s: `0x${string}`;
129
+ to: `0x${string}` | null;
130
+ transactionIndex: number | null;
131
+ typeHex: `0x${string}` | null;
132
+ v: bigint;
133
+ value: bigint;
134
+ gasPrice: bigint;
135
+ maxFeePerGas?: undefined;
136
+ maxPriorityFeePerGas?: undefined;
137
+ accessList: import("../../types/transaction.js").AccessList;
138
+ chainId: number;
139
+ type: "eip2930";
140
+ feeCurrency: `0x${string}` | null;
141
+ gatewayFee: bigint | null;
142
+ gatewayFeeRecipient: `0x${string}` | null;
143
+ } | {
144
+ blockHash: `0x${string}` | null;
145
+ blockNumber: bigint | null;
146
+ from: `0x${string}`;
147
+ gas: bigint;
148
+ hash: `0x${string}`;
149
+ input: `0x${string}`;
150
+ nonce: number;
151
+ r: `0x${string}`;
152
+ s: `0x${string}`;
153
+ to: `0x${string}` | null;
154
+ transactionIndex: number | null;
155
+ typeHex: `0x${string}` | null;
156
+ v: bigint;
157
+ value: bigint;
158
+ gasPrice?: undefined;
159
+ maxFeePerGas: bigint;
160
+ maxPriorityFeePerGas: bigint;
161
+ accessList: import("../../types/transaction.js").AccessList;
162
+ chainId: number;
163
+ type: "eip1559";
164
+ feeCurrency: `0x${string}` | null;
165
+ gatewayFee: bigint | null;
166
+ gatewayFeeRecipient: `0x${string}` | null;
167
+ }) & {};
168
+ type: "transaction";
169
+ };
170
+ readonly transactionReceipt: {
171
+ format: (args: Partial<import("../../types/rpc.js").RpcTransactionReceipt> & {
172
+ feeCurrency: Address | null;
173
+ gatewayFee: Hex | null;
174
+ gatewayFeeRecipient: Address | null;
175
+ }) => {
176
+ blockHash: `0x${string}`;
177
+ blockNumber: bigint;
178
+ contractAddress: `0x${string}` | null;
179
+ cumulativeGasUsed: bigint;
180
+ effectiveGasPrice: bigint;
181
+ from: `0x${string}`;
182
+ gasUsed: bigint;
183
+ logs: import("../../index.js").Log<bigint, number>[];
184
+ logsBloom: `0x${string}`;
185
+ status: "success" | "reverted";
186
+ to: `0x${string}` | null;
187
+ transactionHash: `0x${string}`;
188
+ transactionIndex: number;
189
+ type: import("../../types/transaction.js").TransactionType;
190
+ feeCurrency: `0x${string}` | null;
191
+ gatewayFee: bigint | null;
192
+ gatewayFeeRecipient: `0x${string}` | null;
193
+ } & {};
194
+ type: "transactionReceipt";
195
+ };
196
+ readonly transactionRequest: {
197
+ format: (args: Partial<import("../../types/transaction.js").TransactionRequest> & {
198
+ feeCurrency?: `0x${string}` | undefined;
199
+ gatewayFee?: bigint | undefined;
200
+ gatewayFeeRecipient?: `0x${string}` | undefined;
201
+ }) => ({
202
+ data?: `0x${string}` | undefined;
203
+ from: `0x${string}`;
204
+ gas?: `0x${string}` | undefined;
205
+ nonce?: `0x${string}` | undefined;
206
+ to?: `0x${string}` | undefined;
207
+ value?: `0x${string}` | undefined;
208
+ gasPrice?: `0x${string}` | undefined;
209
+ maxFeePerGas?: undefined;
210
+ maxPriorityFeePerGas?: undefined;
211
+ accessList?: undefined;
212
+ feeCurrency: `0x${string}` | undefined;
213
+ gatewayFee: `0x${string}` | undefined;
214
+ gatewayFeeRecipient: `0x${string}` | undefined;
215
+ } | {
216
+ data?: `0x${string}` | undefined;
217
+ from: `0x${string}`;
218
+ gas?: `0x${string}` | undefined;
219
+ nonce?: `0x${string}` | undefined;
220
+ to?: `0x${string}` | undefined;
221
+ value?: `0x${string}` | undefined;
222
+ gasPrice?: `0x${string}` | undefined;
223
+ maxFeePerGas?: undefined;
224
+ maxPriorityFeePerGas?: undefined;
225
+ accessList?: import("../../types/transaction.js").AccessList | undefined;
226
+ feeCurrency: `0x${string}` | undefined;
227
+ gatewayFee: `0x${string}` | undefined;
228
+ gatewayFeeRecipient: `0x${string}` | undefined;
229
+ } | {
230
+ data?: `0x${string}` | undefined;
231
+ from: `0x${string}`;
232
+ gas?: `0x${string}` | undefined;
233
+ nonce?: `0x${string}` | undefined;
234
+ to?: `0x${string}` | undefined;
235
+ value?: `0x${string}` | undefined;
236
+ gasPrice?: undefined;
237
+ maxFeePerGas?: `0x${string}` | undefined;
238
+ maxPriorityFeePerGas?: `0x${string}` | undefined;
239
+ accessList?: import("../../types/transaction.js").AccessList | undefined;
240
+ feeCurrency: `0x${string}` | undefined;
241
+ gatewayFee: `0x${string}` | undefined;
242
+ gatewayFeeRecipient: `0x${string}` | undefined;
243
+ }) & {};
244
+ type: "transactionRequest";
245
+ };
246
+ };
247
+ //# sourceMappingURL=celo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"celo.d.ts","sourceRoot":"","sources":["../../../../src/chains/formatters/celo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAW7D,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE;QACR,UAAU,EAAE;YACV,SAAS,EAAE,GAAG,CAAA;YACd,QAAQ,EAAE,GAAG,CAAA;SACd,CAAA;QACD,YAAY,EACR,IAAI,EAAE,GACN,CAAC,cAAc,GAAG;YAChB,WAAW,EAAE,OAAO,GAAG,IAAI,CAAA;YAC3B,UAAU,EAAE,GAAG,GAAG,IAAI,CAAA;YACtB,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAA;SAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAGtB,OAAO,GAAG,IAAI;wBACf,GAAG,GAAG,IAAI;iCACD,OAAO,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgER,CAAA"}
@@ -0,0 +1,286 @@
1
+ import type { FeeValuesEIP1559 } from '../../types/fee.js';
2
+ import type { Hash, Hex } from '../../types/misc.js';
3
+ import type { Index, Quantity, RpcTransaction as RpcTransaction_ } from '../../types/rpc.js';
4
+ import type { Transaction as Transaction_, TransactionBase } from '../../types/transaction.js';
5
+ type RpcTransaction = RpcTransaction_ & {
6
+ isSystemTx?: undefined;
7
+ mint?: undefined;
8
+ sourceHash?: undefined;
9
+ };
10
+ export type RpcDepositTransaction = TransactionBase<Quantity, Index> & FeeValuesEIP1559<Quantity> & {
11
+ isSystemTx?: boolean;
12
+ mint?: Hex;
13
+ sourceHash: Hex;
14
+ type: '0x7e';
15
+ };
16
+ type Transaction = Transaction_ & {
17
+ isSystemTx?: undefined;
18
+ mint?: undefined;
19
+ sourceHash?: undefined;
20
+ };
21
+ export type DepositTransaction = TransactionBase & FeeValuesEIP1559 & {
22
+ isSystemTx?: boolean;
23
+ mint?: bigint;
24
+ sourceHash: Hex;
25
+ type: 'deposit';
26
+ };
27
+ type OptimismOverrides = {
28
+ RpcBlock: {
29
+ transactions: Hash[] | OptimismOverrides['RpcTransaction'][];
30
+ };
31
+ RpcTransaction: RpcTransaction | RpcDepositTransaction;
32
+ Transaction: Transaction | DepositTransaction;
33
+ };
34
+ export declare const optimismFormatters: {
35
+ readonly block: {
36
+ format: (args: Partial<import("../../types/rpc.js").RpcBlock> & {
37
+ transactions: Hash[] | OptimismOverrides['RpcTransaction'][];
38
+ }) => {
39
+ baseFeePerGas: bigint | null;
40
+ difficulty: bigint;
41
+ extraData: `0x${string}`;
42
+ gasLimit: bigint;
43
+ gasUsed: bigint;
44
+ hash: `0x${string}` | null;
45
+ logsBloom: `0x${string}` | null;
46
+ miner: `0x${string}`;
47
+ mixHash: `0x${string}`;
48
+ nonce: `0x${string}` | null;
49
+ number: bigint | null;
50
+ parentHash: `0x${string}`;
51
+ receiptsRoot: `0x${string}`;
52
+ sealFields: `0x${string}`[];
53
+ sha3Uncles: `0x${string}`;
54
+ size: bigint;
55
+ stateRoot: `0x${string}`;
56
+ timestamp: bigint;
57
+ totalDifficulty: bigint | null;
58
+ transactions: `0x${string}`[] | (Transaction | DepositTransaction)[];
59
+ transactionsRoot: `0x${string}`;
60
+ uncles: `0x${string}`[];
61
+ } & {};
62
+ type: "block";
63
+ };
64
+ readonly transaction: {
65
+ format: (args: (Partial<import("../../types/transaction.js").TransactionLegacy<`0x${string}`, `0x${string}`, "0x0">> & TransactionBase<`0x${string}`, `0x${string}`> & import("../../types/fee.js").FeeValuesLegacy<`0x${string}`> & {
66
+ accessList?: undefined;
67
+ chainId?: `0x${string}` | undefined;
68
+ type: "0x0";
69
+ } & {
70
+ isSystemTx?: undefined;
71
+ mint?: undefined;
72
+ sourceHash?: undefined;
73
+ }) | (Partial<import("../../types/transaction.js").TransactionEIP2930<`0x${string}`, `0x${string}`, "0x1">> & TransactionBase<`0x${string}`, `0x${string}`> & import("../../types/fee.js").FeeValuesLegacy<`0x${string}`> & {
74
+ accessList: import("../../types/transaction.js").AccessList;
75
+ chainId: `0x${string}`;
76
+ type: "0x1";
77
+ } & {
78
+ isSystemTx?: undefined;
79
+ mint?: undefined;
80
+ sourceHash?: undefined;
81
+ }) | (Partial<import("../../types/transaction.js").TransactionEIP1559<`0x${string}`, `0x${string}`, "0x2">> & TransactionBase<`0x${string}`, `0x${string}`> & FeeValuesEIP1559<`0x${string}`> & {
82
+ accessList: import("../../types/transaction.js").AccessList;
83
+ chainId: `0x${string}`;
84
+ type: "0x2";
85
+ } & {
86
+ isSystemTx?: undefined;
87
+ mint?: undefined;
88
+ sourceHash?: undefined;
89
+ })) => ({
90
+ blockHash: `0x${string}` | null;
91
+ blockNumber: bigint | null;
92
+ from: `0x${string}`;
93
+ gas: bigint;
94
+ hash: `0x${string}`;
95
+ input: `0x${string}`;
96
+ nonce: number;
97
+ r: `0x${string}`;
98
+ s: `0x${string}`;
99
+ to: `0x${string}` | null;
100
+ transactionIndex: number | null;
101
+ typeHex: `0x${string}` | null;
102
+ v: bigint;
103
+ value: bigint;
104
+ gasPrice: bigint;
105
+ maxFeePerGas?: undefined;
106
+ maxPriorityFeePerGas?: undefined;
107
+ accessList?: undefined;
108
+ chainId?: number | undefined;
109
+ type: "legacy";
110
+ isSystemTx?: undefined;
111
+ mint?: undefined;
112
+ sourceHash?: undefined;
113
+ } | {
114
+ blockHash: `0x${string}` | null;
115
+ blockNumber: bigint | null;
116
+ from: `0x${string}`;
117
+ gas: bigint;
118
+ hash: `0x${string}`;
119
+ input: `0x${string}`;
120
+ nonce: number;
121
+ r: `0x${string}`;
122
+ s: `0x${string}`;
123
+ to: `0x${string}` | null;
124
+ transactionIndex: number | null;
125
+ typeHex: `0x${string}` | null;
126
+ v: bigint;
127
+ value: bigint;
128
+ gasPrice: undefined;
129
+ maxFeePerGas: bigint;
130
+ maxPriorityFeePerGas: bigint;
131
+ accessList?: undefined;
132
+ chainId?: number | undefined;
133
+ type: 'deposit';
134
+ isSystemTx?: boolean | undefined;
135
+ mint?: bigint | undefined;
136
+ sourceHash: Hex;
137
+ } | {
138
+ blockHash: `0x${string}` | null;
139
+ blockNumber: bigint | null;
140
+ from: `0x${string}`;
141
+ gas: bigint;
142
+ hash: `0x${string}`;
143
+ input: `0x${string}`;
144
+ nonce: number;
145
+ r: `0x${string}`;
146
+ s: `0x${string}`;
147
+ to: `0x${string}` | null;
148
+ transactionIndex: number | null;
149
+ typeHex: `0x${string}` | null;
150
+ v: bigint;
151
+ value: bigint;
152
+ gasPrice: bigint;
153
+ maxFeePerGas?: undefined;
154
+ maxPriorityFeePerGas?: undefined;
155
+ accessList: import("../../types/transaction.js").AccessList;
156
+ chainId: number;
157
+ type: "eip2930";
158
+ isSystemTx?: undefined;
159
+ mint?: undefined;
160
+ sourceHash?: undefined;
161
+ } | {
162
+ blockHash: `0x${string}` | null;
163
+ blockNumber: bigint | null;
164
+ from: `0x${string}`;
165
+ gas: bigint;
166
+ hash: `0x${string}`;
167
+ input: `0x${string}`;
168
+ nonce: number;
169
+ r: `0x${string}`;
170
+ s: `0x${string}`;
171
+ to: `0x${string}` | null;
172
+ transactionIndex: number | null;
173
+ typeHex: `0x${string}` | null;
174
+ v: bigint;
175
+ value: bigint;
176
+ gasPrice: undefined;
177
+ maxFeePerGas: bigint;
178
+ maxPriorityFeePerGas: bigint;
179
+ accessList: import("../../types/transaction.js").AccessList;
180
+ chainId: number;
181
+ type: "eip1559";
182
+ isSystemTx?: undefined;
183
+ mint?: undefined;
184
+ sourceHash?: undefined;
185
+ } | {
186
+ blockHash: `0x${string}` | null;
187
+ blockNumber: bigint | null;
188
+ from: `0x${string}`;
189
+ gas: bigint;
190
+ hash: `0x${string}`;
191
+ input: `0x${string}`;
192
+ nonce: number;
193
+ r: `0x${string}`;
194
+ s: `0x${string}`;
195
+ to: `0x${string}` | null;
196
+ transactionIndex: number | null;
197
+ typeHex: `0x${string}` | null;
198
+ v: bigint;
199
+ value: bigint;
200
+ gasPrice: undefined;
201
+ maxFeePerGas: bigint;
202
+ maxPriorityFeePerGas: bigint;
203
+ accessList: import("../../types/transaction.js").AccessList;
204
+ chainId: number;
205
+ type: 'deposit';
206
+ isSystemTx?: boolean | undefined;
207
+ mint?: bigint | undefined;
208
+ sourceHash: Hex;
209
+ } | {
210
+ blockHash: `0x${string}` | null;
211
+ blockNumber: bigint | null;
212
+ from: `0x${string}`;
213
+ gas: bigint;
214
+ hash: `0x${string}`;
215
+ input: `0x${string}`;
216
+ nonce: number;
217
+ r: `0x${string}`;
218
+ s: `0x${string}`;
219
+ to: `0x${string}` | null;
220
+ transactionIndex: number | null;
221
+ typeHex: `0x${string}` | null;
222
+ v: bigint;
223
+ value: bigint;
224
+ gasPrice: bigint;
225
+ maxFeePerGas: undefined;
226
+ maxPriorityFeePerGas: undefined;
227
+ accessList: import("../../types/transaction.js").AccessList;
228
+ chainId: number;
229
+ type: "eip2930";
230
+ isSystemTx?: undefined;
231
+ mint?: undefined;
232
+ sourceHash?: undefined;
233
+ } | {
234
+ blockHash: `0x${string}` | null;
235
+ blockNumber: bigint | null;
236
+ from: `0x${string}`;
237
+ gas: bigint;
238
+ hash: `0x${string}`;
239
+ input: `0x${string}`;
240
+ nonce: number;
241
+ r: `0x${string}`;
242
+ s: `0x${string}`;
243
+ to: `0x${string}` | null;
244
+ transactionIndex: number | null;
245
+ typeHex: `0x${string}` | null;
246
+ v: bigint;
247
+ value: bigint;
248
+ gasPrice?: undefined;
249
+ maxFeePerGas: bigint;
250
+ maxPriorityFeePerGas: bigint;
251
+ accessList: import("../../types/transaction.js").AccessList;
252
+ chainId: number;
253
+ type: "eip1559";
254
+ isSystemTx?: undefined;
255
+ mint?: undefined;
256
+ sourceHash?: undefined;
257
+ } | {
258
+ blockHash: `0x${string}` | null;
259
+ blockNumber: bigint | null;
260
+ from: `0x${string}`;
261
+ gas: bigint;
262
+ hash: `0x${string}`;
263
+ input: `0x${string}`;
264
+ nonce: number;
265
+ r: `0x${string}`;
266
+ s: `0x${string}`;
267
+ to: `0x${string}` | null;
268
+ transactionIndex: number | null;
269
+ typeHex: `0x${string}` | null;
270
+ v: bigint;
271
+ value: bigint;
272
+ gasPrice?: undefined;
273
+ maxFeePerGas: bigint;
274
+ maxPriorityFeePerGas: bigint;
275
+ accessList: import("../../types/transaction.js").AccessList;
276
+ chainId: number;
277
+ type: 'deposit';
278
+ isSystemTx?: boolean | undefined;
279
+ mint?: bigint | undefined;
280
+ sourceHash: Hex;
281
+ }) & {};
282
+ type: "transaction";
283
+ };
284
+ };
285
+ export {};
286
+ //# sourceMappingURL=optimism.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimism.d.ts","sourceRoot":"","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