Update Coupon Rates

{
  "name": "update_coupon_rates",
  "desc": "Update variable coupon interest rates in bps",
  "readonly": false,
  "args": [
    {
      "type": "uint64[]",
      "name": "coupon_rates",
      "desc": "Coupon interest rates in bps"
    }
  ],
  "returns": {
    "type": "uint64",
    "desc": "Timestamp of the update"
  },
  "errors": [
    {
      "code": "UNAUTHORIZED",
      "message": "Not authorized"
    },
    {
      "code": "DEFAULTED",
      "message": "Defaulted"
    },
    {
      "code": "SUSPENDED",
      "message": "Asset operations are suspended"
    },
    {
      "code": "INVALID_COUPON_RATES_LENGTH",
      "message": "Coupon rates length is not equal to total coupons"
    },
    {
      "code": "INVALID_PAST_RATE",
      "message": "Due coupon rates can not be modified"
    },
    {
      "code": "PENDING_COUPON_PAYMENT",
      "message": "Pending due coupon payment"
    }
  ]
}

The call MUST fail with the UNAUTHORIZED error code if not called by an authorized caller.

The call MUST fail with the DEFAULTED error code if the asset is defaulted.

The call MAY fail with the SUSPENDED error code if the asset is suspended.

The call MUST fail with the INVALID_COUPON_RATES_LENGTH error code if the length of the coupon rates is not equal to total_coupons.

The call MUST fail with the INVALID_PAST_RATE error code if a due coupon rate is modified.

The call MUST fail with the PENDING_COUPON_PAYMENT error code if there is any due coupon still to be paid.