@unifold/core 0.1.26 → 0.1.28

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
@@ -1,3 +1,5 @@
1
+ type ChainType = 'ethereum' | 'solana' | 'bitcoin' | 'algorand' | 'xrpl';
2
+
1
3
  declare function setApiConfig(config: {
2
4
  baseUrl?: string;
3
5
  publishableKey?: string;
@@ -22,7 +24,7 @@ declare function getIconUrl(iconPath: string): string;
22
24
  declare function getIconUrlWithCdn(iconPath: string, assetCdnUrl?: string): string;
23
25
  interface Wallet {
24
26
  id: string;
25
- chain_type: "ethereum" | "solana" | "bitcoin" | "algorand";
27
+ chain_type: "ethereum" | "solana" | "bitcoin" | "algorand" | "xrpl";
26
28
  address_type: string | null;
27
29
  address: string;
28
30
  destination_chain_type: string;
@@ -51,7 +53,7 @@ declare function createDepositAddress(overrides?: Partial<CreateDepositAddressRe
51
53
  /**
52
54
  * Get wallet address for a specific chain type
53
55
  */
54
- declare function getWalletByChainType(wallets: Wallet[], chainType: "ethereum" | "solana" | "bitcoin" | "algorand"): Wallet | undefined;
56
+ declare function getWalletByChainType(wallets: Wallet[], chainType: "ethereum" | "solana" | "bitcoin" | "algorand" | "xrpl"): Wallet | undefined;
55
57
  interface AutoSwapRequest {
56
58
  wallet_id: string;
57
59
  origin_currency: string;
@@ -420,11 +422,16 @@ interface TokenInfo {
420
422
  chain_icon_url: string;
421
423
  chain_icon_urls: TokenIconUrl[];
422
424
  }
425
+ declare enum IneligibilityReason {
426
+ MINIMUM_NOT_MET = "minimum_not_met",
427
+ NOT_SUPPORTED_DEPOSIT_FROM = "not_supported_deposit_from"
428
+ }
423
429
  interface TokenBalance {
424
430
  amount: string;
425
431
  amount_usd: string | null;
426
432
  exchange_rate: string | null;
427
433
  is_eligible: boolean;
434
+ ineligibility_reason: IneligibilityReason | null;
428
435
  token: TokenInfo;
429
436
  }
430
437
  interface AddressBalancesResponse {
@@ -439,7 +446,7 @@ interface AddressBalancesResponse {
439
446
  * @param chainType - Chain type to fetch balances for ('ethereum', 'solana', or 'bitcoin')
440
447
  * @param publishableKey - Optional publishable key, defaults to configured key
441
448
  */
442
- declare function getAddressBalances(address: string, chainType: 'ethereum' | 'solana' | 'bitcoin', publishableKey?: string): Promise<AddressBalancesResponse>;
449
+ declare function getAddressBalances(address: string, chainType: ChainType, publishableKey?: string): Promise<AddressBalancesResponse>;
443
450
  interface AddressBalanceResponse {
444
451
  address: string;
445
452
  chain_type: string;
@@ -456,7 +463,7 @@ interface AddressBalanceResponse {
456
463
  * @param tokenAddress - Token contract address or "native" for native tokens
457
464
  * @param publishableKey - Optional publishable key, defaults to configured key
458
465
  */
459
- declare function getAddressBalance(address: string, chainType: 'ethereum' | 'solana' | 'bitcoin', chainId: string, tokenAddress: string, publishableKey?: string): Promise<AddressBalanceResponse>;
466
+ declare function getAddressBalance(address: string, chainType: ChainType, chainId: string, tokenAddress: string, publishableKey?: string): Promise<AddressBalanceResponse>;
460
467
  interface VerifyAddressRequest {
461
468
  chain_type: string;
462
469
  chain_id: string;
@@ -626,4 +633,4 @@ declare const i18n: {
626
633
  };
627
634
  type I18nStrings = typeof i18n;
628
635
 
629
- export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, buildSolanaTransaction, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, pollDirectExecutions, queryExecutions, sendSolanaTransaction, setApiConfig, useUserIp, verifyRecipientAddress };
636
+ export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type ChainType, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, IneligibilityReason, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, buildSolanaTransaction, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, pollDirectExecutions, queryExecutions, sendSolanaTransaction, setApiConfig, useUserIp, verifyRecipientAddress };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ type ChainType = 'ethereum' | 'solana' | 'bitcoin' | 'algorand' | 'xrpl';
2
+
1
3
  declare function setApiConfig(config: {
2
4
  baseUrl?: string;
3
5
  publishableKey?: string;
@@ -22,7 +24,7 @@ declare function getIconUrl(iconPath: string): string;
22
24
  declare function getIconUrlWithCdn(iconPath: string, assetCdnUrl?: string): string;
23
25
  interface Wallet {
24
26
  id: string;
25
- chain_type: "ethereum" | "solana" | "bitcoin" | "algorand";
27
+ chain_type: "ethereum" | "solana" | "bitcoin" | "algorand" | "xrpl";
26
28
  address_type: string | null;
27
29
  address: string;
28
30
  destination_chain_type: string;
@@ -51,7 +53,7 @@ declare function createDepositAddress(overrides?: Partial<CreateDepositAddressRe
51
53
  /**
52
54
  * Get wallet address for a specific chain type
53
55
  */
54
- declare function getWalletByChainType(wallets: Wallet[], chainType: "ethereum" | "solana" | "bitcoin" | "algorand"): Wallet | undefined;
56
+ declare function getWalletByChainType(wallets: Wallet[], chainType: "ethereum" | "solana" | "bitcoin" | "algorand" | "xrpl"): Wallet | undefined;
55
57
  interface AutoSwapRequest {
56
58
  wallet_id: string;
57
59
  origin_currency: string;
@@ -420,11 +422,16 @@ interface TokenInfo {
420
422
  chain_icon_url: string;
421
423
  chain_icon_urls: TokenIconUrl[];
422
424
  }
425
+ declare enum IneligibilityReason {
426
+ MINIMUM_NOT_MET = "minimum_not_met",
427
+ NOT_SUPPORTED_DEPOSIT_FROM = "not_supported_deposit_from"
428
+ }
423
429
  interface TokenBalance {
424
430
  amount: string;
425
431
  amount_usd: string | null;
426
432
  exchange_rate: string | null;
427
433
  is_eligible: boolean;
434
+ ineligibility_reason: IneligibilityReason | null;
428
435
  token: TokenInfo;
429
436
  }
430
437
  interface AddressBalancesResponse {
@@ -439,7 +446,7 @@ interface AddressBalancesResponse {
439
446
  * @param chainType - Chain type to fetch balances for ('ethereum', 'solana', or 'bitcoin')
440
447
  * @param publishableKey - Optional publishable key, defaults to configured key
441
448
  */
442
- declare function getAddressBalances(address: string, chainType: 'ethereum' | 'solana' | 'bitcoin', publishableKey?: string): Promise<AddressBalancesResponse>;
449
+ declare function getAddressBalances(address: string, chainType: ChainType, publishableKey?: string): Promise<AddressBalancesResponse>;
443
450
  interface AddressBalanceResponse {
444
451
  address: string;
445
452
  chain_type: string;
@@ -456,7 +463,7 @@ interface AddressBalanceResponse {
456
463
  * @param tokenAddress - Token contract address or "native" for native tokens
457
464
  * @param publishableKey - Optional publishable key, defaults to configured key
458
465
  */
459
- declare function getAddressBalance(address: string, chainType: 'ethereum' | 'solana' | 'bitcoin', chainId: string, tokenAddress: string, publishableKey?: string): Promise<AddressBalanceResponse>;
466
+ declare function getAddressBalance(address: string, chainType: ChainType, chainId: string, tokenAddress: string, publishableKey?: string): Promise<AddressBalanceResponse>;
460
467
  interface VerifyAddressRequest {
461
468
  chain_type: string;
462
469
  chain_id: string;
@@ -626,4 +633,4 @@ declare const i18n: {
626
633
  };
627
634
  type I18nStrings = typeof i18n;
628
635
 
629
- export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, buildSolanaTransaction, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, pollDirectExecutions, queryExecutions, sendSolanaTransaction, setApiConfig, useUserIp, verifyRecipientAddress };
636
+ export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type BuildSolanaTransactionRequest, type BuildSolanaTransactionResponse, type ChainType, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, IneligibilityReason, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SendSolanaTransactionRequest, type SendSolanaTransactionResponse, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, buildSolanaTransaction, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, pollDirectExecutions, queryExecutions, sendSolanaTransaction, setApiConfig, useUserIp, verifyRecipientAddress };
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ExecutionStatus: () => ExecutionStatus,
24
+ IneligibilityReason: () => IneligibilityReason,
24
25
  SOLANA_USDC_ADDRESS: () => SOLANA_USDC_ADDRESS,
25
26
  buildSolanaTransaction: () => buildSolanaTransaction,
26
27
  createDepositAddress: () => createDepositAddress,
@@ -397,6 +398,11 @@ async function getIpAddress() {
397
398
  }
398
399
  return response.json();
399
400
  }
401
+ var IneligibilityReason = /* @__PURE__ */ ((IneligibilityReason2) => {
402
+ IneligibilityReason2["MINIMUM_NOT_MET"] = "minimum_not_met";
403
+ IneligibilityReason2["NOT_SUPPORTED_DEPOSIT_FROM"] = "not_supported_deposit_from";
404
+ return IneligibilityReason2;
405
+ })(IneligibilityReason || {});
400
406
  async function getAddressBalances(address, chainType, publishableKey) {
401
407
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
402
408
  validatePublishableKey(pk);
@@ -609,6 +615,7 @@ var i18n = en_default;
609
615
  // Annotate the CommonJS export names for ESM import in node:
610
616
  0 && (module.exports = {
611
617
  ExecutionStatus,
618
+ IneligibilityReason,
612
619
  SOLANA_USDC_ADDRESS,
613
620
  buildSolanaTransaction,
614
621
  createDepositAddress,
package/dist/index.mjs CHANGED
@@ -343,6 +343,11 @@ async function getIpAddress() {
343
343
  }
344
344
  return response.json();
345
345
  }
346
+ var IneligibilityReason = /* @__PURE__ */ ((IneligibilityReason2) => {
347
+ IneligibilityReason2["MINIMUM_NOT_MET"] = "minimum_not_met";
348
+ IneligibilityReason2["NOT_SUPPORTED_DEPOSIT_FROM"] = "not_supported_deposit_from";
349
+ return IneligibilityReason2;
350
+ })(IneligibilityReason || {});
346
351
  async function getAddressBalances(address, chainType, publishableKey) {
347
352
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
348
353
  validatePublishableKey(pk);
@@ -554,6 +559,7 @@ var en_default = {
554
559
  var i18n = en_default;
555
560
  export {
556
561
  ExecutionStatus,
562
+ IneligibilityReason,
557
563
  SOLANA_USDC_ADDRESS,
558
564
  buildSolanaTransaction,
559
565
  createDepositAddress,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
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",