@rango-dev/wallets-core 0.38.0 → 0.38.1-next.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.
Files changed (201) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/builders/action.d.ts +22 -0
  3. package/dist/builders/action.d.ts.map +1 -0
  4. package/dist/builders/mod.d.ts +5 -0
  5. package/dist/builders/mod.d.ts.map +1 -0
  6. package/dist/builders/namespace.d.ts +47 -0
  7. package/dist/builders/namespace.d.ts.map +1 -0
  8. package/dist/builders/provider.d.ts +13 -0
  9. package/dist/builders/provider.d.ts.map +1 -0
  10. package/dist/builders/types.d.ts +21 -0
  11. package/dist/builders/types.d.ts.map +1 -0
  12. package/dist/hub/helpers.d.ts +6 -0
  13. package/dist/hub/helpers.d.ts.map +1 -0
  14. package/dist/hub/hub.d.ts +28 -0
  15. package/dist/hub/hub.d.ts.map +1 -0
  16. package/dist/hub/mod.d.ts +7 -0
  17. package/dist/hub/mod.d.ts.map +1 -0
  18. package/dist/hub/namespaces/errors.d.ts +4 -0
  19. package/dist/hub/namespaces/errors.d.ts.map +1 -0
  20. package/dist/hub/namespaces/mod.d.ts +3 -0
  21. package/dist/hub/namespaces/mod.d.ts.map +1 -0
  22. package/dist/hub/namespaces/namespace.d.ts +146 -0
  23. package/dist/hub/namespaces/namespace.d.ts.map +1 -0
  24. package/dist/hub/namespaces/namespace.test.d.ts +2 -0
  25. package/dist/hub/namespaces/namespace.test.d.ts.map +1 -0
  26. package/dist/hub/namespaces/types.d.ts +33 -0
  27. package/dist/hub/namespaces/types.d.ts.map +1 -0
  28. package/dist/hub/provider/mod.d.ts +3 -0
  29. package/dist/hub/provider/mod.d.ts.map +1 -0
  30. package/dist/hub/provider/provider.d.ts +136 -0
  31. package/dist/hub/provider/provider.d.ts.map +1 -0
  32. package/dist/hub/provider/provider.test.d.ts +2 -0
  33. package/dist/hub/provider/provider.test.d.ts.map +1 -0
  34. package/dist/hub/provider/types.d.ts +28 -0
  35. package/dist/hub/provider/types.d.ts.map +1 -0
  36. package/dist/hub/store/hub.d.ts +11 -0
  37. package/dist/hub/store/hub.d.ts.map +1 -0
  38. package/dist/hub/store/mod.d.ts +6 -0
  39. package/dist/hub/store/mod.d.ts.map +1 -0
  40. package/dist/hub/store/namespaces.d.ts +34 -0
  41. package/dist/hub/store/namespaces.d.ts.map +1 -0
  42. package/dist/hub/store/providers.d.ts +45 -0
  43. package/dist/hub/store/providers.d.ts.map +1 -0
  44. package/dist/hub/store/selectors.d.ts +18 -0
  45. package/dist/hub/store/selectors.d.ts.map +1 -0
  46. package/dist/hub/store/store.d.ts +13 -0
  47. package/dist/hub/store/store.d.ts.map +1 -0
  48. package/dist/hub/store/store.test.d.ts +2 -0
  49. package/dist/hub/store/store.test.d.ts.map +1 -0
  50. package/dist/legacy/mod.js +1 -1
  51. package/dist/legacy/mod.js.map +2 -2
  52. package/dist/legacy/types.d.ts +1 -1
  53. package/dist/legacy/types.d.ts.map +1 -1
  54. package/dist/legacy/wallet.d.ts +1 -1
  55. package/dist/legacy/wallet.d.ts.map +1 -1
  56. package/dist/mod.d.ts +6 -1
  57. package/dist/mod.d.ts.map +1 -1
  58. package/dist/mod.js +1 -0
  59. package/dist/mod.js.map +4 -4
  60. package/dist/namespaces/common/actions.d.ts +4 -0
  61. package/dist/namespaces/common/actions.d.ts.map +1 -0
  62. package/dist/namespaces/common/after.d.ts +4 -0
  63. package/dist/namespaces/common/after.d.ts.map +1 -0
  64. package/dist/namespaces/common/and.d.ts +6 -0
  65. package/dist/namespaces/common/and.d.ts.map +1 -0
  66. package/dist/namespaces/common/before.d.ts +4 -0
  67. package/dist/namespaces/common/before.d.ts.map +1 -0
  68. package/dist/namespaces/common/builders.d.ts +4 -0
  69. package/dist/namespaces/common/builders.d.ts.map +1 -0
  70. package/dist/namespaces/common/helpers.d.ts +2 -0
  71. package/dist/namespaces/common/helpers.d.ts.map +1 -0
  72. package/dist/namespaces/common/mod.d.ts +6 -0
  73. package/dist/namespaces/common/mod.d.ts.map +1 -0
  74. package/dist/namespaces/common/mod.js +2 -0
  75. package/dist/namespaces/common/mod.js.map +7 -0
  76. package/dist/namespaces/common/types.d.ts +7 -0
  77. package/dist/namespaces/common/types.d.ts.map +1 -0
  78. package/dist/namespaces/cosmos/mod.d.ts +2 -0
  79. package/dist/namespaces/cosmos/mod.d.ts.map +1 -0
  80. package/dist/namespaces/cosmos/types.d.ts +4 -0
  81. package/dist/namespaces/cosmos/types.d.ts.map +1 -0
  82. package/dist/namespaces/evm/actions.d.ts +8 -0
  83. package/dist/namespaces/evm/actions.d.ts.map +1 -0
  84. package/dist/namespaces/evm/after.d.ts +2 -0
  85. package/dist/namespaces/evm/after.d.ts.map +1 -0
  86. package/dist/namespaces/evm/and.d.ts +3 -0
  87. package/dist/namespaces/evm/and.d.ts.map +1 -0
  88. package/dist/namespaces/evm/before.d.ts +2 -0
  89. package/dist/namespaces/evm/before.d.ts.map +1 -0
  90. package/dist/namespaces/evm/builders.d.ts +4 -0
  91. package/dist/namespaces/evm/builders.d.ts.map +1 -0
  92. package/dist/namespaces/evm/constants.d.ts +3 -0
  93. package/dist/namespaces/evm/constants.d.ts.map +1 -0
  94. package/dist/namespaces/evm/eip1193.d.ts +1228 -0
  95. package/dist/namespaces/evm/eip1193.d.ts.map +1 -0
  96. package/dist/namespaces/evm/mod.d.ts +9 -0
  97. package/dist/namespaces/evm/mod.d.ts.map +1 -0
  98. package/dist/namespaces/evm/mod.js +2 -0
  99. package/dist/namespaces/evm/mod.js.map +7 -0
  100. package/dist/namespaces/evm/types.d.ts +10 -0
  101. package/dist/namespaces/evm/types.d.ts.map +1 -0
  102. package/dist/namespaces/evm/utils.d.ts +9 -0
  103. package/dist/namespaces/evm/utils.d.ts.map +1 -0
  104. package/dist/namespaces/solana/actions.d.ts +6 -0
  105. package/dist/namespaces/solana/actions.d.ts.map +1 -0
  106. package/dist/namespaces/solana/after.d.ts +2 -0
  107. package/dist/namespaces/solana/after.d.ts.map +1 -0
  108. package/dist/namespaces/solana/and.d.ts +3 -0
  109. package/dist/namespaces/solana/and.d.ts.map +1 -0
  110. package/dist/namespaces/solana/before.d.ts +2 -0
  111. package/dist/namespaces/solana/before.d.ts.map +1 -0
  112. package/dist/namespaces/solana/builders.d.ts +4 -0
  113. package/dist/namespaces/solana/builders.d.ts.map +1 -0
  114. package/dist/namespaces/solana/constants.d.ts +3 -0
  115. package/dist/namespaces/solana/constants.d.ts.map +1 -0
  116. package/dist/namespaces/solana/mod.d.ts +8 -0
  117. package/dist/namespaces/solana/mod.d.ts.map +1 -0
  118. package/dist/namespaces/solana/mod.js +2 -0
  119. package/dist/namespaces/solana/mod.js.map +7 -0
  120. package/dist/namespaces/solana/types.d.ts +7 -0
  121. package/dist/namespaces/solana/types.d.ts.map +1 -0
  122. package/dist/test-utils/fixtures.d.ts +3 -0
  123. package/dist/test-utils/fixtures.d.ts.map +1 -0
  124. package/dist/types/accounts.d.ts +11 -0
  125. package/dist/types/accounts.d.ts.map +1 -0
  126. package/dist/types/actions.d.ts +5 -0
  127. package/dist/types/actions.d.ts.map +1 -0
  128. package/dist/types/utils.d.ts +7 -0
  129. package/dist/types/utils.d.ts.map +1 -0
  130. package/dist/utils/mod.d.ts +4 -0
  131. package/dist/utils/mod.d.ts.map +1 -0
  132. package/dist/utils/mod.js +2 -0
  133. package/dist/utils/mod.js.map +7 -0
  134. package/dist/utils/versions.d.ts +21 -0
  135. package/dist/utils/versions.d.ts.map +1 -0
  136. package/dist/utils/versions.test.d.ts +2 -0
  137. package/dist/utils/versions.test.d.ts.map +1 -0
  138. package/dist/wallets-core.build.json +1 -1
  139. package/package.json +25 -4
  140. package/src/builders/action.ts +86 -0
  141. package/src/builders/mod.ts +5 -0
  142. package/src/builders/namespace.ts +229 -0
  143. package/src/builders/provider.ts +61 -0
  144. package/src/builders/types.ts +29 -0
  145. package/src/hub/helpers.ts +11 -0
  146. package/src/hub/hub.ts +122 -0
  147. package/src/hub/mod.ts +10 -0
  148. package/src/hub/namespaces/errors.ts +8 -0
  149. package/src/hub/namespaces/mod.ts +9 -0
  150. package/src/hub/namespaces/namespace.test.ts +333 -0
  151. package/src/hub/namespaces/namespace.ts +443 -0
  152. package/src/hub/namespaces/types.ts +50 -0
  153. package/src/hub/provider/mod.ts +9 -0
  154. package/src/hub/provider/provider.test.ts +231 -0
  155. package/src/hub/provider/provider.ts +330 -0
  156. package/src/hub/provider/types.ts +37 -0
  157. package/src/hub/store/hub.ts +18 -0
  158. package/src/hub/store/mod.ts +8 -0
  159. package/src/hub/store/namespaces.ts +90 -0
  160. package/src/hub/store/providers.ts +97 -0
  161. package/src/hub/store/selectors.ts +59 -0
  162. package/src/hub/store/store.test.ts +32 -0
  163. package/src/hub/store/store.ts +26 -0
  164. package/src/legacy/types.ts +1 -1
  165. package/src/legacy/wallet.ts +2 -2
  166. package/src/mod.ts +35 -1
  167. package/src/namespaces/common/actions.ts +11 -0
  168. package/src/namespaces/common/after.ts +8 -0
  169. package/src/namespaces/common/and.ts +42 -0
  170. package/src/namespaces/common/before.ts +9 -0
  171. package/src/namespaces/common/builders.ts +19 -0
  172. package/src/namespaces/common/helpers.ts +10 -0
  173. package/src/namespaces/common/mod.ts +12 -0
  174. package/src/namespaces/common/types.ts +7 -0
  175. package/src/namespaces/cosmos/mod.ts +1 -0
  176. package/src/namespaces/cosmos/types.ts +10 -0
  177. package/src/namespaces/evm/actions.ts +97 -0
  178. package/src/namespaces/evm/after.ts +3 -0
  179. package/src/namespaces/evm/and.ts +5 -0
  180. package/src/namespaces/evm/before.ts +3 -0
  181. package/src/namespaces/evm/builders.ts +10 -0
  182. package/src/namespaces/evm/constants.ts +2 -0
  183. package/src/namespaces/evm/eip1193.ts +1414 -0
  184. package/src/namespaces/evm/mod.ts +9 -0
  185. package/src/namespaces/evm/types.ts +18 -0
  186. package/src/namespaces/evm/utils.ts +52 -0
  187. package/src/namespaces/solana/actions.ts +70 -0
  188. package/src/namespaces/solana/after.ts +3 -0
  189. package/src/namespaces/solana/and.ts +5 -0
  190. package/src/namespaces/solana/before.ts +3 -0
  191. package/src/namespaces/solana/builders.ts +10 -0
  192. package/src/namespaces/solana/constants.ts +2 -0
  193. package/src/namespaces/solana/mod.ts +8 -0
  194. package/src/namespaces/solana/types.ts +20 -0
  195. package/src/test-utils/fixtures.ts +9 -0
  196. package/src/types/accounts.ts +12 -0
  197. package/src/types/actions.ts +11 -0
  198. package/src/types/utils.ts +7 -0
  199. package/src/utils/mod.ts +8 -0
  200. package/src/utils/versions.test.ts +22 -0
  201. package/src/utils/versions.ts +63 -0
