@settlemint/dalp-sdk 3.1.26-main.39717604394 → 3.1.26-main.39728385283

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
@@ -155,6 +155,32 @@ declaration says one lives rather than guessing from a field name.
155
155
  `OrganizationId` is the only entity id branded end to end across the platform;
156
156
  every other identifier crossing this boundary is a plain string.
157
157
 
158
+ Request and response types brand the wire scalars the API validates, so a raw
159
+ string does not compile where the API wants an address, hash or amount. Build the
160
+ brand with a constructor, which throws a `DalpSdkError` (code
161
+ `sdk.scalar.EVM_ADDRESS_INVALID` for an address, `sdk.scalar.VALUE_INVALID` for
162
+ the rest) when the value is not valid, or narrow with the matching guard:
163
+
164
+ ```ts
165
+ import { evmAddress, integerString, isEvmAddress } from "@settlemint/dalp-sdk/scalars";
166
+
167
+ await dalp.api.token.mint({
168
+ assetId: evmAddress("0x52908400098527886e0f7030069857d2e4169ee7"),
169
+ recipients: evmAddress("0x5A0b54D5dc17e0AadC383d2db43B0a0D3E029c4c"),
170
+ amounts: integerString(1000n),
171
+ });
172
+
173
+ const value: unknown = await readFromSomewhere();
174
+ if (isEvmAddress(value)) {
175
+ await dalp.api.token.mint({ assetId: value, recipients: value, amounts: "100" });
176
+ }
177
+ ```
178
+
179
+ The constructors are `evmAddress`, `ethereumHash`, `ethereumHex`,
180
+ `cantonPartyId`, `fiatCurrency`, `networkId`, `timestamp`, `integerString` and
181
+ `decimalString`; each has an `is...` guard, such as `isEthereumHash`. Integer
182
+ text is typed `${bigint}` and decimal text `${number}`.
183
+
158
184
  ## Auth
159
185
 
160
186
  ```ts
package/dist/auth.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  makeCookieStore2,
18
18
  createCookieStoreFetch2,
19
19
  SDK_USER_AGENT2
20
- } from "./chunk-hmjes1ct.js";
20
+ } from "./chunk-em0bmf8p.js";
21
21
  import {
22
22
  normalizeDalpBaseUrl
23
23
  } from "./chunk-h9e65x5z.js";