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

Rename currency fields subunits -> major units #40

Closed
wants to merge 1 commit into from

Conversation

diehuxx
Copy link

@diehuxx diehuxx commented Dec 15, 2023

Update currency amount representation and validation based on this spec change: TBD54566975/tbdex#206

Changes based on the spec

Update the protocol spec, test-vectors, and examples to represent currencies as decided in issue #199 in this comment here.

  1. Strings
  2. Containing major unit amounts
  3. Decimals using period . as the decimal separator regardless of currency.
    Currency representation tbdex#199 (comment)

The updated fields taken from this comment here.

Old New
offering.payinCurrency.minSubunits min or minAmount
offering.payinCurrency.maxSubunits max or maxAmount
offering.payoutCurrency.minSubunits min or minAmount
offering.payoutCurrency.maxSubunits max or maxAmount
offering.paymentMethods[*].feeSubunits fee
rfq.payinSubunits amount or payinAmount
quote.payin.amountSubunits amount
quote.payin.feeSubunits fee
quote.payout.amountSubunits amount
quote.payout.feeSubunits fee

Notes

This PR does NOT validate that currency amount strings are decimals. That will come in a later PR which validates TBDex messages/resources against the published JSON schema. tbdex-js already does this.

@diehuxx diehuxx requested a review from amika-sq as a code owner December 15, 2023 22:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants