@zendfi/sdk 1.0.3 → 1.1.1
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 +49 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -247,8 +247,57 @@ zendfi.cancelSubscription(...)
|
|
|
247
247
|
// Invoices
|
|
248
248
|
zendfi.createInvoice(...)
|
|
249
249
|
zendfi.sendInvoice(...)
|
|
250
|
+
|
|
251
|
+
// Sub-Accounts (merchant-controlled MPC wallets)
|
|
252
|
+
zendfi.createSubAccount(...)
|
|
253
|
+
zendfi.listSubAccounts(...)
|
|
254
|
+
zendfi.getSubAccount(...)
|
|
255
|
+
zendfi.getSubAccountBalance(...)
|
|
256
|
+
zendfi.mintSubAccountDelegationToken(...)
|
|
257
|
+
zendfi.freezeSubAccount(...)
|
|
258
|
+
zendfi.drainSubAccount(...)
|
|
259
|
+
zendfi.withdrawFromSubAccount(...)
|
|
260
|
+
zendfi.withdrawSubAccountToBank(...)
|
|
261
|
+
zendfi.createSubAccountAutomationToken(...)
|
|
262
|
+
zendfi.revokeSubAccountAutomationToken(...)
|
|
263
|
+
zendfi.closeSubAccount(...)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Sub-Accounts
|
|
267
|
+
|
|
268
|
+
Create and manage merchant-controlled sub-accounts with dedicated MPC wallets and scoped delegation tokens.
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
const sub = await zendfi.createSubAccount({
|
|
272
|
+
label: 'user_paschal_001',
|
|
273
|
+
spend_limit_usdc: 500,
|
|
274
|
+
access_mode: 'delegated',
|
|
275
|
+
yield_enabled: false,
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
const token = await zendfi.mintSubAccountDelegationToken(sub.id, {
|
|
279
|
+
scope: 'withdraw_only',
|
|
280
|
+
spend_limit_usdc: 50,
|
|
281
|
+
expires_in_seconds: 900,
|
|
282
|
+
whitelist: ['7xKm...4fVz'],
|
|
283
|
+
single_use: true,
|
|
284
|
+
});
|
|
250
285
|
```
|
|
251
286
|
|
|
287
|
+
Sensitive sub-account operations such as `drainSubAccount`, `withdrawFromSubAccount`, and `withdrawSubAccountToBank` require `passkey_signature` payloads from your WebAuthn flow.
|
|
288
|
+
|
|
289
|
+
`withdrawSubAccountToBank` executes PAJ offramp with server-side proxy-email OTP automation (same pattern as split bank withdrawals), so your integration does not need to collect OTP manually.
|
|
290
|
+
|
|
291
|
+
For headless automation, mint bounded automation credentials with `createSubAccountAutomationToken`, then pass `automation_token` to `withdrawSubAccountToBank`.
|
|
292
|
+
|
|
293
|
+
Sub-account flows emit webhook lifecycle and transfer events:
|
|
294
|
+
|
|
295
|
+
- `SubAccountCreated`
|
|
296
|
+
- `SubAccountDelegationTokenMinted`
|
|
297
|
+
- `SubAccountFrozen`
|
|
298
|
+
- `SubAccountClosed`
|
|
299
|
+
- `WithdrawalInitiated` / `WithdrawalFailed` / `WithdrawalCompleted` (including scoped withdrawals)
|
|
300
|
+
|
|
252
301
|
### Payments
|
|
253
302
|
|
|
254
303
|
Create payments for your customers:
|