viem 2.37.11 → 2.37.13
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.
- package/CHANGELOG.md +22 -0
- package/_cjs/actions/public/call.js +1 -1
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/createAccessList.js +1 -1
- package/_cjs/actions/public/createAccessList.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js +1 -1
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/actions/public/getBlock.js +1 -1
- package/_cjs/actions/public/getBlock.js.map +1 -1
- package/_cjs/actions/public/getTransaction.js +1 -1
- package/_cjs/actions/public/getTransaction.js.map +1 -1
- package/_cjs/actions/public/getTransactionReceipt.js +1 -1
- package/_cjs/actions/public/getTransactionReceipt.js.map +1 -1
- package/_cjs/actions/test/sendUnsignedTransaction.js +1 -1
- package/_cjs/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/_cjs/actions/wallet/sendTransaction.js +1 -1
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/_cjs/actions/wallet/signTransaction.js +1 -1
- package/_cjs/actions/wallet/signTransaction.js.map +1 -1
- package/_cjs/chains/definitions/domaTestnet.js +24 -0
- package/_cjs/chains/definitions/domaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/nitrographTestnet.js +26 -0
- package/_cjs/chains/definitions/nitrographTestnet.js.map +1 -0
- package/_cjs/chains/definitions/tronNile.js +22 -0
- package/_cjs/chains/definitions/tronNile.js.map +1 -0
- package/_cjs/chains/index.js +17 -11
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/linea/actions/estimateGas.js +1 -1
- package/_cjs/linea/actions/estimateGas.js.map +1 -1
- package/_cjs/utils/formatters/block.js +1 -1
- package/_cjs/utils/formatters/block.js.map +1 -1
- package/_cjs/utils/formatters/formatter.js +3 -3
- package/_cjs/utils/formatters/formatter.js.map +1 -1
- package/_cjs/utils/formatters/transaction.js +1 -1
- package/_cjs/utils/formatters/transaction.js.map +1 -1
- package/_cjs/utils/formatters/transactionReceipt.js +1 -1
- package/_cjs/utils/formatters/transactionReceipt.js.map +1 -1
- package/_cjs/utils/formatters/transactionRequest.js +1 -1
- package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/_cjs/utils/transaction/parseTransaction.js +1 -2
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/_cjs/zksync/actions/estimateFee.js +1 -1
- package/_cjs/zksync/actions/estimateFee.js.map +1 -1
- package/_cjs/zksync/actions/estimateGasL1ToL2.js +1 -1
- package/_cjs/zksync/actions/estimateGasL1ToL2.js.map +1 -1
- package/_esm/actions/public/call.js +1 -1
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/createAccessList.js +1 -1
- package/_esm/actions/public/createAccessList.js.map +1 -1
- package/_esm/actions/public/estimateGas.js +1 -1
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/actions/public/getBlock.js +1 -1
- package/_esm/actions/public/getBlock.js.map +1 -1
- package/_esm/actions/public/getTransaction.js +1 -1
- package/_esm/actions/public/getTransaction.js.map +1 -1
- package/_esm/actions/public/getTransactionReceipt.js +1 -1
- package/_esm/actions/public/getTransactionReceipt.js.map +1 -1
- package/_esm/actions/test/sendUnsignedTransaction.js +1 -1
- package/_esm/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/_esm/actions/wallet/sendTransaction.js +1 -1
- package/_esm/actions/wallet/sendTransaction.js.map +1 -1
- package/_esm/actions/wallet/signTransaction.js +1 -1
- package/_esm/actions/wallet/signTransaction.js.map +1 -1
- package/_esm/chains/definitions/domaTestnet.js +21 -0
- package/_esm/chains/definitions/domaTestnet.js.map +1 -0
- package/_esm/chains/definitions/nitrographTestnet.js +23 -0
- package/_esm/chains/definitions/nitrographTestnet.js.map +1 -0
- package/_esm/chains/definitions/tronNile.js +19 -0
- package/_esm/chains/definitions/tronNile.js.map +1 -0
- package/_esm/chains/index.js +4 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/linea/actions/estimateGas.js +1 -1
- package/_esm/linea/actions/estimateGas.js.map +1 -1
- package/_esm/utils/formatters/block.js +1 -1
- package/_esm/utils/formatters/block.js.map +1 -1
- package/_esm/utils/formatters/formatter.js +3 -3
- package/_esm/utils/formatters/formatter.js.map +1 -1
- package/_esm/utils/formatters/transaction.js +1 -1
- package/_esm/utils/formatters/transaction.js.map +1 -1
- package/_esm/utils/formatters/transactionReceipt.js +1 -1
- package/_esm/utils/formatters/transactionReceipt.js.map +1 -1
- package/_esm/utils/formatters/transactionRequest.js +1 -1
- package/_esm/utils/formatters/transactionRequest.js.map +1 -1
- package/_esm/utils/transaction/parseTransaction.js +1 -2
- package/_esm/utils/transaction/parseTransaction.js.map +1 -1
- package/_esm/zksync/actions/estimateFee.js +1 -1
- package/_esm/zksync/actions/estimateFee.js.map +1 -1
- package/_esm/zksync/actions/estimateGasL1ToL2.js +1 -1
- package/_esm/zksync/actions/estimateGasL1ToL2.js.map +1 -1
- package/_types/accounts/types.d.ts +3 -4
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/public/call.d.ts.map +1 -1
- package/_types/actions/public/createAccessList.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/actions/public/getTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/signTransaction.d.ts.map +1 -1
- package/_types/celo/chainConfig.d.ts +52 -14
- package/_types/celo/chainConfig.d.ts.map +1 -1
- package/_types/celo/formatters.d.ts +26 -7
- package/_types/celo/formatters.d.ts.map +1 -1
- package/_types/chains/definitions/abstract.d.ts +26 -7
- package/_types/chains/definitions/abstract.d.ts.map +1 -1
- package/_types/chains/definitions/abstractTestnet.d.ts +26 -7
- package/_types/chains/definitions/abstractTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8.d.ts +3 -3
- package/_types/chains/definitions/ancient8Sepolia.d.ts +3 -3
- package/_types/chains/definitions/base.d.ts +6 -6
- package/_types/chains/definitions/baseGoerli.d.ts +3 -3
- package/_types/chains/definitions/baseSepolia.d.ts +6 -6
- package/_types/chains/definitions/blast.d.ts +3 -3
- package/_types/chains/definitions/bob.d.ts +3 -3
- package/_types/chains/definitions/bobSepolia.d.ts +3 -3
- package/_types/chains/definitions/celo.d.ts +52 -14
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +52 -14
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/celoSepolia.d.ts +52 -14
- package/_types/chains/definitions/celoSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/dchain.d.ts +3 -3
- package/_types/chains/definitions/dchainTestnet.d.ts +3 -3
- package/_types/chains/definitions/domaTestnet.d.ts +39 -0
- package/_types/chains/definitions/domaTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/elysiumTestnet.d.ts +3 -3
- package/_types/chains/definitions/fraxtal.d.ts +3 -3
- package/_types/chains/definitions/fraxtalTestnet.d.ts +3 -3
- package/_types/chains/definitions/funkiMainnet.d.ts +3 -3
- package/_types/chains/definitions/funkiSepolia.d.ts +3 -3
- package/_types/chains/definitions/garnet.d.ts +3 -3
- package/_types/chains/definitions/giwaSepolia.d.ts +3 -3
- package/_types/chains/definitions/ink.d.ts +3 -3
- package/_types/chains/definitions/inkSepolia.d.ts +3 -3
- package/_types/chains/definitions/lisk.d.ts +3 -3
- package/_types/chains/definitions/liskSepolia.d.ts +3 -3
- package/_types/chains/definitions/metalL2.d.ts +3 -3
- package/_types/chains/definitions/mode.d.ts +3 -3
- package/_types/chains/definitions/modeTestnet.d.ts +3 -3
- package/_types/chains/definitions/nitrographTestnet.d.ts +39 -0
- package/_types/chains/definitions/nitrographTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/optimism.d.ts +3 -3
- package/_types/chains/definitions/optimismGoerli.d.ts +3 -3
- package/_types/chains/definitions/optimismSepolia.d.ts +3 -3
- package/_types/chains/definitions/pgn.d.ts +3 -3
- package/_types/chains/definitions/pgnTestnet.d.ts +3 -3
- package/_types/chains/definitions/playfiAlbireo.d.ts +26 -7
- package/_types/chains/definitions/playfiAlbireo.d.ts.map +1 -1
- package/_types/chains/definitions/pyrope.d.ts +3 -3
- package/_types/chains/definitions/redstone.d.ts +3 -3
- package/_types/chains/definitions/rss3.d.ts +3 -3
- package/_types/chains/definitions/rss3Sepolia.d.ts +3 -3
- package/_types/chains/definitions/shape.d.ts +3 -3
- package/_types/chains/definitions/shapeSepolia.d.ts +3 -3
- package/_types/chains/definitions/snax.d.ts +3 -3
- package/_types/chains/definitions/snaxTestnet.d.ts +3 -3
- package/_types/chains/definitions/soneium.d.ts +3 -3
- package/_types/chains/definitions/soneiumMinato.d.ts +3 -3
- package/_types/chains/definitions/sophon.d.ts +26 -7
- package/_types/chains/definitions/sophon.d.ts.map +1 -1
- package/_types/chains/definitions/sophonTestnet.d.ts +26 -7
- package/_types/chains/definitions/sophonTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/superseed.d.ts +3 -3
- package/_types/chains/definitions/superseedSepolia.d.ts +3 -3
- package/_types/chains/definitions/swellchain.d.ts +3 -3
- package/_types/chains/definitions/swellchainTestnet.d.ts +3 -3
- package/_types/chains/definitions/treasure.d.ts +26 -7
- package/_types/chains/definitions/treasure.d.ts.map +1 -1
- package/_types/chains/definitions/treasureTopaz.d.ts +26 -7
- package/_types/chains/definitions/treasureTopaz.d.ts.map +1 -1
- package/_types/chains/definitions/tronNile.d.ts +39 -0
- package/_types/chains/definitions/tronNile.d.ts.map +1 -0
- package/_types/chains/definitions/unichain.d.ts +3 -3
- package/_types/chains/definitions/unichainSepolia.d.ts +3 -3
- package/_types/chains/definitions/worldchain.d.ts +3 -3
- package/_types/chains/definitions/worldchainSepolia.d.ts +3 -3
- package/_types/chains/definitions/zircuit.d.ts +3 -3
- package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts +3 -3
- package/_types/chains/definitions/zircuitTestnet.d.ts +3 -3
- package/_types/chains/definitions/zksync.d.ts +26 -7
- package/_types/chains/definitions/zksync.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts +26 -7
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +26 -7
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +26 -7
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalNode.d.ts +26 -7
- package/_types/chains/definitions/zksyncLocalNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +26 -7
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zora.d.ts +3 -3
- package/_types/chains/definitions/zoraSepolia.d.ts +3 -3
- package/_types/chains/definitions/zoraTestnet.d.ts +3 -3
- package/_types/chains/index.d.ts +4 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/linea/actions/estimateGas.d.ts.map +1 -1
- package/_types/op-stack/chainConfig.d.ts +3 -3
- package/_types/op-stack/formatters.d.ts +3 -3
- package/_types/types/chain.d.ts +1 -1
- package/_types/types/chain.d.ts.map +1 -1
- package/_types/types/transaction.d.ts +9 -6
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/block.d.ts +3 -3
- package/_types/utils/formatters/block.d.ts.map +1 -1
- package/_types/utils/formatters/formatter.d.ts +3 -3
- package/_types/utils/formatters/formatter.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +4 -4
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/transactionReceipt.d.ts +3 -3
- package/_types/utils/formatters/transactionReceipt.d.ts.map +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +4 -4
- package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
- package/_types/utils/transaction/parseTransaction.d.ts +1 -1
- package/_types/utils/transaction/parseTransaction.d.ts.map +1 -1
- package/_types/zksync/actions/estimateFee.d.ts.map +1 -1
- package/_types/zksync/actions/estimateGasL1ToL2.d.ts.map +1 -1
- package/_types/zksync/chainConfig.d.ts +26 -7
- package/_types/zksync/chainConfig.d.ts.map +1 -1
- package/_types/zksync/formatters.d.ts +26 -7
- package/_types/zksync/formatters.d.ts.map +1 -1
- package/accounts/types.ts +3 -14
- package/actions/public/call.ts +20 -17
- package/actions/public/createAccessList.ts +17 -14
- package/actions/public/estimateGas.ts +21 -18
- package/actions/public/getBlock.ts +1 -1
- package/actions/public/getTransaction.ts +1 -1
- package/actions/public/getTransactionReceipt.ts +4 -1
- package/actions/test/sendUnsignedTransaction.ts +17 -14
- package/actions/wallet/sendTransaction.ts +22 -19
- package/actions/wallet/signTransaction.ts +4 -1
- package/chains/definitions/domaTestnet.ts +21 -0
- package/chains/definitions/nitrographTestnet.ts +23 -0
- package/chains/definitions/tronNile.ts +19 -0
- package/chains/index.ts +4 -0
- package/errors/version.ts +1 -1
- package/linea/actions/estimateGas.ts +17 -14
- package/package.json +1 -1
- package/types/chain.ts +1 -1
- package/types/transaction.ts +18 -8
- package/utils/formatters/block.ts +4 -1
- package/utils/formatters/formatter.ts +8 -5
- package/utils/formatters/transaction.ts +4 -1
- package/utils/formatters/transactionReceipt.ts +1 -0
- package/utils/formatters/transactionRequest.ts +1 -0
- package/utils/transaction/parseTransaction.ts +4 -2
- package/zksync/actions/estimateFee.ts +7 -4
- package/zksync/actions/estimateGasL1ToL2.ts +7 -4
package/actions/public/call.ts
CHANGED
|
@@ -226,23 +226,26 @@ export async function call<chain extends Chain | undefined>(
|
|
|
226
226
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format
|
|
227
227
|
const format = chainFormat || formatTransactionRequest
|
|
228
228
|
|
|
229
|
-
const request = format(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
229
|
+
const request = format(
|
|
230
|
+
{
|
|
231
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
232
|
+
...extract(rest, { format: chainFormat }),
|
|
233
|
+
from: account?.address,
|
|
234
|
+
accessList,
|
|
235
|
+
authorizationList,
|
|
236
|
+
blobs,
|
|
237
|
+
data,
|
|
238
|
+
gas,
|
|
239
|
+
gasPrice,
|
|
240
|
+
maxFeePerBlobGas,
|
|
241
|
+
maxFeePerGas,
|
|
242
|
+
maxPriorityFeePerGas,
|
|
243
|
+
nonce,
|
|
244
|
+
to: deploylessCall ? undefined : to,
|
|
245
|
+
value,
|
|
246
|
+
} as TransactionRequest,
|
|
247
|
+
'call',
|
|
248
|
+
) as TransactionRequest
|
|
246
249
|
|
|
247
250
|
if (
|
|
248
251
|
batch &&
|
|
@@ -127,20 +127,23 @@ export async function createAccessList<chain extends Chain | undefined>(
|
|
|
127
127
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format
|
|
128
128
|
const format = chainFormat || formatTransactionRequest
|
|
129
129
|
|
|
130
|
-
const request = format(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
130
|
+
const request = format(
|
|
131
|
+
{
|
|
132
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
133
|
+
...extract(rest, { format: chainFormat }),
|
|
134
|
+
from: account?.address,
|
|
135
|
+
blobs,
|
|
136
|
+
data,
|
|
137
|
+
gas,
|
|
138
|
+
gasPrice,
|
|
139
|
+
maxFeePerBlobGas,
|
|
140
|
+
maxFeePerGas,
|
|
141
|
+
maxPriorityFeePerGas,
|
|
142
|
+
to,
|
|
143
|
+
value,
|
|
144
|
+
} as TransactionRequest,
|
|
145
|
+
'createAccessList',
|
|
146
|
+
) as TransactionRequest
|
|
144
147
|
|
|
145
148
|
const response = await client.request({
|
|
146
149
|
method: 'eth_createAccessList',
|
|
@@ -165,24 +165,27 @@ export async function estimateGas<
|
|
|
165
165
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format
|
|
166
166
|
const format = chainFormat || formatTransactionRequest
|
|
167
167
|
|
|
168
|
-
const request = format(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
168
|
+
const request = format(
|
|
169
|
+
{
|
|
170
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
171
|
+
...extract(rest, { format: chainFormat }),
|
|
172
|
+
from: account?.address,
|
|
173
|
+
accessList,
|
|
174
|
+
authorizationList,
|
|
175
|
+
blobs,
|
|
176
|
+
blobVersionedHashes,
|
|
177
|
+
data,
|
|
178
|
+
gas,
|
|
179
|
+
gasPrice,
|
|
180
|
+
maxFeePerBlobGas,
|
|
181
|
+
maxFeePerGas,
|
|
182
|
+
maxPriorityFeePerGas,
|
|
183
|
+
nonce,
|
|
184
|
+
to,
|
|
185
|
+
value,
|
|
186
|
+
} as TransactionRequest,
|
|
187
|
+
'estimateGas',
|
|
188
|
+
)
|
|
186
189
|
|
|
187
190
|
return BigInt(
|
|
188
191
|
await client.request({
|
|
@@ -68,5 +68,8 @@ export async function getTransactionReceipt<chain extends Chain | undefined>(
|
|
|
68
68
|
const format =
|
|
69
69
|
client.chain?.formatters?.transactionReceipt?.format ||
|
|
70
70
|
formatTransactionReceipt
|
|
71
|
-
return format(
|
|
71
|
+
return format(
|
|
72
|
+
receipt,
|
|
73
|
+
'getTransactionReceipt',
|
|
74
|
+
) as GetTransactionReceiptReturnType<chain>
|
|
72
75
|
}
|
|
@@ -72,20 +72,23 @@ export async function sendUnsignedTransaction<
|
|
|
72
72
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format
|
|
73
73
|
const format = chainFormat || formatTransactionRequest
|
|
74
74
|
|
|
75
|
-
const request = format(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
const request = format(
|
|
76
|
+
{
|
|
77
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
78
|
+
...extract(rest, { format: chainFormat }),
|
|
79
|
+
accessList,
|
|
80
|
+
data,
|
|
81
|
+
from,
|
|
82
|
+
gas,
|
|
83
|
+
gasPrice,
|
|
84
|
+
maxFeePerGas,
|
|
85
|
+
maxPriorityFeePerGas,
|
|
86
|
+
nonce,
|
|
87
|
+
to,
|
|
88
|
+
value,
|
|
89
|
+
} as TransactionRequest,
|
|
90
|
+
'sendUnsignedTransaction',
|
|
91
|
+
)
|
|
89
92
|
const hash = await client.request({
|
|
90
93
|
method: 'eth_sendUnsignedTransaction',
|
|
91
94
|
params: [request],
|
|
@@ -219,25 +219,28 @@ export async function sendTransaction<
|
|
|
219
219
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format
|
|
220
220
|
const format = chainFormat || formatTransactionRequest
|
|
221
221
|
|
|
222
|
-
const request = format(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
222
|
+
const request = format(
|
|
223
|
+
{
|
|
224
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
225
|
+
...extract(rest, { format: chainFormat }),
|
|
226
|
+
accessList,
|
|
227
|
+
authorizationList,
|
|
228
|
+
blobs,
|
|
229
|
+
chainId,
|
|
230
|
+
data,
|
|
231
|
+
from: account?.address,
|
|
232
|
+
gas,
|
|
233
|
+
gasPrice,
|
|
234
|
+
maxFeePerBlobGas,
|
|
235
|
+
maxFeePerGas,
|
|
236
|
+
maxPriorityFeePerGas,
|
|
237
|
+
nonce,
|
|
238
|
+
to,
|
|
239
|
+
type,
|
|
240
|
+
value,
|
|
241
|
+
} as TransactionRequest,
|
|
242
|
+
'sendTransaction',
|
|
243
|
+
)
|
|
241
244
|
|
|
242
245
|
const isWalletNamespaceSupported = supportsWalletNamespace.get(client.uid)
|
|
243
246
|
const method = isWalletNamespaceSupported
|
|
@@ -172,7 +172,10 @@ export async function signTransaction<
|
|
|
172
172
|
method: 'eth_signTransaction',
|
|
173
173
|
params: [
|
|
174
174
|
{
|
|
175
|
-
...format(
|
|
175
|
+
...format(
|
|
176
|
+
transaction as unknown as TransactionRequest,
|
|
177
|
+
'signTransaction',
|
|
178
|
+
),
|
|
176
179
|
chainId: numberToHex(chainId),
|
|
177
180
|
from: account.address,
|
|
178
181
|
} as unknown as RpcTransactionRequest,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const domaTestnet = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 97_476,
|
|
5
|
+
name: 'Doma Testnet',
|
|
6
|
+
nativeCurrency: {
|
|
7
|
+
decimals: 18,
|
|
8
|
+
name: 'Ether',
|
|
9
|
+
symbol: 'ETH',
|
|
10
|
+
},
|
|
11
|
+
rpcUrls: {
|
|
12
|
+
default: { http: ['https://rpc-testnet.doma.xyz'] },
|
|
13
|
+
},
|
|
14
|
+
blockExplorers: {
|
|
15
|
+
default: {
|
|
16
|
+
name: 'Doma Testnet Explorer',
|
|
17
|
+
url: 'https://explorer-testnet.doma.xyz',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
testnet: true,
|
|
21
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const nitrographTestnet = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 200024,
|
|
5
|
+
name: 'Nitrograph Testnet',
|
|
6
|
+
testnet: true,
|
|
7
|
+
rpcUrls: {
|
|
8
|
+
default: {
|
|
9
|
+
http: ['https://rpc-testnet.nitrograph.foundation'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
nativeCurrency: {
|
|
13
|
+
name: 'Nitro',
|
|
14
|
+
symbol: 'NOS',
|
|
15
|
+
decimals: 18,
|
|
16
|
+
},
|
|
17
|
+
blockExplorers: {
|
|
18
|
+
default: {
|
|
19
|
+
url: 'https://explorer-testnet.nitrograph.foundation',
|
|
20
|
+
name: 'Nitrograph Explorer',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const tronNile = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 3448148188,
|
|
5
|
+
name: 'Tron Nile',
|
|
6
|
+
nativeCurrency: { name: 'TRON', symbol: 'TRX', decimals: 6 },
|
|
7
|
+
rpcUrls: {
|
|
8
|
+
default: {
|
|
9
|
+
http: ['https://nile.trongrid.io/jsonrpc'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
blockExplorers: {
|
|
13
|
+
default: {
|
|
14
|
+
name: 'Tronscan',
|
|
15
|
+
url: 'https://nile.tronscan.org',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
testnet: true,
|
|
19
|
+
})
|
package/chains/index.ts
CHANGED
|
@@ -100,6 +100,7 @@ export { bxnTestnet } from './definitions/bxnTestnet.js'
|
|
|
100
100
|
export { cannon } from './definitions/cannon.js'
|
|
101
101
|
export { canto } from './definitions/canto.js'
|
|
102
102
|
export { celo } from './definitions/celo.js'
|
|
103
|
+
/** @deprecated use `celoSepolia` instead */
|
|
103
104
|
export { celoAlfajores } from './definitions/celoAlfajores.js'
|
|
104
105
|
export { celoSepolia } from './definitions/celoSepolia.js'
|
|
105
106
|
export { chang } from './definitions/chang.js'
|
|
@@ -144,6 +145,7 @@ export { diode } from './definitions/diode.js'
|
|
|
144
145
|
export { disChain } from './definitions/disChain.js'
|
|
145
146
|
export { dodochainTestnet } from './definitions/dodochainTestnet.js'
|
|
146
147
|
export { dogechain } from './definitions/dogechain.js'
|
|
148
|
+
export { domaTestnet } from './definitions/domaTestnet.js'
|
|
147
149
|
export { donatuz } from './definitions/donatuz.js'
|
|
148
150
|
export { dosChain } from './definitions/dosChain.js'
|
|
149
151
|
export { dosChainTestnet } from './definitions/dosChainTestnet.js'
|
|
@@ -400,6 +402,7 @@ export { newton } from './definitions/newton.js'
|
|
|
400
402
|
export { nexi } from './definitions/nexi.js'
|
|
401
403
|
export { nexilix } from './definitions/nexilix.js'
|
|
402
404
|
export { nibiru } from './definitions/nibiru.js'
|
|
405
|
+
export { nitrographTestnet } from './definitions/nitrographTestnet.js'
|
|
403
406
|
export { oasisTestnet } from './definitions/oasisTestnet.js'
|
|
404
407
|
export { oasys } from './definitions/oasys.js'
|
|
405
408
|
export { odysseyTestnet } from './definitions/odysseyTestnet.js'
|
|
@@ -589,6 +592,7 @@ export { tomb } from './definitions/tomb.js'
|
|
|
589
592
|
export { treasure } from './definitions/treasure.js'
|
|
590
593
|
export { treasureTopaz } from './definitions/treasureTopaz.js'
|
|
591
594
|
export { tron } from './definitions/tron.js'
|
|
595
|
+
export { tronNile } from './definitions/tronNile.js'
|
|
592
596
|
export { tronShasta } from './definitions/tronShasta.js'
|
|
593
597
|
export { ubiq } from './definitions/ubiq.js'
|
|
594
598
|
export { ultra } from './definitions/ultra.js'
|
package/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.37.
|
|
1
|
+
export const version = '2.37.13'
|
|
@@ -89,20 +89,23 @@ export async function estimateGas<
|
|
|
89
89
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format
|
|
90
90
|
const format = chainFormat || formatTransactionRequest
|
|
91
91
|
|
|
92
|
-
const request = format(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
const request = format(
|
|
93
|
+
{
|
|
94
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
95
|
+
...extract(rest, { format: chainFormat }),
|
|
96
|
+
from: account?.address,
|
|
97
|
+
accessList,
|
|
98
|
+
data,
|
|
99
|
+
gas,
|
|
100
|
+
gasPrice,
|
|
101
|
+
maxFeePerGas,
|
|
102
|
+
maxPriorityFeePerGas,
|
|
103
|
+
nonce,
|
|
104
|
+
to,
|
|
105
|
+
value,
|
|
106
|
+
} as TransactionRequest,
|
|
107
|
+
'estimateGas',
|
|
108
|
+
)
|
|
106
109
|
|
|
107
110
|
type LineaEstimateGasSchema = Filter<
|
|
108
111
|
LineaRpcSchema,
|
package/package.json
CHANGED
package/types/chain.ts
CHANGED
package/types/transaction.ts
CHANGED
|
@@ -259,14 +259,20 @@ export type TransactionRequestEIP4844<
|
|
|
259
259
|
index = number,
|
|
260
260
|
type = 'eip4844',
|
|
261
261
|
> = RequiredBy<TransactionRequestBase<quantity, index, type>, 'to'> &
|
|
262
|
-
|
|
262
|
+
ExactPartial<FeeValuesEIP4844<quantity>> & {
|
|
263
263
|
accessList?: AccessList | undefined
|
|
264
|
-
/** The blobs associated with this transaction. */
|
|
265
|
-
blobs: readonly Hex[] | readonly ByteArray[]
|
|
266
|
-
blobVersionedHashes?: readonly Hex[] | undefined
|
|
267
|
-
kzg?: Kzg | undefined
|
|
268
264
|
sidecars?: readonly BlobSidecar<Hex>[] | undefined
|
|
269
|
-
}
|
|
265
|
+
} & OneOf<
|
|
266
|
+
| {
|
|
267
|
+
blobs?: readonly Hex[] | readonly ByteArray[] | undefined
|
|
268
|
+
blobVersionedHashes: readonly Hex[]
|
|
269
|
+
}
|
|
270
|
+
| {
|
|
271
|
+
blobs: readonly Hex[] | readonly ByteArray[]
|
|
272
|
+
blobVersionedHashes?: readonly Hex[] | undefined
|
|
273
|
+
kzg?: Kzg | undefined
|
|
274
|
+
}
|
|
275
|
+
>
|
|
270
276
|
|
|
271
277
|
export type TransactionRequestEIP7702<
|
|
272
278
|
quantity = bigint,
|
|
@@ -360,11 +366,15 @@ export type TransactionSerializableEIP1559<
|
|
|
360
366
|
export type TransactionSerializableEIP4844<
|
|
361
367
|
quantity = bigint,
|
|
362
368
|
index = number,
|
|
363
|
-
|
|
369
|
+
nullableSidecars extends boolean = boolean,
|
|
370
|
+
> = RequiredBy<TransactionSerializableBase<quantity, index>, 'to'> &
|
|
364
371
|
ExactPartial<FeeValuesEIP4844<quantity>> & {
|
|
365
372
|
accessList?: AccessList | undefined
|
|
366
373
|
chainId: number
|
|
367
|
-
sidecars?:
|
|
374
|
+
sidecars?:
|
|
375
|
+
| readonly BlobSidecar<Hex>[]
|
|
376
|
+
| (nullableSidecars extends true ? false : never)
|
|
377
|
+
| undefined
|
|
368
378
|
type?: 'eip4844' | undefined
|
|
369
379
|
yParity?: number | undefined
|
|
370
380
|
} & OneOf<
|
|
@@ -40,7 +40,10 @@ export type FormattedBlock<
|
|
|
40
40
|
|
|
41
41
|
export type FormatBlockErrorType = ErrorType
|
|
42
42
|
|
|
43
|
-
export function formatBlock(
|
|
43
|
+
export function formatBlock(
|
|
44
|
+
block: ExactPartial<RpcBlock>,
|
|
45
|
+
_?: string | undefined,
|
|
46
|
+
) {
|
|
44
47
|
const transactions = (block.transactions ?? []).map((transaction) => {
|
|
45
48
|
if (typeof transaction === 'string') return transaction
|
|
46
49
|
return formatTransaction(transaction)
|
|
@@ -5,7 +5,7 @@ export type DefineFormatterErrorType = ErrorType
|
|
|
5
5
|
|
|
6
6
|
export function defineFormatter<type extends string, parameters, returnType>(
|
|
7
7
|
type: type,
|
|
8
|
-
format: (
|
|
8
|
+
format: (args: parameters, action?: string | undefined) => returnType,
|
|
9
9
|
) {
|
|
10
10
|
return <
|
|
11
11
|
parametersOverride,
|
|
@@ -16,12 +16,15 @@ export function defineFormatter<type extends string, parameters, returnType>(
|
|
|
16
16
|
format: overrides,
|
|
17
17
|
}: {
|
|
18
18
|
exclude?: exclude | undefined
|
|
19
|
-
format: (
|
|
19
|
+
format: (
|
|
20
|
+
args: parametersOverride,
|
|
21
|
+
action?: string | undefined,
|
|
22
|
+
) => returnTypeOverride
|
|
20
23
|
}) => {
|
|
21
24
|
return {
|
|
22
25
|
exclude,
|
|
23
|
-
format: (args: parametersOverride) => {
|
|
24
|
-
const formatted = format(args as any)
|
|
26
|
+
format: (args: parametersOverride, action?: string | undefined) => {
|
|
27
|
+
const formatted = format(args as any, action)
|
|
25
28
|
if (exclude) {
|
|
26
29
|
for (const key of exclude) {
|
|
27
30
|
delete (formatted as any)[key]
|
|
@@ -29,7 +32,7 @@ export function defineFormatter<type extends string, parameters, returnType>(
|
|
|
29
32
|
}
|
|
30
33
|
return {
|
|
31
34
|
...formatted,
|
|
32
|
-
...overrides(args),
|
|
35
|
+
...overrides(args, action),
|
|
33
36
|
} as Prettify<returnTypeOverride> & {
|
|
34
37
|
[_key in exclude[number]]: never
|
|
35
38
|
}
|
|
@@ -45,7 +45,10 @@ export const transactionType = {
|
|
|
45
45
|
|
|
46
46
|
export type FormatTransactionErrorType = ErrorType
|
|
47
47
|
|
|
48
|
-
export function formatTransaction(
|
|
48
|
+
export function formatTransaction(
|
|
49
|
+
transaction: ExactPartial<RpcTransaction>,
|
|
50
|
+
_?: string | undefined,
|
|
51
|
+
) {
|
|
49
52
|
const transaction_ = {
|
|
50
53
|
...transaction,
|
|
51
54
|
blockHash: transaction.blockHash ? transaction.blockHash : null,
|
|
@@ -73,7 +73,9 @@ export type ParseTransactionReturnType<
|
|
|
73
73
|
?
|
|
74
74
|
| (type extends 'eip1559' ? TransactionSerializableEIP1559 : never)
|
|
75
75
|
| (type extends 'eip2930' ? TransactionSerializableEIP2930 : never)
|
|
76
|
-
| (type extends 'eip4844'
|
|
76
|
+
| (type extends 'eip4844'
|
|
77
|
+
? TransactionSerializableEIP4844<bigint, number, false>
|
|
78
|
+
: never)
|
|
77
79
|
| (type extends 'eip7702' ? TransactionSerializableEIP7702 : never)
|
|
78
80
|
| (type extends 'legacy' ? TransactionSerializableLegacy : never)
|
|
79
81
|
: TransactionSerializable
|
|
@@ -276,9 +278,9 @@ function parseTransactionEIP4844(
|
|
|
276
278
|
const transaction = {
|
|
277
279
|
blobVersionedHashes: blobVersionedHashes as Hex[],
|
|
278
280
|
chainId: hexToNumber(chainId as Hex),
|
|
281
|
+
to,
|
|
279
282
|
type: 'eip4844',
|
|
280
283
|
} as TransactionSerializableEIP4844
|
|
281
|
-
if (isHex(to) && to !== '0x') transaction.to = to
|
|
282
284
|
if (isHex(gas) && gas !== '0x') transaction.gas = hexToBigInt(gas)
|
|
283
285
|
if (isHex(data) && data !== '0x') transaction.data = data
|
|
284
286
|
if (isHex(nonce)) transaction.nonce = nonce === '0x' ? 0 : hexToNumber(nonce)
|
|
@@ -27,10 +27,13 @@ export async function estimateFee<
|
|
|
27
27
|
const account = account_ ? parseAccount(account_) : client.account
|
|
28
28
|
|
|
29
29
|
const formatters = client.chain?.formatters
|
|
30
|
-
const formatted = formatters?.transactionRequest?.format(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
const formatted = formatters?.transactionRequest?.format(
|
|
31
|
+
{
|
|
32
|
+
...request,
|
|
33
|
+
from: account?.address,
|
|
34
|
+
},
|
|
35
|
+
'estimateFee',
|
|
36
|
+
)
|
|
34
37
|
|
|
35
38
|
const result = await client.request({
|
|
36
39
|
method: 'zks_estimateFee',
|
|
@@ -24,10 +24,13 @@ export async function estimateGasL1ToL2<
|
|
|
24
24
|
const account = account_ ? parseAccount(account_) : client.account
|
|
25
25
|
|
|
26
26
|
const formatters = client.chain?.formatters
|
|
27
|
-
const formatted = formatters?.transactionRequest?.format(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const formatted = formatters?.transactionRequest?.format(
|
|
28
|
+
{
|
|
29
|
+
...request,
|
|
30
|
+
from: account?.address,
|
|
31
|
+
},
|
|
32
|
+
'estimateGasL1ToL2',
|
|
33
|
+
)
|
|
31
34
|
|
|
32
35
|
const result = await client.request({
|
|
33
36
|
method: 'zks_estimateGasL1ToL2',
|