@unifold/core 0.1.55 → 0.1.56

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
@@ -48,6 +48,12 @@ interface CreateDepositAddressRequest {
48
48
  recipient_address: string;
49
49
  /** @default ActionType.Deposit */
50
50
  action_type?: ActionType;
51
+ /**
52
+ * Source chain type. When provided together with `action_type=withdraw`,
53
+ * only the deposit wallet for this chain is generated — the other chain
54
+ * types are skipped (they're unused in a withdrawal flow).
55
+ */
56
+ source_chain_type?: ChainType;
51
57
  client_metadata?: Record<string, unknown>;
52
58
  }
53
59
  /**
@@ -56,6 +62,22 @@ interface CreateDepositAddressRequest {
56
62
  * @param publishableKey - Optional publishable key, defaults to configured key
57
63
  */
58
64
  declare function createDepositAddress(overrides?: Partial<CreateDepositAddressRequest>, publishableKey?: string): Promise<DepositAddressResponse>;
65
+ interface GetExistingDepositAddressRequest {
66
+ external_user_id: string;
67
+ destination_chain_type: string;
68
+ destination_chain_id: string;
69
+ destination_token_address: string;
70
+ recipient_address: string;
71
+ /** @default ActionType.Deposit */
72
+ action_type?: ActionType;
73
+ }
74
+ /**
75
+ * Get existing deposit wallets without creating new ones.
76
+ * Returns an empty `data` array when no wallet exists yet for the
77
+ * (user, destination) tuple — callers can treat this as "the wallet
78
+ * will be created fresh on the next createDepositAddress call".
79
+ */
80
+ declare function getDepositAddress(params: GetExistingDepositAddressRequest, publishableKey?: string): Promise<DepositAddressResponse>;
59
81
  /**
60
82
  * Get wallet address for a specific chain type
61
83
  */
@@ -435,6 +457,9 @@ interface ProjectConfigResponse {
435
457
  pay_with_exchange?: {
436
458
  enabled: boolean;
437
459
  };
460
+ hypercore_sponsorship?: {
461
+ enabled: boolean;
462
+ };
438
463
  }
439
464
  /**
440
465
  * Get project configuration
@@ -556,6 +581,7 @@ interface HypercoreActivationResponse {
556
581
  user_exists: boolean;
557
582
  activation_fee: number;
558
583
  is_sanctioned: boolean;
584
+ sponsored?: boolean;
559
585
  }
560
586
  /**
561
587
  * Check whether a recipient address is activated on HyperCore (Hyperliquid L1).
@@ -627,6 +653,127 @@ interface ExchangeSessionStartParams {
627
653
  * This avoids popup blockers in Safari by opening the URL directly via anchor tag or window.open().
628
654
  */
629
655
  declare function getExchangeSessionStartUrl(request: ExchangeSessionStartParams, publishableKey: string): string;
656
+ interface IntegrationExchangeInfo {
657
+ service_provider: string;
658
+ service_provider_display_name: string;
659
+ description: string;
660
+ icon_url: string;
661
+ icon_urls: IconUrl[];
662
+ enabled: boolean;
663
+ supported_networks: string[];
664
+ supported_currencies: string[];
665
+ }
666
+ interface IntegrationExchangesResponse {
667
+ data: IntegrationExchangeInfo[];
668
+ }
669
+ /**
670
+ * Get available integration OAuth exchanges (Coinbase, Binance, Kraken, etc.)
671
+ * Returns provider info with icons, enabled status, and supported networks/currencies.
672
+ */
673
+ declare function getIntegrationExchanges(publishableKey?: string): Promise<IntegrationExchangesResponse>;
674
+ interface StartIntegrationOAuthResult {
675
+ redirect_url: string;
676
+ state: string;
677
+ }
678
+ /**
679
+ * Start Coinbase OAuth flow.
680
+ * Returns a redirect URL (for the user to authorize) and a state token for polling.
681
+ */
682
+ declare function startIntegrationOAuth(publishableKey?: string): Promise<StartIntegrationOAuthResult>;
683
+ declare enum IntegrationProvider {
684
+ COINBASE = "coinbase"
685
+ }
686
+ interface IntegrationAccount {
687
+ id: string;
688
+ name: string;
689
+ currency: string;
690
+ amount: string;
691
+ amount_usd: string | null;
692
+ exchange_rate: string | null;
693
+ type: string;
694
+ icon_url: string;
695
+ icon_urls: IconUrl[];
696
+ }
697
+ type AuthenticateOAuthResult = {
698
+ status: "pending";
699
+ } | {
700
+ status: "completed";
701
+ accounts: IntegrationAccount[];
702
+ access_token: string;
703
+ expires_at: string;
704
+ };
705
+ /**
706
+ * Poll or exchange an OAuth state/token for Coinbase credentials.
707
+ * In the polling flow, pass the `state` from startIntegrationOAuth.
708
+ * Returns `{ status: "pending" }` until the user completes authorization.
709
+ */
710
+ declare function authenticateIntegrationOAuth(params: {
711
+ state?: string;
712
+ oauth_token?: string;
713
+ }, publishableKey?: string): Promise<AuthenticateOAuthResult>;
714
+ interface RefreshIntegrationTokenResult {
715
+ access_token: string;
716
+ expires_at: string;
717
+ }
718
+ declare function refreshIntegrationToken(accessToken: string, publishableKey?: string): Promise<RefreshIntegrationTokenResult>;
719
+ interface IntegrationHoldingsResponse {
720
+ data: IntegrationAccount[];
721
+ }
722
+ declare function getIntegrationHoldings(provider: string, accessToken: string, publishableKey?: string): Promise<IntegrationHoldingsResponse>;
723
+ interface IntegrationFeeAmount {
724
+ amount: string;
725
+ currency: string;
726
+ }
727
+ interface CreateIntegrationTransferResult {
728
+ id: string;
729
+ status: string;
730
+ integration_provider: string;
731
+ currency: string;
732
+ amount: string;
733
+ destination_address: string;
734
+ network: string;
735
+ fee_included: boolean;
736
+ estimated_network_fee: IntegrationFeeAmount;
737
+ destination_amount: string;
738
+ total_amount: string;
739
+ expires_at: string;
740
+ }
741
+ interface CreateIntegrationTransferParams {
742
+ integration_provider: string;
743
+ access_token: string;
744
+ currency: string;
745
+ amount: string;
746
+ network: string;
747
+ destination_address: string;
748
+ fee_included?: boolean;
749
+ }
750
+ declare function createIntegrationTransfer(params: CreateIntegrationTransferParams, publishableKey?: string): Promise<CreateIntegrationTransferResult>;
751
+ interface ConfirmIntegrationTransferResult {
752
+ id: string;
753
+ status: string;
754
+ currency?: string;
755
+ amount?: string;
756
+ destination_address?: string;
757
+ destination_amount?: string;
758
+ network_fee?: IntegrationFeeAmount;
759
+ message?: string;
760
+ }
761
+ declare function confirmIntegrationTransfer(transferId: string, accessToken: string, mfaCode?: string, publishableKey?: string): Promise<ConfirmIntegrationTransferResult>;
762
+ interface TransferDefaultTokenParams {
763
+ integration_provider: string;
764
+ source_currency: string;
765
+ destination_token_address: string;
766
+ destination_chain_id: string;
767
+ destination_chain_type: string;
768
+ country_code?: string;
769
+ subdivision_code?: string;
770
+ }
771
+ interface TransferDefaultTokenResult {
772
+ source_network: string;
773
+ source_network_display_name: string;
774
+ source_chain_type: string;
775
+ }
776
+ declare function getIntegrationTransferDefaultToken(params: TransferDefaultTokenParams, publishableKey?: string): Promise<TransferDefaultTokenResult>;
630
777
  interface BuildSolanaTransactionRequest {
631
778
  chain_id: string;
632
779
  token_address: string;
@@ -767,7 +914,7 @@ interface PaymentIntent {
767
914
  description: string | null;
768
915
  livemode: boolean;
769
916
  settlement_tolerance_percent: number;
770
- /** When true, stablecoin deposits are credited at par (1:1) regardless of swap slippage. */
917
+ /** Whether stablecoin deposits were settled at 1:1. Always `false` for `locked_quote`. */
771
918
  stablecoin_parity: boolean;
772
919
  canceled_at: string | null;
773
920
  cancellation_reason: string | null;
@@ -1189,4 +1336,4 @@ declare const i18n: {
1189
1336
  };
1190
1337
  type I18nStrings = typeof i18n;
1191
1338
 
1192
- export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetExchangesQuery, type HypercoreActionType, type HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IpAddressResponse, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentIntent, type PaymentIntentDepositAddress, type PaymentIntentExecutionsResponse, type PaymentIntentStatus, type PaymentIntentType, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProductType, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SendHypercoreTransactionRequest, type SendHypercoreTransactionResponse, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SourceToken, type SourceTokenNetwork, 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 UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, createCashAppSession, createDepositAddress, createExchangeSession, createOnrampSession, formatStablecoinAmount, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getCashAppLimits, getCashAppSessionStatus, getChainName, getDefaultOnrampToken, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, retrievePaymentIntent, sendHypercoreTransaction, sendSolanaTransaction, setApiConfig, useUserIp, verifyRecipientAddress };
1339
+ export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AuthenticateOAuthResult, type AutoSwapRequest, type AutoSwapResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type ConfirmIntegrationTransferResult, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetExchangesQuery, type HypercoreActionType, 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 OnrampSessionRequest, type OnrampSessionResponse, 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 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, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, formatStablecoinAmount, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getCashAppLimits, getCashAppSessionStatus, getChainName, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, retrievePaymentIntent, sendHypercoreTransaction, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, useUserIp, verifyRecipientAddress };
package/dist/index.d.ts CHANGED
@@ -48,6 +48,12 @@ interface CreateDepositAddressRequest {
48
48
  recipient_address: string;
49
49
  /** @default ActionType.Deposit */
50
50
  action_type?: ActionType;
51
+ /**
52
+ * Source chain type. When provided together with `action_type=withdraw`,
53
+ * only the deposit wallet for this chain is generated — the other chain
54
+ * types are skipped (they're unused in a withdrawal flow).
55
+ */
56
+ source_chain_type?: ChainType;
51
57
  client_metadata?: Record<string, unknown>;
52
58
  }
53
59
  /**
@@ -56,6 +62,22 @@ interface CreateDepositAddressRequest {
56
62
  * @param publishableKey - Optional publishable key, defaults to configured key
57
63
  */
