@calm-xyz/core 0.10.0 → 0.12.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 (3) hide show
  1. package/dist/index.d.ts +2473 -509
  2. package/dist/index.js +648 -37
  3. package/package.json +5 -8
package/dist/index.js CHANGED
@@ -14,19 +14,7 @@ var ApiError = class extends Error {
14
14
  this.status = args.status;
15
15
  }
16
16
  };
17
- let baseConfig = {};
18
- function getConfig() {
19
- return baseConfig;
20
- }
21
- function setConfig(config) {
22
- baseConfig = config;
23
- return baseConfig;
24
- }
25
- async function request(paramsConfig) {
26
- const config = {
27
- ...baseConfig,
28
- ...paramsConfig
29
- };
17
+ async function request(config) {
30
18
  const searchParams = new URLSearchParams();
31
19
  for (const [key, value] of Object.entries(config.params ?? {})) if (value != null) searchParams.append(key, String(value));
32
20
  let targetUrl = [config.apiUrl, config.url].filter(Boolean).join("");
@@ -53,9 +41,7 @@ async function request(paramsConfig) {
53
41
  }
54
42
  return {
55
43
  data,
56
- status: response.status,
57
- statusText: response.statusText,
58
- headers: response.headers
44
+ status: response.status
59
45
  };
60
46
  }
61
47
  function normalizeHeaders(headers) {
@@ -67,6 +53,54 @@ const client = request;
67
53
  * Generated by Kubb (https://kubb.dev/).
68
54
  * Do not edit manually.
69
55
  */
56
+ function getCheckoutCardUrl(address) {
57
+ return {
58
+ method: "POST",
59
+ url: `/v1/wallets/${address}/card/checkout`
60
+ };
61
+ }
62
+ /**
63
+ * @description Submits a card checkout for the session wallet using the encrypted card details supplied in `secure_card`. Every chain is a valid `chain`: the ones the card provider settles to directly are delivered by it, and the rest are routed on arrival, which requires a registered wallet.
64
+ * @summary Submit card checkout
65
+ * {@link /v1/wallets/:address/card/checkout}
66
+ */
67
+ async function checkoutCard(address, data, config = {}) {
68
+ const { client: request = client, ...requestConfig } = config;
69
+ const requestData = data;
70
+ return (await request({
71
+ method: "POST",
72
+ url: getCheckoutCardUrl(address).url.toString(),
73
+ data: requestData,
74
+ ...requestConfig
75
+ })).data;
76
+ }
77
+ /**
78
+ * Generated by Kubb (https://kubb.dev/).
79
+ * Do not edit manually.
80
+ */
81
+ function getCheckoutStripeSessionUrl(address, sessionId) {
82
+ return {
83
+ method: "POST",
84
+ url: `/v1/wallets/${address}/stripe/session/${sessionId}/checkout`
85
+ };
86
+ }
87
+ /**
88
+ * @description Checks out a session and returns its `client_secret`. Driven by the client SDK's `performCheckout` callback — never called standalone; the SDK handles required next actions (3DS) between calls.
89
+ * @summary Check out a Stripe onramp session
90
+ * {@link /v1/wallets/:address/stripe/session/:sessionId/checkout}
91
+ */
92
+ async function checkoutStripeSession(address, sessionId, config = {}) {
93
+ const { client: request = client, ...requestConfig } = config;
94
+ return (await request({
95
+ method: "POST",
96
+ url: getCheckoutStripeSessionUrl(address, sessionId).url.toString(),
97
+ ...requestConfig
98
+ })).data;
99
+ }
100
+ /**
101
+ * Generated by Kubb (https://kubb.dev/).
102
+ * Do not edit manually.
103
+ */
70
104
  function getClearSessionUrl() {
71
105
  return {
72
106
  method: "POST",
@@ -113,6 +147,31 @@ async function connectExchange(address, exchange, config = {}) {
113
147
  * Generated by Kubb (https://kubb.dev/).
114
148
  * Do not edit manually.
115
149
  */
150
+ function getCreateBlinkSignatureUrl(address) {
151
+ return {
152
+ method: "POST",
153
+ url: `/v1/wallets/${address}/blink/signature`
154
+ };
155
+ }
156
+ /**
157
+ * @description Returns the signed authorization the hosted deposit flow requires before it will accept a deposit. The destination is the session wallet and the destination chain's payout token — USDC on most chains, USDm on MegaETH (`4326`) — or the token named by `destination_token` where the chain offers a choice. The authorization is short-lived.
158
+ * @summary Authorize a deposit
159
+ * {@link /v1/wallets/:address/blink/signature}
160
+ */
161
+ async function createBlinkSignature(address, data, config = {}) {
162
+ const { client: request = client, ...requestConfig } = config;
163
+ const requestData = data;
164
+ return (await request({
165
+ method: "POST",
166
+ url: getCreateBlinkSignatureUrl(address).url.toString(),
167
+ data: requestData,
168
+ ...requestConfig
169
+ })).data;
170
+ }
171
+ /**
172
+ * Generated by Kubb (https://kubb.dev/).
173
+ * Do not edit manually.
174
+ */
116
175
  function getCreateCardLinkUrl(address) {
117
176
  return {
118
177
  method: "POST",
@@ -120,7 +179,7 @@ function getCreateCardLinkUrl(address) {
120
179
  };
121
180
  }
122
181
  /**
123
- * @description Returns the hosted card-onramp URL for the wallet. The card provider authenticates the cardholder and settles USDC to the wallet.
182
+ * @description Returns the hosted card-onramp URL for the wallet. The card provider authenticates the cardholder and settles USDC to the wallet. Every chain is a valid `destination_chain`: the ones the card provider settles to directly are delivered by it, and the rest are routed on arrival, which ignores `destination_asset` and delivers to the session wallet.
124
183
  * @summary Get the card-onramp link
125
184
  * {@link /v1/wallets/:address/card}
126
185
  */
@@ -145,7 +204,7 @@ function getCreateCashAppOrderUrl(address) {
145
204
  };
146
205
  }
147
206
  /**
148
- * @description Opens a Cash App onramp order and returns it, including the Cash App payment link. Poll `GET .../cashapp/:id` for status.
207
+ * @description Opens a Cash App onramp order and returns it, including the Cash App payment link. Poll `GET .../cashapp/:id` for status. Every chain is a valid `chain`: the ones Cash App settles to directly are delivered by it, and the rest are routed on arrival, which requires a registered wallet and delivers to the session wallet — pass it as `address` or the request is refused.
149
208
  * @summary Create a Cash App order
150
209
  * {@link /v1/wallets/:address/cashapp}
151
210
  */
@@ -170,7 +229,7 @@ function getCreateCashAppQuoteUrl(address) {
170
229
  };
171
230
  }
172
231
  /**
173
- * @description Returns a pricing preview for a Cash App order — the destination amount, the fee, and the fee in basis points.
232
+ * @description Returns a pricing preview for a Cash App order — the destination amount, the fee, and the fee in basis points. Every chain is a valid `chain`: the ones Cash App settles to directly are quoted against the destination, and the rest are quoted against the chain the order settles on before it is routed onward, which `routed` and `settlement_chain` name.
174
233
  * @summary Quote a Cash App order
175
234
  * {@link /v1/wallets/:address/cashapp/quote}
176
235
  */
@@ -195,7 +254,7 @@ function getCreateDepositAddressUrl(address) {
195
254
  };
196
255
  }
197
256
  /**
198
- * @description Returns an intake address for a `(source chain, source token) → destination` route. Funding it delivers the destination chain's payout token — USDC on most chains, USDm on MegaETH (`4326`) — at that token's own decimals; the same route reuses one address.
257
+ * @description Returns an intake address for a `(source chain, source token) → destination` route. Funding it delivers the destination chain's payout token — USDC on most chains, USDm on MegaETH (`4326`) — at that token's own decimals; the same route reuses one address. Pass `destination_token` to pick among a chain's payout tokens where it offers more than one.
199
258
  * @summary Create a crypto deposit address
200
259
  * {@link /v1/wallets/:address/deposit-address}
201
260
  */
@@ -245,7 +304,7 @@ function getCreateSessionDynamicUrl(address) {
245
304
  };
246
305
  }
247
306
  /**
248
- * @description Verifies a Dynamic identity-token bearer, checks the wallet is linked to the user, resolves the tenant from the publishable key, and mints the session cookie pair. Requires an `Authorization: Bearer <token>` header.
307
+ * @description Creates a session from a Dynamic identity token. The wallet must be linked to the token's user. Requires an `Authorization: Bearer <token>` header and the publishable key.
249
308
  * @summary Create a session (Dynamic)
250
309
  * {@link /v1/session/:address/dynamic}
251
310
  */
@@ -268,7 +327,7 @@ function getCreateSessionPrivyUrl(address) {
268
327
  };
269
328
  }
270
329
  /**
271
- * @description Verifies a Privy identity-token bearer, checks the wallet is linked to the user, resolves the tenant from the publishable key, and mints the session cookie pair. Requires an `Authorization: Bearer <token>` header.
330
+ * @description Creates a session from a Privy identity token. The wallet must be linked to the token's user. Requires an `Authorization: Bearer <token>` header and the publishable key.
272
331
  * @summary Create a session (Privy)
273
332
  * {@link /v1/session/:address/privy}
274
333
  */
@@ -291,7 +350,7 @@ function getCreateSessionSiweUrl(address) {
291
350
  };
292
351
  }
293
352
  /**
294
- * @description Verifies a signed EIP-4361 message and its nonce binding, then mints the session cookie pair. The publishable key rides inside the signed message's `Resources` field, so the wallet attests it.
353
+ * @description Verifies a signed EIP-4361 message and its nonce binding, then mints the session cookie pair. The message is standard EIP-4361 with no Calm-specific fields — the publishable key comes from the binding issued by `/siwe/nonce`, which welds it to the nonce the wallet signed over.
295
354
  * @summary Create a session (SIWE)
296
355
  * {@link /v1/session/:address/siwe}
297
356
  */
@@ -316,7 +375,7 @@ function getCreateSiweNonceUrl(address) {
316
375
  };
317
376
  }
318
377
  /**
319
- * @description Returns a nonce to embed in an EIP-4361 message and a short-lived binding to echo back on the SIWE create. Each call issues a fresh nonce; the binding expires after a few minutes.
378
+ * @description Returns a nonce to embed in an EIP-4361 message and a short-lived binding to echo back on the SIWE create. Send the publishable key as `X-Calm-Publishable-Key`: it is welded into the binding, so the message itself stays standard EIP-4361 with no Calm-specific fields. Each call issues a fresh nonce; the binding expires after a few minutes.
320
379
  * @summary Issue a SIWE nonce binding
321
380
  * {@link /v1/session/:address/siwe/nonce}
322
381
  */
@@ -332,6 +391,54 @@ async function createSiweNonce(address, config = {}) {
332
391
  * Generated by Kubb (https://kubb.dev/).
333
392
  * Do not edit manually.
334
393
  */
394
+ function getCreateStripeAuthIntentUrl(address) {
395
+ return {
396
+ method: "POST",
397
+ url: `/v1/wallets/${address}/stripe/auth-intent`
398
+ };
399
+ }
400
+ /**
401
+ * @description Opens a Link OAuth intent for the buyer's email and returns its id (handed to the client SDK's `authenticate(...)`) plus its expiry. Read-passthrough — nothing is persisted here.
402
+ * @summary Open a Stripe Link auth intent
403
+ * {@link /v1/wallets/:address/stripe/auth-intent}
404
+ */
405
+ async function createStripeAuthIntent(address, data, config = {}) {
406
+ const { client: request = client, ...requestConfig } = config;
407
+ const requestData = data;
408
+ return (await request({
409
+ method: "POST",
410
+ url: getCreateStripeAuthIntentUrl(address).url.toString(),
411
+ data: requestData,
412
+ ...requestConfig
413
+ })).data;
414
+ }
415
+ /**
416
+ * Generated by Kubb (https://kubb.dev/).
417
+ * Do not edit manually.
418
+ */
419
+ function getCreateStripeCustomerUrl(address, crypto_customer_id) {
420
+ return {
421
+ method: "POST",
422
+ url: `/v1/wallets/${address}/stripe/customer/${crypto_customer_id}`
423
+ };
424
+ }
425
+ /**
426
+ * @description Validates the crypto customer exists and persists the customer id onto the session so `/status` can re-derive it after a reopen.
427
+ * @summary Persist a Stripe crypto customer
428
+ * {@link /v1/wallets/:address/stripe/customer/:crypto_customer_id}
429
+ */
430
+ async function createStripeCustomer(address, crypto_customer_id, config = {}) {
431
+ const { client: request = client, ...requestConfig } = config;
432
+ return (await request({
433
+ method: "POST",
434
+ url: getCreateStripeCustomerUrl(address, crypto_customer_id).url.toString(),
435
+ ...requestConfig
436
+ })).data;
437
+ }
438
+ /**
439
+ * Generated by Kubb (https://kubb.dev/).
440
+ * Do not edit manually.
441
+ */
335
442
  function getCreateStripeSessionUrl(address) {
336
443
  return {
337
444
  method: "POST",
@@ -339,7 +446,7 @@ function getCreateStripeSessionUrl(address) {
339
446
  };
340
447
  }
341
448
  /**
342
- * @description Mints an embedded onramp session and mirrors it into a local order. Returns Stripe's `client_secret` (which the SDK mounts the onramp iframe with) plus our own `order_id` to poll via `GET .../stripe/order/:id`. Every chain is a valid `destination_chain`: the ones the card provider settles to directly are delivered by it, and the rest are routed on arrival, which requires a registered wallet and delivers to the session wallet. Amounts are optional; pass at most one of `source_amount` / `destination_amount`.
449
+ * @description Opens a headless onramp session and mirrors it into a local order. Returns Stripe's `session_id` (fed to the client SDK's `performCheckout`) plus our own `order_id` to poll via `GET .../stripe/order/:id`. Every chain is a valid `destination_chain`: the ones Stripe settles to directly are delivered by it, and the rest are routed on arrival, which requires a registered wallet and delivers to the session wallet. Pass exactly one of `source_amount` / `destination_amount`.
343
450
  * @summary Open a Stripe onramp session
344
451
  * {@link /v1/wallets/:address/stripe/session}
345
452
  */
@@ -357,6 +464,31 @@ async function createStripeSession(address, data, config = {}) {
357
464
  * Generated by Kubb (https://kubb.dev/).
358
465
  * Do not edit manually.
359
466
  */
467
+ function getCreateStripeTokensUrl(address) {
468
+ return {
469
+ method: "POST",
470
+ url: `/v1/wallets/${address}/stripe/tokens`
471
+ };
472
+ }
473
+ /**
474
+ * @description Exchanges a consented auth intent for the per-user OAuth tokens and stores them server-side. Returns 204; the access token never reaches the browser. The bound intent must match this session.
475
+ * @summary Exchange an auth intent for tokens
476
+ * {@link /v1/wallets/:address/stripe/tokens}
477
+ */
478
+ async function createStripeTokens(address, data, config = {}) {
479
+ const { client: request = client, ...requestConfig } = config;
480
+ const requestData = data;
481
+ return (await request({
482
+ method: "POST",
483
+ url: getCreateStripeTokensUrl(address).url.toString(),
484
+ data: requestData,
485
+ ...requestConfig
486
+ })).data;
487
+ }
488
+ /**
489
+ * Generated by Kubb (https://kubb.dev/).
490
+ * Do not edit manually.
491
+ */
360
492
  function getCreateSwapQuoteUrl(address) {
361
493
  return {
362
494
  method: "POST",
@@ -364,7 +496,7 @@ function getCreateSwapQuoteUrl(address) {
364
496
  };
365
497
  }
366
498
  /**
367
- * @description Returns an executable quote for swapping a source token into the destination chain's payout token — USDC on most chains, USDm on MegaETH (`4326`) — at that token's own decimals. The response carries the steps the client executes on-chain; source and destination chains may differ.
499
+ * @description Returns an executable quote for swapping a source token into the destination chain's payout token — USDC on most chains, USDm on MegaETH (`4326`) — at that token's own decimals. Pass `destination_token` to pick among a chain's payout tokens where it offers more than one; omitted, the chain's default applies. The response carries the steps the client executes on-chain; source and destination chains may differ.
368
500
  * @summary Quote a swap
369
501
  * {@link /v1/wallets/:address/swap/quote}
370
502
  */
@@ -389,7 +521,7 @@ function getCreateVirtualAccountUrl(address) {
389
521
  };
390
522
  }
391
523
  /**
392
- * @description Provisions a fiat→USDC virtual account for a `(currency, destination chain)` pair. Requires an approved identity verification. Returns 204; refetch the list to see the new account.
524
+ * @description Provisions a virtual account for a `(currency, destination chain, payout token)` triple. Repeating a triple returns the account that already exists. Changing `destination_token` on the same currency and chain provisions a separate account with its own bank details. Every chain is accepted: the ones the banking rail settles to directly are delivered by it, and the rest are routed on arrival. Requires an approved identity verification. Returns 204; refetch the list to see the new account.
393
525
  * @summary Create a virtual account
394
526
  * {@link /v1/wallets/:address/virtual-accounts}
395
527
  */
@@ -462,7 +594,7 @@ function getGetBalanceUrl(address, chain, token) {
462
594
  };
463
595
  }
464
596
  /**
465
- * @description Returns a single token's balance on one chain. `token` is a catalog symbol (`eth`, `hype`, `usdc`, `usdt`).
597
+ * @description Returns a single token's balance on one chain. `token` is a catalog symbol (`eth`, `hype`, `mon`, `usdc`, `usdm`, `usdt`).
466
598
  * @summary Get one token balance
467
599
  * {@link /v1/wallets/:address/balances/:chain/:token}
468
600
  */
@@ -485,7 +617,7 @@ function getGetBalancesUrl(address) {
485
617
  };
486
618
  }
487
619
  /**
488
- * @description Returns the wallet's token balances across the supported source chains, each with its USD value. Filter with `?chains=1,8453`; the default covers the source chains, so a destination-only chain like MegaETH (`4326`) must be requested explicitly.
620
+ * @description Returns the wallet's token balances across the supported source chains, each with its USD value. Filter with `?chains=1,8453`; the default covers the source chains.
489
621
  * @summary List wallet balances
490
622
  * {@link /v1/wallets/:address/balances}
491
623
  */
@@ -502,6 +634,122 @@ async function getBalances(address, params, config = {}) {
502
634
  * Generated by Kubb (https://kubb.dev/).
503
635
  * Do not edit manually.
504
636
  */
637
+ function getGetBlinkConfigUrl(address) {
638
+ return {
639
+ method: "GET",
640
+ url: `/v1/wallets/${address}/blink/config`
641
+ };
642
+ }
643
+ /**
644
+ * @description Returns the environment-specific settings the SDK needs to open the hosted deposit flow. A null value means the SDK should use its bundled default.
645
+ * @summary Get the deposit-rail runtime config
646
+ * {@link /v1/wallets/:address/blink/config}
647
+ */
648
+ async function getBlinkConfig(address, config = {}) {
649
+ const { client: request = client, ...requestConfig } = config;
650
+ return (await request({
651
+ method: "GET",
652
+ url: getGetBlinkConfigUrl(address).url.toString(),
653
+ ...requestConfig
654
+ })).data;
655
+ }
656
+ /**
657
+ * Generated by Kubb (https://kubb.dev/).
658
+ * Do not edit manually.
659
+ */
660
+ function getGetCardConfigUrl(address) {
661
+ return {
662
+ method: "GET",
663
+ url: `/v1/wallets/${address}/card/config`
664
+ };
665
+ }
666
+ /**
667
+ * @description Returns the public client identifiers the card form must be initialized with. Every value is publishable — safe to embed in a browser, like a publishable key; no secret is on this surface.
668
+ * @summary Get card flow config
669
+ * {@link /v1/wallets/:address/card/config}
670
+ */
671
+ async function getCardConfig(address, config = {}) {
672
+ const { client: request = client, ...requestConfig } = config;
673
+ return (await request({
674
+ method: "GET",
675
+ url: getGetCardConfigUrl(address).url.toString(),
676
+ ...requestConfig
677
+ })).data;
678
+ }
679
+ /**
680
+ * Generated by Kubb (https://kubb.dev/).
681
+ * Do not edit manually.
682
+ */
683
+ function getGetCardCustomerUrl(address) {
684
+ return {
685
+ method: "GET",
686
+ url: `/v1/wallets/${address}/card/customer`
687
+ };
688
+ }
689
+ /**
690
+ * @description Returns the saved registration and billing profile for the session wallet.
691
+ * @summary Get card registration + billing
692
+ * {@link /v1/wallets/:address/card/customer}
693
+ */
694
+ async function getCardCustomer(address, config = {}) {
695
+ const { client: request = client, ...requestConfig } = config;
696
+ return (await request({
697
+ method: "GET",
698
+ url: getGetCardCustomerUrl(address).url.toString(),
699
+ ...requestConfig
700
+ })).data;
701
+ }
702
+ /**
703
+ * Generated by Kubb (https://kubb.dev/).
704
+ * Do not edit manually.
705
+ */
706
+ function getGetCardOrderUrl(address, id) {
707
+ return {
708
+ method: "GET",
709
+ url: `/v1/wallets/${address}/card/orders/${id}`
710
+ };
711
+ }
712
+ /**
713
+ * @description Returns the status of one card order, scoped to the session wallet.
714
+ * @summary Get card order
715
+ * {@link /v1/wallets/:address/card/orders/:id}
716
+ */
717
+ async function getCardOrder(address, id, config = {}) {
718
+ const { client: request = client, ...requestConfig } = config;
719
+ return (await request({
720
+ method: "GET",
721
+ url: getGetCardOrderUrl(address, id).url.toString(),
722
+ ...requestConfig
723
+ })).data;
724
+ }
725
+ /**
726
+ * Generated by Kubb (https://kubb.dev/).
727
+ * Do not edit manually.
728
+ */
729
+ function getGetCardQuoteUrl(address) {
730
+ return {
731
+ method: "GET",
732
+ url: `/v1/wallets/${address}/card/quote`
733
+ };
734
+ }
735
+ /**
736
+ * @description Returns an informational price estimate for a fiat card spend: the net USDC the buyer receives, the all-in fiat charged, the fee, and the exchange rate.
737
+ * @summary Quote a card amount
738
+ * {@link /v1/wallets/:address/card/quote}
739
+ */
740
+ async function getCardQuote(address, params, config = {}) {
741
+ const { client: request = client, ...requestConfig } = config;
742
+ return (await request({
743
+ method: "GET",
744
+ url: getGetCardQuoteUrl(address).url.toString(),
745
+ params,
746
+ ...requestConfig
747
+ })).data;
748
+ }
749
+ /**
750
+ * Generated by Kubb (https://kubb.dev/).
751
+ * Do not edit manually.
752
+ */
505
753
  function getGetCashAppOrderUrl(address, id) {
506
754
  return {
507
755
  method: "GET",
@@ -601,7 +849,7 @@ function getGetFxRatesUrl() {
601
849
  };
602
850
  }
603
851
  /**
604
- * @description Returns USD→currency rates for showing amounts in the app's display currency. Public; rates are cached upstream.
852
+ * @description Returns USD→currency rates for showing amounts in the app's display currency. No authentication required.
605
853
  * @summary Get display-currency exchange rates
606
854
  * {@link /v1/fx}
607
855
  */
@@ -663,6 +911,29 @@ async function getStripeConfig(address, config = {}) {
663
911
  * Generated by Kubb (https://kubb.dev/).
664
912
  * Do not edit manually.
665
913
  */
914
+ function getGetStripeCustomerStatusUrl(address, crypto_customer_id) {
915
+ return {
916
+ method: "GET",
917
+ url: `/v1/wallets/${address}/stripe/customer/${crypto_customer_id}`
918
+ };
919
+ }
920
+ /**
921
+ * @description Reads the crypto customer's KYC and document-verification statuses (the two the SDK branches on) plus its provided fields — the same projection as the customer POST, but a pure read with no persistence. The SDK polls it while the verifying step is on screen.
922
+ * @summary Poll a Stripe crypto customer's status
923
+ * {@link /v1/wallets/:address/stripe/customer/:crypto_customer_id}
924
+ */
925
+ async function getStripeCustomerStatus(address, crypto_customer_id, config = {}) {
926
+ const { client: request = client, ...requestConfig } = config;
927
+ return (await request({
928
+ method: "GET",
929
+ url: getGetStripeCustomerStatusUrl(address, crypto_customer_id).url.toString(),
930
+ ...requestConfig
931
+ })).data;
932
+ }
933
+ /**
934
+ * Generated by Kubb (https://kubb.dev/).
935
+ * Do not edit manually.
936
+ */
666
937
  function getGetStripeOrderUrl(address, id) {
667
938
  return {
668
939
  method: "GET",
@@ -686,6 +957,53 @@ async function getStripeOrder(address, id, config = {}) {
686
957
  * Generated by Kubb (https://kubb.dev/).
687
958
  * Do not edit manually.
688
959
  */
960
+ function getGetStripeQuoteUrl(address) {
961
+ return {
962
+ method: "GET",
963
+ url: `/v1/wallets/${address}/stripe/quote`
964
+ };
965
+ }
966
+ /**
967
+ * @description Returns an informational price estimate for a source amount (fiat spend) or destination amount (target USDC) — the destination amount, the buyer's all-in source total, the fee components, and when the rate was fetched. Pin exactly one. No customer, token, or session is involved (it prices with the secret key alone), so it's `session`-gated only. Display-only: Stripe sets the final amounts at session creation.
968
+ * @summary Quote a Stripe onramp amount
969
+ * {@link /v1/wallets/:address/stripe/quote}
970
+ */
971
+ async function getStripeQuote(address, params, config = {}) {
972
+ const { client: request = client, ...requestConfig } = config;
973
+ return (await request({
974
+ method: "GET",
975
+ url: getGetStripeQuoteUrl(address).url.toString(),
976
+ params,
977
+ ...requestConfig
978
+ })).data;
979
+ }
980
+ /**
981
+ * Generated by Kubb (https://kubb.dev/).
982
+ * Do not edit manually.
983
+ */
984
+ function getGetStripeStatusUrl(address) {
985
+ return {
986
+ method: "GET",
987
+ url: `/v1/wallets/${address}/stripe/status`
988
+ };
989
+ }
990
+ /**
991
+ * @description Reports whether this session is still Link-authenticated and, once the customer POST has run, the persisted crypto customer id and the Link account email. Reads Redis only, so an un-authed session is a 200 with `authenticated: false` (not a 401) — the SDK polls it to re-derive the Stripe session on a cold open.
992
+ * @summary Get the session's Stripe login state
993
+ * {@link /v1/wallets/:address/stripe/status}
994
+ */
995
+ async function getStripeStatus(address, config = {}) {
996
+ const { client: request = client, ...requestConfig } = config;
997
+ return (await request({
998
+ method: "GET",
999
+ url: getGetStripeStatusUrl(address).url.toString(),
1000
+ ...requestConfig
1001
+ })).data;
1002
+ }
1003
+ /**
1004
+ * Generated by Kubb (https://kubb.dev/).
1005
+ * Do not edit manually.
1006
+ */
689
1007
  function getGetTermsOfServiceLinkUrl(address) {
690
1008
  return {
691
1009
  method: "POST",
@@ -732,6 +1050,77 @@ async function getWallet(address, config = {}) {
732
1050
  * Generated by Kubb (https://kubb.dev/).
733
1051
  * Do not edit manually.
734
1052
  */
1053
+ function getListCryptoDepositsUrl(address) {
1054
+ return {
1055
+ method: "GET",
1056
+ url: `/v1/wallets/${address}/crypto-deposits`
1057
+ };
1058
+ }
1059
+ /**
1060
+ * @description Returns the wallet's crypto-deposit history, newest first: every detected deposit with its current status (processing, completed, failed, or refunded), amounts, and transaction hashes. `deposit_address` is null when the deposit arrived without a Calm-issued intake address. Requires a valid session cookie for the same wallet.
1061
+ * @summary List crypto deposits
1062
+ * {@link /v1/wallets/:address/crypto-deposits}
1063
+ */
1064
+ async function listCryptoDeposits(address, config = {}) {
1065
+ const { client: request = client, ...requestConfig } = config;
1066
+ return (await request({
1067
+ method: "GET",
1068
+ url: getListCryptoDepositsUrl(address).url.toString(),
1069
+ ...requestConfig
1070
+ })).data;
1071
+ }
1072
+ /**
1073
+ * Generated by Kubb (https://kubb.dev/).
1074
+ * Do not edit manually.
1075
+ */
1076
+ function getListStripePaymentTokensUrl(address) {
1077
+ return {
1078
+ method: "GET",
1079
+ url: `/v1/wallets/${address}/stripe/payment-tokens`
1080
+ };
1081
+ }
1082
+ /**
1083
+ * @description Returns the payment methods the customer has on file. Read-passthrough — the SDK checks this before `collectPaymentMethod` to offer a saved method.
1084
+ * @summary List the customer's payment methods
1085
+ * {@link /v1/wallets/:address/stripe/payment-tokens}
1086
+ */
1087
+ async function listStripePaymentTokens(address, params, config = {}) {
1088
+ const { client: request = client, ...requestConfig } = config;
1089
+ return (await request({
1090
+ method: "GET",
1091
+ url: getListStripePaymentTokensUrl(address).url.toString(),
1092
+ params,
1093
+ ...requestConfig
1094
+ })).data;
1095
+ }
1096
+ /**
1097
+ * Generated by Kubb (https://kubb.dev/).
1098
+ * Do not edit manually.
1099
+ */
1100
+ function getListStripeWalletsUrl(address) {
1101
+ return {
1102
+ method: "GET",
1103
+ url: `/v1/wallets/${address}/stripe/wallets`
1104
+ };
1105
+ }
1106
+ /**
1107
+ * @description Returns the crypto wallets registered to the customer's Link account. Read-passthrough — the SDK checks this before `registerWalletAddress` to avoid re-registering a known address.
1108
+ * @summary List the customer's crypto wallets
1109
+ * {@link /v1/wallets/:address/stripe/wallets}
1110
+ */
1111
+ async function listStripeWallets(address, params, config = {}) {
1112
+ const { client: request = client, ...requestConfig } = config;
1113
+ return (await request({
1114
+ method: "GET",
1115
+ url: getListStripeWalletsUrl(address).url.toString(),
1116
+ params,
1117
+ ...requestConfig
1118
+ })).data;
1119
+ }
1120
+ /**
1121
+ * Generated by Kubb (https://kubb.dev/).
1122
+ * Do not edit manually.
1123
+ */
735
1124
  function getListVirtualAccountsUrl(address) {
736
1125
  return {
737
1126
  method: "GET",
@@ -739,7 +1128,7 @@ function getListVirtualAccountsUrl(address) {
739
1128
  };
740
1129
  }
741
1130
  /**
742
- * @description Returns the wallet's virtual accounts, each with the bank-side deposit instructions the user needs to send fiat.
1131
+ * @description Returns the wallet's virtual accounts, each with the bank-side deposit instructions the user needs to send fiat. A wallet can hold more than one account per `(currency, chain)` when the payout token differs; `destination_token` is what tells them apart, and the bank details are not interchangeable between them.
743
1132
  * @summary List virtual accounts
744
1133
  * {@link /v1/wallets/:address/virtual-accounts}
745
1134
  */
@@ -785,7 +1174,7 @@ function getRegisterWalletUrl(address) {
785
1174
  };
786
1175
  }
787
1176
  /**
788
- * @description Submits the registration form (name + email) for the wallet. Returns 204; the SDK refetches the wallet state to pick up the new facts.
1177
+ * @description Submits the registration form (name + email) for the wallet. Returns 204; re-read `GET /v1/wallets/{address}` to pick up the new facts.
789
1178
  * @summary Register a wallet
790
1179
  * {@link /v1/wallets/:address/register}
791
1180
  */
@@ -856,7 +1245,7 @@ function getUpdateVirtualAccountUrl(address, virtualAccountId) {
856
1245
  };
857
1246
  }
858
1247
  /**
859
- * @description Updates a virtual account's destination chain. Returns 204; refetch the list to see the change.
1248
+ * @description Updates a virtual account's destination chain. Every chain is accepted: the ones the banking rail settles to directly are delivered by it, and the rest are routed on arrival. `destination_token` picks the payout token for the new destination. Omitting it with the chain unchanged leaves the account untouched; omitting it on a chain change takes the new chain's default rather than carrying the current token over. Send `destination_token` explicitly whenever the account should keep a non-default payout. Returns 204; refetch the list to see the change.
860
1249
  * @summary Update a virtual account
861
1250
  * {@link /v1/wallets/:address/virtual-accounts/:virtual-account-id}
862
1251
  */
@@ -870,12 +1259,57 @@ async function updateVirtualAccount(address, virtualAccountId, data, config = {}
870
1259
  ...requestConfig
871
1260
  })).data;
872
1261
  }
1262
+ const checkoutCardMutationRequestChainEnum = {
1263
+ "1": 1,
1264
+ "8453": 8453,
1265
+ "999": 999,
1266
+ "1337": 1337,
1267
+ "4326": 4326,
1268
+ "143": 143,
1269
+ "137": 137
1270
+ };
1271
+ const checkoutCardMutationRequestDestinationTokenEnum = {
1272
+ usdc: "usdc",
1273
+ usdm: "usdm",
1274
+ ausd: "ausd",
1275
+ "usdc.e": "usdc.e"
1276
+ };
873
1277
  const connectExchangePathParamsExchangeEnum = { coinbase: "coinbase" };
1278
+ const createBlinkSignatureMutationRequestDestinationChainEnum = {
1279
+ "1": 1,
1280
+ "8453": 8453,
1281
+ "999": 999,
1282
+ "1337": 1337,
1283
+ "4326": 4326,
1284
+ "143": 143,
1285
+ "137": 137
1286
+ };
1287
+ const createBlinkSignatureMutationRequestDestinationTokenEnum = {
1288
+ usdc: "usdc",
1289
+ usdm: "usdm",
1290
+ ausd: "ausd",
1291
+ "usdc.e": "usdc.e"
1292
+ };
874
1293
  const createCardLinkMutationRequestCurrencyEnum = {
875
1294
  usd: "usd",
876
1295
  gbp: "gbp",
877
1296
  eur: "eur"
878
1297
  };
1298
+ const createCardLinkMutationRequestDestinationChainEnum = {
1299
+ "1": 1,
1300
+ "8453": 8453,
1301
+ "999": 999,
1302
+ "1337": 1337,
1303
+ "4326": 4326,
1304
+ "143": 143,
1305
+ "137": 137
1306
+ };
1307
+ const createCardLinkMutationRequestDestinationTokenEnum = {
1308
+ usdc: "usdc",
1309
+ usdm: "usdm",
1310
+ ausd: "ausd",
1311
+ "usdc.e": "usdc.e"
1312
+ };
879
1313
  const createCashAppOrder200StatusEnum = {
880
1314
  pending: "pending",
881
1315
  processing: "processing",
@@ -891,17 +1325,138 @@ const createCashAppOrder200StatusEnum = {
891
1325
  unfulfilled: "unfulfilled",
892
1326
  expired: "expired"
893
1327
  };
1328
+ const createCashAppOrderMutationRequestChainEnum = {
1329
+ "1": 1,
1330
+ "8453": 8453,
1331
+ "999": 999,
1332
+ "1337": 1337,
1333
+ "4326": 4326,
1334
+ "143": 143,
1335
+ "137": 137
1336
+ };
1337
+ const createCashAppOrderMutationRequestDestinationTokenEnum = {
1338
+ usdc: "usdc",
1339
+ usdm: "usdm",
1340
+ ausd: "ausd",
1341
+ "usdc.e": "usdc.e"
1342
+ };
1343
+ const createCashAppQuoteMutationRequestChainEnum = {
1344
+ "1": 1,
1345
+ "8453": 8453,
1346
+ "999": 999,
1347
+ "1337": 1337,
1348
+ "4326": 4326,
1349
+ "143": 143,
1350
+ "137": 137
1351
+ };
1352
+ const createCashAppQuoteMutationRequestDestinationTokenEnum = {
1353
+ usdc: "usdc",
1354
+ usdm: "usdm",
1355
+ ausd: "ausd",
1356
+ "usdc.e": "usdc.e"
1357
+ };
1358
+ const createDepositAddressMutationRequestDestinationChainEnum = {
1359
+ "1": 1,
1360
+ "8453": 8453,
1361
+ "999": 999,
1362
+ "1337": 1337,
1363
+ "4326": 4326,
1364
+ "143": 143,
1365
+ "137": 137
1366
+ };
1367
+ const createDepositAddressMutationRequestDestinationTokenEnum = {
1368
+ usdc: "usdc",
1369
+ usdm: "usdm",
1370
+ ausd: "ausd",
1371
+ "usdc.e": "usdc.e"
1372
+ };
1373
+ const createDepositAddressMutationRequestSourceChainEnum = {
1374
+ "1": 1,
1375
+ "8453": 8453,
1376
+ "999": 999,
1377
+ "4326": 4326,
1378
+ "143": 143,
1379
+ "137": 137
1380
+ };
894
1381
  const createDepositAddressMutationRequestSourceTokenEnum = {
895
1382
  eth: "eth",
896
1383
  hype: "hype",
1384
+ mon: "mon",
1385
+ pol: "pol",
897
1386
  usdc: "usdc",
1387
+ usdm: "usdm",
898
1388
  usdt: "usdt"
899
1389
  };
900
1390
  const createExchangeWithdrawQuotePathParamsExchangeEnum = { coinbase: "coinbase" };
1391
+ const createExchangeWithdrawQuoteMutationRequestDestinationChainEnum = {
1392
+ "1": 1,
1393
+ "8453": 8453,
1394
+ "999": 999,
1395
+ "1337": 1337,
1396
+ "4326": 4326,
1397
+ "143": 143,
1398
+ "137": 137
1399
+ };
1400
+ const createExchangeWithdrawQuoteMutationRequestDestinationTokenEnum = {
1401
+ usdc: "usdc",
1402
+ usdm: "usdm",
1403
+ ausd: "ausd",
1404
+ "usdc.e": "usdc.e"
1405
+ };
1406
+ const createExchangeWithdrawQuoteMutationRequestOriginChainEnum = {
1407
+ "1": 1,
1408
+ "8453": 8453,
1409
+ "999": 999,
1410
+ "1337": 1337,
1411
+ "4326": 4326,
1412
+ "143": 143,
1413
+ "137": 137
1414
+ };
1415
+ const createStripeSessionMutationRequestDestinationChainEnum = {
1416
+ "1": 1,
1417
+ "8453": 8453,
1418
+ "999": 999,
1419
+ "1337": 1337,
1420
+ "4326": 4326,
1421
+ "143": 143,
1422
+ "137": 137
1423
+ };
1424
+ const createStripeSessionMutationRequestDestinationTokenEnum = {
1425
+ usdc: "usdc",
1426
+ usdm: "usdm",
1427
+ ausd: "ausd",
1428
+ "usdc.e": "usdc.e"
1429
+ };
1430
+ const createSwapQuoteMutationRequestDestinationChainEnum = {
1431
+ "1": 1,
1432
+ "8453": 8453,
1433
+ "999": 999,
1434
+ "1337": 1337,
1435
+ "4326": 4326,
1436
+ "143": 143,
1437
+ "137": 137
1438
+ };
1439
+ const createSwapQuoteMutationRequestDestinationTokenEnum = {
1440
+ usdc: "usdc",
1441
+ usdm: "usdm",
1442
+ ausd: "ausd",
1443
+ "usdc.e": "usdc.e"
1444
+ };
1445
+ const createSwapQuoteMutationRequestSourceChainEnum = {
1446
+ "1": 1,
1447
+ "8453": 8453,
1448
+ "999": 999,
1449
+ "4326": 4326,
1450
+ "143": 143,
1451
+ "137": 137
1452
+ };
901
1453
  const createSwapQuoteMutationRequestSourceTokenEnum = {
902
1454
  eth: "eth",
903
1455
  hype: "hype",
1456
+ mon: "mon",
1457
+ pol: "pol",
904
1458
  usdc: "usdc",
1459
+ usdm: "usdm",
905
1460
  usdt: "usdt"
906
1461
  };
907
1462
  const createSwapQuoteMutationRequestTradeTypeEnum = {
@@ -909,11 +1464,26 @@ const createSwapQuoteMutationRequestTradeTypeEnum = {
909
1464
  EXACT_OUTPUT: "EXACT_OUTPUT",
910
1465
  EXPECTED_OUTPUT: "EXPECTED_OUTPUT"
911
1466
  };
1467
+ const createVirtualAccountMutationRequestChainEnum = {
1468
+ "1": 1,
1469
+ "8453": 8453,
1470
+ "999": 999,
1471
+ "1337": 1337,
1472
+ "4326": 4326,
1473
+ "143": 143,
1474
+ "137": 137
1475
+ };
912
1476
  const createVirtualAccountMutationRequestCurrencyEnum = {
913
1477
  usd: "usd",
914
1478
  gbp: "gbp",
915
1479
  eur: "eur"
916
1480
  };
1481
+ const createVirtualAccountMutationRequestDestinationTokenEnum = {
1482
+ usdc: "usdc",
1483
+ usdm: "usdm",
1484
+ ausd: "ausd",
1485
+ "usdc.e": "usdc.e"
1486
+ };
917
1487
  const disconnectExchangePathParamsExchangeEnum = { coinbase: "coinbase" };
918
1488
  const executeExchangeWithdrawalPathParamsExchangeEnum = { coinbase: "coinbase" };
919
1489
  const executeExchangeWithdrawal200StatusEnum = {
@@ -926,9 +1496,32 @@ const executeExchangeWithdrawal200StatusEnum = {
926
1496
  const getBalancePathParamsTokenEnum = {
927
1497
  eth: "eth",
928
1498
  hype: "hype",
1499
+ mon: "mon",
1500
+ pol: "pol",
929
1501
  usdc: "usdc",
1502
+ usdm: "usdm",
930
1503
  usdt: "usdt"
931
1504
  };
1505
+ const processorEnvEnum = {
1506
+ sandbox: "sandbox",
1507
+ prod: "prod"
1508
+ };
1509
+ const getCardOrder200ChainEnum = {
1510
+ "1": 1,
1511
+ "8453": 8453,
1512
+ "999": 999,
1513
+ "1337": 1337,
1514
+ "4326": 4326,
1515
+ "143": 143,
1516
+ "137": 137
1517
+ };
1518
+ const getCardOrder200StatusEnum = {
1519
+ submitted: "submitted",
1520
+ processing: "processing",
1521
+ completed: "completed",
1522
+ failed: "failed",
1523
+ requires_3ds: "requires_3ds"
1524
+ };
932
1525
  const getCashAppOrder200StatusEnum = {
933
1526
  pending: "pending",
934
1527
  processing: "processing",
@@ -973,12 +1566,30 @@ const getWallet200IdentityVerificationStatusEnum = {
973
1566
  paused: "paused",
974
1567
  offboarded: "offboarded"
975
1568
  };
1569
+ const dataStatusEnum = {
1570
+ processing: "processing",
1571
+ completed: "completed",
1572
+ failed: "failed",
1573
+ refunded: "refunded"
1574
+ };
976
1575
  const dataCurrencyEnum = {
977
1576
  usd: "usd",
978
1577
  gbp: "gbp",
979
1578
  eur: "eur"
980
1579
  };
981
- function configureCalm(options) {
982
- setConfig({ apiUrl: options.apiUrl });
983
- }
984
- export { ApiError, clearSession, client, client as default, configureCalm, connectExchange, connectExchangePathParamsExchangeEnum, createCardLink, createCardLinkMutationRequestCurrencyEnum, createCashAppOrder, createCashAppOrder200StatusEnum, createCashAppQuote, createDepositAddress, createDepositAddressMutationRequestSourceTokenEnum, createExchangeWithdrawQuote, createExchangeWithdrawQuotePathParamsExchangeEnum, createSessionDynamic, createSessionPrivy, createSessionSiwe, createSiweNonce, createStripeSession, createSwapQuote, createSwapQuoteMutationRequestSourceTokenEnum, createSwapQuoteMutationRequestTradeTypeEnum, createVirtualAccount, createVirtualAccountMutationRequestCurrencyEnum, dataCurrencyEnum, disconnectExchange, disconnectExchangePathParamsExchangeEnum, executeExchangeWithdrawal, executeExchangeWithdrawal200StatusEnum, executeExchangeWithdrawalPathParamsExchangeEnum, getBalance, getBalancePathParamsTokenEnum, getBalances, getCashAppOrder, getCashAppOrder200StatusEnum, getConfig, getExchange, getExchangeAssets, getExchangeAssetsPathParamsExchangeEnum, getExchangePathParamsExchangeEnum, getExchangeWithdrawal, getExchangeWithdrawal200StatusEnum, getExchangeWithdrawalPathParamsExchangeEnum, getFxRates, getIdentityVerificationLink, getStripeConfig, getStripeOrder, getStripeOrder200StatusEnum, getTermsOfServiceLink, getWallet, getWallet200IdentityVerificationStatusEnum, listVirtualAccounts, refreshSession, registerWallet, setConfig, submitIdentityVerification, submitTermsOfService, updateVirtualAccount };
1580
+ const updateVirtualAccountMutationRequestChainEnum = {
1581
+ "1": 1,
1582
+ "8453": 8453,
1583
+ "999": 999,
1584
+ "1337": 1337,
1585
+ "4326": 4326,
1586
+ "143": 143,
1587
+ "137": 137
1588
+ };
1589
+ const updateVirtualAccountMutationRequestDestinationTokenEnum = {
1590
+ usdc: "usdc",
1591
+ usdm: "usdm",
1592
+ ausd: "ausd",
1593
+ "usdc.e": "usdc.e"
1594
+ };
1595
+ export { ApiError, checkoutCard, checkoutCardMutationRequestChainEnum, checkoutCardMutationRequestDestinationTokenEnum, checkoutStripeSession, clearSession, client, client as default, connectExchange, connectExchangePathParamsExchangeEnum, createBlinkSignature, createBlinkSignatureMutationRequestDestinationChainEnum, createBlinkSignatureMutationRequestDestinationTokenEnum, createCardLink, createCardLinkMutationRequestCurrencyEnum, createCardLinkMutationRequestDestinationChainEnum, createCardLinkMutationRequestDestinationTokenEnum, createCashAppOrder, createCashAppOrder200StatusEnum, createCashAppOrderMutationRequestChainEnum, createCashAppOrderMutationRequestDestinationTokenEnum, createCashAppQuote, createCashAppQuoteMutationRequestChainEnum, createCashAppQuoteMutationRequestDestinationTokenEnum, createDepositAddress, createDepositAddressMutationRequestDestinationChainEnum, createDepositAddressMutationRequestDestinationTokenEnum, createDepositAddressMutationRequestSourceChainEnum, createDepositAddressMutationRequestSourceTokenEnum, createExchangeWithdrawQuote, createExchangeWithdrawQuoteMutationRequestDestinationChainEnum, createExchangeWithdrawQuoteMutationRequestDestinationTokenEnum, createExchangeWithdrawQuoteMutationRequestOriginChainEnum, createExchangeWithdrawQuotePathParamsExchangeEnum, createSessionDynamic, createSessionPrivy, createSessionSiwe, createSiweNonce, createStripeAuthIntent, createStripeCustomer, createStripeSession, createStripeSessionMutationRequestDestinationChainEnum, createStripeSessionMutationRequestDestinationTokenEnum, createStripeTokens, createSwapQuote, createSwapQuoteMutationRequestDestinationChainEnum, createSwapQuoteMutationRequestDestinationTokenEnum, createSwapQuoteMutationRequestSourceChainEnum, createSwapQuoteMutationRequestSourceTokenEnum, createSwapQuoteMutationRequestTradeTypeEnum, createVirtualAccount, createVirtualAccountMutationRequestChainEnum, createVirtualAccountMutationRequestCurrencyEnum, createVirtualAccountMutationRequestDestinationTokenEnum, dataCurrencyEnum, dataStatusEnum, disconnectExchange, disconnectExchangePathParamsExchangeEnum, executeExchangeWithdrawal, executeExchangeWithdrawal200StatusEnum, executeExchangeWithdrawalPathParamsExchangeEnum, getBalance, getBalancePathParamsTokenEnum, getBalances, getBlinkConfig, getCardConfig, getCardCustomer, getCardOrder, getCardOrder200ChainEnum, getCardOrder200StatusEnum, getCardQuote, getCashAppOrder, getCashAppOrder200StatusEnum, getExchange, getExchangeAssets, getExchangeAssetsPathParamsExchangeEnum, getExchangePathParamsExchangeEnum, getExchangeWithdrawal, getExchangeWithdrawal200StatusEnum, getExchangeWithdrawalPathParamsExchangeEnum, getFxRates, getIdentityVerificationLink, getStripeConfig, getStripeCustomerStatus, getStripeOrder, getStripeOrder200StatusEnum, getStripeQuote, getStripeStatus, getTermsOfServiceLink, getWallet, getWallet200IdentityVerificationStatusEnum, listCryptoDeposits, listStripePaymentTokens, listStripeWallets, listVirtualAccounts, processorEnvEnum, refreshSession, registerWallet, submitIdentityVerification, submitTermsOfService, updateVirtualAccount, updateVirtualAccountMutationRequestChainEnum, updateVirtualAccountMutationRequestDestinationTokenEnum };