viem 2.37.12 → 2.38.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 (104) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/_cjs/actions/index.js +10 -2
  3. package/_cjs/actions/index.js.map +1 -1
  4. package/_cjs/actions/wallet/sendCallsSync.js +17 -0
  5. package/_cjs/actions/wallet/sendCallsSync.js.map +1 -0
  6. package/_cjs/actions/wallet/sendRawTransactionSync.js +17 -0
  7. package/_cjs/actions/wallet/sendRawTransactionSync.js.map +1 -0
  8. package/_cjs/actions/wallet/sendTransactionSync.js +172 -0
  9. package/_cjs/actions/wallet/sendTransactionSync.js.map +1 -0
  10. package/_cjs/actions/wallet/writeContract.js +31 -25
  11. package/_cjs/actions/wallet/writeContract.js.map +1 -1
  12. package/_cjs/actions/wallet/writeContractSync.js +9 -0
  13. package/_cjs/actions/wallet/writeContractSync.js.map +1 -0
  14. package/_cjs/chains/definitions/domaTestnet.js +24 -0
  15. package/_cjs/chains/definitions/domaTestnet.js.map +1 -0
  16. package/_cjs/chains/definitions/nitrographTestnet.js +26 -0
  17. package/_cjs/chains/definitions/nitrographTestnet.js.map +1 -0
  18. package/_cjs/chains/definitions/tronNile.js +22 -0
  19. package/_cjs/chains/definitions/tronNile.js.map +1 -0
  20. package/_cjs/chains/index.js +17 -11
  21. package/_cjs/chains/index.js.map +1 -1
  22. package/_cjs/clients/decorators/public.js +2 -0
  23. package/_cjs/clients/decorators/public.js.map +1 -1
  24. package/_cjs/clients/decorators/wallet.js +8 -0
  25. package/_cjs/clients/decorators/wallet.js.map +1 -1
  26. package/_cjs/errors/version.js +1 -1
  27. package/_cjs/errors/version.js.map +1 -1
  28. package/_cjs/index.js.map +1 -1
  29. package/_esm/actions/index.js +4 -0
  30. package/_esm/actions/index.js.map +1 -1
  31. package/_esm/actions/wallet/sendCallsSync.js +46 -0
  32. package/_esm/actions/wallet/sendCallsSync.js.map +1 -0
  33. package/_esm/actions/wallet/sendRawTransactionSync.js +39 -0
  34. package/_esm/actions/wallet/sendRawTransactionSync.js.map +1 -0
  35. package/_esm/actions/wallet/sendTransactionSync.js +218 -0
  36. package/_esm/actions/wallet/sendTransactionSync.js.map +1 -0
  37. package/_esm/actions/wallet/writeContract.js +31 -25
  38. package/_esm/actions/wallet/writeContract.js.map +1 -1
  39. package/_esm/actions/wallet/writeContractSync.js +38 -0
  40. package/_esm/actions/wallet/writeContractSync.js.map +1 -0
  41. package/_esm/chains/definitions/domaTestnet.js +21 -0
  42. package/_esm/chains/definitions/domaTestnet.js.map +1 -0
  43. package/_esm/chains/definitions/nitrographTestnet.js +23 -0
  44. package/_esm/chains/definitions/nitrographTestnet.js.map +1 -0
  45. package/_esm/chains/definitions/tronNile.js +19 -0
  46. package/_esm/chains/definitions/tronNile.js.map +1 -0
  47. package/_esm/chains/index.js +4 -0
  48. package/_esm/chains/index.js.map +1 -1
  49. package/_esm/clients/decorators/public.js +2 -0
  50. package/_esm/clients/decorators/public.js.map +1 -1
  51. package/_esm/clients/decorators/wallet.js +8 -0
  52. package/_esm/clients/decorators/wallet.js.map +1 -1
  53. package/_esm/errors/version.js +1 -1
  54. package/_esm/errors/version.js.map +1 -1
  55. package/_esm/index.js.map +1 -1
  56. package/_types/accounts/types.d.ts +3 -4
  57. package/_types/accounts/types.d.ts.map +1 -1
  58. package/_types/actions/index.d.ts +4 -0
  59. package/_types/actions/index.d.ts.map +1 -1
  60. package/_types/actions/wallet/sendCallsSync.d.ts +47 -0
  61. package/_types/actions/wallet/sendCallsSync.d.ts.map +1 -0
  62. package/_types/actions/wallet/sendRawTransactionSync.d.ts +42 -0
  63. package/_types/actions/wallet/sendRawTransactionSync.d.ts.map +1 -0
  64. package/_types/actions/wallet/sendTransactionSync.d.ts +73 -0
  65. package/_types/actions/wallet/sendTransactionSync.d.ts.map +1 -0
  66. package/_types/actions/wallet/writeContract.d.ts +5 -1
  67. package/_types/actions/wallet/writeContract.d.ts.map +1 -1
  68. package/_types/actions/wallet/writeContractSync.d.ts +45 -0
  69. package/_types/actions/wallet/writeContractSync.d.ts.map +1 -0
  70. package/_types/chains/definitions/domaTestnet.d.ts +39 -0
  71. package/_types/chains/definitions/domaTestnet.d.ts.map +1 -0
  72. package/_types/chains/definitions/nitrographTestnet.d.ts +39 -0
  73. package/_types/chains/definitions/nitrographTestnet.d.ts.map +1 -0
  74. package/_types/chains/definitions/tronNile.d.ts +39 -0
  75. package/_types/chains/definitions/tronNile.d.ts.map +1 -0
  76. package/_types/chains/index.d.ts +4 -0
  77. package/_types/chains/index.d.ts.map +1 -1
  78. package/_types/clients/decorators/public.d.ts +26 -0
  79. package/_types/clients/decorators/public.d.ts.map +1 -1
  80. package/_types/clients/decorators/wallet.d.ts +138 -0
  81. package/_types/clients/decorators/wallet.d.ts.map +1 -1
  82. package/_types/errors/version.d.ts +1 -1
  83. package/_types/errors/version.d.ts.map +1 -1
  84. package/_types/index.d.ts +4 -0
  85. package/_types/index.d.ts.map +1 -1
  86. package/_types/types/eip1193.d.ts +24 -0
  87. package/_types/types/eip1193.d.ts.map +1 -1
  88. package/accounts/types.ts +3 -14
  89. package/actions/index.ts +24 -0
  90. package/actions/wallet/sendCallsSync.ts +85 -0
  91. package/actions/wallet/sendRawTransactionSync.ts +68 -0
  92. package/actions/wallet/sendTransactionSync.ts +390 -0
  93. package/actions/wallet/writeContract.ts +71 -36
  94. package/actions/wallet/writeContractSync.ts +108 -0
  95. package/chains/definitions/domaTestnet.ts +21 -0
  96. package/chains/definitions/nitrographTestnet.ts +23 -0
  97. package/chains/definitions/tronNile.ts +19 -0
  98. package/chains/index.ts +4 -0
  99. package/clients/decorators/public.ts +33 -0
  100. package/clients/decorators/wallet.ts +189 -0
  101. package/errors/version.ts +1 -1
  102. package/index.ts +21 -0
  103. package/package.json +1 -1
  104. package/types/eip1193.ts +28 -0
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'
@@ -261,6 +261,11 @@ import {
261
261
  type SendRawTransactionReturnType,
262
262
  sendRawTransaction,
263
263
  } from '../../actions/wallet/sendRawTransaction.js'
