@unifold/core 0.1.78 → 0.1.80

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,6 +249,14 @@ 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>;
253
261
  interface SupportedToken {
254
262
  symbol: string;
@@ -272,6 +280,12 @@ declare function getSupportedDepositTokens(publishableKey?: string, options?: {
272
280
  destination_chain_id?: string;
273
281
  destination_chain_type?: string;
274
282
  product_type?: ProductType;
283
+ /**
284
+ * Pass `withdraw` to also get chains that are only valid as a withdrawal
285
+ * source (their funds are bridged onto a settlement chain) and are never
286
+ * routable deposit sources.
287
+ */
288
+ action_type?: ActionType;
275
289
  }): Promise<SupportedDepositTokensResponse>;
276
290
  interface TokenMetadata {
277
291
  symbol: string;
@@ -336,6 +350,24 @@ declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenc
336
350
  declare function getFiatExchangeRates(options?: {
337
351
  currencies?: string[];
338
352
  }, publishableKey?: string): Promise<FiatExchangeRatesResponse>;
353
+ interface TokenPriceResponse {
354
+ data: {
355
+ chain_type: string;
356
+ chain_id: string;
357
+ token_address: string;
358
+ price: number;
359
+ currency: string;
360
+ };
361
+ }
362
+ /**
363
+ * Get the current USD price of a token.
364
+ *
365
+ * @param chainType - Chain type ('ethereum', 'solana', ...)
366
+ * @param chainId - Chain ID (e.g. "8453", "mainnet")
367
+ * @param tokenAddress - Token contract address or "native"
368
+ * @param publishableKey - Optional publishable key, defaults to configured key
369
+ */
370
+ declare function getTokenPrice(chainType: ChainType, chainId: string, tokenAddress: string, publishableKey?: string): Promise<TokenPriceResponse>;
339
371
  interface OnrampQuote {
340
372
  transaction_type: string;
341
373
  source_amount: number;
@@ -1570,7 +1602,16 @@ interface DepositQuoteRequest {
1570
1602
  source_chain_type: string;
1571
1603
  source_chain_id: string;
1572
1604
  source_token_address: string;
1573
- destination_amount: string;
1605
+ /**
1606
+ * Source amount to spend, in base units. Mutually exclusive with
1607
+ * `destination_amount` — provide exactly one. Selects an exact-in quote.
1608
+ */
1609
+ source_amount?: string;
1610
+ /**
1611
+ * Desired destination amount in base units. Mutually exclusive with
1612
+ * `source_amount` — provide exactly one. Selects an exact-out quote.
1613
+ */
1614
+ destination_amount?: string;
1574
1615
  destination_chain_type: string;
1575
1616
  destination_chain_id: string;
1576
1617
  destination_token_address: string;
@@ -1614,10 +1655,26 @@ interface DepositQuote {
1614
1655
  * `adjust_for_slippage`.
1615
1656
  */
1616
1657
  expected_slippage_percent: number | null;
1658
+ /**
1659
+ * Platform fee the depositor will pay, as a percentage
1660
+ * (`basis_point / 100`, e.g. 50 bps → 0.5 for 0.50%).
1661
+ * Null when the project's organization has no active billing subscription.
1662
+ * Optional so older API responses (and checkout clients that ignore it) stay compatible.
1663
+ */
1664
+ platform_fee_percent?: number | null;
1665
+ /**
1666
+ * Estimated platform fee in USD (`source_amount_usd × basis_point / 10000`).
1667
+ * Null when the percent is unknown or the quote has no USD figure.
1668
+ */
1669
+ platform_fee_usd?: string | null;
1617
1670
  }
1618
1671
  /**
1619
- * Get a deposit quote: how much source token is needed to receive a
1620
- * specific destination amount, accounting for bridge fees and slippage.
1672
+ * Get a deposit quote in either direction.
1673
+ *
1674
+ * Provide exactly one of `source_amount` (exact-in: how much lands for this
1675
+ * input) or `destination_amount` (exact-out: how much must be sent to receive
1676
+ * this output). The response includes the quote plus the project's platform
1677
+ * fee from billing, as a percentage.
1621
1678
  * Results are cached server-side for 1 minute.
1622
1679
  */
1623
1680
  declare function getDepositQuote(request: DepositQuoteRequest, publishableKey?: string): Promise<DepositQuote>;
@@ -3914,4 +3971,4 @@ declare const i18n: {
3914
3971
  };
3915
3972
  type I18nStrings = typeof i18n;
3916
3973
 
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 };
3974
+ 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,6 +249,14 @@ 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>;
253
261
  interface SupportedToken {
254
262
  symbol: string;
@@ -272,6 +280,12 @@ declare function getSupportedDepositTokens(publishableKey?: string, options?: {
272
280
  destination_chain_id?: string;
273
281
  destination_chain_type?: string;
274
282
  product_type?: ProductType;
283
+ /**
284
+ * Pass `withdraw` to also get chains that are only valid as a withdrawal
285
+ * source (their funds are bridged onto a settlement chain) and are never
286
+ * routable deposit sources.
287
+ */
288
+ action_type?: ActionType;
275
289
  }): Promise<SupportedDepositTokensResponse>;
276
290
  interface TokenMetadata {
277
291
  symbol: string;
@@ -336,6 +350,24 @@ declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenc
336
350
  declare function getFiatExchangeRates(options?: {
337
351
  currencies?: string[];
338
352
  }, publishableKey?: string): Promise<FiatExchangeRatesResponse>;
353
+ interface TokenPriceResponse {
354
+ data: {
355
+ chain_type: string;
356
+ chain_id: string;
357
+ token_address: string;
358
+ price: number;
359
+ currency: string;
360
+ };
361
+ }
362
+ /**
363
+ * Get the current USD price of a token.
364
+ *
365
+ * @param chainType - Chain type ('ethereum', 'solana', ...)
366
+ * @param chainId - Chain ID (e.g. "8453", "mainnet")
367
+ * @param tokenAddress - Token contract address or "native"
368
+ * @param publishableKey - Optional publishable key, defaults to configured key
369
+ */
370
+ declare function getTokenPrice(chainType: ChainType, chainId: string, tokenAddress: string, publishableKey?: string): Promise<TokenPriceResponse>;
339
371
  interface OnrampQuote {
340
372
  transaction_type: string;
341
373
  source_amount: number;
@@ -1570,7 +1602,16 @@ interface DepositQuoteRequest {
1570
1602
  source_chain_type: string;
1571
1603
  source_chain_id: string;
1572
1604
  source_token_address: string;
1573
- destination_amount: string;
1605
+ /**
1606
+ * Source amount to spend, in base units. Mutually exclusive with
1607
+ * `destination_amount` — provide exactly one. Selects an exact-in quote.
1608
+ */
1609
+ source_amount?: string;
1610
+ /**
1611
+ * Desired destination amount in base units. Mutually exclusive with
1612
+ * `source_amount` — provide exactly one. Selects an exact-out quote.
1613
+ */
1614
+ destination_amount?: string;
1574
1615
  destination_chain_type: string;
1575
1616
  destination_chain_id: string;
1576
1617
  destination_token_address: string;
@@ -1614,10 +1655,26 @@ interface DepositQuote {
1614
1655
  * `adjust_for_slippage`.
1615
1656
  */
1616
1657
  expected_slippage_percent: number | null;
1658
+ /**
1659
+ * Platform fee the depositor will pay, as a percentage
1660
+ * (`basis_point / 100`, e.g. 50 bps → 0.5 for 0.50%).
1661
+ * Null when the project's organization has no active billing subscription.
1662
+ * Optional so older API responses (and checkout clients that ignore it) stay compatible.
1663
+ */
1664
+ platform_fee_percent?: number | null;
1665
+ /**
1666
+ * Estimated platform fee in USD (`source_amount_usd × basis_point / 10000`).
1667
+ * Null when the percent is unknown or the quote has no USD figure.
1668
+ */
1669
+ platform_fee_usd?: string | null;
1617
1670
  }
1618
1671
  /**
1619
- * Get a deposit quote: how much source token is needed to receive a
1620
- * specific destination amount, accounting for bridge fees and slippage.
1672
+ * Get a deposit quote in either direction.
1673
+ *
1674
+ * Provide exactly one of `source_amount` (exact-in: how much lands for this
1675
+ * input) or `destination_amount` (exact-out: how much must be sent to receive
1676
+ * this output). The response includes the quote plus the project's platform
1677
+ * fee from billing, as a percentage.
1621
1678
  * Results are cached server-side for 1 minute.
1622
1679
  */
1623
1680
  declare function getDepositQuote(request: DepositQuoteRequest, publishableKey?: string): Promise<DepositQuote>;
@@ -3914,4 +3971,4 @@ declare const i18n: {
3914
3971
  };
3915
3972
  type I18nStrings = typeof i18n;
3916
3973
 
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 };
3974
+ 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.78" : "0.0.0-dev";
195
+ var SDK_VERSION = true ? "0.1.80" : "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);
@@ -4097,6 +4128,7 @@ var i18n = en_default;
4097
4128
  getSupportedDestinationTokens,
4098
4129
  getTokenChains,
4099
4130
  getTokenMetadata,
4131
+ getTokenPrice,
4100
4132
  getWalletByChainType,
4101
4133
  getWalletMobileDeepLink,
4102
4134
  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.78" : "0.0.0-dev";
44
+ var SDK_VERSION = true ? "0.1.80" : "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);
@@ -3946,6 +3976,7 @@ export {
3946
3976
  getSupportedDestinationTokens,
3947
3977
  getTokenChains,
3948
3978
  getTokenMetadata,
3979
+ getTokenPrice,
3949
3980
  getWalletByChainType,
3950
3981
  getWalletMobileDeepLink,
3951
3982
  getWalletPayLimitUpgradeStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.78",
3
+ "version": "0.1.80",
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",