@near-eth/aurora-erc20
Advanced tools
Comparing version 1.1.0-2 to 1.1.0-3
@@ -72,3 +72,3 @@ "use strict"; | ||
// nonce // tx.nonce of last broadcasted eth tx | ||
// data // tx.input of last broadcasted eth tx | ||
// data // tx.data of last broadcasted eth tx | ||
// } | ||
@@ -330,3 +330,3 @@ // Attributes specific to natural-erc20-to-nep141 transfers | ||
from: transfer.ethCache.from, | ||
// TODO check data is valid when Aurora rpc is complete and contains tx.input (currently "0x") | ||
// TODO check data is valid when Aurora rpc is complete and contains tx.data (currently "0x") | ||
data: transfer.ethCache.data, | ||
@@ -357,3 +357,3 @@ to: transfer.ethCache.to | ||
console.error(error); | ||
if (error instanceof find_replacement_tx_1.SearchError || error instanceof find_replacement_tx_1.TxValidationError) { | ||
if (error instanceof find_replacement_tx_1.TxValidationError) { | ||
return { | ||
@@ -579,3 +579,3 @@ ...transfer, | ||
console.error(error); | ||
if (error instanceof find_replacement_tx_1.SearchError || error instanceof find_replacement_tx_1.TxValidationError) { | ||
if (error instanceof find_replacement_tx_1.TxValidationError) { | ||
return { | ||
@@ -582,0 +582,0 @@ ...transfer, |
@@ -49,2 +49,3 @@ /** | ||
safeReorgHeight: number; | ||
data: any; | ||
nonce: any; | ||
@@ -51,0 +52,0 @@ }; |
@@ -251,2 +251,3 @@ "use strict"; | ||
safeReorgHeight, | ||
data: pendingApprovalTx.data, | ||
nonce: pendingApprovalTx.nonce | ||
@@ -274,17 +275,6 @@ }, | ||
from: transfer.ethCache.from, | ||
to: transfer.ethCache.to | ||
to: transfer.ethCache.to, | ||
data: transfer.ethCache.data | ||
}; | ||
const event = { | ||
name: 'Approval', | ||
abi: process.env.ethErc20AbiText, | ||
address: transfer.sourceToken, | ||
validate: ({ returnValues: { owner, spender, value } }) => { | ||
return (owner.toLowerCase() === transfer.sender.toLowerCase() && | ||
spender.toLowerCase() === process.env.ethLockerAddress.toLowerCase() | ||
// Don't check value as the user may have increased approval before signing. | ||
// value === transfer.amount | ||
); | ||
} | ||
}; | ||
const foundTx = await find_replacement_tx_1.findReplacementTx(provider, transfer.ethCache.safeReorgHeight, tx, event); | ||
const foundTx = await find_replacement_tx_1.findReplacementTx(provider, transfer.ethCache.safeReorgHeight, tx); | ||
if (!foundTx) | ||
@@ -296,3 +286,3 @@ return transfer; | ||
console.error(error); | ||
if (error instanceof find_replacement_tx_1.SearchError || error instanceof find_replacement_tx_1.TxValidationError) { | ||
if (error instanceof find_replacement_tx_1.TxValidationError) { | ||
return { | ||
@@ -362,2 +352,3 @@ ...transfer, | ||
safeReorgHeight, | ||
data: pendingLockTx.data, | ||
nonce: pendingLockTx.nonce | ||
@@ -383,16 +374,6 @@ }, | ||
from: transfer.ethCache.from, | ||
to: transfer.ethCache.to | ||
to: transfer.ethCache.to, | ||
data: transfer.ethCache.data | ||
}; | ||
const event = { | ||
name: 'Locked', | ||
abi: process.env.ethLockerAbiText, | ||
address: process.env.ethLockerAddress, | ||
validate: ({ returnValues: { token, sender, amount, accountId } }) => { | ||
return (token.toLowerCase() === transfer.sourceToken.toLowerCase() && | ||
sender.toLowerCase() === transfer.sender.toLowerCase() && | ||
amount.toString() === transfer.amount && | ||
accountId === process.env.auroraEvmAccount + ':' + transfer.recipient.slice(2)); | ||
} | ||
}; | ||
const foundTx = await find_replacement_tx_1.findReplacementTx(provider, transfer.ethCache.safeReorgHeight, tx, event); | ||
const foundTx = await find_replacement_tx_1.findReplacementTx(provider, transfer.ethCache.safeReorgHeight, tx); | ||
if (!foundTx) | ||
@@ -404,3 +385,3 @@ return transfer; | ||
console.error(error); | ||
if (error instanceof find_replacement_tx_1.SearchError || error instanceof find_replacement_tx_1.TxValidationError) { | ||
if (error instanceof find_replacement_tx_1.TxValidationError) { | ||
return { | ||
@@ -407,0 +388,0 @@ ...transfer, |
{ | ||
"name": "@near-eth/aurora-erc20", | ||
"version": "1.1.0-2", | ||
"version": "1.1.0-3", | ||
"license": "(MIT AND Apache-2.0)", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
40
98299
1427