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 2.0.0 to 2.0.1

25

dist/bridged-erc20/getAddress.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@near-eth/client/dist/utils");
const serialize_1 = require("near-api-js/lib/utils/serialize");
const utils_2 = require("@near-eth/utils");
/**

@@ -23,25 +23,6 @@ * Given an erc20 contract address, get the NEAR contract address of the

const nep141Address = erc20Address.replace('0x', '').toLowerCase() + '.' + nep141Factory;
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
class BorshArgs {
constructor(args) {
Object.assign(this, args);
}
}
;
const schema = new Map([
[BorshArgs, {
kind: 'struct',
fields: [
['nep141', 'String']
]
}]
]);
const args = new BorshArgs({
nep141: nep141Address
});
const serializedArgs = serialize_1.serialize(schema, args);
const address = await nearAccount.viewFunction(auroraEvmAccount, 'get_erc20_from_nep141', Buffer.from(serializedArgs), { parse: (result) => Buffer.from(result).toString('hex') });
return '0x' + address;
const address = await utils_2.aurora.getErc20FromNep141({ nep141Address, nearAccount, auroraEvmAccount });
return address;
}
exports.default = getAuroraErc20Address;
//# sourceMappingURL=getAddress.js.map

@@ -245,6 +245,6 @@ "use strict";

const erc20Address = '0x' + Buffer.from(burnEvent.token).toString('hex');
const destinationTokenName = await getMetadata_1.getSymbol({ erc20Address, options });
const symbol = await getMetadata_1.getSymbol({ erc20Address, options });
const decimals = await getMetadata_1.getDecimals({ erc20Address, options });
const sourceTokenName = 'a' + destinationTokenName;
const symbol = destinationTokenName;
const sourceTokenName = 'a' + symbol;
const destinationTokenName = symbol;
const sourceToken = 'TODO get aurora address';

@@ -378,2 +378,3 @@ // @ts-expect-error TODO

console.log('Wrong eth network for checkLock, expected: %s, got: %s', expectedChainId, ethChainId);
return transfer;
}

@@ -384,4 +385,2 @@ // Ethers formats the receipts and removes nearTransactionHash

if (!burnReceipt) {
return transfer; // TODO remove when speed up available on Aurora
// eslint-disable-next-line no-unreachable
if (!transfer.ethCache)

@@ -391,27 +390,7 @@ return transfer;

const tx = {
// @ts-expect-error
nonce: transfer.ethCache.nonce,
// @ts-expect-error
from: transfer.ethCache.from,
// TODO check data is valid when Aurora rpc is complete and contains tx.data (currently "0x")
// @ts-expect-error
data: transfer.ethCache.data,
// @ts-expect-error
to: transfer.ethCache.to
};
/*
const event = {
name: 'Transfer', // TODO
abi: process.env.auroraErc20AbiText,
address: transfer.sourceToken,
validate: ({ returnValues: { from, to, value } }) => {
return (
from.toLowerCase() === transfer.sender.toLowerCase() &&
to === 0 && // TODO address(0)
value === transfer.amount
)
}
}
*/
// @ts-expect-error
const foundTx = await find_replacement_tx_1.findReplacementTx(provider, transfer.ethCache.safeReorgHeight, tx);

@@ -421,3 +400,2 @@ if (!foundTx)

// Ethers formats the receipts and removes nearTransactionHash
// @ts-expect-error
burnReceipt = await provider.send('eth_getTransactionReceipt', [foundTx.hash]);

@@ -424,0 +402,0 @@ }

8

dist/natural-erc20/sendToAurora/index.js

@@ -168,6 +168,6 @@ "use strict";

}
const sourceTokenName = await getMetadata_1.getSymbol({ erc20Address, options: { provider } });
const symbol = await getMetadata_1.getSymbol({ erc20Address, options: { provider } });
const decimals = await getMetadata_1.getDecimals({ erc20Address, options: { provider } });
const destinationTokenName = 'a' + sourceTokenName;
const symbol = sourceTokenName;
const destinationTokenName = 'a' + symbol;
const sourceTokenName = symbol;
const txBlock = await lockedEvent.getBlock();

@@ -494,3 +494,3 @@ const transfer = {

proof = await utils_2.findEthProof('Locked', lockReceipt.transactionHash, (_e = options.erc20LockerAddress) !== null && _e !== void 0 ? _e : bridgeParams.erc20LockerAddress, (_f = options.erc20LockerAbi) !== null && _f !== void 0 ? _f : bridgeParams.erc20LockerAbi, provider);
const proofAlreadyUsed = await nearAccount.viewFunction((_g = options.nep141Factory) !== null && _g !== void 0 ? _g : bridgeParams.nep141Factory, 'is_used_proof', Buffer.from(proof));
const proofAlreadyUsed = await nearAccount.viewFunction((_g = options.nep141Factory) !== null && _g !== void 0 ? _g : bridgeParams.nep141Factory, 'is_used_proof', Buffer.from(proof), { stringify: (args) => args });
if (proofAlreadyUsed) {

@@ -497,0 +497,0 @@ // TODO: find the event relayer tx hash

{
"name": "@near-eth/aurora-erc20",
"version": "2.0.0",
"version": "2.0.1",
"license": "(MIT AND Apache-2.0)",

@@ -23,10 +23,10 @@ "main": "dist/index.js",

"dependencies": {
"@near-eth/client": "1.6.0",
"@near-eth/utils": "2.0.0",
"@near-eth/client": "1.7.0",
"@near-eth/utils": "2.1.0",
"bn.js": "^5.1.3",
"bs58": "^4.0.1",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.0",
"find-replacement-tx": "1.2.0",
"near-api-js": "https://github.com/aurora-is-near/near-api-js#b31f9975b29c69e65c6db2feca2183fac400109e",
"ethers": "^5.4.6",
"find-replacement-tx": "1.2.1",
"near-api-js": "https://github.com/aurora-is-near/near-api-js#2a63db0016a59d031b58033f3ee50942dab4f5f7",
"promisfy": "^1.2.0",

@@ -33,0 +33,0 @@ "rlp": "^2.2.6"

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

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