Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Overview

The purpose of this document is to describe changes being made to the Registration Site to accommodate the dApp.

API

Get pricing

This call is intended to return current pricing of FIO Addresses and Domains based on Wallet Profile provided.

GET /get-pricing/{referralCode}

Request

Parameter

Format

Required

Description

referralCode

String

Yes

Wallet profile referral code

Response

Group

Parameter

Format

Required

Description

success

boolean

Yes

true if successful

pricing->fio

domain

Int

Yes

FIO Domain price in SUFs

pricing->fio

address

Int

Yes

FIO Address price in SUFs

pricing->usdt

domain

Double

Yes

FIO Domain price in USDT

pricing->usdt

address

Double

Yes

FIO Domain price in USDT

Example

{
  "success": true
  "pricing" : {
    fio: {
      "domain": 400000000000,
      "address": 20000000000
    },
    usdt: {
      "domain": 40.00,
      "address": 2.00
    },  
  error: false
} 

Buy FIO Tokens

If a wallet wants to implement it’s own registration of FIO Domains and Addresses, e.g. to accommodate shopping cart or registrations on a private domain, they will be able to purchase enough FIO Tokens to purchase specific number of FIO Addresses or FIO Domains. Using this method, as opposed to purchasing a specific amount of FIO Tokens is preferred as the Registration site will adjust the amount of tokens to be sufficient for the fees, in case there is a fee change between a quote and processing of crypto payment.

Upon payment, the Registration site will transfer FIO Tokens to publicKey and notify webhook

POST /buy-fio-tokens

Request

Parameter

Format

Required

Description

referralCode

String

Yes

Wallet profile referral code

domainRegistrations

Int

Yes

Number of FIO Domain registrations

addressRegistrations

Int

Yes

Number of FIO Address registrations

publicKey

String

Yes

FIO public key for the ownership of the FIO Tokens

redirectUrl

String

No

This url will be shown to users upon redirection from Coinbase payment screen. Irrelevant if you are showing payment screens inside app.

apiToken

String

Yes

API Token configured in Wallet Profile

webHook

String

No

Webhook which needs to be notified when payment is processed

Example

{
  "referralCode": "fio",
  "domainRegistrations": 0,
  "addressRegistrations": 5,
  "publicKey": "FIO86zM5iJAdsEgF3ggWJDM4SGgTFBVpx63cuBM4SxBEvBFewNyrv",
  "apiToken": "",
  "webHook": "https://www/example.com/webhook"
}

Response

Same as https://developers.fioprotocol.io/pages/api/fio-reg-api/#post-/buy-address

Processing

  • Once request is received:

    • FIO Tokens required is computed based on sum of:

      • domainRegistrations * get_fee for register_fio_domain

      • domainRegistrations * get_fee for set_fio_domain_public

      • addressRegistrations * get_fee for register_fio_address

    • domainRegistrations and addressRegistrations are recorded in order

  • Once payment is received:

    • FIO Tokens required is re-computed (see above)

      • If payment was received within 60 minutes of request and amount is +/- 10%

        • The amount of FIO is adjusted to new number

        • Status is set to Success

      • Else

        • The amount of FIO is not adjusted to new number

        • Status is set to PriceChange

    • Tokens are transferred

    • Webhook fires

Webhook payload

Parameter

Format

Required

Description

extern_id

String

Yes

Coinbase order ID

publicKey

String

Yes

FIO public key for the ownership of the FIO Tokens

amount

Int

Yes

Amount of FIO Tokens in SUFs being transferred

status

boolean

Yes

Success or PriceChange

Wallet Profile

Add “Allow FIO Token Purchases” check box. If selected:

  • That wallet profile will enable Buy FIO Tokens

  • FIO Address/Domain pricing is reset and “Price according to rate of exchange” is checked.

    • If user attempts to enter price or uncheck the “Price according to rate of exchange” box, “Allow FIO Token Purchases” is unchecked.

  • No labels