한글 Back to top

Tx API for Luniverse

Summary

This is a general guide for using Tx API to execute Transaction Action which is defined in Luniverse through Restful API

Luniverse provides guides for two types of API Luniverse API and Tx API separately Luniverse API helps you building Chain Infrastructure and define Token and Transaction Tx API helps you execute Transaction Action which is defined in Luniverse API through Restful API

Tx API can’t be used alone and can be used after predefining DApp and Transaction Action using Luniverse Console or Lunivere API

Changes

  • 2019.05.21 Initial Creation

  • 2019.06.17 TxHash delete, Add Tx Histories API (Please refer to the separate notice for details.)

  • 2019.06.25 Add MFA Verification Token

  • 2019.07.26 Add Analytics API

  • 2019.09.03 Add Vault API (BETA)

Terms

  • Transaction Action: Transaction Action also named as Action is that defined in advance to execute contract function through Restful API in Luniverse

  • DApp: DApp is a parent concept that needs to be created advanced in order to define Transaction Action in Luniverse

  • (DApp) API Key: Authorization Key for verifying the permissions of DApp. Each DApp has one API Key

  • EOA: External Owned Account. This is the Wallet Address on the blockchain managed by Private Key or Key Store

  • REOA: Remote EOA. This is the EOA that Private Key corresponding to EOA is delegated to Luniverse

  • LEOA: Local EOA. This is the EOA that Private Key corresponding to EOA is directly managed by DApp developers

  • Raw Tx: Data object in JSON format containing the from address and params parameters of the Transaction to be executed

  • Signed Tx: Hex String signed Raw Tx with the Private Key of from address

Authorization

  • All APIs are authorized with the Bearer Authentication value of Authorization Header
Authorization: Bearer DAPP_API_KEY

Response

For all APIs, HTTP Status Code 2xx is considered a success. For 4xx errors, exceptions should be made according to what is defined by each API Action. In general, there is no additional work to be done on Dapp developer’s side for 5xx errors, however if they occur on a continuous basis, this may not be made an exception to the incorrect request, so please contact us via Luniverse Channel or mail to support@lambda256.io

Successes Response

A JSON object with a value of result as true will be returned as a success response. data will be returned additionally if there is a response value.

StatusCode: 200
{
  "result": true,
  "data": {
    ..
  }
}

Failed Response

A JSON object with a value of result as false will be returned as a failed response. If necessary, message will be returned additionally to present details of the error. Exceptions for errors should be handled by its HTTP Status Code, and each API has different procedure. For details please refer to the documents of each API

StatusCode: 4xx 5xx
{
  "result": false,
  "message": "An error has occurred."
}

Transaction

There are two types of executing defined Transaction Action

  • Using REOA, Tx API sends the request to blockchain immediately upon call without return the Raw Tx

  • Using LEOA, Tx API will return Raw Tx, the client sign on Raw Tx directly and recall Signed Tx and Tx API sends the request to the blockchain

HTTP Path is same for both using REOA and using LEOA, however client should process both two types of returned responses depending on whether the Raw Tx is returned or not

Transaction Parameters

Client should pass the parameters when executing the Transaction Action. For user deployed contract, pass a JSON object that has key-value where ‘Contract Function’ parameter value is equal to ‘Parameter Name’ & ‘Value’. For Luniverse Side Token Contract Function, please refer to API Sample Curl script on Luniverse Console.

State Modifier

Whether the Smart Contract Programming changes the State or not determines whether a signature is required when calling a Transaction Action

When State Modifier of Contract Function is displayed as view or pure, the smart contract programming doesn’t change the State, so the response will be returned without Raw Tx. Other State Modifier is supposed to be the Function that changes the State and return Raw Tx(except for REOA) and request Signed Tx

409 Error

Returned if EVM fails to handle Read Tx (view or pure). Please check the code value returned.

HTTP Status Code is returned as 409 in the form shown below

{
  result: false,
  code: 'CONFLICT',
  reason: {
    error: -32000,
    code: 'VM-FAILED'
  }
}
  • UNKNOWN: For unknown errors, for details please contact Luniverse Channel or mail to support@lambda256.io

  • VM-FAILED: EVM execution aborted by the code such as Require in Contract code

  • INSUFFICIENT-GAS: If GAS runs out while running EVM, please avoid utilizing complex operations or loops in contract code.

  • TIMEOUT: Timeout while running EVM

Transactions - LEOA

This is the case when a request is made by LEOA. Please refer to the Action Execution (REOA) API when requesting REOA.

Raw Tx Request
POST/v1.0/transactions/{actionName}

API for requesting Raw Tx

The rawTx returned to Response must be signed directly to the Private Key corresponding to the from address and the API Acted Tx below must be called. If rawTx parameters changed, Transaction may not run normally.

There is no restriction on how to sign Raw Tx, and we highly recommend using ethereumjs-tx in the JavaScript / Node.js environment.

const EthereumTx = require('ethereumjs-tx');
const privateKey = Buffer.from('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex');

// const apiResponse = {
//   "result": true,
//   "data": {
//     "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
//     "rawTx": {
//       "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
//       "to": "0x51a4f1865b2869a0c237de8a8650cf7bf6883465",
//       "data": "0x60fe47b1000000000000000000000000000000000000000000000000000000000000006f",
//       "nonce": "0x167a1a2a1ad",
//       "gasLimit": "0x989680",
//       "gasPrice": "0x0"
//     }
//   }
// }

const tx = new EthereumTx(apiResponse.data.rawTx);
tx.sign(privateKey);

const signedTx = tx.serialize().toString('hex');

You can find out how to use ethereumjs-tx be found at https://github.com/ethereumjs/ethereumjs-tx

ethereumjs-tx recommends using the 1.3.x version in relation to the issue of EIP-155. When using the 2.x version, a separate code is required to initialize the chainId returned to rawTx object.

400 Error

Returned if the entered parameter is invalid. Please check the detailed error message.

Example URI

POST https://api.luniverse.io/tx/v1.0/transactions/setValue
URI Parameters
HideShow
actionName
string (required) Example: setValue

Transaction Action name defined at Luniverse console

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
  "inputs": {
    "_to": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
    "_amount": "1000000000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "description": "From Address (42 characters Hex String starting with 0x)"
    },
    "inputs": {
      "type": "object",
      "properties": {
        "_to": {
          "type": "string",
          "description": "Parameters defined in the Contract Function"
        },
        "_amount": {
          "type": "string",
          "description": "Parameters defined in the Contract Function"
        }
      },
      "required": [
        "_to",
        "_amount"
      ],
      "description": "Parameter to call when executing transaction"
    }
  },
  "required": [
    "from",
    "inputs"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
    "rawTx": {
      "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
      "to": "0x51a4f1865b2869a0c237de8a8650cf7bf6883465",
      "data": "0x60fe47b1000000000000000000000000000000000000000000000000000000000000006f",
      "nonce": "0x167a1a2a1ad",
      "gasLimit": "0x989680",
      "gasPrice": "0x0"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "description": "From Address"
        },
        "rawTx": {
          "type": "object",
          "properties": {
            "from": {
              "type": "string",
              "description": "From Address"
            },
            "to": {
              "type": "string",
              "description": "To Address"
            },
            "data": {
              "type": "string"
            },
            "nonce": {
              "type": "string",
              "description": "Nonce"
            },
            "gasLimit": {
              "type": "string",
              "description": "Gas Limit"
            },
            "gasPrice": {
              "type": "string",
              "description": "Gas Price"
            }
          },
          "description": "RawTx"
        }
      },
      "description": "Request result"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The specified parameter is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}

Send Signed Tx
POST/v1.0/transactions/{actionName}

API for sending Signed Tx

Tx Callback

Callback for Tx run results is sent to POST request with JSON Body as the answer object.

app.post('/callback', function(res) {
  const txStatus = res.data.txStatus; // Transaction result
  const txId = res.data.txId; // Unique ID for Transaction managed by TxAPI
  const txHash = res.data.txHash; // Hash value for Transaction call
})

Example URI

POST https://api.luniverse.io/tx/v1.0/transactions/setValue
URI Parameters
HideShow
actionName
string (required) Example: setValue

Transaction Action name defined at Luniverse console

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "signedTx": "0xc7daed2582b9bf66acc381e67bb1afedf35bb376",
  "callbackUrl": "http://callback.luniverse.io/tx"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "signedTx": {
      "type": "string",
      "description": "Raw Tx signed with Private Key"
    },
    "callbackUrl": {
      "type": "string",
      "description": "(Optional) URL to receive result callback when Tx Receipt is created"
    }
  },
  "required": [
    "signedTx"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "txId": "1234567890",
    "txHash": "0xce639cff29fba1da679d8ac44e5539c305e8bff1a4a5937d12d10a08ae264e8b",
    "reqTs": 1548076718356
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "txId": {
          "type": "string",
          "description": "(BigInt String) Tx ID managed by Luniverse"
        },
        "txHash": {
          "type": "string",
          "description": "Tx Hash"
        },
        "reqTs": {
          "type": "number",
          "description": "Requested server time (Epoch Timestamp)"
        }
      },
      "description": "Request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Request Not Allowed."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

Transactions - REOA

REOA Action Execution
POST/v1.0/transactions/{actionName}

API for Transaction Action Execution

400 Error

Returned if the entered parameter is invalid. Please check the detailed error message.

Example URI

POST https://api.luniverse.io/tx/v1.0/transactions/setValue
URI Parameters
HideShow
actionName
string (required) Example: setValue

Transaction Action name defined at Luniverse console

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
  "inputs": {
    "_to": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
    "_amount": "1000000000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "description": "From Address (42 characters Hex String starting with 0x)"
    },
    "inputs": {
      "type": "object",
      "properties": {
        "_to": {
          "type": "string",
          "description": "Defined parameter by Contract Function"
        },
        "_amount": {
          "type": "string",
          "description": "Defined parameter by Contract Function"
        }
      },
      "required": [
        "_to",
        "_amount"
      ],
      "description": "Parameter call when executing transaction"
    }
  },
  "required": [
    "from",
    "inputs"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "txId": "1234567890",
    "txHash": "0xce639cff29fba1da679d8ac44e5539c305e8bff1a4a5937d12d10a08ae264e8b",
    "reqTs": 1548076718356
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "txId": {
          "type": "string",
          "description": "(BigInt String) Tx ID managed by Luniverse"
        },
        "txHash": {
          "type": "string",
          "description": "Tx Hash"
        },
        "reqTs": {
          "type": "number",
          "description": "Requested server time (Epoch Timestamp)"
        }
      },
      "description": "Request result"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The specified parameter is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

MFA Action Execution
POST/v1.0/transactions/{actionName}

API for executing Transaction Action with MFA

When defining the Transaction Action in the Luniverse Console, the MFA property is activated, the Transaction Action setting and Token are required. (However, LEOA is signed directly by the user and will be ignored even if the MFA setting is enabled.)

400 Error

Returned if the input parameter is invalid. Please check the detailed error message.

428 Error

If REOA specified in from is not set in MFA, then it will be returned. It can be called only for the REOA with completed MFA setting.

Example URI

POST https://api.luniverse.io/tx/v1.0/transactions/setValue
URI Parameters
HideShow
actionName
string (required) Example: setValue

Transaction Action name defined at Luniverse console

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "mfaToken": "123456",
  "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
  "inputs": {
    "_to": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
    "_amount": "1000000000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "mfaToken": {
      "type": "string",
      "description": "Token corresponding to registered MFA (Six digit number)"
    },
    "from": {
      "type": "string",
      "description": "From Address (42 characters Hex String starting with 0x)"
    },
    "inputs": {
      "type": "object",
      "properties": {
        "_to": {
          "type": "string",
          "description": "Parameter defined in the Contract Function"
        },
        "_amount": {
          "type": "string",
          "description": "Defined parameter by Contract Function"
        }
      },
      "required": [
        "_to",
        "_amount"
      ],
      "description": "Parameter call when executing Transaction"
    }
  },
  "required": [
    "mfaToken",
    "from",
    "inputs"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "txId": "1234567890",
    "txHash": "0xce639cff29fba1da679d8ac44e5539c305e8bff1a4a5937d12d10a08ae264e8b",
    "reqTs": 1548076718356
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "txId": {
          "type": "string",
          "description": "(BigInt String) Tx ID managed by Luniverse"
        },
        "txHash": {
          "type": "string",
          "description": "Tx Hash"
        },
        "reqTs": {
          "type": "number",
          "description": "Requested server time (Epoch Timestamp)"
        }
      },
      "description": "Request result"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The specified parameter is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}
Response  428
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "MFA Setup Required."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

MFA Action excution (Authentication token based)
POST/v1.0/transactions/{actionName}

API to execute Transaction Action with MFA as MFA authentication token (MFA Authentication token based)

400 Error

Returned if the entered parameter is invalid. Please check the detailed error message.

428 Error

If the REOA specified in from is not MFA set, it is returned. It can be called only for REOA where MFA setup is completed.

Example URI

POST https://api.luniverse.io/tx/v1.0/transactions/setValue
URI Parameters
HideShow
actionName
string (required) Example: setValue

Transaction Action name defined in Luniverse

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Wallet-Auth-Token: WALLET_AUTH_TOKEN
Body
{
  "from": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
  "inputs": {
    "_to": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276",
    "_amount": "1000000000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "description": "From Address (Hex String of 42 characters starting with 0x)"
    },
    "inputs": {
      "type": "object",
      "properties": {
        "_to": {
          "type": "string",
          "description": "Parameters defined in Contract Function"
        },
        "_amount": {
          "type": "string",
          "description": "Parameters defined in Contract Function"
        }
      },
      "required": [
        "_to",
        "_amount"
      ],
      "description": "Parameter to call when executing transaction"
    }
  },
  "required": [
    "from",
    "inputs"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "txId": "1234567890",
    "reqTs": 1548076718356
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "txId": {
          "type": "string",
          "description": "(BigInt String) Tx ID managed by Luniverse"
        },
        "reqTs": {
          "type": "number",
          "description": "Server time the request was received (Epoch Timestamp)"
        }
      },
      "description": "Request result"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The specified parameter is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}
Response  428
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "MFA Setup Required."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

History

Tx Histories

API to get Transaction call history.

get Tx History
GET/v1.0/histories/{txId}

API to get Transaction History

403 Error

Returned if you do not have permission to access the TxId.

404 Error

Returns if TxHash is not found.

Example URI

GET https://api.luniverse.io/tx/v1.0/histories/1234
URI Parameters
HideShow
txId
string (required) Example: 1234

TxId

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "txStatus": "WAIT"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json (This is the result of an API call rather than a success in Tx. Confirmation of Tx result should be done with data.staus value)"
    },
    "data": {
      "type": "object",
      "properties": {
        "txStatus": {
          "type": "string",
          "enum": [
            "WAIT",
            "SENT",
            "SUCCEED",
            "FAILED",
            "CONFLICT"
          ],
          "description": "Tx Status\n\n`WAIT`: Status before requesting Tx execution with Chain\n`SENT`: Requested to run Tx with Chain\n`SUCCEED`: When processing for Tx execution requested by Chain is successful\n`FAILED`: When processing for Tx execution requested by Chain fails\n`CONFLICT`: When Tx cannot be processed due to the load of the chain"
        }
      },
      "description": "Request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Permission denied."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Tx histories not found with the specified txId."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

get Tx History (Bulk)
GET/v1.0/histories/

API to get Transaction History (Bulk)

Example URI

GET https://api.luniverse.io/tx/v1.0/histories/
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "txIds": [
    "12345"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "txIds": {
      "type": "array",
      "description": "Tx ID list"
    }
  },
  "required": [
    "txIds"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "histories": {
      "items": [
        {
          "txId": "12345",
          "...": "..."
        }
      ]
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "properties": {
        "histories": {
          "type": "object",
          "properties": {
            "items": {
              "type": [
                "array",
                "null"
              ],
              "description": "List of Receipts"
            }
          },
          "required": [
            "items"
          ],
          "additionalProperties": false,
          "description": "Receipts"
        }
      },
      "description": "Request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Permission denied."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Tx id not found with the specified txHash."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

Receipt

Tx Receipts

API to get Receipt corresponding to Transaction execution result

get Tx Receipt
GET/v1.0/receipts/{txHash}

API to get Transaction Receipt

The value of the address type of event Emit result returned to Receipt.Logs is processed by converting it to toChecksumAddress inside the chain, which may differ from the value used for the actual call and the value returned to Recip.Logs. For accurate comparison, you need to convert using toChecksumAddress included in web3 Utilities, or use Case Insensitive comparison.

Reference: EIP-55, Mixed-case checksum address encoding

403 Error

Returned if you do not have permission to access TxHash.

404 Error

Returned if TxHash is not found

Example URI

GET https://api.luniverse.io/tx/v1.0/receipts/0xfe7665bba4267aeac07fc234bd86a4db585585f108f9fd46264adeea56e8d91c
URI Parameters
HideShow
txHash
string (required) Example: 0xfe7665bba4267aeac07fc234bd86a4db585585f108f9fd46264adeea56e8d91c

TxHash (0x[0-9ABCDEFabcdef]{1,64}

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "txStatus": "SUCCEED",
    "receipt": {
      "status": true,
      "from": "0x9fea2f03a59a4aaa82a704aefc962a8aa4e5daea",
      "to": "0x3ec7c55c9105d5d203e36c58a1927f45a3d9a1f4",
      "blockHash": "0x36c5c3972bd861891e5efa52f10a53ee7e2a1af68fa320ffebe3483cb6d7390b",
      "logs": [
        {
          "name": "Transfer",
          "inputs": {
            "key": "Key",
            "value": "Value"
          }
        }
      ],
      "logsRaw": [],
      "blockNumber": 85869,
      "transactionHash": "0x6cf1df1baa7de182e9d0c77804cac353f16d5e86ca20b4973eaa4fa81effbffe",
      "contractAddress": "0x3a1800Bf083bDAC5999fe28fC168419f09Def933",
      "cumulativeGasUsed": 43161,
      "...": "..."
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json (API call result. Does not indicate success or failure of Tx. Confirmation of the Tx result can be verified with data.status)"
    },
    "data": {
      "type": "object",
      "properties": {
        "txStatus": {
          "type": "string",
          "enum": [
            "WAIT",
            "SENT",
            "SUCCEED",
            "FAILED",
            "CONFLICT"
          ],
          "description": "Tx Status\n\n`WAIT`: Status before requesting Tx execution with a Chain\n`SENT`: Status at Tx execution request with a Chain\n`SUCCEED`: Status where Tx execution request with a Chain were successful\n`FAILED`: Status where Tx execution request with a Chain were failure\n`CONFLICT`: Status where Tx cannot be processed due to a Chain load"
        },
        "receipt": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "status": {
              "type": "boolean"
            },
            "from": {
              "type": "string"
            },
            "to": {
              "type": "string"
            },
            "blockHash": {
              "type": "string"
            },
            "logs": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Event Name"
                  },
                  "inputs": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "description": "Emit Events"
                  }
                }
              },
              "description": "Parsing result of receipt logs with name and inputs"
            },
            "logsRaw": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {}
              },
              "description": "The logs value in the Receipt returned by the Chain"
            },
            "blockNumber": {
              "type": "number"
            },
            "transactionHash": {
              "type": "string"
            },
            "contractAddress": {
              "type": [
                "string",
                "null"
              ]
            },
            "cumulativeGasUsed": {
              "type": "number"
            },
            "...": {
              "type": "string"
            }
          },
          "description": "Tx Receipt"
        }
      },
      "description": "Request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Permission denied."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Tx receipt not found with the specified txHash."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

get Tx Receipts (Bulk)
GET/v1.0/receipts/

API to get Transaction Receipt (Bulk)

Example URI

GET https://api.luniverse.io/tx/v1.0/receipts/
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "txHashes": [
    "0x1234"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "txHashes": {
      "type": "array",
      "description": "Tx Hash list"
    }
  },
  "required": [
    "txHashes"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "receipts": {
      "items": [
        {
          "txHash": "0x9fea2f03a59a4aaa82a704aefc962a8aa4e5daea",
          "...": "..."
        }
      ]
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "properties": {
        "receipts": {
          "type": "object",
          "properties": {
            "items": {
              "type": [
                "array",
                "null"
              ],
              "description": "List of Receipts"
            }
          },
          "required": [
            "items"
          ],
          "additionalProperties": false,
          "description": "Receipts"
        }
      },
      "description": "request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Permission denied."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Tx receipt not found with the specified txHash."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}

Wallet

Wallet API is an API for generating REOA. REOA manages Private Key corresponding EOA in Luniverse instead, and provides surrogate signature.

Wallet API (DApp + WalletType + UserKey) is considered as a Unique Key and Unique Account.

Wallet Type

Wallet Type provided by Wallet API is as follows.

  • LUNIVERSE: LUNIVERSE PKMS

Wallets

Wallet Generation
POST/v1.0/wallets

API for wallet generation

Example URI

POST https://api.luniverse.io/tx/v1.0/wallets
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "walletType": "WALLET-TYPE",
  "userKey": "1234567890"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "walletType": {
      "type": "string",
      "enum": [
        "WALLET-TYPE"
      ],
      "description": "Wallet Type (Please refer separate wallet type section for detailed value per wallet)"
    },
    "userKey": {
      "type": "string",
      "description": "Unique key value to distinguish wallet users"
    }
  },
  "required": [
    "userKey"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "address": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "EOA"
        }
      },
      "description": "Request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Request Not Allowed."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

get Wallet
GET/v1.0/wallets/bridge

API to get registered Wallet

404 Error

Return if requested DApp + WalletType + UserKey is not registered.

Example URI

GET https://api.luniverse.io/tx/v1.0/wallets/bridge
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "walletType": "WALLET-TYPE",
  "userKey": "1234567890"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "walletType": {
      "type": "string",
      "enum": [
        "WALLET-TYPE"
      ],
      "description": "Wallet Type (Please refer separate wallet type section for detailed value per wallet)"
    },
    "userKey": {
      "type": "string",
      "description": "Unique key value to distinguish wallet users"
    }
  },
  "required": [
    "userKey"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "address": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "EOA"
        }
      },
      "description": "Request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Request Not Allowed."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The specified address is not registered."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "message": {
      "type": "string",
      "description": "Error message"
    }
  }
}

