Create Policy Id

POST /wallets/{walletId}/policy-id

status: stable

Create policy id for the wallet and a given mint/burn script.

Path parameters

  • walletId string(hex) Required

    Minimum length is 40, maximum length is 40.

application/json

Body Required

  • policy_script_template string | object Required

    One of:

    Leaf value for a script designating a cosigner co-sharing the script.

    Format should match the following pattern: ^(cosigner#)[0-9]*$.

Responses

  • 415 application/json

    Unsupported Media Type

    Hide response attributes Show response attributes object
    • message string Required

      A descriptive error message.

    • code string Required

      A specific error code for this error, more precise than HTTP ones.

  • 406 application/json

    Not Acceptable

    Hide response attributes Show response attributes object
    • message string Required

      May occur when providing an invalid 'Accept' header.

    • code string Required

      Value is not_acceptable.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • message string Required

      May occur when a request is not well-formed; that is, it fails to parse successfully. This could be the case when some required parameters are missing or, when malformed values are provided.

    • code string Required

      Value is bad_request.

  • 403 application/json

    Forbidden

    One of:
  • 202 application/json

    Accepted

    Hide response attribute Show response attribute object
    • policy_id string(hex) Required

      A unique identifier of the asset's monetary policy. The policy controls how assets of this kind are created and destroyed.

      The contents are the blake2b-224 hash of the monetary policy script, encoded in hexadecimal.

      Minimum length is 56, maximum length is 56.

POST /wallets/{walletId}/policy-id
curl \
 --request POST https://localhost:8090/v2/wallets/{walletId}/policy-id \
 --header "Content-Type: application/json" \
 --data '{"policy_script_template":"string"}'
Request examples
{
  "policy_script_template": "string"
}
Response examples (415)
{
  "message": "string",
  "code": "an_error_code"
}
Response examples (406)
{
  "message": "string",
  "code": "not_acceptable"
}
Response examples (400)
{
  "message": "string",
  "code": "bad_request"
}
{
  "message": "string",
  "code": "invalid_wallet_type"
}
{
  "message": "string",
  "code": "missing_policy_public_key"
}
{
  "message": "string",
  "code": "created_wrong_policy_script_template"
}
Response examples (202)
{
  "policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b"
}