@unifold/core 0.1.68-beta.1 → 0.1.68

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
@@ -568,6 +568,23 @@ interface ProjectConfigResponse {
568
568
  */
569
569
  is_hidden?: boolean;
570
570
  };
571
+ stripe_link?: {
572
+ /**
573
+ * Developer/merchant toggle for the "Pay with Link" on-ramp, overridable by
574
+ * the SDK `enableStripeLink` prop. There is no dashboard control yet, so it
575
+ * currently resolves to `false` (SDK prop governs). Mirrors `fiat_onramp`.
576
+ */
577
+ enabled?: boolean;
578
+ /**
579
+ * Platform-controlled hard hide for the "Pay with Link" on-ramp. Defaults
580
+ * to false. Stripe Link's crypto on-ramp is only available in a limited set
581
+ * of countries (currently the US); when true, the SDK MUST hide it
582
+ * regardless of `enabled` or the `enableStripeLink` prop. Resolved
583
+ * server-side from the caller's country (`country_code` query param / IP
584
+ * geolocation).
585
+ */
586
+ is_hidden?: boolean;
587
+ };
571
588
  deposit_tracker?: {
572
589
  enabled: boolean;
573
590
  };
@@ -663,7 +680,7 @@ interface AddressBalancesResponse {
663
680
  */
664
681
  declare function getAddressBalances(address: string, chainType: ChainType, publishableKey?: string): Promise<AddressBalancesResponse>;
665
682
  /** Wallet ids supported by the connect-wallet flow. */
666
- type WalletMobileDeepLinkWallet = 'phantom' | 'metamask' | 'coinbase' | 'trust' | 'rainbow' | 'rabby' | 'okx';
683
+ type WalletMobileDeepLinkWallet = 'phantom' | 'metamask' | 'coinbase' | 'trust' | 'rainbow' | 'rabby' | 'okx' | 'solflare' | 'backpack';
667
684
  /** Chain types an external wallet can connect on. */
668
685
  type ExternalWalletChainType = 'ethereum' | 'solana';
669
686
  /** A supported external (self-custody) wallet from the directory endpoint. */
@@ -1703,6 +1720,132 @@ interface CoinbaseApplePaySessionResponse {
1703
1720
  destination_amount?: string;
1704
1721
  total_fee?: number;
1705
1722
  }
1723
+ /**
1724
+ * One Coinbase guest-checkout limit bucket. Field names are snake_case
1725
+ * to match the wire format (every API response is recursively
1726
+ * snake_cased by `TransformInterceptor` on the way out).
1727
+ */
1728
+ interface CoinbaseApplePayLimit {
1729
+ /** `weekly_spending` (rolling 7-day USD cap) or `lifetime_transactions` (all-time count). */
1730
+ limit_type: 'weekly_spending' | 'lifetime_transactions';
1731
+ /** USD for spending limits; absent for count limits. */
1732
+ currency?: string;
1733
+ /** Max limit value (stringified). */
1734
+ limit: string;
1735
+ /** Remaining capacity (`"0"` once the cap is exhausted). */
1736
+ remaining: string;
1737
+ }
1738
+ /**
1739
+ * State machine for a single limit-upgrade option, per Coinbase's
1740
+ * headless-onramp limits-upgrade guide:
1741
+ *
1742
+ * unrequested → user has never submitted; collect `fields` and POST
1743
+ * /limits/upgrade.
1744
+ * pending → submission under review by Coinbase; poll /limits
1745
+ * until a terminal state.
1746
+ * resubmit → previous submission was rejected but retryable;
1747
+ * collect corrected `fields` and POST /limits/upgrade
1748
+ * again.
1749
+ * active → terminal. Upgrade approved.
1750
+ * inactive → terminal. User permanently blocked; do not retry.
1751
+ */
1752
+ type ApplePayLimitUpgradeStatus = 'unrequested' | 'pending' | 'resubmit' | 'active' | 'inactive';
1753
+ /** One available limit-upgrade option (shape is loose; Coinbase may add fields). */
1754
+ interface CoinbaseApplePayLimitUpgradeOption {
1755
+ /** State machine value. May be absent on partial / pre-eligible responses. */
1756
+ status?: ApplePayLimitUpgradeStatus | string;
1757
+ /** Field keys to collect from the user (today: `ssnLast4`, `dateOfBirth`). */
1758
+ fields?: string[];
1759
+ [key: string]: unknown;
1760
+ }
1761
+ /**
1762
+ * Wire-format response from `POST /apple_pay/limits`. The two `limit_*`
1763
+ * fields come straight from Coinbase (via our snake_casing
1764
+ * passthrough); the two derived fields (`limit_reached`,
1765
+ * `upgrade_status`) are appended by the SDK function for caller
1766
+ * ergonomics — see `getCoinbaseApplePayLimits`.
1767
+ */
1768
+ interface CoinbaseApplePayLimitsResponse {
1769
+ limits: CoinbaseApplePayLimit[];
1770
+ limit_upgrade_options?: CoinbaseApplePayLimitUpgradeOption[];
1771
+ /**
1772
+ * Convenience flag baked in by the SDK function. True iff EITHER
1773
+ * `weekly_spending` OR `lifetime_transactions` is exhausted —
1774
+ * Coinbase rejects a new order if it would exceed *either* cap, so
1775
+ * either bucket at `"0"` blocks the user from transacting.
1776
+ * Equivalent to `isApplePayLimitReached(response)`.
1777
+ */
1778
+ limit_reached: boolean;
1779
+ /**
1780
+ * Convenience flag baked in by the SDK function — the status of
1781
+ * `limit_upgrade_options[0]` when present, `null` otherwise.
1782
+ * Equivalent to `getApplePayLimitUpgradeStatus(response)`.
1783
+ */
1784
+ upgrade_status: ApplePayLimitUpgradeStatus | null;
1785
+ }
1786
+ /**
1787
+ * True iff EITHER `weekly_spending` OR `lifetime_transactions` bucket
1788
+ * is exhausted (`remaining === "0"`). Coinbase rejects a new order if
1789
+ * it would exceed *either* cap — so a user with `weekly=985` but
1790
+ * `lifetime=0` still can't transact, and we should route to the
1791
+ * upgrade flow (or terminal screen if no upgrade is available).
1792
+ *
1793
+ * Defensive on missing buckets: an absent bucket is treated as "not at
1794
+ * cap" for that dimension. All buckets absent ⇒ false (safe default —
1795
+ * we have no evidence they're blocked).
1796
+ */
1797
+ declare function isApplePayLimitReached(response: Pick<CoinbaseApplePayLimitsResponse, 'limits'>): boolean;
1798
+ /**
1799
+ * Extract the upgrade option's `status` from a limits response. Returns
1800
+ * `null` when the user has no `limit_upgrade_options` at all
1801
+ * (ineligible) or when the upstream omits the field; the caller should
1802
+ * treat that case the same as an `inactive` terminal — there's no
1803
+ * upgrade path.
1804
+ *
1805
+ * Today Coinbase only ever returns a single entry in
1806
+ * `limit_upgrade_options`; if that changes we'll need to scope this by
1807
+ * payment-method type. For now indexing `[0]` is what the
1808
+ * limits-upgrade guide itself does.
1809
+ */
1810
+ declare function getApplePayLimitUpgradeStatus(response: Pick<CoinbaseApplePayLimitsResponse, 'limit_upgrade_options'>): ApplePayLimitUpgradeStatus | null;
1811
+ /**
1812
+ * Fetch the user's current Apple Pay (guest-checkout) limits + any
1813
+ * available upgrade options. Safe to call before the verification OTP —
1814
+ * callers usually pair this with `isApplePayBothLimitsReached` to decide
1815
+ * whether to surface the limit-upgrade flow instead of sending the SMS.
1816
+ *
1817
+ * @see https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/get-onramp-user-limits
1818
+ */
1819
+ declare function getCoinbaseApplePayLimits(
1820
+ /** US phone in E.164 (e.g. `+12345678901`). */
1821
+ phone: string, publishableKey?: string, signal?: AbortSignal): Promise<CoinbaseApplePayLimitsResponse>;
1822
+ interface RequestCoinbaseApplePayLimitUpgradeRequest {
1823
+ /** US phone in E.164. Must match a phone the user controls (Coinbase verifies via the prior OTP). */
1824
+ phone: string;
1825
+ fields: {
1826
+ /** Last 4 SSN digits, no dashes/spaces. */
1827
+ ssnLast4: string;
1828
+ /** Zero-padded day/month, 4-digit year. */
1829
+ dateOfBirth: {
1830
+ day: string;
1831
+ month: string;
1832
+ year: string;
1833
+ };
1834
+ };
1835
+ }
1836
+ interface RequestCoinbaseApplePayLimitUpgradeResponse {
1837
+ /** Always `"accepted"`. The upgrade decision is asynchronous — poll the limits endpoint. */
1838
+ status: 'accepted';
1839
+ }
1840
+ /**
1841
+ * Submit identity fields (DOB + SSN last 4) to request an Apple Pay limit
1842
+ * upgrade. The decision is asynchronous on Coinbase's side; poll
1843
+ * `getCoinbaseApplePayLimits` after this to observe whether the new caps
1844
+ * landed.
1845
+ *
1846
+ * @see https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/request-limit-upgrade
1847
+ */
1848
+ declare function requestCoinbaseApplePayLimitUpgrade(request: RequestCoinbaseApplePayLimitUpgradeRequest, publishableKey?: string, signal?: AbortSignal): Promise<RequestCoinbaseApplePayLimitUpgradeResponse>;
1706
1849
  /**
1707
1850
  * Create an Apple Pay onramp session. Requires a fresh `onrampToken` from
1708
1851
  * `exchangeOnrampVerificationToken`.
@@ -2021,4 +2164,4 @@ declare const i18n: {
2021
2164
  };
2022
2165
  type I18nStrings = typeof i18n;
2023
2166
 
2024
- export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, 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 CheckoutMethod, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositMethod, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type DirectExecution, 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 HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationExchangeInfo, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, type IpAddressResponse, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionPaymentMethod, type OnrampSessionRequest, type OnrampSessionResponse, 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 QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, 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 SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TransferDefaultTokenParams, type TransferDefaultTokenResult, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseLegalAgreements, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendOnrampVerificationOtp, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeGetTransactionLimits, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp, verifyOnrampVerificationOtp, verifyRecipientAddress };
2167
+ export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, 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 CheckoutMethod, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePayLimit, type CoinbaseApplePayLimitUpgradeOption, type CoinbaseApplePayLimitsResponse, type CoinbaseApplePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositMethod, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type DirectExecution, 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 HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationExchangeInfo, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, type IpAddressResponse, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionPaymentMethod, type OnrampSessionRequest, type OnrampSessionResponse, 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 QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, type RequestCoinbaseApplePayLimitUpgradeRequest, type RequestCoinbaseApplePayLimitUpgradeResponse, 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 SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TransferDefaultTokenParams, type TransferDefaultTokenResult, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayLimitUpgradeStatus, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseApplePayLimits, getCoinbaseLegalAgreements, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, i18n, isApplePayLimitReached, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, requestCoinbaseApplePayLimitUpgrade, 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
@@ -568,6 +568,23 @@ interface ProjectConfigResponse {
568
568
  */
569
569
  is_hidden?: boolean;
570
570
  };
571
+ stripe_link?: {
572
+ /**
573
+ * Developer/merchant toggle for the "Pay with Link" on-ramp, overridable by
574
+ * the SDK `enableStripeLink` prop. There is no dashboard control yet, so it
575
+ * currently resolves to `false` (SDK prop governs). Mirrors `fiat_onramp`.
576
+ */
577
+ enabled?: boolean;
578
+ /**
579
+ * Platform-controlled hard hide for the "Pay with Link" on-ramp. Defaults
580
+ * to false. Stripe Link's crypto on-ramp is only available in a limited set
581
+ * of countries (currently the US); when true, the SDK MUST hide it
582
+ * regardless of `enabled` or the `enableStripeLink` prop. Resolved
583
+ * server-side from the caller's country (`country_code` query param / IP
584
+ * geolocation).
585
+ */
586
+ is_hidden?: boolean;
587
+ };
571
588
  deposit_tracker?: {
572
589
  enabled: boolean;
573
590
  };
@@ -663,7 +680,7 @@ interface AddressBalancesResponse {
663
680
  */
664
681
  declare function getAddressBalances(address: string, chainType: ChainType, publishableKey?: string): Promise<AddressBalancesResponse>;
665
682
  /** Wallet ids supported by the connect-wallet flow. */
666
- type WalletMobileDeepLinkWallet = 'phantom' | 'metamask' | 'coinbase' | 'trust' | 'rainbow' | 'rabby' | 'okx';
683
+ type WalletMobileDeepLinkWallet = 'phantom' | 'metamask' | 'coinbase' | 'trust' | 'rainbow' | 'rabby' | 'okx' | 'solflare' | 'backpack';
667
684
  /** Chain types an external wallet can connect on. */
668
685
  type ExternalWalletChainType = 'ethereum' | 'solana';
669
686
  /** A supported external (self-custody) wallet from the directory endpoint. */
@@ -1703,6 +1720,132 @@ interface CoinbaseApplePaySessionResponse {
1703
1720
  destination_amount?: string;
1704
1721
  total_fee?: number;
1705
1722
  }
1723
+ /**
1724
+ * One Coinbase guest-checkout limit bucket. Field names are snake_case
1725
+ * to match the wire format (every API response is recursively
1726
+ * snake_cased by `TransformInterceptor` on the way out).
1727
+ */
1728
+ interface CoinbaseApplePayLimit {
1729
+ /** `weekly_spending` (rolling 7-day USD cap) or `lifetime_transactions` (all-time count). */
1730
+ limit_type: 'weekly_spending' | 'lifetime_transactions';
1731
+ /** USD for spending limits; absent for count limits. */
1732
+ currency?: string;
1733
+ /** Max limit value (stringified). */
1734
+ limit: string;
1735
+ /** Remaining capacity (`"0"` once the cap is exhausted). */
1736
+ remaining: string;
1737
+ }
1738
+ /**
1739
+ * State machine for a single limit-upgrade option, per Coinbase's
1740
+ * headless-onramp limits-upgrade guide:
1741
+ *
1742
+ * unrequested → user has never submitted; collect `fields` and POST
1743
+ * /limits/upgrade.
1744
+ * pending → submission under review by Coinbase; poll /limits
1745
+ * until a terminal state.
1746
+ * resubmit → previous submission was rejected but retryable;
1747
+ * collect corrected `fields` and POST /limits/upgrade
1748
+ * again.
1749
+ * active → terminal. Upgrade approved.
1750
+ * inactive → terminal. User permanently blocked; do not retry.
1751
+ */
1752
+ type ApplePayLimitUpgradeStatus = 'unrequested' | 'pending' | 'resubmit' | 'active' | 'inactive';
1753
+ /** One available limit-upgrade option (shape is loose; Coinbase may add fields). */
1754
+ interface CoinbaseApplePayLimitUpgradeOption {
1755
+ /** State machine value. May be absent on partial / pre-eligible responses. */
1756
+ status?: ApplePayLimitUpgradeStatus | string;
1757
+ /** Field keys to collect from the user (today: `ssnLast4`, `dateOfBirth`). */
1758
+ fields?: string[];
1759
+ [key: string]: unknown;
1760
+ }
1761
+ /**
1762
+ * Wire-format response from `POST /apple_pay/limits`. The two `limit_*`
1763
+ * fields come straight from Coinbase (via our snake_casing
1764
+ * passthrough); the two derived fields (`limit_reached`,
1765
+ * `upgrade_status`) are appended by the SDK function for caller
1766
+ * ergonomics — see `getCoinbaseApplePayLimits`.
1767
+ */
1768
+ interface CoinbaseApplePayLimitsResponse {
1769
+ limits: CoinbaseApplePayLimit[];
1770
+ limit_upgrade_options?: CoinbaseApplePayLimitUpgradeOption[];
1771
+ /**
1772
+ * Convenience flag baked in by the SDK function. True iff EITHER
1773
+ * `weekly_spending` OR `lifetime_transactions` is exhausted —
1774
+ * Coinbase rejects a new order if it would exceed *either* cap, so
1775
+ * either bucket at `"0"` blocks the user from transacting.
1776
+ * Equivalent to `isApplePayLimitReached(response)`.
1777
+ */
1778
+ limit_reached: boolean;
1779
+ /**
1780
+ * Convenience flag baked in by the SDK function — the status of
1781
+ * `limit_upgrade_options[0]` when present, `null` otherwise.
1782
+ * Equivalent to `getApplePayLimitUpgradeStatus(response)`.
1783
+ */
1784
+ upgrade_status: ApplePayLimitUpgradeStatus | null;
1785
+ }
1786
+ /**
1787
+ * True iff EITHER `weekly_spending` OR `lifetime_transactions` bucket
1788
+ * is exhausted (`remaining === "0"`). Coinbase rejects a new order if
1789
+ * it would exceed *either* cap — so a user with `weekly=985` but
1790
+ * `lifetime=0` still can't transact, and we should route to the
1791
+ * upgrade flow (or terminal screen if no upgrade is available).
1792
+ *
1793
+ * Defensive on missing buckets: an absent bucket is treated as "not at
1794
+ * cap" for that dimension. All buckets absent ⇒ false (safe default —
1795
+ * we have no evidence they're blocked).
1796
+ */
1797
+ declare function isApplePayLimitReached(response: Pick<CoinbaseApplePayLimitsResponse, 'limits'>): boolean;
1798
+ /**
1799
+ * Extract the upgrade option's `status` from a limits response. Returns
1800
+ * `null` when the user has no `limit_upgrade_options` at all
1801
+ * (ineligible) or when the upstream omits the field; the caller should
1802
+ * treat that case the same as an `inactive` terminal — there's no
1803
+ * upgrade path.
1804
+ *
1805
+ * Today Coinbase only ever returns a single entry in
1806
+ * `limit_upgrade_options`; if that changes we'll need to scope this by
1807
+ * payment-method type. For now indexing `[0]` is what the
1808
+ * limits-upgrade guide itself does.
1809
+ */
1810
+ declare function getApplePayLimitUpgradeStatus(response: Pick<CoinbaseApplePayLimitsResponse, 'limit_upgrade_options'>): ApplePayLimitUpgradeStatus | null;
1811
+ /**
1812
+ * Fetch the user's current Apple Pay (guest-checkout) limits + any
1813
+ * available upgrade options. Safe to call before the verification OTP —
1814
+ * callers usually pair this with `isApplePayBothLimitsReached` to decide
1815
+ * whether to surface the limit-upgrade flow instead of sending the SMS.
1816
+ *
1817
+ * @see https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/get-onramp-user-limits
1818
+ */
1819
+ declare function getCoinbaseApplePayLimits(
1820
+ /** US phone in E.164 (e.g. `+12345678901`). */
1821
+ phone: string, publishableKey?: string, signal?: AbortSignal): Promise<CoinbaseApplePayLimitsResponse>;
1822
+ interface RequestCoinbaseApplePayLimitUpgradeRequest {
1823
+ /** US phone in E.164. Must match a phone the user controls (Coinbase verifies via the prior OTP). */
1824
+ phone: string;
1825
+ fields: {
1826
+ /** Last 4 SSN digits, no dashes/spaces. */
1827
+ ssnLast4: string;
1828
+ /** Zero-padded day/month, 4-digit year. */
1829
+ dateOfBirth: {
1830
+ day: string;
1831
+ month: string;
1832
+ year: string;
1833
+ };
1834
+ };
1835
+ }
1836
+ interface RequestCoinbaseApplePayLimitUpgradeResponse {
1837
+ /** Always `"accepted"`. The upgrade decision is asynchronous — poll the limits endpoint. */
1838
+ status: 'accepted';
1839
+ }
1840
+ /**
1841
+ * Submit identity fields (DOB + SSN last 4) to request an Apple Pay limit
1842
+ * upgrade. The decision is asynchronous on Coinbase's side; poll
1843
+ * `getCoinbaseApplePayLimits` after this to observe whether the new caps
1844
+ * landed.
1845
+ *
1846
+ * @see https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/request-limit-upgrade
1847
+ */
1848
+ declare function requestCoinbaseApplePayLimitUpgrade(request: RequestCoinbaseApplePayLimitUpgradeRequest, publishableKey?: string, signal?: AbortSignal): Promise<RequestCoinbaseApplePayLimitUpgradeResponse>;
1706
1849
  /**
1707
1850
  * Create an Apple Pay onramp session. Requires a fresh `onrampToken` from
1708
1851
  * `exchangeOnrampVerificationToken`.
@@ -2021,4 +2164,4 @@ declare const i18n: {
2021
2164
  };
2022
2165
  type I18nStrings = typeof i18n;
2023
2166
 
2024
- export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, 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 CheckoutMethod, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositMethod, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type DirectExecution, 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 HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationExchangeInfo, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, type IpAddressResponse, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionPaymentMethod, type OnrampSessionRequest, type OnrampSessionResponse, 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 QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, 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 SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TransferDefaultTokenParams, type TransferDefaultTokenResult, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseLegalAgreements, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendOnrampVerificationOtp, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeGetTransactionLimits, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp, verifyOnrampVerificationOtp, verifyRecipientAddress };
2167
+ export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, 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 CheckoutMethod, type CheckoutPaymentIntent, type CheckoutPaymentIntentData, type CheckoutPaymentIntentSucceededEvent, type CoinbaseApplePayLimit, type CoinbaseApplePayLimitUpgradeOption, type CoinbaseApplePayLimitsResponse, type CoinbaseApplePaySessionResponse, type CoinbaseLegalAgreement, type CoinbaseLegalAgreementsResponse, type ConfirmIntegrationTransferResult, type CreateCoinbaseApplePaySessionRequest, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type CreateOnrampVerificationSessionRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositMethod, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type DirectExecution, 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 HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IntegrationAccount, type IntegrationExchangeInfo, type IntegrationExchangesResponse, type IntegrationFeeAmount, type IntegrationHoldingsResponse, IntegrationProvider, type IpAddressResponse, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionPaymentMethod, type OnrampSessionRequest, type OnrampSessionResponse, 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 QueryExecutionsRequest, type QueryExecutionsResponse, type RefreshIntegrationTokenResult, type RequestCoinbaseApplePayLimitUpgradeRequest, type RequestCoinbaseApplePayLimitUpgradeResponse, 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 SupportedDepositTokensResponse, type SupportedDestinationTokensResponse, type SupportedSourceTokensQuery, type SupportedSourceTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type TransferDefaultTokenParams, type TransferDefaultTokenResult, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, type WithdrawDirectExecutionSucceededEvent, type WithdrawEvent, WithdrawEventType, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createCoinbaseApplePaySession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, createOnrampVerificationSession, exchangeOnrampVerificationToken, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getApplePayLimitUpgradeStatus, getApplePayProviders, getBankTransferProviders, getCashAppLimits, getCashAppSessionStatus, getChainName, getCoinbaseApplePayLimits, getCoinbaseLegalAgreements, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getOnrampVerificationSession, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, i18n, isApplePayLimitReached, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, requestCoinbaseApplePayLimitUpgrade, 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
@@ -48,11 +48,13 @@ __export(index_exports, {
48
48
  getAddressBalance: () => getAddressBalance,
49
49
  getAddressBalances: () => getAddressBalances,
50
50
  getApiBaseUrl: () => getApiBaseUrl,
51
+ getApplePayLimitUpgradeStatus: () => getApplePayLimitUpgradeStatus,
51
52
  getApplePayProviders: () => getApplePayProviders,
52
53
  getBankTransferProviders: () => getBankTransferProviders,
53
54
  getCashAppLimits: () => getCashAppLimits,
54
55
  getCashAppSessionStatus: () => getCashAppSessionStatus,
55
56
  getChainName: () => getChainName,
57
+ getCoinbaseApplePayLimits: () => getCoinbaseApplePayLimits,
56
58
  getCoinbaseLegalAgreements: () => getCoinbaseLegalAgreements,
57
59
  getDefaultOnrampToken: () => getDefaultOnrampToken,
58
60
  getDepositAddress: () => getDepositAddress,
@@ -79,10 +81,12 @@ __export(index_exports, {
79
81
  getWalletByChainType: () => getWalletByChainType,
80
82
  getWalletMobileDeepLink: () => getWalletMobileDeepLink,
81
83
  i18n: () => i18n,
84
+ isApplePayLimitReached: () => isApplePayLimitReached,
82
85
  listPaymentIntentExecutions: () => listPaymentIntentExecutions,
83
86
  pollDirectExecutions: () => pollDirectExecutions,
84
87
  queryExecutions: () => queryExecutions,
85
88
  refreshIntegrationToken: () => refreshIntegrationToken,
89
+ requestCoinbaseApplePayLimitUpgrade: () => requestCoinbaseApplePayLimitUpgrade,
86
90
  retrievePaymentIntent: () => retrievePaymentIntent,
87
91
  revokeIntegrationToken: () => revokeIntegrationToken,
88
92
  sendHypercoreTransaction: () => sendHypercoreTransaction,
@@ -1535,6 +1539,59 @@ async function getOnrampVerificationSession(id, clientSecret, publishableKey) {
1535
1539
  });
1536
1540
  return jsonOrThrow(response, "Failed to fetch verification session");
1537
1541
  }
1542
+ function isApplePayLimitReached(response) {
1543
+ return response.limits.some((l) => l.remaining === "0");
1544
+ }
1545
+ function getApplePayLimitUpgradeStatus(response) {
1546
+ const opt = response.limit_upgrade_options?.[0];
1547
+ if (!opt || typeof opt.status !== "string") return null;
1548
+ return opt.status;
1549
+ }
1550
+ async function getCoinbaseApplePayLimits(phone, publishableKey, signal) {
1551
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
1552
+ validatePublishableKey(pk);
1553
+ const response = await fetch(
1554
+ `${API_BASE_URL}/v1/public/onramps/headless/coinbase/apple_pay/limits`,
1555
+ {
1556
+ method: "POST",
1557
+ headers: {
1558
+ accept: "application/json",
1559
+ "x-publishable-key": pk,
1560
+ "Content-Type": "application/json"
1561
+ },
1562
+ body: JSON.stringify({ phone }),
1563
+ signal
1564
+ }
1565
+ );
1566
+ const raw = await jsonOrThrow(response, "Failed to fetch Apple Pay limits");
1567
+ return {
1568
+ limits: raw.limits,
1569
+ limit_upgrade_options: raw.limit_upgrade_options,
1570
+ limit_reached: isApplePayLimitReached(raw),
1571
+ upgrade_status: getApplePayLimitUpgradeStatus(raw)
1572
+ };
1573
+ }
1574
+ async function requestCoinbaseApplePayLimitUpgrade(request, publishableKey, signal) {
1575
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
1576
+ validatePublishableKey(pk);
1577
+ const response = await fetch(
1578
+ `${API_BASE_URL}/v1/public/onramps/headless/coinbase/apple_pay/limits/upgrade`,
1579
+ {
1580
+ method: "POST",
1581
+ headers: {
1582
+ accept: "application/json",
1583
+ "x-publishable-key": pk,
1584
+ "Content-Type": "application/json"
1585
+ },
1586
+ body: JSON.stringify(request),
1587
+ signal
1588
+ }
1589
+ );
1590
+ return jsonOrThrow(
1591
+ response,
1592
+ "Failed to request Apple Pay limit upgrade"
1593
+ );
1594
+ }
1538
1595
  async function createCoinbaseApplePaySession(request, onrampToken, publishableKey, signal) {
1539
1596
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
1540
1597
  validatePublishableKey(pk);
@@ -1734,11 +1791,13 @@ var i18n = en_default;
1734
1791
  getAddressBalance,
1735
1792
  getAddressBalances,
1736
1793
  getApiBaseUrl,
1794
+ getApplePayLimitUpgradeStatus,
1737
1795
  getApplePayProviders,
1738
1796
  getBankTransferProviders,
1739
1797
  getCashAppLimits,
1740
1798
  getCashAppSessionStatus,
1741
1799
  getChainName,
1800
+ getCoinbaseApplePayLimits,
1742
1801
  getCoinbaseLegalAgreements,
1743
1802
  getDefaultOnrampToken,
1744
1803
  getDepositAddress,
@@ -1765,10 +1824,12 @@ var i18n = en_default;
1765
1824
  getWalletByChainType,
1766
1825
  getWalletMobileDeepLink,
1767
1826
  i18n,
1827
+ isApplePayLimitReached,
1768
1828
  listPaymentIntentExecutions,
1769
1829
  pollDirectExecutions,
1770
1830
  queryExecutions,
1771
1831
  refreshIntegrationToken,
1832
+ requestCoinbaseApplePayLimitUpgrade,
1772
1833
  retrievePaymentIntent,
1773
1834
  revokeIntegrationToken,
1774
1835
  sendHypercoreTransaction,
package/dist/index.mjs CHANGED
@@ -1423,6 +1423,59 @@ async function getOnrampVerificationSession(id, clientSecret, publishableKey) {
1423
1423
  });
1424
1424
  return jsonOrThrow(response, "Failed to fetch verification session");
1425
1425
  }
1426
+ function isApplePayLimitReached(response) {
1427
+ return response.limits.some((l) => l.remaining === "0");
1428
+ }
1429
+ function getApplePayLimitUpgradeStatus(response) {
1430
+ const opt = response.limit_upgrade_options?.[0];
1431
+ if (!opt || typeof opt.status !== "string") return null;
1432
+ return opt.status;
1433
+ }
1434
+ async function getCoinbaseApplePayLimits(phone, publishableKey, signal) {
1435
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
1436
+ validatePublishableKey(pk);
1437
+ const response = await fetch(
1438
+ `${API_BASE_URL}/v1/public/onramps/headless/coinbase/apple_pay/limits`,
1439
+ {
1440
+ method: "POST",
1441
+ headers: {
1442
+ accept: "application/json",
1443
+ "x-publishable-key": pk,
1444
+ "Content-Type": "application/json"
1445
+ },
1446
+ body: JSON.stringify({ phone }),
1447
+ signal
1448
+ }
1449
+ );
1450
+ const raw = await jsonOrThrow(response, "Failed to fetch Apple Pay limits");
1451
+ return {
1452
+ limits: raw.limits,
1453
+ limit_upgrade_options: raw.limit_upgrade_options,
1454
+ limit_reached: isApplePayLimitReached(raw),
1455
+ upgrade_status: getApplePayLimitUpgradeStatus(raw)
1456
+ };
1457
+ }
1458
+ async function requestCoinbaseApplePayLimitUpgrade(request, publishableKey, signal) {
1459
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
1460
+ validatePublishableKey(pk);
1461
+ const response = await fetch(
1462
+ `${API_BASE_URL}/v1/public/onramps/headless/coinbase/apple_pay/limits/upgrade`,
1463
+ {
1464
+ method: "POST",
1465
+ headers: {
1466
+ accept: "application/json",
1467
+ "x-publishable-key": pk,
1468
+ "Content-Type": "application/json"
1469
+ },
1470
+ body: JSON.stringify(request),
1471
+ signal
1472
+ }
1473
+ );
1474
+ return jsonOrThrow(
1475
+ response,
1476
+ "Failed to request Apple Pay limit upgrade"
1477
+ );
1478
+ }
1426
1479
  async function createCoinbaseApplePaySession(request, onrampToken, publishableKey, signal) {
1427
1480
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
1428
1481
  validatePublishableKey(pk);
@@ -1621,11 +1674,13 @@ export {
1621
1674
  getAddressBalance,
1622
1675
  getAddressBalances,
1623
1676
  getApiBaseUrl,
1677
+ getApplePayLimitUpgradeStatus,
1624
1678
  getApplePayProviders,
1625
1679
  getBankTransferProviders,
1626
1680
  getCashAppLimits,
1627
1681
  getCashAppSessionStatus,
1628
1682
  getChainName,
1683
+ getCoinbaseApplePayLimits,
1629
1684
  getCoinbaseLegalAgreements,
1630
1685
  getDefaultOnrampToken,
1631
1686
  getDepositAddress,
@@ -1652,10 +1707,12 @@ export {
1652
1707
  getWalletByChainType,
1653
1708
  getWalletMobileDeepLink,
1654
1709
  i18n,
1710
+ isApplePayLimitReached,
1655
1711
  listPaymentIntentExecutions,
1656
1712
  pollDirectExecutions,
1657
1713
  queryExecutions,
1658
1714
  refreshIntegrationToken,
1715
+ requestCoinbaseApplePayLimitUpgrade,
1659
1716
  retrievePaymentIntent,
1660
1717
  revokeIntegrationToken,
1661
1718
  sendHypercoreTransaction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.68-beta.1",
3
+ "version": "0.1.68",
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",