@@ -0,0 +1,1228 @@
1
+ type Block = any;
2
+ type Log = any;
3
+ type TransactionRequest = any;
4
+ type BlockNumber = any;
5
+ type BlockTag = any;
6
+ type BlockIdentifier = any;
7
+ type RpcStateOverride = any;
8
+ type FeeHistory = any;
9
+ type Proof = any;
10
+ type Transaction = any;
11
+ type TransactionReceipt = any;
12
+ type LogTopic = any;
13
+ type Uncle = any;
14
+ type RpcUserOperation<_ = any> = any;
15
+ type RpcEstimateUserOperationGasReturnType = any;
16
+ type RpcGetUserOperationByHashReturnType = any;
17
+ type RpcUserOperationReceipt = any;
18
+ type KeyofUnion<type> = type extends type ? keyof type : never;
19
+ export type OneOf<union extends object, fallback extends object | undefined = undefined, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends infer item ? Prettify<item & {
20
+ [key in Exclude<keys, keyof item>]?: fallback extends object ? key extends keyof fallback ? fallback[key] : undefined : undefined;
21
+ }> : never;
22
+ export type AddEthereumChainParameter = {
23
+ /** A 0x-prefixed hexadecimal string */
24
+ chainId: string;
25
+ /** The chain name. */
26
+ chainName: string;
27
+ /** Native currency for the chain. */
28
+ nativeCurrency?: {
29
+ name: string;
30
+ symbol: string;
31
+ decimals: number;
32
+ } | undefined;
33
+ rpcUrls: readonly string[];
34
+ blockExplorerUrls?: string[] | undefined;
35
+ iconUrls?: string[] | undefined;
36
+ };
37
+ export type NetworkSync = {
38
+ /** The current block number */
39
+ currentBlock: Quantity;
40
+ /** Number of latest block on the network */
41
+ highestBlock: Quantity;
42
+ /** Block number at which syncing started */
43
+ startingBlock: Quantity;
44
+ };
45
+ export type WalletCapabilities = {
46
+ [capability: string]: any;
47
+ };
48
+ export type WalletCapabilitiesRecord<capabilities extends WalletCapabilities = WalletCapabilities, id extends string | number = Hex> = {
49
+ [chainId in id]: capabilities;
50
+ };
51
+ export type WalletCallReceipt<quantity = Hex, status = Hex> = {
52
+ logs: {
53
+ address: Hex;
54
+ data: Hex;
55
+ topics: Hex[];
56
+ }[];
57
+ status: status;
58
+ blockHash: Hex;
59
+ blockNumber: quantity;
60
+ gasUsed: quantity;
61
+ transactionHash: Hex;
62
+ };
63
+ export type WalletGrantPermissionsParameters = {
64
+ signer?: {
65
+ type: string;
66
+ data?: unknown | undefined;
67
+ } | undefined;
68
+ permissions: readonly {
69
+ data: unknown;
70
+ policies: readonly {
71
+ data: unknown;
72
+ type: string;
73
+ }[];
74
+ required?: boolean | undefined;
75
+ type: string;
76
+ }[];
77
+ expiry: number;
78
+ };
79
+ export type WalletGrantPermissionsReturnType = {
80
+ expiry: number;
81
+ factory?: `0x${string}` | undefined;
82
+ factoryData?: string | undefined;
83
+ grantedPermissions: readonly {
84
+ data: unknown;
85
+ policies: readonly {
86
+ data: unknown;
87
+ type: string;
88
+ }[];
89
+ required?: boolean | undefined;
90
+ type: string;
91
+ }[];
92
+ permissionsContext: string;
93
+ signerData?: {
94
+ userOpBuilder?: `0x${string}` | undefined;
95
+ submitToAddress?: `0x${string}` | undefined;
96
+ } | undefined;
97
+ };
98
+ export type WalletGetCallsStatusReturnType<quantity = Hex, status = Hex> = {
99
+ status: 'PENDING' | 'CONFIRMED';
100
+ receipts?: WalletCallReceipt<quantity, status>[] | undefined;
101
+ };
102
+ export type WalletPermissionCaveat = {
103
+ type: string;
104
+ value: any;
105
+ };
106
+ export type WalletPermission = {
107
+ caveats: WalletPermissionCaveat[];
108
+ date: number;
109
+ id: string;
110
+ invoker: `http://${string}` | `https://${string}`;
111
+ parentCapability: 'eth_accounts' | string;
112
+ };
113
+ export type WalletSendCallsParameters<capabilities extends WalletCapabilities = WalletCapabilities, chainId extends Hex | number = Hex, quantity extends Quantity | bigint = Quantity> = [
114
+ {
115
+ calls: OneOf<{
116
+ to: Address;
117
+ data?: Hex | undefined;
118
+ value?: quantity | undefined;
119
+ } | {
120
+ data: Hex;
121
+ }>[];
122
+ capabilities?: capabilities | undefined;
123
+ chainId: chainId;
124
+ from: Address;
125
+ version: string;
126
+ }
127
+ ];
128
+ export type WatchAssetParams = {
129
+ /** Token type. */
130
+ type: 'ERC20';
131
+ options: {
132
+ /** The address of the token contract */
133
+ address: string;
134
+ /** A ticker symbol or shorthand, up to 11 characters */
135
+ symbol: string;
136
+ /** The number of token decimals */
137
+ decimals: number;
138
+ /** A string url of the token logo */
139
+ image?: string | undefined;
140
+ };
141
+ };
142
+ export type ExactPartial<type> = {
143
+ [key in keyof type]?: type[key] | undefined;
144
+ };
145
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & ExactPartial<Pick<T, K>>;
146
+ /** TypeScript type to use for `address` values */
147
+ type Address = `0x${string}`;
148
+ export type ProviderConnectInfo = {
149
+ chainId: string;
150
+ };
151
+ export type ProviderMessage = {
152
+ type: string;
153
+ data: unknown;
154
+ };
155
+ declare class ProviderRpcError extends Error {
156
+ code: number;
157
+ details: string;
158
+ constructor(code: number, message: string);
159
+ }
160
+ export type EIP1193EventMap = {
161
+ accountsChanged(accounts: Address[]): void;
162
+ chainChanged(chainId: string): void;
163
+ connect(connectInfo: ProviderConnectInfo): void;
164
+ disconnect(error: ProviderRpcError): void;
165
+ message(message: ProviderMessage): void;
166
+ };
167
+ export type EIP1193Events = {
168
+ on<event extends keyof EIP1193EventMap>(event: event, listener: EIP1193EventMap[event]): void;
169
+ removeListener<event extends keyof EIP1193EventMap>(event: event, listener: EIP1193EventMap[event]): void;
170
+ };
171
+ export type Prettify<T> = {
172
+ [K in keyof T]: T[K];
173
+ } & {};
174
+ export type RpcSchema = readonly {
175
+ Method: string;
176
+ Parameters?: unknown | undefined;
177
+ ReturnType: unknown;
178
+ }[];
179
+ export type RpcSchemaOverride = Omit<RpcSchema[number], 'Method'>;
180
+ export type EIP1193Parameters<rpcSchema extends RpcSchema | undefined = undefined> = rpcSchema extends RpcSchema ? {
181
+ [K in keyof rpcSchema]: Prettify<{
182
+ method: rpcSchema[K] extends rpcSchema[number] ? rpcSchema[K]['Method'] : never;
183
+ } & (rpcSchema[K] extends rpcSchema[number] ? rpcSchema[K]['Parameters'] extends undefined ? {
184
+ params?: undefined;
185
+ } : {
186
+ params: rpcSchema[K]['Parameters'];
187
+ } : never)>;
188
+ }[number] : {
189
+ method: string;
190
+ params?: unknown | undefined;
191
+ };
192
+ export type EIP1193RequestOptions = {
193
+ dedupe?: boolean | undefined;
194
+ retryDelay?: number | undefined;
195
+ retryCount?: number | undefined;
196
+ /** Unique identifier for the request. */
197
+ uid?: string | undefined;
198
+ };
199
+ type DerivedRpcSchema<rpcSchema extends RpcSchema | undefined, rpcSchemaOverride extends RpcSchemaOverride | undefined> = rpcSchemaOverride extends RpcSchemaOverride ? [rpcSchemaOverride & {
200
+ Method: string;
201
+ }] : rpcSchema;
202
+ export type EIP1193RequestFn<rpcSchema extends RpcSchema | undefined = undefined> = <rpcSchemaOverride extends RpcSchemaOverride | undefined = undefined, _parameters extends EIP1193Parameters<DerivedRpcSchema<rpcSchema, rpcSchemaOverride>> = EIP1193Parameters<DerivedRpcSchema<rpcSchema, rpcSchemaOverride>>, _returnType = DerivedRpcSchema<rpcSchema, rpcSchemaOverride> extends RpcSchema ? Extract<DerivedRpcSchema<rpcSchema, rpcSchemaOverride>[number], {
203
+ Method: _parameters['method'];
204
+ }>['ReturnType'] : unknown>(args: _parameters, options?: EIP1193RequestOptions | undefined) => Promise<_returnType>;
205
+ export type Hex = `0x${string}`;
206
+ export type Hash = `0x${string}`;
207
+ export type Quantity = `0x${string}`;
208
+ export type PublicRpcSchema = [
209
+ /**
210
+ * @description Returns the version of the current client
211
+ *
212
+ * @example
213
+ * provider.request({ method: 'web3_clientVersion' })
214
+ * // => 'MetaMask/v1.0.0'
215
+ */
216
+ {
217
+ Method: 'web3_clientVersion';
218
+ Parameters?: undefined;
219
+ ReturnType: string;
220
+ },
221
+ /**
222
+ * @description Hashes data using the Keccak-256 algorithm
223
+ *
224
+ * @example
225
+ * provider.request({ method: 'web3_sha3', params: ['0x68656c6c6f20776f726c64'] })
226
+ * // => '0xc94770007dda54cF92009BFF0dE90c06F603a09f'
227
+ */
228
+ {
229
+ Method: 'web3_sha3';
230
+ Parameters: [data: Hash];
231
+ ReturnType: string;
232
+ },
233
+ /**
234
+ * @description Determines if this client is listening for new network connections
235
+ *
236
+ * @example
237
+ * provider.request({ method: 'net_listening' })
238
+ * // => true
239
+ */
240
+ {
241
+ Method: 'net_listening';
242
+ Parameters?: undefined;
243
+ ReturnType: boolean;
244
+ },
245
+ /**
246
+ * @description Returns the number of peers currently connected to this client
247
+ *
248
+ * @example
249
+ * provider.request({ method: 'net_peerCount' })
250
+ * // => '0x1'
251
+ */
252
+ {
253
+ Method: 'net_peerCount';
254
+ Parameters?: undefined;
255
+ ReturnType: Quantity;
256
+ },
257
+ /**
258
+ * @description Returns the chain ID associated with the current network
259
+ *
260
+ * @example
261
+ * provider.request({ method: 'net_version' })
262
+ * // => '1'
263
+ */
264
+ {
265
+ Method: 'net_version';
266
+ Parameters?: undefined;
267
+ ReturnType: Quantity;
268
+ },
269
+ /**
270
+ * @description Returns the base fee per blob gas in wei.
271
+ *
272
+ * @example
273
+ * provider.request({ method: 'eth_blobBaseFee' })
274
+ * // => '0x09184e72a000'
275
+ */
276
+ {
277
+ Method: 'eth_blobBaseFee';
278
+ Parameters?: undefined;
279
+ ReturnType: Quantity;
280
+ },
281
+ /**
282
+ * @description Returns the number of the most recent block seen by this client
283
+ *
284
+ * @example
285
+ * provider.request({ method: 'eth_blockNumber' })
286
+ * // => '0x1b4'
287
+ */
288
+ {
289
+ Method: 'eth_blockNumber';
290
+ Parameters?: undefined;
291
+ ReturnType: Quantity;
292
+ },
293
+ /**
294
+ * @description Executes a new message call immediately without submitting a transaction to the network
295
+ *
296
+ * @example
297
+ * provider.request({ method: 'eth_call', params: [{ to: '0x...', data: '0x...' }] })
298
+ * // => '0x...'
299
+ */
300
+ {
301
+ Method: 'eth_call';
302
+ Parameters: [transaction: ExactPartial<TransactionRequest>] | [
303
+ transaction: ExactPartial<TransactionRequest>,
304
+ block: BlockNumber | BlockTag | BlockIdentifier
305
+ ] | [
306
+ transaction: ExactPartial<TransactionRequest>,
307
+ block: BlockNumber | BlockTag | BlockIdentifier,
308
+ stateOverrideSet: RpcStateOverride
309
+ ];
310
+ ReturnType: Hex;
311
+ },
312
+ /**
313
+ * @description Returns the chain ID associated with the current network
314
+ * @example
315
+ * provider.request({ method: 'eth_chainId' })
316
+ * // => '1'
317
+ */
318
+ {
319
+ Method: 'eth_chainId';
320
+ Parameters?: undefined;
321
+ ReturnType: Quantity;
322
+ },
323
+ /**
324
+ * @description Returns the client coinbase address.
325
+ * @example
326
+ * provider.request({ method: 'eth_coinbase' })
327
+ * // => '0x...'
328
+ */
329
+ {
330
+ Method: 'eth_coinbase';
331
+ Parameters?: undefined;
332
+ ReturnType: Address;
333
+ },
334
+ /**
335
+ * @description Estimates the gas necessary to complete a transaction without submitting it to the network
336
+ *
337
+ * @example
338
+ * provider.request({
339
+ * method: 'eth_estimateGas',
340
+ * params: [{ from: '0x...', to: '0x...', value: '0x...' }]
341
+ * })
342
+ * // => '0x5208'
343
+ */
344
+ {
345
+ Method: 'eth_estimateGas';
346
+ Parameters: [transaction: TransactionRequest] | [transaction: TransactionRequest, block: BlockNumber | BlockTag] | [
347
+ transaction: TransactionRequest,
348
+ block: BlockNumber | BlockTag,
349
+ stateOverride: RpcStateOverride
350
+ ];
351
+ ReturnType: Quantity;
352
+ },
353
+ /**
354
+ * @description Returns a collection of historical gas information
355
+ *
356
+ * @example
357
+ * provider.request({
358
+ * method: 'eth_feeHistory',
359
+ * params: ['4', 'latest', ['25', '75']]
360
+ * })
361
+ * // => {
362
+ * // oldestBlock: '0x1',
363
+ * // baseFeePerGas: ['0x1', '0x2', '0x3', '0x4'],
364
+ * // gasUsedRatio: ['0x1', '0x2', '0x3', '0x4'],
365
+ * // reward: [['0x1', '0x2'], ['0x3', '0x4'], ['0x5', '0x6'], ['0x7', '0x8']]
366
+ * // }
367
+ *
368
+ */
369
+ {
370
+ Method: 'eth_feeHistory';
371
+ Parameters: [
372
+ /** Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. Less than requested may be returned if not all blocks are available. */
373
+ blockCount: Quantity,
374
+ /** Highest number block of the requested range. */
375
+ newestBlock: BlockNumber | BlockTag,
376
+ /** A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used. */
377
+ rewardPercentiles: number[] | undefined
378
+ ];
379
+ ReturnType: FeeHistory;
380
+ },
381
+ /**
382
+ * @description Returns the current price of gas expressed in wei
383
+ *
384
+ * @example
385
+ * provider.request({ method: 'eth_gasPrice' })
386
+ * // => '0x09184e72a000'
387
+ */
388
+ {
389
+ Method: 'eth_gasPrice';
390
+ Parameters?: undefined;
391
+ ReturnType: Quantity;
392
+ },
393
+ /**
394
+ * @description Returns the balance of an address in wei
395
+ *
396
+ * @example
397
+ * provider.request({ method: 'eth_getBalance', params: ['0x...', 'latest'] })
398
+ * // => '0x12a05...'
399
+ */
400
+ {
401
+ Method: 'eth_getBalance';
402
+ Parameters: [
403
+ address: Address,
404
+ block: BlockNumber | BlockTag | BlockIdentifier
405
+ ];
406
+ ReturnType: Quantity;
407
+ },
408
+ /**
409
+ * @description Returns information about a block specified by hash
410
+ * @link https://eips.ethereum.org/EIPS/eip-1474
411
+ * @example
412
+ * provider.request({ method: 'eth_getBlockByHash', params: ['0x...', true] })
413
+ * // => {
414
+ * // number: '0x1b4',
415
+ * // hash: '0x...',
416
+ * // parentHash: '0x...',
417
+ * // ...
418
+ * // }
419
+ */
420
+ {
421
+ Method: 'eth_getBlockByHash';
422
+ Parameters: [
423
+ /** hash of a block */
424
+ hash: Hash,
425
+ /** true will pull full transaction objects, false will pull transaction hashes */
426
+ includeTransactionObjects: boolean
427
+ ];
428
+ ReturnType: Block | null;
429
+ },
430
+ /**
431
+ * @description Returns information about a block specified by number
432
+ * @link https://eips.ethereum.org/EIPS/eip-1474
433
+ * @example
434
+ * provider.request({ method: 'eth_getBlockByNumber', params: ['0x1b4', true] })
435
+ * // => {
436
+ * // number: '0x1b4',
437
+ * // hash: '0x...',
438
+ * // parentHash: '0x...',
439
+ * // ...
440
+ * // }
441
+ */
442
+ {
443
+ Method: 'eth_getBlockByNumber';
444
+ Parameters: [
445
+ /** block number, or one of "latest", "safe", "finalized", "earliest" or "pending" */
446
+ block: BlockNumber | BlockTag,
447
+ /** true will pull full transaction objects, false will pull transaction hashes */
448
+ includeTransactionObjects: boolean
449
+ ];
450
+ ReturnType: Block | null;
451
+ },
452
+ /**
453
+ * @description Returns the number of transactions in a block specified by block hash
454
+ * @link https://eips.ethereum.org/EIPS/eip-1474
455
+ * @example
456
+ * provider.request({ method: 'eth_getBlockTransactionCountByHash', params: ['0x...'] })
457
+ * // => '0x1'
458
+ */
459
+ {
460
+ Method: 'eth_getBlockTransactionCountByHash';
461
+ Parameters: [hash: Hash];
462
+ ReturnType: Quantity;
463
+ },
464
+ /**
465
+ * @description Returns the number of transactions in a block specified by block number
466
+ * @link https://eips.ethereum.org/EIPS/eip-1474
467
+ * @example
468
+ * provider.request({ method: 'eth_getBlockTransactionCountByNumber', params: ['0x1b4'] })
469
+ * // => '0x1'
470
+ */
471
+ {
472
+ Method: 'eth_getBlockTransactionCountByNumber';
473
+ Parameters: [block: BlockNumber | BlockTag];
474
+ ReturnType: Quantity;
475
+ },
476
+ /**
477
+ * @description Returns the contract code stored at a given address
478
+ * @link https://eips.ethereum.org/EIPS/eip-1474
479
+ * @example
480
+ * provider.request({ method: 'eth_getCode', params: ['0x...', 'latest'] })
481
+ * // => '0x...'
482
+ */
483
+ {
484
+ Method: 'eth_getCode';
485
+ Parameters: [
486
+ address: Address,
487
+ block: BlockNumber | BlockTag | BlockIdentifier
488
+ ];
489
+ ReturnType: Hex;
490
+ },
491
+ /**
492
+ * @description Returns a list of all logs based on filter ID since the last log retrieval
493
+ * @link https://eips.ethereum.org/EIPS/eip-1474
494
+ * @example
495
+ * provider.request({ method: 'eth_getFilterChanges', params: ['0x...'] })
496
+ * // => [{ ... }, { ... }]
497
+ */
498
+ {
499
+ Method: 'eth_getFilterChanges';
500
+ Parameters: [filterId: Quantity];
501
+ ReturnType: Log[] | Hex[];
502
+ },
503
+ /**
504
+ * @description Returns a list of all logs based on filter ID
505
+ * @link https://eips.ethereum.org/EIPS/eip-1474
506
+ * @example
507
+ * provider.request({ method: 'eth_getFilterLogs', params: ['0x...'] })
508
+ * // => [{ ... }, { ... }]
509
+ */
510
+ {
511
+ Method: 'eth_getFilterLogs';
512
+ Parameters: [filterId: Quantity];
513
+ ReturnType: Log[];
514
+ },
515
+ /**
516
+ * @description Returns a list of all logs based on a filter object
517
+ * @link https://eips.ethereum.org/EIPS/eip-1474
518
+ * @example
519
+ * provider.request({ method: 'eth_getLogs', params: [{ fromBlock: '0x...', toBlock: '0x...', address: '0x...', topics: ['0x...'] }] })
520
+ * // => [{ ... }, { ... }]
521
+ */
522
+ {
523
+ Method: 'eth_getLogs';
524
+ Parameters: [
525
+ {
526
+ address?: Address | Address[] | undefined;
527
+ topics?: LogTopic[] | undefined;
528
+ } & ({
529
+ fromBlock?: BlockNumber | BlockTag | undefined;
530
+ toBlock?: BlockNumber | BlockTag | undefined;
531
+ blockHash?: undefined;
532
+ } | {
533
+ fromBlock?: undefined;
534
+ toBlock?: undefined;
535
+ blockHash?: Hash | undefined;
536
+ })
537
+ ];
538
+ ReturnType: Log[];
539
+ },
540
+ /**
541
+ * @description Returns the account and storage values of the specified account including the Merkle-proof.
542
+ * @link https://eips.ethereum.org/EIPS/eip-1186
543
+ * @example
544
+ * provider.request({ method: 'eth_getProof', params: ['0x...', ['0x...'], 'latest'] })
545
+ * // => {
546
+ * // ...
547
+ * // }
548
+ */
549
+ {
550
+ Method: 'eth_getProof';
551
+ Parameters: [
552
+ /** Address of the account. */
553
+ address: Address,
554
+ /** An array of storage-keys that should be proofed and included. */
555
+ storageKeys: Hash[],
556
+ block: BlockNumber | BlockTag
557
+ ];
558
+ ReturnType: Proof;
559
+ },
560
+ /**
561
+ * @description Returns the value from a storage position at an address
562
+ * @link https://eips.ethereum.org/EIPS/eip-1474
563
+ * @example
564
+ * provider.request({ method: 'eth_getStorageAt', params: ['0x...', '0x...', 'latest'] })
565
+ * // => '0x...'
566
+ */
567
+ {
568
+ Method: 'eth_getStorageAt';
569
+ Parameters: [
570
+ address: Address,
571
+ index: Quantity,
572
+ block: BlockNumber | BlockTag | BlockIdentifier
573
+ ];
574
+ ReturnType: Hex;
575
+ },
576
+ /**
577
+ * @description Returns information about a transaction specified by block hash and transaction index
578
+ * @link https://eips.ethereum.org/EIPS/eip-1474
579
+ * @example
580
+ * provider.request({ method: 'eth_getTransactionByBlockHashAndIndex', params: ['0x...', '0x...'] })
581
+ * // => { ... }
582
+ */
583
+ {
584
+ Method: 'eth_getTransactionByBlockHashAndIndex';
585
+ Parameters: [hash: Hash, index: Quantity];
586
+ ReturnType: Transaction | null;
587
+ },
588
+ /**
589
+ * @description Returns information about a transaction specified by block number and transaction index
590
+ * @link https://eips.ethereum.org/EIPS/eip-1474
591
+ * @example
592
+ * provider.request({ method: 'eth_getTransactionByBlockNumberAndIndex', params: ['0x...', '0x...'] })
593
+ * // => { ... }
594
+ */
595
+ {
596
+ Method: 'eth_getTransactionByBlockNumberAndIndex';
597
+ Parameters: [block: BlockNumber | BlockTag, index: Quantity];
598
+ ReturnType: Transaction | null;
599
+ },
600
+ /**
601
+ * @description Returns information about a transaction specified by hash
602
+ * @link https://eips.ethereum.org/EIPS/eip-1474
603
+ * @example
604
+ * provider.request({ method: 'eth_getTransactionByHash', params: ['0x...'] })
605
+ * // => { ... }
606
+ */
607
+ {
608
+ Method: 'eth_getTransactionByHash';
609
+ Parameters: [hash: Hash];
610
+ ReturnType: Transaction | null;
611
+ },
612
+ /**
613
+ * @description Returns the number of transactions sent from an address
614
+ * @link https://eips.ethereum.org/EIPS/eip-1474
615
+ * @example
616
+ * provider.request({ method: 'eth_getTransactionCount', params: ['0x...', 'latest'] })
617
+ * // => '0x1'
618
+ */
619
+ {
620
+ Method: 'eth_getTransactionCount';
621
+ Parameters: [
622
+ address: Address,
623
+ block: BlockNumber | BlockTag | BlockIdentifier
624
+ ];
625
+ ReturnType: Quantity;
626
+ },
627
+ /**
628
+ * @description Returns the receipt of a transaction specified by hash
629
+ * @link https://eips.ethereum.org/EIPS/eip-1474
630
+ * @example
631
+ * provider.request({ method: 'eth_getTransactionReceipt', params: ['0x...'] })
632
+ * // => { ... }
633
+ */
634
+ {
635
+ Method: 'eth_getTransactionReceipt';
636
+ Parameters: [hash: Hash];
637
+ ReturnType: TransactionReceipt | null;
638
+ },
639
+ /**
640
+ * @description Returns information about an uncle specified by block hash and uncle index position
641
+ * @link https://eips.ethereum.org/EIPS/eip-1474
642
+ * @example
643
+ * provider.request({ method: 'eth_getUncleByBlockHashAndIndex', params: ['0x...', '0x...'] })
644
+ * // => { ... }
645
+ */
646
+ {
647
+ Method: 'eth_getUncleByBlockHashAndIndex';
648
+ Parameters: [hash: Hash, index: Quantity];
649
+ ReturnType: Uncle | null;
650
+ },
651
+ /**
652
+ * @description Returns information about an uncle specified by block number and uncle index position
653
+ * @link https://eips.ethereum.org/EIPS/eip-1474
654
+ * @example
655
+ * provider.request({ method: 'eth_getUncleByBlockNumberAndIndex', params: ['0x...', '0x...'] })
656
+ * // => { ... }
657
+ */
658
+ {
659
+ Method: 'eth_getUncleByBlockNumberAndIndex';
660
+ Parameters: [block: BlockNumber | BlockTag, index: Quantity];
661
+ ReturnType: Uncle | null;
662
+ },
663
+ /**
664
+ * @description Returns the number of uncles in a block specified by block hash
665
+ * @link https://eips.ethereum.org/EIPS/eip-1474
666
+ * @example
667
+ * provider.request({ method: 'eth_getUncleCountByBlockHash', params: ['0x...'] })
668
+ * // => '0x1'
669
+ */
670
+ {
671
+ Method: 'eth_getUncleCountByBlockHash';
672
+ Parameters: [hash: Hash];
673
+ ReturnType: Quantity;
674
+ },
675
+ /**
676
+ * @description Returns the number of uncles in a block specified by block number
677
+ * @link https://eips.ethereum.org/EIPS/eip-1474
678
+ * @example
679
+ * provider.request({ method: 'eth_getUncleCountByBlockNumber', params: ['0x...'] })
680
+ * // => '0x1'
681
+ */
682
+ {
683
+ Method: 'eth_getUncleCountByBlockNumber';
684
+ Parameters: [block: BlockNumber | BlockTag];
685
+ ReturnType: Quantity;
686
+ },
687
+ /**
688
+ * @description Returns the current maxPriorityFeePerGas in wei.
689
+ * @link https://ethereum.github.io/execution-apis/api-documentation/
690
+ * @example
691
+ * provider.request({ method: 'eth_maxPriorityFeePerGas' })
692
+ * // => '0x5f5e100'
693
+ */
694
+ {
695
+ Method: 'eth_maxPriorityFeePerGas';
696
+ Parameters?: undefined;
697
+ ReturnType: Quantity;
698
+ },
699
+ /**
700
+ * @description Creates a filter to listen for new blocks that can be used with `eth_getFilterChanges`
701
+ * @link https://eips.ethereum.org/EIPS/eip-1474
702
+ * @example
703
+ * provider.request({ method: 'eth_newBlockFilter' })
704
+ * // => '0x1'
705
+ */
706
+ {
707
+ Method: 'eth_newBlockFilter';
708
+ Parameters?: undefined;
709
+ ReturnType: Quantity;
710
+ },
711
+ /**
712
+ * @description Creates a filter to listen for specific state changes that can then be used with `eth_getFilterChanges`
713
+ * @link https://eips.ethereum.org/EIPS/eip-1474
714
+ * @example
715
+ * provider.request({ method: 'eth_newFilter', params: [{ fromBlock: '0x...', toBlock: '0x...', address: '0x...', topics: ['0x...'] }] })
716
+ * // => '0x1'
717
+ */
718
+ {
719
+ Method: 'eth_newFilter';
720
+ Parameters: [
721
+ filter: {
722
+ fromBlock?: BlockNumber | BlockTag | undefined;
723
+ toBlock?: BlockNumber | BlockTag | undefined;
724
+ address?: Address | Address[] | undefined;
725
+ topics?: LogTopic[] | undefined;
726
+ }
727
+ ];
728
+ ReturnType: Quantity;
729
+ },
730
+ /**
731
+ * @description Creates a filter to listen for new pending transactions that can be used with `eth_getFilterChanges`
732
+ * @link https://eips.ethereum.org/EIPS/eip-1474
733
+ * @example
734
+ * provider.request({ method: 'eth_newPendingTransactionFilter' })
735
+ * // => '0x1'
736
+ */
737
+ {
738
+ Method: 'eth_newPendingTransactionFilter';
739
+ Parameters?: undefined;
740
+ ReturnType: Quantity;
741
+ },
742
+ /**
743
+ * @description Returns the current Ethereum protocol version
744
+ * @link https://eips.ethereum.org/EIPS/eip-1474
745
+ * @example
746
+ * provider.request({ method: 'eth_protocolVersion' })
747
+ * // => '54'
748
+ */
749
+ {
750
+ Method: 'eth_protocolVersion';
751
+ Parameters?: undefined;
752
+ ReturnType: string;
753
+ },
754
+ /**
755
+ * @description Sends a **signed** transaction to the network
756
+ * @link https://eips.ethereum.org/EIPS/eip-1474
757
+ * @example
758
+ * provider.request({ method: 'eth_sendRawTransaction', params: ['0x...'] })
759
+ * // => '0x...'
760
+ */
761
+ {
762
+ Method: 'eth_sendRawTransaction';
763
+ Parameters: [signedTransaction: Hex];
764
+ ReturnType: Hash;
765
+ },
766
+ /**
767
+ * @description Destroys a filter based on filter ID
768
+ * @link https://eips.ethereum.org/EIPS/eip-1474
769
+ * @example
770
+ * provider.request({ method: 'eth_uninstallFilter', params: ['0x1'] })
771
+ * // => true
772
+ */
773
+ {
774
+ Method: 'eth_uninstallFilter';
775
+ Parameters: [filterId: Quantity];
776
+ ReturnType: boolean;
777
+ }
778
+ ];
779
+ export type WalletRpcSchema = [
780
+ /**
781
+ * @description Returns a list of addresses owned by this client
782
+ * @link https://eips.ethereum.org/EIPS/eip-1474
783
+ * @example
784
+ * provider.request({ method: 'eth_accounts' })
785
+ * // => ['0x0fB69...']
786
+ */
787
+ {
788
+ Method: 'eth_accounts';
789
+ Parameters?: undefined;
790
+ ReturnType: Address[];
791
+ },
792
+ /**
793
+ * @description Returns the current chain ID associated with the wallet.
794
+ * @example
795
+ * provider.request({ method: 'eth_chainId' })
796
+ * // => '1'
797
+ */
798
+ {
799
+ Method: 'eth_chainId';
800
+ Parameters?: undefined;
801
+ ReturnType: Quantity;
802
+ },
803
+ /**
804
+ * @description Estimates the gas necessary to complete a transaction without submitting it to the network
805
+ *
806
+ * @example
807
+ * provider.request({
808
+ * method: 'eth_estimateGas',
809
+ * params: [{ from: '0x...', to: '0x...', value: '0x...' }]
810
+ * })
811
+ * // => '0x5208'
812
+ */
813
+ {
814
+ Method: 'eth_estimateGas';
815
+ Parameters: [transaction: TransactionRequest] | [transaction: TransactionRequest, block: BlockNumber | BlockTag] | [
816
+ transaction: TransactionRequest,
817
+ block: BlockNumber | BlockTag,
818
+ stateOverride: RpcStateOverride
819
+ ];
820
+ ReturnType: Quantity;
821
+ },
822
+ /**
823
+ * @description Requests that the user provides an Ethereum address to be identified by. Typically causes a browser extension popup to appear.
824
+ * @link https://eips.ethereum.org/EIPS/eip-1102
825
+ * @example
826
+ * provider.request({ method: 'eth_requestAccounts' }] })
827
+ * // => ['0x...', '0x...']
828
+ */
829
+ {
830
+ Method: 'eth_requestAccounts';
831
+ Parameters?: undefined;
832
+ ReturnType: Address[];
833
+ },
834
+ /**
835
+ * @description Creates, signs, and sends a new transaction to the network
836
+ * @link https://eips.ethereum.org/EIPS/eip-1474
837
+ * @example
838
+ * provider.request({ method: 'eth_sendTransaction', params: [{ from: '0x...', to: '0x...', value: '0x...' }] })
839
+ * // => '0x...'
840
+ */
841
+ {
842
+ Method: 'eth_sendTransaction';
843
+ Parameters: [transaction: TransactionRequest];
844
+ ReturnType: Hash;
845
+ },
846
+ /**
847
+ * @description Sends and already-signed transaction to the network
848
+ * @link https://eips.ethereum.org/EIPS/eip-1474
849
+ * @example
850
+ * provider.request({ method: 'eth_sendRawTransaction', params: ['0x...'] })
851
+ * // => '0x...'
852
+ */
853
+ {
854
+ Method: 'eth_sendRawTransaction';
855
+ Parameters: [signedTransaction: Hex];
856
+ ReturnType: Hash;
857
+ },
858
+ /**
859
+ * @description Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
860
+ * @link https://eips.ethereum.org/EIPS/eip-1474
861
+ * @example
862
+ * provider.request({ method: 'eth_sign', params: ['0x...', '0x...'] })
863
+ * // => '0x...'
864
+ */
865
+ {
866
+ Method: 'eth_sign';
867
+ Parameters: [
868
+ /** Address to use for signing */
869
+ address: Address,
870
+ /** Data to sign */
871
+ data: Hex
872
+ ];
873
+ ReturnType: Hex;
874
+ },
875
+ /**
876
+ * @description Signs a transaction that can be submitted to the network at a later time using with `eth_sendRawTransaction`
877
+ * @link https://eips.ethereum.org/EIPS/eip-1474
878
+ * @example
879
+ * provider.request({ method: 'eth_signTransaction', params: [{ from: '0x...', to: '0x...', value: '0x...' }] })
880
+ * // => '0x...'
881
+ */
882
+ {
883
+ Method: 'eth_signTransaction';
884
+ Parameters: [request: TransactionRequest];
885
+ ReturnType: Hex;
886
+ },
887
+ /**
888
+ * @description Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
889
+ * @link https://eips.ethereum.org/EIPS/eip-1474
890
+ * @example
891
+ * provider.request({ method: 'eth_signTypedData_v4', params: [{ from: '0x...', data: [{ type: 'string', name: 'message', value: 'hello world' }] }] })
892
+ * // => '0x...'
893
+ */
894
+ {
895
+ Method: 'eth_signTypedData_v4';
896
+ Parameters: [
897
+ /** Address to use for signing */
898
+ address: Address,
899
+ /** Message to sign containing type information, a domain separator, and data */
900
+ message: string
901
+ ];
902
+ ReturnType: Hex;
903
+ },
904
+ /**
905
+ * @description Returns information about the status of this client’s network synchronization
906
+ * @link https://eips.ethereum.org/EIPS/eip-1474
907
+ * @example
908
+ * provider.request({ method: 'eth_syncing' })
909
+ * // => { startingBlock: '0x...', currentBlock: '0x...', highestBlock: '0x...' }
910
+ */
911
+ {
912
+ Method: 'eth_syncing';
913
+ Parameters?: undefined;
914
+ ReturnType: NetworkSync | false;
915
+ },
916
+ /**
917
+ * @description Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
918
+ * @link https://eips.ethereum.org/EIPS/eip-1474
919
+ * @example
920
+ * provider.request({ method: 'personal_sign', params: ['0x...', '0x...'] })
921
+ * // => '0x...'
922
+ */
923
+ {
924
+ Method: 'personal_sign';
925
+ Parameters: [
926
+ /** Data to sign */
927
+ data: Hex,
928
+ /** Address to use for signing */
929
+ address: Address
930
+ ];
931
+ ReturnType: Hex;
932
+ },
933
+ /**
934
+ * @description Add an Ethereum chain to the wallet.
935
+ * @link https://eips.ethereum.org/EIPS/eip-3085
936
+ * @example
937
+ * provider.request({ method: 'wallet_addEthereumChain', params: [{ chainId: 1, rpcUrl: 'https://mainnet.infura.io/v3/...' }] })
938
+ * // => { ... }
939
+ */
940
+ {
941
+ Method: 'wallet_addEthereumChain';
942
+ Parameters: [chain: AddEthereumChainParameter];
943
+ ReturnType: null;
944
+ },
945
+ /**
946
+ * @description Returns the status of a call batch that was sent via `wallet_sendCalls`.
947
+ * @link https://eips.ethereum.org/EIPS/eip-5792
948
+ * @example
949
+ * provider.request({ method: 'wallet_getCallsStatus' })
950
+ * // => { ... }
951
+ */
952
+ {
953
+ Method: 'wallet_getCallsStatus';
954
+ Parameters?: [string];
955
+ ReturnType: WalletGetCallsStatusReturnType;
956
+ },
957
+ /**
958
+ * @description Gets the connected wallet's capabilities.
959
+ * @link https://eips.ethereum.org/EIPS/eip-5792
960
+ * @example
961
+ * provider.request({ method: 'wallet_getCapabilities' })
962
+ * // => { ... }
963
+ */
964
+ {
965
+ Method: 'wallet_getCapabilities';
966
+ Parameters?: [Address];
967
+ ReturnType: Prettify<WalletCapabilitiesRecord>;
968
+ },
969
+ /**
970
+ * @description Gets the wallets current permissions.
971
+ * @link https://eips.ethereum.org/EIPS/eip-2255
972
+ * @example
973
+ * provider.request({ method: 'wallet_getPermissions' })
974
+ * // => { ... }
975
+ */
976
+ {
977
+ Method: 'wallet_getPermissions';
978
+ Parameters?: undefined;
979
+ ReturnType: WalletPermission[];
980
+ },
981
+ /**
982
+ * @description Requests permissions from a wallet
983
+ * @link https://eips.ethereum.org/EIPS/eip-7715
984
+ * @example
985
+ * provider.request({ method: 'wallet_grantPermissions', params: [{ ... }] })
986
+ * // => { ... }
987
+ */
988
+ {
989
+ Method: 'wallet_grantPermissions';
990
+ Parameters?: [WalletGrantPermissionsParameters];
991
+ ReturnType: Prettify<WalletGrantPermissionsReturnType>;
992
+ },
993
+ /**
994
+ * @description Requests the given permissions from the user.
995
+ * @link https://eips.ethereum.org/EIPS/eip-2255
996
+ * @example
997
+ * provider.request({ method: 'wallet_requestPermissions', params: [{ eth_accounts: {} }] })
998
+ * // => { ... }
999
+ */
1000
+ {
1001
+ Method: 'wallet_requestPermissions';
1002
+ Parameters: [permissions: {
1003
+ eth_accounts: Record<string, any>;
1004
+ }];
1005
+ ReturnType: WalletPermission[];
1006
+ },
1007
+ /**
1008
+ * @description Revokes the given permissions from the user.
1009
+ * @link https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-2.md
1010
+ * @example
1011
+ * provider.request({ method: 'wallet_revokePermissions', params: [{ eth_accounts: {} }] })
1012
+ * // => { ... }
1013
+ */
1014
+ {
1015
+ Method: 'wallet_revokePermissions';
1016
+ Parameters: [permissions: {
1017
+ eth_accounts: Record<string, any>;
1018
+ }];
1019
+ ReturnType: null;
1020
+ },
1021
+ /**
1022
+ * @description Requests the connected wallet to send a batch of calls.
1023
+ * @link https://eips.ethereum.org/EIPS/eip-5792
1024
+ * @example
1025
+ * provider.request({ method: 'wallet_sendCalls' })
1026
+ * // => { ... }
1027
+ */
1028
+ {
1029
+ Method: 'wallet_sendCalls';
1030
+ Parameters?: WalletSendCallsParameters;
1031
+ ReturnType: string;
1032
+ },
1033
+ /**
1034
+ * @description Requests for the wallet to show information about a call batch
1035
+ * that was sent via `wallet_sendCalls`.
1036
+ * @link https://eips.ethereum.org/EIPS/eip-5792
1037
+ * @example
1038
+ * provider.request({ method: 'wallet_showCallsStatus', params: ['...'] })
1039
+ */
1040
+ {
1041
+ Method: 'wallet_showCallsStatus';
1042
+ Parameters?: [string];
1043
+ ReturnType: void;
1044
+ },
1045
+ /**
1046
+ * @description Switch the wallet to the given Ethereum chain.
1047
+ * @link https://eips.ethereum.org/EIPS/eip-3326
1048
+ * @example
1049
+ * provider.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0xf00' }] })
1050
+ * // => { ... }
1051
+ */
1052
+ {
1053
+ Method: 'wallet_switchEthereumChain';
1054
+ Parameters: [chain: {
1055
+ chainId: string;
1056
+ }];
1057
+ ReturnType: null;
1058
+ },
1059
+ /**
1060
+ * @description Requests that the user tracks the token in their wallet. Returns a boolean indicating if the token was successfully added.
1061
+ * @link https://eips.ethereum.org/EIPS/eip-747
1062
+ * @example
1063
+ * provider.request({ method: 'wallet_watchAsset' }] })
1064
+ * // => true
1065
+ */
1066
+ {
1067
+ Method: 'wallet_watchAsset';
1068
+ Parameters: WatchAssetParams;
1069
+ ReturnType: boolean;
1070
+ }
1071
+ ];
1072
+ export type BundlerRpcSchema = [
1073
+ /**
1074
+ * @description Returns the chain ID associated with the current network
1075
+ *
1076
+ * @link https://eips.ethereum.org/EIPS/eip-4337#-eth_chainid
1077
+ */
1078
+ {
1079
+ Method: 'eth_chainId';
1080
+ Parameters?: undefined;
1081
+ ReturnType: Hex;
1082
+ },
1083
+ /**
1084
+ * @description Estimate the gas values for a UserOperation.
1085
+ *
1086
+ * @link https://eips.ethereum.org/EIPS/eip-4337#-eth_estimateuseroperationgas
1087
+ *
1088
+ * @example
1089
+ * provider.request({
1090
+ * method: 'eth_estimateUserOperationGas',
1091
+ * params: [{ ... }]
1092
+ * })
1093
+ * // => { ... }
1094
+ */
1095
+ {
1096
+ Method: 'eth_estimateUserOperationGas';
1097
+ Parameters: [userOperation: RpcUserOperation, entrypoint: Address] | [
1098
+ userOperation: RpcUserOperation,
1099
+ entrypoint: Address,
1100
+ stateOverrideSet: RpcStateOverride
1101
+ ];
1102
+ ReturnType: RpcEstimateUserOperationGasReturnType;
1103
+ },
1104
+ /**
1105
+ * @description Return a UserOperation based on a hash.
1106
+ *
1107
+ * @link https://eips.ethereum.org/EIPS/eip-4337#-eth_getuseroperationbyhash
1108
+ *
1109
+ * @example
1110
+ * provider.request({
1111
+ * method: 'eth_getUserOperationByHash',
1112
+ * params: ['0x...']
1113
+ * })
1114
+ * // => { ... }
1115
+ */
1116
+ {
1117
+ Method: 'eth_getUserOperationByHash';
1118
+ Parameters: [hash: Hash];
1119
+ ReturnType: RpcGetUserOperationByHashReturnType | null;
1120
+ },
1121
+ /**
1122
+ * @description Return a UserOperation receipt based on a hash.
1123
+ *
1124
+ * @link https://eips.ethereum.org/EIPS/eip-4337#-eth_getuseroperationreceipt
1125
+ *
1126
+ * @example
1127
+ * provider.request({
1128
+ * method: 'eth_getUserOperationReceipt',
1129
+ * params: ['0x...']
1130
+ * })
1131
+ * // => { ... }
1132
+ */
1133
+ {
1134
+ Method: 'eth_getUserOperationReceipt';
1135
+ Parameters: [hash: Hash];
1136
+ ReturnType: RpcUserOperationReceipt | null;
1137
+ },
1138
+ /**
1139
+ * @description Submits a User Operation object to the User Operation pool of the client.
1140
+ *
1141
+ * @link https://eips.ethereum.org/EIPS/eip-4337#-eth_senduseroperation
1142
+ *
1143
+ * @example
1144
+ * provider.request({
1145
+ * method: 'eth_sendUserOperation',
1146
+ * params: [{ ... }]
1147
+ * })
1148
+ * // => '0x...'
1149
+ */
1150
+ {
1151
+ Method: 'eth_sendUserOperation';
1152
+ Parameters: [userOperation: RpcUserOperation, entrypoint: Address];
1153
+ ReturnType: Hash;
1154
+ },
1155
+ /**
1156
+ * @description Return the list of supported entry points by the client.
1157
+ *
1158
+ * @link https://eips.ethereum.org/EIPS/eip-4337#-eth_supportedentrypoints
1159
+ */
1160
+ {
1161
+ Method: 'eth_supportedEntryPoints';
1162
+ Parameters?: undefined;
1163
+ ReturnType: readonly Address[];
1164
+ }
1165
+ ];
1166
+ export type PaymasterRpcSchema = [
1167
+ /**
1168
+ * @description Returns the chain ID associated with the current network
1169
+ *
1170
+ * @link https://eips.ethereum.org/EIPS/eip-4337#-eth_chainid
1171
+ */
1172
+ {
1173
+ Method: 'pm_getPaymasterStubData';
1174
+ Parameters?: [
1175
+ userOperation: OneOf<PartialBy<Pick<RpcUserOperation<'0.6'>, 'callData' | 'callGasLimit' | 'initCode' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'>, 'callGasLimit' | 'initCode' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'preVerificationGas' | 'verificationGasLimit'> | PartialBy<Pick<RpcUserOperation<'0.7'>, 'callData' | 'callGasLimit' | 'factory' | 'factoryData' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'>, 'callGasLimit' | 'factory' | 'factoryData' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'preVerificationGas' | 'verificationGasLimit'>>,
1176
+ entrypoint: Address,
1177
+ chainId: Hex,
1178
+ context: unknown
1179
+ ];
1180
+ ReturnType: OneOf<{
1181
+ paymasterAndData: Hex;
1182
+ } | {
1183
+ paymaster: Address;
1184
+ paymasterData: Hex;
1185
+ paymasterVerificationGasLimit: Hex;
1186
+ paymasterPostOpGasLimit: Hex;
1187
+ }> & {
1188
+ sponsor?: {
1189
+ name: string;
1190
+ icon?: string | undefined;
1191
+ } | undefined;
1192
+ isFinal?: boolean | undefined;
1193
+ };
1194
+ },
1195
+ /**
1196
+ * @description Returns values to be used in paymaster-related fields of a signed user operation.
1197
+ *
1198
+ * @link https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7677.md#pm_getpaymasterdata
1199
+ */
1200
+ {
1201
+ Method: 'pm_getPaymasterData';
1202
+ Parameters?: [
1203
+ userOperation: Pick<RpcUserOperation<'0.6'>, 'callData' | 'callGasLimit' | 'initCode' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'> | Pick<RpcUserOperation<'0.7'>, 'callData' | 'callGasLimit' | 'factory' | 'factoryData' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'>,
1204
+ entrypoint: Address,
1205
+ chainId: Hex,
1206
+ context: unknown
1207
+ ];
1208
+ ReturnType: OneOf<{
1209
+ paymasterAndData: Hex;
1210
+ } | {
1211
+ paymaster: Address;
1212
+ paymasterData: Hex;
1213
+ paymasterVerificationGasLimit: Hex;
1214
+ paymasterPostOpGasLimit: Hex;
1215
+ }>;
1216
+ }
1217
+ ];
1218
+ export type EIP1474Methods = [
1219
+ ...PublicRpcSchema,
1220
+ ...WalletRpcSchema,
1221
+ ...BundlerRpcSchema,
1222
+ ...PaymasterRpcSchema
1223
+ ];
1224
+ export type EIP1193Provider = EIP1193Events & {
1225
+ request: EIP1193RequestFn<EIP1474Methods>;
1226
+ };
1227
+ export {};
1228
+ //# sourceMappingURL=eip1193.d.ts.map