@coinmasters/toolbox-evm
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -1,2 +0,2 @@ | ||
import { aY as o, aZ as t, a_ as b, a$ as l, aS as r, aT as d, b0 as A, bj as i, b2 as T, aW as c, b3 as h, bc as n, b8 as x, b4 as g, bb as k, b5 as w, bh as p, aU as E, bd as M, bi as S, aV as W, b1 as m, ba as C, be as B, bf as V, b6 as u, b9 as N, aX as P, bg as f, b7 as D } from "./index-69ad43b4.js"; | ||
import { aY as o, aZ as t, a_ as b, a$ as l, aS as r, aT as d, b0 as A, bj as i, b2 as T, aW as c, b3 as h, bc as n, b8 as x, b4 as g, bb as k, b5 as w, bh as p, aU as E, bd as M, bi as S, aV as W, b1 as m, ba as C, be as B, bf as V, b6 as u, b9 as N, aX as P, bg as f, b7 as D } from "./index-968a5826.js"; | ||
import "@coinmasters/helpers"; | ||
@@ -3,0 +3,0 @@ export { |
@@ -5,3 +5,3 @@ { | ||
"ethers": "6.9.0", | ||
"@coinmasters/types": "4.6.0" | ||
"@coinmasters/types": "4.6.1" | ||
}, | ||
@@ -18,4 +18,4 @@ "description": "THORSwap evm", | ||
"vitest": "0.34.6", | ||
"@internal/config": "2.6.0", | ||
"@coinmasters/helpers": "10.0.0" | ||
"@coinmasters/helpers": "10.0.1", | ||
"@internal/config": "2.6.1" | ||
}, | ||
@@ -26,3 +26,3 @@ "eslintConfig": { | ||
"peerDependencies": { | ||
"@coinmasters/helpers": "10.0.0" | ||
"@coinmasters/helpers": "10.0.1" | ||
}, | ||
@@ -52,3 +52,3 @@ "exports": { | ||
"types": "./dist/index.d.ts", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"scripts": { | ||
@@ -55,0 +55,0 @@ "build": "vite build", |
@@ -35,2 +35,3 @@ import type { AssetValue } from '@coinmasters/helpers'; | ||
[Chain.Arbitrum]: ContractAddress.ARB, | ||
[Chain.Base]: ContractAddress.ETH, | ||
[Chain.Ethereum]: ContractAddress.ETH, | ||
@@ -407,3 +408,3 @@ [Chain.Avalanche]: ContractAddress.AVAX, | ||
const { from, to, data, value, ...transaction } = tx; | ||
//console.log("TOOLBOX: tx: ",tx) | ||
console.log('TOOLBOX: tx: ', tx); | ||
if (!to) throw new Error('No to address provided'); | ||
@@ -426,3 +427,3 @@ | ||
const nonce = tx.nonce || (await provider.getTransactionCount(address)); | ||
const chainId = (await provider.getNetwork()).chainId; | ||
const chainId = parseInt((await provider.getNetwork()).chainId.toString()); | ||
@@ -447,4 +448,7 @@ const isEIP1559 = isEIP1559Transaction(parsedTxObject) || isEIP1559Compatible; | ||
: {}; | ||
let gasLimit: string; | ||
try { | ||
if(parsedTxObject.gasLimit.indexOf('0x0x') > -1) parsedTxObject.gasLimit.replace('0x0x', '0x') | ||
gasLimit = toHexString( | ||
@@ -454,7 +458,16 @@ parsedTxObject.gasLimit || ((await provider.estimateGas(parsedTxObject)) * 11n) / 10n, | ||
} catch (error) { | ||
throw new Error(`Error estimating gas limit: ${JSON.stringify(error)}`); | ||
console.error('Failed to estimate gas'); | ||
if (chainId === 1) { | ||
gasLimit = toHexString(221000n); | ||
} else if (chainId === 8453) { | ||
gasLimit = toHexString(121000n); | ||
} else { | ||
gasLimit = toHexString(1000000n); | ||
} | ||
} | ||
try { | ||
const txObject = { | ||
console.log('TOOLBOX: checkpoint: parsedTxObject: ', parsedTxObject); | ||
const txObject: any = { | ||
...parsedTxObject, | ||
@@ -467,3 +480,4 @@ chainId, | ||
}; | ||
//console.log("TOOLBOX: txObject: ",txObject) | ||
if(isEIP1559) delete txObject.gasPrice; | ||
console.log('TOOLBOX: txObject: ', txObject); | ||
try { | ||
@@ -474,2 +488,4 @@ const response = await signer.sendTransaction(txObject); | ||
} catch (error) { | ||
// | ||
console.log('TOOLBOX: sendTransaction failed, doing manual sign/broadcast: ', error); | ||
const txHex = await signer.signTransaction({ | ||
@@ -485,3 +501,3 @@ ...txObject, | ||
} catch (error) { | ||
console.error("sendTransaction: BaseEVMToolbox: ",error) | ||
console.error('sendTransaction: BaseEVMToolbox: ', error); | ||
throw new Error(`Error sending transaction: ${JSON.stringify(error)}`); | ||
@@ -488,0 +504,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
867324
18413
+ Added@coinmasters/helpers@10.0.1(transitive)
+ Added@coinmasters/tokens@3.6.1(transitive)
+ Added@coinmasters/types@4.6.1(transitive)
- Removed@coinmasters/helpers@10.0.0(transitive)
- Removed@coinmasters/tokens@3.6.0(transitive)
- Removed@coinmasters/types@4.6.0(transitive)
Updated@coinmasters/types@4.6.1