Search…
Blockchain API
This chapter contains the resource for the devlopement - token / block APIs and useful tutorials

Finenex provides collections of APIs that work together on the FINX platform to solve a variety of problems. Developers can build solutions using the FINX platform to meet the business needs.

The endpoints for Finenex services are:
Service
Endpoint
Description
Token API
API for transaction of FINX network
  • JsonRPC
Block API
API for checking block information of FINX network
  • JsonRPC
Wallet service for private key management
  • JsonRPC
Get an auth token to use the payment API
  • REST
API for Point and Payment
  • REST

JSON-RPC 2.0 Specification
Request body
{
"jsonrpc":"2.0",
"method":"methodName",
"params":[ "key":"value" ],
"id":7723
}
Response body (success)
{
"jsonrpc":"2.0",
"id":7723,
"result":{
"TransactionID": "705e0c42118e8007dd5271a7c90bcff3a8ce496a6da6d5bb74e16655a1f3d01d",
"resultData": "ec141e57d14ea0bbb0cb6a9c37abf06a7e323d77e170b0862d8575bebee078909999fd881ead6d208567cc5179f57b6833069cea332a7d2c3b359fbde85229c4"
}
}
Response body (error)
{
"code": -1121,
"msg": "Invalid symbol."
}

Request
Response
curl --location --request POST 'https://api.finenex.net/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": "1234",
"method": "net_getTempKey",
"params": {
"address": "0xf9acd4c2d6a358113bfec174e34d2af01323028a",
"keyType": "transfer"
}
}'
{
"jsonrpc": "2.0",
"id": "1234",
"result": {
"resultCode": "200",
"resultMessage": "Success",
"resultData": {
"tempKey": "fc3d6024d6bca69fd54a138615b28e74"
}
}
}

  • 32700 : parse error. not well formed
  • 32701 : parse error. unsupported encoding
  • 32702 : parse error. invalid character for encoding
  • 32600 : server error. invalid xml-rpc. not conforming to spec.
  • 32601 : server error. requested method not found
  • 32602 : server error. invalid method parameters
  • 32603 : server error. internal xml-rpc error
  • 32500 : application error
  • 32400 : system error
  • 32300 : transport error

{
"jsonrpc":"2.0",
"id":7723,
"result":{
"resultCode": "500",
"resultMessage": "Error Message",
"resultData": ""
}
}

You can create a new privateKey in the ServerWallet by using createAddress. The createAddress returns the created address, mnemonic, and secretKey values. You can restore the private key from the archived mnemonic using importAddress.
The secretKey is used as a secret when using serverWallet. If authentication is required when using the serverWallet, the hashKey generated through hash (tempKey + "|" + secretKey) is sent to the serverWallet to authenticate using the secretKey stored inside the wallet and the delivered tempKey.
hashKey = CryptoUtil.getSah256(tempKey +"|" + secretKey)

When using APIs that generate transactions, such as createToken and transfer, you must create and pass a signature as a parameter. A signature can be created by calling signData. The transfer as an example. You hashed the string consisting of "fromAddress | toAddress | amount | hashKey" with sha256 and made the result into a hex string. You can get the signature value by passing this string as a parameter to signData.
String data = fromAddress + "|" + toAddress + "|" + amount + "|" + tempKey + "|" + hashKey;log.debug("data=" + data);
String hashData = CryptoUtil.getSha256(data);
resultMessage = tokenApiService.signData(fromAddress, hashData, tempKey, hashKey);
...
public static String getSha256(String msg) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(msg.getBytes());
byte[] mdBytes = md.digest();
String mdStr = bytesToHex(mdBytes);
return mdStr;
}

You can get sample code from github. (https://github.com/Finenex/connect-api-examples)
Last modified 43m ago
Copy link
On this page
Get Started
Endpoint
JsonRPC
Protocol Error
Service Error
Address and secretKey
How to create a signature
Sample Project