Skip to content

Commit 7907227

Browse files
Revert "wallet_swapAsset v1 (#201)" (#289)
1 parent 5062e4b commit 7907227

File tree

1 file changed

+0
-74
lines changed

1 file changed

+0
-74
lines changed

openrpc.yaml

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -872,76 +872,6 @@ methods:
872872
result:
873873
name: eth_unsubscribeExampleResult
874874
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."
931-
examples:
932-
- name: wallet_swapAsset example
933-
params:
934-
- name: SwapAssetParameter
935-
value:
936-
from:
937-
- tokenAddress: '0x1234567890abcdefABCDEF1234567890ABCDEF'
938-
value: '0xDE0B6B3A7640000'
939-
to:
940-
tokenAddress: '0xabcdef1234567890ABCDEF1234567890abcdef'
941-
userAddress: '0x0000000000000000000000000000000000000000'
942-
result:
943-
name: wallet_swapAssetExampleResult
944-
value: true
945875
components:
946876
schemas:
947877
TypedData:
@@ -1127,10 +1057,6 @@ components:
11271057
type: array
11281058
items:
11291059
$ref: '#/components/schemas/Permission'
1130-
Caip10Address:
1131-
title: Caip10Address
1132-
type: string
1133-
description: CAIP-10 defines a way to identify an account/address in any blockchain.
11341060
tags:
11351061
MetaMask:
11361062
name: MetaMask

0 commit comments

Comments
 (0)