@rhea-finance/cross-chain-aggregation-dex 0.1.9 → 0.2.1
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 +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +123 -88
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +119 -89
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -433,6 +433,30 @@ declare const logger: {
|
|
|
433
433
|
error: (...args: any[]) => void;
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Unified error messages for the SDK
|
|
438
|
+
* All error messages should be defined here for consistency
|
|
439
|
+
*/
|
|
440
|
+
declare const TRANSACTION_EXECUTION_ERROR_MESSAGE = "Transaction execution error occurred. Please contact support";
|
|
441
|
+
declare const ErrorMessages: {
|
|
442
|
+
readonly QUOTE_FAILED: "Failed to get quote";
|
|
443
|
+
readonly EXECUTE_FAILED: "Transaction failed";
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* Get user-friendly error message
|
|
447
|
+
* Prioritizes API error messages, falls back to standardized messages
|
|
448
|
+
*/
|
|
449
|
+
declare function getErrorMessage(error: string | undefined | null, fallback?: string): string;
|
|
450
|
+
/**
|
|
451
|
+
* Process error message to determine if it's a user action or system error
|
|
452
|
+
* Returns original message for user actions, unified message for system errors
|
|
453
|
+
*/
|
|
454
|
+
declare function processErrorMessage(errorMessage: string): string;
|
|
455
|
+
/**
|
|
456
|
+
* Normalize common error patterns
|
|
457
|
+
*/
|
|
458
|
+
declare function normalizeError(error: string | undefined | null): string;
|
|
459
|
+
|
|
436
460
|
/** Set the SDK-wide bluechip token config used for NearIntents compatibility and intermediate routing. */
|
|
437
461
|
declare function setBluechipTokensConfig(config: BluechipTokensConfig): void;
|
|
438
462
|
/** Get the bluechip token config; returns an empty object if unset. */
|
|
@@ -664,4 +688,4 @@ interface QuoteSameChainSwapResult {
|
|
|
664
688
|
*/
|
|
665
689
|
declare function quoteSameChainSwap(params: QuoteSameChainSwapParams, dexRouters: DexRouter[]): Promise<QuoteSameChainSwapResult>;
|
|
666
690
|
|
|
667
|
-
export { AggregateDexRouter, type AggregateDexRouterConfig, type BaseExecuteParams, type BaseQuoteParams, type BitgetAdapter, type BitgetQuoteResponse, BitgetRouter, type BitgetRouterConfig, type BitgetSwapResponse, type BluechipTokenConfig, type BluechipTokensConfig, type CompleteQuoteConfig, type CompleteQuoteParams, type CompleteQuoteResult, type ConfigAdapter, type DexRouter, type EvmChainAdapter, type ExecuteParams, type ExecuteResult, type FindPathAdapter, type FindPathResponse, type IntentsQuotationAdapter, type IntentsQuoteResult, type NearChainAdapter, NearSmartRouter, type NearSmartRouterConfig, type PoolInfo, type QuoteParams, type QuoteResult, type QuoteSameChainSwapParams, type QuoteSameChainSwapResult, type RecipientExecuteParams, type RecipientQuoteParams, type Route, type RouterCapabilities, type SimpleQuoteParams, type SupportedChain, type SwapMultiDexPathAdapter, type SwapMultiDexPathResponse, type TokenInfo, completeQuote, convertSlippageToBasisPoints, findBestBluechipToken, findBestEvmBluechipToken, formatGasString, formatGasToTgas, getBluechipTokensConfig, isEvmIntentsSupportedToken, isNearIntentsSupportedToken, logger, normalizeDestinationAsset, normalizeEvmAddress, normalizeTokenId, quoteSameChainSwap, requiresRecipient, requiresRecipientInExecute, selectBestQuote, setBluechipTokensConfig };
|
|
691
|
+
export { AggregateDexRouter, type AggregateDexRouterConfig, type BaseExecuteParams, type BaseQuoteParams, type BitgetAdapter, type BitgetQuoteResponse, BitgetRouter, type BitgetRouterConfig, type BitgetSwapResponse, type BluechipTokenConfig, type BluechipTokensConfig, type CompleteQuoteConfig, type CompleteQuoteParams, type CompleteQuoteResult, type ConfigAdapter, type DexRouter, ErrorMessages, type EvmChainAdapter, type ExecuteParams, type ExecuteResult, type FindPathAdapter, type FindPathResponse, type IntentsQuotationAdapter, type IntentsQuoteResult, type NearChainAdapter, NearSmartRouter, type NearSmartRouterConfig, type PoolInfo, type QuoteParams, type QuoteResult, type QuoteSameChainSwapParams, type QuoteSameChainSwapResult, type RecipientExecuteParams, type RecipientQuoteParams, type Route, type RouterCapabilities, type SimpleQuoteParams, type SupportedChain, type SwapMultiDexPathAdapter, type SwapMultiDexPathResponse, TRANSACTION_EXECUTION_ERROR_MESSAGE, type TokenInfo, completeQuote, convertSlippageToBasisPoints, findBestBluechipToken, findBestEvmBluechipToken, formatGasString, formatGasToTgas, getBluechipTokensConfig, getErrorMessage, isEvmIntentsSupportedToken, isNearIntentsSupportedToken, logger, normalizeDestinationAsset, normalizeError, normalizeEvmAddress, normalizeTokenId, processErrorMessage, quoteSameChainSwap, requiresRecipient, requiresRecipientInExecute, selectBestQuote, setBluechipTokensConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -433,6 +433,30 @@ declare const logger: {
|
|
|
433
433
|
error: (...args: any[]) => void;
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Unified error messages for the SDK
|
|
438
|
+
* All error messages should be defined here for consistency
|
|
439
|
+
*/
|
|
440
|
+
declare const TRANSACTION_EXECUTION_ERROR_MESSAGE = "Transaction execution error occurred. Please contact support";
|
|
441
|
+
declare const ErrorMessages: {
|
|
442
|
+
readonly QUOTE_FAILED: "Failed to get quote";
|
|
443
|
+
readonly EXECUTE_FAILED: "Transaction failed";
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* Get user-friendly error message
|
|
447
|
+
* Prioritizes API error messages, falls back to standardized messages
|
|
448
|
+
*/
|
|
449
|
+
declare function getErrorMessage(error: string | undefined | null, fallback?: string): string;
|
|
450
|
+
/**
|
|
451
|
+
* Process error message to determine if it's a user action or system error
|
|
452
|
+
* Returns original message for user actions, unified message for system errors
|
|
453
|
+
*/
|
|
454
|
+
declare function processErrorMessage(errorMessage: string): string;
|
|
455
|
+
/**
|
|
456
|
+
* Normalize common error patterns
|
|
457
|
+
*/
|
|
458
|
+
declare function normalizeError(error: string | undefined | null): string;
|
|
459
|
+
|
|
436
460
|
/** Set the SDK-wide bluechip token config used for NearIntents compatibility and intermediate routing. */
|
|
437
461
|
declare function setBluechipTokensConfig(config: BluechipTokensConfig): void;
|
|
438
462
|
/** Get the bluechip token config; returns an empty object if unset. */
|
|
@@ -664,4 +688,4 @@ interface QuoteSameChainSwapResult {
|
|
|
664
688
|
*/
|
|
665
689
|
declare function quoteSameChainSwap(params: QuoteSameChainSwapParams, dexRouters: DexRouter[]): Promise<QuoteSameChainSwapResult>;
|
|
666
690
|
|
|
667
|
-
export { AggregateDexRouter, type AggregateDexRouterConfig, type BaseExecuteParams, type BaseQuoteParams, type BitgetAdapter, type BitgetQuoteResponse, BitgetRouter, type BitgetRouterConfig, type BitgetSwapResponse, type BluechipTokenConfig, type BluechipTokensConfig, type CompleteQuoteConfig, type CompleteQuoteParams, type CompleteQuoteResult, type ConfigAdapter, type DexRouter, type EvmChainAdapter, type ExecuteParams, type ExecuteResult, type FindPathAdapter, type FindPathResponse, type IntentsQuotationAdapter, type IntentsQuoteResult, type NearChainAdapter, NearSmartRouter, type NearSmartRouterConfig, type PoolInfo, type QuoteParams, type QuoteResult, type QuoteSameChainSwapParams, type QuoteSameChainSwapResult, type RecipientExecuteParams, type RecipientQuoteParams, type Route, type RouterCapabilities, type SimpleQuoteParams, type SupportedChain, type SwapMultiDexPathAdapter, type SwapMultiDexPathResponse, type TokenInfo, completeQuote, convertSlippageToBasisPoints, findBestBluechipToken, findBestEvmBluechipToken, formatGasString, formatGasToTgas, getBluechipTokensConfig, isEvmIntentsSupportedToken, isNearIntentsSupportedToken, logger, normalizeDestinationAsset, normalizeEvmAddress, normalizeTokenId, quoteSameChainSwap, requiresRecipient, requiresRecipientInExecute, selectBestQuote, setBluechipTokensConfig };
|
|
691
|
+
export { AggregateDexRouter, type AggregateDexRouterConfig, type BaseExecuteParams, type BaseQuoteParams, type BitgetAdapter, type BitgetQuoteResponse, BitgetRouter, type BitgetRouterConfig, type BitgetSwapResponse, type BluechipTokenConfig, type BluechipTokensConfig, type CompleteQuoteConfig, type CompleteQuoteParams, type CompleteQuoteResult, type ConfigAdapter, type DexRouter, ErrorMessages, type EvmChainAdapter, type ExecuteParams, type ExecuteResult, type FindPathAdapter, type FindPathResponse, type IntentsQuotationAdapter, type IntentsQuoteResult, type NearChainAdapter, NearSmartRouter, type NearSmartRouterConfig, type PoolInfo, type QuoteParams, type QuoteResult, type QuoteSameChainSwapParams, type QuoteSameChainSwapResult, type RecipientExecuteParams, type RecipientQuoteParams, type Route, type RouterCapabilities, type SimpleQuoteParams, type SupportedChain, type SwapMultiDexPathAdapter, type SwapMultiDexPathResponse, TRANSACTION_EXECUTION_ERROR_MESSAGE, type TokenInfo, completeQuote, convertSlippageToBasisPoints, findBestBluechipToken, findBestEvmBluechipToken, formatGasString, formatGasToTgas, getBluechipTokensConfig, getErrorMessage, isEvmIntentsSupportedToken, isNearIntentsSupportedToken, logger, normalizeDestinationAsset, normalizeError, normalizeEvmAddress, normalizeTokenId, processErrorMessage, quoteSameChainSwap, requiresRecipient, requiresRecipientInExecute, selectBestQuote, setBluechipTokensConfig };
|