-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix_wc_web3modal_z_index
- Loading branch information
Showing
7 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/swapper/src/swappers/JupiterSwapper/errorPatterns.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export class SolanaLogsError extends Error { | ||
constructor(name: string) { | ||
super(name) | ||
this.name = name | ||
} | ||
} | ||
|
||
export enum JUPITER_ERROR_PATTERNS { | ||
SLIPPAGE_TOLERANCE_EXCEEDED = 'SlippageToleranceExceeded', | ||
JUPITER_SLIPPAGE_ERROR_CODE = '0x1771', | ||
UNDER_MINIMUM_AMOUNT = 'RequireGteViolated', | ||
CONSUMED_MORE_FEES = 'exceeded CUs meter', | ||
} | ||
|
||
export enum JUPITER_ERROR_NAME { | ||
SLIPPAGE_TOLERANCE_EXCEEDED = 'SlippageToleranceExceeded', | ||
UNDER_MINIMUM_AMOUNT = 'UnderMinimumAmount', | ||
CONSUMED_MORE_FEES = 'ConsumedMoreFees', | ||
} | ||
|
||
export const JUPITER_ERRORS: Record<JUPITER_ERROR_PATTERNS | string, string> = { | ||
[JUPITER_ERROR_PATTERNS.SLIPPAGE_TOLERANCE_EXCEEDED]: | ||
JUPITER_ERROR_NAME.SLIPPAGE_TOLERANCE_EXCEEDED, | ||
[JUPITER_ERROR_PATTERNS.JUPITER_SLIPPAGE_ERROR_CODE]: | ||
JUPITER_ERROR_NAME.SLIPPAGE_TOLERANCE_EXCEEDED, | ||
[JUPITER_ERROR_PATTERNS.UNDER_MINIMUM_AMOUNT]: JUPITER_ERROR_NAME.UNDER_MINIMUM_AMOUNT, | ||
[JUPITER_ERROR_PATTERNS.CONSUMED_MORE_FEES]: JUPITER_ERROR_NAME.CONSUMED_MORE_FEES, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './utils/constants' | ||
export * from './errorPatterns' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters