@amboras-dev/money 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/ai.cjs +4 -4
- package/dist/ai.d.cts +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +4 -4
- package/dist/{allocate-D7tm_t_o.cjs → allocate-CZRg4TOP.cjs} +2 -2
- package/dist/{allocate-CdnhvAda.js → allocate-X7_jAtOj.js} +2 -2
- package/dist/{amount-DHtvZSSm.cjs → amount-BV0O-aN8.cjs} +3 -3
- package/dist/{amount-D7dj76nH.js → amount-BoYBMgK9.js} +3 -3
- package/dist/{arithmetic-C-Q_aI49.js → arithmetic-BhNwisjb.js} +3 -3
- package/dist/{arithmetic-Bq-8mSal.cjs → arithmetic-DjT4Kzgt.cjs} +3 -3
- package/dist/billing.cjs +2 -2
- package/dist/billing.d.cts +1 -1
- package/dist/billing.d.ts +1 -1
- package/dist/billing.js +2 -2
- package/dist/commerce.cjs +7 -7
- package/dist/commerce.d.cts +2 -2
- package/dist/commerce.d.ts +2 -2
- package/dist/commerce.js +7 -7
- package/dist/{format-BdB7LEIp.js → format-BdPnijvn.js} +11 -2
- package/dist/{format-BnA1aLJk.cjs → format-DLhno7eX.cjs} +16 -1
- package/dist/fx.cjs +5 -5
- package/dist/fx.d.cts +5 -5
- package/dist/fx.d.ts +5 -5
- package/dist/fx.js +5 -5
- package/dist/index.cjs +10 -7
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +8 -8
- package/dist/input.cjs +4 -4
- package/dist/input.d.cts +2 -2
- package/dist/input.d.ts +2 -2
- package/dist/input.js +4 -4
- package/dist/{iso-minor-CtaiIifs.js → iso-minor-CqkWDxHS.js} +1 -1
- package/dist/{iso-minor--gQWI1f2.cjs → iso-minor-wSwJN57T.cjs} +1 -1
- package/dist/{medusa-DuQ3-KoD.d.cts → medusa-4K8N1pUc.d.cts} +11 -2
- package/dist/{medusa-RwqxaDGq.d.ts → medusa-DBXJXXvF.d.ts} +11 -2
- package/dist/{medusa-CmxCni-G.js → medusa-DqJY1qpj.js} +17 -2
- package/dist/{medusa-OJ2TJOxt.cjs → medusa-lRY9xlsf.cjs} +22 -1
- package/dist/{money-CbhsT0fB.d.cts → money-B-3aFjNJ.d.cts} +19 -3
- package/dist/{money-CbhsT0fB.d.ts → money-B-3aFjNJ.d.ts} +19 -3
- package/dist/{money-D5-vlv0h.cjs → money-B3wH_Z4S.cjs} +35 -5
- package/dist/{money-CIgELekG.js → money-WhnGiI00.js} +18 -6
- package/dist/{number-text-BpvN6NAo.cjs → number-text-BWu67jUq.cjs} +1 -1
- package/dist/{number-text-C82oh6JB.js → number-text-DE-q4jO5.js} +1 -1
- package/dist/{percent-Dt8vNIAW.cjs → percent-C0InC2t2.cjs} +1 -1
- package/dist/{percent-CKVI_c-m.js → percent-D1VB9xXG.js} +1 -1
- package/dist/{rate-DGPfB_jc.cjs → rate-CVeMii4a.cjs} +1 -1
- package/dist/{rate-CmeTGNex.d.ts → rate-DBPiYgT1.d.ts} +1 -1
- package/dist/{rate-lLPViBuM.js → rate-DicStBue.js} +1 -1
- package/dist/{rate-toyS3EMf.d.cts → rate-tqK8ijG0.d.cts} +1 -1
- package/dist/{reporting-DEM97DhQ.d.cts → reporting-CG-ai2sM.d.cts} +2 -2
- package/dist/{reporting-5xby-Zas.d.ts → reporting-tpGJbqYp.d.ts} +2 -2
- package/dist/{retail-BsvpNv1F.js → retail-1mu888J1.js} +3 -3
- package/dist/{retail-Mqd-sPMF.d.cts → retail-C_BPLvMj.d.cts} +1 -1
- package/dist/{retail-DTk2XAMM.cjs → retail-Cml8YSKg.cjs} +3 -3
- package/dist/{retail-BwcFJcVN.d.ts → retail-DRUTTQoJ.d.ts} +1 -1
- package/dist/{rounding-oZ832yTD.cjs → rounding-DHBtNCHG.cjs} +1 -1
- package/dist/{rounding-CVAPEfq_.js → rounding-g9rvye0k.js} +1 -1
- package/dist/sql.cjs +3 -3
- package/dist/sql.d.cts +2 -2
- package/dist/sql.d.ts +2 -2
- package/dist/sql.js +3 -3
- package/dist/testing.cjs +33481 -4
- package/dist/testing.d.cts +31 -3
- package/dist/testing.d.ts +31 -3
- package/dist/testing.js +33481 -5
- package/dist/{wire-DQZ6fA3c.cjs → wire-Bhuut8cW.cjs} +259 -34
- package/dist/{wire-Cd4Q1Jmm.d.ts → wire-CaUN9Vf_.d.ts} +61 -21
- package/dist/{wire-CI3Sm1iC.js → wire-sW0yzqth.js} +248 -35
- package/dist/{wire-hWuixv3w.d.cts → wire-xjYXv4go.d.cts} +61 -21
- package/dist/wire.cjs +3 -1
- package/dist/wire.d.cts +2 -2
- package/dist/wire.d.ts +2 -2
- package/dist/wire.js +2 -2
- package/package.json +1 -1
package/dist/testing.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { R as DecimalText, b as FractionDigits, i as Money, x as StorageScale, z as RoundingMode } from "./money-B-3aFjNJ.cjs";
|
|
2
|
+
import { Y as PspId } from "./wire-xjYXv4go.cjs";
|
|
3
3
|
//#region src/testing/check-wire-digits.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Mismatch messages (empty when consistent) between `psp`'s encoder and `documented(code)`, the
|
|
@@ -94,4 +94,32 @@ interface GoldenVector {
|
|
|
94
94
|
/** Wire bytes for every PSP x presented currency x storage amount (18900 vectors). */
|
|
95
95
|
export declare const PSP_GOLDEN_VECTORS: readonly GoldenVector[];
|
|
96
96
|
//#endregion
|
|
97
|
-
|
|
97
|
+
//#region src/testing/golden-psp-fractional.d.ts
|
|
98
|
+
/**
|
|
99
|
+
* Where the package departs on purpose from what the codec does with a fractional amount:
|
|
100
|
+
* `'sub-unit'` a positive amount whose wire is 0 is refused (`error` contains `SUB_UNIT_REFUSAL`);
|
|
101
|
+
* `'exact-half-up'` a tie at the wire digits that Medusa's float `toFixed` rounded down is rounded
|
|
102
|
+
* half-up exactly; `'real-amount'` a refusal that named a `toFixed` neighbour of the amount names
|
|
103
|
+
* the amount as held.
|
|
104
|
+
*/
|
|
105
|
+
type FractionalPolicy = 'sub-unit' | 'exact-half-up' | 'real-amount';
|
|
106
|
+
/**
|
|
107
|
+
* One encode of a FRACTIONAL storage amount (Medusa keeps unrounded totals): `wire` and `error` are
|
|
108
|
+
* what encodeWire gives; where it departs from the codec on purpose, `policy` says why and `medusa`
|
|
109
|
+
* holds the codec's own wire or message.
|
|
110
|
+
*/
|
|
111
|
+
interface FractionalGoldenVector {
|
|
112
|
+
readonly psp: GoldenPspId;
|
|
113
|
+
readonly currency: string;
|
|
114
|
+
readonly convention: GoldenVector['convention'];
|
|
115
|
+
/** The storage amount as canonical decimal text (`'107.8175'`). */
|
|
116
|
+
readonly stored: string;
|
|
117
|
+
readonly wire: number | string | null;
|
|
118
|
+
readonly error: string | null;
|
|
119
|
+
readonly policy: FractionalPolicy | null;
|
|
120
|
+
readonly medusa: number | string | null;
|
|
121
|
+
}
|
|
122
|
+
/** Fractional storage amounts for every PSP x presented currency (10500 vectors). */
|
|
123
|
+
export declare const PSP_FRACTIONAL_GOLDEN_VECTORS: readonly FractionalGoldenVector[];
|
|
124
|
+
//#endregion
|
|
125
|
+
export type { CurrencyCase, DestinationAmountVector, DestinationTextVector, FractionalGoldenVector, FractionalPolicy, GoldenPspId, GoldenVector, MedusaAmountShape, RoundingVector };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { R as DecimalText, b as FractionDigits, i as Money, x as StorageScale, z as RoundingMode } from "./money-B-3aFjNJ.js";
|
|
2
|
+
import { Y as PspId } from "./wire-CaUN9Vf_.js";
|
|
3
3
|
//#region src/testing/check-wire-digits.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Mismatch messages (empty when consistent) between `psp`'s encoder and `documented(code)`, the
|
|
@@ -94,4 +94,32 @@ interface GoldenVector {
|
|
|
94
94
|
/** Wire bytes for every PSP x presented currency x storage amount (18900 vectors). */
|
|
95
95
|
export declare const PSP_GOLDEN_VECTORS: readonly GoldenVector[];
|
|
96
96
|
//#endregion
|
|
97
|
-
|
|
97
|
+
//#region src/testing/golden-psp-fractional.d.ts
|
|
98
|
+
/**
|
|
99
|
+
* Where the package departs on purpose from what the codec does with a fractional amount:
|
|
100
|
+
* `'sub-unit'` a positive amount whose wire is 0 is refused (`error` contains `SUB_UNIT_REFUSAL`);
|
|
101
|
+
* `'exact-half-up'` a tie at the wire digits that Medusa's float `toFixed` rounded down is rounded
|
|
102
|
+
* half-up exactly; `'real-amount'` a refusal that named a `toFixed` neighbour of the amount names
|
|
103
|
+
* the amount as held.
|
|
104
|
+
*/
|
|
105
|
+
type FractionalPolicy = 'sub-unit' | 'exact-half-up' | 'real-amount';
|
|
106
|
+
/**
|
|
107
|
+
* One encode of a FRACTIONAL storage amount (Medusa keeps unrounded totals): `wire` and `error` are
|
|
108
|
+
* what encodeWire gives; where it departs from the codec on purpose, `policy` says why and `medusa`
|
|
109
|
+
* holds the codec's own wire or message.
|
|
110
|
+
*/
|
|
111
|
+
interface FractionalGoldenVector {
|
|
112
|
+
readonly psp: GoldenPspId;
|
|
113
|
+
readonly currency: string;
|
|
114
|
+
readonly convention: GoldenVector['convention'];
|
|
115
|
+
/** The storage amount as canonical decimal text (`'107.8175'`). */
|
|
116
|
+
readonly stored: string;
|
|
117
|
+
readonly wire: number | string | null;
|
|
118
|
+
readonly error: string | null;
|
|
119
|
+
readonly policy: FractionalPolicy | null;
|
|
120
|
+
readonly medusa: number | string | null;
|
|
121
|
+
}
|
|
122
|
+
/** Fractional storage amounts for every PSP x presented currency (10500 vectors). */
|
|
123
|
+
export declare const PSP_FRACTIONAL_GOLDEN_VECTORS: readonly FractionalGoldenVector[];
|
|
124
|
+
//#endregion
|
|
125
|
+
export type { CurrencyCase, DestinationAmountVector, DestinationTextVector, FractionalGoldenVector, FractionalPolicy, GoldenPspId, GoldenVector, MedusaAmountShape, RoundingVector };
|