-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathopenrpc.yaml
More file actions
1681 lines (1676 loc) · 60.5 KB
/
Copy pathopenrpc.yaml
File metadata and controls
1681 lines (1676 loc) · 60.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openrpc: 1.2.4
info:
title: JSON-RPC API
version: 1.0.0
description: >-
This section provides an interactive reference for MetaMask's Wallet
JSON-RPC API. The API builds on a set of standard Ethereum methods with
MetaMask-specific enhancements, and is designed for seamless integration
into dapps.
methods:
- name: wallet_addEthereumChain
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Multichain'
summary: Adds an Ethereum chain to the wallet.
description: >-
Creates a confirmation asking the user to add the specified chain to the
wallet application. The caller must specify a chain ID and some chain metadata.
Specified by [EIP-3085](https://eips.ethereum.org/EIPS/eip-3085).
params:
- name: Chain
schema:
$ref: '#/components/schemas/AddEthereumChainParameter'
errors:
- code: -32602
message: >-
Expected null or array with at least one valid string HTTPS URL
'blockExplorerUrl'. Received: ${blockExplorerUrls}
- code: -32602
message: >-
Expected 0x-prefixed, unpadded, non-zero hexadecimal string 'chainId'.
Received:
${chainId}
- code: -32602
message: >-
Invalid chain ID "${_chainId}": numerical value greater than max safe
value. Received:
${chainId}
- code: -32602
message: May not specify default MetaMask chain.
- code: -32602
message: |-
Expected 2-6 character string 'nativeCurrency.symbol'. Received:
${ticker}
- code: -32602
message: >-
nativeCurrency.symbol does not match currency symbol for a network the
user already has added with the same chainId. Received:
${ticker}
result:
name: Null response
description: This method returns `null` if the chain is added.
schema:
type: 'null'
examples:
- name: wallet_addEthereumChain example
params:
- name: Chain
value:
chainId: '0x64'
chainName: Gnosis
rpcUrls:
- 'https://rpc.gnosischain.com'
iconUrls:
- 'https://xdaichain.com/fake/example/url/xdai.svg'
- 'https://xdaichain.com/fake/example/url/xdai.png'
nativeCurrency:
name: XDAI
symbol: XDAI
decimals: 18
blockExplorerUrls:
- 'https://blockscout.com/poa/xdai/'
result:
name: Null response
value: 'null'
- name: wallet_switchEthereumChain
tags:
- $ref: '#/components/tags/MetaMask'
summary: Switches the wallet's active Ethereum chain.
description: >-
Requests that the wallet switches its active Ethereum chain. Specified by
[EIP-3326](https://eips.ethereum.org/EIPS/eip-3326).
params:
- name: Chain
schema:
title: Chain
description: Object containing the chain ID to switch to.
type: object
required:
- chainId
properties:
chainId:
description: >-
The chain ID as a `0x`-prefixed hexadecimal string, as returned by the
`eth_chainId` method.
type: string
result:
name: Null response
description: This method returns `null` if the active chain is switched.
schema:
type: 'null'
errors:
- code: 4902
message: >-
Unrecognized chain ID. Try adding the chain using
wallet_addEthereumChain first.
examples:
- name: wallet_switchEthereumChain example
params:
- name: Chain
value:
chainId: '0x64'
result:
name: Null response
value: 'null'
- name: wallet_getPermissions
tags:
- $ref: '#/components/tags/MetaMask'
summary: Gets the user's permissions.
description: >-
Gets the user's permissions. Specified by
[EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).
params: []
result:
name: Permissions list
schema:
$ref: '#/components/schemas/PermissionsList'
examples:
- name: wallet_getPermissions example
params: []
result:
name: Permission list
value:
eth_accounts: {}
- name: wallet_requestPermissions
tags:
- $ref: '#/components/tags/MetaMask'
summary: Requests additional permissions.
description: >-
Requests additional permissions from the user. This method accepts
a single permission per call. Specified by
[EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).
params:
- name: Permission
required: true
schema:
title: Permission
description: Object containing the permission to request.
type: object
properties:
permission_name:
type: object
description: >-
The permission object. `permission_name` is the name of the permission
being requested.
additionalProperties: true
result:
name: Permissions list
schema:
$ref: '#/components/schemas/PermissionsList'
examples:
- name: >-
wallet_requestPermissions example
params:
- name: Permission
value:
eth_accounts: {}
result:
name: Permission list
value:
eth_accounts: {}
errors:
- $ref: '#/components/errors/UserRejected'
- name: wallet_revokePermissions
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Experimental'
summary: Revokes the current dapp permissions.
description: >-
Revokes previously granted permissions for the current dapp identified by its
origin. This method accepts a single permission per call. Specified by
[MIP-2](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-2.md)
and only available for the MetaMask browser extension.
params:
- name: Permission
required: true
schema:
title: Permission
description: Object containing the permission to revoke.
type: object
properties:
permission_name:
type: object
description: >-
The permission object. `permission_name` is the name of the permission
being revoked.
additionalProperties: true
result:
name: Null response
description: This method returns `null` if the permission is revoked.
schema:
type: 'null'
errors: []
examples:
- name: >-
wallet_revokePermissions example
params:
- name: Permission
value:
eth_accounts: {}
result:
name: Null response
value: 'null'
- name: personal_sign
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Restricted'
- $ref: '#/components/tags/Multichain'
summary: Presents a plain text signature challenge to the user.
description: >-
Presents a plain text signature challenge to the user and returns the
signed response. Prepends a safe prefix to the signed message to prevent the challenge
tricking users into signing a financial transaction.
<br><br>
MetaMask implements `personal_sign` similarly to the Go Ethereum client's `eth_sign`
implementation. MetaMask's `personal_sign` doesn't accept a password.
<br><br>
This method requires that the user has granted permission to interact
with their account first, so make sure to call `eth_requestAccounts` (recommended)
or `wallet_requestPermissions` first.
deprecated: false
params:
- name: Challenge
required: true
description: >-
A hex-encoded UTF-8 string to present to the user. See how to encode a
string like this in the
[`browser-string-hexer`](https://github.com/danfinlay/browser-string-hexer)
module.
schema:
type: string
pattern: '^0x[a-fA-F\d]+$'
- name: Address
required: true
description: The address of the requested signing account.
schema:
type: string
pattern: '^0x[0-9a-fA-F]{40}$'
result:
name: Signature
description: A hex-encoded signature.
schema:
type: string
pattern: '^0x[0-9a-f]*$'
examples:
- name: personal_sign example
params:
- name: Challenge
value: '0x506c65617365207369676e2074686973206d65737361676520746f20636f6e6669726d20796f7572206964656e746974792e'
- name: Address
value: '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7'
result:
name: Signature
value: '0x43d7215ebe96c09a5adac69fc76dea5647286b501954ea273e417cf65e6c80e1db4891826375a7de02467a3e01caf125f64c851a8e9ee9467fd6f7e83523b2115bed8e79d527a85e28a36807d79b85fc551b5c15c1ead2e43456c31f565219203db2aed86cb3601b33ec3b410836d4be7718c6148dc9ac82ecc0a04c5edecd8914'
- name: eth_signTypedData_v4
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Restricted'
- $ref: '#/components/tags/Multichain'
summary: Presents a structured data message for the user to sign.
description: >-
Presents a data message for the user to sign in a structured and readable
format and returns the signed response. Introduced by
[EIP-712](https://eips.ethereum.org/EIPS/eip-712).
This method requires that the user has granted permission to interact with their account first,
so make sure to call `eth_requestAccounts` (recommended) or `wallet_requestPermissions` first.
params:
- name: Address
required: true
description: The address of the requested signing account.
schema:
type: string
pattern: '^0x[0-9a-fA-F]{40}$'
- name: Typed data
required: true
schema:
$ref: '#/components/schemas/TypedData'
result:
name: Signature
description: A hex-encoded signature.
schema:
type: string
pattern: '^0x[0-9a-f]*$'
examples:
- name: eth_SignTypedData_v4 example
params:
- name: Address
value: '0x0000000000000000000000000000000000000000'
- name: Typed data
value:
types:
EIP712Domain:
- name: name
type: string
- name: version
type: string
- name: chainId
type: uint256
- name: verifyingContract
type: address
Person:
- name: name
type: string
- name: wallet
type: address
Mail:
- name: from
type: Person
- name: to
type: Person
- name: contents
type: string
primaryType: Mail
domain:
name: Ether Mail
version: '1'
chainId: 1
verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC'
message:
from:
name: Cow
wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826'
to:
name: Bob
wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB'
contents: 'Hello, Bob!'
result:
name: Signature
value: >-
0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c
- name: wallet_registerOnboarding
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Multichain'
summary: Redirects the user back to the site after onboarding.
description: >-
Registers the requesting site with MetaMask as the initiator of
onboarding, enabling MetaMask to redirect the user back to the site after
onboarding. Returns a promise that resolves to `true`, or rejects the request if
there's an error. Instead of calling this method directly, you should use
the
[`@metamask/onboarding`](https://github.com/MetaMask/metamask-onboarding)
library.
params: []
result:
name: Registered
description: '`true` if the request was successful, `false` otherwise.'
schema:
type: boolean
examples:
- name: wallet_registerOnboarding example
params: []
result:
name: Registered
value: true
- name: wallet_watchAsset
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Experimental'
- $ref: '#/components/tags/Multichain'
summary: Tracks a token in MetaMask.
description: >-
Requests that the user track the specified token in MetaMask. Returns a
boolean indicating if the token was successfully added. Once added, the
token is indistinguishable from those added using legacy methods, such as
a centralized registry. Introduced by
[EIP-747](https://eips.ethereum.org/EIPS/eip-747).
paramStructure: by-name
params:
- name: type
schema:
type: string
description: >-
The token type (`ERC20`, `ERC721`, or `ERC1155`). Support for ERC-721
and ERC-1155 tokens is experimental and currently only available on
the extension (not on mobile). See
[MIP-1](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md)
and the [MIP proposal
lifecycle](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle)
for more information.
enum:
- ERC20
- ERC721
- ERC1155
required: true
- name: options
schema:
description: An object containing information about the token.
type: object
required:
- address
properties:
address:
description: The address of the token contract.
type: string
symbol:
description: >-
A ticker symbol or shorthand, up to 11 characters (optional for
ERC-20 tokens).
minLength: 2
maxLength: 11
type: string
decimals:
description: The number of token decimals (optional for ERC-20 tokens).
type: number
image:
description: A string URL of the token logo (optional for ERC-20 tokens).
type: string
tokenId:
description: >-
The unique identifier of the NFT (required for ERC-721 and
ERC-1155 tokens).
type: string
errors:
- code: -32602
message: 'Must specify address, symbol, and decimals.'
- code: -32602
message: 'Invalid symbol: not a string.'
- code: -32602
message: 'Invalid symbol ''${symbol}'': longer than 11 characters.'
- code: -32602
message: 'Invalid decimals ''${decimals}'': must be 0 <= 36.'
- code: -32602
message: 'Invalid address ''${address}''.'
- code: -32602
message: Asset type is required.
- code: -32602
message: Both address and tokenId are required.
- code: -32602
message: Invalid address.
- code: -32000
message: Suggested NFT is not owned by the selected account.
- code: -32000
message: >-
Suggested NFT of type ${standard} does not match received type
${type}.
- code: -32002
message: >-
Unable to verify ownership. Possibly because the standard is not
supported or the user's currently selected network does not match the
chain of the asset in question.
result:
name: Added
description: '`true` if the token was added, `false` otherwise.'
schema:
type: boolean
examples:
- name: wallet_watchAsset ERC-20 example
params:
- name: type
value: ERC20
- name: options
value:
address: '0xb60e8dd61c5d32be8058bb8eb970870f07233155'
symbol: FOO
decimals: 18
image: 'https://foo.io/token-image.svg'
result:
name: Added
value: true
- name: wallet_watchAsset ERC-721 example
params:
- name: type
value: ERC721
- name: options
value:
address: '0x123456789abcdef0123456789abcdef01234567'
tokenId: '42'
result:
name: Added
value: true
- name: wallet_watchAsset ERC-1155 example
params:
- name: type
value: ERC1155
- name: options
value:
address: '0xabcdef0123456789abcdef0123456789abcdef01'
tokenId: '1337'
result:
name: Added
value: true
- name: wallet_scanQRCode
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Mobile'
- $ref: '#/components/tags/Multichain'
summary: Requests that the user scan a QR code.
description: >-
Requests that the user scan a QR code using their device camera.
Introduced by [EIP-945](https://github.com/ethereum/EIPs/issues/945).
params:
- name: Regex
required: false
description: >-
A regular expression (regex) string for matching arbitrary QR code
strings.
schema:
type: string
title: regex
result:
name: QR code string
description: >-
A string corresponding to the scanned QR code. If a regex string is
provided, the resulting string matches it. If no regex string is
provided, the resulting string matches an Ethereum address. If neither
condition is met, the method returns an error.
schema:
type: string
title: QR code string
- name: wallet_sendCalls
tags:
- $ref: '#/components/tags/MetaMask'
summary: Sends a batch of calls.
description: >-
Requests that the wallet submits a batch of calls. Specified by
[EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).
params:
- name: Calls
required: true
schema:
$ref: '#/components/schemas/SendCallsParameter'
result:
name: Batch result
schema:
description: An object containing information about the sent batch.
type: object
properties:
id:
description: The ID of the batch of calls.
type: string
capabilities:
description: >-
Wallets can use this object to attach capability-specific metadata.
type: object
errors:
- $ref: '#/components/errors/InvalidParams'
- code: -32000
message: Version not supported.
- $ref: '#/components/errors/UserRejected'
- $ref: '#/components/errors/Unauthorized'
- code: 5700
message: >-
The wallet does not support a capability that was not marked as optional.
- code: 5710
message: EIP-7702 not supported on the specified chain ID.
- code: 5720
message: There is already a batch submitted with the specified batch ID.
- code: 5740
message: The batch is too large for the wallet to process.
- code: 5750
message: EIP-7702 upgrade rejected for this chain and account.
examples:
- name: wallet_sendCalls example
params:
- name: Calls
value:
version: '2.0.0'
from: '0xd46e8dd67c5d32be8058bb8eb970870f07244567'
chainId: '0xaa36a7'
atomicRequired: true
calls:
- to: '0x54f1C1965B355e1AB9ec3465616136be35bb5Ff7'
value: '0x0'
- to: '0x2D48e6f5Ae053e4E918d2be53570961D880905F2'
value: '0x0'
result:
name: Batch result
value:
id: '0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
- name: wallet_getCallsStatus
tags:
- $ref: '#/components/tags/MetaMask'
summary: Gets the status of a call batch.
description: >-
Gets the status of a batch of calls that was previously sent using
`wallet_sendCalls`. Specified by
[EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).
params:
- name: Batch ID
required: true
description: >-
The ID of a batch of calls (the `id` value returned by `wallet_sendCalls`).
schema:
type: string
result:
name: Batch status
schema:
description: >-
An object containing status information of the batch of calls.
type: object
properties:
version:
description: The version of the API format.
type: string
id:
description: The ID of the batch of calls.
$ref: '#/components/schemas/uint'
chainId:
description: The chain ID of the calls.
$ref: '#/components/schemas/uint'
status:
description: >-
The status code of the batch of calls. Possible values are:
<br>
<ul>
<li>`100` - Pending</li>
<li>`200` - Confirmed</li>
<li>`400` - Failed offchain</li>
<li>`500` - Reverted</li>
<li>`600` - Partially reverted</li>
</ul>
type: number
atomic:
description: >-
`true` if the wallet executed the calls atomically. `false` if the
wallet executed the calls non-atomically.
type: boolean
receipts:
description: >-
An array of transaction receipts. If the wallet executed the calls
atomically, a single receipt or an array of receipts may be returned,
corresponding to how the batch of calls were included onchain.
type: array
items:
title: Receipt
description: A transaction receipt object.
type: object
properties:
logs:
description: An array of log objects.
type: array
items:
title: Log
description: An object containing information about the log.
type: object
properties:
address:
description: The address that generated the log.
type: string
pattern: '^0x[0-9a-fA-F]{40}$'
data:
description: The data of the log.
type: string
pattern: '^0x[0-9a-f]*$'
topics:
description: An array of log topics.
type: array
items:
title: Topic
description: A log topic.
type: string
pattern: '^0x[0-9a-f]*$'
status:
description: >-
The status of the transaction. `0x1` indicates success, and `0x0`
indicates failure.
type: string
pattern: '^0x[0-1]$'
blockHash:
description: The hash of the block containing the transaction.
type: string
pattern: '^0x[0-9a-f]{64}$'
blockNumber:
description: The number of the block containing the transaction.
type: string
pattern: '^0x([1-9a-f]+[0-9a-f]*|0)$'
gasUsed:
description: The amount of gas used by the transaction.
type: string
pattern: '^0x([1-9a-f]+[0-9a-f]*|0)$'
transactionHash:
description: The hash of the transaction.
type: string
pattern: '^0x[0-9a-f]{64}$'
additionalProperties: true
capabilities:
description: Capabilities associated with the batch of calls.
type: object
additionalProperties: true
errors:
- $ref: '#/components/errors/InvalidParams'
- $ref: '#/components/errors/Unauthorized'
- code: 5730
message: No matching bundle found.
examples:
- name: wallet_getCallsStatus example
params:
- name: Batch ID
value: '0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
result:
name: Batch status
value:
version: '2.0.0'
chainId: '0xaa36a7'
id: '0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
status: 200
atomic: true
receipts:
- logs:
- address: '0xa922b54716264130634d6ff183747a8ead91a40b'
topics:
- '0x5a2a90727cc9d000dd060b1132a5c977c9702bb3a52afe360c9c22f0e9451a68'
data: '0xabcd'
status: '0x1'
blockHash: '0xf19bbafd9fd0124ec110b848e8de4ab4f62bf60c189524e54213285e7f540d4a'
blockNumber: '0xabcd'
gasUsed: '0xdef'
transactionHash: '0x9b7bb827c2e5e3c1a0a44dc53e573aa0b3af3bd1f9f5ed03071b100bb039eaff'
- name: wallet_getCapabilities
tags:
- $ref: '#/components/tags/MetaMask'
summary: Gets the capabilities of the wallet.
description: >-
Returns information about the wallet's support for the `atomic`
capability. The `atomic` capability specifies how the wallet will
execute batches of transactions sent using `wallet_sendCalls`.
`wallet_getCapabilities` is specified by
[EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).
params:
- name: Address
description: A wallet address.
required: true
schema:
type: string
pattern: '^0x[0-9a-fA-F]{40}$'
- name: Chain IDs
description: An array of chain IDs to get capabilities for.
schema:
type: array
items:
title: Chain ID
description: >-
An [EIP-155](https://eips.ethereum.org/EIPS/eip-155)
chain ID in hexadecimal format.
$ref: '#/components/schemas/uint'
result:
name: Capabilities
schema:
description: >-
An object specifying the status of the `atomic` capability for
specific [EIP-155](https://eips.ethereum.org/EIPS/eip-155) chain IDs.
For each chain, the `atomic` capability can have a `status` of:
<br>
<ul>
<li>`supported` - The wallet will execute calls sent using
`wallet_sendCalls` atomically.</li>
<li>`ready` - The wallet can upgrade to `supported` pending user
approval to upgrade their account via EIP-7702.</li>
</ul>
If the `atomic` capability is not `supported` or `ready` for a
specified chain ID, the wallet will not return anything for that chain ID.
type: object
errors:
- $ref: '#/components/errors/InvalidParams'
- $ref: '#/components/errors/Unauthorized'
examples:
- name: wallet_getCapabilities example
params:
- name: Address
value: '0xd46e8dd67c5d32be8058bb8eb970870f07244567'
- name: Chain IDs
value:
- '0xaa36a7'
result:
name: Capabilities
value:
'0xaa36a7':
atomic:
status: ready
- name: wallet_requestExecutionPermissions
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Experimental'
- $ref: '#/components/tags/Multichain'
summary: Requests ERC-7715 execution permissions.
description: >-
Requests that the user grant one or more ERC-7715 execution permissions,
allowing a delegate account to perform a constrained set of actions on
behalf of the user's account. Specified by
[ERC-7715](https://eips.ethereum.org/EIPS/eip-7715).
params:
- name: Permission requests
required: true
description: An array of execution permission requests.
schema:
type: array
items:
$ref: '#/components/schemas/ExecutionPermissionRequest'
result:
name: Granted permissions
description: An array of the granted execution permissions.
schema:
type: array
items:
$ref: '#/components/schemas/ExecutionPermissionResponse'
errors:
- $ref: '#/components/errors/InvalidParams'
- $ref: '#/components/errors/UserRejected'
- $ref: '#/components/errors/Unauthorized'
examples:
- name: wallet_requestExecutionPermissions example
params:
- name: Permission requests
value:
- chainId: '0xaa36a7'
to: '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7'
permission:
type: native-token-periodic
isAdjustmentAllowed: true
data:
periodAmount: '0x38d7ea4c68000'
periodDuration: 86400
startTime: 1798761600
justification: Permission to transfer 0.001 ETH every day
rules:
- type: expiry
data:
timestamp: 1893456000
result:
name: Granted permissions
value:
- chainId: '0xaa36a7'
to: '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7'
permission:
type: native-token-periodic
isAdjustmentAllowed: true
data:
periodAmount: '0x38d7ea4c68000'
periodDuration: 86400
startTime: 1798761600
justification: Permission to transfer 0.001 ETH every day
rules:
- type: expiry
data:
timestamp: 1893456000
context: '0x00000000000000000000000000000000000000000000000000000000000000'
delegationManager: '0x2D48e6f5Ae053e4E918d2be53570961D880905F2'
dependencies: []
- name: wallet_getGrantedExecutionPermissions
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Experimental'
- $ref: '#/components/tags/Multichain'
summary: Gets granted ERC-7715 execution permissions.
description: >-
Returns the ERC-7715 execution permissions that the user has previously
granted to the requesting dapp. Specified by
[ERC-7715](https://eips.ethereum.org/EIPS/eip-7715).
params: []
result:
name: Granted permissions
description: An array of the granted execution permissions.
schema:
type: array
items:
$ref: '#/components/schemas/ExecutionPermissionResponse'
errors:
- $ref: '#/components/errors/Unauthorized'
examples:
- name: wallet_getGrantedExecutionPermissions example
params: []
result:
name: Granted permissions
value: []
- name: wallet_getSupportedExecutionPermissions
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Experimental'
- $ref: '#/components/tags/Multichain'
summary: Gets supported ERC-7715 execution permissions.
description: >-
Returns the ERC-7715 execution permission types supported by the wallet,
keyed by permission type, including the chain IDs and rule types each
permission supports. Specified by
[ERC-7715](https://eips.ethereum.org/EIPS/eip-7715).
params: []
result:
name: Supported permissions
description: >-
An object keyed by permission type. Each entry describes the chain IDs
and rule types supported for that permission type.
schema:
type: object
additionalProperties:
type: object
properties:
chainIds:
description: The chain IDs that support the permission type.
type: array
items:
$ref: '#/components/schemas/uint'
ruleTypes:
description: The rule types supported for the permission type.
type: array
items:
type: string
errors:
- $ref: '#/components/errors/Unauthorized'
examples:
- name: wallet_getSupportedExecutionPermissions example
params: []
result:
name: Supported permissions
value:
native-token-periodic:
chainIds:
- '0xaa36a7'
ruleTypes:
- expiry
- name: eth_requestAccounts
tags:
- $ref: '#/components/tags/MetaMask'
description: >-
Requests that the user provide access to one or more Ethereum addresses.
This method is specified by
[EIP-1102](https://eips.ethereum.org/EIPS/eip-1102). Internally, this
method calls `wallet_requestPermissions` for permission to call
`eth_accounts`.
summary: Requests that the user provide access to addresses.
params: []
result:
name: Address list
schema:
type: array
description: >-
An array of Ethereum addresses that the user has authorized the dapp
to access.
items:
title: Address
description: A hex-encoded address.
type: string
pattern: '^0x[0-9a-fA-F]{40}$'
errors:
- $ref: '#/components/errors/UserRejected'
examples:
- name: eth_requestAccounts example
params: []
result:
name: Address list
value:
- '0xa77392123a1085f75e62eec7dea7e0e1e5142d5f'
- name: eth_accounts
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Restricted'
description: >-
Returns a list of addresses that the user has authorized the dapp to access.
This method requires calling `wallet_requestPermissions` for permission.
We recommend using `eth_requestAccounts`, which internally calls `wallet_requestPermission`.
summary: Gets a list of authorized addresses.
params: []
result:
name: Address list
schema:
type: array
description: >-
An array of Ethereum addresses that the user has authorized the dapp
to access.
items:
title: Address
description: A hex-encoded address.
type: string
pattern: '^0x[0-9a-fA-F]{40}$'
examples:
- name: eth_accounts example
params: []
result:
name: Address list
value:
- '0xa77392123a1085f75e62eec7dea7e0e1e5142d5f'
- name: eth_sendTransaction
tags:
- $ref: '#/components/tags/MetaMask'
- $ref: '#/components/tags/Restricted'
- $ref: '#/components/tags/Multichain'
description: >-
Creates a new wallet confirmation to make an Ethereum transaction from the
user's account. This method requires that the user has granted permission
to interact with their account first, so make sure to call `eth_requestAccounts` (recommended)
or `wallet_requestPermissions` first.
summary: Initiates a new transaction.
params:
- name: Transaction
required: true
description: The transaction object to sign and send.
schema: