Oracle's API

Attest with Commit

GET http://127.0.0.1:8585/attest

Request an attestation message body

Query Parameters

Name
Type
Description

commit

string

Commit ID of the committed data

cid

string

ContractId of the recipient address

pk

string

Public key of the recipient address

address

String

Address of the recipient (either a contract address or a public key hash address).

{
    "root": "3e47241505bca37f3356fd8dda544c2a3c9c043601f147ea0c6da1362c85a472",
    "timestamp": "1600785099516",
    "commit": "2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3",
    "tx": "No TX",
    "messageBody": "{\n  \"dict\": [\n    [\n      \"Commit\",\n      {\n        \"hash\": \"2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3\"\n      }\n    ],\n    [\n      \"OraclePubKey\",\n      {\n        \"pk\": \"02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c\"\n      }\n    ]\n  ]\n}",
    "messageBodyEncoded": "0c0206436f6d6d6974072d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d30c4f7261636c655075624b65790a02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c"
}
`

Attest with Root and Timestamp

GET http://127.0.0.1:8585/attest

Request an attestation message body

Query Parameters

Name
Type
Description

root

string

Root of the Merkle Tree

timestamp

string

Time of the committed data (in millisecond in epoch format)

cid

string

Contract ID of the recipient address

pk

string

ContractId of the Recipient address

address

String

Address of the recipient (either a contract address or a public key hash address).

{
    "root": "3e47241505bca37f3356fd8dda544c2a3c9c043601f147ea0c6da1362c85a472",
    "timestamp": "1600785099516",
    "commit": "2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3",
    "tx": "No TX",
    "messageBody": "{\n  \"dict\": [\n    [\n      \"Commit\",\n      {\n        \"hash\": \"2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3\"\n      }\n    ],\n    [\n      \"OraclePubKey\",\n      {\n        \"pk\": \"02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c\"\n      }\n    ]\n  ]\n}",
    "messageBodyEncoded": "0c0206436f6d6d6974072d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d30c4f7261636c655075624b65790a02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c"
}
`

Query the Oracle

GET http://127.0.0.1:8585/query

Filter the commited data to find the commitment.

Query Parameters

Name
Type
Description

high

string

filter the data with the higher timestamp bond

low

string

Filter the data with the lower timestamp bond

key

string

Filter by this ticker

take*

String

Take only the first <n> items (after the skip if there is one).

skip

String

Skip the first <n> items.

[{
    "item": {
        "APPL": "10"
    },
    "timestamp": "1600785099516",
    "commit": "2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3",
    "hash": "0ecb254e1ff36f9b6a09f35926041a01a955171a29d8500775fb58a0acbff54c"
}]

Count commits

GET http://127.0.0.1:8585/count/

Count the number of items committed by the service.

Query Parameters

Name
Type
Description

high

String

filter the data with the higher timestamp bond

low

String

Filter the data with the lower timestamp bond

key

String

Filter by this ticker

{
    // Response
}

Get the values

POST http://127.0.0.1:8585/getValues

Query Parameters

Name
Type
Description

key

String

Filter by this ticker

high

String

filter the data with the higher timestamp bond

low

String

Filter the data with the lower timestamp bond

{
    // Response
}

Last updated