264
+ import {
265
+ type SendRawTransactionSyncParameters,
266
+ type SendRawTransactionSyncReturnType,
267
+ sendRawTransactionSync,
268
+ } from '../../actions/wallet/sendRawTransactionSync.js'
264
269
  import type { Account } from '../../types/account.js'
265
270
  import type { BlockNumber, BlockTag } from '../../types/block.js'
266
271
  import type { Chain } from '../../types/chain.js'
@@ -1535,6 +1540,33 @@ export type PublicActions<
1535
1540
  sendRawTransaction: (
1536
1541
  args: SendRawTransactionParameters,
1537
1542
  ) => Promise<SendRawTransactionReturnType>
1543
+ /**
1544
+ * Sends a **signed** transaction to the network
1545
+ *
1546
+ * - Docs: https://viem.sh/docs/actions/wallet/sendRawTransactionSync
1547
+ * - JSON-RPC Method: [`eth_sendRawTransactionSync`](https://eips.ethereum.org/EIPS/eip-7966)
1548
+ *
1549
+ * @param client - Client to use
1550
+ * @param parameters - {@link SendRawTransactionSyncParameters}
1551
+ * @returns The transaction receipt. {@link SendRawTransactionSyncReturnType}
1552
+ *
1553
+ * @example
1554
+ * import { createWalletClient, custom } from 'viem'
1555
+ * import { mainnet } from 'viem/chains'
1556
+ * import { sendRawTransactionSync } from 'viem/wallet'
1557
+ *
1558
+ * const client = createWalletClient({
1559
+ * chain: mainnet,
1560
+ * transport: custom(window.ethereum),
1561
+ * })
1562
+ *
1563
+ * const receipt = await client.sendRawTransactionSync({
1564
+ * serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
1565
+ * })
1566
+ */
1567
+ sendRawTransactionSync: (
1568
+ args: SendRawTransactionSyncParameters,
1569
+ ) => Promise<SendRawTransactionSyncReturnType<chain>>
1538
1570
  /**
1539
1571
  * @deprecated Use `simulateBlocks` instead.
1540
1572
  */
@@ -2018,6 +2050,7 @@ export function publicActions<
2018
2050
  prepareTransactionRequest(client as any, args as any) as any,
2019
2051
  readContract: (args) => readContract(client, args),
2020
2052
  sendRawTransaction: (args) => sendRawTransaction(client, args),
2053
+ sendRawTransactionSync: (args) => sendRawTransactionSync(client, args),
2021
2054
  simulate: (args) => simulateBlocks(client, args),
2022
2055
  simulateBlocks: (args) => simulateBlocks(client, args),
2023
2056
  simulateCalls: (args) => simulateCalls(client, args),
@@ -57,17 +57,33 @@ import {
57
57
  type SendCallsReturnType,
58
58
  sendCalls,
59
59
  } from '../../actions/wallet/sendCalls.js'
60
+ import {
61
+ type SendCallsSyncParameters,
62
+ type SendCallsSyncReturnType,
63
+ sendCallsSync,
64
+ } from '../../actions/wallet/sendCallsSync.js'
60
65
  import {
61
66
  type SendRawTransactionParameters,
62
67
  type SendRawTransactionReturnType,
63
68
  sendRawTransaction,
64
69
  } from '../../actions/wallet/sendRawTransaction.js'
70
+ import {
71
+ type SendRawTransactionSyncParameters,
72
+ type SendRawTransactionSyncReturnType,
73
+ sendRawTransactionSync,
74
+ } from '../../actions/wallet/sendRawTransactionSync.js'
65
75
  import {
66
76
  type SendTransactionParameters,
67
77
  type SendTransactionRequest,
68
78
  type SendTransactionReturnType,
69
79
  sendTransaction,
70
80
  } from '../../actions/wallet/sendTransaction.js'
81
+ import {
82
+ type SendTransactionSyncParameters,
83
+ type SendTransactionSyncRequest,
84
+ type SendTransactionSyncReturnType,
85
+ sendTransactionSync,
86
+ } from '../../actions/wallet/sendTransactionSync.js'
71
87
  import {
72
88
  type ShowCallsStatusParameters,
73
89
  type ShowCallsStatusReturnType,
@@ -113,6 +129,11 @@ import {
113
129
  type WriteContractReturnType,
114
130
  writeContract,
115
131
  } from '../../actions/wallet/writeContract.js'
132
+ import {
133
+ type WriteContractSyncParameters,
134
+ type WriteContractSyncReturnType,
135
+ writeContractSync,
136
+ } from '../../actions/wallet/writeContractSync.js'
116
137
  import type { Chain } from '../../types/chain.js'
117
138
  import type {
118
139
  ContractFunctionArgs,
@@ -471,6 +492,44 @@ export type WalletActions<
471
492
  >(
472
493
  parameters: SendCallsParameters<chain, account, chainOverride, calls>,
473
494
  ) => Promise<SendCallsReturnType>
495
+ /**
496
+ * Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block.
497
+ *
498
+ * - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync
499
+ * - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792)
500
+ *
501
+ * @param client - Client to use
502
+ * @returns Calls status. {@link SendCallsSyncReturnType}
503
+ *
504
+ * @example
505
+ * import { createWalletClient, custom } from 'viem'
506
+ * import { mainnet } from 'viem/chains'
507
+ *
508
+ * const client = createWalletClient({
509
+ * chain: mainnet,
510
+ * transport: custom(window.ethereum),
511
+ * })
512
+ *
513
+ * const status = await client.sendCallsSync({
514
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
515
+ * calls: [
516
+ * {
517
+ * data: '0xdeadbeef',
518
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
519
+ * },
520
+ * {
521
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
522
+ * value: 69420n,
523
+ * },
524
+ * ],
525
+ * })
526
+ */
527
+ sendCallsSync: <
528
+ const calls extends readonly unknown[],
529
+ chainOverride extends Chain | undefined = undefined,
530
+ >(
531
+ parameters: SendCallsSyncParameters<chain, account, chainOverride, calls>,
532
+ ) => Promise<SendCallsSyncReturnType>
474
533
  /**
475
534
  * Sends a **signed** transaction to the network
476
535
  *
@@ -498,6 +557,34 @@ export type WalletActions<
498
557
  sendRawTransaction: (
499
558
  args: SendRawTransactionParameters,
500
559
  ) => Promise<SendRawTransactionReturnType>
560
+ /**
561
+ * Sends a **signed** transaction to the network synchronously,
562
+ * and waits for the transaction to be included in a block.
563
+ *
564
+ * - Docs: https://viem.sh/docs/actions/wallet/sendRawTransactionSync
565
+ * - JSON-RPC Method: [`eth_sendRawTransactionSync`](https://eips.ethereum.org/EIPS/eip-7966)
566
+ *
567
+ * @param client - Client to use
568
+ * @param parameters - {@link SendRawTransactionSyncParameters}
569
+ * @returns The transaction receipt. {@link SendRawTransactionSyncReturnType}
570
+ *
571
+ * @example
572
+ * import { createWalletClient, custom } from 'viem'
573
+ * import { mainnet } from 'viem/chains'
574
+ * import { sendRawTransactionSync } from 'viem/wallet'
575
+ *
576
+ * const client = createWalletClient({
577
+ * chain: mainnet,
578
+ * transport: custom(window.ethereum),
579
+ * })
580
+ *
581
+ * const receipt = await client.sendRawTransactionSync({
582
+ * serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
583
+ * })
584
+ */
585
+ sendRawTransactionSync: (
586
+ args: SendRawTransactionSyncParameters,
587
+ ) => Promise<SendRawTransactionSyncReturnType<chain>>
501
588
  /**
502
589
  * Creates, signs, and sends a new transaction to the network.
503
590
  *
@@ -546,6 +633,55 @@ export type WalletActions<
546
633
  >(
547
634
  args: SendTransactionParameters<chain, account, chainOverride, request>,
548
635
  ) => Promise<SendTransactionReturnType>
636
+ /**
637
+ * Creates, signs, and sends a new transaction to the network synchronously.
638
+ * Returns the transaction receipt.
639
+ *
640
+ * - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync
641
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions
642
+ * - JSON-RPC Methods:
643
+ * - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
644
+ * - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
645
+ *
646
+ * @param args - {@link SendTransactionParameters}
647
+ * @returns The transaction receipt. {@link SendTransactionReturnType}
648
+ *
649
+ * @example
650
+ * import { createWalletClient, custom } from 'viem'
651
+ * import { mainnet } from 'viem/chains'
652
+ *
653
+ * const client = createWalletClient({
654
+ * chain: mainnet,
655
+ * transport: custom(window.ethereum),
656
+ * })
657
+ * const receipt = await client.sendTransactionSync({
658
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
659
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
660
+ * value: 1000000000000000000n,
661
+ * })
662
+ *
663
+ * @example
664
+ * // Account Hoisting
665
+ * import { createWalletClient, http } from 'viem'
666
+ * import { privateKeyToAccount } from 'viem/accounts'
667
+ * import { mainnet } from 'viem/chains'
668
+ *
669
+ * const client = createWalletClient({
670
+ * account: privateKeyToAccount('0x…'),
671
+ * chain: mainnet,
672
+ * transport: http(),
673
+ * })
674
+ * const receipt = await client.sendTransactionSync({
675
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
676
+ * value: 1000000000000000000n,
677
+ * })
678
+ */
679
+ sendTransactionSync: <
680
+ const request extends SendTransactionSyncRequest<chain, chainOverride>,
681
+ chainOverride extends Chain | undefined = undefined,
682
+ >(
683
+ args: SendTransactionSyncParameters<chain, account, chainOverride, request>,
684
+ ) => Promise<SendTransactionSyncReturnType>
549
685
  /**
550
686
  * Requests for the wallet to show information about a call batch
551
687
  * that was sent via `sendCalls`.
@@ -951,6 +1087,55 @@ export type WalletActions<
951
1087
  chainOverride
952
1088
  >,
953
1089
  ) => Promise<WriteContractReturnType>
1090
+ /**
1091
+ * Executes a write function on a contract synchronously.
1092
+ * Returns the transaction receipt.
1093
+ *
1094
+ * - Docs: https://viem.sh/docs/contract/writeContract
1095
+ *
1096
+ * A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state.
1097
+ *
1098
+ * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
1099
+ *
1100
+ * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__
1101
+ *
1102
+ * @param args - {@link WriteContractSyncParameters}
1103
+ * @returns A [Transaction Receipt](https://viem.sh/docs/glossary/terms#receipt). {@link WriteContractSyncReturnType}
1104
+ *
1105
+ * @example
1106
+ * import { createWalletClient, custom, parseAbi } from 'viem'
1107
+ * import { mainnet } from 'viem/chains'
1108
+ *
1109
+ * const client = createWalletClient({
1110
+ * chain: mainnet,
1111
+ * transport: custom(window.ethereum),
1112
+ * })
1113
+ * const receipt = await client.writeContractSync({
1114
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
1115
+ * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
1116
+ * functionName: 'mint',
1117
+ * args: [69420],
1118
+ * })
1119
+ */
1120
+ writeContractSync: <
1121
+ const abi extends Abi | readonly unknown[],
1122
+ functionName extends ContractFunctionName<abi, 'payable' | 'nonpayable'>,
1123
+ args extends ContractFunctionArgs<
1124
+ abi,
1125
+ 'payable' | 'nonpayable',
1126
+ functionName
1127
+ >,
1128
+ chainOverride extends Chain | undefined = undefined,
1129
+ >(
1130
+ args: WriteContractSyncParameters<
1131
+ abi,
1132
+ functionName,
1133
+ args,
1134
+ chain,
1135
+ account,
1136
+ chainOverride
1137
+ >,
1138
+ ) => Promise<WriteContractSyncReturnType>
954
1139
  }
955
1140
 
956
1141
  export function walletActions<
@@ -972,8 +1157,11 @@ export function walletActions<
972
1157
  requestAddresses: () => requestAddresses(client),
973
1158
  requestPermissions: (args) => requestPermissions(client, args),
974
1159
  sendCalls: (args) => sendCalls(client, args),
1160
+ sendCallsSync: (args) => sendCallsSync(client, args),
975
1161
  sendRawTransaction: (args) => sendRawTransaction(client, args),
1162
+ sendRawTransactionSync: (args) => sendRawTransactionSync(client, args),
976
1163
  sendTransaction: (args) => sendTransaction(client, args),
1164
+ sendTransactionSync: (args) => sendTransactionSync(client, args),
977
1165
  showCallsStatus: (args) => showCallsStatus(client, args),
978
1166
  signAuthorization: (args) => signAuthorization(client, args),
979
1167
  signMessage: (args) => signMessage(client, args),
@@ -983,5 +1171,6 @@ export function walletActions<
983
1171
  waitForCallsStatus: (args) => waitForCallsStatus(client, args),
984
1172
  watchAsset: (args) => watchAsset(client, args),
985
1173
  writeContract: (args) => writeContract(client, args as any),
1174
+ writeContractSync: (args) => writeContractSync(client, args as any),
986
1175
  }
