2.0 API Upgrade Guide

Change Luniverse 1.X API to 2.0 API

The modifications to be made to change from 1.X API to 2.0 API are as follows:
  1. 1.
    Authentication method
  2. 2.
    API URI
  3. 3.
    API Parameter

Changing the Authentication Method

Issuing Authentication Tokens

In order to call the API in 1.0, you need to create a DApp and get a DApp API Key.
2.0 removes the concept of abstract DApp and instead uses API Key to manage the Privilege API calls. This creates an API Key by granting an API Privilege of an explicitly callable type and calls the API by issuing an authentication token through the generated API Key.
Please refer to the page below and to issue an authentication token.

Chaging Authentication Tokens

Below is an example of changing the newly issued authentication tokens.

Sample: Issued Token Response

{
"result": true,
"status": 200,
"data": {
"authToken": {
"authTokenId": "4126500546387664000",
"accountId": "4091261008918166000",
"iamUserId": "4162667536408060000",
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ2ZXIiOiJ2MSIsInRrbiI6ImNmYmFiOTVkZTEwMGM5ZTIiLCJ0cGUiOiJJQU0iLCJzbHQiOiI4NWJkY2VkNWRmNGY1Yjk2IiwiaWF0IjoxNjI5MzU5MjAzLCJleHAiOjE2Mjk5NjQwMDMsImlzcyI6Imx1bnZzOmJhYXM6YXV0aDpzZXJ2aWNlIn0.pRTdfnZysEDZ7R2oguUB4hGdFoiS4QPU4wQPBTB6LsvlJQXY1TBvZ1e2UMcQ54QIOH7wJT87kIwBscqRFCC000",
"expiryAt": "2021-08-26T07:46:44.000Z"
}
},
"code": "OK"
}
Uses data.authToken.token value

Example: Changing Authentication Token (Inquire mx-api nonce)

curl -X GET 'https://api.luniverse.io/mx/v2.0/wallets/{address}/nonce' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ2ZXIiOiJ2MSIsInRrbiI6ImNmYmFiOTVkZTEwMGM5ZTIiLCJ0cGUiOiJJQU0iLCJzbHQiOiI4NWJkY2VkNWRmNGY1Yjk2IiwiaWF0IjoxNjI5MzU5MjAzLCJleHAiOjE2Mjk5NjQwMDMsImlzcyI6Imx1bnZzOmJhYXM6YXV0aDpzZXJ2aWNlIn0.pRTdfnZysEDZ7R2oguUB4hGdFoiS4QPU4wQPBTB6LsvlJQXY1TBvZ1e2UMcQ54QIOH7wJT87kIwBscqRFCC000' \
--header 'Content-Type: application/json' \
Enter the issued authentication token after Bearer keyword of Authorization.

Changing API URI

Contact us for the APIs that are not lised below.
1.0 service API was written for one of the v1.0, v1.1, and v1.5 URIs.

TX API

Luniverse 1.0 API (Before Change)
Luniverse 2.0 API (After Change)
Description
POST tx/v1.1/transactions/{actionName}
POST tx/v2.0/transactions/{actionName}
Request EOA rawTx
POST tx/v1.1/transactions/{actionName}
POST tx/v2.0/transactions/{actionName}/signedTx
EOA Send Signed Tx
POST tx/v1.1/transactions/{actionName}
POST tx/v2.0/transactions/{actionName}
Run DEOA Tx
GET tx/v1.1/histories/{txId}
GET tx/v2.0/transactions
View history
GET tx/v1.1/histories
GET tx/v2.0/transactions
View history (Bulk)
GET tx/v1.1/receipts/{txHash}
GET tx/v2.0/receipts
View Receipt
GET tx/v1.1/receipts
GET tx/v2.0/receipts
View Receipt (Bulk)
POST tx/v1.1/wallets
POST tx/v2.0/wallets
Create Wallet
GET tx/v1.1/wallets/bridge
GET tx/v2.0/wallet/bridge
View Wallet
GET tx/v1.1/wallets/{address}/{mtSymbol}/balance
GET tx/v2.0/wallets/{address}/{mtSymbol}/balance
View Main Token Balance
GET tx/v1.1/wallets/{address}/{mtSymbol}/{stSymbol}/balance
GET tx/v2.0/wallets/{address}/{mtSymbol}/{stSymbol}/balance
View Side Token Balance

MX API

Luniverse 1.0 API (Before Change)
Luniverse 2.0 API (After Change)
Description
GET mx/v1.0/wallets/{address}/balance
GET mx/v2.0/wallets/{address}/balance
View LUK Balance
GET mx/v1.0/wallet/transfer/raw-tx
GET mx/v2.0/wallet/transfer/raw-tx
Create LUK Transfer Raw Tx
GET mx/v1.0/wallets/{address}/nonce
GET mx/v2.0/wallets/{address}/nonce
View Nonce
POST mx/v1.0/wallets/{address}/sign
POST mx/v2.0/wallets/{address}/sign
Remote Sign
POST mx/v1.0/transaction/send/signed-tx
POST mx/v2.0/transaction/send/signed-tx
Send Signed Tx
GET mx/v1.0/transactions/{txHash}/receipt
GET mx/v2.0/transactions/{txHash}/receipt
View Receipt (TxHash)
mx/v1.0/token/main-tokens/{symbol}/transfer/raw-tx
GET mx/v2.0/token/main-tokens/{symbol}/transfer/raw-tx
Create Main Token Transfer Raw Tx
GET mx/v1.0/transactions/redeems/{txId}
GET mx/v2.0/transactions/redeems/{txId}
View Redeem Result (TxId)
GET mx/v1.0/transactions/redeems/{txHash}
GET mx/v2.0/transactions/redeems/{txHash}
View Redeem Result(TxHash)
POST mx/v1.0/swap/{userAddress}
POST mx/v2.0/swap/{userAddress}
Issue Swap Address
GET mx/v1.0/swap/{swapAddress}/side-chain/address
GET mx/v2.0/swap/{swapAddress}/side-chain-address
View Swap Address

BE API

Luniverse 1.0 API (Before Change)
Luniverse 2.0 API (After Change)
Description
POST be/chains/{chainId}/dc/whitelists
POST mx/v2.0/delegation-contract/whitelist
Register DC Whitelist

Change API Parameter

For detailed parameter information after an updat to 2.0 API, please refer to the API guides below.