viem 2.50.3 → 2.51.0

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 (204) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/_cjs/actions/index.js +5 -3
  3. package/_cjs/actions/index.js.map +1 -1
  4. package/_cjs/actions/public/createAccessList.js +3 -0
  5. package/_cjs/actions/public/createAccessList.js.map +1 -1
  6. package/_cjs/actions/public/getBlockReceipts.js +19 -0
  7. package/_cjs/actions/public/getBlockReceipts.js.map +1 -0
  8. package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
  9. package/_cjs/chains/definitions/somnia.js +7 -0
  10. package/_cjs/chains/definitions/somnia.js.map +1 -1
  11. package/_cjs/chains/definitions/somniaTestnet.js +3 -2
  12. package/_cjs/chains/definitions/somniaTestnet.js.map +1 -1
  13. package/_cjs/clients/decorators/public.js +2 -0
  14. package/_cjs/clients/decorators/public.js.map +1 -1
  15. package/_cjs/errors/version.js +1 -1
  16. package/_cjs/index.js.map +1 -1
  17. package/_cjs/op-stack/actions/buildProveWithdrawal.js +10 -2
  18. package/_cjs/op-stack/actions/buildProveWithdrawal.js.map +1 -1
  19. package/_cjs/op-stack/actions/getGame.js.map +1 -1
  20. package/_cjs/op-stack/actions/getGames.js +3 -1
  21. package/_cjs/op-stack/actions/getGames.js.map +1 -1
  22. package/_cjs/op-stack/actions/getTimeToProve.js +3 -3
  23. package/_cjs/op-stack/actions/getTimeToProve.js.map +1 -1
  24. package/_cjs/op-stack/actions/getWithdrawalStatus.js +1 -1
  25. package/_cjs/op-stack/actions/getWithdrawalStatus.js.map +1 -1
  26. package/_cjs/op-stack/actions/waitToProve.js +4 -3
  27. package/_cjs/op-stack/actions/waitToProve.js.map +1 -1
  28. package/_cjs/op-stack/gameTypes.js +9 -0
  29. package/_cjs/op-stack/gameTypes.js.map +1 -0
  30. package/_cjs/op-stack/index.js +7 -1
  31. package/_cjs/op-stack/index.js.map +1 -1
  32. package/_cjs/op-stack/utils/getL2BlockNumberAtTimestamp.js +29 -0
  33. package/_cjs/op-stack/utils/getL2BlockNumberAtTimestamp.js.map +1 -0
  34. package/_cjs/tempo/Abis.js +477 -11
  35. package/_cjs/tempo/Abis.js.map +1 -1
  36. package/_cjs/tempo/Account.js +27 -1
  37. package/_cjs/tempo/Account.js.map +1 -1
  38. package/_cjs/tempo/Decorator.js +17 -0
  39. package/_cjs/tempo/Decorator.js.map +1 -1
  40. package/_cjs/tempo/Transaction.js +10 -2
  41. package/_cjs/tempo/Transaction.js.map +1 -1
  42. package/_cjs/tempo/actions/channel.js +377 -0
  43. package/_cjs/tempo/actions/channel.js.map +1 -0
  44. package/_cjs/tempo/actions/index.js +2 -1
  45. package/_cjs/tempo/actions/index.js.map +1 -1
  46. package/_cjs/tempo/actions/token.js +57 -27
  47. package/_cjs/tempo/actions/token.js.map +1 -1
  48. package/_cjs/tempo/index.js +2 -1
  49. package/_cjs/tempo/index.js.map +1 -1
  50. package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
  51. package/_cjs/utils/index.js.map +1 -1
  52. package/_esm/actions/index.js +1 -0
  53. package/_esm/actions/index.js.map +1 -1
  54. package/_esm/actions/public/createAccessList.js +3 -0
  55. package/_esm/actions/public/createAccessList.js.map +1 -1
  56. package/_esm/actions/public/getBlockReceipts.js +39 -0
  57. package/_esm/actions/public/getBlockReceipts.js.map +1 -0
  58. package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
  59. package/_esm/chains/definitions/somnia.js +7 -0
  60. package/_esm/chains/definitions/somnia.js.map +1 -1
  61. package/_esm/chains/definitions/somniaTestnet.js +3 -2
  62. package/_esm/chains/definitions/somniaTestnet.js.map +1 -1
  63. package/_esm/clients/decorators/public.js +2 -0
  64. package/_esm/clients/decorators/public.js.map +1 -1
  65. package/_esm/errors/version.js +1 -1
  66. package/_esm/index.js.map +1 -1
  67. package/_esm/op-stack/actions/buildProveWithdrawal.js +10 -2
  68. package/_esm/op-stack/actions/buildProveWithdrawal.js.map +1 -1
  69. package/_esm/op-stack/actions/getGame.js.map +1 -1
  70. package/_esm/op-stack/actions/getGames.js +3 -1
  71. package/_esm/op-stack/actions/getGames.js.map +1 -1
  72. package/_esm/op-stack/actions/getTimeToProve.js +3 -3
  73. package/_esm/op-stack/actions/getTimeToProve.js.map +1 -1
  74. package/_esm/op-stack/actions/getWithdrawalStatus.js +1 -1
  75. package/_esm/op-stack/actions/getWithdrawalStatus.js.map +1 -1
  76. package/_esm/op-stack/actions/waitToProve.js +4 -3
  77. package/_esm/op-stack/actions/waitToProve.js.map +1 -1
  78. package/_esm/op-stack/gameTypes.js +9 -0
  79. package/_esm/op-stack/gameTypes.js.map +1 -0
  80. package/_esm/op-stack/index.js +2 -0
  81. package/_esm/op-stack/index.js.map +1 -1
  82. package/_esm/op-stack/utils/getL2BlockNumberAtTimestamp.js +33 -0
  83. package/_esm/op-stack/utils/getL2BlockNumberAtTimestamp.js.map +1 -0
  84. package/_esm/tempo/Abis.js +476 -10
  85. package/_esm/tempo/Abis.js.map +1 -1
  86. package/_esm/tempo/Account.js +27 -2
  87. package/_esm/tempo/Account.js.map +1 -1
  88. package/_esm/tempo/Decorator.js +17 -0
  89. package/_esm/tempo/Decorator.js.map +1 -1
  90. package/_esm/tempo/Transaction.js +16 -11
  91. package/_esm/tempo/Transaction.js.map +1 -1
  92. package/_esm/tempo/actions/channel.js +736 -0
  93. package/_esm/tempo/actions/channel.js.map +1 -0
  94. package/_esm/tempo/actions/index.js +1 -0
  95. package/_esm/tempo/actions/index.js.map +1 -1
  96. package/_esm/tempo/actions/token.js +61 -28
  97. package/_esm/tempo/actions/token.js.map +1 -1
  98. package/_esm/tempo/index.js +1 -1
  99. package/_esm/tempo/index.js.map +1 -1
  100. package/_esm/utils/formatters/transactionRequest.js.map +1 -1
  101. package/_esm/utils/index.js.map +1 -1
  102. package/_types/actions/index.d.ts +1 -0
  103. package/_types/actions/index.d.ts.map +1 -1
  104. package/_types/actions/public/createAccessList.d.ts +2 -1
  105. package/_types/actions/public/createAccessList.d.ts.map +1 -1
  106. package/_types/actions/public/getBlockReceipts.d.ts +53 -0
  107. package/_types/actions/public/getBlockReceipts.d.ts.map +1 -0
  108. package/_types/actions/wallet/prepareTransactionRequest.d.ts +4 -5
  109. package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
  110. package/_types/chains/definitions/somnia.d.ts +7 -10
  111. package/_types/chains/definitions/somnia.d.ts.map +1 -1
  112. package/_types/chains/definitions/somniaTestnet.d.ts +3 -3
  113. package/_types/chains/definitions/somniaTestnet.d.ts.map +1 -1
  114. package/_types/chains/definitions/tempo.d.ts +8 -8
  115. package/_types/chains/definitions/tempoDevnet.d.ts +8 -8
  116. package/_types/chains/definitions/tempoLocalnet.d.ts +8 -8
  117. package/_types/chains/definitions/tempoModerato.d.ts +8 -8
  118. package/_types/chains/index.d.ts +44 -0
  119. package/_types/chains/index.d.ts.map +1 -1
  120. package/_types/clients/decorators/public.d.ts +23 -0
  121. package/_types/clients/decorators/public.d.ts.map +1 -1
  122. package/_types/errors/version.d.ts +1 -1
  123. package/_types/index.d.ts +2 -1
  124. package/_types/index.d.ts.map +1 -1
  125. package/_types/op-stack/actions/buildProveWithdrawal.d.ts +2 -1
  126. package/_types/op-stack/actions/buildProveWithdrawal.d.ts.map +1 -1
  127. package/_types/op-stack/actions/getGame.d.ts +7 -0
  128. package/_types/op-stack/actions/getGame.d.ts.map +1 -1
  129. package/_types/op-stack/actions/getGames.d.ts +7 -0
  130. package/_types/op-stack/actions/getGames.d.ts.map +1 -1
  131. package/_types/op-stack/actions/getTimeToProve.d.ts +4 -0
  132. package/_types/op-stack/actions/getTimeToProve.d.ts.map +1 -1
  133. package/_types/op-stack/actions/getWithdrawalStatus.d.ts +4 -0
  134. package/_types/op-stack/actions/getWithdrawalStatus.d.ts.map +1 -1
  135. package/_types/op-stack/actions/waitToProve.d.ts +4 -0
  136. package/_types/op-stack/actions/waitToProve.d.ts.map +1 -1
  137. package/_types/op-stack/gameTypes.d.ts +7 -0
  138. package/_types/op-stack/gameTypes.d.ts.map +1 -0
  139. package/_types/op-stack/index.d.ts +2 -0
  140. package/_types/op-stack/index.d.ts.map +1 -1
  141. package/_types/op-stack/utils/getL2BlockNumberAtTimestamp.d.ts +21 -0
  142. package/_types/op-stack/utils/getL2BlockNumberAtTimestamp.d.ts.map +1 -0
  143. package/_types/tempo/Abis.d.ts +3784 -2271
  144. package/_types/tempo/Abis.d.ts.map +1 -1
  145. package/_types/tempo/Account.d.ts +32 -1
  146. package/_types/tempo/Account.d.ts.map +1 -1
  147. package/_types/tempo/Decorator.d.ts +246 -1
  148. package/_types/tempo/Decorator.d.ts.map +1 -1
  149. package/_types/tempo/Transaction.d.ts.map +1 -1
  150. package/_types/tempo/actions/accessKey.d.ts +339 -0
  151. package/_types/tempo/actions/accessKey.d.ts.map +1 -1
  152. package/_types/tempo/actions/channel.d.ts +4390 -0
  153. package/_types/tempo/actions/channel.d.ts.map +1 -0
  154. package/_types/tempo/actions/dex.d.ts +140 -0
  155. package/_types/tempo/actions/dex.d.ts.map +1 -1
  156. package/_types/tempo/actions/fee.d.ts +0 -48
  157. package/_types/tempo/actions/fee.d.ts.map +1 -1
  158. package/_types/tempo/actions/index.d.ts +1 -0
  159. package/_types/tempo/actions/index.d.ts.map +1 -1
  160. package/_types/tempo/actions/reward.d.ts +74 -18
  161. package/_types/tempo/actions/reward.d.ts.map +1 -1
  162. package/_types/tempo/actions/token.d.ts +629 -141
  163. package/_types/tempo/actions/token.d.ts.map +1 -1
  164. package/_types/tempo/actions/virtualAddress.d.ts +11 -0
  165. package/_types/tempo/actions/virtualAddress.d.ts.map +1 -1
  166. package/_types/tempo/index.d.ts +1 -1
  167. package/_types/tempo/index.d.ts.map +1 -1
  168. package/_types/types/eip1193.d.ts +13 -0
  169. package/_types/types/eip1193.d.ts.map +1 -1
  170. package/_types/utils/formatters/transactionRequest.d.ts +6 -1
  171. package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
  172. package/_types/utils/index.d.ts +1 -1
  173. package/_types/utils/index.d.ts.map +1 -1
  174. package/actions/index.ts +6 -0
  175. package/actions/public/createAccessList.ts +4 -0
  176. package/actions/public/getBlockReceipts.ts +101 -0
  177. package/actions/wallet/prepareTransactionRequest.ts +7 -10
  178. package/chains/definitions/somnia.ts +7 -0
  179. package/chains/definitions/somniaTestnet.ts +3 -2
  180. package/chains/index.ts +50 -0
  181. package/clients/decorators/public.ts +30 -0
  182. package/errors/version.ts +1 -1
  183. package/index.ts +6 -0
  184. package/op-stack/actions/buildProveWithdrawal.ts +17 -2
  185. package/op-stack/actions/getGame.ts +7 -0
  186. package/op-stack/actions/getGames.ts +10 -1
  187. package/op-stack/actions/getTimeToProve.ts +7 -3
  188. package/op-stack/actions/getWithdrawalStatus.ts +6 -1
  189. package/op-stack/actions/waitToProve.ts +8 -3
  190. package/op-stack/gameTypes.ts +9 -0
  191. package/op-stack/index.ts +7 -1
  192. package/op-stack/utils/getL2BlockNumberAtTimestamp.ts +57 -0
  193. package/package.json +2 -2
  194. package/tempo/Abis.ts +477 -10
  195. package/tempo/Account.ts +67 -2
  196. package/tempo/Decorator.ts +299 -1
  197. package/tempo/Transaction.ts +18 -11
  198. package/tempo/actions/channel.ts +1197 -0
  199. package/tempo/actions/index.ts +1 -0
  200. package/tempo/actions/token.ts +85 -26
  201. package/tempo/index.ts +1 -0
  202. package/types/eip1193.ts +13 -0
  203. package/utils/formatters/transactionRequest.ts +13 -1
  204. package/utils/index.ts +1 -0