Balances

Note

Balance lookup does not require a separate Private Key signature, so it can be lookup based on Token Symbol registered in Luniverse Console regardless of whether it is REOA or LEOA.

get Main Token balance
GET/v1.0/wallets/{address}/{mtSymbol}/balance

API for Main Token balance lookup

Example URI

GET https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/MTS/balance
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Lookup Address, Constraint(/^0x[a-fA-F0-9]{40}$/)

mtSymbol
string (required) Example: MTS

Lookup MainToken’s Symbol, Constraint(/^[A-Z][A-Z0-9]{2,19}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "balance": "100000000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "balance": {
          "type": "string",
          "description": "Balance"
        }
      },
      "description": "Request result"
    }
  }
}

get Side Token Balance
GET/v1.0/wallets/{address}/{mtSymbol}/{stSymbol}/balance

API to get Side Token balance

Example URI

GET https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/MTS/STS/balance
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Lookup Address, Constraint(/^0x[a-fA-F0-9]{40}$/)

mtSymbol
string (required) Example: MTS

get MainToken’s Symbol, Constraint(/^[A-Z][A-Z0-9]{2,19}$/)

stSymbol
string (required) Example: STS

get SideToken’s Symbol, Constraint(/^[A-Z][A-Z0-9]{2,19}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "balance": "100000000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "balance": {
          "type": "string",
          "description": "balance"
        }
      },
      "description": "Request result"
    }
  }
}

MFA

Note

If you activate MFA attribute When defining a Transaction Action at the Luniverse Console, then you need MFA and Token for corresponding Transaction Action. (Note that LEOAis ignored even if the MFA setting is enabled.)

MFA Secret Request
POST/v1.0/wallets/{address}/mfa/setup

API for requesting Secret, QRCode for MFA registration

Example URI

POST https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/mfa/setup
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Address to register MFA, Constrained(/^0x[a-fA-F0-9]{40}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "serviceName": "Ohvengers",
  "userName": "Jane Doe"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "serviceName": {
      "type": "string",
      "description": "OTP Uri, service name to be included in QR Code (Default: DApp title)"
    },
    "userName": {
      "type": "string",
      "description": "OTP Uri, username to be included in QR Code (QR Code: EOA)"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "type": "GOOGLE-AUTHENTICATOR",
    "payload": "UwqU8WkMlVMKm9UTCpvVPym...",
    "keyuri": "otpauth://totp/svc:name?secret=...",
    "qrcode": "data:image/png;base64,..."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "GOOGLE-AUTHENTICATOR"
          ],
          "description": "MFA Type\n\n`GOOGLE-AUTHENTICATOR`: Google Authenticator"
        },
        "payload": {
          "type": "string",
          "description": "Payload, The value must be sent together with the MFA registration"
        },
        "keyuri": {
          "type": "string",
          "description": "OTP Uri, URL used for OTP registration"
        },
        "qrcode": {
          "type": "string",
          "description": "Base64 Encoded QR Code Image"
        }
      },
      "description": "Request result"
    }
  }
}

MFA Registration
POST/v1.0/wallets/{address}/mfa/register

API for MFA registration

Example URI

POST https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/mfa/register
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Lookup Address, Constraint(/^0x[a-fA-F0-9]{40}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "payload": "UwqU8WkMlVMKm9UTCpvVPym...",
  "token": "123456"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "payload": {
      "type": "string",
      "description": "`/setup` the `payload` value returned by the API request"
    },
    "token": {
      "type": "string",
      "description": "OTP Token (Six digit number)"
    }
  },
  "required": [
    "payload",
    "token"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    }
  }
}

get MFA Info
GET/v1.0/wallets/{address}/mfa

API to get registered MFA info

Example URI

GET https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/mfa
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Lookup Address, Constratin(/^0x[a-fA-F0-9]{40}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "mfaWallet": {
      "type": "GOOGLE-AUTHENTICATOR",
      "serviceName": "Ohvengers",
      "userName": "Jane Doe",
      "address": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "mfaWallet": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "GOOGLE-AUTHENTICATOR"
              ],
              "description": "MFA Type\n\n`GOOGLE-AUTHENTICATOR`: Google Authenticator"
            },
            "serviceName": {
              "type": "string",
              "description": "Service Name"
            },
            "userName": {
              "type": "string",
              "description": "User Name"
            },
            "address": {
              "type": "string",
              "description": "EOA"
            }
          },
          "description": "Tx Receipt"
        }
      },
      "description": "Request result"
    }
  }
}

Generate MFA Authentication Token
POST/v1.0/wallets/{address}/mfa/token

API for generating tokens used for Wallet-Auth-Token (MFA registration required)

  • Set the token value of the returned accessToken to the Wallet-Auth-Token Header and use it to execute the MFA Action.

Example URI

POST https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/mfa/token
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Address, Constraints(/^0x[a-fA-F0-9]{40}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "code": "123456",
  "expiresIn": "86400"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "OTP Code (숫자 6자리)"
    },
    "expiresIn": {
      "type": "string",
      "description": "MFA Verification Token Expiration Date (Units: seconds, Default: 1800, maximum: 86400)"
    }
  },
  "required": [
    "code"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "accessToken": {
      "token": "DjbY/LEUi9lyEhebIgQESeGyencQ6OrDbmeCeBpErFVSqoM2QrM+9BbHl3uG3/T9+xg..",
      "expiresIn": 1800
    },
    "refreshToken": {
      "token": "KljP/gQESeGyencebIgQESeGyencQ6OrDbmeCeBpErFEUi9lyEhebIgQESeG/SeGye..",
      "expiresIn": 31556926
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "accessToken": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string",
              "description": "MFA Verification Token"
            },
            "expiresIn": {
              "type": "number",
              "description": "MFA Verification Token Expiration Date (Units: seconds, Default: 1800, maximum: 86400)"
            }
          }
        },
        "refreshToken": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string",
              "description": "MFA Certification Renewal Token"
            },
            "expiresIn": {
              "type": "number",
              "description": "MFA Verification Token Expiration Date (Units: seconds, Default: 31556926, maximum: 31556926)"
            }
          }
        }
      },
      "description": "Request result"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The specified parameter is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}

Renew MFA Authentication Token
POST/v1.0/wallets/{address}/mfa/refresh

API for renewing the authentication token used for Wallet-Auth-Token (Require MFA Certification Renewal Token)

  • When renewing, it returns new access token and refresh token.

Example URI

POST https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/mfa/refresh
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Address, Constraints(/^0x[a-fA-F0-9]{40}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "refreshToken": "KljP/gQESeGyencebIgQESeGyencQ6OrDbmeCeBpErFEUi9lyEhebIgQESeG/SeGye.."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "refreshToken": {
      "type": "string",
      "description": "MFA Certification Renewal Token"
    }
  },
  "required": [
    "refreshToken"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "accessToken": {
      "token": "NjbY/LEUi9lyEhebIgQESeGyencQ6OrDbmeCeBpErFVSqoM2QrM+9BbHl3uG3/T9+xg..",
      "expiresIn": 1800
    },
    "refreshToken": {
      "token": "KljP/gQESeGyencebIgQESeGyencQ6OrDbmeCeBpErFEUi9lyEhebIgQESeG/SeGye..",
      "expiresIn": 31556926
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "data": {
      "type": "object",
      "properties": {
        "accessToken": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string",
              "description": "MFA Verification Token"
            },
            "expiresIn": {
              "type": "number",
              "description": "MFA Verification Token Expiration Date (Units: seconds, Default: 1800, maximum: 86400)"
            }
          }
        },
        "refreshToken": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string",
              "description": "MFA Certification Renewal Token"
            },
            "expiresIn": {
              "type": "number",
              "description": "MFA Certification Renewal Token Validity (Units: seconds, Default: 31556926, maximum: 31556926)"
            }
          }
        }
      },
      "description": "Request result"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The specified parameter is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}

Delete MFA authentication token
DELETE/v1.0/wallets/{address}/mfa/token

API for deleting MFA authentication tokens and renewal tokens

Example URI

DELETE https://api.luniverse.io/tx/v1.0/wallets/0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276/mfa/token
URI Parameters
HideShow
address
string (required) Example: 0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276

Address, Constraints(/^0x[a-fA-F0-9]{40}$/)

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Session invalid, please login again."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "reponse data in jason"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}

Vault - BETA

The Vault API is an API for keeping keystores secure.

The Vault API is currently available in the BETA version.

The BETA is a period for functional open testing, free of charge. We are not responsible for any problems caused by this service.

The Vault Registration / get API cannot be called from a server registered as a DApp IP Whitelist. The session key should be obtained from the server registered in the IP Whitelist, and the Registration / get API should be called from the client with the obtained session key.

Vaults

Auth Token acheive
POST/v1.0/auth/token

API to obtain Authorization Token required to call API that can only be called from IP Whitelist not registered

Example URI

POST https://api.luniverse.io/tx/v1.0/auth/token
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "userKey": "1234567890"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "userKey": {
      "type": "string",
      "description": "Unique key value to distinguish Vault users"
    }
  },
  "required": [
    "userKey"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "token": "BErny7XiQWpqBp15nQYAE+JASMNvJ4kGcebs/lFsxvQSK5AKKyE9mSSX1LdC4.."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "ONE_TIME_API_KEY"
        }
      },
      "description": "Request result"
    }
  }
}

Vault custody
POST/v1.0/vaults

API for storing encrypted keystores (Can only be called where IP Whitelist is not registered)

Encrypted keystores are not accessible to DApp developers. The Vault Archive API cannot be called from a server registered with the DApp IP Whitelist.

You should use the ONE_TIME_API_KEY obtained with thePOST / auth / token API instead of DAPP_API_KEY

Example URI

POST https://api.luniverse.io/tx/v1.0/vaults
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ONE_TIME_API_KEY
Body
{
  "encryptedKeystore": "EnCt2f2aa2fa24f6c13c58dd41cada..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "encryptedKeystore": {
      "type": "string",
      "description": "Encrypted Keystore"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "address": "0x786ea325bb1c6df36accdfe7aeb5bbdf89b13276"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "EOA"
        }
      },
      "description": "Request result"
    }
  }
}

get Vault
GET/v1.0/vaults

API to get encrypted keystore registered in Vault (Can only be called where IP Whitelist is not registered)

Encrypted keystores are not accessible to DApp developers. The API to get vault cannot be called from a server registered with the DApp IP Whitelist.

You should use ONE_TIME_API_KEY obtained with POST / auth / token API instead of DAPP_API_KEY.

404 Error

It will be returned if DApp + UserKey which requested inquiry is not registered in Vault.

Example URI

GET https://api.luniverse.io/tx/v1.0/vaults
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ONE_TIME_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "encryptedKeystore": "EnCt2f2aa2fa24f6c13c58dd41cada..."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "encryptedKeystore": {
          "type": "string",
          "description": "Encrypted Keystore"
        }
      },
      "description": "Request result"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Request Not Allowed."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The spcified userKey is not registered."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}

Vault DELETE
DELETE/v1.0/vaults

API for deleting registered vault

404 Error

It will be returned if DApp + UserKey which requested inquiry is not registered in Vault.

Example URI

DELETE https://api.luniverse.io/tx/v1.0/vaults
Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Body
{
  "userKey": "1234567890"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "userKey": {
      "type": "string",
      "description": "Unique key value to distinguish Vault users"
    }
  },
  "required": [
    "userKey"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "Request Not Allowed."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "result": false,
  "message": "The spcified userKey is not registered."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "message": {
      "type": "string",
      "description": "error message"
    }
  }
}

Analytics

Tx Analytics

API to get Transaction call statistics.

get Tx Analytics
GET/v1.0/analytics?fromDate={fromDate}&toDate={toDate}

API to get Transaction call statistics

Example URI

GET https://api.luniverse.io/tx/v1.0/analytics?fromDate=20190720&toDate=20190720
URI Parameters
HideShow
fromDate
string (required) Example: 20190720

lookup start date

toDate
string (required) Example: 20190720

lookup End Date

Request  Example
HideShow
Headers
Content-Type: application/json
Authorization: Bearer DAPP_API_KEY
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "result": true,
  "data": {
    "analytics": {
      "items": [
        {
          "basedate": "20190720",
          "stats": [
            {
              "actionId": "10",
              "count": "0"
            }
          ]
        }
      ]
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "result": {
      "type": "boolean",
      "description": "response data in json"
    },
    "data": {
      "type": "object",
      "properties": {
        "analytics": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "basedate": {
                    "type": "string",
                    "description": "Date"
                  },
                  "stats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "actionId": {
                          "type": "string",
                          "description": "Action Id"
                        },
                        "count": {
                          "type": "string",
                          "description": "Action Call count"
                        }
                      },
                      "required": [
                        "actionId",
                        "count"
                      ],
                      "additionalProperties": false
                    },
                    "description": "List of Stats"
                  }
                },
                "required": [
                  "basedate",
                  "stats"
                ],
                "additionalProperties": false
              },
              "description": "List of Analytics"
            }
          },
          "description": "Analytics"
        }
      },
      "description": "Request result"
    }
  }
}

Generated by aglio on 27 Sep 2019