Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Provide default value for requiredClaims #233

Description

@angiejones

Issue

Currently, even if a developer is creating an offering that doesnt have any required claims, they still have to add the requiredClaims value to their object. This is because, while OfferingData does have requiredClaims as optional, there's no default value. So this forces developers to pass in null to get around this.

Current usage

      OfferingData(
          description = "Selling GBP for USD",
          payin = PayinDetails(currencyCode = "USD", methods = listOf()),
          payout = PayoutDetails(currencyCode = "GBP", methods = listOf()),
          payoutUnitsPerPayinUnit = "0.00003826",
          requiredClaims = null
      )

Desired usage

      OfferingData(
          description = "Selling GBP for USD",
          payin = PayinDetails(currencyCode = "USD", methods = listOf()),
          payout = PayoutDetails(currencyCode = "GBP", methods = listOf()),
          payoutUnitsPerPayinUnit = "0.00003826"
      )

Suggested Fix

Update ResourceData to:

val requiredClaims: PresentationDefinitionV2? = null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions