@cosmosapp/pay_sdk 2.2.0 → 2.3.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.
@@ -455,18 +455,66 @@ interface ProductData {
455
455
  createdAt: string;
456
456
  updatedAt: string;
457
457
  }
458
+ /** The chains a customer's wallet can be on: the chains payments settle on. */
459
+ type CustomerWalletChain = 'stellar' | 'solana' | 'monad';
460
+ /**
461
+ * Body for `POST /v1/customers/:id/wallets`, and one entry of
462
+ * {@link CreateCustomerOptions.wallets}: one wallet of a customer, the chain it
463
+ * is on and its address there.
464
+ */
465
+ interface AddCustomerWalletOptions {
466
+ /** The chain the wallet is on. */
467
+ chain: CustomerWalletChain;
468
+ /**
469
+ * The address on that chain: a Stellar account (G..., checksum verified), a
470
+ * Solana address (base58, 32 bytes) or a Monad address (0x + 40 hex, any case;
471
+ * stored EIP-55 checksummed). Payment intents whose payer (`source`) is this
472
+ * address count toward the customer.
473
+ */
474
+ address: string;
475
+ /** A name for the wallet, shown beside the address. */
476
+ label?: string;
477
+ }
458
478
  /** Body for `POST /v1/customers`. */
459
479
  interface CreateCustomerOptions {
460
480
  name: string;
461
481
  alias?: string;
462
482
  note?: string;
463
483
  email?: string;
464
- /** Optional Stellar account to associate the customer with. */
484
+ /**
485
+ * The customer's wallets, on any chain payments settle on, up to 20. Payment
486
+ * intents paid from any of them count toward the customer. A wallet that
487
+ * another of your customers already holds answers `409 customer_wallet_taken`.
488
+ */
489
+ wallets?: AddCustomerWalletOptions[];
490
+ /**
491
+ * @deprecated Use `wallets`. One wallet, its chain read from its shape (a
492
+ * Stellar, Solana or Monad address); it is added to `wallets`.
493
+ */
465
494
  account?: string;
466
495
  reference?: string;
467
496
  }
468
- /** Body for `PATCH /v1/customers/:id`. */
469
- type UpdateCustomerOptions = Partial<CreateCustomerOptions>;
497
+ /** Body for `PATCH /v1/customers/:id`. Wallets change through their own routes. */
498
+ type UpdateCustomerOptions = Partial<Omit<CreateCustomerOptions, 'wallets'>>;
499
+ /** A wallet of a customer, on one chain, as the API returns it. */
500
+ interface CustomerWalletData {
501
+ /** Wallet id, used to remove it from the customer. */
502
+ id: string;
503
+ chain: CustomerWalletChain;
504
+ /** The address, in its chain's stored spelling (EIP-55 on Monad). */
505
+ address: string;
506
+ /** A name for the wallet; null when none was given. */
507
+ label?: string | null;
508
+ /** When the wallet was added (ISO 8601). */
509
+ createdAt: string;
510
+ }
511
+ /** Confirmation that a wallet was removed from a customer. */
512
+ interface CustomerWalletDeletedData {
513
+ /** Id of the removed wallet. */
514
+ id: string;
515
+ /** Always true. */
516
+ deleted: boolean;
517
+ }
470
518
  /**
471
519
  * Raw customer payload.
472
520
  *
@@ -480,6 +528,9 @@ interface CustomerData {
480
528
  alias: string | null;
481
529
  note: string | null;
482
530
  email: string | null;
531
+ /** The customer's wallets, oldest first, on any chain payments settle on. */
532
+ wallets: CustomerWalletData[];
533
+ /** @deprecated Read `wallets`. The first wallet's address; null without wallets. */
483
534
  account: string | null;
484
535
  reference: string | null;
485
536
  createdAt: string;
@@ -579,6 +630,192 @@ interface WebhookLogsData {
579
630
  data: WebhookLogRow[];
580
631
  total: number;
581
632
  }
