WEMIX3.0
Search…
App-to-App API
This page describes the App-to-App API for working dApps with WEMIX Wallet.

Overview and flow

App-to-App is provided through REST API.
No separate authentication procedure is required and it works with HTTPS communication.
The App-to-App API Flow is as follows:
The App-to-App API provides the following connection environments:

Request Run dApp

post
/api/v1/a2a/proposal
Define the job you want to run in the dApp and issue the requestId for the defined job.
About ‘type’
Value
Text
auth
Request wallet address(request approval)
send
Request WEMIX transfer
send_token
Request token transfer
send_nft
Request NFT transfer
contract_execute
Request Contract execution
About ‘metadata’
Attribute
Type
Text
name
string
Name of dApp
description
string
Description of execution
url
string
dApp URL(representative)
icon
string
dApp URL(logo image)
successCallback
string
Information of callback when call for dApp is successful
failureCallback
string
Information of callback when call for dApp fails
About ‘transaction’
Attribute
Type
Text
from
string
Sender's address (Wallet User Verification Purpose)
to
string
Transaction) Address of recipient
Smart Contract) Address of contract
value
string
Amount of token to transfer (unit : 10^18)
tokenId
string
Token id of NFT
contract
string
Contract address when transferring tokens and NFTs
params
string
Function parameters when executing smart contracts
abi
string
Function abi when executing smart contracts
Example) Create and connect wallet
{
"type": "auth",
"metadata": {
"name": "dApp NAME",
"description": "Request Description",
"url": "dApp representative URL",
"icon": "dApp logo image URL",
"successCallback": "Callback information to process when dApp request is successful",
"failureCallback": "Callback information to process when dApp request is fail"
}
}
Example) Transfer WEMIX
{
"type": "send",
"metadata": {
"name": "dApp NAME",
"description": "Request Description",
"url": "dApp representative URL",
"icon": "dApp logo image URL",
"successCallback": "Callback information to process when dApp request is successful",
"failureCallback": "Callback information to process when dApp request is fail"
},
"transaction": {
"from": "fromAddress",
"to": "toAddress",
"value": "10000000"
}
}
Example) Transfer token
{
"type": "send_token",
"metadata": {
"name": "dApp NAME",
"description": "Request Description",
"url": "dApp representative URL",
"icon": "dApp logo image URL",
"successCallback": "Callback information to process when dApp request is successful",
"failureCallback": "Callback information to process when dApp request is fail"
},
"transaction": {
"from": "fromAddress",
"to": "toAddress",
"value": "10000000",
"contract": "contract"
}
}
Example) Transfer NFT
{
"type": "send_nft",
"metadata": {
"name": "dApp NAME",
"description": "Request Description",
"url": "dApp representative URL",
"icon": "dApp logo image URL",
"successCallback": "Callback information to process when dApp request is successful",
"failureCallback": "Callback information to process when dApp request is fail"
},
"transaction": {
"from": "fromAddress",
"to": "toAddress",
"contract": "nftContract",
"tokenId": "testTokenId"
}
}
Example) Execute smart contract
{
"type": "contract_execute",
"metadata": {
"name": "dApp NAME",
"description": "Request Description",
"url": "dApp representative URL",
"icon": "dApp logo image URL",
"successCallback": "Callback information to process when dApp request is successful",
"failureCallback": "Callback information to process when dApp request is fail"
},
"transaction": {
"from": "fromAddress",
"to": "toAddress",
"abi": "{\"name\": \"transfer\", \"type\": \"function\", \"inputs\": [{ \"name\": \"to\", \"type\": \"address\", \"internalType\": \"address\" }, { \"name\": \"amount\", \"type\": \"uint256\", \"internalType\":\"uint256\"}], \"outputs\": [{\"name\": \"\", \"type\": \"bool\", \"internalType\": \"bool\" }], \"stateMutability\": \"nonpayable\"}",
"params": "testParams"
}
}

View dApp Result

get
/api/v1/a2a/result
?requestId={requestwork requestId}
Show execution results.
About ‘status’
Value
Text
proposal
Execution requested
completed
Execution completed
canceled
Execution canceled

Error Code

Examples of error codes:
{
"errorCode": 3611,
"errorMessage": "invalid type",
"status": 400
}
Status code
Error Code
Description
400
3610
type is required
3611
invalid type
3612
transaction is required
3613
requestId is not found
3614
requestId is required
500
500
server error
Copy link
On this page
Overview and flow
Request Run dApp
post
Define the job you want to run in the dApp and issue the requestId for the defined job.
View dApp Result
get
Show execution results.
Error Code