@near-eth/aurora-erc20
Advanced tools
Comparing version 1.1.0-1 to 1.1.0-2
@@ -27,3 +27,2 @@ "use strict"; | ||
const utils_1 = require("@near-eth/utils"); | ||
const eth_revert_reason_1 = __importDefault(require("eth-revert-reason")); | ||
const ethers_1 = require("ethers"); | ||
@@ -469,5 +468,5 @@ const bs58_1 = __importDefault(require("bs58")); | ||
const provider = utils_2.getEthProvider(); | ||
const ethNetwork = (await provider.getNetwork()).name; | ||
if (ethNetwork !== process.env.ethNetworkId) { | ||
console.log('Wrong eth network for checkSync, expected: %s, got: %s', process.env.ethNetworkId, ethNetwork); | ||
const ethChainId = (await provider.getNetwork()).chainId; | ||
if (ethChainId !== Number(process.env.ethChainId)) { | ||
console.log('Wrong eth network for checkSync, expected: %s, got: %s', process.env.ethChainId, ethChainId); | ||
return transfer; | ||
@@ -556,5 +555,5 @@ } | ||
const provider = utils_2.getEthProvider(); | ||
const ethNetwork = (await provider.getNetwork()).name; | ||
if (ethNetwork !== process.env.ethNetworkId) { | ||
console.log('Wrong eth network for checkUnlock, expected: %s, got: %s', process.env.ethNetworkId, ethNetwork); | ||
const ethChainId = (await provider.getNetwork()).chainId; | ||
if (ethChainId !== Number(process.env.ethChainId)) { | ||
console.log('Wrong eth network for checkUnlock, expected: %s, got: %s', process.env.ethChainId, ethChainId); | ||
return transfer; | ||
@@ -593,10 +592,3 @@ } | ||
if (!unlockReceipt.status) { | ||
let error; | ||
try { | ||
error = await eth_revert_reason_1.default(unlockHash, ethNetwork, 'latest', provider); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
error = `Could not determine why transaction failed; encountered error: ${e.message}`; | ||
} | ||
const error = `Transaction failed: ${unlockReceipt.transactionHash}`; | ||
return { | ||
@@ -603,0 +595,0 @@ ...transfer, |
@@ -26,3 +26,2 @@ "use strict"; | ||
exports.checkApprove = exports.approve = exports.initiate = exports.recover = exports.checkStatus = exports.act = exports.i18n = exports.TRANSFER_TYPE = exports.DESTINATION_NETWORK = exports.SOURCE_NETWORK = void 0; | ||
const eth_revert_reason_1 = __importDefault(require("eth-revert-reason")); | ||
const ethers_1 = require("ethers"); | ||
@@ -222,6 +221,6 @@ const client_1 = require("@near-eth/client"); | ||
const provider = utils_1.getSignerProvider(); | ||
const ethNetwork = (await provider.getNetwork()).name; | ||
if (ethNetwork !== process.env.ethNetworkId) { | ||
const ethChainId = (await provider.getNetwork()).chainId; | ||
if (ethChainId !== Number(process.env.ethChainId)) { | ||
// Webapp should prevent the user from confirming if the wrong network is selected | ||
throw new Error('Wrong eth network for approve, expected: %s, got: %s', process.env.ethNetworkId, ethNetwork); | ||
throw new Error(`Wrong eth network for approve, expected: ${process.env.ethChainId}, got: ${ethChainId}`); | ||
} | ||
@@ -263,5 +262,5 @@ // TODO enable different recipient and consider multisig case where sender is not the signer | ||
const provider = utils_1.getEthProvider(); | ||
const ethNetwork = (await provider.getNetwork()).name; | ||
if (ethNetwork !== process.env.ethNetworkId) { | ||
console.log('Wrong eth network for checkApprove, expected: %s, got: %s', process.env.ethNetworkId, ethNetwork); | ||
const ethChainId = (await provider.getNetwork()).chainId; | ||
if (ethChainId !== Number(process.env.ethChainId)) { | ||
console.log('Wrong eth network for checkApprove, expected: %s, got: %s', process.env.ethChainId, ethChainId); | ||
return transfer; | ||
@@ -311,11 +310,3 @@ } | ||
if (!approvalReceipt.status) { | ||
let error; | ||
try { | ||
error = await eth_revert_reason_1.default(approvalHash, ethNetwork, 'latest', provider); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
error = `Could not determine why transaction '${approvalReceipt.transactionHash}' | ||
failed; encountered error: ${e.message}`; | ||
} | ||
const error = `Transaction failed: ${approvalReceipt.transactionHash}`; | ||
return { | ||
@@ -355,6 +346,6 @@ ...transfer, | ||
const provider = utils_1.getSignerProvider(); | ||
const ethNetwork = (await provider.getNetwork()).name; | ||
if (ethNetwork !== process.env.ethNetworkId) { | ||
const ethChainId = (await provider.getNetwork()).chainId; | ||
if (ethChainId !== Number(process.env.ethChainId)) { | ||
// Webapp should prevent the user from confirming if the wrong network is selected | ||
throw new Error('Wrong eth network for lock, expected: %s, got: %s', process.env.ethNetworkId, ethNetwork); | ||
throw new Error(`Wrong eth network for lock, expected: ${process.env.ethChainId}, got: ${ethChainId}`); | ||
} | ||
@@ -381,5 +372,5 @@ const ethTokenLocker = new ethers_1.ethers.Contract(process.env.ethLockerAddress, process.env.ethLockerAbiText, provider.getSigner()); | ||
const lockHash = last(transfer.lockHashes); | ||
const ethNetwork = (await provider.getNetwork()).name; | ||
if (ethNetwork !== process.env.ethNetworkId) { | ||
console.log('Wrong eth network for checkLock, expected: %s, got: %s', process.env.ethNetworkId, ethNetwork); | ||
const ethChainId = (await provider.getNetwork()).chainId; | ||
if (ethChainId !== Number(process.env.ethChainId)) { | ||
console.log('Wrong eth network for checkLock, expected: %s, got: %s', process.env.ethChainId, ethChainId); | ||
return transfer; | ||
@@ -427,10 +418,3 @@ } | ||
if (!lockReceipt.status) { | ||
let error; | ||
try { | ||
error = await eth_revert_reason_1.default(lockHash, ethNetwork, 'latest', provider); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
error = `Could not determine why transaction failed; encountered error: ${e.message}`; | ||
} | ||
const error = `Transaction failed: ${lockReceipt.transactionHash}`; | ||
return { | ||
@@ -437,0 +421,0 @@ ...transfer, |
{ | ||
"name": "@near-eth/aurora-erc20", | ||
"version": "1.1.0-1", | ||
"version": "1.1.0-2", | ||
"license": "(MIT AND Apache-2.0)", | ||
@@ -26,3 +26,2 @@ "main": "dist/index.js", | ||
"bs58": "^4.0.1", | ||
"eth-revert-reason": "^1.0.3", | ||
"ethereumjs-util": "^7.0.10", | ||
@@ -29,0 +28,0 @@ "ethers": "^5.4.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
10
100486
1445
- Removedeth-revert-reason@^1.0.3
- Removedeth-revert-reason@1.0.3(transitive)
- Removedethers@4.0.49(transitive)
- Removedhash.js@1.1.3(transitive)
- Removedjs-sha3@0.5.7(transitive)
- Removedscrypt-js@2.0.4(transitive)
- Removedsetimmediate@1.0.4(transitive)
- Removeduuid@2.0.1(transitive)
- Removedxmlhttprequest@1.8.0(transitive)