@unifold/core 0.1.63 → 0.1.65
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 +77 -9
- package/dist/index.d.ts +77 -9
- package/dist/index.js +38 -0
- package/dist/index.mjs +36 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type ChainType = 'ethereum' | 'solana' | 'bitcoin' | 'algorand' | 'xrpl' | 'cardano';
|
|
1
|
+
type ChainType = 'ethereum' | 'solana' | 'bitcoin' | 'algorand' | 'xrpl' | 'cardano' | 'n1';
|
|
2
2
|
|
|
3
3
|
declare function setApiConfig(config: {
|
|
4
4
|
baseUrl?: string;
|
|
@@ -24,10 +24,10 @@ declare function getIconUrl(iconPath: string): string;
|
|
|
24
24
|
declare function getIconUrlWithCdn(iconPath: string, assetCdnUrl?: string): string;
|
|
25
25
|
interface Wallet {
|
|
26
26
|
id: string;
|
|
27
|
-
chain_type:
|
|
27
|
+
chain_type: ChainType;
|
|
28
28
|
address_type: string | null;
|
|
29
29
|
address: string;
|
|
30
|
-
destination_chain_type:
|
|
30
|
+
destination_chain_type: ChainType;
|
|
31
31
|
destination_chain_id: string;
|
|
32
32
|
destination_token_address: string;
|
|
33
33
|
recipient_address: string;
|
|
@@ -93,7 +93,7 @@ declare function getDepositAddress(params: GetExistingDepositAddressRequest, pub
|
|
|
93
93
|
/**
|
|
94
94
|
* Get wallet address for a specific chain type
|
|
95
95
|
*/
|
|
96
|
-
declare function getWalletByChainType(wallets: Wallet[], chainType:
|
|
96
|
+
declare function getWalletByChainType(wallets: Wallet[], chainType: ChainType): Wallet | undefined;
|
|
97
97
|
interface AutoSwapRequest {
|
|
98
98
|
wallet_id: string;
|
|
99
99
|
origin_currency: string;
|
|
@@ -551,6 +551,78 @@ interface AddressBalancesResponse {
|
|
|
551
551
|
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
552
552
|
*/
|
|
553
553
|
declare function getAddressBalances(address: string, chainType: ChainType, publishableKey?: string): Promise<AddressBalancesResponse>;
|
|
554
|
+
/** Wallet ids supported by the connect-wallet flow. */
|
|
555
|
+
type WalletMobileDeepLinkWallet = "phantom" | "metamask" | "coinbase" | "trust" | "rainbow" | "rabby" | "okx";
|
|
556
|
+
/** Chain types an external wallet can connect on. */
|
|
557
|
+
type ExternalWalletChainType = "ethereum" | "solana";
|
|
558
|
+
/** A supported external (self-custody) wallet from the directory endpoint. */
|
|
559
|
+
interface ExternalWalletInfo {
|
|
560
|
+
id: WalletMobileDeepLinkWallet;
|
|
561
|
+
name: string;
|
|
562
|
+
chain_types: ExternalWalletChainType[];
|
|
563
|
+
install_url: string;
|
|
564
|
+
icon_url: string;
|
|
565
|
+
icon_urls: Array<{
|
|
566
|
+
url: string;
|
|
567
|
+
format: "svg" | "png";
|
|
568
|
+
}>;
|
|
569
|
+
/** Whether the wallet can be opened into its in-app browser on mobile. */
|
|
570
|
+
supports_mobile_browse: boolean;
|
|
571
|
+
/**
|
|
572
|
+
* Mobile platforms the in-app browser deep link works on.
|
|
573
|
+
* `null` means all platforms; an explicit list (e.g. `["ios"]`) tells the
|
|
574
|
+
* client to only offer mobile-browse on those platforms.
|
|
575
|
+
*/
|
|
576
|
+
mobile_browse_platforms: ("ios" | "android")[] | null;
|
|
577
|
+
}
|
|
578
|
+
interface ExternalWalletsResponse {
|
|
579
|
+
data: ExternalWalletInfo[];
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* List the external (self-custody) wallets supported by the connect-wallet flow.
|
|
583
|
+
*
|
|
584
|
+
* Returns the wallet catalog (id, name, networks, install URL, icons, mobile
|
|
585
|
+
* in-app browser support) from the backend, so the supported set can change
|
|
586
|
+
* server-side without an SDK release.
|
|
587
|
+
*
|
|
588
|
+
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
589
|
+
*/
|
|
590
|
+
declare function getExternalWallets(publishableKey?: string): Promise<ExternalWalletsResponse>;
|
|
591
|
+
/** A Unifold deposit address the hosted pay page can send funds to. */
|
|
592
|
+
interface WalletMobileDeepLinkDepositAddress {
|
|
593
|
+
chain_type: string;
|
|
594
|
+
address: string;
|
|
595
|
+
}
|
|
596
|
+
interface WalletMobileDeepLinkResponse {
|
|
597
|
+
/** The wallet the deep link was generated for. */
|
|
598
|
+
wallet: WalletMobileDeepLinkWallet;
|
|
599
|
+
/**
|
|
600
|
+
* Universal/deep link that opens the hosted Unifold pay page inside the
|
|
601
|
+
* wallet's in-app browser, or `null` when the wallet has no reliable
|
|
602
|
+
* dapp-browser deep link.
|
|
603
|
+
*/
|
|
604
|
+
deeplink: string | null;
|
|
605
|
+
/** The hosted Unifold pay URL the deep link points at (self-contained flow). */
|
|
606
|
+
pay_url: string;
|
|
607
|
+
/** Whether the wallet supports opening a dapp in its in-app browser. */
|
|
608
|
+
supported: boolean;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Generate a mobile in-app browser deep link for a wallet.
|
|
612
|
+
*
|
|
613
|
+
* Browser-extension wallets only inject their provider inside their own in-app
|
|
614
|
+
* browser, not in a regular mobile browser. The backend builds a self-contained
|
|
615
|
+
* Unifold-hosted pay URL (embedding the given deposit addresses) and wraps it in
|
|
616
|
+
* the selected wallet's in-app browser deep link (e.g. Phantom's embedded
|
|
617
|
+
* browser). Opening it runs the deposit flow inside the wallet without depending
|
|
618
|
+
* on the merchant's site. `deeplink` is `null` for wallets without a reliable
|
|
619
|
+
* dapp-browser deep link.
|
|
620
|
+
*
|
|
621
|
+
* @param wallet - Wallet id (phantom, metamask, coinbase, trust, rainbow, rabby, okx)
|
|
622
|
+
* @param depositAddresses - Unifold deposit addresses (one per source chain) to embed in the hosted pay URL
|
|
623
|
+
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
624
|
+
*/
|
|
625
|
+
declare function getWalletMobileDeepLink(wallet: WalletMobileDeepLinkWallet, depositAddresses: WalletMobileDeepLinkDepositAddress[], publishableKey?: string): Promise<WalletMobileDeepLinkResponse>;
|
|
554
626
|
interface AddressBalanceResponse {
|
|
555
627
|
address: string;
|
|
556
628
|
chain_type: string;
|
|
@@ -1125,14 +1197,10 @@ interface DepositQuote {
|
|
|
1125
1197
|
* Results are cached server-side for 1 minute.
|
|
1126
1198
|
*/
|
|
1127
1199
|
declare function getDepositQuote(request: DepositQuoteRequest, publishableKey?: string): Promise<DepositQuote>;
|
|
1128
|
-
type HypercoreActionType = "spot_send" | "usd_send";
|
|
1129
1200
|
interface BuildHypercoreTransactionRequest {
|
|
1130
|
-
action_type: HypercoreActionType;
|
|
1131
|
-
signature_chain_type: string;
|
|
1132
1201
|
signature_chain_id: string;
|
|
1133
1202
|
recipient_address: string;
|
|
1134
1203
|
token_address: string;
|
|
1135
|
-
token_symbol?: string;
|
|
1136
1204
|
amount: string;
|
|
1137
1205
|
}
|
|
1138
1206
|
interface BuildHypercoreTransactionResponse {
|
|
@@ -1373,4 +1441,4 @@ declare const i18n: {
|
|
|
1373
1441
|
};
|
|
1374
1442
|
type I18nStrings = typeof i18n;
|
|
1375
1443
|
|
|
1376
|
-
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 EvmContractCall, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetExchangesQuery, type
|
|
1444
|
+
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 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 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 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, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getCashAppLimits, getCashAppSessionStatus, getChainName, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, useUserIp, verifyRecipientAddress };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type ChainType = 'ethereum' | 'solana' | 'bitcoin' | 'algorand' | 'xrpl' | 'cardano';
|
|
1
|
+
type ChainType = 'ethereum' | 'solana' | 'bitcoin' | 'algorand' | 'xrpl' | 'cardano' | 'n1';
|
|
2
2
|
|
|
3
3
|
declare function setApiConfig(config: {
|
|
4
4
|
baseUrl?: string;
|
|
@@ -24,10 +24,10 @@ declare function getIconUrl(iconPath: string): string;
|
|
|
24
24
|
declare function getIconUrlWithCdn(iconPath: string, assetCdnUrl?: string): string;
|
|
25
25
|
interface Wallet {
|
|
26
26
|
id: string;
|
|
27
|
-
chain_type:
|
|
27
|
+
chain_type: ChainType;
|
|
28
28
|
address_type: string | null;
|
|
29
29
|
address: string;
|
|
30
|
-
destination_chain_type:
|
|
30
|
+
destination_chain_type: ChainType;
|
|
31
31
|
destination_chain_id: string;
|
|
32
32
|
destination_token_address: string;
|
|
33
33
|
recipient_address: string;
|
|
@@ -93,7 +93,7 @@ declare function getDepositAddress(params: GetExistingDepositAddressRequest, pub
|
|
|
93
93
|
/**
|
|
94
94
|
* Get wallet address for a specific chain type
|
|
95
95
|
*/
|
|
96
|
-
declare function getWalletByChainType(wallets: Wallet[], chainType:
|
|
96
|
+
declare function getWalletByChainType(wallets: Wallet[], chainType: ChainType): Wallet | undefined;
|
|
97
97
|
interface AutoSwapRequest {
|
|
98
98
|
wallet_id: string;
|
|
99
99
|
origin_currency: string;
|
|
@@ -551,6 +551,78 @@ interface AddressBalancesResponse {
|
|
|
551
551
|
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
552
552
|
*/
|
|
553
553
|
declare function getAddressBalances(address: string, chainType: ChainType, publishableKey?: string): Promise<AddressBalancesResponse>;
|
|
554
|
+
/** Wallet ids supported by the connect-wallet flow. */
|
|
555
|
+
type WalletMobileDeepLinkWallet = "phantom" | "metamask" | "coinbase" | "trust" | "rainbow" | "rabby" | "okx";
|
|
556
|
+
/** Chain types an external wallet can connect on. */
|
|
557
|
+
type ExternalWalletChainType = "ethereum" | "solana";
|
|
558
|
+
/** A supported external (self-custody) wallet from the directory endpoint. */
|
|
559
|
+
interface ExternalWalletInfo {
|
|
560
|
+
id: WalletMobileDeepLinkWallet;
|
|
561
|
+
name: string;
|
|
562
|
+
chain_types: ExternalWalletChainType[];
|
|
563
|
+
install_url: string;
|
|
564
|
+
icon_url: string;
|
|
565
|
+
icon_urls: Array<{
|
|
566
|
+
url: string;
|
|
567
|
+
format: "svg" | "png";
|
|
568
|
+
}>;
|
|
569
|
+
/** Whether the wallet can be opened into its in-app browser on mobile. */
|
|
570
|
+
supports_mobile_browse: boolean;
|
|
571
|
+
/**
|
|
572
|
+
* Mobile platforms the in-app browser deep link works on.
|
|
573
|
+
* `null` means all platforms; an explicit list (e.g. `["ios"]`) tells the
|
|
574
|
+
* client to only offer mobile-browse on those platforms.
|
|
575
|
+
*/
|
|
576
|
+
mobile_browse_platforms: ("ios" | "android")[] | null;
|
|
577
|
+
}
|
|
578
|
+
interface ExternalWalletsResponse {
|
|
579
|
+
data: ExternalWalletInfo[];
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* List the external (self-custody) wallets supported by the connect-wallet flow.
|
|
583
|
+
*
|
|
584
|
+
* Returns the wallet catalog (id, name, networks, install URL, icons, mobile
|
|
585
|
+
* in-app browser support) from the backend, so the supported set can change
|
|
586
|
+
* server-side without an SDK release.
|
|
587
|
+
*
|
|
588
|
+
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
589
|
+
*/
|
|
590
|
+
declare function getExternalWallets(publishableKey?: string): Promise<ExternalWalletsResponse>;
|
|
591
|
+
/** A Unifold deposit address the hosted pay page can send funds to. */
|
|
592
|
+
interface WalletMobileDeepLinkDepositAddress {
|
|
593
|
+
chain_type: string;
|
|
594
|
+
address: string;
|
|
595
|
+
}
|
|
596
|
+
interface WalletMobileDeepLinkResponse {
|
|
597
|
+
/** The wallet the deep link was generated for. */
|
|
598
|
+
wallet: WalletMobileDeepLinkWallet;
|
|
599
|
+
/**
|
|
600
|
+
* Universal/deep link that opens the hosted Unifold pay page inside the
|
|
601
|
+
* wallet's in-app browser, or `null` when the wallet has no reliable
|
|
602
|
+
* dapp-browser deep link.
|
|
603
|
+
*/
|
|
604
|
+
deeplink: string | null;
|
|
605
|
+
/** The hosted Unifold pay URL the deep link points at (self-contained flow). */
|
|
606
|
+
pay_url: string;
|
|
607
|
+
/** Whether the wallet supports opening a dapp in its in-app browser. */
|
|
608
|
+
supported: boolean;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Generate a mobile in-app browser deep link for a wallet.
|
|
612
|
+
*
|
|
613
|
+
* Browser-extension wallets only inject their provider inside their own in-app
|
|
614
|
+
* browser, not in a regular mobile browser. The backend builds a self-contained
|
|
615
|
+
* Unifold-hosted pay URL (embedding the given deposit addresses) and wraps it in
|
|
616
|
+
* the selected wallet's in-app browser deep link (e.g. Phantom's embedded
|
|
617
|
+
* browser). Opening it runs the deposit flow inside the wallet without depending
|
|
618
|
+
* on the merchant's site. `deeplink` is `null` for wallets without a reliable
|
|
619
|
+
* dapp-browser deep link.
|
|
620
|
+
*
|
|
621
|
+
* @param wallet - Wallet id (phantom, metamask, coinbase, trust, rainbow, rabby, okx)
|
|
622
|
+
* @param depositAddresses - Unifold deposit addresses (one per source chain) to embed in the hosted pay URL
|
|
623
|
+
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
624
|
+
*/
|
|
625
|
+
declare function getWalletMobileDeepLink(wallet: WalletMobileDeepLinkWallet, depositAddresses: WalletMobileDeepLinkDepositAddress[], publishableKey?: string): Promise<WalletMobileDeepLinkResponse>;
|
|
554
626
|
interface AddressBalanceResponse {
|
|
555
627
|
address: string;
|
|
556
628
|
chain_type: string;
|
|
@@ -1125,14 +1197,10 @@ interface DepositQuote {
|
|
|
1125
1197
|
* Results are cached server-side for 1 minute.
|
|
1126
1198
|
*/
|
|
1127
1199
|
declare function getDepositQuote(request: DepositQuoteRequest, publishableKey?: string): Promise<DepositQuote>;
|
|
1128
|
-
type HypercoreActionType = "spot_send" | "usd_send";
|
|
1129
1200
|
interface BuildHypercoreTransactionRequest {
|
|
1130
|
-
action_type: HypercoreActionType;
|
|
1131
|
-
signature_chain_type: string;
|
|
1132
1201
|
signature_chain_id: string;
|
|
1133
1202
|
recipient_address: string;
|
|
1134
1203
|
token_address: string;
|
|
1135
|
-
token_symbol?: string;
|
|
1136
1204
|
amount: string;
|
|
1137
1205
|
}
|
|
1138
1206
|
interface BuildHypercoreTransactionResponse {
|
|
@@ -1373,4 +1441,4 @@ declare const i18n: {
|
|
|
1373
1441
|
};
|
|
1374
1442
|
type I18nStrings = typeof i18n;
|
|
1375
1443
|
|
|
1376
|
-
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 EvmContractCall, type ExchangeProviderInfo, type ExchangeProvidersResponse, type ExchangeSessionStartParams, type ExchangeWalletAddress, ExecutionStatus, type FeaturedToken, type FeaturedWallet, type FiatCurrenciesResponse, type FiatCurrency, type GetExchangesQuery, type
|
|
1444
|
+
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 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 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 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, type WalletMobileDeepLinkDepositAddress, type WalletMobileDeepLinkResponse, type WalletMobileDeepLinkWallet, authenticateIntegrationOAuth, buildHypercoreTransaction, buildSolanaTransaction, checkHypercoreActivation, confirmIntegrationTransfer, createCashAppSession, createDepositAddress, createExchangeSession, createIntegrationTransfer, createOnrampSession, formatStablecoinAmount, generateKSUID, generatePrefixedKSUID, getAddressBalance, getAddressBalances, getApiBaseUrl, getCashAppLimits, getCashAppSessionStatus, getChainName, getDefaultOnrampToken, getDepositAddress, getDepositQuote, getExchangeSessionStartUrl, getExchanges, getExternalWallets, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIntegrationExchanges, getIntegrationHoldings, getIntegrationTransferDefaultToken, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getTokenMetadata, getWalletByChainType, getWalletMobileDeepLink, i18n, listPaymentIntentExecutions, pollDirectExecutions, queryExecutions, refreshIntegrationToken, retrievePaymentIntent, revokeIntegrationToken, sendHypercoreTransaction, sendSolanaTransaction, setApiConfig, startIntegrationOAuth, useUserIp, verifyRecipientAddress };
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ __export(index_exports, {
|
|
|
50
50
|
getDepositQuote: () => getDepositQuote,
|
|
51
51
|
getExchangeSessionStartUrl: () => getExchangeSessionStartUrl,
|
|
52
52
|
getExchanges: () => getExchanges,
|
|
53
|
+
getExternalWallets: () => getExternalWallets,
|
|
53
54
|
getFiatCurrencies: () => getFiatCurrencies,
|
|
54
55
|
getIconUrl: () => getIconUrl,
|
|
55
56
|
getIconUrlWithCdn: () => getIconUrlWithCdn,
|
|
@@ -66,6 +67,7 @@ __export(index_exports, {
|
|
|
66
67
|
getTokenChains: () => getTokenChains,
|
|
67
68
|
getTokenMetadata: () => getTokenMetadata,
|
|
68
69
|
getWalletByChainType: () => getWalletByChainType,
|
|
70
|
+
getWalletMobileDeepLink: () => getWalletMobileDeepLink,
|
|
69
71
|
i18n: () => i18n,
|
|
70
72
|
listPaymentIntentExecutions: () => listPaymentIntentExecutions,
|
|
71
73
|
pollDirectExecutions: () => pollDirectExecutions,
|
|
@@ -558,6 +560,40 @@ async function getAddressBalances(address, chainType, publishableKey) {
|
|
|
558
560
|
const data = await response.json();
|
|
559
561
|
return data;
|
|
560
562
|
}
|
|
563
|
+
async function getExternalWallets(publishableKey) {
|
|
564
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
565
|
+
validatePublishableKey(pk);
|
|
566
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/external_wallets`, {
|
|
567
|
+
method: "GET",
|
|
568
|
+
headers: {
|
|
569
|
+
accept: "application/json",
|
|
570
|
+
"x-publishable-key": pk
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
if (!response.ok) {
|
|
574
|
+
throw new Error(`Failed to fetch external wallets: ${response.statusText}`);
|
|
575
|
+
}
|
|
576
|
+
const data = await response.json();
|
|
577
|
+
return data;
|
|
578
|
+
}
|
|
579
|
+
async function getWalletMobileDeepLink(wallet, depositAddresses, publishableKey) {
|
|
580
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
581
|
+
validatePublishableKey(pk);
|
|
582
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/external_wallets/mobile_deeplink`, {
|
|
583
|
+
method: "POST",
|
|
584
|
+
headers: {
|
|
585
|
+
"Content-Type": "application/json",
|
|
586
|
+
accept: "application/json",
|
|
587
|
+
"x-publishable-key": pk
|
|
588
|
+
},
|
|
589
|
+
body: JSON.stringify({ wallet, deposit_addresses: depositAddresses })
|
|
590
|
+
});
|
|
591
|
+
if (!response.ok) {
|
|
592
|
+
throw new Error(`Failed to generate wallet deep link: ${response.statusText}`);
|
|
593
|
+
}
|
|
594
|
+
const data = await response.json();
|
|
595
|
+
return data;
|
|
596
|
+
}
|
|
561
597
|
async function getAddressBalance(address, chainType, chainId, tokenAddress, publishableKey) {
|
|
562
598
|
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
563
599
|
validatePublishableKey(pk);
|
|
@@ -1232,6 +1268,7 @@ var i18n = en_default;
|
|
|
1232
1268
|
getDepositQuote,
|
|
1233
1269
|
getExchangeSessionStartUrl,
|
|
1234
1270
|
getExchanges,
|
|
1271
|
+
getExternalWallets,
|
|
1235
1272
|
getFiatCurrencies,
|
|
1236
1273
|
getIconUrl,
|
|
1237
1274
|
getIconUrlWithCdn,
|
|
@@ -1248,6 +1285,7 @@ var i18n = en_default;
|
|
|
1248
1285
|
getTokenChains,
|
|
1249
1286
|
getTokenMetadata,
|
|
1250
1287
|
getWalletByChainType,
|
|
1288
|
+
getWalletMobileDeepLink,
|
|
1251
1289
|
i18n,
|
|
1252
1290
|
listPaymentIntentExecutions,
|
|
1253
1291
|
pollDirectExecutions,
|
package/dist/index.mjs
CHANGED
|
@@ -474,6 +474,40 @@ async function getAddressBalances(address, chainType, publishableKey) {
|
|
|
474
474
|
const data = await response.json();
|
|
475
475
|
return data;
|
|
476
476
|
}
|
|
477
|
+
async function getExternalWallets(publishableKey) {
|
|
478
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
479
|
+
validatePublishableKey(pk);
|
|
480
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/external_wallets`, {
|
|
481
|
+
method: "GET",
|
|
482
|
+
headers: {
|
|
483
|
+
accept: "application/json",
|
|
484
|
+
"x-publishable-key": pk
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
if (!response.ok) {
|
|
488
|
+
throw new Error(`Failed to fetch external wallets: ${response.statusText}`);
|
|
489
|
+
}
|
|
490
|
+
const data = await response.json();
|
|
491
|
+
return data;
|
|
492
|
+
}
|
|
493
|
+
async function getWalletMobileDeepLink(wallet, depositAddresses, publishableKey) {
|
|
494
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
495
|
+
validatePublishableKey(pk);
|
|
496
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/external_wallets/mobile_deeplink`, {
|
|
497
|
+
method: "POST",
|
|
498
|
+
headers: {
|
|
499
|
+
"Content-Type": "application/json",
|
|
500
|
+
accept: "application/json",
|
|
501
|
+
"x-publishable-key": pk
|
|
502
|
+
},
|
|
503
|
+
body: JSON.stringify({ wallet, deposit_addresses: depositAddresses })
|
|
504
|
+
});
|
|
505
|
+
if (!response.ok) {
|
|
506
|
+
throw new Error(`Failed to generate wallet deep link: ${response.statusText}`);
|
|
507
|
+
}
|
|
508
|
+
const data = await response.json();
|
|
509
|
+
return data;
|
|
510
|
+
}
|
|
477
511
|
async function getAddressBalance(address, chainType, chainId, tokenAddress, publishableKey) {
|
|
478
512
|
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
479
513
|
validatePublishableKey(pk);
|
|
@@ -1147,6 +1181,7 @@ export {
|
|
|
1147
1181
|
getDepositQuote,
|
|
1148
1182
|
getExchangeSessionStartUrl,
|
|
1149
1183
|
getExchanges,
|
|
1184
|
+
getExternalWallets,
|
|
1150
1185
|
getFiatCurrencies,
|
|
1151
1186
|
getIconUrl,
|
|
1152
1187
|
getIconUrlWithCdn,
|
|
@@ -1163,6 +1198,7 @@ export {
|
|
|
1163
1198
|
getTokenChains,
|
|
1164
1199
|
getTokenMetadata,
|
|
1165
1200
|
getWalletByChainType,
|
|
1201
|
+
getWalletMobileDeepLink,
|
|
1166
1202
|
i18n,
|
|
1167
1203
|
listPaymentIntentExecutions,
|
|
1168
1204
|
pollDirectExecutions,
|