633
+ /**
634
+ * How `GET /v1/summary/series` groups its buckets (UTC, weeks from Monday):
635
+ * `day` is 30 days, `week` 12 weeks, `month` 12 months and `year` 5 years.
636
+ */
637
+ type AnalyticsSeriesPeriod = 'day' | 'week' | 'month' | 'year';
638
+ /** Query for `GET /v1/summary/series`. */
639
+ interface AnalyticsSeriesOptions {
640
+ /** The bucket size; the server's default is `day`. */
641
+ period?: AnalyticsSeriesPeriod;
642
+ }
643
+ /** Payment intents created in one bucket of the series. */
644
+ interface AnalyticsSeriesBucket {
645
+ /** The first day of the bucket (UTC; weeks start on Monday), e.g. `2026-10-01`. */
646
+ start: string;
647
+ /** Payments created in the bucket, any status. */
648
+ count: number;
649
+ /** Of those, the ones settled (status `SUCCEEDED`). */
650
+ succeeded: number;
651
+ /** Failed, cancelled or expired. */
652
+ failed: number;
653
+ /** Settled volume, every asset added, as a decimal string. */
654
+ volume: string;
655
+ /**
656
+ * Settled volume in USD with two decimals, at NEAR Intents' current reference
657
+ * price for each asset (indicative, today's price). Null only when the bucket
658
+ * has settled payments and those prices could not be read.
659
+ */
660
+ volumeUsd: string | null;
661
+ }
662
+ /** Payment intent totals for a whole window of the series. */
663
+ interface AnalyticsSeriesWindow {
664
+ /** Payment intents created in the window, any status. */
665
+ count: number;
666
+ succeeded: number;
667
+ /** Failed, cancelled or expired. */
668
+ failed: number;
669
+ /** Settled amount, every asset added, as a decimal string. */
670
+ volume: string;
671
+ /** Settled amount in USD (indicative); null when prices could not be read. */
672
+ volumeUsd: string | null;
673
+ /** Settled payments `volumeUsd` leaves out because their asset has no USD price. */
674
+ unpriced: number;
675
+ }
676
+ /** {@link AnalyticsSeriesWindow} for the window the buckets cover, plus its distinct payers. */
677
+ interface AnalyticsSeriesTotals extends AnalyticsSeriesWindow {
678
+ /** Distinct paying accounts in the window. */
679
+ payers: number;
680
+ }
681
+ /** Swaps or liquidity operations by outcome, for a bucket or a window. */
682
+ interface AnalyticsSeriesOutcomeCounts {
683
+ /** Created in the bucket or window, any status. */
684
+ count: number;
685
+ /** Of those, the ones that succeeded (for a USDT0 transfer, delivered). */
686
+ succeeded: number;
687
+ /** Given up on: failed or expired (and, for a cross-chain swap, refunded). */
688
+ failed: number;
689
+ }
690
+ /** Swaps of every kind created in one bucket, with the USD value of the completed ones. */
691
+ interface AnalyticsSeriesSwapBucket extends AnalyticsSeriesOutcomeCounts {
692
+ /** The first day of the bucket, the same as the payments bucket at that index. */
693
+ start: string;
694
+ /** What the completed swaps sold, in USD (indicative); null when no price could be read. */
695
+ volumeUsd: string | null;
696
+ }
697
+ /** A window's swaps split by kind, any status. */
698
+ interface AnalyticsSeriesSwapsByKind {
699
+ /** Stellar DEX swaps. */
700
+ dex: number;
701
+ /** Solana (Jupiter) and Monad (Kuru Flow) swaps. Mainnet only. */
702
+ chain: number;
703
+ /** Swaps between networks through NEAR Intents. Mainnet only. */
704
+ crossChain: number;
705
+ /** USDT0 sent from Stellar to an EVM network through LayerZero. Mainnet only. */
706
+ usdt0: number;
707
+ }
708
+ /** Swap totals for the window the buckets cover. */
709
+ interface AnalyticsSeriesSwapTotals extends AnalyticsSeriesOutcomeCounts {
710
+ /** Not final yet: unsigned, submitted, or a cross-chain swap awaiting or processing its deposit. */
711
+ inProgress: number;
712
+ byKind: AnalyticsSeriesSwapsByKind;
713
+ /** What the completed swaps sold, in USD (indicative); null when no price could be read. */
714
+ volumeUsd: string | null;
715
+ /** Completed swaps whose sold asset has no USD price, left out of `volumeUsd`. */
716
+ unpriced: number;
717
+ }
718
+ /** Swap totals for the window of the same length just before the current one. */
719
+ interface AnalyticsSeriesSwapPrevious extends AnalyticsSeriesOutcomeCounts {
720
+ volumeUsd: string | null;
721
+ }
722
+ /**
723
+ * Swaps of every kind (Stellar DEX, Solana and Monad, cross-chain, USDT0) on the
724
+ * key's network. A sandbox key counts no Solana, Monad, cross-chain swap or USDT0
725
+ * transfer, which run on mainnet only.
726
+ */
727
+ interface AnalyticsSeriesSwaps {
728
+ buckets: AnalyticsSeriesSwapBucket[];
729
+ totals: AnalyticsSeriesSwapTotals;
730
+ previous: AnalyticsSeriesSwapPrevious;
731
+ }
732
+ /** Liquidity pool deposits and withdrawals created in one bucket. */
733
+ interface AnalyticsSeriesLiquidityBucket extends AnalyticsSeriesOutcomeCounts {
734
+ start: string;
735
+ }
736
+ /** Liquidity pool operations on the key's network. */
737
+ interface AnalyticsSeriesLiquidity {
738
+ buckets: AnalyticsSeriesLiquidityBucket[];
739
+ totals: AnalyticsSeriesOutcomeCounts;
740
+ previous: AnalyticsSeriesOutcomeCounts;
741
+ }
742
+ /** Webhook deliveries created in one bucket. */
743
+ interface AnalyticsSeriesWebhookBucket {
744
+ start: string;
745
+ /** Deliveries created in the bucket, any status. */
746
+ deliveries: number;
747
+ /** Of those, the ones whose last attempt failed. */
748
+ failed: number;
749
+ }
750
+ /** Webhook deliveries created in a window. */
751
+ interface AnalyticsSeriesWebhookCounts {
752
+ deliveries: number;
753
+ failed: number;
754
+ }
755
+ /** Webhook deliveries to the consumer's endpoints (not scoped by network). */
756
+ interface AnalyticsSeriesWebhooks {
757
+ buckets: AnalyticsSeriesWebhookBucket[];
758
+ totals: AnalyticsSeriesWebhookCounts;
759
+ previous: AnalyticsSeriesWebhookCounts;
760
+ }
761
+ /** Private payments created in one bucket, amounts in XLM. */
762
+ interface AnalyticsSeriesPrivatePaymentBucket {
763
+ start: string;
764
+ /** Private payments created in the bucket, any status. */
765
+ count: number;
766
+ /** Settled: both transfers confirmed. */
767
+ succeeded: number;
768
+ /** Past their deadline without settling. */
769
+ expired: number;
770
+ /** Settled amount in XLM, what the payers paid (the commission included). */
771
+ volume: string;
772
+ /** Settled amount in USD (indicative); null when prices could not be read. */
773
+ volumeUsd: string | null;
774
+ }
775
+ /** Private payment totals for a window, amounts in XLM. */
776
+ interface AnalyticsSeriesPrivatePaymentWindow {
777
+ count: number;
778
+ succeeded: number;
779
+ expired: number;
780
+ /** Settled amount in XLM, the commission included. */
781
+ volume: string;
782
+ volumeUsd: string | null;
783
+ /** Commission the settled payments paid to Cosmos Pay, in XLM (0.18% of each). */
784
+ fees: string;
785
+ /** The commission in USD (indicative); null when prices could not be read. */
786
+ feesUsd: string | null;
787
+ }
788
+ /**
789
+ * Private payments on the key's network. They run on testnet only for now, so a
790
+ * production key counts none.
791
+ */
792
+ interface AnalyticsSeriesPrivatePayments {
793
+ buckets: AnalyticsSeriesPrivatePaymentBucket[];
794
+ totals: AnalyticsSeriesPrivatePaymentWindow;
795
+ previous: AnalyticsSeriesPrivatePaymentWindow;
796
+ }
797
+ /**
798
+ * Raw activity series returned by `GET /v1/summary/series`: payments, swaps,
799
+ * liquidity operations, webhook deliveries and private payments, each grouped
800
+ * into the UTC buckets of `period`, with the totals of the window and of the
801
+ * window before (for growth). Every `buckets` array is oldest first and
802
+ * pre-seeded, so a quiet bucket is a zero.
803
+ */
804
+ interface AnalyticsSeriesData {
805
+ /** How the buckets are grouped, as requested (`day` when omitted). */
806
+ period: AnalyticsSeriesPeriod;
807
+ /** Payment intents per bucket. */
808
+ buckets: AnalyticsSeriesBucket[];
809
+ /** Payment intent totals for the window the buckets cover. */
810
+ totals: AnalyticsSeriesTotals;
811
+ /** The window of the same length just before it. */
812
+ previous: AnalyticsSeriesWindow;
813
+ swaps: AnalyticsSeriesSwaps;
814
+ liquidity: AnalyticsSeriesLiquidity;
815
+ webhooks: AnalyticsSeriesWebhooks;
816
+ /** Private payments (the API names this field after its `/v1/zk-payments` route). */
817
+ zkPayments: AnalyticsSeriesPrivatePayments;
818
+ }
582
819
  interface HealthCheckData {
583
820
  status: string;
584
821
  info?: Record<string, {
@@ -1915,6 +2152,414 @@ interface DefindexWithdrawOptions {
1915
2152
  caller: string;
1916
2153
  slippageBps?: number;
1917
2154
  }
2155
+ /**
2156
+ * A merchant fee to charge on an operation: a percentage, a fixed amount or
2157
+ * both, paid on-chain to `wallet`. At least one of `bps` and `fixed` must be
2158
+ * above zero.
2159
+ */
2160
+ interface MerchantFeeOptions {
2161
+ /** The percentage part, in basis points (150 = 1.5%), at most 1000 (10%). Taken from `amount`, rounded down. */
2162
+ bps?: number;
2163
+ /** The fixed part, in the operation's asset, as a decimal with at most that asset's decimals. */
2164
+ fixed?: string;
2165
+ /** Where the fee is paid: an account on the chain the fee travels on. */
2166
+ wallet: string;
2167
+ /**
2168
+ * `recipient` (the default): deducted from `amount`, so the receiver gets less.
2169
+ * `payer`: added on top, so the payer sends `amount` plus the fee.
2170
+ */
2171
+ paidBy?: 'recipient' | 'payer';
2172
+ }
2173
+ /** The merchant fee an operation charged, as its record stores it. */
2174
+ interface MerchantFeeData {
2175
+ /** The percentage part, in basis points. */
2176
+ bps: number;
2177
+ /** The fixed part, in `asset`. */
2178
+ fixed: string;
2179
+ /** The fee charged: the percentage of `amount` plus the fixed part. */
2180
+ amount: string;
2181
+ /** The asset the fee is paid in. */
2182
+ asset: string;
2183
+ /** Where the fee is paid. */
2184
+ wallet: string;
2185
+ paidBy: 'recipient' | 'payer';
2186
+ }
2187
+ /**
2188
+ * Where a private payment stands, as it reads now: a `PENDING` payment past
2189
+ * `expiresAt` reads `EXPIRED`, and can still settle with transfers that closed
2190
+ * in time.
2191
+ */
2192
+ declare const PrivatePaymentStatus: {
2193
+ readonly Pending: "PENDING";
2194
+ readonly Succeeded: "SUCCEEDED";
2195
+ readonly Expired: "EXPIRED";
2196
+ };
2197
+ type PrivatePaymentStatus = (typeof PrivatePaymentStatus)[keyof typeof PrivatePaymentStatus];
2198
+ /** The Stellar network a private payment is on, set by the API key. */
2199
+ type PrivatePaymentNetwork = 'public' | 'testnet';
2200
+ /** Body for `POST /v1/zk-payments`. */
2201
+ interface CreatePrivatePaymentOptions {
2202
+ /**
2203
+ * What the payer pays in total, in XLM (up to 7 decimal places). The merchant
2204
+ * receives it minus the 0.18% commission (`netAmount`); the commission
2205
+ * (`feeAmount`, rounded up, at least one stroop) goes to Cosmos Pay's fee
2206
+ * account. An amount whose net would be zero is refused.
2207
+ */
2208
+ amount: string;
2209
+ /**
2210
+ * The merchant's Stellar account (G...). It must already hold a confidential
2211
+ * account on Cosmos Pay's token, registered under auditor id 0; otherwise the
2212
+ * payment is refused with `recipient_not_registered`.
2213
+ */
2214
+ recipient: string;
2215
+ /**
2216
+ * Shown to the payer by the checkout (max 280 characters). Not secret and not
2217
+ * on-chain: the public read returns it to anyone holding the payment id.
2218
+ */
2219
+ description?: string;
2220
+ /** How long the payment stays payable, in minutes (1 to 10080; the server's default is 60). */
2221
+ expiresInMinutes?: number;
2222
+ /**
2223
+ * Idempotency key (max 255 characters), sent as the `Idempotency-Key` header
2224
+ * and in the body. A retry with the same key and request returns the existing
2225
+ * payment; the same key with a different request is `409 idempotency_conflict`.
2226
+ */
2227
+ idempotencyKey?: string;
2228
+ /**
2229
+ * Your own fee on this payment, in XLM, paid privately by a third confidential
2230
+ * transfer to `wallet`, which must already hold a confidential account on the
2231
+ * token (under auditor id 0) and be neither the recipient nor the fee account.
2232
+ */
2233
+ merchantFee?: MerchantFeeOptions;
2234
+ }
2235
+ /** Query for `GET /v1/zk-payments`. */
2236
+ interface ListPrivatePaymentsOptions {
2237
+ /** Only payments in this status, as it reads now. */
2238
+ status?: PrivatePaymentStatus;
2239
+ /** Page size (1 to 100, default 20). */
2240
+ take?: number;
2241
+ /** Offset (default 0). */
2242
+ skip?: number;
2243
+ }
2244
+ /** Raw private payment, as its owner (the merchant's API key) reads it. */
2245
+ interface PrivatePaymentData {
2246
+ /** The private payment id (a cuid). */
2247
+ id: string;
2248
+ status: PrivatePaymentStatus;
2249
+ network: PrivatePaymentNetwork;
2250
+ /** The confidential token every transfer must be made on. */
2251
+ tokenContract: string;
2252
+ /** What the payer pays in total, in XLM: `netAmount + feeAmount`, plus `merchantFee.amount` when there is one. */
2253
+ amount: string;
2254
+ /** What the merchant receives: `amount - feeAmount`, less `merchantFee.amount` when there is one. */
2255
+ netAmount: string;
2256
+ /** The commission: `ceil(amount * feeBps / 10000)` in stroops, at least one. */
2257
+ feeAmount: string;
2258
+ /** The commission rate the payment was priced at, in basis points. */
2259
+ feeBps: number;
2260
+ /** The merchant (G...). */
2261
+ recipient: string;
2262
+ /** Cosmos Pay's account the commission (`feeAmount`) is paid to. */
2263
+ feeAccount: string;
2264
+ /** The account the transfers came from, once settled. */
2265
+ payer: string | null;
2266
+ /** The transaction of the transfer that paid `netAmount` to the recipient, once settled. */
2267
+ paymentTxHash: string | null;
2268
+ /** The transaction of the transfer that paid `feeAmount` to the fee account, once settled. */
2269
+ feeTxHash: string | null;
2270
+ /** The merchant fee the request named; null without one. */
2271
+ merchantFee: MerchantFeeData | null;
2272
+ /** The merchant fee's transaction, once settled. */
2273
+ merchantFeeTxHash: string | null;
2274
+ /** The description given at create; null when none was given. */
2275
+ description: string | null;
2276
+ /** The idempotency key of the create: the one sent, or a generated `zkp_...` key. */
2277
+ idempotencyKey: string;
2278
+ /** When the payment stops being payable. Every transfer must close before it. */
2279
+ expiresAt: string;
2280
+ /** When the later of the transfers closed, once settled. */
2281
+ settledAt: string | null;
2282
+ createdAt: string;
2283
+ updatedAt: string;
2284
+ }
2285
+ /** Raw paginated list of private payments, newest first. */
2286
+ interface PrivatePaymentListData {
2287
+ data: PrivatePaymentData[];
2288
+ total: number;
2289
+ take: number;
2290
+ skip: number;
2291
+ }
2292
+ /** Cosmos Pay's confidential token on one network. */
2293
+ interface PrivatePaymentTokenData {
2294
+ /** The confidential token contract (C...). */
2295
+ contractId: string;
2296
+ /** What it wraps: native XLM. */
2297
+ symbol: string;
2298
+ /** Decimal places of the token's amounts (7, as for XLM). */
2299
+ decimals: number;
2300
+ /** Native XLM's Stellar Asset Contract on this network. */
2301
+ underlying: string;
2302
+ /** The ledger the token was deployed at: where a wallet replays its confidential balance from. */
2303
+ deployedAtLedger: number;
2304
+ }
2305
+ /**
2306
+ * Raw private payments setup of the API key's network (`GET /v1/zk-payments/config`):
2307
+ * the token, registries, auditor id, commission and fee account a wallet
2308
+ * registers, proves and pays against. Everything in it is public on-chain data
2309
+ * or a public URL.
2310
+ */
2311
+ interface PrivatePaymentsConfigData {
2312
+ /**
2313
+ * Whether private payments run on this network. False where they do not run
2314
+ * yet (mainnet today); every other field but `network`, `networkPassphrase`,
2315
+ * `auditorId` and `feeBps` is then null.
2316
+ */
2317
+ enabled: boolean;
2318
+ network: PrivatePaymentNetwork;
2319
+ /** The Soroban RPC to build and submit transactions through. */
2320
+ rpcUrl: string | null;
2321
+ /** The Stellar network passphrase of `network`. */
2322
+ networkPassphrase: string;
2323
+ /** Cosmos Pay's confidential token on this network; null when `enabled` is false. */
2324
+ token: PrivatePaymentTokenData | null;
2325
+ /** The UltraHonk verifier registry the token checks proofs with. */
2326
+ verifier: string | null;
2327
+ /** The auditor registry holding Cosmos Pay's key. */
2328
+ auditorRegistry: string | null;
2329
+ /** The auditor id every account on the token registers under. */
2330
+ auditorId: number;
2331
+ /** The commission, in basis points (18 = 0.18%). */
2332
+ feeBps: number;
2333
+ /** Cosmos Pay's account the commission is transferred to. */
2334
+ feeAccount: string | null;
2335
+ }
2336
+ /** Where a USDT0 transfer stands. DELIVERED, FAILED and EXPIRED are final. */
2337
+ declare const Usdt0TransferStatus: {
2338
+ /** Built, waiting for the signature. */
2339
+ readonly Pending: "PENDING";
2340
+ /** On the Stellar ledger; LayerZero is delivering it. */
2341
+ readonly Submitted: "SUBMITTED";
2342
+ /** Credited on the destination network. */
2343
+ readonly Delivered: "DELIVERED";
2344
+ /** The Stellar transaction failed, or LayerZero gave up on the message. */
2345
+ readonly Failed: "FAILED";
2346
+ /** Never reached the ledger before `expiresAt`. */
2347
+ readonly Expired: "EXPIRED";
2348
+ };
2349
+ type Usdt0TransferStatus = (typeof Usdt0TransferStatus)[keyof typeof Usdt0TransferStatus];
2350
+ /**
2351
+ * A network USDT0 can be sent to from Stellar (`GET /v1/usdt0/routes`). `eth`
2352
+ * receives native USDT; every other network receives USDT0.
2353
+ */
2354
+ type Usdt0Destination = 'eth' | 'arb' | 'bera' | 'conflux' | 'flare' | 'hedera' | 'hyperevm' | 'ink' | 'mantle' | 'megaeth' | 'monad' | 'morph' | 'op' | 'plasma' | 'pol' | 'rootstock' | 'sei' | 'stable' | 'tempo' | 'unichain' | 'xlayer';
2355
+ /** What arrives: native `USDT` on Ethereum, `USDT0` everywhere else. */
2356
+ type Usdt0Receives = 'USDT' | 'USDT0';
2357
+ /** Body for `POST /v1/usdt0/quote`. Nothing is persisted. */
2358
+ interface QuoteUsdt0Options {
2359
+ /** The destination network. */
2360
+ to: Usdt0Destination;
2361
+ /**
2362
+ * USDT0 to send, decimal with up to 7 places. The OFT carries 6: a 7th decimal
2363
+ * is dust that stays in the account.
2364
+ */
2365
+ amount: string;
2366
+ /** The account the quote is simulated as. Omitted, a fixed mainnet account is used; the price is the same. */
2367
+ source?: string;
2368
+ }
2369
+ /** Body for `POST /v1/usdt0/transfers`. */
2370
+ interface CreateUsdt0TransferOptions {
2371
+ /** The Stellar account that holds the USDT0, signs the transaction and pays its fees in XLM. */
2372
+ source: string;
2373
+ /** The destination network. */
2374
+ to: Usdt0Destination;
2375
+ /** The EVM address credited on the destination network (0x + 40 hex; a mixed-case one must be valid EIP-55). */
2376
+ recipient: string;
2377
+ /** USDT0 to send, decimal with up to 7 places (a 7th decimal is dust that stays in the account). */
2378
+ amount: string;
2379
+ /**
2380
+ * Idempotency key, sent as the `Idempotency-Key` header and in the body. A retry
2381
+ * with the same key and request returns the stored transfer; the same key with a
2382
+ * different request is `409 idempotency_conflict`.
2383
+ */
2384
+ idempotencyKey?: string;
2385
+ /**
2386
+ * Your own fee on this transfer, in USDT0, paid to `wallet` (a Stellar account
2387
+ * that trusts USDT0) in the same transaction. Needs a deployment with the fee
2388
+ * wrapper configured; otherwise `400 merchant_fee_unsupported`.
2389
+ */
2390
+ merchantFee?: MerchantFeeOptions;
2391
+ }
2392
+ /** Query for `GET /v1/usdt0/transfers`. */
2393
+ interface ListUsdt0TransfersOptions {
2394
+ /** Only transfers in this status, as last refreshed. */
2395
+ status?: Usdt0TransferStatus;
2396
+ /** Page size (max 100, default 20). */
2397
+ take?: number;
2398
+ /** Offset (default 0). */
2399
+ skip?: number;
2400
+ }
2401
+ /** Body for `POST /v1/usdt0/transfers/:id/submit`. */
2402
+ interface SubmitUsdt0TransferOptions {
2403
+ /** The signed transaction envelope (base64 XDR): the one the API built, carrying a signature. */
2404
+ signedXdr: string;
2405
+ }
2406
+ /**
2407
+ * Sent as `X-Record-Token` on the read and submit of one transfer. Required only
2408
+ * when the client uses the shared public key: it is the `publicToken` the create
2409
+ * returned. Every other key ignores it.
2410
+ */
2411
+ interface Usdt0RecordTokenOptions {
2412
+ recordToken?: string;
2413
+ }
2414
+ /** Raw USDT0 quote: what is sent and arrives, the fees and the OFT's limits. */
2415
+ interface Usdt0QuoteData {
2416
+ to: Usdt0Destination;
2417
+ /** The destination network's LayerZero endpoint id. */
2418
+ eid: number;
2419
+ receives: Usdt0Receives;
2420
+ /** The amount asked for. */
2421
+ amount: string;
2422
+ /** Cosmos Pay's plan commission rate, in basis points (0 when the deployment has no fee wrapper). */
2423
+ feeBps: number;
2424
+ /** The commission in USDT0, out of `amount`, rounded down. */
2425
+ feeAmount: string;
2426
+ /** What the OFT takes from the account: `amount` without its dust. */
2427
+ amountSent: string;
2428
+ /** What arrives on the destination network. */
2429
+ amountReceived: string;
2430
+ /** The 7th decimal the OFT cannot carry; it stays in the account. */
2431
+ dust: string;
2432
+ /** LayerZero's messaging fee, in XLM, paid on top of the USDT0. */
2433
+ nativeFee: string;
2434
+ /** What a transfer built now would offer LayerZero, in XLM (`nativeFee` plus 20%, the excess refunded). */
2435
+ nativeFeeLimit: string;
2436
+ /** The smallest amount the OFT accepts, in USDT0. */
2437
+ minAmount: string;
2438
+ /** The largest amount the OFT accepts, in USDT0. */
2439
+ maxAmount: string;
2440
+ }
2441
+ /** Raw USDT0 transfer from Stellar to an EVM network. */
2442
+ interface Usdt0TransferData {
2443
+ /** The transfer's id, used by the read and submit routes. */
2444
+ id: string;
2445
+ status: Usdt0TransferStatus;
2446
+ /** Always mainnet (`public`). */
2447
+ network: string;
2448
+ /** The Stellar account that holds the USDT0, signs the transaction and pays its fees in XLM. */
2449
+ source: string;
2450
+ to: Usdt0Destination;
2451
+ /** The destination network's LayerZero endpoint id. */
2452
+ eid: number;
2453
+ receives: Usdt0Receives;
2454
+ /** The EVM address credited, EIP-55. */
2455
+ recipient: string;
2456
+ /** The amount asked for. */
2457
+ amount: string;
2458
+ /** What the OFT takes from the account: `amount` without its dust. */
2459
+ amountSent: string;
2460
+ /** What arrives, and the on-chain floor: the transaction fails rather than deliver less. */
2461
+ amountReceived: string;
2462
+ /** The dust left in the account (`amount` - `amountSent`). */
2463
+ dust: string;
2464
+ /** LayerZero's quoted messaging fee, in XLM. */
2465
+ nativeFee: string;
2466
+ /** What the transaction offers LayerZero, in XLM: `nativeFee` plus a 20% buffer, the rest refunded. */
2467
+ nativeFeeLimit: string;
2468
+ /** The Stellar network fee, in XLM. */
2469
+ networkFee: string;
2470
+ /** Cosmos Pay's plan commission rate, in basis points. */
2471
+ feeBps: number;
2472
+ /** The commission in USDT0, out of `amount`. */
2473
+ feeAmount: string;
2474
+ /** Where the commission went; null without one. */
2475
+ feeWallet: string | null;
2476
+ /** The unsigned transaction (base64 XDR) to sign. */
2477
+ xdr: string;
2478
+ /** A SEP-7 `tx` link carrying `xdr`. */
2479
+ uri: string;
2480
+ /**
2481
+ * A QR of `uri` as a PNG data URL, or null when the transaction is too large for
2482
+ * one (a Soroban transaction usually is). Absent from list rows.
2483
+ */
2484
+ qr?: string | null;
2485
+ /** The Stellar transaction hash once it reached the network; null while PENDING or EXPIRED. */
2486
+ txHash: string | null;
2487
+ /** LayerZero's message id (0x + 64 hex), once the transaction landed. */
2488
+ guid: string | null;
2489
+ /** The destination network's transaction, once DELIVERED. */
2490
+ destinationTxHash: string | null;
2491
+ /** LayerZero Scan's own status word, verbatim (`INFLIGHT`, `CONFIRMING`, `DELIVERED`, ...). */
2492
+ scanStatus: string | null;
2493
+ /** The transaction on LayerZero Scan, once it reached the network. */
2494
+ scanUrl: string | null;
2495
+ /** Why a FAILED transfer failed. */
2496
+ failureReason: string | null;
2497
+ /** The merchant fee the request named, in USDT0; null without one. */
2498
+ merchantFee: MerchantFeeData | null;
2499
+ /** The Idempotency-Key it was created with, if any. */
2500
+ idempotencyKey: string | null;
2501
+ /** When the transaction's time bounds close: submit refuses it afterwards. */
2502
+ expiresAt: string;
2503
+ /** When it was first seen accepted by the network. */
2504
+ submittedAt: string | null;
2505
+ createdAt: string;
2506
+ updatedAt: string;
2507
+ /**
2508
+ * Only on the create, and only when the caller is the shared public key: this
2509
+ * record's read token, to send as `X-Record-Token` when reading or submitting it.
2510
+ */
2511
+ publicToken?: string;
2512
+ }
2513
+ /** Raw paginated list of USDT0 transfers, newest first, as last refreshed. */
2514
+ interface Usdt0TransferListData {
2515
+ data: Usdt0TransferData[];
2516
+ total: number;
2517
+ take: number;
2518
+ skip: number;
2519
+ }
2520
+ /** Raw outcome of relaying a signed USDT0 transaction. */
2521
+ interface Usdt0SubmitOutcomeData {
2522
+ /** True when the network accepted the transaction (SUBMITTED, or already DELIVERED). */
2523
+ submitted: boolean;
2524
+ /** The transfer's status after this submission. */
2525
+ status: Usdt0TransferStatus;
2526
+ /** The Stellar transaction hash, once it reached the network. */
2527
+ txHash?: string;
2528
+ /** Why it was not submitted, when `submitted` is false. */
2529
+ reason?: string | null;
2530
+ /** The transfer after this submission. */
2531
+ transfer: Usdt0TransferData;
2532
+ }
2533
+ /** USDT0 on Stellar: the classic asset and its Stellar Asset Contract. */
2534
+ interface Usdt0TokenData {
2535
+ code: string;
2536
+ issuer: string;
2537
+ contract: string;
2538
+ }
2539
+ /** One destination network USDT0 can be sent to from Stellar. */
2540
+ interface Usdt0RouteData {
2541
+ /** The id requests name this network with (`to`). */
2542
+ chain: Usdt0Destination;
2543
+ /** The network's display name. */
2544
+ name: string;
2545
+ /** LayerZero endpoint id. */
2546
+ eid: number;
2547
+ receives: Usdt0Receives;
2548
+ }
2549
+ /** Raw `GET /v1/usdt0/routes`: where USDT0 can go, with the token and OFT a transfer uses. */
2550
+ interface Usdt0RoutesData {
2551
+ /** Always `public`: USDT0 exists on Stellar mainnet only. */
2552
+ network: string;
2553
+ /** True for a prod (mainnet) key; a dev (testnet) key gets `false` and no routes. */
2554
+ available: boolean;
2555
+ token: Usdt0TokenData;
2556
+ /** The LayerZero OFT contract the transaction calls (`send`). */
2557
+ oft: string;
2558
+ /** Stellar mainnet's LayerZero endpoint id. */
2559
+ eid: number;
2560
+ /** The destination networks, Ethereum first and then by name. */
2561
+ routes: Usdt0RouteData[];
2562
+ }
1918
2563
 
1919
2564
  /**
1920
2565
  * Error thrown when the Cosmos Pay API responds with a non-2xx status.
@@ -2056,5 +2701,5 @@ interface ResolvableIntentInput {
2056
2701
  */
2057
2702
  declare function resolveIntentBody<T extends ResolvableIntentInput>(options: T, book?: AddressBook): Omit<T, 'asset'>;
2058
2703
 
2059
- export { PaymentIntentKind as aC, PaymentIntentStatus as aD, ProductKind as aO, SwapStatus as aT, CrossChainSwapStatus as am, TestnetAssets as b$, WebhookEventType as b1, WebhookDeliveryStatus as b2, AddressBook as bh, Assets as br, CosmosPayAPIError as bx, CosmosPayRequestError as by, Wallets as c1, addresses as c4, assertAddress as c5, defineAsset as c6, isAddress as c7, isContractAddress as c8, isMuxedAddress as c9, isNativeAsset as ca, isStellarAddress as cb, resolveAddress as cc, resolveAsset as cd, resolveIntentBody as ce, LiquidityOperationKind as r, LiquidityOperationStatus as s };
2060
- export type { ActivityReportData as $, AliasResolutionData as A, BrowseLiquidityPoolsOptions as B, CreateAliasChallengeOptions as C, DepositLiquidityOptions as D, ListPayinsOptions as E, CreateTrustlineOptions as F, CreateVirtualAccountOptions as G, HealthCheckData as H, CreatePayoutQuoteOptions as I, PayoutQuoteData as J, AuthorizePayoutOptions as K, ListRegistryAssetsOptions as L, AuthorizePayoutData as M, CreatePayoutOptions as N, OwnedAliasData as O, PayinQuoteData as P, PayoutData as Q, ListPayoutsOptions as R, SubmitLiquidityOptions as S, TrustlineData as T, UpdateCustomerOptions as U, VirtualAccountData as V, WebhookLogsData as W, AttachPayoutDocumentOptions as X, PayoutDocumentData as Y, ActivityEventInput as Z, ReportActivityOptions as _, AliasAvailabilityData as a, SubmitSwapOptions as a$, ListActivityOptions as a0, ActivityListData as a1, ActivitySummaryData as a2, ReceiverData as a3, UpdateReceiverOptions as a4, ApproveReceiverOptions as a5, RequestTosOptions as a6, TermsOfServiceData as a7, EnableReceiverOptions as a8, CreateReceiverWalletOptions as a9, PublicKeyData as aA, PaymentIntentData as aB, PaymentChain as aE, UpdatePaymentIntentOptions as aF, DeletedData as aG, ValidationOutcomeData as aH, CreateTxPaymentIntentOptions as aI, CreatePayPaymentIntentOptions as aJ, PaymentIntentTransitionData as aK, ListPaymentIntentsOptions as aL, ValidatePaymentIntentOptions as aM, ProductData as aN, UpdateProductOptions as aP, CreateProductOptions as aQ, ChainSwapData as aR, OtherSwapChain as aS, ChainSwapTransaction as aU, EvmCallData as aV, SwapData as aW, QuoteSwapOptions as aX, SwapQuoteData as aY, CreateSwapOptions as aZ, ListSwapsOptions as a_, ReceiverWalletData as aa, ListKycOptions as ab, CreateBankAccountOptions as ac, BankAccountData as ad, CreateReceiverOptions as ae, SetReceiverAccessOptions as af, WalletSignMessageData as ag, KycUploadData as ah, InitiateTosOptions as ai, KycRailsData as aj, BankDetailsData as ak, CrossChainSwapData as al, SwapChain as an, CrossChainTransactionData as ao, CrossChainAssetData as ap, QuoteCrossChainSwapOptions as aq, CrossChainQuoteData as ar, CreateCrossChainSwapOptions as as, ListCrossChainSwapsOptions as at, DefindexDepositOptions as au, DefindexWithdrawOptions as av, PluginData as aw, InstallPluginOptions as ax, PluginUninstalledData as ay, PluginActionResultData as az, AliasByAddressData as b, WebhookDeliveryData as b0, WebhookEndpointData as b3, WebhookEndpointWithSecretData as b4, UpdateWebhookEndpointOptions as b5, WebhookPingData as b6, ListWebhookDeliveriesOptions as b7, AnyWebhookEvent as b8, WebhookEventDataMap as b9, CurrencyType as bA, CustomerListData as bB, KycType as bC, LiquidityOperationListData as bD, LiquidityPoolListData as bE, LiquidityPositionData as bF, LiquidityReserveData as bG, LiquiditySubmitOutcomeData as bH, PayinListData as bI, PayinMethod as bJ, PayinPayerRules as bK, PaymentIntentListData as bL, PayoutChain as bM, PayoutListData as bN, PayoutNetwork as bO, PluginListData as bP, RampToken as bQ, ReceiverListData as bR, ReceiverOwner as bS, ReceiverType as bT, ReceiverWalletListData as bU, ReceiverWalletNetwork as bV, RegistryAssetData as bW, ResolvableIntentInput as bX, ResolvedAsset as bY, SwapListData as bZ, SwapSubmitOutcomeData as b_, TypedWebhookEvent as ba, CreateWebhookEndpointOptions as bb, WebhookEvent as bc, ActivityBucket as bd, ActivityEventData as be, ActivityLevel as bf, ActivitySource as bg, AddressRef as bi, AliasChallengePurpose as bj, AnalyticsBalanceEntry as bk, AnalyticsRecentRow as bl, AnalyticsSeriesPoint as bm, AnalyticsVolumeEntry as bn, ApiLogRow as bo, AssetDefinition as bp, AssetRef as bq, BankAccountListData as bs, BankRail as bt, BankingPartner as bu, ChainSwapListData as bv, ChainSwapSubmitOutcomeData as bw, CrossChainSwapListData as bz, AliasChallengeData as c, WalletId as c0, WebhookDeliveryListData as c2, WebhookLogRow as c3, ClaimAliasOptions as d, AliasListData as e, AddAliasAddressOptions as f, AliasAddressData as g, AliasDeletedData as h, AliasRecoveryStartedData as i, CompleteAliasRecoveryOptions as j, AnalyticsSummaryData as k, AnalyticsBalancesData as l, ApiLogsData as m, AssetRegistryData as n, CustomerData as o, CreateCustomerOptions as p, LiquidityOperationData as q, WithdrawLiquidityOptions as t, LiquidityPositionsData as u, LiquidityPoolData as v, ListLiquidityOperationsOptions as w, CreatePayinQuoteOptions as x, CreatePayinOptions as y, PayinData as z };
2704
+ export { PaymentIntentKind as aH, PaymentIntentStatus as aI, PrivatePaymentStatus as aT, ProductKind as a_, CrossChainSwapStatus as ar, SwapStatus as b3, AddressBook as bE, Usdt0TransferStatus as bd, WebhookEventType as bo, WebhookDeliveryStatus as bp, resolveIntentBody as c$, Assets as c4, TestnetAssets as cI, Wallets as cO, addresses as cR, assertAddress as cS, defineAsset as cT, isAddress as cU, isContractAddress as cV, isMuxedAddress as cW, isNativeAsset as cX, isStellarAddress as cY, resolveAddress as cZ, resolveAsset as c_, CosmosPayAPIError as ca, CosmosPayRequestError as cb, LiquidityOperationKind as w, LiquidityOperationStatus as x };
2705
+ export type { ListPayoutsOptions as $, AliasResolutionData as A, BrowseLiquidityPoolsOptions as B, CreateAliasChallengeOptions as C, DepositLiquidityOptions as D, LiquidityPoolData as E, ListLiquidityOperationsOptions as F, CreatePayinQuoteOptions as G, HealthCheckData as H, CreatePayinOptions as I, PayinData as J, ListPayinsOptions as K, ListRegistryAssetsOptions as L, CreateTrustlineOptions as M, CreateVirtualAccountOptions as N, OwnedAliasData as O, PayinQuoteData as P, CreatePayoutQuoteOptions as Q, PayoutQuoteData as R, SubmitLiquidityOptions as S, TrustlineData as T, UpdateCustomerOptions as U, VirtualAccountData as V, WebhookLogsData as W, AuthorizePayoutOptions as X, AuthorizePayoutData as Y, CreatePayoutOptions as Z, PayoutData as _, AliasAvailabilityData as a, UpdateProductOptions as a$, AttachPayoutDocumentOptions as a0, PayoutDocumentData as a1, ActivityEventInput as a2, ReportActivityOptions as a3, ActivityReportData as a4, ListActivityOptions as a5, ActivityListData as a6, ActivitySummaryData as a7, ReceiverData as a8, UpdateReceiverOptions as a9, DefindexWithdrawOptions as aA, PluginData as aB, InstallPluginOptions as aC, PluginUninstalledData as aD, PluginActionResultData as aE, PublicKeyData as aF, PaymentIntentData as aG, PaymentChain as aJ, UpdatePaymentIntentOptions as aK, DeletedData as aL, ValidationOutcomeData as aM, CreateTxPaymentIntentOptions as aN, CreatePayPaymentIntentOptions as aO, PaymentIntentTransitionData as aP, ListPaymentIntentsOptions as aQ, ValidatePaymentIntentOptions as aR, PrivatePaymentData as aS, PrivatePaymentNetwork as aU, MerchantFeeData as aV, CreatePrivatePaymentOptions as aW, ListPrivatePaymentsOptions as aX, PrivatePaymentsConfigData as aY, ProductData as aZ, ApproveReceiverOptions as aa, RequestTosOptions as ab, TermsOfServiceData as ac, EnableReceiverOptions as ad, CreateReceiverWalletOptions as ae, ReceiverWalletData as af, ListKycOptions as ag, CreateBankAccountOptions as ah, BankAccountData as ai, CreateReceiverOptions as aj, SetReceiverAccessOptions as ak, WalletSignMessageData as al, KycUploadData as am, InitiateTosOptions as an, KycRailsData as ao, BankDetailsData as ap, CrossChainSwapData as aq, SwapChain as as, CrossChainTransactionData as at, CrossChainAssetData as au, QuoteCrossChainSwapOptions as av, CrossChainQuoteData as aw, CreateCrossChainSwapOptions as ax, ListCrossChainSwapsOptions as ay, DefindexDepositOptions as az, AliasByAddressData as b, AnalyticsSeriesWindow as b$, CreateProductOptions as b0, ChainSwapData as b1, OtherSwapChain as b2, ChainSwapTransaction as b4, EvmCallData as b5, SwapData as b6, QuoteSwapOptions as b7, SwapQuoteData as b8, CreateSwapOptions as b9, ActivityBucket as bA, ActivityEventData as bB, ActivityLevel as bC, ActivitySource as bD, AddressRef as bF, AliasChallengePurpose as bG, AnalyticsBalanceEntry as bH, AnalyticsRecentRow as bI, AnalyticsSeriesBucket as bJ, AnalyticsSeriesLiquidity as bK, AnalyticsSeriesLiquidityBucket as bL, AnalyticsSeriesOutcomeCounts as bM, AnalyticsSeriesPeriod as bN, AnalyticsSeriesPoint as bO, AnalyticsSeriesPrivatePaymentBucket as bP, AnalyticsSeriesPrivatePaymentWindow as bQ, AnalyticsSeriesPrivatePayments as bR, AnalyticsSeriesSwapBucket as bS, AnalyticsSeriesSwapPrevious as bT, AnalyticsSeriesSwapTotals as bU, AnalyticsSeriesSwaps as bV, AnalyticsSeriesSwapsByKind as bW, AnalyticsSeriesTotals as bX, AnalyticsSeriesWebhookBucket as bY, AnalyticsSeriesWebhookCounts as bZ, AnalyticsSeriesWebhooks as b_, ListSwapsOptions as ba, SubmitSwapOptions as bb, Usdt0TransferData as bc, Usdt0Destination as be, Usdt0Receives as bf, Usdt0RoutesData as bg, QuoteUsdt0Options as bh, Usdt0QuoteData as bi, CreateUsdt0TransferOptions as bj, ListUsdt0TransfersOptions as bk, Usdt0RecordTokenOptions as bl, SubmitUsdt0TransferOptions as bm, WebhookDeliveryData as bn, WebhookEndpointData as bq, WebhookEndpointWithSecretData as br, UpdateWebhookEndpointOptions as bs, WebhookPingData as bt, ListWebhookDeliveriesOptions as bu, AnyWebhookEvent as bv, WebhookEventDataMap as bw, TypedWebhookEvent as bx, CreateWebhookEndpointOptions as by, WebhookEvent as bz, AliasChallengeData as c, AnalyticsVolumeEntry as c0, ApiLogRow as c1, AssetDefinition as c2, AssetRef as c3, BankAccountListData as c5, BankRail as c6, BankingPartner as c7, ChainSwapListData as c8, ChainSwapSubmitOutcomeData as c9, ReceiverType as cA, ReceiverWalletListData as cB, ReceiverWalletNetwork as cC, RegistryAssetData as cD, ResolvableIntentInput as cE, ResolvedAsset as cF, SwapListData as cG, SwapSubmitOutcomeData as cH, Usdt0RouteData as cJ, Usdt0SubmitOutcomeData as cK, Usdt0TokenData as cL, Usdt0TransferListData as cM, WalletId as cN, WebhookDeliveryListData as cP, WebhookLogRow as cQ, CrossChainSwapListData as cc, CurrencyType as cd, CustomerListData as ce, CustomerWalletChain as cf, KycType as cg, LiquidityOperationListData as ch, LiquidityPoolListData as ci, LiquidityPositionData as cj, LiquidityReserveData as ck, LiquiditySubmitOutcomeData as cl, MerchantFeeOptions as cm, PayinListData as cn, PayinMethod as co, PayinPayerRules as cp, PaymentIntentListData as cq, PayoutChain as cr, PayoutListData as cs, PayoutNetwork as ct, PluginListData as cu, PrivatePaymentListData as cv, PrivatePaymentTokenData as cw, RampToken as cx, ReceiverListData as cy, ReceiverOwner as cz, ClaimAliasOptions as d, AliasListData as e, AddAliasAddressOptions as f, AliasAddressData as g, AliasDeletedData as h, AliasRecoveryStartedData as i, CompleteAliasRecoveryOptions as j, AnalyticsSummaryData as k, AnalyticsSeriesOptions as l, AnalyticsSeriesData as m, AnalyticsBalancesData as n, ApiLogsData as o, AssetRegistryData as p, CustomerData as q, CustomerWalletData as r, AddCustomerWalletOptions as s, CustomerWalletDeletedData as t, CreateCustomerOptions as u, LiquidityOperationData as v, WithdrawLiquidityOptions as y, LiquidityPositionsData as z };