@capxul/sdk 2.3.2 → 2.5.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 CHANGED
@@ -43,6 +43,28 @@ if ("kind" in amount) {
43
43
  `parseMoney` returns validation errors as values. `formatMoney` rejects a
44
44
  malformed `Money` record with `INVALID_INPUT`.
45
45
 
46
+ ## The asset a screen shows
47
+
48
+ `holdings.primary` picks the one asset a hero balance or a summary total
49
+ should show. It returns the renderable holding with the largest available
50
+ balance. A chain row that carries no `decimals`, no `symbol`, or a symbol that
51
+ stands for no supported currency is skipped, because it cannot be rendered.
52
+
53
+ ```ts
54
+ import { formatMoney, type Holding } from "@capxul/sdk";
55
+
56
+ const result = await client.holdings.primary();
57
+
58
+ if (result.ok && result.value !== null) {
59
+ const holding: Holding = result.value;
60
+ console.log(holding.symbol); // "USDX" — the token symbol the chain reported
61
+ console.log(formatMoney(holding.available, { grammar: "code" })); // e.g. "1,250.50 USD"
62
+ }
63
+ ```
64
+
65
+ `null` means no row is renderable. It is a value, not an error, so give the
66
+ screen its own rule for showing nothing.
67
+
46
68
  ## Observability
47
69
 
48
70
  Hosts can attach the PostHog client they already initialized through one
@@ -293,6 +293,12 @@ function toPartyId(raw) {
293
293
  function toBudgetId(raw) {
294
294
  return toNonEmptyStringBrand(raw, "budgetId");
295
295
  }
296
+ function toPayrollRunId(raw) {
297
+ return toNonEmptyStringBrand(raw, "payrollRunId");
298
+ }
299
+ function toPayrollGroupId(raw) {
300
+ return toNonEmptyStringBrand(raw, "payrollGroupId");
301
+ }
296
302
  function toOrgId(raw) {
297
303
  return toNonEmptyStringBrand(raw, "orgId");
298
304
  }
@@ -488,4 +494,4 @@ Layer.effect(AuthCachePortTag, Effect.sync(() => new InMemoryAuthCacheAdapter())
488
494
  cause
489
495
  }))));
490
496
  //#endregion
491
- export { toPartyId as A, toDurationMs as C, toJwtToken as D, toEpochSeconds as E, CAPXUL_ERROR_CODES as F, CapxulError as I, EXPECTED_OPERATION_OUTCOMES as L, toRoleKey as M, toSessionToken as N, toKycTier as O, decodeConvexError as P, Errors as R, toCurrencyCode as S, toEpochMs as T, toAppId as _, AuthCacheError as a, toChainId as b, BYTES32_RE as c, WEI_RE as d, ZERO_BYTES32 as f, toAllowedOrigin as g, toAddress as h, parseCachedJwt as i, toPublishableKey as j, toOrgId as k, EVM_ADDRESS_RE as l, toAccountId as m, BrowserAuthCacheAdapter as n, AuthCachePortTag as o, currencySymbolFor as p, parseAuthSession as r, APP_ID_RE as s, InMemoryAuthCacheAdapter as t, SUPPORTED_CURRENCY_CODES as u, toAuthUserId as v, toEmail as w, toCountryCode as x, toBudgetId as y, isCapxulError as z };
497
+ export { toPartyId as A, Errors as B, toDurationMs as C, toJwtToken as D, toEpochSeconds as E, toSessionToken as F, decodeConvexError as I, CAPXUL_ERROR_CODES as L, toPayrollRunId as M, toPublishableKey as N, toKycTier as O, toRoleKey as P, CapxulError as R, toCurrencyCode as S, toEpochMs as T, isCapxulError as V, toAppId as _, AuthCacheError as a, toChainId as b, BYTES32_RE as c, WEI_RE as d, ZERO_BYTES32 as f, toAllowedOrigin as g, toAddress as h, parseCachedJwt as i, toPayrollGroupId as j, toOrgId as k, EVM_ADDRESS_RE as l, toAccountId as m, BrowserAuthCacheAdapter as n, AuthCachePortTag as o, currencySymbolFor as p, parseAuthSession as r, APP_ID_RE as s, InMemoryAuthCacheAdapter as t, SUPPORTED_CURRENCY_CODES as u, toAuthUserId as v, toEmail as w, toCountryCode as x, toBudgetId as y, EXPECTED_OPERATION_OUTCOMES as z };