This is a sample smart contract that connects to the Translucent Oracle on Goerli and retrieves a dynamic list of strings from a JSON API.
- Oracle Address -
0x188b71C9d27cDeE01B9b0dfF5C1aff62E8D6F434
- Job ID -
a72b502cccf444e49e4d4768017b6572
- LINK token address on Goerli -
0x326C977E6efc84E512bB9C30f76E30c160eD06FB
The example.sol calls the Oracle with two required parameters
get
- the URL of the API to retrieve.path
- a comma-separated JSON path to retrieve the list of wallets.
You could deploy this contract in Remix and call the following function:
requestBytes("https://gist.githubusercontent.com/ijonas/3b7234ac7417885c34c5744b89637e58/raw/8861d6a639e720497ed97ef88f79153e0836e495/example.json", "result,ids")
After about 15 seconds or so you would get a 3-value response that you can query on the example contract with
ids[0]
ids[1]
ids[2]
- example.json - a sample JSON response pretending to be the JSON API
- example.sol - a working sample contract that can be deployed to Goerli and executed with the parameters described above.