Working with QEDIT Rules

Rules define which wallets are allowed to issue which assets. Rules also define which wallets are allowed to create and delete rules.

Creating a new rule

A wallet may be permitted by the network to create issuance rules or to provide such permissions to other wallets. To do so an API call is made to create a new rule. The rule is written to a block in the Blockchain similarly to a transaction. Rules created by a wallet will appear in its activity history. Rules are also listed in the network activity.

Request

POST /wallet/create_rule
{
  "wallet_id": "issuer_wallet",
  "authorization": "PrivacyIsAwesome",
  "rules_to_add": [
    {
      "public_key": "bf45ab74bd4a46fe7a2432ba05e2f726bf4fe42a80052849e13e2541230d3204",
      "can_issue_confidentially": false,
      "namespace": "bank-a.loans.*",
      "is_admin": false
    }
  ]
}

Response

{
  "id": "70a88558-2b8b-4b63-a5b6-2c54b24377f5"
}

Deleting a rule

A QEDIT wallet that is permitted by the network to create rules is also permitted to delete existing rules.

Request

POST /wallet/delete_rule
{
  "public_key": "bf45ab74bd4a46fe7a2432ba05e2f726bf4fe42a80052849e13e2541230d3204",
  "can_issue_confidentially": false,
  "namespace": "bank-a.loans.*",
  "is_admin": false
}

Response

{
  "id": "70a88558-2b8b-4b63-a5b6-2c54b24377f5"
}

Getting the network rules

Any QEDIT node can list all the network rules.

Request

POST /node/get_rules

Response

{
  "rules": [
    {
      "public_key": "bf45ab74bd4a46fe7a2432ba05e2f726bf4fe42a80052849e13e2541230d3204",
      "can_issue_confidentially": false,
      "namespace": "bank-a.loans.*",
      "is_admin": false
    }
  ]
}