...
Parameter | Required | Format | Definition | |
---|---|---|---|---|
amount | Yes | Positive Int | Amount of wFIO (in SUFs) to unwrap. | |
account | to make it consistent with other ETH contracts?)Yes | String | Public address on ETH blockchain where wrapped FIO should be delivered. | |
amount | Yes | Positive Int | Amount of wFIO (in SUFs) to unwrap. |
Example
Code Block |
---|
{ "amount": 100000000000, "eth_addressaccount": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B" } |
...
Request is validated per Exception handling.
Consensus required. Transaction is executed when all registered oracles have called
wrap
(submitted their “observation”).wFIO is minted and transferred to
eth_address
account
Exception handling
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid amount | Transfer amount is not valid. | 400 | "amount" | Value sent in, e.g. "-1" | "Invalid amount" |
Invalid public address | Recipient public address is not valid | 400 | "eth_addressaccount" | Value sent in, e.g. "notvalidethaddress" | "Invalid public address" |
No authority | The signer is not a registered Oracle and does not have authority to call this function | 403 | "Only a wFIO Oracle may call this function" |
...
Parameter | Required | Format | Definition | |
---|---|---|---|---|
amount | Yes | Positive Int | Amount of wFIO (in SUFs) to unwrap. | |
fio_address (or Hash of address to save space?) | Yes | String | FIO Address where FIO Tokens should be delivered. | |
max_oracle_fee | ?Yes | Positive Int | ||
max_fee? | Yes | Positive Int | Maximum amount of SUFs the user is willing to pay for fee. Should be preceded by /get_fee for correct value. | |
tpid? | Yes | FIO Address | FIO Address of the entity which generates this transaction. TPID rewards will be paid to this address. Set to empty if not known. |
...
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid FIO address | Recipient public address is not valid | 400 | "eth_addressaccount" | Value sent in, e.g. "notvalidethaddress" | "Invalid FIO address" |
Invalid amount | Transfer amount is not valid. | 400 | "amount" | Value sent in, e.g. "-1" | "Invalid amount" |
Insufficient balance | Balance is less than amount + oracle fee + chain fee | 400 | "amount" | Value sent in, e.g. "100000000000" | "Insufficient balance" |
Invalid oracle fee value | max_oracle_fee format is not valid | 400 | "max_oracle_fee" | Value sent in, e.g. "-100" | "Invalid oracle fee value" |
Oracle fee exceeds maximum | Actual oracle fee is greater than supplied max_oracle_fee | 400 | "max_oracle_fee" | Value sent in, e.g. "1000000000" | "Oracle fee exceeds supplied maximum" |
No authority | The signer is not a registered Oracle and does not have authority to call this function | 403 | "Only a wFIO Oracle may call this function" | ||
Invalid fee value? | max_fee format is not valid | 400 | "max_fee" | Value sent in, e.g. "-100" | "Invalid fee value" |
Fee exceeds maximum? | Actual fee is greater than supplied max_fee | 400 | "max_fee" | Value sent in, e.g. "1000000000" | "Fee exceeds supplied maximum" |
Invalid TPID? | tpid format is not valid | 400 | "tpid" | Value sent in, e.g. "notvalidfioaddress" | "TPID must be empty or valid FIO address" |
...
Parameter | Required | Format | Definition |
---|---|---|---|
eth_addressethaddress | Yes | Ethereum public address | Ethereum address owned by the Oracle. |
Example
Code Block |
---|
{ "eth_addressethaddress": "FIO8k7N7jU9eyj57AfazGxMuvPGZG5hvXNUyxt9pBchnkXXx9KUuD0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B" } |
Processing
Request is validated per Exception handling.
Consensus required. Oracle is added after 2/3+1 Custodians have called
regoracle
with sameeth_address
ethaddress
.Ethereum address is registered as a valid Oracle.
...
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid address | Ethereum address is not valid | 400 | "eth_addressethaddress" | Value sent in, e.g. "notvalidethaddress" | "Invalid address" |
No authority | The signer is not a registered Custodian and does not have authority to call this function | 403 | "Only a wFIO custodian may call this function" | ||
Already registered | The Ethereum address is already registered as an Oracle | 400 | "eth_addressethaddress" | “Oracle is already registered” |
...
Parameter | Required | Format | Definition |
---|---|---|---|
eth_addressethaddress | Yes | Ethereum public address | Ethereum address owned by the Oracle. |
Example
Code Block |
---|
{ "eth_addressethaddress": "FIO8k7N7jU9eyj57AfazGxMuvPGZG5hvXNUyxt9pBchnkXXx9KUuD0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B" } |
Processing
Oracle is removed after 2/3+1 Custodians have unregistered the same Oracle Ethereum address
Consensus required. Oracle is removed after 2/3+1 Custodians have called
unregoracle
with sameoracle_address
ethaddress
.Ethereum address is removed as a valid Oracle.
...
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid oracle | Oracle is not registered | 400 | "eth_addressethaddress" | Value sent in, e.g. "ethaddressnotinoracletable" | "Invalid oracle" |
No authority | The signer is not a registered Custodian and does not have authority to call this function | 403 | "Only a wFIO custodian may call this function" |
...
Parameter | Required | Format | Definition |
---|---|---|---|
eth_addressethaddress | Yes | Ethereum public address | Ethereum address owned by the Custodian. |
Example
Code Block |
---|
{ "eth_addressethaddress": "FIO8k7N7jU9eyj57AfazGxMuvPGZG5hvXNUyxt9pBchnkXXx9KUuD0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B" } |
Processing
Request is validated per Exception handling.
Consensus required. Custodian is added after 2/3+1 custodians have registered the same Ethereum address.
Ethereum address is added as a valid Custodian.
...
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid address | Ethereum address is not valid | 400 | "eth_addressethaddress" | Value sent in, e.g. "notvalidethaddress" | "Invalid address" |
No authority | The signer is not a registered Custodian and does not have authority to call this function | 403 | "Only a wFIO custodian may call this function" | ||
Already registered | The Ethereum address is already registered as an Custodian | 400 | "eth_addressethaddress" | “Custodian is already registered” |
...
Parameter | Required | Format | Definition |
---|---|---|---|
eth_addressethaddress | Yes | Ethereum public address | Ethereum address owned by the Custodian. |
Example
Code Block |
---|
{ "eth_addressethaddress": "FIO8k7N7jU9eyj57AfazGxMuvPGZG5hvXNUyxt9pBchnkXXx9KUuD0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B" } |
Processing
Request is validated per Exception handling.
Consensus required. Custodian is removed after 2/3+1 custodians have registered the same Ethereum address.
Ethereum address is removed as a valid Custodian.
...
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid custodian | Custodian is not registered | 400 | "eth_addressethaddress" | Value sent in, e.g. "ethaddressnotincusttable" | "Invalid custodian" |
Invalid address | Ethereum address is not valid | 400 | "eth_addressethaddress" | Value sent in, e.g. "notvalidethaddress" | "Invalid address" |
No authority | The signer is not a registered Custodian and does not have authority to call this function | 403 | "Only a wFIO custodian may call this function" |
...