@cosmosapp/pay_sdk 2.2.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
- import { A as AliasResolutionData, a as AliasAvailabilityData, b as AliasByAddressData, C as CreateAliasChallengeOptions, c as AliasChallengeData, d as ClaimAliasOptions, O as OwnedAliasData, e as AliasListData, f as AddAliasAddressOptions, g as AliasAddressData, h as AliasDeletedData, i as AliasRecoveryStartedData, j as CompleteAliasRecoveryOptions, k as AnalyticsSummaryData, l as AnalyticsBalancesData, m as ApiLogsData, W as WebhookLogsData, L as ListRegistryAssetsOptions, n as AssetRegistryData, o as CustomerData, U as UpdateCustomerOptions, p as CreateCustomerOptions, H as HealthCheckData, q as LiquidityOperationData, r as LiquidityOperationKind, s as LiquidityOperationStatus, S as SubmitLiquidityOptions, D as DepositLiquidityOptions, t as WithdrawLiquidityOptions, u as LiquidityPositionsData, B as BrowseLiquidityPoolsOptions, v as LiquidityPoolData, w as ListLiquidityOperationsOptions, x as CreatePayinQuoteOptions, P as PayinQuoteData, y as CreatePayinOptions, z as PayinData, E as ListPayinsOptions, F as CreateTrustlineOptions, T as TrustlineData, G as CreateVirtualAccountOptions, V as VirtualAccountData, I as CreatePayoutQuoteOptions, J as PayoutQuoteData, K as AuthorizePayoutOptions, M as AuthorizePayoutData, N as CreatePayoutOptions, Q as PayoutData, R as ListPayoutsOptions, X as AttachPayoutDocumentOptions, Y as PayoutDocumentData, Z as ActivityEventInput, _ as ReportActivityOptions, $ as ActivityReportData, a0 as ListActivityOptions, a1 as ActivityListData, a2 as ActivitySummaryData, a3 as ReceiverData, a4 as UpdateReceiverOptions, a5 as ApproveReceiverOptions, a6 as RequestTosOptions, a7 as TermsOfServiceData, a8 as EnableReceiverOptions, a9 as CreateReceiverWalletOptions, aa as ReceiverWalletData, ab as ListKycOptions, ac as CreateBankAccountOptions, ad as BankAccountData, ae as CreateReceiverOptions, af as SetReceiverAccessOptions, ag as WalletSignMessageData, ah as KycUploadData, ai as InitiateTosOptions, aj as KycRailsData, ak as BankDetailsData, al as CrossChainSwapData, am as CrossChainSwapStatus, an as SwapChain, ao as CrossChainTransactionData, ap as CrossChainAssetData, aq as QuoteCrossChainSwapOptions, ar as CrossChainQuoteData, as as CreateCrossChainSwapOptions, at as ListCrossChainSwapsOptions, au as DefindexDepositOptions, av as DefindexWithdrawOptions, aw as PluginData, ax as InstallPluginOptions, ay as PluginUninstalledData, az as PluginActionResultData, aA as PublicKeyData, aB as PaymentIntentData, aC as PaymentIntentKind, aD as PaymentIntentStatus, aE as PaymentChain, aF as UpdatePaymentIntentOptions, aG as DeletedData, aH as ValidationOutcomeData, aI as CreateTxPaymentIntentOptions, aJ as CreatePayPaymentIntentOptions, aK as PaymentIntentTransitionData, aL as ListPaymentIntentsOptions, aM as ValidatePaymentIntentOptions, aN as ProductData, aO as ProductKind, aP as UpdateProductOptions, aQ as CreateProductOptions, aR as ChainSwapData, aS as OtherSwapChain, aT as SwapStatus, aU as ChainSwapTransaction, aV as EvmCallData, aW as SwapData, aX as QuoteSwapOptions, aY as SwapQuoteData, aZ as CreateSwapOptions, a_ as ListSwapsOptions, a$ as SubmitSwapOptions, b0 as WebhookDeliveryData, b1 as WebhookEventType, b2 as WebhookDeliveryStatus, b3 as WebhookEndpointData, b4 as WebhookEndpointWithSecretData, b5 as UpdateWebhookEndpointOptions, b6 as WebhookPingData, b7 as ListWebhookDeliveriesOptions, b8 as AnyWebhookEvent, b9 as WebhookEventDataMap, ba as TypedWebhookEvent, bb as CreateWebhookEndpointOptions, bc as WebhookEvent } from './intent-input-GiCgpAWR.cjs';
3
- export { bd as ActivityBucket, be as ActivityEventData, bf as ActivityLevel, bg as ActivitySource, bh as AddressBook, bi as AddressRef, bj as AliasChallengePurpose, bk as AnalyticsBalanceEntry, bl as AnalyticsRecentRow, bm as AnalyticsSeriesPoint, bn as AnalyticsVolumeEntry, bo as ApiLogRow, bp as AssetDefinition, bq as AssetRef, br as Assets, bs as BankAccountListData, bt as BankRail, bu as BankingPartner, bv as ChainSwapListData, bw as ChainSwapSubmitOutcomeData, bx as CosmosPayAPIError, by as CosmosPayRequestError, bz as CrossChainSwapListData, bA as CurrencyType, bB as CustomerListData, bC as KycType, bD as LiquidityOperationListData, bE as LiquidityPoolListData, bF as LiquidityPositionData, bG as LiquidityReserveData, bH as LiquiditySubmitOutcomeData, bI as PayinListData, bJ as PayinMethod, bK as PayinPayerRules, bL as PaymentIntentListData, bM as PayoutChain, bN as PayoutListData, bO as PayoutNetwork, bP as PluginListData, bQ as RampToken, bR as ReceiverListData, bS as ReceiverOwner, bT as ReceiverType, bU as ReceiverWalletListData, bV as ReceiverWalletNetwork, bW as RegistryAssetData, bX as ResolvableIntentInput, bY as ResolvedAsset, bZ as SwapListData, b_ as SwapSubmitOutcomeData, b$ as TestnetAssets, c0 as WalletId, c1 as Wallets, c2 as WebhookDeliveryListData, c3 as WebhookLogRow, c4 as addresses, c5 as assertAddress, c6 as defineAsset, c7 as isAddress, c8 as isContractAddress, c9 as isMuxedAddress, ca as isNativeAsset, cb as isStellarAddress, cc as resolveAddress, cd as resolveAsset, ce as resolveIntentBody } from './intent-input-GiCgpAWR.cjs';
2
+ import { A as AliasResolutionData, a as AliasAvailabilityData, b as AliasByAddressData, C as CreateAliasChallengeOptions, c as AliasChallengeData, d as ClaimAliasOptions, O as OwnedAliasData, e as AliasListData, f as AddAliasAddressOptions, g as AliasAddressData, h as AliasDeletedData, i as AliasRecoveryStartedData, j as CompleteAliasRecoveryOptions, k as AnalyticsSummaryData, l as AnalyticsSeriesOptions, m as AnalyticsSeriesData, n as AnalyticsBalancesData, o as ApiLogsData, W as WebhookLogsData, L as ListRegistryAssetsOptions, p as AssetRegistryData, q as CustomerData, r as CustomerWalletData, U as UpdateCustomerOptions, s as AddCustomerWalletOptions, t as CustomerWalletDeletedData, u as CreateCustomerOptions, H as HealthCheckData, v as LiquidityOperationData, w as LiquidityOperationKind, x as LiquidityOperationStatus, S as SubmitLiquidityOptions, D as DepositLiquidityOptions, y as WithdrawLiquidityOptions, z as LiquidityPositionsData, B as BrowseLiquidityPoolsOptions, E as LiquidityPoolData, F as ListLiquidityOperationsOptions, G as CreatePayinQuoteOptions, P as PayinQuoteData, I as CreatePayinOptions, J as PayinData, K as ListPayinsOptions, M as CreateTrustlineOptions, T as TrustlineData, N as CreateVirtualAccountOptions, V as VirtualAccountData, Q as CreatePayoutQuoteOptions, R as PayoutQuoteData, X as AuthorizePayoutOptions, Y as AuthorizePayoutData, Z as CreatePayoutOptions, _ as PayoutData, $ as ListPayoutsOptions, a0 as AttachPayoutDocumentOptions, a1 as PayoutDocumentData, a2 as ActivityEventInput, a3 as ReportActivityOptions, a4 as ActivityReportData, a5 as ListActivityOptions, a6 as ActivityListData, a7 as ActivitySummaryData, a8 as ReceiverData, a9 as UpdateReceiverOptions, aa as ApproveReceiverOptions, ab as RequestTosOptions, ac as TermsOfServiceData, ad as EnableReceiverOptions, ae as CreateReceiverWalletOptions, af as ReceiverWalletData, ag as ListKycOptions, ah as CreateBankAccountOptions, ai as BankAccountData, aj as CreateReceiverOptions, ak as SetReceiverAccessOptions, al as WalletSignMessageData, am as KycUploadData, an as InitiateTosOptions, ao as KycRailsData, ap as BankDetailsData, aq as CrossChainSwapData, ar as CrossChainSwapStatus, as as SwapChain, at as CrossChainTransactionData, au as CrossChainAssetData, av as QuoteCrossChainSwapOptions, aw as CrossChainQuoteData, ax as CreateCrossChainSwapOptions, ay as ListCrossChainSwapsOptions, az as DefindexDepositOptions, aA as DefindexWithdrawOptions, aB as PluginData, aC as InstallPluginOptions, aD as PluginUninstalledData, aE as PluginActionResultData, aF as PublicKeyData, aG as PaymentIntentData, aH as PaymentIntentKind, aI as PaymentIntentStatus, aJ as PaymentChain, aK as UpdatePaymentIntentOptions, aL as DeletedData, aM as ValidationOutcomeData, aN as CreateTxPaymentIntentOptions, aO as CreatePayPaymentIntentOptions, aP as PaymentIntentTransitionData, aQ as ListPaymentIntentsOptions, aR as ValidatePaymentIntentOptions, aS as PrivatePaymentData, aT as PrivatePaymentStatus, aU as PrivatePaymentNetwork, aV as MerchantFeeData, aW as CreatePrivatePaymentOptions, aX as ListPrivatePaymentsOptions, aY as PrivatePaymentsConfigData, aZ as ProductData, a_ as ProductKind, a$ as UpdateProductOptions, b0 as CreateProductOptions, b1 as ChainSwapData, b2 as OtherSwapChain, b3 as SwapStatus, b4 as ChainSwapTransaction, b5 as EvmCallData, b6 as SwapData, b7 as QuoteSwapOptions, b8 as SwapQuoteData, b9 as CreateSwapOptions, ba as ListSwapsOptions, bb as SubmitSwapOptions, bc as Usdt0TransferData, bd as Usdt0TransferStatus, be as Usdt0Destination, bf as Usdt0Receives, bg as Usdt0RoutesData, bh as QuoteUsdt0Options, bi as Usdt0QuoteData, bj as CreateUsdt0TransferOptions, bk as ListUsdt0TransfersOptions, bl as Usdt0RecordTokenOptions, bm as SubmitUsdt0TransferOptions, bn as WebhookDeliveryData, bo as WebhookEventType, bp as WebhookDeliveryStatus, bq as WebhookEndpointData, br as WebhookEndpointWithSecretData, bs as UpdateWebhookEndpointOptions, bt as WebhookPingData, bu as ListWebhookDeliveriesOptions, bv as AnyWebhookEvent, bw as WebhookEventDataMap, bx as TypedWebhookEvent, by as CreateWebhookEndpointOptions, bz as WebhookEvent } from './intent-input-CP5bkBYI.cjs';
3
+ export { bA as ActivityBucket, bB as ActivityEventData, bC as ActivityLevel, bD as ActivitySource, bE as AddressBook, bF as AddressRef, bG as AliasChallengePurpose, bH as AnalyticsBalanceEntry, bI as AnalyticsRecentRow, bJ as AnalyticsSeriesBucket, bK as AnalyticsSeriesLiquidity, bL as AnalyticsSeriesLiquidityBucket, bM as AnalyticsSeriesOutcomeCounts, bN as AnalyticsSeriesPeriod, bO as AnalyticsSeriesPoint, bP as AnalyticsSeriesPrivatePaymentBucket, bQ as AnalyticsSeriesPrivatePaymentWindow, bR as AnalyticsSeriesPrivatePayments, bS as AnalyticsSeriesSwapBucket, bT as AnalyticsSeriesSwapPrevious, bU as AnalyticsSeriesSwapTotals, bV as AnalyticsSeriesSwaps, bW as AnalyticsSeriesSwapsByKind, bX as AnalyticsSeriesTotals, bY as AnalyticsSeriesWebhookBucket, bZ as AnalyticsSeriesWebhookCounts, b_ as AnalyticsSeriesWebhooks, b$ as AnalyticsSeriesWindow, c0 as AnalyticsVolumeEntry, c1 as ApiLogRow, c2 as AssetDefinition, c3 as AssetRef, c4 as Assets, c5 as BankAccountListData, c6 as BankRail, c7 as BankingPartner, c8 as ChainSwapListData, c9 as ChainSwapSubmitOutcomeData, ca as CosmosPayAPIError, cb as CosmosPayRequestError, cc as CrossChainSwapListData, cd as CurrencyType, ce as CustomerListData, cf as CustomerWalletChain, cg as KycType, ch as LiquidityOperationListData, ci as LiquidityPoolListData, cj as LiquidityPositionData, ck as LiquidityReserveData, cl as LiquiditySubmitOutcomeData, cm as MerchantFeeOptions, cn as PayinListData, co as PayinMethod, cp as PayinPayerRules, cq as PaymentIntentListData, cr as PayoutChain, cs as PayoutListData, ct as PayoutNetwork, cu as PluginListData, cv as PrivatePaymentListData, cw as PrivatePaymentTokenData, cx as RampToken, cy as ReceiverListData, cz as ReceiverOwner, cA as ReceiverType, cB as ReceiverWalletListData, cC as ReceiverWalletNetwork, cD as RegistryAssetData, cE as ResolvableIntentInput, cF as ResolvedAsset, cG as SwapListData, cH as SwapSubmitOutcomeData, cI as TestnetAssets, cJ as Usdt0RouteData, cK as Usdt0SubmitOutcomeData, cL as Usdt0TokenData, cM as Usdt0TransferListData, cN as WalletId, cO as Wallets, cP as WebhookDeliveryListData, cQ as WebhookLogRow, cR as addresses, cS as assertAddress, cT as defineAsset, cU as isAddress, cV as isContractAddress, cW as isMuxedAddress, cX as isNativeAsset, cY as isStellarAddress, cZ as resolveAddress, c_ as resolveAsset, c$ as resolveIntentBody } from './intent-input-CP5bkBYI.cjs';
4
4
  import { IncomingMessage, ServerResponse } from 'node:http';
5
5
 
6
6
  /**
@@ -76,6 +76,13 @@ declare class AnalyticsManager {
76
76
  private get rest();
77
77
  /** Overview metrics: totals, settled volume, webhook health, 30-day series. */
78
78
  summary(): Promise<AnalyticsSummaryData>;
79
+ /**
80
+ * Activity per day, week, month or year, with the window before for growth:
81
+ * payments (with their settled volume in USD), swaps of every kind, liquidity
82
+ * operations, webhook deliveries and private payments, each in the UTC
83
+ * buckets of `period` (`day` when omitted).
84
+ */
85
+ series(options?: AnalyticsSeriesOptions): Promise<AnalyticsSeriesData>;
79
86
  /** Settled (and pending) amount per asset. */
80
87
  balances(): Promise<AnalyticsBalancesData>;
81
88
  /** Recent API requests reaching the service (with details). */
@@ -134,12 +141,17 @@ declare class Customer extends Base<CustomerData> {
134
141
  alias: string | null;
135
142
  note: string | null;
136
143
  email: string | null;
137
- /** Optional Stellar account associated with the customer. */
144
+ /**
145
+ * The customer's wallets, oldest first, on Stellar, Solana or Monad. Payments
146
+ * paid from any of them count toward the customer.
147
+ */
148
+ wallets: CustomerWalletData[];
149
+ /** @deprecated Read {@link Customer.wallets}. The first wallet's address, or null. */
138
150
  account: string | null;
139
151
  reference: string | null;
140
152
  createdAt: Date;
141
153
  updatedAt: Date;
142
- /** Number of payment intents from this customer's account (list view only). */
154
+ /** Number of payment intents from this customer's wallets (list view only). */
143
155
  payments: number | null;
144
156
  /** Number of succeeded payments (list view only). */
145
157
  succeeded: number | null;
@@ -156,6 +168,15 @@ declare class Customer extends Base<CustomerData> {
156
168
  id: string;
157
169
  deleted: boolean;
158
170
  }>;
171
+ /**
172
+ * Add a wallet to this customer and to {@link Customer.wallets}. A wallet the
173
+ * customer already holds answers as it is.
174
+ */
175
+ addWallet(options: AddCustomerWalletOptions): Promise<CustomerWalletData>;
176
+ /** Remove one of this customer's wallets, by id or as read from {@link Customer.wallets}. */
177
+ removeWallet(wallet: string | CustomerWalletData): Promise<CustomerWalletDeletedData>;
178
+ /** `account` is the first wallet's address, as the API derives it. */
179
+ private syncAccount;
159
180
  toJSON(): CustomerData;
160
181
  }