987
1176
  }
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.37.12'
1
+ export const version = '2.38.0'
package/index.ts CHANGED
@@ -480,17 +480,33 @@ export type {
480
480
  SendCallsParameters,
481
481
  SendCallsReturnType,
482
482
  } from './actions/wallet/sendCalls.js'
483
+ export type {
484
+ SendCallsSyncErrorType,
485
+ SendCallsSyncParameters,
486
+ SendCallsSyncReturnType,
487
+ } from './actions/wallet/sendCallsSync.js'
483
488
  export type {
484
489
  SendRawTransactionErrorType,
485
490
  SendRawTransactionParameters,
486
491
  SendRawTransactionReturnType,
487
492
  } from './actions/wallet/sendRawTransaction.js'
493
+ export type {
494
+ SendRawTransactionSyncErrorType,
495
+ SendRawTransactionSyncParameters,
496
+ SendRawTransactionSyncReturnType,
497
+ } from './actions/wallet/sendRawTransactionSync.js'
488
498
  export type {
489
499
  SendTransactionErrorType,
490
500
  SendTransactionParameters,
491
501
  SendTransactionRequest,
492
502
  SendTransactionReturnType,
493
503
  } from './actions/wallet/sendTransaction.js'
504
+ export type {
505
+ SendTransactionSyncErrorType,
506
+ SendTransactionSyncParameters,
507
+ SendTransactionSyncRequest,
508
+ SendTransactionSyncReturnType,
509
+ } from './actions/wallet/sendTransactionSync.js'
494
510
  export type {
495
511
  ShowCallsStatusErrorType,
496
512
  ShowCallsStatusParameters,
@@ -537,6 +553,11 @@ export type {
537
553
  WriteContractParameters,
538
554
  WriteContractReturnType,
539
555
  } from './actions/wallet/writeContract.js'
556
+ export type {
557
+ WriteContractSyncErrorType,
558
+ WriteContractSyncParameters,
559
+ WriteContractSyncReturnType,
560
+ } from './actions/wallet/writeContractSync.js'
540
561
  export {
541
562
  type Client,
542
563
  type ClientConfig,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.37.12",
4
+ "version": "2.38.0",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
package/types/eip1193.ts CHANGED
@@ -1168,6 +1168,20 @@ export type PublicRpcSchema = [
1168
1168
  Parameters: [signedTransaction: Hex]
1169
1169
  ReturnType: Hash
1170
1170
  },
1171
+ /**
1172
+ * @description Sends a **signed** transaction to the network synchronously
1173
+ * @link https://eips.ethereum.org/EIPS/eip-7966
1174
+ * @example
1175
+ * provider.request({ method: 'eth_sendRawTransactionSync', params: ['0x...'] })
1176
+ * // => '0x...'
1177
+ */
1178
+ {
1179
+ Method: 'eth_sendRawTransactionSync'
1180
+ Parameters:
1181
+ | [signedTransaction: Hex]
1182
+ | [signedTransaction: Hex, timeout: Hex]
1183
+ ReturnType: TransactionReceipt
1184
+ },
1171
1185
  /**
1172
1186
  * @description Simulates execution of a set of calls with optional block and state overrides.
1173
1187
  * @example
@@ -1711,6 +1725,20 @@ export type WalletRpcSchema = [
1711
1725
  Parameters: [signedTransaction: Hex]
1712
1726
  ReturnType: Hash
1713
1727
  },
1728
+ /**
1729
+ * @description Sends and already-signed transaction to the network synchronously
1730
+ * @link https://eips.ethereum.org/EIPS/eip-7966
1731
+ * @example
1732
+ * provider.request({ method: 'eth_sendRawTransactionSync', params: ['0x...'] })
1733
+ * // => '0x...'
1734
+ */
1735
+ {
1736
+ Method: 'eth_sendRawTransactionSync'
1737
+ Parameters:
1738
+ | [signedTransaction: Hex]
1739
+ | [signedTransaction: Hex, timeout: Hex]
1740
+ ReturnType: TransactionReceipt
1741
+ },
1714
1742
  /**
1715
1743
  * @description Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
1716
1744
  * @link https://eips.ethereum.org/EIPS/eip-1474