ixofoundation / ixo-assistant

A chat widget for Rasa and Botfront
https://botfront.io/rasa
Apache License 2.0
0 stars 0 forks source link

Check a user's KYC status and account balance #8

Open ig-shaun opened 3 years ago

ig-shaun commented 3 years ago

Responding to an intent account_status{"userDid":}

Run a custom action which sets the slot values for "ixoAccount" // ixo blockchain account id (in the format ixo123...) "kycValidated" // boolean "ixo_accountFunded" // boolean value 0 if balance of denom uixo is zero and 1 if the balance >0 "ixo_accountBalance" // numerical value which filters for coin denom uixo and parses the IXO value by dividing uixo by 1,000,000

These functions are called at chain_id // get the gPRC endpoint from a lookup using the entity value of the chain (e.g. impacthub-2)

  1. For the kycValidated property: GET /did/getByDid/{did}

Which returns

{
  "did": "string",
  "publicKey": "string",
  "credentials": [
    {
      "type": [
        "string"
      ],
      "claim": {
        "id": "string",
        "KYCValidated": true
      },
      "issuer": "string"
    }
  ]
}
  1. For "ixoAccount" property GET /didToAddr/

which returns:

{
  "height": "0",
  "result": "ixo1j0jhdsl2hugv0gaay99rft8ywpgjgxntg22ytp"
}
  1. For "ixo_accountBalance"

Use "result" value from above for the address

GET /auth/accounts/ which returns: { "height": "0", "result": { "type": "cosmos-sdk/Account", "value": { "address": "", "coins": [], "public_key": null, "account_number": "0", "sequence": "0" } } }