Luniverse Developer
Search…
Luniverse Developer
Luniverse Developer-eng
Welcome
Release Notes
Luniverse Core Api
TX (Side Chain Transaction)
MX (Main Chain Transaction)
Luniverse Service Api
Loyalty Point
Trace
DID
NFT
Faucet
How to
Luniverse 2.0 Upgrade Guide
Swap Side Tokens to Main Tokens
Swap Main Tokens to Side Tokens
Sending Main Tokens
Issuing Authentication Token
Powered By
GitBook
Swap Side Tokens to Main Tokens
Luniverse provides a way to swap Side Tokens to Main Tokens via following processes:
Create Redeem to Main Token Tx Action
Refer to the link below to create Tx Action from redeem function of side tokens.
Create a Side Token Tx Action
사이드 토큰 Tx Action 생성하기
Created API
https://api.luniverse.io/tx/v2.0/transactions/
{
YOUR_ACITON_NAME
}
Run Redeem to Main Token Tx Action
curl
-X POST
'https://api.luniverse.io/tx/v2.0/transactions/<YOUR_ACTION_NAME>'
\
--header
'Authorization: Bearer <YOUR_API_TOKEN>'
\
--header
'Content-Type: application/json'
\
--data
'{
"txId": "<UUID>",
"from": "<YOUR_EOA_ADDRESS>",
"inputs": {
"valueAmount": "<VALUE_AMOUNT>"
}
}'
txId: You must create and input this in a UUID format each time.
valueAmount: Quantity of tokens you want to transfer * 10 ** <TOKEN_DECIMALS>
TOKEN_DECIMALS represents the decimal value entered when creating the token..
If your decimal is 18 and you want to send 1 token, you would enter "10000000000000000000" which is 1 * 10 to the power of 18.
Token decimals entered when creating tokens.
Running Tx Action might differ in process depending on whether it is EOA and DEOA. Please refer to the link below to run.
Run TxAction
Tx Action 실행하기
Viewing Results
View results via API.
https://api.luniverse.io/mx/v2.0/transactions/redeems/
{
TX_ID or TX_HASH
}
curl
-X GET
'https://api.luniverse.io/mx/v2.0/transactions/redeems/<TX_ID or TX_HASH>'
\
--header
'Authorization: Bearer <YOUR_API_TOKEN>'
\
--header
'Content-Type: application/json'
\
--data
'{
"sideEnvironmentId": "<SIDE_ENVIRONMENT_ID>"
}'
Check whether the main tokens have been sent to the main chain address corresponding to "from" via scan.
https://scan.luniverse.io/accounts/{address}
Previous
2.0 API Upgrade Guide
Next - How to
Swap Main Tokens to Side Tokens
Last modified
5mo ago
Copy link
Outline
Create Redeem to Main Token Tx Action
Created API
Run Redeem to Main Token Tx Action
Viewing Results