@unifold/core 0.1.79 → 0.1.81

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.mts CHANGED
@@ -249,7 +249,30 @@ interface SupportedDestinationTokensResponse {
249
249
  */
250
250
  declare function getSupportedDestinationTokens(publishableKey?: string, options?: {
251
251
  product_type?: ProductType;
252
+ /** Which surface the list is for; only read alongside `source_chain_type`. */
253
+ action_type?: ActionType;
254
+ /**
255
+ * Chain the funds are being sent from. With `action_type: withdraw`,
256
+ * destinations this source can't reach are omitted — a withdrawal that has
257
+ * to be bridged off its source chain (N1) can't land back on it.
258
+ */
259
+ source_chain_type?: ChainType;
252
260
  }): Promise<SupportedDestinationTokensResponse>;
261
+ /**
262
+ * Fiat currency a stablecoin is pegged to (lowercase ISO 4217). Mirrors the
263
+ * API's `FiatCurrency` enum; kept as a local union here because the SDK cannot
264
+ * import server-side types across the package boundary. Named distinctly from
265
+ * the onramp `FiatCurrency` object interface below.
266
+ *
267
+ * This is intentionally an OPEN union: `'usd'` and `'eur'` are listed for
268
+ * editor autocomplete, but the `(string & Record<never, never>)` member keeps
269
+ * the type forward-compatible. If the backend later adds a new fiat currency
270
+ * (e.g. `'gbp'`), an older SDK build still type-checks — the new value is a
271
+ * valid `string`, so consumers can compare/handle it without a TS error and
272
+ * without needing to upgrade. Always treat unknown values defensively rather
273
+ * than assuming USD.
274
+ */
275
+ type StablecoinFiatCurrency = 'usd' | 'eur' | (string & Record<never, never>);
253
276
  interface SupportedToken {
254
277
  symbol: string;
255
278
  /** Slugged `symbol` (e.g. "usdc", "usdc_e", "usdc_perp"). */
@@ -258,6 +281,12 @@ interface SupportedToken {
258
281
  icon_url: string;
259
282
  is_newly_added: boolean;
260
283
  is_stablecoin: boolean;
284
+ /**
285
+ * Fiat currency a stablecoin tracks (e.g. "usd", "eur"). Present only for
286
+ * stablecoins. Consumers must not assume a stablecoin is USD-denominated —
287
+ * check this before treating a token amount as a USD amount.
288
+ */
289
+ stablecoin_fiat_currency?: StablecoinFiatCurrency;
261
290
  chains: SupportedChain[];
262
291
  }
263
292
  interface SupportedDepositTokensResponse {
@@ -272,6 +301,12 @@ declare function getSupportedDepositTokens(publishableKey?: string, options?: {
272
301
  destination_chain_id?: string;
273
302
  destination_chain_type?: string;
274
303
  product_type?: ProductType;
304
+ /**
305
+ * Pass `withdraw` to also get chains that are only valid as a withdrawal
306
+ * source (their funds are bridged onto a settlement chain) and are never
307
+ * routable deposit sources.
308
+ */
309
+ action_type?: ActionType;
275
310
  }): Promise<SupportedDepositTokensResponse>;
276
311
  interface TokenMetadata {
277
312
  symbol: string;
@@ -283,6 +318,8 @@ interface TokenMetadata {
283
318
  chain_id: string;
284
319
  token_address: string;
285
320
  decimals: number;
321
+ /** Catalog classification from `/v1/public/tokens/token`. */
322
+ is_stablecoin?: boolean;
286
323
  chain_icon_url: string;
287
324
  chain_icon_urls: IconUrl[];
288
325
  }
@@ -336,6 +373,24 @@ declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenc
336
373
  declare function getFiatExchangeRates(options?: {
337
374
  currencies?: string[];
338
375
  }, publishableKey?: string): Promise<FiatExchangeRatesResponse>;
376
+ interface TokenPriceResponse {
377
+ data: {
378
+ chain_type: string;
379
+ chain_id: string;
380
+ token_address: string;
381
+ price: number;
382
+ currency: string;
383
+ };
384
+ }
385
+ /**
386
+ * Get the current USD price of a token.
387
+ *
388
+ * @param chainType - Chain type ('ethereum', 'solana', ...)
389
+ * @param chainId - Chain ID (e.g. "8453", "mainnet")
390
+ * @param tokenAddress - Token contract address or "native"
391
+ * @param publishableKey - Optional publishable key, defaults to configured key
392
+ */
393
+ declare function getTokenPrice(chainType: ChainType, chainId: string, tokenAddress: string, publishableKey?: string): Promise<TokenPriceResponse>;
339
394
  interface OnrampQuote {
340
395
  transaction_type: string;
341
396
  source_amount: number;
@@ -368,6 +423,8 @@ interface OnrampQuote {
368
423
  institution_name: string | null;
369
424
  low_kyc: boolean;
370
425
  partner_fee: number | null;
426
+ /** Seconds. Same unit as token `estimated_processing_time`. */
427
+ estimated_processing_time: number;
371
428
  }
372
429
  interface OnrampQuotesRequest {
373
430
  country_code: string;
@@ -1570,7 +1627,16 @@ interface DepositQuoteRequest {
1570
1627
  source_chain_type: string;
1571
1628
  source_chain_id: string;
1572
1629
  source_token_address: string;
1573
- destination_amount: string;
1630
+ /**
1631
+ * Source amount to spend, in base units. Mutually exclusive with
1632
+ * `destination_amount` — provide exactly one. Selects an exact-in quote.
1633
+ */
1634
+ source_amount?: string;
1635
+ /**
1636
+ * Desired destination amount in base units. Mutually exclusive with
1637
+ * `source_amount` — provide exactly one. Selects an exact-out quote.
1638
+ */
1639
+ destination_amount?: string;
1574
1640
  destination_chain_type: string;
1575
1641
  destination_chain_id: string;
1576
1642
  destination_token_address: string;
@@ -1614,10 +1680,26 @@ interface DepositQuote {
1614
1680
  * `adjust_for_slippage`.
1615
1681
  */
1616
1682
  expected_slippage_percent: number | null;
1683
+ /**
1684
+ * Platform fee the depositor will pay, as a percentage
1685
+ * (`basis_point / 100`, e.g. 50 bps → 0.5 for 0.50%).
1686
+ * Null when the project's organization has no active billing subscription.
1687
+ * Optional so older API responses (and checkout clients that ignore it) stay compatible.
1688
+ */
1689
+ platform_fee_percent?: number | null;
1690
+ /**
1691
+ * Estimated platform fee in USD (`source_amount_usd × basis_point / 10000`).
1692
+ * Null when the percent is unknown or the quote has no USD figure.
1693
+ */
1694
+ platform_fee_usd?: string | null;
1617
1695
  }
1618
1696
  /**
1619
- * Get a deposit quote: how much source token is needed to receive a
1620
- * specific destination amount, accounting for bridge fees and slippage.
1697
+ * Get a deposit quote in either direction.
1698
+ *
1699
+ * Provide exactly one of `source_amount` (exact-in: how much lands for this
1700
+ * input) or `destination_amount` (exact-out: how much must be sent to receive
1701
+ * this output). The response includes the quote plus the project's platform
1702
+ * fee from billing, as a percentage.
1621
1703
  * Results are cached server-side for 1 minute.
1622
1704
  */
1623
1705
  declare function getDepositQuote(request: DepositQuoteRequest, publishableKey?: string): Promise<DepositQuote>;
@@ -1843,6 +1925,7 @@ interface StripeQuotesResponse {
1843
1925
  destination_network: string;
1844
1926
  service_provider: string;
1845
1927
  service_provider_display_name: string;
1928
+ estimated_processing_time: number;
1846
1929
  destination_network_quotes: Record<string, unknown[]>;
1847
1930
  }
1848
1931
  /**
@@ -2840,6 +2923,8 @@ interface OnrampProviderQuote {
2840
2923
  iconUrl: string;
2841
2924
  iconUrls: IconUrl[];
2842
2925
  institutionName: string | null;
2926
+ /** Seconds. Same unit as token `estimatedProcessingTime`. */
2927
+ estimatedProcessingTime: number;
2843
2928
  }
2844
2929
  /** Map a wire {@link OnrampQuote} to the SDK-facing {@link OnrampProviderQuote}. */
2845
2930
  declare function mapOnrampQuote(quote: OnrampQuote): OnrampProviderQuote;
@@ -3914,4 +3999,4 @@ declare const i18n: {
3914
3999
  };
3915
4000
  type I18nStrings = typeof i18n;
3916
4001
 
3917
- export { type AccountConnectionData, ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AddressVerification, type ApplePayLimitUpgradeStatus, type ApplePayProvider, type ApplePayProvidersResponse, type AuthenticateOAuthResult, type AutoSwapRequest, type AutoSwapResponse, type BankTransferConfig, type BankTransferProvider, type BankTransferProvidersResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type CheckoutEvent, CheckoutEventType, type CheckoutFlowFailedData, type CheckoutFlowStartedData, type CheckoutMethod, type CheckoutMethodSelectedData, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePayLimit, type CoinbaseApplePayLimitUpgradeOption, type CoinbaseApplePayLimitsResponse, type CoinbaseApplePaySessionResponse, type CoinbaseGooglePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type CoinbaseWalletPayLimit, type CoinbaseWalletPayLimitUpgradeOption, type CoinbaseWalletPayLimitsResponse, type CoinbaseWalletPaySessionResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateCoinbaseGooglePaySessionRequest, type CreateCoinbaseWalletPaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationExchangeSessionRequest, type CreateIntegrationExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, DETECTION_ARM_DELAY_MS, DETECTION_POLL_INTERVAL_MS, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddress, type DepositAddressParams, type DepositAddressResponse, DepositAddressValidationError, type DepositEvent, DepositEventType, type DepositFlowFailedData, type DepositFlowStartedData, type DepositLimitReachedData, type DepositMethod, type DepositMethodSelectedData, type DepositQuote, type DepositQuoteRequest, DepositSession, type DepositSessionConfig, type DepositSessionDestination, type DepositSessionError, type DepositSessionErrorCode, type DepositSessionEvent, type DepositSessionEventMap, DepositSessionEventType, type DepositSessionParams, type DepositSessionSnapshot, type DepositSessionStatus, DepositSessionWaitError, type DepositSessionWaitErrorCode, type DepositSessionWaitOptions, type DestinationToken, type DestinationTokenChain, type DirectExecution, DirectExecutionEventType, type DirectExecutionFailedEvent, type DirectExecutionResponse, type DirectExecutionSucceededEvent, type EvmContractCall, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type ExternalWalletChainType, type ExternalWalletInfo, type ExternalWalletsResponse, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetBankTransferProvidersOptions, type GetExchangesQuery, type GetIntegrationExchangesQuery, type GooglePayProvider, type GooglePayProvidersResponse, type HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationConnectionMethod, type IntegrationExchangeInfo, type IntegrationExchangeSessionStartParams, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, IntegrationTransferError, type IntegrationTransferErrorType, type IpAddressResponse, LOOKBACK_MS, type ListExecutionsParams, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampCheckout, type OnrampDestinationToken, type OnrampProviderQuote, type OnrampQuote, type OnrampQuoteRequest, type OnrampQuotesRequest, type OnrampQuotesResponse, OnrampSession, type OnrampSessionConfig, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionError, type OnrampSessionErrorCode, type OnrampSessionEvent, type OnrampSessionEventMap, OnrampSessionEventType, type OnrampSessionParams, type OnrampSessionPaymentMethod, type OnrampSessionPaymentMethodType, type OnrampSessionRequest, type OnrampSessionResponse, type OnrampSessionSnapshot, type OnrampSessionStatus, type OnrampSessionStatusResponse, type OnrampSessionStatusValue, OnrampSessionWaitError, type OnrampSessionWaitErrorCode, type OnrampSessionWaitOptions, type OnrampVerificationFactor, type OnrampVerificationFactorStatus, type OnrampVerificationSession, type OnrampVerificationStatus, type OnrampVerificationTokenResponse, type PaymentIntent, type PaymentIntentDepositAddress, type PaymentIntentExecutionsResponse, type PaymentIntentStatus, type PaymentIntentType, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProductType, type ProjectConfigResponse, type ProviderSelectedData, type PublicIncidentResponse, QUOTE_REFRESH_INTERVAL_MS, type QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, type RequestCoinbaseApplePayLimitUpgradeRequest, type RequestCoinbaseApplePayLimitUpgradeResponse, type RequestCoinbaseWalletPayLimitUpgradeRequest, type RequestCoinbaseWalletPayLimitUpgradeResponse, SCAN_NUDGE_INTERVAL_MS, SOLANA_USDC_ADDRESS, type SendHypercoreTransactionRequest, type SendHypercoreTransactionResponse, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SourceToken, type SourceTokenNetwork, type StartIntegrationOAuthResult, type StripeAccessTokenResponse, StripeApiResponseError, type StripeAuthIntentResponse, type StripeConfigResponse, type StripeConfirmRequest, type StripeConsumerWallet, type StripeCreateSessionRequest, type StripeCryptoCustomer, type StripeCustomerVerification, type StripeDefaultTokenResponse, type StripeListResponse, type StripeOnrampErrorType, type StripeOnrampSession, type StripeOnrampTransactionDetails, type StripePaymentToken, type StripeQuoteRequest, type StripeQuotesResponse, type StripeTransactionLimitEntry, type StripeTransactionLimitsResponse, type SupportedChain, type SupportedDepositTokensParams, type SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenDisplayMetadata, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TokenSelectedData, type TransferDefaultTokenParams, type TransferDefaultTokenResult, UnifoldClient, type UnifoldClientOptions, type UserIpInfo, type VerificationData, type VerifyAddressParams, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletConnectionData, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WalletPayLimitUpgradeStatus, type WalletPayMethod, type WalletPayProvider, type WalletPayProvidersResponse, type WalletSelectedData, type WithdrawDirectExecutionFailedEvent, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, type WithdrawFlowStartedData, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createCoinbaseGooglePaySession, createCoinbaseWalletPaySession, createDepositAddress, createExchangeSession, createIntegrationExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, createUnifoldClient, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayLimitUpgradeStatus, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseApplePayLimits, getCoinbaseLegalAgreements, getCoinbaseWalletPayLimits, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getFiatExchangeRates, getGooglePayLimitUpgradeStatus, getGooglePayProviders, getIconUrl, getIconUrlWithCdn, getIntegrationExchangeSessionStartUrl, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampSessionStatus, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getPublicIncident, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, getWalletPayLimitUpgradeStatus, getWalletPayProviders, i18n, isApplePayLimitReached, isDepositAddressValidationError, isGooglePayLimitReached, isWalletPayLimitReached, listPaymentIntentExecutions, mapDefaultOnrampToken, mapDirectExecution, mapOnrampQuote, mapWalletToDepositAddress, pollDirectExecutions, queryExecutions, refreshIntegrationToken, requestCoinbaseApplePayLimitUpgrade, requestCoinbaseWalletPayLimitUpgrade, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendOnrampVerificationOtp, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeGetTransactionLimits, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp, verifyOnrampVerificationOtp, verifyRecipientAddress };
4002
+ export { type AccountConnectionData, ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AddressVerification, type ApplePayLimitUpgradeStatus, type ApplePayProvider, type ApplePayProvidersResponse, type AuthenticateOAuthResult, type AutoSwapRequest, type AutoSwapResponse, type BankTransferConfig, type BankTransferProvider, type BankTransferProvidersResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type CheckoutEvent, CheckoutEventType, type CheckoutFlowFailedData, type CheckoutFlowStartedData, type CheckoutMethod, type CheckoutMethodSelectedData, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePayLimit, type CoinbaseApplePayLimitUpgradeOption, type CoinbaseApplePayLimitsResponse, type CoinbaseApplePaySessionResponse, type CoinbaseGooglePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type CoinbaseWalletPayLimit, type CoinbaseWalletPayLimitUpgradeOption, type CoinbaseWalletPayLimitsResponse, type CoinbaseWalletPaySessionResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateCoinbaseGooglePaySessionRequest, type CreateCoinbaseWalletPaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationExchangeSessionRequest, type CreateIntegrationExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, DETECTION_ARM_DELAY_MS, DETECTION_POLL_INTERVAL_MS, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddress, type DepositAddressParams, type DepositAddressResponse, DepositAddressValidationError, type DepositEvent, DepositEventType, type DepositFlowFailedData, type DepositFlowStartedData, type DepositLimitReachedData, type DepositMethod, type DepositMethodSelectedData, type DepositQuote, type DepositQuoteRequest, DepositSession, type DepositSessionConfig, type DepositSessionDestination, type DepositSessionError, type DepositSessionErrorCode, type DepositSessionEvent, type DepositSessionEventMap, DepositSessionEventType, type DepositSessionParams, type DepositSessionSnapshot, type DepositSessionStatus, DepositSessionWaitError, type DepositSessionWaitErrorCode, type DepositSessionWaitOptions, type DestinationToken, type DestinationTokenChain, type DirectExecution, DirectExecutionEventType, type DirectExecutionFailedEvent, type DirectExecutionResponse, type DirectExecutionSucceededEvent, type EvmContractCall, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type ExternalWalletChainType, type ExternalWalletInfo, type ExternalWalletsResponse, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetBankTransferProvidersOptions, type GetExchangesQuery, type GetIntegrationExchangesQuery, type GooglePayProvider, type GooglePayProvidersResponse, type HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationConnectionMethod, type IntegrationExchangeInfo, type IntegrationExchangeSessionStartParams, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, IntegrationTransferError, type IntegrationTransferErrorType, type IpAddressResponse, LOOKBACK_MS, type ListExecutionsParams, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampCheckout, type OnrampDestinationToken, type OnrampProviderQuote, type OnrampQuote, type OnrampQuoteRequest, type OnrampQuotesRequest, type OnrampQuotesResponse, OnrampSession, type OnrampSessionConfig, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionError, type OnrampSessionErrorCode, type OnrampSessionEvent, type OnrampSessionEventMap, OnrampSessionEventType, type OnrampSessionParams, type OnrampSessionPaymentMethod, type OnrampSessionPaymentMethodType, type OnrampSessionRequest, type OnrampSessionResponse, type OnrampSessionSnapshot, type OnrampSessionStatus, type OnrampSessionStatusResponse, type OnrampSessionStatusValue, OnrampSessionWaitError, type OnrampSessionWaitErrorCode, type OnrampSessionWaitOptions, type OnrampVerificationFactor, type OnrampVerificationFactorStatus, type OnrampVerificationSession, type OnrampVerificationStatus, type OnrampVerificationTokenResponse, type PaymentIntent, type PaymentIntentDepositAddress, type PaymentIntentExecutionsResponse, type PaymentIntentStatus, type PaymentIntentType, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProductType, type ProjectConfigResponse, type ProviderSelectedData, type PublicIncidentResponse, QUOTE_REFRESH_INTERVAL_MS, type QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, type RequestCoinbaseApplePayLimitUpgradeRequest, type RequestCoinbaseApplePayLimitUpgradeResponse, type RequestCoinbaseWalletPayLimitUpgradeRequest, type RequestCoinbaseWalletPayLimitUpgradeResponse, SCAN_NUDGE_INTERVAL_MS, SOLANA_USDC_ADDRESS, type SendHypercoreTransactionRequest, type SendHypercoreTransactionResponse, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SourceToken, type SourceTokenNetwork, type StartIntegrationOAuthResult, type StripeAccessTokenResponse, StripeApiResponseError, type StripeAuthIntentResponse, type StripeConfigResponse, type StripeConfirmRequest, type StripeConsumerWallet, type StripeCreateSessionRequest, type StripeCryptoCustomer, type StripeCustomerVerification, type StripeDefaultTokenResponse, type StripeListResponse, type StripeOnrampErrorType, type StripeOnrampSession, type StripeOnrampTransactionDetails, type StripePaymentToken, type StripeQuoteRequest, type StripeQuotesResponse, type StripeTransactionLimitEntry, type StripeTransactionLimitsResponse, type SupportedChain, type SupportedDepositTokensParams, type SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenDisplayMetadata, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TokenPriceResponse, type TokenSelectedData, type TransferDefaultTokenParams, type TransferDefaultTokenResult, UnifoldClient, type UnifoldClientOptions, type UserIpInfo, type VerificationData, type VerifyAddressParams, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletConnectionData, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WalletPayLimitUpgradeStatus, type WalletPayMethod, type WalletPayProvider, type WalletPayProvidersResponse, type WalletSelectedData, type WithdrawDirectExecutionFailedEvent, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, type WithdrawFlowStartedData, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createCoinbaseGooglePaySession, createCoinbaseWalletPaySession, createDepositAddress, createExchangeSession, createIntegrationExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, createUnifoldClient, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayLimitUpgradeStatus, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseApplePayLimits, getCoinbaseLegalAgreements, getCoinbaseWalletPayLimits, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getFiatExchangeRates, getGooglePayLimitUpgradeStatus, getGooglePayProviders, getIconUrl, getIconUrlWithCdn, getIntegrationExchangeSessionStartUrl, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampSessionStatus, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getPublicIncident, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getTokenPrice, getWalletByChainType, getWalletMobileDeepLink, getWalletPayLimitUpgradeStatus, getWalletPayProviders, i18n, isApplePayLimitReached, isDepositAddressValidationError, isGooglePayLimitReached, isWalletPayLimitReached, listPaymentIntentExecutions, mapDefaultOnrampToken, mapDirectExecution, mapOnrampQuote, mapWalletToDepositAddress, pollDirectExecutions, queryExecutions, refreshIntegrationToken, requestCoinbaseApplePayLimitUpgrade, requestCoinbaseWalletPayLimitUpgrade, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendOnrampVerificationOtp, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeGetTransactionLimits, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp, verifyOnrampVerificationOtp, verifyRecipientAddress };
package/dist/index.d.ts CHANGED
@@ -249,7 +249,30 @@ interface SupportedDestinationTokensResponse {
249
249
  */
250
250
  declare function getSupportedDestinationTokens(publishableKey?: string, options?: {
251
251
  product_type?: ProductType;
252
+ /** Which surface the list is for; only read alongside `source_chain_type`. */
253
+ action_type?: ActionType;
254
+ /**
255
+ * Chain the funds are being sent from. With `action_type: withdraw`,
256
+ * destinations this source can't reach are omitted — a withdrawal that has
257
+ * to be bridged off its source chain (N1) can't land back on it.
258
+ */
259
+ source_chain_type?: ChainType;
252
260
  }): Promise<SupportedDestinationTokensResponse>;
261
+ /**
262
+ * Fiat currency a stablecoin is pegged to (lowercase ISO 4217). Mirrors the
263
+ * API's `FiatCurrency` enum; kept as a local union here because the SDK cannot
264
+ * import server-side types across the package boundary. Named distinctly from
265
+ * the onramp `FiatCurrency` object interface below.
266
+ *
267
+ * This is intentionally an OPEN union: `'usd'` and `'eur'` are listed for
268
+ * editor autocomplete, but the `(string & Record<never, never>)` member keeps
269
+ * the type forward-compatible. If the backend later adds a new fiat currency
270
+ * (e.g. `'gbp'`), an older SDK build still type-checks — the new value is a
271
+ * valid `string`, so consumers can compare/handle it without a TS error and
272
+ * without needing to upgrade. Always treat unknown values defensively rather
273
+ * than assuming USD.
274
+ */
275
+ type StablecoinFiatCurrency = 'usd' | 'eur' | (string & Record<never, never>);
253
276
  interface SupportedToken {
254
277
  symbol: string;
255
278
  /** Slugged `symbol` (e.g. "usdc", "usdc_e", "usdc_perp"). */
@@ -258,6 +281,12 @@ interface SupportedToken {
258
281
  icon_url: string;
259
282
  is_newly_added: boolean;
260
283
  is_stablecoin: boolean;
284
+ /**
285
+ * Fiat currency a stablecoin tracks (e.g. "usd", "eur"). Present only for
286
+ * stablecoins. Consumers must not assume a stablecoin is USD-denominated —
287
+ * check this before treating a token amount as a USD amount.
288
+ */
289
+ stablecoin_fiat_currency?: StablecoinFiatCurrency;
261
290
  chains: SupportedChain[];
262
291
  }
263
292
  interface SupportedDepositTokensResponse {
@@ -272,6 +301,12 @@ declare function getSupportedDepositTokens(publishableKey?: string, options?: {
272
301
  destination_chain_id?: string;
273
302
  destination_chain_type?: string;
274
303
  product_type?: ProductType;
304
+ /**
305
+ * Pass `withdraw` to also get chains that are only valid as a withdrawal
306
+ * source (their funds are bridged onto a settlement chain) and are never
307
+ * routable deposit sources.
308
+ */
309
+ action_type?: ActionType;
275
310
  }): Promise<SupportedDepositTokensResponse>;
276
311
  interface TokenMetadata {
277
312
  symbol: string;
@@ -283,6 +318,8 @@ interface TokenMetadata {
283
318
  chain_id: string;
284
319
  token_address: string;
285
320
  decimals: number;
321
+ /** Catalog classification from `/v1/public/tokens/token`. */
322
+ is_stablecoin?: boolean;
286
323
  chain_icon_url: string;
287
324
  chain_icon_urls: IconUrl[];
288
325
  }
@@ -336,6 +373,24 @@ declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenc
336
373
  declare function getFiatExchangeRates(options?: {
337
374
  currencies?: string[];
338
375
  }, publishableKey?: string): Promise<FiatExchangeRatesResponse>;
376
+ interface TokenPriceResponse {
377
+ data: {
378
+ chain_type: string;
379
+ chain_id: string;
380
+ token_address: string;
381
+ price: number;
382
+ currency: string;
383
+ };
384
+ }
385
+ /**
386
+ * Get the current USD price of a token.
387
+ *
388
+ * @param chainType - Chain type ('ethereum', 'solana', ...)
389
+ * @param chainId - Chain ID (e.g. "8453", "mainnet")
390
+ * @param tokenAddress - Token contract address or "native"
391
+ * @param publishableKey - Optional publishable key, defaults to configured key
392
+ */
393
+ declare function getTokenPrice(chainType: ChainType, chainId: string, tokenAddress: string, publishableKey?: string): Promise<TokenPriceResponse>;
339
394
  interface OnrampQuote {
340
395
  transaction_type: string;
341
396
  source_amount: number;
@@ -368,6 +423,8 @@ interface OnrampQuote {
368
423
  institution_name: string | null;
369
424
  low_kyc: boolean;
370
425
  partner_fee: number | null;
426
+ /** Seconds. Same unit as token `estimated_processing_time`. */
427
+ estimated_processing_time: number;
371
428
  }
372
429
  interface OnrampQuotesRequest {
373
430
  country_code: string;
@@ -1570,7 +1627,16 @@ interface DepositQuoteRequest {
1570
1627
  source_chain_type: string;
1571
1628
  source_chain_id: string;
1572
1629
  source_token_address: string;
1573
- destination_amount: string;
1630
+ /**
1631
+ * Source amount to spend, in base units. Mutually exclusive with
1632
+ * `destination_amount` — provide exactly one. Selects an exact-in quote.
1633
+ */
1634
+ source_amount?: string;
1635
+ /**
1636
+ * Desired destination amount in base units. Mutually exclusive with
1637
+ * `source_amount` — provide exactly one. Selects an exact-out quote.
1638
+ */
1639
+ destination_amount?: string;
1574
1640
  destination_chain_type: string;
1575
1641
  destination_chain_id: string;
1576
1642
  destination_token_address: string;
@@ -1614,10 +1680,26 @@ interface DepositQuote {
1614
1680
  * `adjust_for_slippage`.
1615
1681
  */
1616
1682
  expected_slippage_percent: number | null;
1683
+ /**
1684
+ * Platform fee the depositor will pay, as a percentage
1685
+ * (`basis_point / 100`, e.g. 50 bps → 0.5 for 0.50%).
1686
+ * Null when the project's organization has no active billing subscription.
1687
+ * Optional so older API responses (and checkout clients that ignore it) stay compatible.
1688
+ */
1689
+ platform_fee_percent?: number | null;
1690
+ /**
1691
+ * Estimated platform fee in USD (`source_amount_usd × basis_point / 10000`).
1692
+ * Null when the percent is unknown or the quote has no USD figure.
1693
+ */
1694
+ platform_fee_usd?: string | null;
1617
1695
  }
1618
1696
  /**
1619
- * Get a deposit quote: how much source token is needed to receive a
1620
- * specific destination amount, accounting for bridge fees and slippage.
1697
+ * Get a deposit quote in either direction.
1698
+ *
1699
+ * Provide exactly one of `source_amount` (exact-in: how much lands for this
1700
+ * input) or `destination_amount` (exact-out: how much must be sent to receive
1701
+ * this output). The response includes the quote plus the project's platform
1702
+ * fee from billing, as a percentage.
1621
1703
  * Results are cached server-side for 1 minute.
1622
1704
  */
1623
1705
  declare function getDepositQuote(request: DepositQuoteRequest, publishableKey?: string): Promise<DepositQuote>;
@@ -1843,6 +1925,7 @@ interface StripeQuotesResponse {
1843
1925
  destination_network: string;
1844
1926
  service_provider: string;
1845
1927
  service_provider_display_name: string;
1928
+ estimated_processing_time: number;
1846
1929
  destination_network_quotes: Record<string, unknown[]>;
1847
1930
  }
1848
1931
  /**
@@ -2840,6 +2923,8 @@ interface OnrampProviderQuote {
2840
2923
  iconUrl: string;
2841
2924
  iconUrls: IconUrl[];
2842
2925
  institutionName: string | null;
2926
+ /** Seconds. Same unit as token `estimatedProcessingTime`. */
2927
+ estimatedProcessingTime: number;
2843
2928
  }
2844
2929
  /** Map a wire {@link OnrampQuote} to the SDK-facing {@link OnrampProviderQuote}. */
2845
2930
  declare function mapOnrampQuote(quote: OnrampQuote): OnrampProviderQuote;
@@ -3914,4 +3999,4 @@ declare const i18n: {
3914
3999
  };
3915
4000
  type I18nStrings = typeof i18n;
3916
4001
 
3917
- export { type AccountConnectionData, ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AddressVerification, type ApplePayLimitUpgradeStatus, type ApplePayProvider, type ApplePayProvidersResponse, type AuthenticateOAuthResult, type AutoSwapRequest, type AutoSwapResponse, type BankTransferConfig, type BankTransferProvider, type BankTransferProvidersResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type CheckoutEvent, CheckoutEventType, type CheckoutFlowFailedData, type CheckoutFlowStartedData, type CheckoutMethod, type CheckoutMethodSelectedData, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePayLimit, type CoinbaseApplePayLimitUpgradeOption, type CoinbaseApplePayLimitsResponse, type CoinbaseApplePaySessionResponse, type CoinbaseGooglePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type CoinbaseWalletPayLimit, type CoinbaseWalletPayLimitUpgradeOption, type CoinbaseWalletPayLimitsResponse, type CoinbaseWalletPaySessionResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateCoinbaseGooglePaySessionRequest, type CreateCoinbaseWalletPaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationExchangeSessionRequest, type CreateIntegrationExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, DETECTION_ARM_DELAY_MS, DETECTION_POLL_INTERVAL_MS, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddress, type DepositAddressParams, type DepositAddressResponse, DepositAddressValidationError, type DepositEvent, DepositEventType, type DepositFlowFailedData, type DepositFlowStartedData, type DepositLimitReachedData, type DepositMethod, type DepositMethodSelectedData, type DepositQuote, type DepositQuoteRequest, DepositSession, type DepositSessionConfig, type DepositSessionDestination, type DepositSessionError, type DepositSessionErrorCode, type DepositSessionEvent, type DepositSessionEventMap, DepositSessionEventType, type DepositSessionParams, type DepositSessionSnapshot, type DepositSessionStatus, DepositSessionWaitError, type DepositSessionWaitErrorCode, type DepositSessionWaitOptions, type DestinationToken, type DestinationTokenChain, type DirectExecution, DirectExecutionEventType, type DirectExecutionFailedEvent, type DirectExecutionResponse, type DirectExecutionSucceededEvent, type EvmContractCall, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type ExternalWalletChainType, type ExternalWalletInfo, type ExternalWalletsResponse, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetBankTransferProvidersOptions, type GetExchangesQuery, type GetIntegrationExchangesQuery, type GooglePayProvider, type GooglePayProvidersResponse, type HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationConnectionMethod, type IntegrationExchangeInfo, type IntegrationExchangeSessionStartParams, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, IntegrationTransferError, type IntegrationTransferErrorType, type IpAddressResponse, LOOKBACK_MS, type ListExecutionsParams, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampCheckout, type OnrampDestinationToken, type OnrampProviderQuote, type OnrampQuote, type OnrampQuoteRequest, type OnrampQuotesRequest, type OnrampQuotesResponse, OnrampSession, type OnrampSessionConfig, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionError, type OnrampSessionErrorCode, type OnrampSessionEvent, type OnrampSessionEventMap, OnrampSessionEventType, type OnrampSessionParams, type OnrampSessionPaymentMethod, type OnrampSessionPaymentMethodType, type OnrampSessionRequest, type OnrampSessionResponse, type OnrampSessionSnapshot, type OnrampSessionStatus, type OnrampSessionStatusResponse, type OnrampSessionStatusValue, OnrampSessionWaitError, type OnrampSessionWaitErrorCode, type OnrampSessionWaitOptions, type OnrampVerificationFactor, type OnrampVerificationFactorStatus, type OnrampVerificationSession, type OnrampVerificationStatus, type OnrampVerificationTokenResponse, type PaymentIntent, type PaymentIntentDepositAddress, type PaymentIntentExecutionsResponse, type PaymentIntentStatus, type PaymentIntentType, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProductType, type ProjectConfigResponse, type ProviderSelectedData, type PublicIncidentResponse, QUOTE_REFRESH_INTERVAL_MS, type QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, type RequestCoinbaseApplePayLimitUpgradeRequest, type RequestCoinbaseApplePayLimitUpgradeResponse, type RequestCoinbaseWalletPayLimitUpgradeRequest, type RequestCoinbaseWalletPayLimitUpgradeResponse, SCAN_NUDGE_INTERVAL_MS, SOLANA_USDC_ADDRESS, type SendHypercoreTransactionRequest, type SendHypercoreTransactionResponse, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SourceToken, type SourceTokenNetwork, type StartIntegrationOAuthResult, type StripeAccessTokenResponse, StripeApiResponseError, type StripeAuthIntentResponse, type StripeConfigResponse, type StripeConfirmRequest, type StripeConsumerWallet, type StripeCreateSessionRequest, type StripeCryptoCustomer, type StripeCustomerVerification, type StripeDefaultTokenResponse, type StripeListResponse, type StripeOnrampErrorType, type StripeOnrampSession, type StripeOnrampTransactionDetails, type StripePaymentToken, type StripeQuoteRequest, type StripeQuotesResponse, type StripeTransactionLimitEntry, type StripeTransactionLimitsResponse, type SupportedChain, type SupportedDepositTokensParams, type SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenDisplayMetadata, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TokenSelectedData, type TransferDefaultTokenParams, type TransferDefaultTokenResult, UnifoldClient, type UnifoldClientOptions, type UserIpInfo, type VerificationData, type VerifyAddressParams, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletConnectionData, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WalletPayLimitUpgradeStatus, type WalletPayMethod, type WalletPayProvider, type WalletPayProvidersResponse, type WalletSelectedData, type WithdrawDirectExecutionFailedEvent, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, type WithdrawFlowStartedData, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createCoinbaseGooglePaySession, createCoinbaseWalletPaySession, createDepositAddress, createExchangeSession, createIntegrationExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, createUnifoldClient, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayLimitUpgradeStatus, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseApplePayLimits, getCoinbaseLegalAgreements, getCoinbaseWalletPayLimits, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getFiatExchangeRates, getGooglePayLimitUpgradeStatus, getGooglePayProviders, getIconUrl, getIconUrlWithCdn, getIntegrationExchangeSessionStartUrl, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampSessionStatus, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getPublicIncident, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, getWalletPayLimitUpgradeStatus, getWalletPayProviders, i18n, isApplePayLimitReached, isDepositAddressValidationError, isGooglePayLimitReached, isWalletPayLimitReached, listPaymentIntentExecutions, mapDefaultOnrampToken, mapDirectExecution, mapOnrampQuote, mapWalletToDepositAddress, pollDirectExecutions, queryExecutions, refreshIntegrationToken, requestCoinbaseApplePayLimitUpgrade, requestCoinbaseWalletPayLimitUpgrade, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendOnrampVerificationOtp, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeGetTransactionLimits, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp, verifyOnrampVerificationOtp, verifyRecipientAddress };
4002
+ export { type AccountConnectionData, ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AddressVerification, type ApplePayLimitUpgradeStatus, type ApplePayProvider, type ApplePayProvidersResponse, type AuthenticateOAuthResult, type AutoSwapRequest, type AutoSwapResponse, type BankTransferConfig, type BankTransferProvider, type BankTransferProvidersResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type CheckoutEvent, CheckoutEventType, type CheckoutFlowFailedData, type CheckoutFlowStartedData, type CheckoutMethod, type CheckoutMethodSelectedData, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePayLimit, type CoinbaseApplePayLimitUpgradeOption, type CoinbaseApplePayLimitsResponse, type CoinbaseApplePaySessionResponse, type CoinbaseGooglePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type CoinbaseWalletPayLimit, type CoinbaseWalletPayLimitUpgradeOption, type CoinbaseWalletPayLimitsResponse, type CoinbaseWalletPaySessionResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateCoinbaseGooglePaySessionRequest, type CreateCoinbaseWalletPaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationExchangeSessionRequest, type CreateIntegrationExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, DETECTION_ARM_DELAY_MS, DETECTION_POLL_INTERVAL_MS, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddress, type DepositAddressParams, type DepositAddressResponse, DepositAddressValidationError, type DepositEvent, DepositEventType, type DepositFlowFailedData, type DepositFlowStartedData, type DepositLimitReachedData, type DepositMethod, type DepositMethodSelectedData, type DepositQuote, type DepositQuoteRequest, DepositSession, type DepositSessionConfig, type DepositSessionDestination, type DepositSessionError, type DepositSessionErrorCode, type DepositSessionEvent, type DepositSessionEventMap, DepositSessionEventType, type DepositSessionParams, type DepositSessionSnapshot, type DepositSessionStatus, DepositSessionWaitError, type DepositSessionWaitErrorCode, type DepositSessionWaitOptions, type DestinationToken, type DestinationTokenChain, type DirectExecution, DirectExecutionEventType, type DirectExecutionFailedEvent, type DirectExecutionResponse, type DirectExecutionSucceededEvent, type EvmContractCall, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type ExternalWalletChainType, type ExternalWalletInfo, type ExternalWalletsResponse, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetBankTransferProvidersOptions, type GetExchangesQuery, type GetIntegrationExchangesQuery, type GooglePayProvider, type GooglePayProvidersResponse, type HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationConnectionMethod, type IntegrationExchangeInfo, type IntegrationExchangeSessionStartParams, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, IntegrationTransferError, type IntegrationTransferErrorType, type IpAddressResponse, LOOKBACK_MS, type ListExecutionsParams, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampCheckout, type OnrampDestinationToken, type OnrampProviderQuote, type OnrampQuote, type OnrampQuoteRequest, type OnrampQuotesRequest, type OnrampQuotesResponse, OnrampSession, type OnrampSessionConfig, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionError, type OnrampSessionErrorCode, type OnrampSessionEvent, type OnrampSessionEventMap, OnrampSessionEventType, type OnrampSessionParams, type OnrampSessionPaymentMethod, type OnrampSessionPaymentMethodType, type OnrampSessionRequest, type OnrampSessionResponse, type OnrampSessionSnapshot, type OnrampSessionStatus, type OnrampSessionStatusResponse, type OnrampSessionStatusValue, OnrampSessionWaitError, type OnrampSessionWaitErrorCode, type OnrampSessionWaitOptions, type OnrampVerificationFactor, type OnrampVerificationFactorStatus, type OnrampVerificationSession, type OnrampVerificationStatus, type OnrampVerificationTokenResponse, type PaymentIntent, type PaymentIntentDepositAddress, type PaymentIntentExecutionsResponse, type PaymentIntentStatus, type PaymentIntentType, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProductType, type ProjectConfigResponse, type ProviderSelectedData, type PublicIncidentResponse, QUOTE_REFRESH_INTERVAL_MS, type QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, type RequestCoinbaseApplePayLimitUpgradeRequest, type RequestCoinbaseApplePayLimitUpgradeResponse, type RequestCoinbaseWalletPayLimitUpgradeRequest, type RequestCoinbaseWalletPayLimitUpgradeResponse, SCAN_NUDGE_INTERVAL_MS, SOLANA_USDC_ADDRESS, type SendHypercoreTransactionRequest, type SendHypercoreTransactionResponse, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SourceToken, type SourceTokenNetwork, type StartIntegrationOAuthResult, type StripeAccessTokenResponse, StripeApiResponseError, type StripeAuthIntentResponse, type StripeConfigResponse, type StripeConfirmRequest, type StripeConsumerWallet, type StripeCreateSessionRequest, type StripeCryptoCustomer, type StripeCustomerVerification, type StripeDefaultTokenResponse, type StripeListResponse, type StripeOnrampErrorType, type StripeOnrampSession, type StripeOnrampTransactionDetails, type StripePaymentToken, type StripeQuoteRequest, type StripeQuotesResponse, type StripeTransactionLimitEntry, type StripeTransactionLimitsResponse, type SupportedChain, type SupportedDepositTokensParams, type SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenDisplayMetadata, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TokenPriceResponse, type TokenSelectedData, type TransferDefaultTokenParams, type TransferDefaultTokenResult, UnifoldClient, type UnifoldClientOptions, type UserIpInfo, type VerificationData, type VerifyAddressParams, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletConnectionData, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WalletPayLimitUpgradeStatus, type WalletPayMethod, type WalletPayProvider, type WalletPayProvidersResponse, type WalletSelectedData, type WithdrawDirectExecutionFailedEvent, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, type WithdrawFlowStartedData, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createCoinbaseGooglePaySession, createCoinbaseWalletPaySession, createDepositAddress, createExchangeSession, createIntegrationExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, createUnifoldClient, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayLimitUpgradeStatus, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseApplePayLimits, getCoinbaseLegalAgreements, getCoinbaseWalletPayLimits, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getFiatExchangeRates, getGooglePayLimitUpgradeStatus, getGooglePayProviders, getIconUrl, getIconUrlWithCdn, getIntegrationExchangeSessionStartUrl, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampSessionStatus, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getPublicIncident, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getTokenPrice, getWalletByChainType, getWalletMobileDeepLink, getWalletPayLimitUpgradeStatus, getWalletPayProviders, i18n, isApplePayLimitReached, isDepositAddressValidationError, isGooglePayLimitReached, isWalletPayLimitReached, listPaymentIntentExecutions, mapDefaultOnrampToken, mapDirectExecution, mapOnrampQuote, mapWalletToDepositAddress, pollDirectExecutions, queryExecutions, refreshIntegrationToken, requestCoinbaseApplePayLimitUpgrade, requestCoinbaseWalletPayLimitUpgrade, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendOnrampVerificationOtp, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeGetTransactionLimits, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp, verifyOnrampVerificationOtp, verifyRecipientAddress };
package/dist/index.js CHANGED
@@ -106,6 +106,7 @@ __export(index_exports, {
106
106
  getSupportedDestinationTokens: () => getSupportedDestinationTokens,
107
107
  getTokenChains: () => getTokenChains,
108
108
  getTokenMetadata: () => getTokenMetadata,
109
+ getTokenPrice: () => getTokenPrice,
109
110
  getWalletByChainType: () => getWalletByChainType,
110
111
  getWalletMobileDeepLink: () => getWalletMobileDeepLink,
111
112
  getWalletPayLimitUpgradeStatus: () => getWalletPayLimitUpgradeStatus,
@@ -191,7 +192,7 @@ function generatePrefixedKSUID(prefix) {
191
192
  }
192
193
 
193
194
  // src/lib/client-headers.ts
194
- var SDK_VERSION = true ? "0.1.79" : "0.0.0-dev";
195
+ var SDK_VERSION = true ? "0.1.81" : "0.0.0-dev";
195
196
  var CLIENT_VERSION_HEADER = "x-unifold-client-version";
196
197
  var CLIENT_USER_AGENT_HEADER = "x-unifold-client-user-agent";
197
198
  function detectRuntime() {
@@ -435,6 +436,12 @@ async function getSupportedDestinationTokens(publishableKey, options) {
435
436
  if (options?.product_type) {
436
437
  params.set("product_type", options.product_type);
437
438
  }
439
+ if (options?.action_type) {
440
+ params.set("action_type", options.action_type);
441
+ }
442
+ if (options?.source_chain_type) {
443
+ params.set("source_chain_type", options.source_chain_type);
444
+ }
438
445
  const qs = params.toString();
439
446
  if (qs) {
440
447
  url = `${url}?${qs}`;
@@ -464,6 +471,9 @@ async function getSupportedDepositTokens(publishableKey, options) {
464
471
  if (options?.product_type) {
465
472
  params.set("product_type", options.product_type);
466
473
  }
474
+ if (options?.action_type) {
475
+ params.set("action_type", options.action_type);
476
+ }
467
477
  const qs = params.toString();
468
478
  if (qs) {
469
479
  url = `${url}?${qs}`;
@@ -546,6 +556,27 @@ async function getFiatExchangeRates(options = {}, publishableKey) {
546
556
  }
547
557
  return response.json();
548
558
  }
559
+ async function getTokenPrice(chainType, chainId, tokenAddress, publishableKey) {
560
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
561
+ validatePublishableKey(pk);
562
+ const params = new URLSearchParams({
563
+ chain_type: chainType,
564
+ chain_id: chainId,
565
+ token_address: tokenAddress
566
+ });
567
+ const url = `${API_BASE_URL}/v1/public/exchange_rates/token?${params.toString()}`;
568
+ const response = await apiFetch(url, {
569
+ method: "GET",
570
+ headers: {
571
+ accept: "application/json",
572
+ "x-publishable-key": pk
573
+ }
574
+ });
575
+ if (!response.ok) {
576
+ throw new Error(`Failed to fetch token price: ${response.statusText}`);
577
+ }
578
+ return response.json();
579
+ }
549
580
  async function getOnrampQuotes(request, publishableKey) {
550
581
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
551
582
  validatePublishableKey(pk);
@@ -2125,7 +2156,8 @@ function mapOnrampQuote(quote) {
2125
2156
  lowKyc: quote.low_kyc,
2126
2157
  iconUrl: quote.icon_url,
2127
2158
  iconUrls: quote.icon_urls,
2128
- institutionName: quote.institution_name
2159
+ institutionName: quote.institution_name,
2160
+ estimatedProcessingTime: quote.estimated_processing_time
2129
2161
  };
2130
2162
  }
2131
2163
  function mapDefaultOnrampToken(response) {
@@ -4097,6 +4129,7 @@ var i18n = en_default;
4097
4129
  getSupportedDestinationTokens,
4098
4130
  getTokenChains,
4099
4131
  getTokenMetadata,
4132
+ getTokenPrice,
4100
4133
  getWalletByChainType,
4101
4134
  getWalletMobileDeepLink,
4102
4135
  getWalletPayLimitUpgradeStatus,
package/dist/index.mjs CHANGED
@@ -41,7 +41,7 @@ function generatePrefixedKSUID(prefix) {
41
41
  }
42
42
 
43
43
  // src/lib/client-headers.ts
44
- var SDK_VERSION = true ? "0.1.79" : "0.0.0-dev";
44
+ var SDK_VERSION = true ? "0.1.81" : "0.0.0-dev";
45
45
  var CLIENT_VERSION_HEADER = "x-unifold-client-version";
46
46
  var CLIENT_USER_AGENT_HEADER = "x-unifold-client-user-agent";
47
47
  function detectRuntime() {
@@ -285,6 +285,12 @@ async function getSupportedDestinationTokens(publishableKey, options) {
285
285
  if (options?.product_type) {
286
286
  params.set("product_type", options.product_type);
287
287
  }
288
+ if (options?.action_type) {
289
+ params.set("action_type", options.action_type);
290
+ }
291
+ if (options?.source_chain_type) {
292
+ params.set("source_chain_type", options.source_chain_type);
293
+ }
288
294
  const qs = params.toString();
289
295
  if (qs) {
290
296
  url = `${url}?${qs}`;
@@ -314,6 +320,9 @@ async function getSupportedDepositTokens(publishableKey, options) {
314
320
  if (options?.product_type) {
315
321
  params.set("product_type", options.product_type);
316
322
  }
323
+ if (options?.action_type) {
324
+ params.set("action_type", options.action_type);
325
+ }
317
326
  const qs = params.toString();
318
327
  if (qs) {
319
328
  url = `${url}?${qs}`;
@@ -396,6 +405,27 @@ async function getFiatExchangeRates(options = {}, publishableKey) {
396
405
  }
397
406
  return response.json();
398
407
  }
408
+ async function getTokenPrice(chainType, chainId, tokenAddress, publishableKey) {
409
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
410
+ validatePublishableKey(pk);
411
+ const params = new URLSearchParams({
412
+ chain_type: chainType,
413
+ chain_id: chainId,
414
+ token_address: tokenAddress
415
+ });
416
+ const url = `${API_BASE_URL}/v1/public/exchange_rates/token?${params.toString()}`;
417
+ const response = await apiFetch(url, {
418
+ method: "GET",
419
+ headers: {
420
+ accept: "application/json",
421
+ "x-publishable-key": pk
422
+ }
423
+ });
424
+ if (!response.ok) {
425
+ throw new Error(`Failed to fetch token price: ${response.statusText}`);
426
+ }
427
+ return response.json();
428
+ }
399
429
  async function getOnrampQuotes(request, publishableKey) {
400
430
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
401
431
  validatePublishableKey(pk);
@@ -1975,7 +2005,8 @@ function mapOnrampQuote(quote) {
1975
2005
  lowKyc: quote.low_kyc,
1976
2006
  iconUrl: quote.icon_url,
1977
2007
  iconUrls: quote.icon_urls,
1978
- institutionName: quote.institution_name
2008
+ institutionName: quote.institution_name,
2009
+ estimatedProcessingTime: quote.estimated_processing_time
1979
2010
  };
1980
2011
  }
1981
2012
  function mapDefaultOnrampToken(response) {
@@ -3946,6 +3977,7 @@ export {
3946
3977
  getSupportedDestinationTokens,
3947
3978
  getTokenChains,
3948
3979
  getTokenMetadata,
3980
+ getTokenPrice,
3949
3981
  getWalletByChainType,
3950
3982
  getWalletMobileDeepLink,
3951
3983
  getWalletPayLimitUpgradeStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.79",
3
+ "version": "0.1.81",
4
4
  "description": "Unifold Core SDK - Core types, API client, and business logic",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",