@@ -1,6 +1,7 @@
1
1
  // biome-ignore lint/performance/noBarrelFile: _
2
2
  export * as accessKey from './accessKey.js'
3
3
  export * as amm from './amm.js'
4
+ export * as channel from './channel.js'
4
5
  export * as dex from './dex.js'
5
6
  export * as faucet from './faucet.js'
6
7
  export * as fee from './fee.js'
@@ -879,6 +879,7 @@ export namespace changeTransferPolicySync {
879
879
  * name: 'My Token',
880
880
  * symbol: 'MTK',
881
881
  * currency: 'USD',
882
+ * logoURI: 'https://example.com/token.svg',
882
883
  * })
883
884
  * ```
884
885
  *
@@ -913,6 +914,8 @@ export namespace create {
913
914
  currency: string
914
915
  /** Token name. */
915
916
  name: string
917
+ /** Logo URI. Requires a T5-enabled Tempo chain. */
918
+ logoURI?: string | undefined
916
919
  /** Quote token. */
917
920
  quoteToken?: TokenId.TokenIdOrAddress | undefined
918
921
  /** Unique salt. @default Hex.random(32) */
@@ -983,6 +986,7 @@ export namespace create {
983
986
  * name: 'My Token',
984
987
  * symbol: 'MTK',
985
988
  * currency: 'USD',
989
+ * logoURI: 'https://example.com/token.svg',
986
990
  * admin: '0xfeed...fede',
987
991
  * }),
988
992
  * ]
@@ -997,6 +1001,7 @@ export namespace create {
997
1001
  name,
998
1002
  symbol,
999
1003
  currency,
1004
+ logoURI,
1000
1005
  quoteToken = Addresses.pathUsd,
1001
1006
  admin,
1002
1007
  salt = Hex.random(32),
@@ -1004,14 +1009,25 @@ export namespace create {
1004
1009
  return defineCall({
1005
1010
  address: Addresses.tip20Factory,
1006
1011
  abi: Abis.tip20Factory,
1007
- args: [
1008
- name,
1009
- symbol,
1010
- currency,
1011
- TokenId.toAddress(quoteToken),
1012
- admin,
1013
- salt,
1014
- ],
1012
+ args:
1013
+ typeof logoURI === 'string'
1014
+ ? [
1015
+ name,
1016
+ symbol,
1017
+ currency,
1018
+ TokenId.toAddress(quoteToken),
1019
+ admin,
1020
+ salt,
1021
+ logoURI,
1022
+ ]
1023
+ : [
1024
+ name,
1025
+ symbol,
1026
+ currency,
1027
+ TokenId.toAddress(quoteToken),
1028
+ admin,
1029
+ salt,
1030
+ ],
1015
1031
  functionName: 'createToken',
1016
1032
  })
1017
1033
  }
@@ -1054,6 +1070,7 @@ export namespace create {
1054
1070
  * name: 'My Token',
1055
1071
  * symbol: 'MTK',
1056
1072
  * currency: 'USD',
1073
+ * logoURI: 'https://example.com/token.svg',
1057
1074
  * })
1058
1075
  * ```
