Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arb-ethers-web3-bridge

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arb-ethers-web3-bridge - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

7

ethers-web3-bridge.js

@@ -496,9 +496,4 @@ /*

}
if (txRequest.gas) {
txRequest.gasLimit = txRequest.gas
delete(txRequest.gas)
}
signer.sendTransaction(txRequest).then(
signer.sendTransaction(makeTransaction(txRequest)).then(
function (tx) {

@@ -505,0 +500,0 @@ respond(tx.hash)

53

index.js

@@ -19,2 +19,53 @@ /*

module.exports = ProviderBridge
// wrapProvider was inspired by https://github.com/ethereum-optimism/optimism-monorepo/blob/master/packages/ovm-truffle-provider-wrapper/index.ts
function wrapProvider(provider) {
if (typeof provider !== 'object' || !provider['sendAsync']) {
throw Error(
'Invalid provider. Expected provider to conform to Truffle provider interface!'
)
}
let chainId = 'not set';
provider.sendAsync({
jsonrpc: "2.0",
method: "net_version",
params: [],
id: 0
}, (err, network) => {
if (chainId == 'not set') {
if (err) {
throw Error("couldn't get chain id", err)
}
if (typeof(network.result) === 'string') {
network.result = parseInt(network.result)
}
chainId = network.result
}
})
const sendAsync = provider.sendAsync
const send = provider.send
provider.sendAsync = function(...args) {
if (args[0].method === 'eth_sendTransaction') {
// To properly set chainID for all transactions.
args[0].params[0].chainId = chainId
}
sendAsync.apply(this, args)
}
provider.send = function(...args) {
if (args[0].method === 'eth_sendTransaction') {
// To properly set chainID for all transactions.
args[0].params[0].chainId = chainId
}
send.apply(this, args)
}
return provider
}
module.exports = {
ProviderBridge,
wrapProvider
}
{
"name": "arb-ethers-web3-bridge",
"version": "0.7.2",
"version": "0.7.3",
"description": "Arbitrum bridge for converting ethers provider into web3",

@@ -5,0 +5,0 @@ "author": "Offchain Labs, Inc.",

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