HomeKaleido ServicesPublic Ethereum TetherTether API Reference

Tether API Reference

Public Ethereum Tether API Reference

The tether APIs can be leveraged to retrieve reports and balance information. Alternatively, they can be exercised to set configuration parameters.

The sample cURL commands make use of the following exported environment variables; please set them or enumerate the appropriate values accordingly:

export APIURL="https://console.kaleido.io/api/v1"
export APIKEY="YOUR_API_KEY"
export HDR_AUTH="Authorization: Bearer $APIKEY"
export HDR_CT="Content-Type: application/json"

If you are targeting an environment outside of the US, make sure to modify your URL accordingly. The ap qualifier resolves to Sydney, while ko resolves to Seoul:

export APIURL="https://console-eu.kaleido.io/api/v1"
export APIURL="https://console-ap.kaleido.io/api/v1"
export APIURL="https://console-ko.kaleido.io/api/v1"

The tether_id is the last 10 characters of the service’s URL. For example, if the service’s URL is https://console.kaleido.io/dashboard/tether/zztzis76ug/zzwsukueuq/zztukjy497/zzeh2wtgm2, then the tether_id would be zzeh2wtgm2

GET

  • /reportCount returns the total number of environmental reports for your tether service instance.  Each node’s individual state report object is contained within a single report.

curl -X GET -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/reportCount" | jq

  • /lastReport returns the most recent aggregated collection of state report objects.

curl -X GET -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/lastReport" | jq

  • /reports/{index} returns the enumerated report, where the first report in the index defined as int 0.  In other words, if /reportCount returns 100, then the most recent report would be specified as int 99.

curl -X GET -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/reports/{index}" | jq

  • /accounts returns the service’s account address and the balance (specified in wei) for the currently targeted network.

curl -X GET -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/account" | jq

  • /balance/{network} returns the account’s balance for the specified network.  This call accepts either mainnet or rinkeby as specifications.  For example, to retrieve the balance for the account funding MainNet transactions:

curl -X GET -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/balance/mainnet" | jq

POST

  • /targetNetwork can be used to set or reconfigure the targeted public network.  This call requires either mainnet or rinkeby as a specification in the body of the call.  This configuration must be set prior to deploying the tether smart contract and subsequently activating the service.  For example, to set or change your target network to the Ethereum MainNet:

curl -X POST -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/targetNetwork" -d '{"network":"mainnet"}'

  • /interval can be used to set or reconfigure the pinning interval.  This call requires an integer of ≥ 1 in the body of the call, with the integer enumerating the hourly interval between pinning transactions.  This configuration must be set prior to activating the service.  For example, to set the pinning interval to 48 hours (i.e. pin once every two days):

curl -X POST -H "$HDR_AUTH" -H "L/tether/{tether_id}/interval" -d '{"interval":48}'

  • /deploy is used to deploy the tether smart contract on the configured target network.  Note that if the Tether Service’s account address does not have funds on the configured target network, then the deployment will fail.  The deployment of the tether smart contract must succeed prior to activating a service instance.  Requires an empty body. For example:

curl -X POST -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/deploy" -d '{}'

  • /activate starts a new tether service or resumes a deactivated instance.  This call requires an empty body and returns a boolean of true if successful. For example:

curl -X POST -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/activate" -d '{}'

  • /deactivate stops an active tether service.  This call requires an empty body and returns a boolean of true if successful. For example:

curl -X POST -H "$HDR_AUTH" -H "$HDR_CT" "$APIURL/tether/{tether_id}/deactivate" -d '{}'