1059
1076
  *
@@ -1264,7 +1281,7 @@ export namespace getBalance {
1264
1281
  }
1265
1282
 
1266
1283
  /**
1267
- * Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
1284
+ * Gets TIP20 token metadata including name, symbol, logo URI, currency, decimals, and total supply.
1268
1285
  *
1269
1286
  * @example
1270
1287
  * ```ts
@@ -1310,6 +1327,11 @@ export async function getMetadata<chain extends Chain | undefined>(
1310
1327
  abi,
1311
1328
  functionName: 'decimals',
1312
1329
  },
1330
+ {
1331
+ address,
1332
+ abi,
1333
+ functionName: 'logoURI',
1334
+ },
1313
1335
  {
1314
1336
  address,
1315
1337
  abi,
@@ -1326,14 +1348,15 @@ export async function getMetadata<chain extends Chain | undefined>(
1326
1348
  functionName: 'totalSupply',
1327
1349
  },
1328
1350
  ] as const,
1329
- allowFailure: false,
1351
+ allowFailure: true,
1330
1352
  deployless: true,
1331
- }).then(([currency, decimals, name, symbol, totalSupply]) => ({
1332
- name,
1333
- symbol,
1334
- currency,
1335
- decimals,
1336
- totalSupply,
1353
+ }).then(([currency, decimals, logoURI, name, symbol, totalSupply]) => ({
1354
+ name: unwrapMulticallResult(name),
1355
+ symbol: unwrapMulticallResult(symbol),
1356
+ currency: unwrapMulticallResult(currency),
1357
+ decimals: unwrapMulticallResult(decimals),
1358
+ logoURI: unwrapMulticallResult(logoURI, ''),
1359
+ totalSupply: unwrapMulticallResult(totalSupply),
1337
1360
  }))
1338
1361
 
1339
1362
  return multicall(client, {
@@ -1349,6 +1372,11 @@ export async function getMetadata<chain extends Chain | undefined>(
1349
1372
  abi,
1350
1373
  functionName: 'decimals',
1351
1374
  },
1375
+ {
1376
+ address,
1377
+ abi,
1378
+ functionName: 'logoURI',
1379
+ },
1352
1380
  {
1353
1381
  address,
1354
1382
  abi,
@@ -1385,12 +1413,13 @@ export async function getMetadata<chain extends Chain | undefined>(
1385
1413
  functionName: 'transferPolicyId',
1386
1414
  },
1387
1415
  ] as const,
1388
- allowFailure: false,
1416
+ allowFailure: true,
1389
1417
  deployless: true,
1390
1418
  }).then(
1391
1419
  ([
1392
1420
  currency,
1393
1421
  decimals,
1422
+ logoURI,
1394
1423
  quoteToken,
1395
1424
  name,
1396
1425
  paused,
@@ -1399,19 +1428,44 @@ export async function getMetadata<chain extends Chain | undefined>(
1399
1428
  totalSupply,
1400
1429
  transferPolicyId,
1401
1430
  ]) => ({
1402
- name,
1403
- symbol,
1404
- currency,
1405
- decimals,
1406
- quoteToken,
1407
- totalSupply,
1408
- paused,
1409
- supplyCap,
1410
- transferPolicyId,
1431
+ name: unwrapMulticallResult(name),
1432
+ symbol: unwrapMulticallResult(symbol),
1433
+ currency: unwrapMulticallResult(currency),
1434
+ decimals: unwrapMulticallResult(decimals),
1435
+ logoURI: unwrapMulticallResult(logoURI, ''),
1436
+ quoteToken: unwrapMulticallResult(quoteToken),
1437
+ totalSupply: unwrapMulticallResult(totalSupply),
1438
+ paused: unwrapMulticallResult(paused),
1439
+ supplyCap: unwrapMulticallResult(supplyCap),
1440
+ transferPolicyId: unwrapMulticallResult(transferPolicyId),
1411
1441
  }),
1412
1442
  )
1413
1443
  }
1414
1444
 
1445
+ function unwrapMulticallResult<result>(
1446
+ response:
1447
+ | { result: result; status: 'success' }
1448
+ | { error: unknown; status: 'failure' },
1449
+ ): result
1450
+ function unwrapMulticallResult<result>(
1451
+ response:
1452
+ | { result: result; status: 'success' }
1453
+ | { error: unknown; status: 'failure' },
1454
+ fallback: result,
1455
+ ): result
1456
+ function unwrapMulticallResult<result>(
1457
+ response:
1458
+ | { result: result; status: 'success' }
1459
+ | { error: unknown; status: 'failure' },
1460
+ ...fallback: [] | [result]
1461
+ ) {
1462
+ if (response.status === 'failure') {
1463
+ if (fallback.length > 0) return fallback[0]
1464
+ throw response.error
1465
+ }
1466
+ return response.result
1467
+ }
1468
+
1415
1469
  export declare namespace getMetadata {
1416
1470
  export type Parameters = {
1417
1471
  /** Address or ID of the TIP20 token. */
