Table of Contents |
---|
Dynamic Oracle Approach
FIO is automatically converted to ETH to cover gas costs
...
v1/chain/get_nft_image example
POST:
'{“url”:”https://fio.eosrio.io/v1/chain/get_nft_image”}'
RESPONSE:
'{“image”:”https://imgur.com/exampleimage.png”}'
IPFS Url formatting:
'{“image”:”https://{gatewayURL}/ipfs/{content ID}/{optional path to resource}”}'
Oracles
regoracle
Register Oracle.
Registering oracles
Each Oracle is registered using regoracle action.
Implementation
New action: regoracle
Request body
Parameter | Required | Format | Definition |
---|---|---|---|
oracle | Yes | Ethereum public address | Same as FIO account |
Processing
Request is validated per Exception handling.
Oracle is added after 7 custodians have registered the same Ethereum public address
Exception handling
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid oracle | Oracle is not valid or does not exist | 400 | "oracle_actor" | Value sent in, e.g. "alice" | "Invalid oracle" |
No authority | The signer does not have authority to register oracles | 403 | Type: invalid_signature |
Response body
Parameter | Format | Definition |
---|---|---|
status | String | OK if successful |
unregoracle
Unregister Oracle.
Implementation
New action: unregoracle
Request body
Parameter | Required | Format | Definition |
---|---|---|---|
oracle | Yes | Ethereum public address |
Processing
Oracle is removed after 7 custodians have unregistered the same public address
oracle_actor is removed
Exception handling
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid oracle | Oracle is not registered | 400 | "oracle_actor" | Value sent in, e.g. "alice" | "Invalid oracle" |
No authority | The signer does not have authority to register oracles | 403 | Type: invalid_signature |
Response body
Parameter | Format | Definition |
---|---|---|
status | String | OK if successful |
Example
Code Block |
---|
{
"status": "OK"
}
|
Custodians
regcustodian
Register Custodian
Registering oracles
Each Custodian is registered using regcustodian action.
Implementation
New action: regcustodian
Request body
Parameter | Required | Format | Definition |
---|---|---|---|
oracle_actor | Yes | 12 character string | Same as FIO account |
Processing
Request is validated per Exception handling.
Custodian is added after 7 custodians have registered the same public address
Exception handling
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid oracle | Oracle is not valid or does not exist | 400 | "oracle_actor" | Value sent in, e.g. "alice" | "Invalid oracle" |
No authority | The signer does not have authority to register oracles | 403 | Type: invalid_signature |
Response body
Parameter | Format | Definition |
---|---|---|
status | String | OK if successful |
unregcustodian
Unregister Custodian.
Implementation
New action: unregcustodian
Request body
Parameter | Required | Format | Definition |
---|---|---|---|
oracle_actor | Yes | 12 character string | Valid actor (account) of oracle. |
Processing
Custodian is removed after 7 custodians have unregistered the same public address
Exception handling
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid oracle | Oracle is not registered | 400 | "oracle_actor" | Value sent in, e.g. "alice" | "Invalid oracle" |
No authority | The signer does not have authority to register oracles | 403 | Type: invalid_signature |
Response body
Parameter | Format | Definition |
---|---|---|
status | String | OK if successful |
Example
Code Block |
---|
{
"status": "OK"
}
|