@takeal/cusfront-sdk 0.5.0 → 0.6.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +49 -2
  2. package/README.md +168 -3
  3. package/dist/analytics.cjs +28 -7
  4. package/dist/analytics.cjs.map +1 -1
  5. package/dist/analytics.js +28 -7
  6. package/dist/analytics.js.map +1 -1
  7. package/dist/{cards-Ba1wZttb.d.ts → cards-CF3-He2x.d.ts} +144 -20
  8. package/dist/{cards-B_aNY35J.d.cts → cards-qfHz6xZY.d.cts} +144 -20
  9. package/dist/{deposits-DScyT_D9.d.ts → deposits-B2LBe2k1.d.ts} +71 -8
  10. package/dist/{deposits-BEc8U80M.d.cts → deposits-ZjT_btgi.d.cts} +71 -8
  11. package/dist/index.cjs +92 -50
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +6 -6
  14. package/dist/index.d.ts +6 -6
  15. package/dist/index.js +92 -50
  16. package/dist/index.js.map +1 -1
  17. package/dist/react/index.cjs +2 -8
  18. package/dist/react/index.cjs.map +1 -1
  19. package/dist/react/index.d.cts +2 -2
  20. package/dist/react/index.d.ts +2 -2
  21. package/dist/react/index.js +2 -8
  22. package/dist/react/index.js.map +1 -1
  23. package/dist/resources/attribution.cjs.map +1 -1
  24. package/dist/resources/attribution.js.map +1 -1
  25. package/dist/resources/auth.cjs.map +1 -1
  26. package/dist/resources/auth.js.map +1 -1
  27. package/dist/resources/cards.cjs +41 -28
  28. package/dist/resources/cards.cjs.map +1 -1
  29. package/dist/resources/cards.d.cts +1 -1
  30. package/dist/resources/cards.d.ts +1 -1
  31. package/dist/resources/cards.js +41 -28
  32. package/dist/resources/cards.js.map +1 -1
  33. package/dist/resources/deposits.cjs +8 -5
  34. package/dist/resources/deposits.cjs.map +1 -1
  35. package/dist/resources/deposits.d.cts +2 -2
  36. package/dist/resources/deposits.d.ts +2 -2
  37. package/dist/resources/deposits.js +8 -5
  38. package/dist/resources/deposits.js.map +1 -1
  39. package/dist/resources/devices.cjs +3 -1
  40. package/dist/resources/devices.cjs.map +1 -1
  41. package/dist/resources/devices.js +3 -1
  42. package/dist/resources/devices.js.map +1 -1
  43. package/dist/resources/documents.cjs +3 -1
  44. package/dist/resources/documents.cjs.map +1 -1
  45. package/dist/resources/documents.js +3 -1
  46. package/dist/resources/documents.js.map +1 -1
  47. package/dist/resources/funding-options.cjs.map +1 -1
  48. package/dist/resources/funding-options.d.cts +2 -2
  49. package/dist/resources/funding-options.d.ts +2 -2
  50. package/dist/resources/funding-options.js.map +1 -1
  51. package/dist/resources/history.cjs +3 -1
  52. package/dist/resources/history.cjs.map +1 -1
  53. package/dist/resources/history.js +3 -1
  54. package/dist/resources/history.js.map +1 -1
  55. package/dist/resources/push.cjs +3 -1
  56. package/dist/resources/push.cjs.map +1 -1
  57. package/dist/resources/push.js +3 -1
  58. package/dist/resources/push.js.map +1 -1
  59. package/dist/telegram.cjs +67 -53
  60. package/dist/telegram.cjs.map +1 -1
  61. package/dist/telegram.d.cts +2 -2
  62. package/dist/telegram.d.ts +2 -2
  63. package/dist/telegram.js +67 -53
  64. package/dist/telegram.js.map +1 -1
  65. package/package.json +12 -5
@@ -52,16 +52,12 @@ interface CustomerInfo {
52
52
  * POST /me/cards/{id}/unfreeze → unfreeze
53
53
  * POST /me/cards/{id}/transfer → transfer (to another of their cards)
54
54
  * POST /me/cards/{id}/terminate → terminate (one-way)
55
+ * POST /me/cards/{id}/reveal → reveal (the numbers, or a provider page)
56
+ * POST /me/cards/{id}/pin → setPin (physical cards)
55
57
  *
56
58
  * The lifecycle actions are ownership-gated server-side: a caller can only
57
59
  * freeze / unfreeze / terminate a card that belongs to them (else 404).
58
60
  *
59
- * ## What is intentionally NOT here
60
- *
61
- * Card-data reveal (PAN / CVV) is a separate, security-sensitive flow with its
62
- * own re-auth + rate-limit + audit contract and is intentionally
63
- * NOT part of this resource (tracked separately).
64
- *
65
61
  * Today only PREPAID is wired end-to-end; CREDIT and GIFT return 400 from
66
62
  * the Takeal API until their issuer flows land.
67
63
  */
@@ -70,11 +66,36 @@ type CardType = "credit" | "prepaid" | "gift";
70
66
  /**
71
67
  * Card lifecycle state.
72
68
  *
73
- * `pending_payment` is a transient state: the row exists but the
74
- * per-card issuance-fee debit has not yet succeeded; such cards have no
75
- * provider reference and no user-visible side effects.
69
+ * - `pending_payment`: the row exists but the issuance fee has not been
70
+ * paid yet; the provider has not been called and nothing is visible.
71
+ * - `pending`: the issuer accepted the order and has not issued the card
72
+ * yet. The price is charged. Show the card as "being issued" with no
73
+ * numbers; it becomes `active` on its own, or `failed` with the price
74
+ * back on the wallet. Some issuers take minutes, some a day.
75
+ * - `active`, `frozen`: the usual states. Read `status_source` before
76
+ * offering to unfreeze.
77
+ * - `terminating`: the holder (or the issuer) closed the card and the
78
+ * issuer has not finished: the balance comes back to the wallet when it
79
+ * does. Show it as closing; no actions apply.
80
+ * - `terminated`, `redeemed`, `failed`: final.
81
+ */
82
+ type CardStatus = "pending_payment" | "pending" | "active" | "frozen" | "terminating" | "terminated" | "redeemed" | "failed";
83
+ /**
84
+ * Who made the card's last status change. `provider` on a `frozen` card
85
+ * means the issuer froze it (a risk check, a lost-card report): the holder
86
+ * cannot unfreeze it, so do not offer the button; say the freeze is lifted
87
+ * through the issuer's support. `holder` and `operator` freezes are undone
88
+ * with `unfreeze()` as usual.
76
89
  */
77
- type CardStatus = "pending_payment" | "active" | "frozen" | "terminated" | "redeemed" | "failed";
90
+ type CardStatusSource = "holder" | "operator" | "provider";
91
+ /** `virtual` cards show their numbers in the app; `physical` cards are plastic and have a PIN. */
92
+ type CardForm = "virtual" | "physical";
93
+ /**
94
+ * Why `terminate()` is refused right now: `first_purchase_required` (the
95
+ * card closes after its first purchase) or `card_locked` (only support can
96
+ * change it).
97
+ */
98
+ type CloseBlockedReason = "first_purchase_required" | "card_locked";
78
99
  /**
79
100
  * A card design: the artwork a card is shown with. `image_url` is the front,
80
101
  * `image_url_back` the back; both are either absolute URLs or paths relative
@@ -174,6 +195,24 @@ interface Card {
174
195
  initial_amount: string | null;
175
196
  currency: string;
176
197
  failure_reason: string | null;
198
+ /** Who changed the status last; `null` when it never changed. See {@link CardStatusSource}. */
199
+ status_source: CardStatusSource | null;
200
+ /** Virtual or plastic. A `physical` card takes a PIN with {@link CardsResource.setPin}. */
201
+ card_form: CardForm;
202
+ /** Why the card cannot be closed right now, or `null` when it can. */
203
+ close_blocked: CloseBlockedReason | null;
204
+ /**
205
+ * Top-ups the issuer has accepted and not loaded yet, summed, decimal
206
+ * string in `currency`; `null` when there are none. Show it next to the
207
+ * balance as money on its way to the card.
208
+ */
209
+ topups_pending: string | null;
210
+ /**
211
+ * Top-ups the issuer has held for too long, summed, decimal string in
212
+ * `currency`; `null` when there are none. The money is safe and waits for
213
+ * support to settle it; say so instead of offering a retry.
214
+ */
215
+ topups_held: string | null;
177
216
  /** The name the user gave the card, or `null`. */
178
217
  name: string | null;
179
218
  /** The artwork the card is shown with. Always present. */
@@ -299,11 +338,26 @@ interface TopUpInput {
299
338
  */
300
339
  idempotencyKey: string;
301
340
  }
341
+ /**
342
+ * Where a top-up stands.
343
+ *
344
+ * - `pending`: the issuer accepted it and has not loaded the card yet. The
345
+ * wallet is debited, the card balance is unchanged, the amount shows in
346
+ * `Card.topups_pending`. Most issuers finish within minutes.
347
+ * - `confirmed`: the money is on the card.
348
+ * - `failed`: the issuer refused; the wallet is credited back.
349
+ * - `stalled`: pending for longer than the deployment allows. The money is
350
+ * safe and waits for support; it shows in `Card.topups_held`.
351
+ * - `returned`: support sent the money back to the wallet.
352
+ * - `written_off`: support closed it without the money coming back (the
353
+ * issuer kept it); `failure_reason` says so.
354
+ */
355
+ type CardTopUpStatus = "pending" | "confirmed" | "failed" | "stalled" | "returned" | "written_off";
302
356
  /** One top-up attempt as the API records it. */
303
357
  interface CardTopUp {
304
358
  id: string;
305
359
  card_id: string;
306
- status: "pending" | "confirmed" | "failed";
360
+ status: CardTopUpStatus;
307
361
  /** What landed on the card, decimal string, in `currency`. */
308
362
  amount: string;
309
363
  currency: string;
@@ -314,7 +368,13 @@ interface CardTopUp {
314
368
  created_at: string;
315
369
  updated_at: string;
316
370
  }
317
- /** A completed top-up with the state to redraw: card, its balance, the wallet. */
371
+ /**
372
+ * The outcome of a top-up with the state to redraw: card, its balance, the
373
+ * wallet. When `topup.status` is `pending`, the wallet has paid and
374
+ * `card_balance` has not moved yet: show the amount as on its way
375
+ * (`card.topups_pending`) and refresh the card later or on the
376
+ * `card_topup` notification.
377
+ */
318
378
  interface TopUpResult {
319
379
  topup: CardTopUp;
320
380
  card: Card;
@@ -342,16 +402,33 @@ interface RevealCardInput {
342
402
  totpCode?: string;
343
403
  }
344
404
  /**
345
- * Full card data from a successful reveal. **Security**: never persist this —
405
+ * Full card data from a successful reveal. **Security**: never persist this,
346
406
  * keep it in volatile memory only, clear it within `expires_in_seconds`, and
347
407
  * never write it to localStorage / logs (the API marks the response no-store).
408
+ *
409
+ * Some issuers hand out a page that shows the numbers instead of the
410
+ * numbers themselves. Then `reveal_url` is set, `pan` and `cvv` are empty,
411
+ * and the client opens the page in a frame; see the README for the frame.
348
412
  */
349
413
  interface RevealedCard {
414
+ /** The card number; empty when `reveal_url` is set. */
350
415
  pan: string;
416
+ /** The security code; empty when `reveal_url` is set. */
351
417
  cvv: string;
352
418
  expiry_month: number;
353
419
  expiry_year: number;
354
420
  holder_name: string;
421
+ /**
422
+ * A page at the card issuer that shows the details to the holder. Present
423
+ * only for issuers that give a page instead of the numbers. Short-lived,
424
+ * often single use: open it at once in an `<iframe>` and never store it.
425
+ */
426
+ reveal_url?: string;
427
+ /**
428
+ * The person the card is registered to at its issuer: what a checkout
429
+ * asks for. Absent for cards issued before holders were kept.
430
+ */
431
+ cardholder?: Cardholder;
355
432
  /**
356
433
  * The address the card is registered at — what a merchant's checkout asks
357
434
  * for, and the postal code some of them decline a payment over. Absent
@@ -370,6 +447,33 @@ interface BillingAddress {
370
447
  postal_code?: string;
371
448
  country?: string;
372
449
  }
450
+ /**
451
+ * The cardholder the issuer knows: the details to type into a checkout
452
+ * that asks for the name, phone or address on the card. `source` says
453
+ * whether the platform made them up (`generated`), the user supplied them
454
+ * (`provided`) or both (`mixed`).
455
+ */
456
+ interface Cardholder {
457
+ id: string;
458
+ first_name: string;
459
+ last_name: string;
460
+ /** `YYYY-MM-DD`. */
461
+ birth_date: string;
462
+ /** E.164. */
463
+ phone: string;
464
+ /** A mailbox the platform owns; mail the issuer sends there reaches the user. */
465
+ email: string;
466
+ address: BillingAddress;
467
+ source: "generated" | "provided" | "mixed";
468
+ }
469
+ /** The new PIN for a physical card. */
470
+ interface SetPinInput {
471
+ /**
472
+ * Four to six digits, as the user typed them. Sent once to the issuer and
473
+ * kept nowhere: not by the SDK, not by the API. Never log it.
474
+ */
475
+ pin: string;
476
+ }
373
477
  /** What to move, and the key that makes a retry safe. */
374
478
  interface TransferInput {
375
479
  /** The card the money lands on. Must be the caller's, and of the same kind and currency. */
@@ -482,9 +586,11 @@ declare class CardsResource {
482
586
  */
483
587
  transfer(fromCardId: string, input: TransferInput): Promise<TransferResult>;
484
588
  /**
485
- * Freeze the caller's own card. Reversible via {@link unfreeze}. The optional
486
- * `reason` is recorded on the audit trail. Resolves to the updated card.
487
- * 404 if the card isn't the caller's; 501 if the issuer can't freeze.
589
+ * Freeze the caller's own card. Reversible via {@link unfreeze} while
590
+ * `status_source` is `holder` or `operator`. The optional `reason` is
591
+ * recorded on the audit trail. Resolves to the updated card. 404 if the
592
+ * card isn't the caller's; 409 `card_locked` when support holds it; 501 if
593
+ * the issuer can't freeze.
488
594
  */
489
595
  freeze(id: string, reason?: string): Promise<Card>;
490
596
  /**
@@ -497,12 +603,30 @@ declare class CardsResource {
497
603
  * keep the result in volatile memory only, never write it to
498
604
  * localStorage / logs, and clear it within `expires_in_seconds`.
499
605
  *
500
- * 401 bad re-auth · 403 not your card · 429 rate-limited · 501 connector
501
- * has no sensitive-data endpoint · 503 provider error.
606
+ * The result is the numbers, or `reveal_url` with empty `pan` and `cvv`
607
+ * when the issuer shows them on a page of its own: open that page in a
608
+ * frame right away, it is short-lived.
609
+ *
610
+ * 403 not your card · 409 `card_locked` · 429 rate-limited · 501 connector
611
+ * has no sensitive-data endpoint · 503 `provider_unavailable`.
502
612
  */
503
613
  reveal(id: string, _input?: RevealCardInput): Promise<RevealedCard>;
504
- /** Unfreeze a previously-frozen card. Idempotent on an already-active card. */
614
+ /**
615
+ * Unfreeze a previously-frozen card. Idempotent on an already-active card.
616
+ * A card the issuer froze (`status_source: "provider"`) is not the
617
+ * holder's to unfreeze: the API answers 409 `card_locked`, so hide the
618
+ * button and say the freeze is lifted through the issuer's support.
619
+ */
505
620
  unfreeze(id: string): Promise<Card>;
621
+ /**
622
+ * Set the PIN of the caller's own physical card. The session is enough; the
623
+ * call is rate-limited like {@link reveal} and the PIN is kept nowhere.
624
+ * Resolves to the card; the user also gets a notification that the PIN
625
+ * was set. 400 not four to six digits or the card is not active · 403 not
626
+ * your card · 409 `card_locked`, or `provider_refused` when the issuer did
627
+ * not take it · 429 too many attempts · 501 a virtual card has no PIN.
628
+ */
629
+ setPin(id: string, input: SetPinInput): Promise<Card>;
506
630
  /**
507
631
  * Terminate the caller's own card. **One-way** — a terminated card cannot be
508
632
  * reactivated. The optional `reason` is audited. Idempotent on an
@@ -511,4 +635,4 @@ declare class CardsResource {
511
635
  terminate(id: string, reason?: string): Promise<Card>;
512
636
  }
513
637
 
514
- export { type Address as A, type BillingAddress as B, type CardProduct as C, type IssuanceBonus as I, type RevealCardInput as R, type TopUpInput as T, type UpdateCardInput as U, type Card as a, CardsResource as b, type CardBalance as c, type CardDesignRef as d, type CardProductPrice as e, type CardStatus as f, type CardTopUp as g, type CardTransfer as h, type CardType as i, type CreateCardInput as j, type CustomerInfo as k, type RevealedCard as l, type TopUpResult as m, type TopUpTerms as n, type TransferInput as o, type TransferResult as p, cardRequestBody as q };
638
+ export { type Address as A, type BillingAddress as B, type CardProduct as C, type IssuanceBonus as I, type RevealCardInput as R, type SetPinInput as S, type TopUpInput as T, type UpdateCardInput as U, type Card as a, CardsResource as b, type CardBalance as c, type CardDesignRef as d, type CardForm as e, type CardProductPrice as f, type CardStatus as g, type CardStatusSource as h, type CardTopUp as i, type CardTopUpStatus as j, type CardTransfer as k, type CardType as l, type Cardholder as m, type CloseBlockedReason as n, type CreateCardInput as o, type CustomerInfo as p, type RevealedCard as q, type TopUpResult as r, type TopUpTerms as s, type TransferInput as t, type TransferResult as u, cardRequestBody as v };
@@ -1,5 +1,5 @@
1
1
  import { H as HttpClient } from './http-DeANAoTs.js';
2
- import { k as CustomerInfo, j as CreateCardInput } from './cards-Ba1wZttb.js';
2
+ import { p as CustomerInfo, o as CreateCardInput } from './cards-CF3-He2x.js';
3
3
 
4
4
  /**
5
5
  * Funding options resource — `client.fundingOptions.*`.
@@ -19,6 +19,27 @@ import { k as CustomerInfo, j as CreateCardInput } from './cards-Ba1wZttb.js';
19
19
  type FunderMode = "wallet" | "spool" | "mixed";
20
20
  /** Where one top-up goes: the wallet, or one of the user's cards. */
21
21
  type DepositTarget = "wallet" | "card";
22
+ /**
23
+ * What one way of paying through a funding connector costs and allows.
24
+ * Draw the top-up form from it: the currency to ask for, the fee to show
25
+ * (or not, for a markup), the floor, the cap and the day's limit.
26
+ */
27
+ interface MethodTerms {
28
+ method: DepositMethod;
29
+ /** ISO 4217 code the user pays in this way; `null` when any the quote accepts. */
30
+ source_currency: string | null;
31
+ fee_kind: FeeKind;
32
+ /** The fee in basis points (2000 = 20 %). */
33
+ fee_bps: number;
34
+ /** How long a quote through this method stays executable, and the deposit waits for its payment. */
35
+ quote_ttl_seconds: number;
36
+ /** Smallest single top-up in the source currency; `null` for no floor. */
37
+ min_amount: string | null;
38
+ /** Largest single top-up in the source currency; `null` for no cap. */
39
+ max_amount: string | null;
40
+ /** What one user may top up this way over 24 hours; `null` for no limit. */
41
+ daily_limit_per_user: string | null;
42
+ }
22
43
  /** One way to top up. */
23
44
  interface FundingOption {
24
45
  /** Pass it as `funder_slug` to `deposits.initiate`. */
@@ -33,6 +54,8 @@ interface FundingOption {
33
54
  * (`issue_card` on `deposits.initiate`).
34
55
  */
35
56
  issue_card: boolean;
57
+ /** The terms of each method in `methods`. */
58
+ method_terms: MethodTerms[];
36
59
  }
37
60
  declare class FundingOptionsResource {
38
61
  private readonly http;
@@ -60,10 +83,18 @@ declare class FundingOptionsResource {
60
83
  * a connector → Takeal API inbound event. Poll `get(id)` or watch the user's
61
84
  * webhook stream for the `deposit.confirmed` / `deposit.failed` outcome.
62
85
  */
63
- /** Lifecycle of a deposit. `redirect_required` carries `redirect_url`. */
64
- type DepositStatus = "pending" | "redirect_required" | "confirmed" | "failed";
65
- /** Top-up rail. The chosen funder decides which it supports. */
66
- type DepositMethod = "card" | "crypto" | "bank_transfer";
86
+ /**
87
+ * Lifecycle of a deposit. `redirect_required` carries `redirect_url`.
88
+ * `expired`: nobody paid before `expires_at`; the user starts over with a
89
+ * new quote. A payment that still arrives is credited at the stored rate
90
+ * and the deposit turns `confirmed` after all.
91
+ */
92
+ type DepositStatus = "pending" | "redirect_required" | "confirmed" | "failed" | "expired";
93
+ /**
94
+ * Top-up rail. The chosen funder decides which it supports; `sbp` is
95
+ * Russia's instant payments through a payment page, paid in roubles.
96
+ */
97
+ type DepositMethod = "card" | "crypto" | "bank_transfer" | "sbp";
67
98
  /**
68
99
  * A deposit record as the Takeal API returns it. Mirrors the `deposits` table; the
69
100
  * server-side `id` is the stable handle the SDK polls against. `idempotency_key`
@@ -85,7 +116,23 @@ interface CreateQuoteInput {
85
116
  * card issued with the top-up (`issue_card`). Ignored with `card_id`.
86
117
  */
87
118
  target_currency?: string;
119
+ /**
120
+ * The funding connector the deposit will go through (`funder_slug` of
121
+ * `initiate()`). With `method`, the quote is priced on that method's own
122
+ * terms from `fundingOptions.list()`: its fee and kind, its rate source,
123
+ * its lifetime, its limits. Sent as `connector_slug`.
124
+ */
125
+ connectorSlug?: string;
126
+ /** The way the user pays. Pass the same method to `initiate()`. */
127
+ method?: DepositMethod;
88
128
  }
129
+ /**
130
+ * How a method's fee reads. `spread`: taken off the credited amount at the
131
+ * deployment's rate. `markup`: in the rate the user sees, so show the rate
132
+ * and nothing else. `commission`: the rate is the provider's and the fee is
133
+ * a line of its own on the credited amount.
134
+ */
135
+ type FeeKind = "spread" | "markup" | "commission";
89
136
  /** How far a top-up meant for a card has got. */
90
137
  type CardLoadStatus = "pending" | "succeeded" | "failed";
91
138
  /**
@@ -110,10 +157,22 @@ interface FundingQuote {
110
157
  source_currency: string;
111
158
  credited_amount: string;
112
159
  credited_currency: string;
113
- /** Provider rate before spread (credited units per 1 source unit). */
160
+ /**
161
+ * Provider rate before the fee, credited units per 1 source unit. The
162
+ * rate to show the user is `credited_amount / source_amount`, which has
163
+ * the fee in it; see the README for the rouble-per-dollar form.
164
+ */
114
165
  rate: string;
166
+ /** The fee in basis points; the same figure as `fee_bps`, under its old name. */
115
167
  spread_bps: number;
168
+ /** The fee in basis points (2000 = 20 %). */
169
+ fee_bps: number;
170
+ fee_kind: FeeKind;
116
171
  provider: string;
172
+ /** The pair the quote was priced for, when the request named one. */
173
+ connector_slug?: string;
174
+ method?: DepositMethod;
175
+ /** The rate is locked until then; the deposit made with it waits for its payment as long. */
117
176
  expires_at: string;
118
177
  }
119
178
  interface Deposit {
@@ -139,6 +198,10 @@ interface Deposit {
139
198
  /** Locked provider rate (credited units per 1 source unit). */
140
199
  fx_rate?: string | null;
141
200
  fx_spread_bps?: number | null;
201
+ /** How `fx_spread_bps` was taken; see `FeeKind`. */
202
+ fx_fee_kind?: FeeKind | null;
203
+ /** When the deposit stops waiting for its payment; `null` for one without a term. */
204
+ expires_at?: string | null;
142
205
  /** The wallet's local currency the deposit converted into. */
143
206
  credited_currency?: string | null;
144
207
  /** What the wallet was actually credited, net of spread. */
@@ -202,7 +265,7 @@ interface InitiateDepositInput {
202
265
  * test deployments with the mock funder `mock_scenario`, which picks the
203
266
  * outcome: `happy` (confirmed at once, the default), `pending` (confirmed
204
267
  * about 15 s later), `redirect` (a hosted page where the user approves or
205
- * declines) or `fail`.
268
+ * declines), `late` (paid after the term) or `fail`.
206
269
  */
207
270
  metadata?: Record<string, string>;
208
271
  /** Structured billing details — real PSPs require these for 3DS / compliance. */
@@ -307,4 +370,4 @@ declare class DepositsResource {
307
370
  refund(depositId: string, input: CreateDepositRefundInput): Promise<Refund>;
308
371
  }
309
372
 
310
- export { type CardLoadStatus as C, type Deposit as D, FundingOptionsResource as F, type InitiateDepositInput as I, type Refund as R, DepositsResource as a, type CreateDepositRefundInput as b, type CreateQuoteInput as c, type DepositMethod as d, type DepositStatus as e, type DepositTarget as f, type FunderMode as g, type FundingOption as h, type FundingQuote as i, type IssueCardInput as j };
373
+ export { type CardLoadStatus as C, type Deposit as D, FundingOptionsResource as F, type InitiateDepositInput as I, type MethodTerms as M, type Refund as R, DepositsResource as a, type CreateDepositRefundInput as b, type CreateQuoteInput as c, type DepositMethod as d, type DepositStatus as e, type DepositTarget as f, type FeeKind as g, type FunderMode as h, type FundingOption as i, type FundingQuote as j, type IssueCardInput as k };
@@ -1,5 +1,5 @@
1
1
  import { H as HttpClient } from './http-DeANAoTs.cjs';
2
- import { k as CustomerInfo, j as CreateCardInput } from './cards-B_aNY35J.cjs';
2
+ import { p as CustomerInfo, o as CreateCardInput } from './cards-qfHz6xZY.cjs';
3
3
 
4
4
  /**
5
5
  * Funding options resource — `client.fundingOptions.*`.
@@ -19,6 +19,27 @@ import { k as CustomerInfo, j as CreateCardInput } from './cards-B_aNY35J.cjs';
19
19
  type FunderMode = "wallet" | "spool" | "mixed";
20
20
  /** Where one top-up goes: the wallet, or one of the user's cards. */
21
21
  type DepositTarget = "wallet" | "card";
22
+ /**
23
+ * What one way of paying through a funding connector costs and allows.
24
+ * Draw the top-up form from it: the currency to ask for, the fee to show
25
+ * (or not, for a markup), the floor, the cap and the day's limit.
26
+ */
27
+ interface MethodTerms {
28
+ method: DepositMethod;
29
+ /** ISO 4217 code the user pays in this way; `null` when any the quote accepts. */
30
+ source_currency: string | null;
31
+ fee_kind: FeeKind;
32
+ /** The fee in basis points (2000 = 20 %). */
33
+ fee_bps: number;
34
+ /** How long a quote through this method stays executable, and the deposit waits for its payment. */
35
+ quote_ttl_seconds: number;
36
+ /** Smallest single top-up in the source currency; `null` for no floor. */
37
+ min_amount: string | null;
38
+ /** Largest single top-up in the source currency; `null` for no cap. */
39
+ max_amount: string | null;
40
+ /** What one user may top up this way over 24 hours; `null` for no limit. */
41
+ daily_limit_per_user: string | null;
42
+ }
22
43
  /** One way to top up. */
23
44
  interface FundingOption {
24
45
  /** Pass it as `funder_slug` to `deposits.initiate`. */
@@ -33,6 +54,8 @@ interface FundingOption {
33
54
  * (`issue_card` on `deposits.initiate`).
34
55
  */
35
56
  issue_card: boolean;
57
+ /** The terms of each method in `methods`. */
58
+ method_terms: MethodTerms[];
36
59
  }
37
60
  declare class FundingOptionsResource {
38
61
  private readonly http;
@@ -60,10 +83,18 @@ declare class FundingOptionsResource {
60
83
  * a connector → Takeal API inbound event. Poll `get(id)` or watch the user's
61
84
  * webhook stream for the `deposit.confirmed` / `deposit.failed` outcome.
62
85
  */
63
- /** Lifecycle of a deposit. `redirect_required` carries `redirect_url`. */
64
- type DepositStatus = "pending" | "redirect_required" | "confirmed" | "failed";
65
- /** Top-up rail. The chosen funder decides which it supports. */
66
- type DepositMethod = "card" | "crypto" | "bank_transfer";
86
+ /**
87
+ * Lifecycle of a deposit. `redirect_required` carries `redirect_url`.
88
+ * `expired`: nobody paid before `expires_at`; the user starts over with a
89
+ * new quote. A payment that still arrives is credited at the stored rate
90
+ * and the deposit turns `confirmed` after all.
91
+ */
92
+ type DepositStatus = "pending" | "redirect_required" | "confirmed" | "failed" | "expired";
93
+ /**
94
+ * Top-up rail. The chosen funder decides which it supports; `sbp` is
95
+ * Russia's instant payments through a payment page, paid in roubles.
96
+ */
97
+ type DepositMethod = "card" | "crypto" | "bank_transfer" | "sbp";
67
98
  /**
68
99
  * A deposit record as the Takeal API returns it. Mirrors the `deposits` table; the
69
100
  * server-side `id` is the stable handle the SDK polls against. `idempotency_key`
@@ -85,7 +116,23 @@ interface CreateQuoteInput {
85
116
  * card issued with the top-up (`issue_card`). Ignored with `card_id`.
86
117
  */
87
118
  target_currency?: string;
119
+ /**
120
+ * The funding connector the deposit will go through (`funder_slug` of
121
+ * `initiate()`). With `method`, the quote is priced on that method's own
122
+ * terms from `fundingOptions.list()`: its fee and kind, its rate source,
123
+ * its lifetime, its limits. Sent as `connector_slug`.
124
+ */
125
+ connectorSlug?: string;
126
+ /** The way the user pays. Pass the same method to `initiate()`. */
127
+ method?: DepositMethod;
88
128
  }
129
+ /**
130
+ * How a method's fee reads. `spread`: taken off the credited amount at the
131
+ * deployment's rate. `markup`: in the rate the user sees, so show the rate
132
+ * and nothing else. `commission`: the rate is the provider's and the fee is
133
+ * a line of its own on the credited amount.
134
+ */
135
+ type FeeKind = "spread" | "markup" | "commission";
89
136
  /** How far a top-up meant for a card has got. */
90
137
  type CardLoadStatus = "pending" | "succeeded" | "failed";
91
138
  /**
@@ -110,10 +157,22 @@ interface FundingQuote {
110
157
  source_currency: string;
111
158
  credited_amount: string;
112
159
  credited_currency: string;
113
- /** Provider rate before spread (credited units per 1 source unit). */
160
+ /**
161
+ * Provider rate before the fee, credited units per 1 source unit. The
162
+ * rate to show the user is `credited_amount / source_amount`, which has
163
+ * the fee in it; see the README for the rouble-per-dollar form.
164
+ */
114
165
  rate: string;
166
+ /** The fee in basis points; the same figure as `fee_bps`, under its old name. */
115
167
  spread_bps: number;
168
+ /** The fee in basis points (2000 = 20 %). */
169
+ fee_bps: number;
170
+ fee_kind: FeeKind;
116
171
  provider: string;
172
+ /** The pair the quote was priced for, when the request named one. */
173
+ connector_slug?: string;
174
+ method?: DepositMethod;
175
+ /** The rate is locked until then; the deposit made with it waits for its payment as long. */
117
176
  expires_at: string;
118
177
  }
119
178
  interface Deposit {
@@ -139,6 +198,10 @@ interface Deposit {
139
198
  /** Locked provider rate (credited units per 1 source unit). */
140
199
  fx_rate?: string | null;
141
200
  fx_spread_bps?: number | null;
201
+ /** How `fx_spread_bps` was taken; see `FeeKind`. */
202
+ fx_fee_kind?: FeeKind | null;
203
+ /** When the deposit stops waiting for its payment; `null` for one without a term. */
204
+ expires_at?: string | null;
142
205
  /** The wallet's local currency the deposit converted into. */
143
206
  credited_currency?: string | null;
144
207
  /** What the wallet was actually credited, net of spread. */
@@ -202,7 +265,7 @@ interface InitiateDepositInput {
202
265
  * test deployments with the mock funder `mock_scenario`, which picks the
203
266
  * outcome: `happy` (confirmed at once, the default), `pending` (confirmed
204
267
  * about 15 s later), `redirect` (a hosted page where the user approves or
205
- * declines) or `fail`.
268
+ * declines), `late` (paid after the term) or `fail`.
206
269
  */
207
270
  metadata?: Record<string, string>;
208
271
  /** Structured billing details — real PSPs require these for 3DS / compliance. */
@@ -307,4 +370,4 @@ declare class DepositsResource {
307
370
  refund(depositId: string, input: CreateDepositRefundInput): Promise<Refund>;
308
371
  }
309
372
 
310
- export { type CardLoadStatus as C, type Deposit as D, FundingOptionsResource as F, type InitiateDepositInput as I, type Refund as R, DepositsResource as a, type CreateDepositRefundInput as b, type CreateQuoteInput as c, type DepositMethod as d, type DepositStatus as e, type DepositTarget as f, type FunderMode as g, type FundingOption as h, type FundingQuote as i, type IssueCardInput as j };
373
+ export { type CardLoadStatus as C, type Deposit as D, FundingOptionsResource as F, type InitiateDepositInput as I, type MethodTerms as M, type Refund as R, DepositsResource as a, type CreateDepositRefundInput as b, type CreateQuoteInput as c, type DepositMethod as d, type DepositStatus as e, type DepositTarget as f, type FeeKind as g, type FunderMode as h, type FundingOption as i, type FundingQuote as j, type IssueCardInput as k };