viem 2.9.9 → 2.9.11
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 -1
- package/_cjs/chains/definitions/dfk.js +6 -0
- package/_cjs/chains/definitions/dfk.js.map +1 -1
- package/_cjs/chains/definitions/mode.js +2 -0
- package/_cjs/chains/definitions/mode.js.map +1 -1
- package/_cjs/chains/definitions/modeTestnet.js +2 -0
- package/_cjs/chains/definitions/modeTestnet.js.map +1 -1
- package/_cjs/chains/definitions/polygonAmoy.js +6 -0
- package/_cjs/chains/definitions/polygonAmoy.js.map +1 -1
- package/_cjs/chains/definitions/polygonZkEvmCardona.js +29 -0
- package/_cjs/chains/definitions/polygonZkEvmCardona.js.map +1 -0
- package/_cjs/chains/index.js +6 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/experimental/actions/{getCallsReceipt.js → getCallsStatus.js} +6 -6
- package/_cjs/experimental/actions/getCallsStatus.js.map +1 -0
- package/_cjs/experimental/actions/getCapabilities.js +9 -1
- package/_cjs/experimental/actions/getCapabilities.js.map +1 -1
- package/_cjs/experimental/actions/sendCalls.js +12 -10
- package/_cjs/experimental/actions/sendCalls.js.map +1 -1
- package/_cjs/experimental/actions/showCallsStatus.js +13 -0
- package/_cjs/experimental/actions/showCallsStatus.js.map +1 -0
- package/_cjs/experimental/decorators/eip5792.js +5 -3
- package/_cjs/experimental/decorators/eip5792.js.map +1 -1
- package/_cjs/experimental/index.js +5 -3
- package/_cjs/experimental/index.js.map +1 -1
- package/_esm/chains/definitions/dfk.js +6 -0
- package/_esm/chains/definitions/dfk.js.map +1 -1
- package/_esm/chains/definitions/mode.js +2 -0
- package/_esm/chains/definitions/mode.js.map +1 -1
- package/_esm/chains/definitions/modeTestnet.js +2 -0
- package/_esm/chains/definitions/modeTestnet.js.map +1 -1
- package/_esm/chains/definitions/polygonAmoy.js +6 -0
- package/_esm/chains/definitions/polygonAmoy.js.map +1 -1
- package/_esm/chains/definitions/polygonZkEvmCardona.js +26 -0
- package/_esm/chains/definitions/polygonZkEvmCardona.js.map +1 -0
- package/_esm/chains/index.js +3 -1
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/experimental/actions/{getCallsReceipt.js → getCallsStatus.js} +9 -9
- package/_esm/experimental/actions/getCallsStatus.js.map +1 -0
- package/_esm/experimental/actions/getCapabilities.js +9 -1
- package/_esm/experimental/actions/getCapabilities.js.map +1 -1
- package/_esm/experimental/actions/sendCalls.js +12 -10
- package/_esm/experimental/actions/sendCalls.js.map +1 -1
- package/_esm/experimental/actions/showCallsStatus.js +30 -0
- package/_esm/experimental/actions/showCallsStatus.js.map +1 -0
- package/_esm/experimental/decorators/eip5792.js +5 -3
- package/_esm/experimental/decorators/eip5792.js.map +1 -1
- package/_esm/experimental/index.js +2 -1
- package/_esm/experimental/index.js.map +1 -1
- package/_types/chains/definitions/dfk.d.ts +6 -8
- package/_types/chains/definitions/dfk.d.ts.map +1 -1
- package/_types/chains/definitions/mode.d.ts +1 -1
- package/_types/chains/definitions/mode.d.ts.map +1 -1
- package/_types/chains/definitions/modeTestnet.d.ts +1 -1
- package/_types/chains/definitions/modeTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/polygonAmoy.d.ts +6 -8
- package/_types/chains/definitions/polygonAmoy.d.ts.map +1 -1
- package/_types/chains/definitions/polygonZkEvmCardona.d.ts +34 -0
- package/_types/chains/definitions/polygonZkEvmCardona.d.ts.map +1 -0
- package/_types/chains/index.d.ts +3 -1
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/experimental/actions/getCallsStatus.d.ts +35 -0
- package/_types/experimental/actions/getCallsStatus.d.ts.map +1 -0
- package/_types/experimental/actions/getCapabilities.d.ts +9 -2
- package/_types/experimental/actions/getCapabilities.d.ts.map +1 -1
- package/_types/experimental/actions/sendCalls.d.ts +2 -2
- package/_types/experimental/actions/sendCalls.d.ts.map +1 -1
- package/_types/experimental/actions/showCallsStatus.d.ts +34 -0
- package/_types/experimental/actions/showCallsStatus.d.ts.map +1 -0
- package/_types/experimental/decorators/eip5792.d.ts +36 -10
- package/_types/experimental/decorators/eip5792.d.ts.map +1 -1
- package/_types/experimental/index.d.ts +2 -1
- package/_types/experimental/index.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +31 -17
- package/_types/types/eip1193.d.ts.map +1 -1
- package/chains/definitions/dfk.ts +6 -0
- package/chains/definitions/mode.ts +3 -0
- package/chains/definitions/modeTestnet.ts +3 -0
- package/chains/definitions/polygonAmoy.ts +6 -0
- package/chains/definitions/polygonZkEvmCardona.ts +26 -0
- package/chains/index.ts +3 -1
- package/errors/version.ts +1 -1
- package/experimental/actions/{getCallsReceipt.ts → getCallsStatus.ts} +15 -15
- package/experimental/actions/getCapabilities.ts +29 -3
- package/experimental/actions/sendCalls.ts +14 -12
- package/experimental/actions/showCallsStatus.ts +48 -0
- package/experimental/decorators/eip5792.ts +55 -16
- package/experimental/index.ts +11 -5
- package/index.ts +1 -1
- package/package.json +1 -1
- package/types/eip1193.ts +31 -17
- package/_cjs/experimental/actions/getCallsReceipt.js.map +0 -1
- package/_esm/experimental/actions/getCallsReceipt.js.map +0 -1
- package/_types/experimental/actions/getCallsReceipt.d.ts +0 -35
- package/_types/experimental/actions/getCallsReceipt.d.ts.map +0 -1
@@ -1,15 +1,24 @@
|
|
1
1
|
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
|
+
import { AccountNotFoundError } from '../../errors/account.js'
|
3
4
|
import type { ErrorType } from '../../errors/utils.js'
|
4
|
-
import type {
|
5
|
+
import type {
|
6
|
+
GetAccountParameter,
|
7
|
+
JsonRpcAccount,
|
8
|
+
} from '../../types/account.js'
|
5
9
|
import type { Chain } from '../../types/chain.js'
|
6
10
|
import type {
|
7
11
|
WalletCapabilities,
|
8
12
|
WalletCapabilitiesRecord,
|
9
13
|
} from '../../types/eip1193.js'
|
10
14
|
import type { Prettify } from '../../types/utils.js'
|
15
|
+
import { parseAccount } from '../../utils/accounts.js'
|
11
16
|
import type { RequestErrorType } from '../../utils/buildRequest.js'
|
12
17
|
|
18
|
+
export type GetCapabilitiesParameters<
|
19
|
+
account extends JsonRpcAccount | undefined = JsonRpcAccount | undefined,
|
20
|
+
> = GetAccountParameter<account>
|
21
|
+
|
13
22
|
export type GetCapabilitiesReturnType = Prettify<
|
14
23
|
WalletCapabilitiesRecord<WalletCapabilities, number>
|
15
24
|
>
|
@@ -38,12 +47,29 @@ export type GetCapabilitiesErrorType = RequestErrorType | ErrorType
|
|
38
47
|
*/
|
39
48
|
export async function getCapabilities<
|
40
49
|
chain extends Chain | undefined,
|
41
|
-
account extends
|
50
|
+
account extends JsonRpcAccount | undefined = undefined,
|
42
51
|
>(
|
43
|
-
|
52
|
+
...parameters: account extends JsonRpcAccount
|
53
|
+
?
|
54
|
+
| [client: Client<Transport, chain, account>]
|
55
|
+
| [
|
56
|
+
client: Client<Transport, chain, account>,
|
57
|
+
parameters: GetCapabilitiesParameters<account>,
|
58
|
+
]
|
59
|
+
: [
|
60
|
+
client: Client<Transport, chain, account>,
|
61
|
+
parameters: GetCapabilitiesParameters<account>,
|
62
|
+
]
|
44
63
|
): Promise<GetCapabilitiesReturnType> {
|
64
|
+
const [client, args] = parameters
|
65
|
+
const account_raw = args?.account ?? client.account
|
66
|
+
|
67
|
+
if (!account_raw) throw new AccountNotFoundError()
|
68
|
+
const account = parseAccount(account_raw)
|
69
|
+
|
45
70
|
const capabilities_raw = await client.request({
|
46
71
|
method: 'wallet_getCapabilities',
|
72
|
+
params: [account.address],
|
47
73
|
})
|
48
74
|
|
49
75
|
const capabilities = {} as WalletCapabilitiesRecord<
|
@@ -33,9 +33,9 @@ export type SendCallsParameters<
|
|
33
33
|
}
|
34
34
|
>[]
|
35
35
|
capabilities?:
|
36
|
-
| WalletSendCallsParameters<WalletCapabilities>['capabilities']
|
36
|
+
| WalletSendCallsParameters<WalletCapabilities>[number]['capabilities']
|
37
37
|
| undefined
|
38
|
-
version?: WalletSendCallsParameters['version'] | undefined
|
38
|
+
version?: WalletSendCallsParameters[number]['version'] | undefined
|
39
39
|
} & GetAccountParameter<account> &
|
40
40
|
GetChainParameter<chain, chainOverride>
|
41
41
|
|
@@ -103,16 +103,18 @@ export async function sendCalls<
|
|
103
103
|
return await client.request(
|
104
104
|
{
|
105
105
|
method: 'wallet_sendCalls',
|
106
|
-
params:
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
106
|
+
params: [
|
107
|
+
{
|
108
|
+
calls: calls.map((call) => ({
|
109
|
+
...call,
|
110
|
+
value: call.value ? numberToHex(call.value) : undefined,
|
111
|
+
})) as any,
|
112
|
+
capabilities,
|
113
|
+
chainId: numberToHex(chain!.id),
|
114
|
+
from: account.address,
|
115
|
+
version,
|
116
|
+
},
|
117
|
+
],
|
116
118
|
},
|
117
119
|
{ retryCount: 0 },
|
118
120
|
)
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
|
+
import type { ErrorType } from '../../errors/utils.js'
|
4
|
+
import type { Account } from '../../types/account.js'
|
5
|
+
import type { Chain } from '../../types/chain.js'
|
6
|
+
import type { RequestErrorType } from '../../utils/buildRequest.js'
|
7
|
+
|
8
|
+
export type ShowCallsStatusParameters = { id: string }
|
9
|
+
|
10
|
+
export type ShowCallsStatusReturnType = void
|
11
|
+
|
12
|
+
export type ShowCallsStatusErrorType = RequestErrorType | ErrorType
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Requests for the wallet to show information about a call batch
|
16
|
+
* that was sent via `sendCalls`.
|
17
|
+
*
|
18
|
+
* - Docs: https://viem.sh/experimental/actions/showCallsStatus
|
19
|
+
* - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)
|
20
|
+
*
|
21
|
+
* @param client - Client to use
|
22
|
+
* @returns Status of the calls. {@link ShowCallsStatusReturnType}
|
23
|
+
*
|
24
|
+
* @example
|
25
|
+
* import { createWalletClient, custom } from 'viem'
|
26
|
+
* import { mainnet } from 'viem/chains'
|
27
|
+
* import { showCallsStatus } from 'viem/wallet'
|
28
|
+
*
|
29
|
+
* const client = createWalletClient({
|
30
|
+
* chain: mainnet,
|
31
|
+
* transport: custom(window.ethereum),
|
32
|
+
* })
|
33
|
+
* await showCallsStatus(client, { id: '0xdeadbeef' })
|
34
|
+
*/
|
35
|
+
export async function showCallsStatus<
|
36
|
+
chain extends Chain | undefined,
|
37
|
+
account extends Account | undefined = undefined,
|
38
|
+
>(
|
39
|
+
client: Client<Transport, chain, account>,
|
40
|
+
parameters: ShowCallsStatusParameters,
|
41
|
+
): Promise<ShowCallsStatusReturnType> {
|
42
|
+
const { id } = parameters
|
43
|
+
await client.request({
|
44
|
+
method: 'wallet_showCallsStatus',
|
45
|
+
params: [id],
|
46
|
+
})
|
47
|
+
return
|
48
|
+
}
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
|
-
import type { Account } from '../../types/account.js'
|
3
|
+
import type { Account, JsonRpcAccount } from '../../types/account.js'
|
4
4
|
import type { Chain } from '../../types/chain.js'
|
5
5
|
import {
|
6
|
-
type
|
7
|
-
type
|
8
|
-
|
9
|
-
} from '../actions/
|
6
|
+
type GetCallsStatusParameters,
|
7
|
+
type GetCallsStatusReturnType,
|
8
|
+
getCallsStatus,
|
9
|
+
} from '../actions/getCallsStatus.js'
|
10
10
|
import {
|
11
|
+
type GetCapabilitiesParameters,
|
11
12
|
type GetCapabilitiesReturnType,
|
12
13
|
getCapabilities,
|
13
14
|
} from '../actions/getCapabilities.js'
|
@@ -16,6 +17,11 @@ import {
|
|
16
17
|
type SendCallsReturnType,
|
17
18
|
sendCalls,
|
18
19
|
} from '../actions/sendCalls.js'
|
20
|
+
import {
|
21
|
+
type ShowCallsStatusParameters,
|
22
|
+
type ShowCallsStatusReturnType,
|
23
|
+
showCallsStatus,
|
24
|
+
} from '../actions/showCallsStatus.js'
|
19
25
|
import {
|
20
26
|
type WriteContractsParameters,
|
21
27
|
type WriteContractsReturnType,
|
@@ -29,11 +35,11 @@ export type WalletActionsEip5792<
|
|
29
35
|
/**
|
30
36
|
* Returns the status of a call batch that was sent via `sendCalls`.
|
31
37
|
*
|
32
|
-
* - Docs: https://viem.sh/experimental/actions/
|
33
|
-
* - JSON-RPC Methods: [`
|
38
|
+
* - Docs: https://viem.sh/experimental/actions/getCallsStatus
|
39
|
+
* - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)
|
34
40
|
*
|
35
41
|
* @param client - Client to use
|
36
|
-
* @returns Status of the calls. {@link
|
42
|
+
* @returns Status of the calls. {@link GetCallsStatusReturnType}
|
37
43
|
*
|
38
44
|
* @example
|
39
45
|
* import { createWalletClient, custom } from 'viem'
|
@@ -45,11 +51,11 @@ export type WalletActionsEip5792<
|
|
45
51
|
* transport: custom(window.ethereum),
|
46
52
|
* }).extend(walletActionsEip5792())
|
47
53
|
*
|
48
|
-
* const { receipts, status } = await client.
|
54
|
+
* const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })
|
49
55
|
*/
|
50
|
-
|
51
|
-
parameters:
|
52
|
-
) => Promise<
|
56
|
+
getCallsStatus: (
|
57
|
+
parameters: GetCallsStatusParameters,
|
58
|
+
) => Promise<GetCallsStatusReturnType>
|
53
59
|
/**
|
54
60
|
* Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc).
|
55
61
|
*
|
@@ -69,9 +75,15 @@ export type WalletActionsEip5792<
|
|
69
75
|
* transport: custom(window.ethereum),
|
70
76
|
* }).extend(walletActionsEip5792())
|
71
77
|
*
|
72
|
-
* const capabilities = await client.getCapabilities(
|
78
|
+
* const capabilities = await client.getCapabilities({
|
79
|
+
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
80
|
+
* })
|
73
81
|
*/
|
74
|
-
getCapabilities: (
|
82
|
+
getCapabilities: (
|
83
|
+
...parameters: account extends JsonRpcAccount
|
84
|
+
? [] | [parameters: GetCapabilitiesParameters<account>]
|
85
|
+
: [parameters: GetCapabilitiesParameters<undefined>]
|
86
|
+
) => Promise<GetCapabilitiesReturnType>
|
75
87
|
/**
|
76
88
|
* Requests the connected wallet to send a batch of calls.
|
77
89
|
*
|
@@ -108,6 +120,31 @@ export type WalletActionsEip5792<
|
|
108
120
|
sendCalls: <chainOverride extends Chain | undefined = undefined>(
|
109
121
|
parameters: SendCallsParameters<chain, account, chainOverride>,
|
110
122
|
) => Promise<SendCallsReturnType>
|
123
|
+
/**
|
124
|
+
* Requests for the wallet to show information about a call batch
|
125
|
+
* that was sent via `sendCalls`.
|
126
|
+
*
|
127
|
+
* - Docs: https://viem.sh/experimental/actions/showCallsStatus
|
128
|
+
* - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)
|
129
|
+
*
|
130
|
+
* @param client - Client to use
|
131
|
+
* @returns Displays status of the calls in wallet. {@link ShowCallsStatusReturnType}
|
132
|
+
*
|
133
|
+
* @example
|
134
|
+
* import { createWalletClient, custom } from 'viem'
|
135
|
+
* import { mainnet } from 'viem/chains'
|
136
|
+
* import { walletActionsEip5792 } from 'viem/experimental'
|
137
|
+
*
|
138
|
+
* const client = createWalletClient({
|
139
|
+
* chain: mainnet,
|
140
|
+
* transport: custom(window.ethereum),
|
141
|
+
* }).extend(walletActionsEip5792())
|
142
|
+
*
|
143
|
+
* await client.showCallsStatus({ id: '0xdeadbeef' })
|
144
|
+
*/
|
145
|
+
showCallsStatus: (
|
146
|
+
parameters: ShowCallsStatusParameters,
|
147
|
+
) => Promise<ShowCallsStatusReturnType>
|
111
148
|
/**
|
112
149
|
* Requests for the wallet to sign and broadcast a batch of write contract calls (transactions) to the network.
|
113
150
|
*
|
@@ -191,9 +228,11 @@ export function walletActionsEip5792() {
|
|
191
228
|
client: Client<transport, chain, account>,
|
192
229
|
): WalletActionsEip5792<chain, account> => {
|
193
230
|
return {
|
194
|
-
|
195
|
-
getCapabilities: () =>
|
231
|
+
getCallsStatus: (parameters) => getCallsStatus(client, parameters),
|
232
|
+
getCapabilities: ((parameters: any) =>
|
233
|
+
getCapabilities(client as any, parameters)) as any,
|
196
234
|
sendCalls: (parameters) => sendCalls(client, parameters),
|
235
|
+
showCallsStatus: (parameters) => showCallsStatus(client, parameters),
|
197
236
|
writeContracts: (parameters) => writeContracts(client, parameters),
|
198
237
|
}
|
199
238
|
}
|
package/experimental/index.ts
CHANGED
@@ -10,11 +10,17 @@ export {
|
|
10
10
|
sendCalls,
|
11
11
|
} from './actions/sendCalls.js'
|
12
12
|
export {
|
13
|
-
type
|
14
|
-
type
|
15
|
-
type
|
16
|
-
|
17
|
-
} from './actions/
|
13
|
+
type GetCallsStatusErrorType,
|
14
|
+
type GetCallsStatusParameters,
|
15
|
+
type GetCallsStatusReturnType,
|
16
|
+
getCallsStatus,
|
17
|
+
} from './actions/getCallsStatus.js'
|
18
|
+
export {
|
19
|
+
type ShowCallsStatusErrorType,
|
20
|
+
type ShowCallsStatusParameters,
|
21
|
+
type ShowCallsStatusReturnType,
|
22
|
+
showCallsStatus,
|
23
|
+
} from './actions/showCallsStatus.js'
|
18
24
|
export {
|
19
25
|
type WriteContractsErrorType,
|
20
26
|
type WriteContractsParameters,
|
package/index.ts
CHANGED
@@ -1002,7 +1002,7 @@ export type {
|
|
1002
1002
|
WalletCapabilities,
|
1003
1003
|
WalletCapabilitiesRecord,
|
1004
1004
|
WalletCallReceipt,
|
1005
|
-
|
1005
|
+
WalletGetCallsStatusReturnType,
|
1006
1006
|
WalletSendCallsParameters,
|
1007
1007
|
WalletPermissionCaveat,
|
1008
1008
|
WalletPermission,
|
package/package.json
CHANGED
package/types/eip1193.ts
CHANGED
@@ -131,7 +131,7 @@ export type WalletCallReceipt<quantity = Hex, status = Hex> = {
|
|
131
131
|
transactionHash: Hex
|
132
132
|
}
|
133
133
|
|
134
|
-
export type
|
134
|
+
export type WalletGetCallsStatusReturnType<quantity = Hex, status = Hex> = {
|
135
135
|
status: 'PENDING' | 'CONFIRMED'
|
136
136
|
receipts?: WalletCallReceipt<quantity, status>[] | undefined
|
137
137
|
}
|
@@ -153,17 +153,19 @@ export type WalletSendCallsParameters<
|
|
153
153
|
capabilities extends WalletCapabilities = WalletCapabilities,
|
154
154
|
chainId extends Hex | number = Hex,
|
155
155
|
quantity extends Quantity | bigint = Quantity,
|
156
|
-
> =
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
156
|
+
> = [
|
157
|
+
{
|
158
|
+
version: string
|
159
|
+
chainId: chainId
|
160
|
+
from: Address
|
161
|
+
calls: {
|
162
|
+
to: Address
|
163
|
+
data: Hex
|
164
|
+
value: quantity
|
165
|
+
}[]
|
166
|
+
capabilities?: capabilities | undefined
|
167
|
+
},
|
168
|
+
]
|
167
169
|
|
168
170
|
export type WatchAssetParams = {
|
169
171
|
/** Token type. */
|
@@ -1319,13 +1321,13 @@ export type WalletRpcSchema = [
|
|
1319
1321
|
* @description Returns the status of a call batch that was sent via `wallet_sendCalls`.
|
1320
1322
|
* @link https://eips.ethereum.org/EIPS/eip-5792
|
1321
1323
|
* @example
|
1322
|
-
* provider.request({ method: '
|
1324
|
+
* provider.request({ method: 'wallet_getCallsStatus' })
|
1323
1325
|
* // => { ... }
|
1324
1326
|
*/
|
1325
1327
|
{
|
1326
|
-
Method: '
|
1327
|
-
Parameters?: string
|
1328
|
-
ReturnType:
|
1328
|
+
Method: 'wallet_getCallsStatus'
|
1329
|
+
Parameters?: [string]
|
1330
|
+
ReturnType: WalletGetCallsStatusReturnType
|
1329
1331
|
},
|
1330
1332
|
/**
|
1331
1333
|
* @description Gets the connected wallet's capabilities.
|
@@ -1336,7 +1338,7 @@ export type WalletRpcSchema = [
|
|
1336
1338
|
*/
|
1337
1339
|
{
|
1338
1340
|
Method: 'wallet_getCapabilities'
|
1339
|
-
Parameters?:
|
1341
|
+
Parameters?: [Address]
|
1340
1342
|
ReturnType: Prettify<WalletCapabilitiesRecord>
|
1341
1343
|
},
|
1342
1344
|
/**
|
@@ -1375,6 +1377,18 @@ export type WalletRpcSchema = [
|
|
1375
1377
|
Parameters?: WalletSendCallsParameters
|
1376
1378
|
ReturnType: string
|
1377
1379
|
},
|
1380
|
+
/**
|
1381
|
+
* @description Requests for the wallet to show information about a call batch
|
1382
|
+
* that was sent via `wallet_sendCalls`.
|
1383
|
+
* @link https://eips.ethereum.org/EIPS/eip-5792
|
1384
|
+
* @example
|
1385
|
+
* provider.request({ method: 'wallet_showCallsStatus', params: ['...'] })
|
1386
|
+
*/
|
1387
|
+
{
|
1388
|
+
Method: 'wallet_showCallsStatus'
|
1389
|
+
Parameters?: [string]
|
1390
|
+
ReturnType: void
|
1391
|
+
},
|
1378
1392
|
/**
|
1379
1393
|
* @description Switch the wallet to the given Ethereum chain.
|
1380
1394
|
* @link https://eips.ethereum.org/EIPS/eip-3326
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getCallsReceipt.js","sourceRoot":"","sources":["../../../experimental/actions/getCallsReceipt.ts"],"names":[],"mappings":";;;AAQA,gEAA6D;AAC7D,wFAA8E;AA8BvE,KAAK,UAAU,eAAe,CAInC,MAAyC,EACzC,UAAqC;IAErC,MAAM,EAAE,EAAE,EAAE,GAAG,UAAU,CAAA;IACzB,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAChD,MAAM,EAAE,wBAAwB;QAChC,MAAM,EAAE,EAAE;KACX,CAAC,CAAA;IACF,OAAO;QACL,MAAM;QACN,QAAQ,EACN,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC1B,GAAG,OAAO;YACV,WAAW,EAAE,IAAA,wBAAW,EAAC,OAAO,CAAC,WAAW,CAAC;YAC7C,OAAO,EAAE,IAAA,wBAAW,EAAC,OAAO,CAAC,OAAO,CAAC;YACrC,MAAM,EAAE,uCAAe,CAAC,OAAO,CAAC,MAAuB,CAAC;SACzD,CAAC,CAAC,IAAI,EAAE;KACZ,CAAA;AACH,CAAC;AAtBD,0CAsBC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getCallsReceipt.js","sourceRoot":"","sources":["../../../experimental/actions/getCallsReceipt.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAA;AAU9E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAInC,MAAyC,EACzC,UAAqC;IAErC,MAAM,EAAE,EAAE,EAAE,GAAG,UAAU,CAAA;IACzB,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAChD,MAAM,EAAE,wBAAwB;QAChC,MAAM,EAAE,EAAE;KACX,CAAC,CAAA;IACF,OAAO;QACL,MAAM;QACN,QAAQ,EACN,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC1B,GAAG,OAAO;YACV,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC;YAC7C,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;YACrC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,MAAuB,CAAC;SACzD,CAAC,CAAC,IAAI,EAAE;KACZ,CAAA;AACH,CAAC"}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import type { Client } from '../../clients/createClient.js';
|
2
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
-
import type { ErrorType } from '../../errors/utils.js';
|
4
|
-
import type { Account } from '../../types/account.js';
|
5
|
-
import type { Chain } from '../../types/chain.js';
|
6
|
-
import type { WalletGetCallsReceiptReturnType } from '../../types/eip1193.js';
|
7
|
-
import type { Prettify } from '../../types/utils.js';
|
8
|
-
import type { RequestErrorType } from '../../utils/buildRequest.js';
|
9
|
-
export type GetCallsReceiptParameters = {
|
10
|
-
id: string;
|
11
|
-
};
|
12
|
-
export type GetCallsReceiptReturnType = Prettify<WalletGetCallsReceiptReturnType<bigint, 'success' | 'reverted'>>;
|
13
|
-
export type GetCallsReceiptErrorType = RequestErrorType | ErrorType;
|
14
|
-
/**
|
15
|
-
* Returns the status of a call batch that was sent via `sendCalls`.
|
16
|
-
*
|
17
|
-
* - Docs: https://viem.sh/experimental/actions/getCallsReceipt
|
18
|
-
* - JSON-RPC Methods: [`wallet_getCallsReceipt`](https://eips.ethereum.org/EIPS/eip-5792)
|
19
|
-
*
|
20
|
-
* @param client - Client to use
|
21
|
-
* @returns Status of the calls. {@link GetCallsReceiptReturnType}
|
22
|
-
*
|
23
|
-
* @example
|
24
|
-
* import { createWalletClient, custom } from 'viem'
|
25
|
-
* import { mainnet } from 'viem/chains'
|
26
|
-
* import { getCallsReceipt } from 'viem/wallet'
|
27
|
-
*
|
28
|
-
* const client = createWalletClient({
|
29
|
-
* chain: mainnet,
|
30
|
-
* transport: custom(window.ethereum),
|
31
|
-
* })
|
32
|
-
* const { receipts, status } = await getCallsReceipt(client, { id: '0xdeadbeef' })
|
33
|
-
*/
|
34
|
-
export declare function getCallsReceipt<chain extends Chain | undefined, account extends Account | undefined = undefined>(client: Client<Transport, chain, account>, parameters: GetCallsReceiptParameters): Promise<GetCallsReceiptReturnType>;
|
35
|
-
//# sourceMappingURL=getCallsReceipt.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getCallsReceipt.d.ts","sourceRoot":"","sources":["../../../experimental/actions/getCallsReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInE,MAAM,MAAM,yBAAyB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAC9C,+BAA+B,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC,CAChE,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG,SAAS,CAAA;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,eAAe,CACnC,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAE/C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,EACzC,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,yBAAyB,CAAC,CAgBpC"}
|