viem 2.37.13 → 2.38.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.
- package/CHANGELOG.md +14 -0
- package/_cjs/actions/index.js +10 -2
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/wallet/sendCalls.js +6 -1
- package/_cjs/actions/wallet/sendCalls.js.map +1 -1
- package/_cjs/actions/wallet/sendCallsSync.js +17 -0
- package/_cjs/actions/wallet/sendCallsSync.js.map +1 -0
- package/_cjs/actions/wallet/sendRawTransactionSync.js +17 -0
- package/_cjs/actions/wallet/sendRawTransactionSync.js.map +1 -0
- package/_cjs/actions/wallet/sendTransactionSync.js +172 -0
- package/_cjs/actions/wallet/sendTransactionSync.js.map +1 -0
- package/_cjs/actions/wallet/writeContract.js +31 -25
- package/_cjs/actions/wallet/writeContract.js.map +1 -1
- package/_cjs/actions/wallet/writeContractSync.js +9 -0
- package/_cjs/actions/wallet/writeContractSync.js.map +1 -0
- package/_cjs/chains/definitions/injective.js +28 -0
- package/_cjs/chains/definitions/injective.js.map +1 -0
- package/_cjs/chains/definitions/injectiveTestnet.js +28 -0
- package/_cjs/chains/definitions/injectiveTestnet.js.map +1 -0
- package/_cjs/chains/index.js +12 -8
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/decorators/public.js +2 -0
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/clients/decorators/wallet.js +8 -0
- package/_cjs/clients/decorators/wallet.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/index.js.map +1 -1
- package/_esm/actions/index.js +4 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/wallet/sendCalls.js +8 -1
- package/_esm/actions/wallet/sendCalls.js.map +1 -1
- package/_esm/actions/wallet/sendCallsSync.js +46 -0
- package/_esm/actions/wallet/sendCallsSync.js.map +1 -0
- package/_esm/actions/wallet/sendRawTransactionSync.js +39 -0
- package/_esm/actions/wallet/sendRawTransactionSync.js.map +1 -0
- package/_esm/actions/wallet/sendTransactionSync.js +218 -0
- package/_esm/actions/wallet/sendTransactionSync.js.map +1 -0
- package/_esm/actions/wallet/writeContract.js +31 -25
- package/_esm/actions/wallet/writeContract.js.map +1 -1
- package/_esm/actions/wallet/writeContractSync.js +38 -0
- package/_esm/actions/wallet/writeContractSync.js.map +1 -0
- package/_esm/chains/definitions/injective.js +25 -0
- package/_esm/chains/definitions/injective.js.map +1 -0
- package/_esm/chains/definitions/injectiveTestnet.js +25 -0
- package/_esm/chains/definitions/injectiveTestnet.js.map +1 -0
- package/_esm/chains/index.js +2 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/decorators/public.js +2 -0
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/clients/decorators/wallet.js +8 -0
- package/_esm/clients/decorators/wallet.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/index.js.map +1 -1
- package/_types/actions/index.d.ts +4 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
- package/_types/actions/wallet/sendCallsSync.d.ts +47 -0
- package/_types/actions/wallet/sendCallsSync.d.ts.map +1 -0
- package/_types/actions/wallet/sendRawTransactionSync.d.ts +42 -0
- package/_types/actions/wallet/sendRawTransactionSync.d.ts.map +1 -0
- package/_types/actions/wallet/sendTransactionSync.d.ts +73 -0
- package/_types/actions/wallet/sendTransactionSync.d.ts.map +1 -0
- package/_types/actions/wallet/writeContract.d.ts +5 -1
- package/_types/actions/wallet/writeContract.d.ts.map +1 -1
- package/_types/actions/wallet/writeContractSync.d.ts +45 -0
- package/_types/actions/wallet/writeContractSync.d.ts.map +1 -0
- package/_types/chains/definitions/injective.d.ts +41 -0
- package/_types/chains/definitions/injective.d.ts.map +1 -0
- package/_types/chains/definitions/injectiveTestnet.d.ts +41 -0
- package/_types/chains/definitions/injectiveTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +2 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +26 -0
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +138 -0
- package/_types/clients/decorators/wallet.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/index.d.ts +4 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +24 -0
- package/_types/types/eip1193.d.ts.map +1 -1
- package/actions/index.ts +24 -0
- package/actions/wallet/sendCalls.ts +10 -1
- package/actions/wallet/sendCallsSync.ts +85 -0
- package/actions/wallet/sendRawTransactionSync.ts +68 -0
- package/actions/wallet/sendTransactionSync.ts +390 -0
- package/actions/wallet/writeContract.ts +71 -36
- package/actions/wallet/writeContractSync.ts +108 -0
- package/chains/definitions/injective.ts +25 -0
- package/chains/definitions/injectiveTestnet.ts +25 -0
- package/chains/index.ts +2 -0
- package/clients/decorators/public.ts +33 -0
- package/clients/decorators/wallet.ts +189 -0
- package/errors/version.ts +1 -1
- package/index.ts +21 -0
- package/package.json +1 -1
- package/types/eip1193.ts +28 -0
|
@@ -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.
|
|
1
|
+
export const version = '2.38.1'
|
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
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
|