58
64
  declare function createDepositAddress(overrides?: Partial<CreateDepositAddressRequest>, publishableKey?: string): Promise<DepositAddressResponse>;
65
+ interface GetExistingDepositAddressRequest {
66
+ external_user_id: string;
67
+ destination_chain_type: string;
68
+ destination_chain_id: string;
69
+ destination_token_address: string;
70
+ recipient_address: string;
71
+ /** @default ActionType.Deposit */
72
+ action_type?: ActionType;
73
+ }
74
+ /**
75
+ * Get existing deposit wallets without creating new ones.
76
+ * Returns an empty `data` array when no wallet exists yet for the
77
+ * (user, destination) tuple — callers can treat this as "the wallet
78
+ * will be created fresh on the next createDepositAddress call".
79
+ */
80
+ declare function getDepositAddress(params: GetExistingDepositAddressRequest, publishableKey?: string): Promise<DepositAddressResponse>;
59
81
  /**
60
82
  * Get wallet address for a specific chain type
61
83
  */
@@ -435,6 +457,9 @@ interface ProjectConfigResponse {
435
457
  pay_with_exchange?: {
436
458
  enabled: boolean;
437
459
  };
460
+ hypercore_sponsorship?: {
461
+ enabled: boolean;
462
+ };
438
463
  }
439
464
  /**
440
465
  * Get project configuration
@@ -556,6 +581,7 @@ interface HypercoreActivationResponse {
556
581
  user_exists: boolean;
557
582
  activation_fee: number;
558
583
  is_sanctioned: boolean;
584
+ sponsored?: boolean;
559
585
  }
560
586
  /**
561
587
  * Check whether a recipient address is activated on HyperCore (Hyperliquid L1).
@@ -627,6 +653,127 @@ interface ExchangeSessionStartParams {
627
653
  * This avoids popup blockers in Safari by opening the URL directly via anchor tag or window.open().
628
654
  */
629
655
  declare function getExchangeSessionStartUrl(request: ExchangeSessionStartParams, publishableKey: string): string;
656
+ interface IntegrationExchangeInfo {
657
+ service_provider: string;
658
+ service_provider_display_name: string;
659
+ description: string;
660
+ icon_url: string;
661
+ icon_urls: IconUrl[];
662
+ enabled: boolean;
663
+ supported_networks: string[];
664
+ supported_currencies: string[];
665
+ }
666
+ interface IntegrationExchangesResponse {
667
+ data: IntegrationExchangeInfo[];
668
+ }
669
+ /**
670
+ * Get available integration OAuth exchanges (Coinbase, Binance, Kraken, etc.)
671
+ * Returns provider info with icons, enabled status, and supported networks/currencies.
672
+ */
673
+ declare function getIntegrationExchanges(publishableKey?: string): Promise<IntegrationExchangesResponse>;
674
+ interface StartIntegrationOAuthResult {
675
+ redirect_url: string;
676
+ state: string;
677
+ }
678
+ /**
679
+ * Start Coinbase OAuth flow.
680
+ * Returns a redirect URL (for the user to authorize) and a state token for polling.
681
+ */
682
+ declare function startIntegrationOAuth(publishableKey?: string): Promise<StartIntegrationOAuthResult>;
683
+ declare enum IntegrationProvider {
684
+ COINBASE = "coinbase"
685
+ }
686
+ interface IntegrationAccount {
687
+ id: string;
688
+ name: string;
689
+ currency: string;
690
+ amount: string;
691
+ amount_usd: string | null;
692
+ exchange_rate: string | null;
693
+ type: string;
694
+ icon_url: string;
695
+ icon_urls: IconUrl[];
696
+ }
697
+ type AuthenticateOAuthResult = {
698
+ status: "pending";
699
+ } | {
700
+ status: "completed";
701
+ accounts: IntegrationAccount[];
702
+ access_token: string;
703
+ expires_at: string;
704
+ };
705
+ /**
706
+ * Poll or exchange an OAuth state/token for Coinbase credentials.
707
+ * In the polling flow, pass the `state` from startIntegrationOAuth.
708
+ * Returns `{ status: "pending" }` until the user completes authorization.
709
+ */
710
+ declare function authenticateIntegrationOAuth(params: {
711
+ state?: string;
712
+ oauth_token?: string;
713
+ }, publishableKey?: string): Promise<AuthenticateOAuthResult>;
714
+ interface RefreshIntegrationTokenResult {
715
+ access_token: string;
716
+ expires_at: string;
717
+ }
718
+ declare function refreshIntegrationToken(accessToken: string, publishableKey?: string): Promise<RefreshIntegrationTokenResult>;
719
+ interface IntegrationHoldingsResponse {
720
+ data: IntegrationAccount[];
721
+ }
722
+ declare function getIntegrationHoldings(provider: string, accessToken: string, publishableKey?: string): Promise<IntegrationHoldingsResponse>;
723
+ interface IntegrationFeeAmount {
724
+ amount: string;
725
+ currency: string;
726
+ }
727
+ interface CreateIntegrationTransferResult {
728
+ id: string;
729
+ status: string;
730
+ integration_provider: string;
731
+ currency: string;
732
+ amount: string;
733
+ destination_address: string;
734
+ network: string;
735
+ fee_included: boolean;
736
+ estimated_network_fee: IntegrationFeeAmount;
737
+ destination_amount: string;
738
+ total_amount: string;
739
+ expires_at: string;
740
+ }
741
+ interface CreateIntegrationTransferParams {
742
+ integration_provider: string;
743
+ access_token: string;
744
+ currency: string;
745
+ amount: string;
746
+ network: string;
747
+ destination_address: string;
748
+ fee_included?: boolean;
749
+ }
750
+ declare function createIntegrationTransfer(params: CreateIntegrationTransferParams, publishableKey?: string): Promise<CreateIntegrationTransferResult>;
751
+ interface ConfirmIntegrationTransferResult {
752
+ id: string;
753
+ status: string;
754
+ currency?: string;
755
+ amount?: string;
756
+ destination_address?: string;
757
+ destination_amount?: string;
758
+ network_fee?: IntegrationFeeAmount;
759
+ message?: string;
760
+ }
761
+ declare function confirmIntegrationTransfer(transferId: string, accessToken: string, mfaCode?: string, publishableKey?: string): Promise<ConfirmIntegrationTransferResult>;
762
+ interface TransferDefaultTokenParams {
763
+ integration_provider: string;
764
+ source_currency: string;
765
+ destination_token_address: string;
766
+ destination_chain_id: string;
767
+ destination_chain_type: string;
768
+ country_code?: string;
769
+ subdivision_code?: string;
770
+ }
771
+ interface TransferDefaultTokenResult {
772
+ source_network: string;
773
+ source_network_display_name: string;
774
+ source_chain_type: string;
775
+ }
776
+ declare function getIntegrationTransferDefaultToken(params: TransferDefaultTokenParams, publishableKey?: string): Promise<TransferDefaultTokenResult>;
630
777
  interface BuildSolanaTransactionRequest {
631
778
  chain_id: string;
632
779
  token_address: string;
@@ -767,7 +914,7 @@ interface PaymentIntent {
767
914
  description: string | null;
768
915
  livemode: boolean;
769
916
  settlement_tolerance_percent: number;
770
- /** When true, stablecoin deposits are credited at par (1:1) regardless of swap slippage. */
917
+ /** Whether stablecoin deposits were settled at 1:1. Always `false` for `locked_quote`. */
771
918
  stablecoin_parity: boolean;
772
919
  canceled_at: string | null;
773
920
  cancellation_reason: string | null;
@@ -1189,4 +1336,4 @@ declare const i18n: {
1189
1336
  };
1190
1337
  type I18nStrings = typeof i18n;
1191
1338
 
1192
- export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetExchangesQuery, type HypercoreActionType, type HypercoreActivationRequest, type HypercoreActivationResponse, type I18nStrings, type IconUrl, IneligibilityReason, type IpAddressResponse, type LockedQuoteLimits, type LockedQuotePreview, type LockedQuotePreviewRequest, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionCreatedData, type OnrampSessionCreatedEvent, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentIntent, type PaymentIntentDepositAddress, type PaymentIntentExecutionsResponse, type PaymentIntentStatus, type PaymentIntentType, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProductType, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SendHypercoreTransactionRequest, type SendHypercoreTransactionResponse, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SourceToken, type SourceTokenNetwork, 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 UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, createCashAppSession, createDepositAddress, createExchangeSession, createOnrampSession, formatStablecoinAmount, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getCashAppLimits, getCashAppSessionStatus, getChainName, getDefaultOnrampToken, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, retrievePaymentIntent, sendHypercoreTransaction, sendSolanaTransaction, setApiConfig, useUserIp, verifyRecipientAddress };
1339
+ export { ActionType, type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AuthenticateOAuthResult, type AutoSwapRequest, type AutoSwapResponse, type BlockedCountrySubdivision, type BuildHypercoreTransactionRequest, type BuildHypercoreTransactionResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CashAppLimits, type CashAppSessionRequest, type CashAppSessionResponse, type CashAppSessionStatusResponse, type ChainType, type ConfirmIntegrationTransferResult, type CreateDepositAddressRequest, type CreateExchangeSessionRequest, type CreateExchangeSessionResponse, type CreateIntegrationTransferParams, type CreateIntegrationTransferResult, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, type DepositEvent, DepositEventType, type DepositQuote, type DepositQuoteRequest, type DestinationToken, type DestinationTokenChain, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetExchangesQuery, type HypercoreActionType, 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 OnrampSessionRequest, type OnrampSessionResponse, 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 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, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, formatStablecoinAmount, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getCashAppLimits, getCashAppSessionStatus, getChainName, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, retrievePaymentIntent, sendHypercoreTransaction, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, useUserIp, verifyRecipientAddress };
package/dist/index.js CHANGED
@@ -24,13 +24,17 @@ __export(index_exports, {
24
24
  DepositEventType: () => DepositEventType,
25
25
  ExecutionStatus: () => ExecutionStatus,
26
26
  IneligibilityReason: () => IneligibilityReason,
27
+ IntegrationProvider: () => IntegrationProvider,
27
28
  SOLANA_USDC_ADDRESS: () => SOLANA_USDC_ADDRESS,
29
+ authenticateIntegrationOAuth: () => authenticateIntegrationOAuth,
28
30
  buildHypercoreTransaction: () => buildHypercoreTransaction,
29
31
  buildSolanaTransaction: () => buildSolanaTransaction,
30
32
  checkHypercoreActivation: () => checkHypercoreActivation,
33
+ confirmIntegrationTransfer: () => confirmIntegrationTransfer,
31
34
  createCashAppSession: () => createCashAppSession,
32
35
  createDepositAddress: () => createDepositAddress,
33
36
  createExchangeSession: () => createExchangeSession,
37
+ createIntegrationTransfer: () => createIntegrationTransfer,
34
38
  createOnrampSession: () => createOnrampSession,
35
39
  formatStablecoinAmount: () => formatStablecoinAmount,
36
40
  generatePrefixedKSUID: () => generatePrefixedKSUID,
@@ -41,12 +45,16 @@ __export(index_exports, {
41
45
  getCashAppSessionStatus: () => getCashAppSessionStatus,
42
46
  getChainName: () => getChainName,
43
47
  getDefaultOnrampToken: () => getDefaultOnrampToken,
48
+ getDepositAddress: () => getDepositAddress,
44
49
  getDepositQuote: () => getDepositQuote,
45
50
  getExchangeSessionStartUrl: () => getExchangeSessionStartUrl,
46
51
  getExchanges: () => getExchanges,
47
52
  getFiatCurrencies: () => getFiatCurrencies,
48
53
  getIconUrl: () => getIconUrl,
49
54
  getIconUrlWithCdn: () => getIconUrlWithCdn,
55
+ getIntegrationExchanges: () => getIntegrationExchanges,
56
+ getIntegrationHoldings: () => getIntegrationHoldings,
57
+ getIntegrationTransferDefaultToken: () => getIntegrationTransferDefaultToken,
50
58
  getIpAddress: () => getIpAddress,
51
59
  getOnrampQuotes: () => getOnrampQuotes,
52
60
  getOnrampSessionStartUrl: () => getOnrampSessionStartUrl,
@@ -61,10 +69,12 @@ __export(index_exports, {
61
69
  listPaymentIntentExecutions: () => listPaymentIntentExecutions,
62
70
  pollDirectExecutions: () => pollDirectExecutions,
63
71
  queryExecutions: () => queryExecutions,
72
+ refreshIntegrationToken: () => refreshIntegrationToken,
64
73
  retrievePaymentIntent: () => retrievePaymentIntent,
65
74
  sendHypercoreTransaction: () => sendHypercoreTransaction,
66
75
  sendSolanaTransaction: () => sendSolanaTransaction,
67
76
  setApiConfig: () => setApiConfig,
77
+ startIntegrationOAuth: () => startIntegrationOAuth,
68
78
  useUserIp: () => useUserIp,
69
79
  verifyRecipientAddress: () => verifyRecipientAddress
70
80
  });
@@ -139,6 +149,7 @@ async function createDepositAddress(overrides, publishableKey) {
139
149
  destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
140
150
  recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
141
151
  ...overrides?.action_type ? { action_type: overrides.action_type } : {},
152
+ ...overrides?.source_chain_type ? { source_chain_type: overrides.source_chain_type } : {},
142
153
  client_metadata: overrides?.client_metadata || {}
143
154
  };
144
155
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
@@ -157,6 +168,26 @@ async function createDepositAddress(overrides, publishableKey) {
157
168
  }
158
169
  return response.json();
159
170
  }
171
+ async function getDepositAddress(params, publishableKey) {
172
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
173
+ validatePublishableKey(pk);
174
+ const response = await fetch(
175
+ `${API_BASE_URL}/v1/public/deposit_addresses/existing`,
176
+ {
177
+ method: "POST",
178
+ headers: {
179
+ accept: "application/json",
180
+ "x-publishable-key": pk,
181
+ "Content-Type": "application/json"
182
+ },
183
+ body: JSON.stringify(params)
184
+ }
185
+ );
186
+ if (!response.ok) {
187
+ throw new Error(`Failed to get deposit addresses: ${response.statusText}`);
188
+ }
189
+ return response.json();
190
+ }
160
191
  function getWalletByChainType(wallets, chainType) {
161
192
  return wallets.find((wallet) => wallet.chain_type === chainType);
162
193
  }
@@ -617,6 +648,151 @@ function getExchangeSessionStartUrl(request, publishableKey) {
617
648
  }
618
649
  return `${API_BASE_URL}/v1/public/onramps/exchanges/sessions/start?${params.toString()}`;
619
650
  }
651
+ async function getIntegrationExchanges(publishableKey) {
652
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
653
+ validatePublishableKey(pk);
654
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/oauth/exchanges`, {
655
+ method: "GET",
656
+ headers: {
657
+ accept: "application/json",
658
+ "x-publishable-key": pk
659
+ }
660
+ });
661
+ if (!response.ok) {
662
+ throw new Error(`Failed to fetch integration exchanges: ${response.statusText}`);
663
+ }
664
+ return response.json();
665
+ }
666
+ async function startIntegrationOAuth(publishableKey) {
667
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
668
+ validatePublishableKey(pk);
669
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/oauth/coinbase/start`, {
670
+ method: "POST",
671
+ headers: {
672
+ accept: "application/json",
673
+ "x-publishable-key": pk,
674
+ "Content-Type": "application/json"
675
+ }
676
+ });
677
+ if (!response.ok) {
678
+ throw new Error(`Failed to start OAuth: ${response.statusText}`);
679
+ }
680
+ return response.json();
681
+ }
682
+ var IntegrationProvider = /* @__PURE__ */ ((IntegrationProvider2) => {
683
+ IntegrationProvider2["COINBASE"] = "coinbase";
684
+ return IntegrationProvider2;
685
+ })(IntegrationProvider || {});
686
+ async function authenticateIntegrationOAuth(params, publishableKey) {
687
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
688
+ validatePublishableKey(pk);
689
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/oauth/authenticate`, {
690
+ method: "POST",
691
+ headers: {
692
+ accept: "application/json",
693
+ "x-publishable-key": pk,
694
+ "Content-Type": "application/json"
695
+ },
696
+ body: JSON.stringify(params)
697
+ });
698
+ if (!response.ok) {
699
+ throw new Error(`Failed to authenticate OAuth: ${response.statusText}`);
700
+ }
701
+ return response.json();
702
+ }
703
+ async function refreshIntegrationToken(accessToken, publishableKey) {
704
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
705
+ validatePublishableKey(pk);
706
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/token/refresh`, {
707
+ method: "POST",
708
+ headers: {
709
+ accept: "application/json",
710
+ "x-publishable-key": pk,
711
+ "Content-Type": "application/json"
712
+ },
713
+ body: JSON.stringify({ access_token: accessToken })
714
+ });
715
+ if (!response.ok) {
716
+ throw new Error(`Failed to refresh token: ${response.statusText}`);
717
+ }
718
+ return response.json();
719
+ }
720
+ async function getIntegrationHoldings(provider, accessToken, publishableKey) {
721
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
722
+ validatePublishableKey(pk);
723
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/holdings`, {
724
+ method: "POST",
725
+ headers: {
726
+ accept: "application/json",
727
+ "x-publishable-key": pk,
728
+ "Content-Type": "application/json"
729
+ },
730
+ body: JSON.stringify({
731
+ integration_provider: provider,
732
+ access_token: accessToken
733
+ })
734
+ });
735
+ if (!response.ok) {
736
+ throw new Error(`Failed to fetch holdings: ${response.statusText}`);
737
+ }
738
+ return response.json();
739
+ }
740
+ async function createIntegrationTransfer(params, publishableKey) {
741
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
742
+ validatePublishableKey(pk);
743
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/transfers`, {
744
+ method: "POST",
745
+ headers: {
746
+ accept: "application/json",
747
+ "x-publishable-key": pk,
748
+ "Content-Type": "application/json"
749
+ },
750
+ body: JSON.stringify(params)
751
+ });
752
+ if (!response.ok) {
753
+ const err = await response.json().catch(() => ({ message: response.statusText }));
754
+ throw new Error(`Failed to create transfer: ${err.message || response.statusText}`);
755
+ }
756
+ return response.json();
757
+ }
758
+ async function confirmIntegrationTransfer(transferId, accessToken, mfaCode, publishableKey) {
759
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
760
+ validatePublishableKey(pk);
761
+ const body = { access_token: accessToken };
762
+ if (mfaCode) body.mfa_code = mfaCode;
763
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/transfers/${transferId}/confirm`, {
764
+ method: "POST",
765
+ headers: {
766
+ accept: "application/json",
767
+ "x-publishable-key": pk,
768
+ "Content-Type": "application/json"
769
+ },
770
+ body: JSON.stringify(body)
771
+ });
772
+ if (!response.ok) {
773
+ const err = await response.json().catch(() => ({ message: response.statusText }));
774
+ throw new Error(`Failed to confirm transfer: ${err.message || response.statusText}`);
775
+ }
776
+ return response.json();
777
+ }
778
+ async function getIntegrationTransferDefaultToken(params, publishableKey) {
779
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
780
+ validatePublishableKey(pk);
781
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/transfers/default_token`, {
782
+ method: "POST",
783
+ headers: {
784
+ accept: "application/json",
785
+ "x-publishable-key": pk,
786
+ "Content-Type": "application/json"
787
+ },
788
+ body: JSON.stringify(params)
789
+ });
790
+ if (!response.ok) {
791
+ const err = await response.json().catch(() => ({ message: response.statusText }));
792
+ throw new Error(`Failed to get transfer default token: ${err.message || response.statusText}`);
793
+ }
794
+ return response.json();
795
+ }
620
796
  async function buildSolanaTransaction(request, publishableKey) {
621
797
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
622
798
  validatePublishableKey(pk);
@@ -1015,13 +1191,17 @@ var i18n = en_default;
1015
1191
  DepositEventType,
1016
1192
  ExecutionStatus,
1017
1193
  IneligibilityReason,
1194
+ IntegrationProvider,
1018
1195
  SOLANA_USDC_ADDRESS,
1196
+ authenticateIntegrationOAuth,
1019
1197
  buildHypercoreTransaction,
1020
1198
  buildSolanaTransaction,
1021
1199
  checkHypercoreActivation,
1200
+ confirmIntegrationTransfer,
1022
1201
  createCashAppSession,
1023
1202
  createDepositAddress,
1024
1203
  createExchangeSession,
1204
+ createIntegrationTransfer,
1025
1205
  createOnrampSession,
1026
1206
  formatStablecoinAmount,
1027
1207
  generatePrefixedKSUID,
@@ -1032,12 +1212,16 @@ var i18n = en_default;
1032
1212
  getCashAppSessionStatus,
1033
1213
  getChainName,
1034
1214
  getDefaultOnrampToken,
1215
+ getDepositAddress,
1035
1216
  getDepositQuote,
1036
1217
  getExchangeSessionStartUrl,
1037
1218
  getExchanges,
1038
1219
  getFiatCurrencies,
1039
1220
  getIconUrl,
1040
1221
  getIconUrlWithCdn,
1222
+ getIntegrationExchanges,
1223
+ getIntegrationHoldings,
1224
+ getIntegrationTransferDefaultToken,
1041
1225
  getIpAddress,
1042
1226
  getOnrampQuotes,
1043
1227
  getOnrampSessionStartUrl,
@@ -1052,10 +1236,12 @@ var i18n = en_default;
1052
1236
  listPaymentIntentExecutions,
1053
1237
  pollDirectExecutions,
1054
1238
  queryExecutions,
1239
+ refreshIntegrationToken,
1055
1240
  retrievePaymentIntent,
1056
1241
  sendHypercoreTransaction,
1057
1242
  sendSolanaTransaction,
1058
1243
  setApiConfig,
1244
+ startIntegrationOAuth,
1059
1245
  useUserIp,
1060
1246
  verifyRecipientAddress
1061
1247
  });
package/dist/index.mjs CHANGED
@@ -67,6 +67,7 @@ async function createDepositAddress(overrides, publishableKey) {
67
67
  destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
68
68
  recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
69
69
  ...overrides?.action_type ? { action_type: overrides.action_type } : {},
70
+ ...overrides?.source_chain_type ? { source_chain_type: overrides.source_chain_type } : {},
70
71
  client_metadata: overrides?.client_metadata || {}
71
72
  };
72
73
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
@@ -85,6 +86,26 @@ async function createDepositAddress(overrides, publishableKey) {
85
86
  }
86
87
  return response.json();
87
88
  }
89
+ async function getDepositAddress(params, publishableKey) {
90
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
91
+ validatePublishableKey(pk);
92
+ const response = await fetch(
93
+ `${API_BASE_URL}/v1/public/deposit_addresses/existing`,
94
+ {
95
+ method: "POST",
96
+ headers: {
97
+ accept: "application/json",
98
+ "x-publishable-key": pk,
99
+ "Content-Type": "application/json"
100
+ },
101
+ body: JSON.stringify(params)
102
+ }
103
+ );
104
+ if (!response.ok) {
105
+ throw new Error(`Failed to get deposit addresses: ${response.statusText}`);
106
+ }
107
+ return response.json();
108
+ }
88
109
  function getWalletByChainType(wallets, chainType) {
89
110
  return wallets.find((wallet) => wallet.chain_type === chainType);
90
111
  }
@@ -545,6 +566,151 @@ function getExchangeSessionStartUrl(request, publishableKey) {
545
566
  }
546
567
  return `${API_BASE_URL}/v1/public/onramps/exchanges/sessions/start?${params.toString()}`;
547
568
  }
569
+ async function getIntegrationExchanges(publishableKey) {
570
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
571
+ validatePublishableKey(pk);
572
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/oauth/exchanges`, {
573
+ method: "GET",
574
+ headers: {
575
+ accept: "application/json",
576
+ "x-publishable-key": pk
577
+ }
578
+ });
579
+ if (!response.ok) {
580
+ throw new Error(`Failed to fetch integration exchanges: ${response.statusText}`);
581
+ }
582
+ return response.json();
583
+ }
584
+ async function startIntegrationOAuth(publishableKey) {
585
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
586
+ validatePublishableKey(pk);
587
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/oauth/coinbase/start`, {
588
+ method: "POST",
589
+ headers: {
590
+ accept: "application/json",
591
+ "x-publishable-key": pk,
592
+ "Content-Type": "application/json"
593
+ }
594
+ });
595
+ if (!response.ok) {
596
+ throw new Error(`Failed to start OAuth: ${response.statusText}`);
597
+ }
598
+ return response.json();
599
+ }
600
+ var IntegrationProvider = /* @__PURE__ */ ((IntegrationProvider2) => {
601
+ IntegrationProvider2["COINBASE"] = "coinbase";
602
+ return IntegrationProvider2;
603
+ })(IntegrationProvider || {});
604
+ async function authenticateIntegrationOAuth(params, publishableKey) {
605
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
606
+ validatePublishableKey(pk);
607
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/oauth/authenticate`, {
608
+ method: "POST",
609
+ headers: {
610
+ accept: "application/json",
611
+ "x-publishable-key": pk,
612
+ "Content-Type": "application/json"
613
+ },
614
+ body: JSON.stringify(params)
615
+ });
616
+ if (!response.ok) {
617
+ throw new Error(`Failed to authenticate OAuth: ${response.statusText}`);
618
+ }
619
+ return response.json();
620
+ }
621
+ async function refreshIntegrationToken(accessToken, publishableKey) {
622
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
623
+ validatePublishableKey(pk);
624
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/token/refresh`, {
625
+ method: "POST",
626
+ headers: {
627
+ accept: "application/json",
628
+ "x-publishable-key": pk,
629
+ "Content-Type": "application/json"
630
+ },
631
+ body: JSON.stringify({ access_token: accessToken })
632
+ });
633
+ if (!response.ok) {
634
+ throw new Error(`Failed to refresh token: ${response.statusText}`);
635
+ }
636
+ return response.json();
637
+ }
638
+ async function getIntegrationHoldings(provider, accessToken, publishableKey) {
639
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
640
+ validatePublishableKey(pk);
641
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/holdings`, {
642
+ method: "POST",
643
+ headers: {
644
+ accept: "application/json",
645
+ "x-publishable-key": pk,
646
+ "Content-Type": "application/json"
647
+ },
648
+ body: JSON.stringify({
649
+ integration_provider: provider,
650
+ access_token: accessToken
651
+ })
652
+ });
653
+ if (!response.ok) {
654
+ throw new Error(`Failed to fetch holdings: ${response.statusText}`);
655
+ }
656
+ return response.json();
657
+ }
658
+ async function createIntegrationTransfer(params, publishableKey) {
659
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
660
+ validatePublishableKey(pk);
661
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/transfers`, {
662
+ method: "POST",
663
+ headers: {
664
+ accept: "application/json",
665
+ "x-publishable-key": pk,
666
+ "Content-Type": "application/json"
667
+ },
668
+ body: JSON.stringify(params)
669
+ });
670
+ if (!response.ok) {
671
+ const err = await response.json().catch(() => ({ message: response.statusText }));
672
+ throw new Error(`Failed to create transfer: ${err.message || response.statusText}`);
673
+ }
674
+ return response.json();
675
+ }
676
+ async function confirmIntegrationTransfer(transferId, accessToken, mfaCode, publishableKey) {
677
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
678
+ validatePublishableKey(pk);
679
+ const body = { access_token: accessToken };
680
+ if (mfaCode) body.mfa_code = mfaCode;
681
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/transfers/${transferId}/confirm`, {
682
+ method: "POST",
683
+ headers: {
684
+ accept: "application/json",
685
+ "x-publishable-key": pk,
686
+ "Content-Type": "application/json"
687
+ },
688
+ body: JSON.stringify(body)
689
+ });
690
+ if (!response.ok) {
691
+ const err = await response.json().catch(() => ({ message: response.statusText }));
692
+ throw new Error(`Failed to confirm transfer: ${err.message || response.statusText}`);
693
+ }
694
+ return response.json();
695
+ }
696
+ async function getIntegrationTransferDefaultToken(params, publishableKey) {
697
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
698
+ validatePublishableKey(pk);
699
+ const response = await fetch(`${API_BASE_URL}/v1/public/integrations/transfers/default_token`, {
700
+ method: "POST",
701
+ headers: {
702
+ accept: "application/json",
703
+ "x-publishable-key": pk,
704
+ "Content-Type": "application/json"
705
+ },
706
+ body: JSON.stringify(params)
707
+ });
708
+ if (!response.ok) {
709
+ const err = await response.json().catch(() => ({ message: response.statusText }));
710
+ throw new Error(`Failed to get transfer default token: ${err.message || response.statusText}`);
711
+ }
712
+ return response.json();
713
+ }
548
714
  async function buildSolanaTransaction(request, publishableKey) {
549
715
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
550
716
  validatePublishableKey(pk);
@@ -942,13 +1108,17 @@ export {
942
1108
  DepositEventType,
943
1109
  ExecutionStatus,
944
1110
  IneligibilityReason,
1111
+ IntegrationProvider,
945
1112
  SOLANA_USDC_ADDRESS,
1113
+ authenticateIntegrationOAuth,
946
1114
  buildHypercoreTransaction,
947
1115
  buildSolanaTransaction,
948
1116
  checkHypercoreActivation,
1117
+ confirmIntegrationTransfer,
949
1118
  createCashAppSession,
950
1119
  createDepositAddress,
951
1120
  createExchangeSession,
1121
+ createIntegrationTransfer,
952
1122
  createOnrampSession,
953
1123
  formatStablecoinAmount,
954
1124
  generatePrefixedKSUID,
@@ -959,12 +1129,16 @@ export {
959
1129
  getCashAppSessionStatus,
960
1130
  getChainName,
961
1131
  getDefaultOnrampToken,
1132
+ getDepositAddress,
962
1133
  getDepositQuote,
963
1134
  getExchangeSessionStartUrl,
964
1135
  getExchanges,
965
1136
  getFiatCurrencies,
966
1137
  getIconUrl,
967
1138
  getIconUrlWithCdn,
1139
+ getIntegrationExchanges,
1140
+ getIntegrationHoldings,
1141
+ getIntegrationTransferDefaultToken,
968
1142
  getIpAddress,
969
1143
  getOnrampQuotes,
970
1144
  getOnrampSessionStartUrl,
@@ -979,10 +1153,12 @@ export {
979
1153
  listPaymentIntentExecutions,
980
1154
  pollDirectExecutions,
981
1155
  queryExecutions,
1156
+ refreshIntegrationToken,
982
1157
  retrievePaymentIntent,
983
1158
  sendHypercoreTransaction,
984
1159
  sendSolanaTransaction,
985
1160
  setApiConfig,
1161
+ startIntegrationOAuth,
986
1162
  useUserIp,
987
1163
  verifyRecipientAddress
988
1164
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
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",