@railgun-community/shared-models
Advanced tools
Comparing version 3.1.4 to 3.1.5
@@ -18,12 +18,12 @@ "use strict"; | ||
if (lowercaseMsg.includes('call revert exception')) { | ||
return new Error('Possible bad token address.'); | ||
return new Error('Failed to connect to RPC.'); | ||
} | ||
if (lowercaseMsg.includes('missing revert data')) { | ||
return new Error('Possible bad address.'); | ||
return new Error('RPC connection error.'); | ||
} | ||
if (lowercaseMsg.includes('transaction may fail or may require manual gas limit')) { | ||
return new Error('Something went wrong. Please make sure you have a valid balance for this transaction.'); | ||
return new Error('Something went wrong. Please make sure you have a valid gas balance for this transaction.'); | ||
} | ||
if (lowercaseMsg.includes('replacement fee too low')) { | ||
return new Error('Cancellation fee too low. Please increase your network fee to replace the current pending transaction.'); | ||
return new Error('Nonce is used in a pending transaction, and replacement fee is too low. Please increase your network fee to replace the pending transaction.'); | ||
} | ||
@@ -34,12 +34,39 @@ if (lowercaseMsg.includes('intrinsic gas too low')) { | ||
if (lowercaseMsg.includes('insufficient funds for intrinsic')) { | ||
return new Error('Insufficient gas in signing wallet.'); | ||
return new Error('Insufficient gas to process transaction.'); | ||
} | ||
if (lowercaseMsg.includes('nonce has already been used')) { | ||
return new Error('Nonce previously used: this transaction is already completed.'); | ||
return new Error('Nonce already used: the transaction was already completed.'); | ||
} | ||
if (lowercaseMsg.includes('Error while dialing dial tcp')) { | ||
return new Error('Error while dialing provider. Please try again.'); | ||
if (lowercaseMsg.includes('error while dialing dial tcp')) { | ||
return new Error('Error while connecting to RPC provider. Please try again.'); | ||
} | ||
if (lowercaseMsg.includes('RailgunLogic: Invalid Merkle Root')) { | ||
return new Error('RailgunLogic: Invalid Merkle Root. Please try re-scanning your balances through Settings.'); | ||
// Custom RAILGUN contract error messages | ||
if (lowercaseMsg.includes('railgunsmartwallet')) { | ||
if (lowercaseMsg.includes('invalid nft note value')) { | ||
return new Error('RailgunSmartWallet: Invalid NFT Note Value.'); | ||
} | ||
if (lowercaseMsg.includes('unsupported token')) { | ||
return new Error('RailgunSmartWallet: Unsupported Token. This token cannot interact with the RAILGUN contract.'); | ||
} | ||
if (lowercaseMsg.includes('invalid note value')) { | ||
return new Error('RailgunSmartWallet: Invalid Note Value. Please submit transaction with a corrected amount.'); | ||
} | ||
if (lowercaseMsg.includes('invalid adapt contract as sender')) { | ||
return new Error('RailgunSmartWallet: Invalid Adapt Contract as Sender. Please update your frontend to current Adapt module versions.'); | ||
} | ||
if (lowercaseMsg.includes('invalid merkle root')) { | ||
return new Error('RailgunSmartWallet: Invalid Merkle Root. Please sync your balances and try again.'); | ||
} | ||
if (lowercaseMsg.includes('note already spent')) { | ||
return new Error('RailgunSmartWallet: Note Already Spent. Please sync your balances and try again.'); | ||
} | ||
if (lowercaseMsg.includes('invalid note ciphertext array length')) { | ||
return new Error('RailgunSmartWallet: Invalid Note Ciphertext Array Length. Please sync balances and re-prove your transaction.'); | ||
} | ||
if (lowercaseMsg.includes('invalid withdraw note')) { | ||
return new Error('RailgunSmartWallet: Invalid Unshield Note. Please sync balances and re-prove your transaction.'); | ||
} | ||
if (lowercaseMsg.includes('invalid snark proof')) { | ||
return new Error('RailgunSmartWallet: Invalid Snark Proof. Please re-prove your transaction.'); | ||
} | ||
} | ||
@@ -46,0 +73,0 @@ return new Error(validAscii(err.message).replace(":".concat(STRING_PREFIX_AFTER_UNICODE_REPLACEMENT), ': ')); |
{ | ||
"name": "@railgun-community/shared-models", | ||
"version": "3.1.4", | ||
"version": "3.1.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88191
993