@@ -1427,6 +1481,11 @@ export declare namespace getMetadata {
1427
1481
  * Decimals of the token.
1428
1482
  */
1429
1483
  decimals: number
1484
+ /**
1485
+ * Logo URI of the token. Returns an empty string if unset or unsupported
1486
+ * by the active Tempo hardfork.
1487
+ */
1488
+ logoURI: string
1430
1489
  /**
1431
1490
  * Quote token.
1432
1491
  *
package/tempo/index.ts CHANGED
@@ -12,6 +12,7 @@ export type {
12
12
  TxEnvelopeTempo as z_TxEnvelopeTempo,
13
13
  } from 'ox/tempo'
14
14
  export {
15
+ Channel,
15
16
  Period,
16
17
  TempoAddress,
17
18
  Tick,
package/types/eip1193.ts CHANGED
@@ -706,6 +706,7 @@ export type PublicRpcSchema = [
706
706
  ]
707
707
  ReturnType: {
708
708
  accessList: AccessList
709
+ error?: string | undefined
709
710
  gasUsed: Quantity
710
711
  }
711
712
  },
@@ -867,6 +868,18 @@ export type PublicRpcSchema = [
867
868
  ]
868
869
  ReturnType: Block | null
869
870
  },
871
+ /**
872
+ * @description Returns the receipts of a block specified by block number, block tag, or block hash
873
+ * @link https://ethereum.github.io/execution-apis/api/methods/eth_getBlockReceipts/
874
+ * @example
875
+ * provider.request({ method: 'eth_getBlockReceipts', params: ['latest'] })
876
+ * // => [{ ... }, { ... }]
877
+ */
878
+ {
879
+ Method: 'eth_getBlockReceipts'
880
+ Parameters: [block: BlockNumber | BlockTag | Hash]
881
+ ReturnType: TransactionReceipt[] | null
882
+ },
870
883
  /**
871
884
  * @description Returns the number of transactions in a block specified by block hash
872
885
  * @link https://eips.ethereum.org/EIPS/eip-1474
@@ -11,7 +11,7 @@ import type {
11
11
  RpcTransactionRequest,
12
12
  } from '../../types/rpc.js'
13
13
  import type { TransactionRequest } from '../../types/transaction.js'
14
- import type { ExactPartial } from '../../types/utils.js'
14
+ import type { ExactPartial, UnionOmit } from '../../types/utils.js'
15
15
  import { bytesToHex, numberToHex } from '../encoding/toHex.js'
16
16
  import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
17
17
 
@@ -23,6 +23,18 @@ export type FormattedTransactionRequest<
23
23
  TransactionRequest
24
24
  >
25
25
 
26
+ export type ExtractFormattedTransactionRequest<
27
+ chain extends Chain | undefined,
28
+ request extends { type?: string | undefined },
29
+ ///
30
+ _transactionRequest = UnionOmit<FormattedTransactionRequest<chain>, 'from'>,
31
+ _transactionType = request['type'],
32
+ > = _transactionRequest extends { type?: infer type | undefined }
33
+ ? Extract<_transactionType, type> extends never
34
+ ? never
35
+ : _transactionRequest
36
+ : never
37
+
26
38
  export const rpcTransactionType = {
27
39
  legacy: '0x0',
28
40
  eip2930: '0x1',
package/utils/index.ts CHANGED
@@ -341,6 +341,7 @@ export {
341
341
  export {
342
342
  type DefineTransactionRequestErrorType,
343
343
  defineTransactionRequest,
344
+ type ExtractFormattedTransactionRequest,
344
345
  type FormatTransactionRequestErrorType,
345
346
  type FormattedTransactionRequest,
346
347
  formatTransactionRequest,