You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openrpc.yaml
-74Lines changed: 0 additions & 74 deletions
Original file line number
Diff line number
Diff line change
@@ -872,76 +872,6 @@ methods:
872
872
result:
873
873
name: eth_unsubscribeExampleResult
874
874
value: true
875
-
- name: wallet_swapAsset
876
-
tags:
877
-
- $ref: '#/components/tags/MetaMask'
878
-
- $ref: '#/components/tags/Experimental'
879
-
summary: Allows dApps to request MetaMask to perform a token swap operation.
880
-
description: >-
881
-
This method enables dApps to initiate a token swap directly within MetaMask, improving the user experience by streamlining the process of swapping tokens. The method accepts parameters for the source and destination tokens and initiates a token swap operation.
882
-
params:
883
-
- name: SwapAssetParameter
884
-
required: true
885
-
schema:
886
-
title: SwapAssetParameter
887
-
type: object
888
-
required:
889
-
- fromToken
890
-
- toToken
891
-
- userAddress
892
-
properties:
893
-
fromToken:
894
-
type: array
895
-
items:
896
-
type: object
897
-
required:
898
-
- address
899
-
properties:
900
-
address:
901
-
type: string
902
-
description: The CAIP-10 formatted address of the source token.
903
-
$ref: '#/components/schemas/Caip10Address'
904
-
value:
905
-
type: string
906
-
description: (Optional) The amount of the source token to be swapped, in wei, as a hexadecimal string, defaults to 0.
907
-
nullable: true
908
-
toToken:
909
-
type: object
910
-
required:
911
-
- address
912
-
properties:
913
-
address:
914
-
type: string
915
-
description: The CAIP-10 formatted address of the destination token.
916
-
$ref: '#/components/schemas/Caip10Address'
917
-
userAddress:
918
-
type: string
919
-
description: The CAIP-10 formatted address of the user performing the swap.
920
-
$ref: '#/components/schemas/Caip10Address'
921
-
result:
922
-
name: SwapAssetResult
923
-
description: A boolean indicating if the swap was initiated successfully.
924
-
schema:
925
-
type: boolean
926
-
errors:
927
-
- code: 6000
928
-
message: "Swap is not available on this chain {{chainName}}"
929
-
- code: -32600
930
-
message: "Cross-chain swaps are currently not supported. Both fromToken and toToken must be on the same blockchain."
0 commit comments