@settlemint/dalp-sdk 3.1.33-main.43433008600 → 3.1.33-release.43440124932
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/LICENSE +157 -3
- package/README.md +169 -276
- package/dist/api-types.generated.d.ts +14160 -0
- package/dist/api-types.generated.d.ts.map +1 -0
- package/dist/{auth/permissions.d.ts → auth-permissions.d.ts} +8 -0
- package/dist/auth-permissions.d.ts.map +1 -0
- package/dist/auth-wallet-plugins.d.ts +86 -0
- package/dist/auth-wallet-plugins.d.ts.map +1 -0
- package/dist/auth.d.ts +115 -8
- package/dist/auth.d.ts.map +1 -0
- package/dist/bundler.d.ts +217 -0
- package/dist/bundler.d.ts.map +1 -0
- package/dist/client.d.ts +19 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/contract-errors.d.ts +4156 -0
- package/dist/contract-errors.d.ts.map +1 -0
- package/dist/contract.d.ts +22 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/cookie-store.d.ts +10 -0
- package/dist/cookie-store.d.ts.map +1 -0
- package/dist/dapi-errors.d.ts +656 -0
- package/dist/dapi-errors.d.ts.map +1 -0
- package/dist/errors.d.ts +639 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +45 -28
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94522 -159
- package/dist/platform.d.ts +41 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +13 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +8 -0
- package/dist/sdk-error.d.ts +74 -0
- package/dist/sdk-error.d.ts.map +1 -0
- package/dist/serializers.d.ts +41 -0
- package/dist/serializers.d.ts.map +1 -0
- package/dist/types.d.ts +114 -38
- package/dist/types.d.ts.map +1 -0
- package/dist/url.d.ts +1 -0
- package/dist/url.d.ts.map +1 -0
- package/dist/verify-webhook.d.ts +28 -18
- package/dist/verify-webhook.d.ts.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.generated.d.ts +8 -0
- package/dist/version.generated.d.ts.map +1 -0
- package/dist/wait-for-transaction.d.ts +86 -46
- package/dist/wait-for-transaction.d.ts.map +1 -0
- package/dist/webhook-events.d.ts +35 -1360
- package/dist/webhook-events.d.ts.map +1 -0
- package/package.json +36 -176
- package/dist/auth/client.d.ts +0 -114
- package/dist/auth/invite-step-up.d.ts +0 -2
- package/dist/auth/live.d.ts +0 -47
- package/dist/auth/native-passkey.d.ts +0 -8
- package/dist/auth/wallet-plugins.d.ts +0 -196
- package/dist/auth-surface.d.ts +0 -2
- package/dist/auth.js +0 -540
- package/dist/chunk-28wnam27.js +0 -4
- package/dist/chunk-2s3djfcb.js +0 -5
- package/dist/chunk-6hckdbwt.js +0 -600
- package/dist/chunk-6kwchmzg.js +0 -339
- package/dist/chunk-b03ycwb7.js +0 -68
- package/dist/chunk-crtb9edj.js +0 -29
- package/dist/chunk-crymqnve.js +0 -5
- package/dist/chunk-g5j1xky8.js +0 -99
- package/dist/chunk-k3ntysxx.js +0 -57
- package/dist/chunk-vgq00sfj.js +0 -38
- package/dist/chunk-wxma5jfh.js +0 -204
- package/dist/chunk-x0d5as8p.js +0 -1529
- package/dist/client/conditional-request.d.ts +0 -8
- package/dist/client/factory.d.ts +0 -4
- package/dist/client/query-serializer.d.ts +0 -1
- package/dist/client/request-compression.d.ts +0 -12
- package/dist/client/ssr-fetch.d.ts +0 -10
- package/dist/client/step-up-challenge.d.ts +0 -10
- package/dist/effect.d.ts +0 -39
- package/dist/effect.js +0 -110
- package/dist/errors/api-error.d.ts +0 -35
- package/dist/errors/error-codes.d.ts +0 -18
- package/dist/errors/find-current-error.d.ts +0 -2
- package/dist/errors/prefix-coded-list.d.ts +0 -3
- package/dist/errors/public-error.d.ts +0 -3
- package/dist/errors/public-error.js +0 -9
- package/dist/errors/sdk-error.d.ts +0 -52
- package/dist/errors/sdk-error.js +0 -8
- package/dist/generated/api-types.d.ts +0 -104873
- package/dist/generated/api-types.ts +0 -112304
- package/dist/generated/console-routes.d.ts +0 -12
- package/dist/generated/error-catalog.d.ts +0 -9
- package/dist/generated/error-codes.d.ts +0 -9
- package/dist/generated/response-scalars.d.ts +0 -9
- package/dist/generated/response-schemas.d.ts +0 -9
- package/dist/generated/route-error-codes.d.ts +0 -9
- package/dist/generated/routes.d.ts +0 -12
- package/dist/proxy/builder.d.ts +0 -17
- package/dist/proxy/client-core.d.ts +0 -36
- package/dist/proxy/client.d.ts +0 -5
- package/dist/proxy/fetch-executor.d.ts +0 -7
- package/dist/proxy/flat-args.d.ts +0 -24
- package/dist/proxy/response-decode.d.ts +0 -38
- package/dist/proxy/sse.d.ts +0 -11
- package/dist/proxy/step-up-challenge.d.ts +0 -4
- package/dist/proxy/tanstack.d.ts +0 -6
- package/dist/proxy/transport.d.ts +0 -76
- package/dist/react-query.d.ts +0 -2
- package/dist/react-query.js +0 -14
- package/dist/routes/cli-command.d.ts +0 -17
- package/dist/routes/console.d.ts +0 -14
- package/dist/routes/console.js +0 -27
- package/dist/routes/index.d.ts +0 -6
- package/dist/routes/index.js +0 -122
- package/dist/routes/types.d.ts +0 -73
- package/dist/runtime-exports.d.ts +0 -4
- package/dist/runtime-exports.js +0 -38
- package/dist/runtime.d.ts +0 -8
- package/dist/scalars/big-decimal.d.ts +0 -22
- package/dist/scalars/big-int.d.ts +0 -3
- package/dist/scalars/dalp-scalars.d.ts +0 -28
- package/dist/scalars/ethereum-address.d.ts +0 -3
- package/dist/scalars/exchange-rates.d.ts +0 -13
- package/dist/scalars/index.d.ts +0 -14
- package/dist/scalars/index.js +0 -236
- package/dist/scalars/organization-id.d.ts +0 -5
- package/dist/scalars/token-decimals.d.ts +0 -4
- package/dist/secret.d.ts +0 -12
- package/dist/server-proxy.d.ts +0 -39
- package/dist/server-proxy.js +0 -186
- package/dist/sign-webhook-receipt.d.ts +0 -16
- package/dist/sign-webhook-receipt.js +0 -26
- package/dist/transport/cookie-store.d.ts +0 -9
- package/dist/transport/sse-lifecycle.d.ts +0 -24
- package/dist/verify-webhook.js +0 -8
- package/dist/wait-for-transaction.js +0 -154
package/LICENSE
CHANGED
|
@@ -1,8 +1,162 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SETTLEMINT COMMERCIAL CUSTOMER SOURCE LICENSE
|
|
2
|
+
|
|
3
|
+
**("License")**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## TL;DR (NON-BINDING SUMMARY)
|
|
8
|
+
|
|
9
|
+
- You may view, fork, modify, and run this code ONLY while you have an active, paid contract with SettleMint.
|
|
10
|
+
- You may use it internally (cloud, on-prem, or hybrid) only as agreed in your contract.
|
|
11
|
+
- You may NOT resell it, offer it as a service, publish it, or use it to build or operate a competing product.
|
|
12
|
+
- When your contract ends, your right to use the software ends immediately. You must stop all deployments and delete active copies.
|
|
13
|
+
- This is NOT open source.
|
|
14
|
+
|
|
15
|
+
*This summary is informational only. The legal terms below control.*
|
|
16
|
+
|
|
17
|
+
---
|
|
2
18
|
|
|
3
19
|
Copyright © 2025 SettleMint NV
|
|
4
20
|
All rights reserved.
|
|
5
21
|
|
|
6
|
-
|
|
22
|
+
This License governs the use of the Software (as defined below) and is a proprietary, source-available license. It is not an open-source license.
|
|
23
|
+
|
|
24
|
+
By accessing, copying, modifying, or using the Software, You agree to be bound by this License and confirm that You are a Customer with an Active Contract.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 1. DEFINITIONS
|
|
29
|
+
|
|
30
|
+
**1.1 "Licensor"**
|
|
31
|
+
SettleMint NV, a company incorporated under Belgian law, or any affiliated entity explicitly identified in the applicable Commercial Agreement.
|
|
32
|
+
|
|
33
|
+
**1.2 "Customer" or "You"**
|
|
34
|
+
The legal entity that has entered into an Active Contract with Licensor and whose employees or contractors access or use the Software.
|
|
35
|
+
|
|
36
|
+
**1.3 "Commercial Agreement"**
|
|
37
|
+
Any master services agreement, subscription agreement, order form, statement of work, or similar contract executed between Licensor and Customer governing commercial terms.
|
|
38
|
+
|
|
39
|
+
**1.4 "Active Contract"**
|
|
40
|
+
A Commercial Agreement that is in force, not terminated, and for which all undisputed fees due are paid.
|
|
41
|
+
|
|
42
|
+
**1.5 "Software"**
|
|
43
|
+
The source code, object code, build scripts, configuration files, documentation, and any other materials made available by Licensor in this repository, including all updates and modifications thereto.
|
|
44
|
+
|
|
45
|
+
**1.6 "Derivative Works"**
|
|
46
|
+
Any modification, adaptation, translation, or other work based on or incorporating the Software, as defined under Book XI of the Belgian Code of Economic Law.
|
|
47
|
+
|
|
48
|
+
**1.7 "Authorized Use"**
|
|
49
|
+
Use of the Software solely for Customer's internal business purposes and strictly within the scope permitted by the Active Contract.
|
|
50
|
+
|
|
51
|
+
**1.8 "Authorized Deployment"**
|
|
52
|
+
Any installation, environment, system, blockchain network, cluster, or runtime explicitly permitted under the Active Contract, whether cloud-based, on-premises, or hybrid.
|
|
53
|
+
|
|
54
|
+
**1.9 "Competitive Use"**
|
|
55
|
+
Any use of the Software or Derivative Works to develop, operate, market, or support a product or service that competes with Licensor's products or services, or that could reasonably substitute for them.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 2. LICENSE GRANT
|
|
60
|
+
|
|
61
|
+
**2.1 Conditional License Grant**
|
|
62
|
+
Subject to continuous compliance with this License and the existence of an Active Contract, Licensor grants Customer a limited, non-exclusive, non-transferable, non-sublicensable, revocable license to:
|
|
63
|
+
|
|
64
|
+
(a) access and review the Software;
|
|
65
|
+
(b) copy the Software for internal use;
|
|
66
|
+
(c) modify the Software and create Derivative Works;
|
|
67
|
+
(d) deploy and run the Software and Derivative Works solely for Authorized Use and only in Authorized Deployments.
|
|
68
|
+
|
|
69
|
+
**2.2 Forking**
|
|
70
|
+
Customer may create private forks of the Software solely for Authorized Use. All such forks remain subject to this License.
|
|
71
|
+
|
|
72
|
+
**2.3 No Implied Rights**
|
|
73
|
+
No rights are granted except as expressly stated. All rights not expressly granted are reserved by Licensor.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 3. RESTRICTIONS
|
|
78
|
+
|
|
79
|
+
Customer shall not, directly or indirectly:
|
|
80
|
+
|
|
81
|
+
(a) use the Software without an Active Contract;
|
|
82
|
+
(b) deploy the Software outside Authorized Deployments;
|
|
83
|
+
(c) provide the Software or any Derivative Work as a service, platform, or product to third parties, unless explicitly permitted in writing;
|
|
84
|
+
(d) sublicense, distribute, sell, lease, or transfer the Software or any Derivative Work to any third party;
|
|
85
|
+
(e) engage in any Competitive Use;
|
|
86
|
+
(f) use the Software to benchmark, reverse-engineer, or analyze Licensor's products for competitive purposes;
|
|
87
|
+
(g) publish, disclose, or make publicly available the Software or any fork thereof;
|
|
88
|
+
(h) remove or obscure copyright, trademark, or proprietary notices.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 4. OWNERSHIP
|
|
93
|
+
|
|
94
|
+
**4.1 Licensor IP**
|
|
95
|
+
Licensor retains all right, title, and interest in and to the Software.
|
|
96
|
+
|
|
97
|
+
**4.2 Customer Modifications**
|
|
98
|
+
Customer retains ownership of original modifications it creates; however, Customer may not use, execute, deploy, or distribute any Derivative Work that includes or depends on the Software except as permitted under an Active Contract.
|
|
99
|
+
|
|
100
|
+
**4.3 Feedback and Contributions**
|
|
101
|
+
Any feedback, suggestions, or contributions provided by Customer may be used by Licensor without restriction. To the extent such contributions constitute copyrightable works, Customer grants Licensor a perpetual, worldwide, royalty-free, irrevocable license to use, modify, and distribute them.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 5. TERMINATION
|
|
106
|
+
|
|
107
|
+
**5.1 Automatic Termination**
|
|
108
|
+
This License automatically terminates upon termination or expiration of the Active Contract.
|
|
109
|
+
|
|
110
|
+
**5.2 Effect of Termination**
|
|
111
|
+
Upon termination, Customer must immediately:
|
|
112
|
+
|
|
113
|
+
(a) cease all use and deployment of the Software and Derivative Works;
|
|
114
|
+
(b) delete all running instances, binaries, containers, and deployments;
|
|
115
|
+
(c) destroy or delete all copies of the Software, except that one archival copy of source code may be retained solely for legal or compliance purposes.
|
|
116
|
+
|
|
117
|
+
No right to resume use or deployment survives termination.
|
|
118
|
+
|
|
119
|
+
**5.3 Survival**
|
|
120
|
+
Sections relating to ownership, restrictions, liability, governing law, and jurisdiction survive termination.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 6. WARRANTY DISCLAIMER
|
|
125
|
+
|
|
126
|
+
THE SOFTWARE IS PROVIDED "AS IS". TO THE MAXIMUM EXTENT PERMITTED BY BELGIAN LAW, LICENSOR DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 7. LIMITATION OF LIABILITY
|
|
131
|
+
|
|
132
|
+
To the maximum extent permitted by Belgian law, Licensor shall not be liable for any indirect, incidental, consequential, or special damages, including loss of profits, data, or business interruption, even if advised of the possibility.
|
|
133
|
+
|
|
134
|
+
Nothing in this License limits liability that cannot be limited under mandatory Belgian law.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 8. GOVERNING LAW AND JURISDICTION
|
|
139
|
+
|
|
140
|
+
This License is governed by and construed in accordance with the laws of Belgium, excluding conflict-of-law rules.
|
|
141
|
+
|
|
142
|
+
Any dispute arising out of or in connection with this License shall be subject to the exclusive jurisdiction of the courts of Brussels.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 9. MISCELLANEOUS
|
|
147
|
+
|
|
148
|
+
**9.1 Entire Agreement**
|
|
149
|
+
This License, together with the applicable Commercial Agreement, constitutes the entire agreement regarding the Software.
|
|
150
|
+
|
|
151
|
+
**9.2 Conflict**
|
|
152
|
+
In case of conflict, the Commercial Agreement prevails.
|
|
153
|
+
|
|
154
|
+
**9.3 Severability**
|
|
155
|
+
If any provision is held invalid, the remaining provisions remain in full force.
|
|
156
|
+
|
|
157
|
+
**9.4 No Waiver**
|
|
158
|
+
Failure to enforce any provision does not constitute a waiver.
|
|
159
|
+
|
|
160
|
+
---
|
|
7
161
|
|
|
8
|
-
|
|
162
|
+
**END OF LICENSE**
|
package/README.md
CHANGED
|
@@ -1,313 +1,206 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://github.com/settlemint/sdk/blob/main/logo.svg" width="200px" align="center" alt="SettleMint logo" />
|
|
3
|
+
<h1 align="center">DALP SDK</h1>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://settlemint.com">https://settlemint.com</a>
|
|
6
|
+
<br/>
|
|
7
|
+
Fully typed TypeScript SDK for the Digital Asset Lifecycle Platform API.
|
|
8
|
+
</p>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/@settlemint/dalp-sdk" rel="nofollow"><img src="https://img.shields.io/npm/v/@settlemint/dalp-sdk" alt="npm version"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@settlemint/dalp-sdk" rel="nofollow"><img src="https://img.shields.io/npm/dw/@settlemint/dalp-sdk" alt="npm downloads"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<div align="center">
|
|
17
|
+
<a href="https://settlemint.com">Website</a>
|
|
18
|
+
<span> • </span>
|
|
19
|
+
<a href="https://www.npmjs.com/package/@settlemint/dalp-sdk">NPM</a>
|
|
20
|
+
<span> • </span>
|
|
21
|
+
<a href="mailto:support@settlemint.com">Support</a>
|
|
22
|
+
<br />
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
## About
|
|
26
|
+
|
|
27
|
+
The DALP SDK provides a fully typed client for the Digital Asset Lifecycle Platform API. Built on [oRPC](https://orpc.unnoq.com/) with contract-first types, it gives you auto-complete for every API namespace — tokens, identities, compliance, transactions, and more.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# npm
|
|
33
|
+
npm install @settlemint/dalp-sdk
|
|
34
|
+
|
|
35
|
+
# bun
|
|
36
|
+
bun add @settlemint/dalp-sdk
|
|
37
|
+
```
|
|
13
38
|
|
|
14
|
-
##
|
|
39
|
+
## Quick Start
|
|
15
40
|
|
|
16
|
-
```
|
|
41
|
+
```typescript
|
|
17
42
|
import { createDalpClient } from "@settlemint/dalp-sdk";
|
|
18
43
|
|
|
19
44
|
const dalp = createDalpClient({
|
|
20
|
-
|
|
45
|
+
url: "https://dalp.example.com",
|
|
21
46
|
apiKey: "sm_dalp_...",
|
|
47
|
+
organizationId: "org_...", // optional, for multi-org setups
|
|
22
48
|
});
|
|
23
49
|
|
|
24
|
-
|
|
50
|
+
// Every method is fully typed with auto-complete
|
|
51
|
+
const tokens = await dalp.token.list({ query: {} });
|
|
52
|
+
const system = await dalp.system.read({});
|
|
25
53
|
```
|
|
26
54
|
|
|
27
|
-
|
|
28
|
-
parameters and which are query or body fields, so a call site names what it
|
|
29
|
-
means and never restates the transport. The build refuses any route whose path
|
|
30
|
-
parameter would collide with a body or query key, which is what makes the
|
|
31
|
-
merge safe.
|
|
32
|
-
|
|
33
|
-
`createDalpClient` owns the shared transport policy once: the credential
|
|
34
|
-
mechanism, the acting-context headers (`organizationId`, `participant`,
|
|
35
|
-
`executor`, `chainId`, `selectedSigners`, `idempotencyKey`), conditional
|
|
36
|
-
`If-None-Match` reuse, custom fetch injection, the settlement bound, and abort
|
|
37
|
-
propagation.
|
|
38
|
-
|
|
39
|
-
**An API key cannot reach a browser or an app.** `createDalpClient` and
|
|
40
|
-
`createDalpAuthClient` throw at construction when a key is passed with
|
|
41
|
-
`runtime: "browser"` or `runtime: "react-native"`, rather than at the first
|
|
42
|
-
request. A key carries the
|
|
43
|
-
full authority of the identity it belongs to, and anything bundled into a web
|
|
44
|
-
page or an app ships to every user. There the client authenticates with the
|
|
45
|
-
session cookie instead.
|
|
46
|
-
|
|
47
|
-
### Dispatch by route id
|
|
48
|
-
|
|
49
|
-
```ts
|
|
50
|
-
const token = await dalp.execute("token/read", { assetId });
|
|
51
|
-
```
|
|
55
|
+
## Auth Client
|
|
52
56
|
|
|
53
|
-
`
|
|
54
|
-
|
|
55
|
-
the namespaced tree gives a call site. The CLI, the end-to-end harness, and the
|
|
56
|
-
demo scripts are all built on it.
|
|
57
|
-
|
|
58
|
-
### Settlement
|
|
59
|
-
|
|
60
|
-
A queue-backed write carries a `Prefer` header derived from
|
|
61
|
-
`settlementTimeoutMs`: undefined asks for `wait=15`, zero or less asks for
|
|
62
|
-
`respond-async`, anything else asks for `wait=<seconds>`, clamped to the
|
|
63
|
-
platform's 5 to 99 second range. `settlementTimeoutMs` sets that bound per
|
|
64
|
-
client, and a call may override it.
|
|
65
|
-
|
|
66
|
-
The platform does the waiting, not the client. When the write settles inside
|
|
67
|
-
the wait, the call returns the route's HTTP 200 resource. When it does not, the
|
|
68
|
-
call returns the declared HTTP 202 handle unchanged: a transaction write's
|
|
69
|
-
`{ transactionId, status, statusUrl }`, or a custody write's `{ requestId,
|
|
70
|
-
state, statusUrl }`. The client never polls a status URL on your behalf.
|
|
71
|
-
|
|
72
|
-
User creation can return `{ requestId, state: "running", statusUrl }` when it
|
|
73
|
-
exceeds the synchronous wait. Poll `statusUrl` with the same organization and
|
|
74
|
-
chain headers. The read returns 202 while creation is running, 200 with the
|
|
75
|
-
created user when it completes, or a named error when it fails. It can also
|
|
76
|
-
return a custody handle to follow until the custody account settles. Do not
|
|
77
|
-
submit another create while the original request is pending.
|
|
78
|
-
|
|
79
|
-
Pass a transaction id to `waitForTransaction` to follow it to a terminal
|
|
80
|
-
state. A write the funding gate parks on an operator payment reads as still
|
|
81
|
-
queued for as long as the ask is open: the status row carries it as
|
|
82
|
-
`activeRequirement`, and `waitForTransaction` restarts its own timeout on every
|
|
83
|
-
status that reports one, so the wait it runs outlasts the pause. A caller that
|
|
84
|
-
cannot wait that long ends the wait through `signal`, or passes
|
|
85
|
-
`holdWhilePaused: false` to end on the first parked status instead. A custody
|
|
86
|
-
handle has no equivalent helper: follow `statusUrl` yourself. A `DEAD_LETTER`
|
|
87
|
-
status with `mayStillLand: true` is not terminal: the call can still reach the
|
|
88
|
-
chain, so `waitForTransaction` keeps polling it and ends with reason `timeout`,
|
|
89
|
-
not `terminal-failure`. Do not resend while `mayStillLand` is `true`.
|
|
90
|
-
|
|
91
|
-
### Conditional requests and ETags
|
|
92
|
-
|
|
93
|
-
The client reuses a held body when the server answers a matching ETag with 304.
|
|
94
|
-
Server ETags must be **strong content digests** computed **after
|
|
95
|
-
authorization** inside the requester's partition. Version-stamp ETags
|
|
96
|
-
(generation counters, watermarks, table versions) are forbidden for conditional
|
|
97
|
-
request adopters: a stamp can collide across tenants or lag a body change.
|
|
98
|
-
|
|
99
|
-
Identity changes that do not ride this client (browser sign-out, organization
|
|
100
|
-
switch) must clear the held bodies, so a later GET cannot send another
|
|
101
|
-
session's `If-None-Match`.
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
dalp.conditionalRequests.clear();
|
|
105
|
-
```
|
|
57
|
+
Use `createDalpAuthClient` for Better Auth operations such as sign-up, session listing, organization management, API
|
|
58
|
+
keys, device authorization, and wallet verification setup.
|
|
106
59
|
|
|
107
|
-
|
|
60
|
+
```typescript
|
|
61
|
+
import { createDalpAuthClient } from "@settlemint/dalp-sdk";
|
|
108
62
|
|
|
109
|
-
|
|
110
|
-
|
|
63
|
+
const auth = createDalpAuthClient({
|
|
64
|
+
url: "https://dalp.example.com",
|
|
65
|
+
apiKey: "sm_dalp_...",
|
|
66
|
+
organizationId: "org_...",
|
|
67
|
+
});
|
|
111
68
|
|
|
112
|
-
const
|
|
113
|
-
const tokens = yield * dalp.api.token.list({ page: { limit: 25 } });
|
|
69
|
+
const apiKeys = await auth.apiKey.list();
|
|
114
70
|
```
|
|
115
71
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
rather than throwing. `execute` is typed by route id here too.
|
|
72
|
+
For Node-side session flows, use the platform client. It keeps Better Auth cookies in an SDK-owned store and exposes the
|
|
73
|
+
DAPI client and auth client together.
|
|
119
74
|
|
|
120
|
-
|
|
75
|
+
```typescript
|
|
76
|
+
import { createDalpPlatformClient } from "@settlemint/dalp-sdk";
|
|
121
77
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
`./routes` publishes the generated table both interpreters dispatch through:
|
|
127
|
-
every v2 route's id, method, path template, statuses, and traits. It carries no
|
|
128
|
-
client and no Effect, so a tool that only needs to know what the platform
|
|
129
|
-
serves loads this rather than a client.
|
|
78
|
+
const platform = createDalpPlatformClient({
|
|
79
|
+
url: "https://dalp.example.com",
|
|
80
|
+
});
|
|
130
81
|
|
|
131
|
-
|
|
82
|
+
await platform.auth.signUp.email({
|
|
83
|
+
email: "user@example.com",
|
|
84
|
+
password: "Password123!",
|
|
85
|
+
name: "Example User",
|
|
86
|
+
});
|
|
132
87
|
|
|
133
|
-
|
|
134
|
-
const options = dalp.api.token.list.queryOptions({ page: { limit: 25 } });
|
|
135
|
-
const transfer = dalp.api.token.transfer.mutationOptions();
|
|
88
|
+
const sessionCookie = platform.cookieStore.header;
|
|
136
89
|
```
|
|
137
90
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
`
|
|
153
|
-
|
|
154
|
-
`
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
`
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
the rest) when the value is not valid, or narrow with the matching guard:
|
|
166
|
-
|
|
167
|
-
```ts
|
|
168
|
-
import { evmAddress, integerString, isEvmAddress } from "@settlemint/dalp-sdk/scalars";
|
|
169
|
-
|
|
170
|
-
await dalp.api.token.mint({
|
|
171
|
-
assetId: evmAddress("0x52908400098527886e0f7030069857d2e4169ee7"),
|
|
172
|
-
recipients: evmAddress("0x5A0b54D5dc17e0AadC383d2db43B0a0D3E029c4c"),
|
|
173
|
-
amounts: integerString(1000n),
|
|
174
|
-
});
|
|
91
|
+
### Auth Namespaces
|
|
92
|
+
|
|
93
|
+
All namespaces below are fully typed on `DalpAuthClient` — every operation has auto-complete and a typed return value.
|
|
94
|
+
|
|
95
|
+
| Namespace | Operations | Description |
|
|
96
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
97
|
+
| `signIn` | `email` | Sign in with email and password |
|
|
98
|
+
| `signUp` | `email` | Register a new account |
|
|
99
|
+
| `getSession` | — | Fetch the current session |
|
|
100
|
+
| `listSessions` | — | List all active sessions |
|
|
101
|
+
| `revokeSession` | — | Revoke a specific session |
|
|
102
|
+
| `revokeOtherSessions` | — | Revoke all sessions except the current one |
|
|
103
|
+
| `apiKey` | `create`, `list`, `delete` | Manage API keys |
|
|
104
|
+
| `organization` | `create`, `list`, `setActive`, `inviteMember`, `acceptInvitation`, `listMembers`, `addMember`, `removeMember` | Manage organizations and membership |
|
|
105
|
+
| `admin` | `listUsers`, `createUser`, `removeUser`, `setRole` | Administrative user management |
|
|
106
|
+
| `device` | `code`, `token`, `approve`, `deny` | Device authorization flow |
|
|
107
|
+
| `twoFactor` | `enable`, `disable`, `verifyTotp`, `verifyBackupCode`, `generateBackupCodes` | Account-level TOTP two-factor authentication |
|
|
108
|
+
| `wallet.pincode` | `enable`, `disable`, `update`, `reset` | Wallet pincode protection |
|
|
109
|
+
| `wallet.twoFactor` | `enable`, `disable`, `verify` | Wallet two-factor verification |
|
|
110
|
+
| `wallet.secretCodes` | `generate`, `confirm` | Wallet secret (recovery) codes |
|
|
111
|
+
| `passkey` | — | Account-level passkey registration (browser/WebAuthn only) |
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
// Enable account-level 2FA and verify a TOTP code
|
|
115
|
+
await auth.twoFactor.enable({ password: "..." });
|
|
116
|
+
await auth.twoFactor.verifyTotp({ code: "123456" });
|
|
117
|
+
```
|
|
175
118
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
119
|
+
```typescript
|
|
120
|
+
// Enable wallet pincode protection
|
|
121
|
+
await auth.wallet.pincode.enable({ pincode: "1234", password: "..." });
|
|
180
122
|
```
|
|
181
123
|
|
|
182
|
-
|
|
183
|
-
`cantonPartyId`, `fiatCurrency`, `networkId`, `timestamp`, `integerString` and
|
|
184
|
-
`decimalString`; each has an `is...` guard, such as `isEthereumHash`. Integer
|
|
185
|
-
text is typed `${bigint}` and decimal text `${number}`.
|
|
124
|
+
## Configuration
|
|
186
125
|
|
|
187
|
-
|
|
126
|
+
```typescript
|
|
127
|
+
import { createDalpClient } from "@settlemint/dalp-sdk";
|
|
188
128
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
129
|
+
const dalp = createDalpClient({
|
|
130
|
+
// Required
|
|
131
|
+
url: "https://dalp.example.com",
|
|
192
132
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
that must run on the device (`passkeyClient` drives the WebAuthn ceremony
|
|
196
|
-
through `navigator.credentials`, or through the `passkey` ceremony a React
|
|
197
|
-
Native app passes), and the access-control model that evaluates a
|
|
198
|
-
permission locally instead of round-tripping. It sits off the package root
|
|
199
|
-
because it costs roughly 70 KiB of Better Auth that a consumer who only calls
|
|
200
|
-
routes should not pay.
|
|
201
|
-
|
|
202
|
-
Better Auth's client types reference zod, so `zod` is an optional peer
|
|
203
|
-
dependency: install it if you use `./auth`, skip it otherwise. No code in this
|
|
204
|
-
package imports zod at runtime.
|
|
205
|
-
|
|
206
|
-
An API key works on 9 auth routes only. Eight of them are reads:
|
|
207
|
-
|
|
208
|
-
- `GET /get-session`
|
|
209
|
-
- `GET /organization/list`
|
|
210
|
-
- `GET /organization/get-full-organization`
|
|
211
|
-
- `GET /organization/list-members`
|
|
212
|
-
- `POST /organization/has-permission`
|
|
213
|
-
- `GET /api-key/list`
|
|
214
|
-
- `GET /api-key/get`
|
|
215
|
-
- `GET /passkey/list-user-passkeys`
|
|
216
|
-
|
|
217
|
-
The ninth, `POST /api-key/delete`, deletes only the key that sends the request.
|
|
218
|
-
|
|
219
|
-
Every other auth route answers a request that carries a key with HTTP 403 and
|
|
220
|
-
the code `API_KEY_NOT_SUPPORTED_ON_ROUTE`. Use a session cookie for those
|
|
221
|
-
routes. The API key guide in the DALP API reference has the details.
|
|
222
|
-
|
|
223
|
-
## React Native
|
|
224
|
-
|
|
225
|
-
Supported: Expo SDK 57 (React Native 0.86, React 19.2), with `fetch` from
|
|
226
|
-
`expo/fetch` passed to both clients. The SDK detects React Native from
|
|
227
|
-
`navigator.product` and then keeps the session in its own cookie store, sends
|
|
228
|
-
`credentials: "omit"`, refuses an API key, and sends the platform's origin as
|
|
229
|
-
`Origin` on every call.
|
|
230
|
-
|
|
231
|
-
```ts
|
|
232
|
-
import { createCookieStoreFetch, createDalpClient, makeCookieStore } from "@settlemint/dalp-sdk";
|
|
233
|
-
import { createDalpAuthClient } from "@settlemint/dalp-sdk/auth";
|
|
234
|
-
import { fetch } from "expo/fetch";
|
|
235
|
-
|
|
236
|
-
const cookieStore = makeCookieStore((await SecureStore.getItemAsync("dalp.session")) ?? "");
|
|
237
|
-
const auth = await createDalpAuthClient({ url, cookieStore, fetch, passkey: ceremony });
|
|
238
|
-
const dalp = createDalpClient({ baseUrl: url, fetch: createCookieStoreFetch(cookieStore, fetch) });
|
|
239
|
-
```
|
|
133
|
+
// Required for authenticated routes
|
|
134
|
+
apiKey: "sm_dalp_...",
|
|
240
135
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
memory only.
|
|
249
|
-
|
|
250
|
-
The SDK's tests run this wiring headless on the fetch and abort polyfills React
|
|
251
|
-
Native ships and a model of `expo/fetch`. They do not run on Hermes, a
|
|
252
|
-
simulator, or a device.
|
|
253
|
-
|
|
254
|
-
## Bundler and paymaster
|
|
255
|
-
|
|
256
|
-
Use JSON-RPC 2.0 over `POST https://dalp.example.com/bundler/{chainId}` for
|
|
257
|
-
account-abstraction calls. `{chainId}` is the decimal EVM chain ID; this is
|
|
258
|
-
not an `/api/v2` REST route and is not exposed through `dalp.api` or a separate
|
|
259
|
-
SDK bundler client. From a server, send a write-capable API key in `x-api-key`;
|
|
260
|
-
the key's active organization selects the tenant. Never put the key in browser
|
|
261
|
-
code.
|
|
262
|
-
|
|
263
|
-
The mount serves these standard methods:
|
|
264
|
-
|
|
265
|
-
| Method | Params |
|
|
266
|
-
| ------------------------------ | ----------------------------------------------- |
|
|
267
|
-
| `eth_chainId` | `[]` |
|
|
268
|
-
| `eth_sendUserOperation` | `[userOperation, entryPoint]` |
|
|
269
|
-
| `eth_estimateUserOperationGas` | `[userOperation, entryPoint]` |
|
|
270
|
-
| `eth_getUserOperationByHash` | `[userOperationHash]` |
|
|
271
|
-
| `eth_getUserOperationReceipt` | `[userOperationHash]` |
|
|
272
|
-
| `eth_supportedEntryPoints` | `[]` |
|
|
273
|
-
| `pm_getPaymasterData` | `[userOperation, entryPoint, chainId, context]` |
|
|
274
|
-
| `pm_getPaymasterStubData` | `[userOperation, entryPoint, chainId, context]` |
|
|
275
|
-
|
|
276
|
-
The UserOperation must be signed by your account-abstraction stack before
|
|
277
|
-
`eth_sendUserOperation`. The mount accepts EntryPoint v0.7 UserOperations and
|
|
278
|
-
returns JSON-RPC `result` or `error` envelopes, not REST `{ data, links }`
|
|
279
|
-
resources. `eth_chainId` reports the chain selected by the URL. Consult the platform's bundler
|
|
280
|
-
method policy before depending on a method being enabled for your credential.
|
|
281
|
-
|
|
282
|
-
```ts
|
|
283
|
-
const response = await fetch("https://dalp.example.com/bundler/1", {
|
|
284
|
-
method: "POST",
|
|
285
|
-
headers: {
|
|
286
|
-
"content-type": "application/json",
|
|
287
|
-
"x-api-key": apiKey,
|
|
288
|
-
},
|
|
289
|
-
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_supportedEntryPoints", params: [] }),
|
|
136
|
+
// Optional
|
|
137
|
+
organizationId: "org_...", // multi-org scoping
|
|
138
|
+
headers: { "User-Agent": "MyApp" }, // override default headers
|
|
139
|
+
idempotencyKey: "req_abc123", // ⚠️ sent on EVERY request — use only for single-mutation clients
|
|
140
|
+
requestValidation: false, // validate requests client-side (default: false)
|
|
141
|
+
responseValidation: false, // validate responses client-side (default: false)
|
|
142
|
+
fetch: customFetch, // custom fetch implementation
|
|
290
143
|
});
|
|
291
|
-
const answer = await response.json(); // { jsonrpc: "2.0", id: 1, result: [...] } or { error: ... }
|
|
292
144
|
```
|
|
293
145
|
|
|
294
|
-
##
|
|
146
|
+
## API Namespaces
|
|
147
|
+
|
|
148
|
+
| Namespace | Description |
|
|
149
|
+
| ------------------ | -------------------------- |
|
|
150
|
+
| `account` | Manage accounts |
|
|
151
|
+
| `actions` | Manage actions |
|
|
152
|
+
| `addons` | Manage addons |
|
|
153
|
+
| `admin` | Administrative operations |
|
|
154
|
+
| `contacts` | Manage contacts |
|
|
155
|
+
| `exchangeRates` | View exchange rates |
|
|
156
|
+
| `externalToken` | Manage external tokens |
|
|
157
|
+
| `identityRecovery` | Recover lost identities |
|
|
158
|
+
| `monitoring` | Platform monitoring |
|
|
159
|
+
| `search` | Search across the platform |
|
|
160
|
+
| `settings` | Platform settings |
|
|
161
|
+
| `system` | System administration |
|
|
162
|
+
| `token` | Manage security tokens |
|
|
163
|
+
| `transaction` | View transactions |
|
|
164
|
+
| `user` | Manage platform users |
|
|
165
|
+
|
|
166
|
+
## Endpoint Coverage
|
|
167
|
+
|
|
168
|
+
The SDK covers 100% of the v2 REST API: it is generated from the same oRPC contract that the server implements, and a
|
|
169
|
+
CI check (`bun run check:sdk-coverage`) diffs every mounted API route against the contract on every change. Endpoints
|
|
170
|
+
intentionally outside the SDK contract are named in a committed allowlist with a reason each, in these categories:
|
|
171
|
+
|
|
172
|
+
- **v1-frozen** — the deliberately frozen v1 REST surface
|
|
173
|
+
- **internal-ops** — health probes, CSP report sink, theme CSS, static manifests
|
|
174
|
+
- **webhook-receiver** — provider webhook receivers (DFNS, Ripple, compliance providers)
|
|
175
|
+
- **better-auth** — auth plumbing, covered by the SDK auth client instead
|
|
176
|
+
- **docs / asset-delivery / bundler / orpc-mount** — API docs pages, binary asset delivery, the ERC-4337 bundler
|
|
177
|
+
JSON-RPC passthrough (covered by the SDK bundler client), and the oRPC transport mounts themselves
|
|
178
|
+
|
|
179
|
+
## Subpath Exports
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
// Main entry — client factory, error codes, serializers
|
|
183
|
+
import { createDalpAuthClient, createDalpClient, createDalpPlatformClient } from "@settlemint/dalp-sdk";
|
|
184
|
+
|
|
185
|
+
// Type-only — for function signatures without runtime code
|
|
186
|
+
import type { DalpClient, DalpClientConfig } from "@settlemint/dalp-sdk/types";
|
|
187
|
+
|
|
188
|
+
// Plugins — optional oRPC link plugins for advanced usage
|
|
189
|
+
import { BatchLinkPlugin, RequestValidationPlugin } from "@settlemint/dalp-sdk/plugins";
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Security
|
|
295
193
|
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
|
|
300
|
-
returns when the platform's wait runs out.
|
|
194
|
+
- **API key authentication** — issued via the DALP dashboard (Settings → API Keys) or via `dalp login`
|
|
195
|
+
- Public routes can be called without an API key; authenticated routes still require one
|
|
196
|
+
- Security headers (`x-api-key`, `x-organization-id`) cannot be overridden by custom headers
|
|
197
|
+
- Client-side request validation can be enabled to catch schema violations early
|
|
301
198
|
|
|
302
|
-
##
|
|
199
|
+
## Errors
|
|
303
200
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
calls routes never pays for auth, TanStack Query, or webhook code.
|
|
201
|
+
DAPI errors thrown by the SDK use `DalpSdkError` and include `message`, `why`, `fix`, `status`, `retryable`, and the
|
|
202
|
+
public DAPI error id when the server returns one.
|
|
307
203
|
|
|
308
|
-
##
|
|
204
|
+
## License
|
|
309
205
|
|
|
310
|
-
|
|
311
|
-
install and credentials, calling routes, mutations and settlement, streaming,
|
|
312
|
-
TanStack Query, server rendering in TanStack Start and Next.js, React Native,
|
|
313
|
-
and the Effect surface.
|
|
206
|
+
This project is licensed under the **SettleMint Commercial Customer Source License**. See the LICENSE file included in the package for full terms.
|