161
182
 
@@ -277,7 +298,9 @@ type CustomerDeletedData = {
277
298
  * @example
278
299
  * const customer = await client.customers.create({
279
300
  * name: 'Acme Inc.', email: 'billing@acme.com',
301
+ * wallets: [{ chain: 'stellar', address: 'G...' }],
280
302
  * });
303
+ * await customer.addWallet({ chain: 'solana', address: '7EcD...', label: 'Phantom' });
281
304
  */
282
305
  declare class CustomerManager extends BaseManager<Customer> {
283
306
  private readonly route;
@@ -291,6 +314,19 @@ declare class CustomerManager extends BaseManager<Customer> {
291
314
  update(id: string, options: UpdateCustomerOptions): Promise<Customer>;
292
315
  /** Delete a customer. */
293
316
  delete(id: string): Promise<CustomerDeletedData>;
317
+ /**
318
+ * Add a wallet to a customer, on Stellar, Solana or Monad (up to 20 per
319
+ * customer); payments paid from it count toward the customer. A wallet the
320
+ * customer already holds answers as it is; one another of your customers holds
321
+ * is `409 customer_wallet_taken`.
322
+ */
323
+ addWallet(customerId: string, options: AddCustomerWalletOptions): Promise<CustomerWalletData>;
324
+ /**
325
+ * Remove a wallet from a customer. Payments from that address stop counting
326
+ * toward it, and a later settled payment from it adds it as a new automatic
327
+ * customer. A `walletId` that is not one of this customer's wallets is 404.
328
+ */
329
+ removeWallet(customerId: string, walletId: string): Promise<CustomerWalletDeletedData>;
294
330
  }
295
331
 
296
332
  /**
@@ -1092,6 +1128,102 @@ declare class PaymentIntentManager extends BaseManager<PaymentIntent> {
1092
1128
  validate(id: string, options: ValidatePaymentIntentOptions): Promise<ValidationOutcome>;
1093
1129
  }
1094
1130
 
1131
+ /**
1132
+ * A private payment, from `client.privatePayments`: an amount in XLM whose value
1133
+ * is hidden on-chain. The payer pays it with confidential transfers on Cosmos
1134
+ * Pay's confidential token (net to {@link recipient}, the commission to
1135
+ * {@link feeAccount}, and a third one when there is a {@link merchantFee}) and
1136
+ * confirms them through the private checkout. Poll with `await payment.fetch()`.
1137
+ */
1138
+ declare class PrivatePayment extends Base<PrivatePaymentData> {
1139
+ /** As it reads now: a PENDING payment past {@link expiresAt} reads EXPIRED. */
1140
+ status: PrivatePaymentStatus;
1141
+ network: PrivatePaymentNetwork;
1142
+ /** The confidential token every transfer must be made on. */
1143
+ tokenContract: string;
1144
+ /** What the payer pays in total, in XLM. */
1145
+ amount: string;
1146
+ /** What the merchant receives, in XLM. */
1147
+ netAmount: string;
1148
+ /** The commission, in XLM. */
1149
+ feeAmount: string;
1150
+ /** The commission rate the payment was priced at, in basis points. */
1151
+ feeBps: number;
1152
+ /** The merchant (G...). */
1153
+ recipient: string;
1154
+ /** Cosmos Pay's account the commission is paid to. */
1155
+ feeAccount: string;
1156
+ /** The account the transfers came from, once settled. */
1157
+ payer: string | null;
1158
+ paymentTxHash: string | null;
1159
+ feeTxHash: string | null;
1160
+ merchantFee: MerchantFeeData | null;
1161
+ merchantFeeTxHash: string | null;
1162
+ description: string | null;
1163
+ idempotencyKey: string;
1164
+ /** Every transfer must close before this. */
1165
+ expiresAt: Date;
1166
+ settledAt: Date | null;
1167
+ createdAt: Date;
1168
+ updatedAt: Date;
1169
+ constructor(client: Client, data: PrivatePaymentData);
1170
+ protected _patch(data: PrivatePaymentData): this;
1171
+ /** Whether the payment is still waiting for its transfers. */
1172
+ get isPending(): boolean;
1173
+ /** Whether every transfer has been confirmed. */
1174
+ get isSucceeded(): boolean;
1175
+ /** Whether it passed {@link expiresAt} without settling (it can still settle with transfers that closed in time). */
1176
+ get isExpired(): boolean;
1177
+ /** Re-fetch from the API, updating this instance in place. */
1178
+ fetch(): Promise<this>;
1179
+ toJSON(): PrivatePaymentData;
1180
+ }
1181
+
1182
+ /** A page of private payments plus its pagination metadata. */
1183
+ interface PrivatePaymentPage {
1184
+ items: PrivatePayment[];
1185
+ total: number;
1186
+ take: number;
1187
+ skip: number;
1188
+ }
1189
+ /**
1190
+ * Private payments: `client.privatePayments`.
1191
+ *
1192
+ * A private payment hides its amount on-chain. It is priced in XLM and paid with
1193
+ * confidential transfers on Cosmos Pay's confidential token; the merchant
1194
+ * receives `amount` minus a 0.18% commission. They run on Stellar testnet only
1195
+ * for now: on mainnet, {@link config} answers `enabled: false`.
1196
+ *
1197
+ * The SDK creates and reads them with your API key. The payer completes one in
1198
+ * the private checkout, which proves the transfers in their own browser.
1199
+ *
1200
+ * @example
1201
+ * const payment = await client.privatePayments.create({
1202
+ * amount: '25.5', recipient: 'G...', description: 'Order #24',
1203
+ * });
1204
+ * // ...the payer pays it through the private checkout...
1205
+ * await payment.fetch(); // payment.status: PENDING, then SUCCEEDED (or EXPIRED)
1206
+ */
1207
+ declare class PrivatePaymentManager extends BaseManager<PrivatePayment> {
1208
+ private readonly route;
1209
+ /**
1210
+ * Create a private payment. The server prices it (`amount` = `netAmount` +
1211
+ * `feeAmount`) and checks on-chain that the recipient holds a confidential
1212
+ * account on the token, refusing it with `recipient_not_registered` otherwise.
1213
+ */
1214
+ create(options: CreatePrivatePaymentOptions): Promise<PrivatePayment>;
1215
+ /** List the private payments on the key's network, newest first. */
1216
+ list(options?: ListPrivatePaymentsOptions): Promise<PrivatePaymentPage>;
1217
+ /** Get one of your private payments, with the transfers that settled it. */
1218
+ fetch(id: string): Promise<PrivatePayment>;
1219
+ /**
1220
+ * The private payments setup of the key's network: the token, registries,
1221
+ * auditor id, commission and fee account a wallet registers and pays against.
1222
+ * `enabled` is false where private payments do not run yet.
1223
+ */
1224
+ config(): Promise<PrivatePaymentsConfigData>;
1225
+ }
1226
+
1095
1227
  /** A product / price the consumer can charge for. */
1096
1228
  declare class Product extends Base<ProductData> {
1097
1229
  name: string;
@@ -1340,6 +1472,152 @@ declare class SwapManager extends BaseManager<Swap | ChainSwap> {
1340
1472
  private materialize;
1341
1473
  }
1342
1474
 
1475
+ /**
1476
+ * A USDT0 transfer from Stellar to an EVM network through LayerZero, from
1477
+ * `client.usdt0`.
1478
+ *
1479
+ * Non-custodial like a {@link Swap}: the API builds one Soroban transaction
1480
+ * ({@link xdr}, or the SEP-7 {@link uri}), the account that holds the USDT0
1481
+ * ({@link source}) signs it, and `await transfer.submit({ signedXdr })` relays it.
1482
+ * LayerZero then delivers it (about 27 minutes on every route); follow it with
1483
+ * `await transfer.fetch()` until {@link isFinal}.
1484
+ */
1485
+ declare class Usdt0Transfer extends Base<Usdt0TransferData> {
1486
+ status: Usdt0TransferStatus;
1487
+ /** Always mainnet (`public`). */
1488
+ network: string;
1489
+ /** The Stellar account that holds the USDT0, signs and pays the fees in XLM. */
1490
+ source: string;
1491
+ to: Usdt0Destination;
1492
+ /** The destination network's LayerZero endpoint id. */
1493
+ eid: number;
1494
+ receives: Usdt0Receives;
1495
+ /** The EVM address credited. */
1496
+ recipient: string;
1497
+ amount: string;
1498
+ amountSent: string;
1499
+ amountReceived: string;
1500
+ dust: string;
1501
+ /** LayerZero's quoted messaging fee, in XLM. */
1502
+ nativeFee: string;
1503
+ /** What the transaction offers LayerZero, in XLM; the unused part is refunded. */
1504
+ nativeFeeLimit: string;
1505
+ /** The Stellar network fee, in XLM. */
1506
+ networkFee: string;
1507
+ feeBps: number;
1508
+ feeAmount: string;
1509
+ feeWallet: string | null;
1510
+ /** The unsigned transaction (base64 XDR) to sign. */
1511
+ xdr: string;
1512
+ /** SEP-7 `tx` link carrying {@link xdr}. */
1513
+ uri: string;
1514
+ /** QR of {@link uri}; usually null (a Soroban transaction is too large for one), and absent from list rows. */
1515
+ qr: string | null;
1516
+ txHash: string | null;
1517
+ /** LayerZero's message id, once the transaction landed. */
1518
+ guid: string | null;
1519
+ destinationTxHash: string | null;
1520
+ /** LayerZero Scan's own status word, verbatim. */
1521
+ scanStatus: string | null;
1522
+ scanUrl: string | null;
1523
+ failureReason: string | null;
1524
+ merchantFee: MerchantFeeData | null;
1525
+ idempotencyKey: string | null;
1526
+ /** Submit refuses the transaction after this. */
1527
+ expiresAt: Date;
1528
+ submittedAt: Date | null;
1529
+ createdAt: Date;
1530
+ updatedAt: Date;
1531
+ /**
1532
+ * The record's read token, returned by the create only when the client uses the
1533
+ * shared public key. Kept across {@link fetch} and {@link submit}, which send it
1534
+ * as `X-Record-Token`.
1535
+ */
1536
+ publicToken: string | null;
1537
+ constructor(client: Client, data: Usdt0TransferData);
1538
+ protected _patch(data: Usdt0TransferData): this;
1539
+ /** Whether the transfer is still waiting for its signature. */
1540
+ get isPending(): boolean;
1541
+ /** Whether it was credited on the destination network. */
1542
+ get isDelivered(): boolean;
1543
+ /** Whether it reached an outcome that will not change (DELIVERED, FAILED or EXPIRED). */
1544
+ get isFinal(): boolean;
1545
+ /** Re-read it (the API refreshes it from the ledger and LayerZero Scan), updating this instance in place. */
1546
+ fetch(): Promise<this>;
1547
+ /**
1548
+ * Relay the signed transaction. Mutates this instance from the transfer in the
1549
+ * outcome and returns the outcome.
1550
+ */
1551
+ submit(options: {
1552
+ signedXdr: string;
1553
+ }): Promise<Usdt0SubmitOutcome>;
1554
+ private recordToken;
1555
+ toJSON(): Usdt0TransferData;
1556
+ }
1557
+
1558
+ /** A page of USDT0 transfers plus its pagination metadata. */
1559
+ interface Usdt0TransferPage {
1560
+ items: Usdt0Transfer[];
1561
+ total: number;
1562
+ take: number;
1563
+ skip: number;
1564
+ }
1565
+ /** Submission outcome of a USDT0 transfer, with the refreshed transfer materialized. */
1566
+ interface Usdt0SubmitOutcome {
1567
+ /** True when the network accepted the transaction (SUBMITTED, or already DELIVERED). */
1568
+ submitted: boolean;
1569
+ status: Usdt0TransferStatus;
1570
+ txHash: string | null;
1571
+ /** Why it was not submitted: refused by the network (still PENDING, submit again) or failed on the ledger. */
1572
+ reason: string | null;
1573
+ transfer: Usdt0Transfer;
1574
+ }
1575
+ /**
1576
+ * USDT0 from Stellar to EVM networks: `client.usdt0`.
1577
+ *
1578
+ * USDT0 is Tether's omnichain USDT. From Stellar it travels through LayerZero's
1579
+ * OFT: Ethereum receives native USDT, every other network receives USDT0, and
1580
+ * every route takes an EVM recipient. Signing works like a swap: the API builds
1581
+ * the transaction, the holder signs it, and {@link submit} relays the signed XDR.
1582
+ * The holder pays LayerZero's fee and the network fee in XLM. Mainnet only: a
1583
+ * `dev` key gets `available: false` from {@link routes}, and `400
1584
+ * network_unsupported` from {@link quote} and {@link create}.
1585
+ *
1586
+ * @example
1587
+ * const quote = await client.usdt0.quote({ to: 'arb', amount: '12.5' });
1588
+ * const transfer = await client.usdt0.create({
1589
+ * source: 'G...', to: 'arb', recipient: '0x5aAe...', amount: '12.5',
1590
+ * });
1591
+ * // ...the holder signs transfer.xdr (or opens transfer.uri)...
1592
+ * await transfer.submit({ signedXdr });
1593
+ * await transfer.fetch(); // transfer.status: SUBMITTED, then DELIVERED
1594
+ */
1595
+ declare class Usdt0Manager extends BaseManager<Usdt0Transfer> {
1596
+ private readonly route;
1597
+ /** The networks USDT0 can be sent to from Stellar, with the token and OFT a transfer uses. */
1598
+ routes(): Promise<Usdt0RoutesData>;
1599
+ /**
1600
+ * Price a transfer: what is sent and arrives, the dust, LayerZero's fee and the
1601
+ * OFT's limits. Persists nothing.
1602
+ */
1603
+ quote(options: QuoteUsdt0Options): Promise<Usdt0QuoteData>;
1604
+ /** Build a transfer: the one unsigned Soroban transaction the holder signs (XDR and SEP-7 link). */
1605
+ create(options: CreateUsdt0TransferOptions): Promise<Usdt0Transfer>;
1606
+ /** List your transfers, newest first, as last refreshed (fetch one to refresh it). */
1607
+ list(options?: ListUsdt0TransfersOptions): Promise<Usdt0TransferPage>;
1608
+ /**
1609
+ * Get one transfer. While PENDING or SUBMITTED the API refreshes it from the
1610
+ * Stellar ledger and LayerZero Scan (at most every 15 seconds).
1611
+ */
1612
+ fetch(id: string, options?: Usdt0RecordTokenOptions): Promise<Usdt0Transfer>;
1613
+ /**
1614
+ * Relay the signed transaction to Stellar mainnet. It must be the transaction
1615
+ * the API built for this transfer, signed. A refusal by the network leaves it
1616
+ * PENDING (`submitted: false`, `reason`) to submit again until it expires.
1617
+ */
1618
+ submit(id: string, options: SubmitUsdt0TransferOptions & Usdt0RecordTokenOptions): Promise<Usdt0SubmitOutcome>;
1619
+ }
1620
+
1343
1621
  /** A single attempt to deliver an event to a webhook endpoint (audit record). */
1344
1622
  declare class WebhookDelivery extends Base<WebhookDeliveryData> {
1345
1623
  endpointId: string;
@@ -1660,7 +1938,7 @@ interface Client {
1660
1938
  */
1661
1939
  declare class Client extends EventEmitter {
1662
1940
  /** Library version. */
1663
- static readonly version = "2.2.1";
1941
+ static readonly version = "2.3.1";
1664
1942
  /**
1665
1943
  * Process-wide shared defaults maintained by Cosmos Pay (gateway URL, version,
1666
1944
  * internal secrets). Mutate once at startup to change them for every client
@@ -1683,6 +1961,10 @@ declare class Client extends EventEmitter {
1683
1961
  readonly swaps: SwapManager;
1684
1962
  /** Swaps between Stellar, Solana and Monad, settled by NEAR Intents. */
1685
1963
  readonly crossChainSwaps: CrossChainSwapManager;
1964
+ /** USDT0 from Stellar to EVM networks through LayerZero (mainnet only). */
1965
+ readonly usdt0: Usdt0Manager;
1966
+ /** Private payments: amounts hidden on-chain (Stellar testnet only for now). */
1967
+ readonly privatePayments: PrivatePaymentManager;
1686
1968
  /** Liquidity pools: browse, positions, deposit / withdraw. */
1687
1969
  readonly liquidity: LiquidityManager;
1688
1970
  /** Fiat -> stablecoin: quotes, payins, trustlines, virtual accounts. */
@@ -1693,9 +1975,9 @@ declare class Client extends EventEmitter {
1693
1975
  readonly activity: ActivityManager;
1694
1976
  /** KYC / KYB: receivers, their wallets and their bank accounts. */
1695
1977
  readonly kyc: KycManager;
1696
- /** Customers. */
1978
+ /** Customers and their wallets. */
1697
1979
  readonly customers: CustomerManager;
1698
- /** Read-only analytics (summary, balances, logs). */
1980
+ /** Read-only analytics (summary, series, balances, logs). */
1699
1981
  readonly analytics: AnalyticsManager;
1700
1982
  /** Service health probes (public). */
1701
1983
  readonly health: HealthManager;
@@ -1773,7 +2055,7 @@ declare const Webhooks: {
1773
2055
  };
1774
2056
 
1775
2057
  /** Library version, kept in sync with package.json. */
1776
- declare const version = "2.2.1";
2058
+ declare const version = "2.3.1";
1777
2059
  /**
1778
2060
  * Default base URL of the Cosmos Pay gateway. Maintained by Cosmos Pay — users
1779
2061
  * never need to set this; it's part of the {@link shared} configuration. Override
@@ -1805,5 +2087,5 @@ declare const Events: {
1805
2087
  };
1806
2088
  type ClientEvent = (typeof Events)[keyof typeof Events];
1807
2089
 
1808
- export { ActivityEventInput, ActivityListData, ActivityManager, ActivityReportData, ActivitySummaryData, AddAliasAddressOptions, AliasAddressData, AliasAvailabilityData, AliasByAddressData, AliasChallengeData, AliasDeletedData, AliasListData, AliasManager, AliasRecoveryStartedData, AliasResolutionData, AnalyticsBalancesData, AnalyticsManager, AnalyticsSummaryData, AnyWebhookEvent, ApiLogsData, ApproveReceiverOptions, AssetManager, AssetRegistryData, AttachPayoutDocumentOptions, AuthorizePayoutData, AuthorizePayoutOptions, BankAccountData, BankDetailsData, Base, BaseManager, BrowseLiquidityPoolsOptions, ChainSwap, ChainSwapData, ChainSwapTransaction, ClaimAliasOptions, Client, CompleteAliasRecoveryOptions, CreateAliasChallengeOptions, CreateBankAccountOptions, CreateCrossChainSwapOptions, CreateCustomerOptions, CreatePayPaymentIntentOptions, CreatePayinOptions, CreatePayinQuoteOptions, CreatePayoutOptions, CreatePayoutQuoteOptions, CreateProductOptions, CreateReceiverOptions, CreateReceiverWalletOptions, CreateSwapOptions, CreateTrustlineOptions, CreateTxPaymentIntentOptions, CreateVirtualAccountOptions, CreateWebhookEndpointOptions, CrossChainAssetData, CrossChainQuoteData, CrossChainSwap, CrossChainSwapData, CrossChainSwapManager, CrossChainSwapStatus, CrossChainTransactionData, Customer, CustomerData, CustomerManager, DEFAULT_BASE_URL, DEFAULT_RETRIES, DEFAULT_TIMEOUT, DEFAULT_VERSION, DefindexDepositOptions, DefindexManager, DefindexWithdrawOptions, DeletedData, DepositLiquidityOptions, EnableReceiverOptions, Events, EvmCallData, HealthCheckData, HealthManager, InitiateTosOptions, InstallPluginOptions, KycManager, KycRailsData, KycUploadData, LiquidityManager, LiquidityOperation, LiquidityOperationData, LiquidityOperationKind, LiquidityOperationStatus, LiquidityPoolData, LiquidityPositionsData, ListActivityOptions, ListCrossChainSwapsOptions, ListKycOptions, ListLiquidityOperationsOptions, ListPayinsOptions, ListPaymentIntentsOptions, ListPayoutsOptions, ListRegistryAssetsOptions, ListSwapsOptions, ListWebhookDeliveriesOptions, OfframpManager, OnrampManager, OtherSwapChain, OwnedAliasData, PayinData, PayinQuoteData, PaymentChain, PaymentIntent, PaymentIntentData, PaymentIntentKind, PaymentIntentManager, PaymentIntentStatus, PaymentIntentTransitionData, PayoutData, PayoutDocumentData, PayoutQuoteData, PluginActionResultData, PluginData, PluginManager, PluginUninstalledData, Product, ProductData, ProductKind, ProductManager, PublicKeyData, PublicKeyManager, QuoteCrossChainSwapOptions, QuoteSwapOptions, REST, Receiver, ReceiverData, ReceiverWalletData, ReportActivityOptions, RequestTosOptions, SIGNATURE_HEADER, SetReceiverAccessOptions, SubmitLiquidityOptions, SubmitSwapOptions, Swap, SwapChain, SwapData, SwapManager, SwapQuoteData, SwapStatus, TermsOfServiceData, TrustlineData, TypedWebhookEvent, UpdateCustomerOptions, UpdatePaymentIntentOptions, UpdateProductOptions, UpdateReceiverOptions, UpdateWebhookEndpointOptions, ValidatePaymentIntentOptions, ValidationOutcomeData, VirtualAccountData, WalletSignMessageData, WebhookDelivery, WebhookDeliveryData, WebhookDeliveryStatus, WebhookEndpoint, WebhookEndpointData, WebhookEndpointWithSecretData, WebhookEvent, WebhookEventDataMap, WebhookEventType, WebhookLogsData, WebhookManager, WebhookPingData, WebhookSignatureError, Webhooks, WithdrawLiquidityOptions, resolveShared, shared, version };
1809
- export type { ActivityPage, BankAccountPage, ChainSwapSubmitOutcome, ClientEvent, ClientEvents, ClientOptions, CrossChainSwapPage, FetchLike, LiquidityOperationPage, LiquidityPoolPage, LiquiditySubmitOutcome, PayinPage, PaymentIntentPage, PayoutPage, RESTOptions, ReceiverPage, ReceiverWalletPage, RequestOptions, SharedConfig, SwapPage, SwapSubmitOutcome, ValidationOutcome, VerifyWebhookOptions, WebhookDeliveryPage, WebhookHandlerOptions, WebhookListenerEvents, WebhookProcessOptions };
2090
+ export { ActivityEventInput, ActivityListData, ActivityManager, ActivityReportData, ActivitySummaryData, AddAliasAddressOptions, AddCustomerWalletOptions, AliasAddressData, AliasAvailabilityData, AliasByAddressData, AliasChallengeData, AliasDeletedData, AliasListData, AliasManager, AliasRecoveryStartedData, AliasResolutionData, AnalyticsBalancesData, AnalyticsManager, AnalyticsSeriesData, AnalyticsSeriesOptions, AnalyticsSummaryData, AnyWebhookEvent, ApiLogsData, ApproveReceiverOptions, AssetManager, AssetRegistryData, AttachPayoutDocumentOptions, AuthorizePayoutData, AuthorizePayoutOptions, BankAccountData, BankDetailsData, Base, BaseManager, BrowseLiquidityPoolsOptions, ChainSwap, ChainSwapData, ChainSwapTransaction, ClaimAliasOptions, Client, CompleteAliasRecoveryOptions, CreateAliasChallengeOptions, CreateBankAccountOptions, CreateCrossChainSwapOptions, CreateCustomerOptions, CreatePayPaymentIntentOptions, CreatePayinOptions, CreatePayinQuoteOptions, CreatePayoutOptions, CreatePayoutQuoteOptions, CreatePrivatePaymentOptions, CreateProductOptions, CreateReceiverOptions, CreateReceiverWalletOptions, CreateSwapOptions, CreateTrustlineOptions, CreateTxPaymentIntentOptions, CreateUsdt0TransferOptions, CreateVirtualAccountOptions, CreateWebhookEndpointOptions, CrossChainAssetData, CrossChainQuoteData, CrossChainSwap, CrossChainSwapData, CrossChainSwapManager, CrossChainSwapStatus, CrossChainTransactionData, Customer, CustomerData, CustomerManager, CustomerWalletData, CustomerWalletDeletedData, DEFAULT_BASE_URL, DEFAULT_RETRIES, DEFAULT_TIMEOUT, DEFAULT_VERSION, DefindexDepositOptions, DefindexManager, DefindexWithdrawOptions, DeletedData, DepositLiquidityOptions, EnableReceiverOptions, Events, EvmCallData, HealthCheckData, HealthManager, InitiateTosOptions, InstallPluginOptions, KycManager, KycRailsData, KycUploadData, LiquidityManager, LiquidityOperation, LiquidityOperationData, LiquidityOperationKind, LiquidityOperationStatus, LiquidityPoolData, LiquidityPositionsData, ListActivityOptions, ListCrossChainSwapsOptions, ListKycOptions, ListLiquidityOperationsOptions, ListPayinsOptions, ListPaymentIntentsOptions, ListPayoutsOptions, ListPrivatePaymentsOptions, ListRegistryAssetsOptions, ListSwapsOptions, ListUsdt0TransfersOptions, ListWebhookDeliveriesOptions, MerchantFeeData, OfframpManager, OnrampManager, OtherSwapChain, OwnedAliasData, PayinData, PayinQuoteData, PaymentChain, PaymentIntent, PaymentIntentData, PaymentIntentKind, PaymentIntentManager, PaymentIntentStatus, PaymentIntentTransitionData, PayoutData, PayoutDocumentData, PayoutQuoteData, PluginActionResultData, PluginData, PluginManager, PluginUninstalledData, PrivatePayment, PrivatePaymentData, PrivatePaymentManager, PrivatePaymentNetwork, PrivatePaymentStatus, PrivatePaymentsConfigData, Product, ProductData, ProductKind, ProductManager, PublicKeyData, PublicKeyManager, QuoteCrossChainSwapOptions, QuoteSwapOptions, QuoteUsdt0Options, REST, Receiver, ReceiverData, ReceiverWalletData, ReportActivityOptions, RequestTosOptions, SIGNATURE_HEADER, SetReceiverAccessOptions, SubmitLiquidityOptions, SubmitSwapOptions, SubmitUsdt0TransferOptions, Swap, SwapChain, SwapData, SwapManager, SwapQuoteData, SwapStatus, TermsOfServiceData, TrustlineData, TypedWebhookEvent, UpdateCustomerOptions, UpdatePaymentIntentOptions, UpdateProductOptions, UpdateReceiverOptions, UpdateWebhookEndpointOptions, Usdt0Destination, Usdt0Manager, Usdt0QuoteData, Usdt0Receives, Usdt0RecordTokenOptions, Usdt0RoutesData, Usdt0Transfer, Usdt0TransferData, Usdt0TransferStatus, ValidatePaymentIntentOptions, ValidationOutcomeData, VirtualAccountData, WalletSignMessageData, WebhookDelivery, WebhookDeliveryData, WebhookDeliveryStatus, WebhookEndpoint, WebhookEndpointData, WebhookEndpointWithSecretData, WebhookEvent, WebhookEventDataMap, WebhookEventType, WebhookLogsData, WebhookManager, WebhookPingData, WebhookSignatureError, Webhooks, WithdrawLiquidityOptions, resolveShared, shared, version };
2091
+ export type { ActivityPage, BankAccountPage, ChainSwapSubmitOutcome, ClientEvent, ClientEvents, ClientOptions, CrossChainSwapPage, FetchLike, LiquidityOperationPage, LiquidityPoolPage, LiquiditySubmitOutcome, PayinPage, PaymentIntentPage, PayoutPage, PrivatePaymentPage, RESTOptions, ReceiverPage, ReceiverWalletPage, RequestOptions, SharedConfig, SwapPage, SwapSubmitOutcome, Usdt0SubmitOutcome, Usdt0TransferPage, ValidationOutcome, VerifyWebhookOptions, WebhookDeliveryPage, WebhookHandlerOptions, WebhookListenerEvents, WebhookProcessOptions };