New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@near-eth/aurora-erc20

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@near-eth/aurora-erc20 - npm Package Compare versions

Comparing version 1.1.0-1 to 1.1.0-2

22

dist/bridged-erc20/sendToEthereum/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc