@kasufinance/kasu-sdk 2.5.0 → 2.6.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.
Files changed (72) hide show
  1. package/README.md +17 -5
  2. package/dist/bundle.cjs.js +797 -16
  3. package/dist/bundle.esm.js +771 -17
  4. package/dist/domain/au-minimum.d.ts +135 -0
  5. package/dist/domain/au-minimum.js +154 -0
  6. package/dist/domain/au-minimum.js.map +1 -0
  7. package/dist/domain/au-minimum.test.d.ts +1 -0
  8. package/dist/domain/au-minimum.test.js +202 -0
  9. package/dist/domain/au-minimum.test.js.map +1 -0
  10. package/dist/domain/index.d.ts +17 -3
  11. package/dist/domain/index.js +13 -3
  12. package/dist/domain/index.js.map +1 -1
  13. package/dist/domain/loan-contract.d.ts +174 -0
  14. package/dist/domain/loan-contract.js +160 -0
  15. package/dist/domain/loan-contract.js.map +1 -0
  16. package/dist/domain/loan-contract.test.d.ts +1 -0
  17. package/dist/domain/loan-contract.test.js +255 -0
  18. package/dist/domain/loan-contract.test.js.map +1 -0
  19. package/dist/domain/requests.d.ts +181 -0
  20. package/dist/domain/requests.js +202 -0
  21. package/dist/domain/requests.js.map +1 -0
  22. package/dist/domain/requests.test.d.ts +1 -0
  23. package/dist/domain/requests.test.js +470 -0
  24. package/dist/domain/requests.test.js.map +1 -0
  25. package/dist/domain/settlement.d.ts +97 -0
  26. package/dist/domain/settlement.js +117 -0
  27. package/dist/domain/settlement.js.map +1 -0
  28. package/dist/domain/settlement.test.d.ts +1 -0
  29. package/dist/domain/settlement.test.js +152 -0
  30. package/dist/domain/settlement.test.js.map +1 -0
  31. package/dist/domain/wallet-errors.d.ts +37 -0
  32. package/dist/domain/wallet-errors.js +56 -0
  33. package/dist/domain/wallet-errors.js.map +1 -0
  34. package/dist/domain/wallet-errors.test.d.ts +1 -0
  35. package/dist/domain/wallet-errors.test.js +71 -0
  36. package/dist/domain/wallet-errors.test.js.map +1 -0
  37. package/dist/facade/chain-configs.js +7 -1
  38. package/dist/facade/chain-configs.js.map +1 -1
  39. package/dist/facade/facade.test.js +82 -5
  40. package/dist/facade/facade.test.js.map +1 -1
  41. package/dist/facade/user-portfolio.d.ts +18 -0
  42. package/dist/facade/user-portfolio.js +23 -0
  43. package/dist/facade/user-portfolio.js.map +1 -1
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +1 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/services/DataService/data-service.js +3 -10
  48. package/dist/services/DataService/data-service.js.map +1 -1
  49. package/dist/services/DataService/directus-client.d.ts +26 -0
  50. package/dist/services/DataService/directus-client.js +38 -0
  51. package/dist/services/DataService/directus-client.js.map +1 -0
  52. package/dist/services/UserLending/user-lending.js +11 -7
  53. package/dist/services/UserLending/user-lending.js.map +1 -1
  54. package/package.json +1 -1
  55. package/src/domain/au-minimum.test.ts +371 -0
  56. package/src/domain/au-minimum.ts +192 -0
  57. package/src/domain/index.ts +67 -3
  58. package/src/domain/loan-contract.test.ts +343 -0
  59. package/src/domain/loan-contract.ts +275 -0
  60. package/src/domain/requests.test.ts +653 -0
  61. package/src/domain/requests.ts +414 -0
  62. package/src/domain/settlement.test.ts +198 -0
  63. package/src/domain/settlement.ts +161 -0
  64. package/src/domain/wallet-errors.test.ts +100 -0
  65. package/src/domain/wallet-errors.ts +56 -0
  66. package/src/facade/chain-configs.ts +7 -1
  67. package/src/facade/facade.test.ts +124 -0
  68. package/src/facade/user-portfolio.ts +24 -0
  69. package/src/index.ts +2 -0
  70. package/src/services/DataService/data-service.ts +7 -24
  71. package/src/services/DataService/directus-client.ts +54 -0
  72. package/src/services/UserLending/user-lending.ts +17 -21
@@ -0,0 +1,135 @@
1
+ /**
2
+ * The AU cumulative-lending minimum — the numeric half.
3
+ *
4
+ * RULE: a lender whose verified KYC country is Australia may only lend when
5
+ * their existing deposited position on THIS deployment, plus the amount they
6
+ * are asking for, reaches the deployment's threshold.
7
+ *
8
+ * This is UX PRE-VALIDATION ONLY. kasu-backend enforces the rule
9
+ * authoritatively at contract generation and refuses with HTTP 403
10
+ * `AU_WHOLESALE_MINIMUM_NOT_MET`; a lender who gets past this check is still
11
+ * stopped there. What these helpers exist for is to raise the amount field's
12
+ * minimum so the lender learns the rule while typing rather than at the end.
13
+ *
14
+ * FAIL-OPEN by design: an absent or unknown country is NOT restricted, and an
15
+ * unlisted stable symbol has no threshold. An UNKNOWN existing position is
16
+ * treated as 0 — strict, so the floor is never advertised lower than the
17
+ * backend will accept, and it relaxes once the position loads.
18
+ *
19
+ * Arithmetic is integer bigint in minor units (10^decimals) so no two
20
+ * consumers can disagree at the boundary. Parsing TRUNCATES, never rounds up —
21
+ * a position can never be inflated into passing. `BigInt(...)` calls only, no
22
+ * bigint literals, so consumers on an older target still compile.
23
+ *
24
+ * Lifted from kasu-ui's `features/lending/lib/au-lending-restriction.ts`. The
25
+ * two toast strings that live there are copy and stay in the applications.
26
+ */
27
+ type Maybe<T> = T | null | undefined;
28
+ type NumLike = string | number | null | undefined;
29
+ /** ISO 3166-1 alpha-3 for Australia — the collapsed KYC country field. */
30
+ export declare const AU_ALPHA3 = "AUS";
31
+ /**
32
+ * Is this the Australian KYC country? Case-insensitive and
33
+ * whitespace-tolerant. Anything that is not a string — including the
34
+ * `undefined` of an unloaded KYC record — is not restricted (fail-open).
35
+ *
36
+ * The alpha-2 `'AU'` deliberately does NOT match: the KYC country reaching
37
+ * this rule is normalised to alpha-3 upstream, and a bare two-letter code
38
+ * here means something else went wrong.
39
+ */
40
+ export declare function isAustralianKyc(country: Maybe<string>): boolean;
41
+ /**
42
+ * Minimum CUMULATIVE position, in WHOLE stable units, keyed on the
43
+ * deployment's stable-asset symbol (a property of the currency, not the
44
+ * chain). Must match kasu-backend's table exactly.
45
+ */
46
+ export declare const AU_MIN_CUMULATIVE_BY_STABLE: Readonly<Record<string, number>>;
47
+ /**
48
+ * Threshold in whole units, or `undefined` for an unlisted stable — a
49
+ * deployment whose currency has no configured minimum is unrestricted.
50
+ */
51
+ export declare function auThresholdFor(symbol: Maybe<string>): number | undefined;
52
+ /**
53
+ * Is this wallet released from the minimum entirely, whatever its country,
54
+ * stable or position says?
55
+ *
56
+ * `exemptAddresses` is DEPLOYMENT CONFIGURATION the caller supplies, not a
57
+ * constant of this package. kasu-sdk is published publicly; the exempt list is
58
+ * a compliance carve-out naming particular lender wallets, so it does not
59
+ * belong in a public tarball. Read it from wherever the application keeps its
60
+ * deployment configuration, and keep it identical to kasu-backend's
61
+ * `AU_WHOLESALE_EXEMPT_ADDRESSES` — that is where the rule is actually
62
+ * enforced. An address exempt here but not there sees no raised minimum in the
63
+ * form and is refused at the end, which is worse than not exempting it at all.
64
+ *
65
+ * The address matched must be the CONNECTED wallet — the one that owns the KYC
66
+ * record and signs the agreement request. kasu-backend verifies that signature
67
+ * before the gate, so an exemption cannot be claimed by asserting someone
68
+ * else's address; it takes their private key. Never match a "view as" address.
69
+ *
70
+ * Comparison is case-insensitive and whitespace-tolerant. Anything that is not
71
+ * a string is NOT exempt (fail closed), and so is anything when the list is
72
+ * absent.
73
+ */
74
+ export declare function isAuMinimumExempt(address: Maybe<string>, exemptAddresses: Maybe<readonly string[]>): boolean;
75
+ /**
76
+ * Truncating, partial-input-tolerant decimal → minor-unit parse.
77
+ * `'10.'` → `10000000n` · `'1.23456789'` → `1234567n` (truncated at 6dp).
78
+ * `''` / `'abc'` / negative / null → `null`.
79
+ *
80
+ * Tolerant of mid-typing states because it runs on an amount field as the
81
+ * lender types, and truncating because rounding up would let a position that
82
+ * is a fraction short read as passing.
83
+ */
84
+ export declare function parseMinorUnits(value: NumLike, decimals: number): bigint | null;
85
+ export interface AuMinimumInput {
86
+ /** Collapsed KYC country (alpha-3). Missing/undefined ⇒ not restricted. */
87
+ country: Maybe<string>;
88
+ /**
89
+ * The CONNECTED wallet (never a "view as" override).
90
+ *
91
+ * REQUIRED KEY, nullable value. A caller with no wallet passes `undefined`
92
+ * and gets the un-exempted behaviour; what it may not do is silently omit
93
+ * the key. Optional would let a refactor of the call site drop it with no
94
+ * compile error — and because a form's own minimum validation refuses a
95
+ * submit below the floor, an exempt lender would then be stopped HERE and
96
+ * never reach the backend that would have let them through.
97
+ */
98
+ address: Maybe<string>;
99
+ /**
100
+ * The deployment's exempt wallets — see `isAuMinimumExempt`. REQUIRED KEY
101
+ * for the same reason `address` is: a caller that has no list passes
102
+ * `undefined` deliberately, and no refactor can drop it by accident.
103
+ */
104
+ exemptAddresses: Maybe<readonly string[]>;
105
+ /** Deployment stable-asset symbol, e.g. `'USDC'` / `'AUDD'`. */
106
+ stableSymbol: Maybe<string>;
107
+ /** Stable-asset decimals (6 on every current deployment). */
108
+ decimals: number;
109
+ /**
110
+ * Existing position (active + pending) on THIS deployment, whole units.
111
+ * Unparseable/undefined ⇒ treated as 0 (strict: the full threshold applies
112
+ * until the position is known).
113
+ */
114
+ existingDeposited: NumLike;
115
+ }
116
+ /**
117
+ * The amount, in WHOLE stable units, an Australian lender still needs in order
118
+ * to reach the deployment's cumulative minimum. Apply it as the amount field's
119
+ * floor via `max(trancheMin, auMinimumRemaining(...))`.
120
+ *
121
+ * Returns 0 for everyone the rule does not restrict (fail-open), 0 for an
122
+ * exempt address, and 0 once the lender's existing position already satisfies
123
+ * the threshold.
124
+ *
125
+ * The exemption is tested FIRST and unconditionally: an exempt wallet has no
126
+ * minimum whatever its country, stable or position says. kasu-backend
127
+ * deliberately tests country first and the exemption second — the two orders
128
+ * are not in conflict, both return "no minimum" for the same inputs. There,
129
+ * the exemption sets a flag that drives a compliance log, so it must not fire
130
+ * for a lender the rule never engaged for. Here nothing is logged, so
131
+ * exemption-first is preferred: it makes this function right on its own,
132
+ * whatever country a caller happens to pass.
133
+ */
134
+ export declare function auMinimumRemaining(input: AuMinimumInput): number;
135
+ export {};
@@ -0,0 +1,154 @@
1
+ /**
2
+ * The AU cumulative-lending minimum — the numeric half.
3
+ *
4
+ * RULE: a lender whose verified KYC country is Australia may only lend when
5
+ * their existing deposited position on THIS deployment, plus the amount they
6
+ * are asking for, reaches the deployment's threshold.
7
+ *
8
+ * This is UX PRE-VALIDATION ONLY. kasu-backend enforces the rule
9
+ * authoritatively at contract generation and refuses with HTTP 403
10
+ * `AU_WHOLESALE_MINIMUM_NOT_MET`; a lender who gets past this check is still
11
+ * stopped there. What these helpers exist for is to raise the amount field's
12
+ * minimum so the lender learns the rule while typing rather than at the end.
13
+ *
14
+ * FAIL-OPEN by design: an absent or unknown country is NOT restricted, and an
15
+ * unlisted stable symbol has no threshold. An UNKNOWN existing position is
16
+ * treated as 0 — strict, so the floor is never advertised lower than the
17
+ * backend will accept, and it relaxes once the position loads.
18
+ *
19
+ * Arithmetic is integer bigint in minor units (10^decimals) so no two
20
+ * consumers can disagree at the boundary. Parsing TRUNCATES, never rounds up —
21
+ * a position can never be inflated into passing. `BigInt(...)` calls only, no
22
+ * bigint literals, so consumers on an older target still compile.
23
+ *
24
+ * Lifted from kasu-ui's `features/lending/lib/au-lending-restriction.ts`. The
25
+ * two toast strings that live there are copy and stay in the applications.
26
+ */
27
+ const ZERO = BigInt(0);
28
+ /** ISO 3166-1 alpha-3 for Australia — the collapsed KYC country field. */
29
+ export const AU_ALPHA3 = 'AUS';
30
+ /**
31
+ * Is this the Australian KYC country? Case-insensitive and
32
+ * whitespace-tolerant. Anything that is not a string — including the
33
+ * `undefined` of an unloaded KYC record — is not restricted (fail-open).
34
+ *
35
+ * The alpha-2 `'AU'` deliberately does NOT match: the KYC country reaching
36
+ * this rule is normalised to alpha-3 upstream, and a bare two-letter code
37
+ * here means something else went wrong.
38
+ */
39
+ export function isAustralianKyc(country) {
40
+ if (typeof country !== 'string')
41
+ return false;
42
+ return country.trim().toUpperCase() === AU_ALPHA3;
43
+ }
44
+ /**
45
+ * Minimum CUMULATIVE position, in WHOLE stable units, keyed on the
46
+ * deployment's stable-asset symbol (a property of the currency, not the
47
+ * chain). Must match kasu-backend's table exactly.
48
+ */
49
+ export const AU_MIN_CUMULATIVE_BY_STABLE = {
50
+ USDC: 360000,
51
+ AUDD: 500000,
52
+ };
53
+ /**
54
+ * Threshold in whole units, or `undefined` for an unlisted stable — a
55
+ * deployment whose currency has no configured minimum is unrestricted.
56
+ */
57
+ export function auThresholdFor(symbol) {
58
+ if (typeof symbol !== 'string')
59
+ return undefined;
60
+ return AU_MIN_CUMULATIVE_BY_STABLE[symbol.trim().toUpperCase()];
61
+ }
62
+ /**
63
+ * Is this wallet released from the minimum entirely, whatever its country,
64
+ * stable or position says?
65
+ *
66
+ * `exemptAddresses` is DEPLOYMENT CONFIGURATION the caller supplies, not a
67
+ * constant of this package. kasu-sdk is published publicly; the exempt list is
68
+ * a compliance carve-out naming particular lender wallets, so it does not
69
+ * belong in a public tarball. Read it from wherever the application keeps its
70
+ * deployment configuration, and keep it identical to kasu-backend's
71
+ * `AU_WHOLESALE_EXEMPT_ADDRESSES` — that is where the rule is actually
72
+ * enforced. An address exempt here but not there sees no raised minimum in the
73
+ * form and is refused at the end, which is worse than not exempting it at all.
74
+ *
75
+ * The address matched must be the CONNECTED wallet — the one that owns the KYC
76
+ * record and signs the agreement request. kasu-backend verifies that signature
77
+ * before the gate, so an exemption cannot be claimed by asserting someone
78
+ * else's address; it takes their private key. Never match a "view as" address.
79
+ *
80
+ * Comparison is case-insensitive and whitespace-tolerant. Anything that is not
81
+ * a string is NOT exempt (fail closed), and so is anything when the list is
82
+ * absent.
83
+ */
84
+ export function isAuMinimumExempt(address, exemptAddresses) {
85
+ if (typeof address !== 'string' || !exemptAddresses)
86
+ return false;
87
+ const needle = address.trim().toLowerCase();
88
+ return exemptAddresses.some((a) => a.trim().toLowerCase() === needle);
89
+ }
90
+ const DECIMAL_RE = /^(\d+)?(?:\.(\d*))?$/;
91
+ /**
92
+ * Truncating, partial-input-tolerant decimal → minor-unit parse.
93
+ * `'10.'` → `10000000n` · `'1.23456789'` → `1234567n` (truncated at 6dp).
94
+ * `''` / `'abc'` / negative / null → `null`.
95
+ *
96
+ * Tolerant of mid-typing states because it runs on an amount field as the
97
+ * lender types, and truncating because rounding up would let a position that
98
+ * is a fraction short read as passing.
99
+ */
100
+ export function parseMinorUnits(value, decimals) {
101
+ if (value === null || value === undefined)
102
+ return null;
103
+ const raw = typeof value === 'number' ? String(value) : value.trim();
104
+ if (!raw)
105
+ return null;
106
+ const match = DECIMAL_RE.exec(raw);
107
+ if (!match || (!match[1] && !match[2]))
108
+ return null;
109
+ // Both capture groups are optional, so either can be absent at runtime.
110
+ // A fractional group that matched EMPTY ('10.') is not absent, and the
111
+ // destructuring defaults leave it alone — only `undefined` takes them.
112
+ const [, whole = '0', fracDigits = ''] = match;
113
+ const frac = fracDigits.slice(0, decimals).padEnd(decimals, '0');
114
+ return BigInt(whole + frac);
115
+ }
116
+ /**
117
+ * The amount, in WHOLE stable units, an Australian lender still needs in order
118
+ * to reach the deployment's cumulative minimum. Apply it as the amount field's
119
+ * floor via `max(trancheMin, auMinimumRemaining(...))`.
120
+ *
121
+ * Returns 0 for everyone the rule does not restrict (fail-open), 0 for an
122
+ * exempt address, and 0 once the lender's existing position already satisfies
123
+ * the threshold.
124
+ *
125
+ * The exemption is tested FIRST and unconditionally: an exempt wallet has no
126
+ * minimum whatever its country, stable or position says. kasu-backend
127
+ * deliberately tests country first and the exemption second — the two orders
128
+ * are not in conflict, both return "no minimum" for the same inputs. There,
129
+ * the exemption sets a flag that drives a compliance log, so it must not fire
130
+ * for a lender the rule never engaged for. Here nothing is logged, so
131
+ * exemption-first is preferred: it makes this function right on its own,
132
+ * whatever country a caller happens to pass.
133
+ */
134
+ export function auMinimumRemaining(input) {
135
+ var _a, _b;
136
+ if (isAuMinimumExempt(input.address, input.exemptAddresses))
137
+ return 0;
138
+ if (!isAustralianKyc(input.country))
139
+ return 0;
140
+ const threshold = auThresholdFor(input.stableSymbol);
141
+ if (threshold === undefined)
142
+ return 0;
143
+ const { existingDeposited, decimals } = input;
144
+ // A table threshold always parses; `?? ZERO` keeps the rule fail-open
145
+ // rather than asserting, so an unparseable one yields no minimum at all.
146
+ const thresholdMinor = (_a = parseMinorUnits(threshold, decimals)) !== null && _a !== void 0 ? _a : ZERO;
147
+ const existingMinor = (_b = parseMinorUnits(existingDeposited, decimals)) !== null && _b !== void 0 ? _b : ZERO;
148
+ const remaining = thresholdMinor - existingMinor;
149
+ if (remaining <= ZERO)
150
+ return 0;
151
+ const base = BigInt('1' + '0'.repeat(decimals));
152
+ return Number(remaining / base) + Number(remaining % base) / Number(base);
153
+ }
154
+ //# sourceMappingURL=au-minimum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"au-minimum.js","sourceRoot":"","sources":["../../src/domain/au-minimum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,0EAA0E;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,OAAsB;IAClD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAqC;IACzE,IAAI,EAAE,MAAO;IACb,IAAI,EAAE,MAAO;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAqB;IAChD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACjD,OAAO,2BAA2B,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,iBAAiB,CAC7B,OAAsB,EACtB,eAAyC;IAEzC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,eAAe;QAAE,OAAO,KAAK,CAAC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O,EAAE,KAAK,CAAC,eAAe,CAAC;QAAE,OAAO,CAAC,CAAC;IACtE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC;QAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACrD,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACtC,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC9C,sEAAsE;IACtE,yEAAyE;IACzE,MAAM,cAAc,GAAG,MAAA,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,mCAAI,IAAI,CAAC;IACpE,MAAM,aAAa,GAAG,MAAA,eAAe,CAAC,iBAAiB,EAAE,QAAQ,CAAC,mCAAI,IAAI,CAAC;IAC3E,MAAM,SAAS,GAAG,cAAc,GAAG,aAAa,CAAC;IACjD,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,202 @@
1
+ import { AU_ALPHA3, AU_MIN_CUMULATIVE_BY_STABLE, auMinimumRemaining, auThresholdFor, isAuMinimumExempt, isAustralianKyc, parseMinorUnits, } from './au-minimum';
2
+ /**
3
+ * Ported from kasu-ui
4
+ * `src/features/lending/lib/au-lending-restriction.test.ts`, minus the two
5
+ * cases that pin toast copy — those strings stay in the applications.
6
+ *
7
+ * What these pin is the arithmetic: integer bigint minor units and a
8
+ * truncating parse, so no consumer can disagree with another at the
9
+ * 360,000 / 500,000 boundary.
10
+ */
11
+ // 6dp on every current deployment (USDC on Base/XDC, AUDD on XDC).
12
+ const DP = 6;
13
+ const n = (v) => BigInt(v);
14
+ describe('isAustralianKyc', () => {
15
+ it('accepts the alpha-3 code in any casing, with surrounding whitespace', () => {
16
+ expect(isAustralianKyc('AUS')).toBe(true);
17
+ expect(isAustralianKyc('aus')).toBe(true);
18
+ expect(isAustralianKyc(' AUS ')).toBe(true);
19
+ expect(isAustralianKyc('Aus')).toBe(true);
20
+ });
21
+ it('rejects the alpha-2 code — the collapsed KYC field is alpha-3', () => {
22
+ // Deliberate: a bare 'AU' must NOT restrict. The KYC claim is
23
+ // normalised to alpha-3 before it ever reaches this rule.
24
+ expect(isAustralianKyc('AU')).toBe(false);
25
+ });
26
+ it('rejects near-misses and absent countries (fail-open)', () => {
27
+ expect(isAustralianKyc('AUT')).toBe(false);
28
+ expect(isAustralianKyc('')).toBe(false);
29
+ expect(isAustralianKyc(undefined)).toBe(false);
30
+ expect(isAustralianKyc(null)).toBe(false);
31
+ });
32
+ it('exports the alpha-3 constant it compares against', () => {
33
+ expect(AU_ALPHA3).toBe('AUS');
34
+ });
35
+ });
36
+ describe('auThresholdFor', () => {
37
+ it('returns the per-stable whole-unit minimum, case-insensitively', () => {
38
+ expect(auThresholdFor('USDC')).toBe(360000);
39
+ expect(auThresholdFor('usdc')).toBe(360000);
40
+ expect(auThresholdFor(' USDC ')).toBe(360000);
41
+ expect(auThresholdFor('AUDD')).toBe(500000);
42
+ expect(auThresholdFor('audd')).toBe(500000);
43
+ });
44
+ it('fails open for an unlisted stable or a missing symbol', () => {
45
+ expect(auThresholdFor('DAI')).toBeUndefined();
46
+ expect(auThresholdFor(undefined)).toBeUndefined();
47
+ expect(auThresholdFor(null)).toBeUndefined();
48
+ expect(auThresholdFor('')).toBeUndefined();
49
+ });
50
+ it('exposes the table kasu-backend’s minimums must match', () => {
51
+ expect(AU_MIN_CUMULATIVE_BY_STABLE).toEqual({
52
+ USDC: 360000,
53
+ AUDD: 500000,
54
+ });
55
+ });
56
+ });
57
+ describe('parseMinorUnits (6dp)', () => {
58
+ it('parses whole and partial decimal input', () => {
59
+ expect(parseMinorUnits('0', DP)).toBe(n('0'));
60
+ expect(parseMinorUnits('1', DP)).toBe(n('1000000'));
61
+ // Mid-typing states an amount field really produces.
62
+ expect(parseMinorUnits('10.', DP)).toBe(n('10000000'));
63
+ expect(parseMinorUnits('.5', DP)).toBe(n('500000'));
64
+ expect(parseMinorUnits('1.5', DP)).toBe(n('1500000'));
65
+ });
66
+ it('TRUNCATES excess precision — a position can never be inflated into passing', () => {
67
+ expect(parseMinorUnits('1.23456789', DP)).toBe(n('1234567'));
68
+ });
69
+ it('returns null for empty, non-numeric, negative and absent input', () => {
70
+ expect(parseMinorUnits('', DP)).toBeNull();
71
+ expect(parseMinorUnits(' ', DP)).toBeNull();
72
+ expect(parseMinorUnits('abc', DP)).toBeNull();
73
+ expect(parseMinorUnits('-5', DP)).toBeNull();
74
+ // A lone separator matches the shape but carries no digits.
75
+ expect(parseMinorUnits('.', DP)).toBeNull();
76
+ expect(parseMinorUnits(null, DP)).toBeNull();
77
+ expect(parseMinorUnits(undefined, DP)).toBeNull();
78
+ });
79
+ it('accepts numbers as well as strings', () => {
80
+ expect(parseMinorUnits(360000, DP)).toBe(n('360000000000'));
81
+ expect(parseMinorUnits(0, DP)).toBe(n('0'));
82
+ });
83
+ });
84
+ // `address` and `exemptAddresses` are required keys on AuMinimumInput (a
85
+ // refactor must not be able to drop either silently), so the shared fixture
86
+ // supplies the un-exempted defaults and the exemption cases override them.
87
+ const BASE = {
88
+ stableSymbol: 'USDC',
89
+ decimals: DP,
90
+ address: undefined,
91
+ exemptAddresses: undefined,
92
+ };
93
+ describe('auMinimumRemaining — fail-open cases return 0 (no raised minimum)', () => {
94
+ it('is 0 when the KYC country is absent', () => {
95
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: undefined, existingDeposited: '0' }))).toBe(0);
96
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: null, existingDeposited: '0' }))).toBe(0);
97
+ });
98
+ it('is 0 for a non-Australian lender', () => {
99
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'USA', existingDeposited: '0' }))).toBe(0);
100
+ });
101
+ it('is 0 on a deployment whose stable has no configured threshold', () => {
102
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { stableSymbol: 'DAI', country: 'AUS', existingDeposited: '0' }))).toBe(0);
103
+ });
104
+ });
105
+ describe('auMinimumRemaining — Australian lender', () => {
106
+ it('demands the FULL threshold while the position is unknown (strict-until-loaded)', () => {
107
+ // `undefined` is not a zero position — it is an unread one. Treating
108
+ // it as 0 keeps the floor at its strictest until the read lands, so
109
+ // the field never advertises a minimum lower than the backend accepts.
110
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', existingDeposited: undefined }))).toBe(360000);
111
+ });
112
+ it('is 0 once the existing position exactly meets the threshold (inclusive)', () => {
113
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', existingDeposited: '360000' }))).toBe(0);
114
+ });
115
+ it('is 0 once the existing position exceeds the threshold', () => {
116
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', existingDeposited: '400000' }))).toBe(0);
117
+ });
118
+ it('returns the remainder for a partial position', () => {
119
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', existingDeposited: '120000' }))).toBe(240000);
120
+ });
121
+ it('keeps sub-unit precision — one minor unit short still demands one minor unit', () => {
122
+ // 359,999.999999 lent → 0.000001 USDC left to reach 360,000. The
123
+ // bigint arithmetic must not round that away into a 0 (unrestricted).
124
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', existingDeposited: '359999.999999' }))).toBe(0.000001);
125
+ });
126
+ it('accepts a numeric existing position, not just a string', () => {
127
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', existingDeposited: 120000 }))).toBe(240000);
128
+ });
129
+ it('uses the 500,000 threshold on AUDD deployments', () => {
130
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { stableSymbol: 'AUDD', country: 'AUS', existingDeposited: 0 }))).toBe(500000);
131
+ });
132
+ });
133
+ // Deployment configuration the caller supplies — see `isAuMinimumExempt`. The
134
+ // real list is never shipped in this public package; these are stand-ins.
135
+ const EXEMPT_CHECKSUMMED = '0x1111111111111111111111111111111111111111';
136
+ const EXEMPT_LOWER = EXEMPT_CHECKSUMMED.toLowerCase();
137
+ const OTHER_EXEMPT = '0x2222222222222222222222222222222222222222';
138
+ const NOT_EXEMPT = '0x3333333333333333333333333333333333333333';
139
+ const LIST = [EXEMPT_LOWER, OTHER_EXEMPT.toLowerCase()];
140
+ describe('isAuMinimumExempt', () => {
141
+ it('matches a listed wallet in any casing, with surrounding whitespace', () => {
142
+ expect(isAuMinimumExempt(EXEMPT_CHECKSUMMED, LIST)).toBe(true);
143
+ expect(isAuMinimumExempt(EXEMPT_LOWER, LIST)).toBe(true);
144
+ expect(isAuMinimumExempt(EXEMPT_LOWER.toUpperCase(), LIST)).toBe(true);
145
+ expect(isAuMinimumExempt(` ${OTHER_EXEMPT} `, LIST)).toBe(true);
146
+ });
147
+ it('matches a list entry stored in mixed case too', () => {
148
+ // The rule normalises both sides, so a caller that reads its list
149
+ // straight out of configuration cannot be caught out by casing.
150
+ expect(isAuMinimumExempt(EXEMPT_LOWER, [EXEMPT_CHECKSUMMED.toUpperCase()])).toBe(true);
151
+ });
152
+ it('fails CLOSED on anything unlisted or not a string', () => {
153
+ expect(isAuMinimumExempt(NOT_EXEMPT, LIST)).toBe(false);
154
+ expect(isAuMinimumExempt('', LIST)).toBe(false);
155
+ expect(isAuMinimumExempt(' ', LIST)).toBe(false);
156
+ expect(isAuMinimumExempt(undefined, LIST)).toBe(false);
157
+ expect(isAuMinimumExempt(null, LIST)).toBe(false);
158
+ // A prefix of, or an extension to, a listed address is another wallet.
159
+ expect(isAuMinimumExempt(EXEMPT_LOWER.slice(0, -1), LIST)).toBe(false);
160
+ expect(isAuMinimumExempt(`${EXEMPT_LOWER}00`, LIST)).toBe(false);
161
+ });
162
+ it('fails CLOSED when no list was supplied', () => {
163
+ expect(isAuMinimumExempt(EXEMPT_LOWER, undefined)).toBe(false);
164
+ expect(isAuMinimumExempt(EXEMPT_LOWER, null)).toBe(false);
165
+ expect(isAuMinimumExempt(EXEMPT_LOWER, [])).toBe(false);
166
+ });
167
+ });
168
+ describe('auMinimumRemaining — named-address exemption', () => {
169
+ it('is 0 for an exempt wallet that would otherwise owe the full threshold', () => {
170
+ for (const address of [
171
+ EXEMPT_CHECKSUMMED,
172
+ EXEMPT_LOWER,
173
+ OTHER_EXEMPT,
174
+ ]) {
175
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', address, exemptAddresses: LIST, existingDeposited: 0 }))).toBe(0);
176
+ }
177
+ });
178
+ it('is 0 on AUDD too, where the threshold is the larger 500,000', () => {
179
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { stableSymbol: 'AUDD', country: 'AUS', address: EXEMPT_LOWER, exemptAddresses: LIST, existingDeposited: 0 }))).toBe(0);
180
+ });
181
+ it('overrides an UNKNOWN position — the strict full-threshold case', () => {
182
+ // `undefined` is what a caller passes while the on-chain read is in
183
+ // flight, and it normally yields the whole threshold. An exemption
184
+ // outranks it, so an exempt lender never sees a floor that later drops.
185
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', address: EXEMPT_LOWER, exemptAddresses: LIST, existingDeposited: undefined }))).toBe(0);
186
+ });
187
+ it('leaves a non-exempt Australian on the full threshold', () => {
188
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', address: NOT_EXEMPT, exemptAddresses: LIST, existingDeposited: 0 }))).toBe(360000);
189
+ });
190
+ it('treats an absent address, or an absent list, as NOT exempt', () => {
191
+ // Both keys are required; either VALUE may be absent, and when it is
192
+ // the rule applies exactly as it did before exemptions existed.
193
+ for (const address of [undefined, null]) {
194
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', address, exemptAddresses: LIST, existingDeposited: 0 }))).toBe(360000);
195
+ }
196
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'AUS', address: EXEMPT_LOWER, exemptAddresses: undefined, existingDeposited: 0 }))).toBe(360000);
197
+ });
198
+ it('is 0 for a non-Australian at an exempt address, as it always was', () => {
199
+ expect(auMinimumRemaining(Object.assign(Object.assign({}, BASE), { country: 'FRA', address: EXEMPT_LOWER, exemptAddresses: LIST, existingDeposited: 0 }))).toBe(0);
200
+ });
201
+ });
202
+ //# sourceMappingURL=au-minimum.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"au-minimum.test.js","sourceRoot":"","sources":["../../src/domain/au-minimum.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,2BAA2B,EAC3B,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,GAClB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;GAQG;AAEH,mEAAmE;AACnE,MAAM,EAAE,GAAG,CAAC,CAAC;AACb,MAAM,CAAC,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAE3C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC3E,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,CAAC,eAAe,CAAC,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AAI,CAAC,MAAO,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAClE,qEAAqE;QACrE,gEAAgE;QAChE,KAAK,MAAM,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC;YACtC,MAAM,CACF,kBAAkB,iCACX,IAAI,KACP,OAAO,EAAE,KAAK,EACd,OAAO,EACP,eAAe,EAAE,IAAI,EACrB,iBAAiB,EAAE,CAAC,IACtB,CACL,CAAC,IAAI,CAAC,MAAO,CAAC,CAAC;QACpB,CAAC;QACD,MAAM,CACF,kBAAkB,iCACX,IAAI,KACP,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,SAAS,EAC1B,iBAAiB,EAAE,CAAC,IACtB,CACL,CAAC,IAAI,CAAC,MAAO,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QACxE,MAAM,CACF,kBAAkB,iCACX,IAAI,KACP,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,IAAI,EACrB,iBAAiB,EAAE,CAAC,IACtB,CACL,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -8,19 +8,33 @@
8
8
  * user reads — `netEffectiveApy` returns `0.196`, never `'19.60% p.a.'`,
9
9
  * and `derivePoolStatus` returns the code `'Full'`, not a sentence. The
10
10
  * formatters that turn these into text stay in each app, where the design
11
- * system and the visitor's locale are. The one exception is
12
- * `getTrancheDisplayName`, which exists precisely because that rename must
13
- * NOT drift between apps.
11
+ * system and the visitor's locale are.
12
+ *
13
+ * Two kinds of string are exempt, and only these two. `getTrancheDisplayName`
14
+ * is here precisely because that rename must NOT drift between apps. And
15
+ * `loan-contract.ts` builds PROTOCOL strings — messages kasu-backend
16
+ * reconstructs byte-for-byte to verify a lender's signature. Those are not
17
+ * copy: nobody may reword them, in any language, without a matching backend
18
+ * change, which is exactly why they belong in one place.
14
19
  * 2. **Pure.** No network, no clock, no environment. Anything with I/O belongs
15
20
  * in `facade/` (see `fetchUnusedPoolIds`).
16
21
  */
17
22
  export { apyToEpochRate, epochRateToApy, EPOCHS_IN_YEAR, netEffectiveApy, } from './rates';
23
+ export { AU_ALPHA3, AU_MIN_CUMULATIVE_BY_STABLE, auMinimumRemaining, auThresholdFor, isAuMinimumExempt, isAustralianKyc, parseMinorUnits, } from './au-minimum';
24
+ export type { AuMinimumInput } from './au-minimum';
18
25
  export { ceilToCents, floorToCents, isBelowMinimumCapacity, MAX_LENDING_AMOUNT_FALLBACK, MIN_LENDING_AMOUNT_FALLBACK, parseTrancheBound, resolveBoundShortcuts, resolveDepositBounds, } from './deposit-bounds';
19
26
  export type { BoundShortcuts, DepositBounds } from './deposit-bounds';
20
27
  export { APXIUM, getCreditOriginator, getInstitutionalLender, INVOICEMATE, RIXON_CAPITAL, } from './partners';
21
28
  export type { PoolNameSignal, StrategyPartner } from './partners';
29
+ export { asContractType, buildContractVersionType, buildFullNameRequestMessage, buildLegacyContractRequestMessage, buildLoanAgreementSignMessage, encodeDepositData, formatSignTimestampUtc, parseFormattedMessage, } from './loan-contract';
30
+ export type { ContractListItem, ContractSection, ContractType, ExemptLoanContract, GenerateContractResponse, LoanContractFormatted, ResolvedContractResponse, RetailLoanContract, } from './loan-contract';
22
31
  export { maxNetRateCeiling, pickHighestYieldTranche, poolMaxApy, selectVisiblePools, } from './pools';
23
32
  export type { BestTranche } from './pools';
33
+ export { countSubmissions, deriveRequestState, firstSubmissionTimestamp, isCycleClosed, submissionEvents, } from './requests';
34
+ export type { RequestKind, RequestState, RequestStatusCode, } from './requests';
35
+ export { CLEARING_WINDOW_SECONDS, computeSettlementWindow, deriveCycleDates, nextCycleBoundary, } from './settlement';
36
+ export type { CycleDates, SettlementWindowInput, SettlementWindowState, } from './settlement';
24
37
  export { getTrancheDisplayName, UPPER_MEZZANINE } from './tranche-display-name';
25
38
  export { compareTrancheSeniority, derivePoolStatus, MIN_TRANCHE_CAPACITY, netTrancheApyBounds, pickDefaultTrancheId, poolAllTranchesFull, trancheApyBounds, trancheHasCapacity, trancheRiskRank, } from './tranches';
26
39
  export type { ApyBounds, PoolStatus, TrancheCapacitySignal, } from './tranches';
40
+ export { isUnpredictableGas, isUserRejected } from './wallet-errors';
@@ -8,16 +8,26 @@
8
8
  * user reads — `netEffectiveApy` returns `0.196`, never `'19.60% p.a.'`,
9
9
  * and `derivePoolStatus` returns the code `'Full'`, not a sentence. The
10
10
  * formatters that turn these into text stay in each app, where the design
11
- * system and the visitor's locale are. The one exception is
12
- * `getTrancheDisplayName`, which exists precisely because that rename must
13
- * NOT drift between apps.
11
+ * system and the visitor's locale are.
12
+ *
13
+ * Two kinds of string are exempt, and only these two. `getTrancheDisplayName`
14
+ * is here precisely because that rename must NOT drift between apps. And
15
+ * `loan-contract.ts` builds PROTOCOL strings — messages kasu-backend
16
+ * reconstructs byte-for-byte to verify a lender's signature. Those are not
17
+ * copy: nobody may reword them, in any language, without a matching backend
18
+ * change, which is exactly why they belong in one place.
14
19
  * 2. **Pure.** No network, no clock, no environment. Anything with I/O belongs
15
20
  * in `facade/` (see `fetchUnusedPoolIds`).
16
21
  */
17
22
  export { apyToEpochRate, epochRateToApy, EPOCHS_IN_YEAR, netEffectiveApy, } from './rates';
23
+ export { AU_ALPHA3, AU_MIN_CUMULATIVE_BY_STABLE, auMinimumRemaining, auThresholdFor, isAuMinimumExempt, isAustralianKyc, parseMinorUnits, } from './au-minimum';
18
24
  export { ceilToCents, floorToCents, isBelowMinimumCapacity, MAX_LENDING_AMOUNT_FALLBACK, MIN_LENDING_AMOUNT_FALLBACK, parseTrancheBound, resolveBoundShortcuts, resolveDepositBounds, } from './deposit-bounds';
19
25
  export { APXIUM, getCreditOriginator, getInstitutionalLender, INVOICEMATE, RIXON_CAPITAL, } from './partners';
26
+ export { asContractType, buildContractVersionType, buildFullNameRequestMessage, buildLegacyContractRequestMessage, buildLoanAgreementSignMessage, encodeDepositData, formatSignTimestampUtc, parseFormattedMessage, } from './loan-contract';
20
27
  export { maxNetRateCeiling, pickHighestYieldTranche, poolMaxApy, selectVisiblePools, } from './pools';
28
+ export { countSubmissions, deriveRequestState, firstSubmissionTimestamp, isCycleClosed, submissionEvents, } from './requests';
29
+ export { CLEARING_WINDOW_SECONDS, computeSettlementWindow, deriveCycleDates, nextCycleBoundary, } from './settlement';
21
30
  export { getTrancheDisplayName, UPPER_MEZZANINE } from './tranche-display-name';
22
31
  export { compareTrancheSeniority, derivePoolStatus, MIN_TRANCHE_CAPACITY, netTrancheApyBounds, pickDefaultTrancheId, poolAllTranchesFull, trancheApyBounds, trancheHasCapacity, trancheRiskRank, } from './tranches';
32
+ export { isUnpredictableGas, isUserRejected } from './wallet-errors';
23
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACH,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACH,MAAM,EACN,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,EACX,aAAa,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EACvB,UAAU,EACV,kBAAkB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EACH,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAClB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACH,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,SAAS,EACT,2BAA2B,EAC3B,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACH,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACH,MAAM,EACN,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,EACX,aAAa,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACH,cAAc,EACd,wBAAwB,EACxB,2BAA2B,EAC3B,iCAAiC,EACjC,6BAA6B,EAC7B,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GACxB,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EACvB,UAAU,EACV,kBAAkB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACH,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,gBAAgB,GACnB,MAAM,YAAY,CAAC;AAOpB,OAAO,EACH,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EACH,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB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