Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
719fd524
Unverified
Commit
719fd524
authored
Feb 17, 2023
by
lynn
Committed by
GitHub
Feb 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update user rejected txn errors to stay up to date with widget (#5996)
init
parent
f15dd1e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
swapErrorToUserReadableMessage.tsx
src/utils/swapErrorToUserReadableMessage.tsx
+5
-1
No files found.
src/utils/swapErrorToUserReadableMessage.tsx
View file @
719fd524
...
@@ -25,6 +25,8 @@ export function swapErrorToUserReadableMessage(error: any): string {
...
@@ -25,6 +25,8 @@ export function swapErrorToUserReadableMessage(error: any): string {
// The 4001 error code doesn't capture the case where users reject a transaction for all wallets,
// The 4001 error code doesn't capture the case where users reject a transaction for all wallets,
// so we need to parse the reason for these special cases:
// so we need to parse the reason for these special cases:
if
(
if
(
// ethers v5.7.0 wrapped error
error
?.
code
===
'
ACTION_REJECTED
'
||
// For Rainbow :
// For Rainbow :
(
reason
?.
match
(
/request/i
)
&&
reason
?.
match
(
/reject/i
))
||
(
reason
?.
match
(
/request/i
)
&&
reason
?.
match
(
/reject/i
))
||
// For Frame:
// For Frame:
...
@@ -32,7 +34,9 @@ export function swapErrorToUserReadableMessage(error: any): string {
...
@@ -32,7 +34,9 @@ export function swapErrorToUserReadableMessage(error: any): string {
// For SafePal:
// For SafePal:
reason
?.
match
(
/cancelled by user/i
)
||
reason
?.
match
(
/cancelled by user/i
)
||
// For Coinbase:
// For Coinbase:
reason
?.
match
(
/user denied/i
)
reason
?.
match
(
/user denied/i
)
||
// For Fireblocks
reason
?.
match
(
/user rejected/i
)
)
{
)
{
return
t
`Transaction rejected`
return
t
`Transaction rejected`
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment