API Tutorial
The API involves sending a blockchain request to
a smart
contract containing the following elements:
- service: is the name of the service provider
- data: is the data provided to the provider with a request for
information. Data consists of a json formatted object, and the values
for the object are dependent on the service provider.
The remaining three parameters will select the response of the service
and convert it into a form which is usable for a smart contract.
- keypath: uses keypath selector to select one or more
elements from the json provided by the service
- abi: can take the following values
- json - return response as json string
- cbor - return response as chor string
- ipfs or ipfs/json - return response via IPFS address
- ipfs/cbor - return response as IPFS address in cbor format
abi can also be in the form of an EVM type in which case the byte
returned is formalled using EVM type such as int256, uint256, or
string
- multiplier: - multiplys the value by a constant before
doing the format conversion.