@zendfi/sdk 1.0.3 → 1.1.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.
Files changed (2) hide show
  1. package/README.md +42 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -247,8 +247,50 @@ 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.closeSubAccount(...)
261
+ ```
262
+
263
+ ### Sub-Accounts
264
+
265
+ Create and manage merchant-controlled sub-accounts with dedicated MPC wallets and scoped delegation tokens.
266
+
267
+ ```typescript
268
+ const sub = await zendfi.createSubAccount({
269
+ label: 'user_paschal_001',
270
+ spend_limit_usdc: 500,
271
+ access_mode: 'delegated',
272
+ yield_enabled: false,
273
+ });
274
+
275
+ const token = await zendfi.mintSubAccountDelegationToken(sub.id, {
276
+ scope: 'withdraw_only',
277
+ spend_limit_usdc: 50,
278
+ expires_in_seconds: 900,
279
+ whitelist: ['7xKm...4fVz'],
280
+ single_use: true,
281
+ });
250
282
  ```
251
283
 
284
+ Sensitive sub-account operations such as `drainSubAccount` and `withdrawFromSubAccount` require `passkey_signature` payloads from your WebAuthn flow.
285
+
286
+ Sub-account flows emit webhook lifecycle and transfer events:
287
+
288
+ - `SubAccountCreated`
289
+ - `SubAccountDelegationTokenMinted`
290
+ - `SubAccountFrozen`
291
+ - `SubAccountClosed`
292
+ - `WithdrawalInitiated` / `WithdrawalFailed` / `WithdrawalCompleted` (including scoped withdrawals)
293
+
252
294
  ### Payments
253
295
 
254
296
  Create payments for your customers:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendfi/sdk",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Zero-config TypeScript SDK for ZendFi. Global payments powered by stablecoins!",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",