@spritz-finance/api-client 0.14.0 → 0.15.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 +16 -0
- package/dist/spritz-api-client.cjs +61 -61
- package/dist/spritz-api-client.d.ts +111 -2
- package/dist/spritz-api-client.mjs +61 -61
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1015,6 +1015,22 @@ ACH onramp lets users convert USD from their bank account into USDC delivered to
|
|
|
1015
1015
|
5. **Server:** prepare a quote with `client.deposit.prepare(...)`
|
|
1016
1016
|
6. **Client:** show the quote and ACH authorization message to the user
|
|
1017
1017
|
7. **Server:** create the deposit with `client.deposit.create(input, { idempotencyKey })`; Spritz runs risk checks before initiating the ACH pull. Persist one unique key per deposit intent and reuse it verbatim on retries so a timed-out request replays the original response instead of authorizing a second debit
|
|
1018
|
+
8. **Server:** track the deposit with `client.deposit.get(depositId)`, or reconcile a backlog by paging `client.deposit.list({ limit, cursor })`
|
|
1019
|
+
|
|
1020
|
+
```typescript
|
|
1021
|
+
// Page the authenticated user's deposits, newest first
|
|
1022
|
+
const { data, hasMore, nextCursor } = await client.deposit.list({ limit: 25 })
|
|
1023
|
+
|
|
1024
|
+
if (hasMore && nextCursor) {
|
|
1025
|
+
const next = await client.deposit.list({ limit: 25, cursor: nextCursor })
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
// Read one deposit's ACH debit and crypto release state
|
|
1029
|
+
const deposit = await client.deposit.get('dep_01JV7Q8M4Y8K6N2Z5P3R1T9W0X')
|
|
1030
|
+
console.log(deposit.status, deposit.debitStatus, deposit.releaseStatus)
|
|
1031
|
+
```
|
|
1032
|
+
|
|
1033
|
+
`client.deposit.list()` is user-scoped, so an integrator-wide reconciliation iterates your own user roster and authorizes each user's read with `client.setApiKey(userApiKey)`. Webhooks are notifications, not the only record of deposits.
|
|
1018
1034
|
|
|
1019
1035
|
Authorization is derived from the verified ACH funding source — no wallet signature is required.
|
|
1020
1036
|
|