@settlemint/dalp-sdk 2.1.7-main.22780180229 → 2.1.7
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 +22 -22
- package/dist/index.js +5 -10
- package/dist/types.d.ts +3 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,34 +63,34 @@ const dalp = createDalpClient({
|
|
|
63
63
|
apiKey: "sm_dalp_...",
|
|
64
64
|
|
|
65
65
|
// Optional
|
|
66
|
-
organizationId: "org_...",
|
|
66
|
+
organizationId: "org_...", // multi-org scoping
|
|
67
67
|
headers: { "User-Agent": "MyApp" }, // override default headers
|
|
68
|
-
idempotencyKey: "req_abc123",
|
|
69
|
-
requestValidation: true,
|
|
70
|
-
responseValidation: false,
|
|
71
|
-
fetch: customFetch,
|
|
68
|
+
idempotencyKey: "req_abc123", // mutation deduplication
|
|
69
|
+
requestValidation: true, // validate requests client-side (default: true)
|
|
70
|
+
responseValidation: false, // validate responses client-side (default: false)
|
|
71
|
+
fetch: customFetch, // custom fetch implementation
|
|
72
72
|
});
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
## API Namespaces
|
|
76
76
|
|
|
77
|
-
| Namespace | Description
|
|
78
|
-
| ------------------ |
|
|
79
|
-
| `account` | Manage accounts
|
|
80
|
-
| `actions` | Manage actions
|
|
81
|
-
| `addons` | Manage addons
|
|
82
|
-
| `admin` | Administrative operations
|
|
83
|
-
| `contacts` | Manage contacts
|
|
84
|
-
| `exchangeRates` | View exchange rates
|
|
85
|
-
| `externalToken` | Manage external tokens
|
|
86
|
-
| `identityRecovery` | Recover lost identities
|
|
87
|
-
| `monitoring` | Platform monitoring
|
|
88
|
-
| `search` | Search across the platform
|
|
89
|
-
| `settings` | Platform settings
|
|
90
|
-
| `system` | System administration
|
|
91
|
-
| `token` | Manage security tokens
|
|
92
|
-
| `transaction` | View transactions
|
|
93
|
-
| `user` | Manage platform users
|
|
77
|
+
| Namespace | Description |
|
|
78
|
+
| ------------------ | ------------------------------ |
|
|
79
|
+
| `account` | Manage accounts |
|
|
80
|
+
| `actions` | Manage actions |
|
|
81
|
+
| `addons` | Manage addons |
|
|
82
|
+
| `admin` | Administrative operations |
|
|
83
|
+
| `contacts` | Manage contacts |
|
|
84
|
+
| `exchangeRates` | View exchange rates |
|
|
85
|
+
| `externalToken` | Manage external tokens |
|
|
86
|
+
| `identityRecovery` | Recover lost identities |
|
|
87
|
+
| `monitoring` | Platform monitoring |
|
|
88
|
+
| `search` | Search across the platform |
|
|
89
|
+
| `settings` | Platform settings |
|
|
90
|
+
| `system` | System administration |
|
|
91
|
+
| `token` | Manage security tokens |
|
|
92
|
+
| `transaction` | View transactions |
|
|
93
|
+
| `user` | Manage platform users |
|
|
94
94
|
|
|
95
95
|
## Subpath Exports
|
|
96
96
|
|
package/dist/index.js
CHANGED
|
@@ -16109,7 +16109,7 @@ var dalpSerializers = [
|
|
|
16109
16109
|
// package.json
|
|
16110
16110
|
var package_default = {
|
|
16111
16111
|
name: "@settlemint/dalp-sdk",
|
|
16112
|
-
version: "2.1.7
|
|
16112
|
+
version: "2.1.7",
|
|
16113
16113
|
private: false,
|
|
16114
16114
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
16115
16115
|
homepage: "https://settlemint.com",
|
|
@@ -16197,20 +16197,15 @@ function createDalpClient(config3) {
|
|
|
16197
16197
|
responseValidation = false,
|
|
16198
16198
|
fetch: customFetch
|
|
16199
16199
|
} = config3;
|
|
16200
|
-
|
|
16201
|
-
if (!trimmedApiKey) {
|
|
16200
|
+
if (!apiKey || !apiKey.trim()) {
|
|
16202
16201
|
throw new Error("DALP SDK: apiKey is required. Generate one in the DALP dashboard (Settings → API Keys) or via `dalp login`.");
|
|
16203
16202
|
}
|
|
16204
|
-
let parsed;
|
|
16205
16203
|
try {
|
|
16206
|
-
|
|
16204
|
+
new URL(url);
|
|
16207
16205
|
} catch {
|
|
16208
16206
|
throw new Error(`DALP SDK: invalid url "${url}". Provide a full URL including the protocol (e.g., "https://dalp.example.com").`);
|
|
16209
16207
|
}
|
|
16210
|
-
|
|
16211
|
-
throw new Error(`DALP SDK: url must use https:// or http:// protocol, got "${parsed.protocol}".`);
|
|
16212
|
-
}
|
|
16213
|
-
const baseUrl = `${parsed.origin}${parsed.pathname.replace(/\/+$/, "")}`;
|
|
16208
|
+
const baseUrl = url.replace(/\/+$/, "");
|
|
16214
16209
|
const plugins = [];
|
|
16215
16210
|
if (requestValidation) {
|
|
16216
16211
|
plugins.push(new RequestValidationPlugin(rpcContract));
|
|
@@ -16225,7 +16220,7 @@ function createDalpClient(config3) {
|
|
|
16225
16220
|
"User-Agent": SDK_USER_AGENT
|
|
16226
16221
|
};
|
|
16227
16222
|
const secured = {
|
|
16228
|
-
"x-api-key":
|
|
16223
|
+
"x-api-key": apiKey
|
|
16229
16224
|
};
|
|
16230
16225
|
if (idempotencyKey) {
|
|
16231
16226
|
secured["Idempotency-Key"] = idempotencyKey;
|
package/dist/types.d.ts
CHANGED
|
@@ -56,16 +56,9 @@ export interface DalpClientConfig {
|
|
|
56
56
|
*/
|
|
57
57
|
fetch?: typeof globalThis.fetch;
|
|
58
58
|
/**
|
|
59
|
-
* Idempotency key
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* If you reuse the same client instance for multiple mutations, the server
|
|
63
|
-
* will deduplicate all but the first — subsequent mutations silently return
|
|
64
|
-
* the first response. Only set this when the client is used for a single
|
|
65
|
-
* mutation (e.g., a one-shot script). For multi-mutation workflows, set the
|
|
66
|
-
* header per-request via the `headers` callback instead.
|
|
67
|
-
*
|
|
68
|
-
* When omitted, no idempotency key header is sent.
|
|
59
|
+
* Idempotency key for mutation request deduplication.
|
|
60
|
+
* When set, sent as the `Idempotency-Key` header on every request.
|
|
61
|
+
* When omitted, no idempotency key header is sent (the server generates one if needed).
|
|
69
62
|
*/
|
|
70
63
|
idempotencyKey?: string;
|
|
71
64
|
}
|