Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@eth-optimism/sdk
Advanced tools
The @eth-optimism/sdk
package provides a set of tools for interacting with Optimism.
@eth-optimism/sdk
has been superseded by op-viem
. For most developers we suggest you migrate to viem which has native built in op-stack support built in. It also has additional benefits.
The OP Labs team has no plans to update @eth-optimism/sdk and it is in maintenance mode at the moment
If viem does not have what you need please let us know by opening an issue in the viem repo or here. Letting us know helps us advocate to upstream more functionality to viem. Viem is missing the following functionality:
If viem doesn't have what you need, the extensions for viem, op-viem extensions, likely have it too.
npm install @eth-optimism/sdk
You can find auto-generated API documentation over at sdk.optimism.io.
Most of the core functionality is in the CrossChainMessenger file.
The CrossChainMessenger
class simplifies the process of moving assets and data between Ethereum and Optimism.
You can use this class to, for example, initiate a withdrawal of ERC20 tokens from Optimism back to Ethereum, accurately track when the withdrawal is ready to be finalized on Ethereum, and execute the finalization transaction after the challenge period has elapsed.
The CrossChainMessenger
can handle deposits and withdrawals of ETH and any ERC20-compatible token.
Detailed API descriptions can be found at sdk.optimism.io.
The CrossChainMessenger
automatically connects to all relevant contracts so complex configuration is not necessary.
The Optimism SDK includes various utilities for handling Optimism's transaction fee model.
For instance, estimateTotalGasCost
will estimate the total cost (in wei) to send at transaction on Optimism including both the L2 execution cost and the L1 data cost.
You can also use the asL2Provider
function to wrap an ethers Provider object into an L2Provider
which will have all of these helper functions attached.
The SDK contains other useful helper functions and constants. For a complete list, refer to the auto-generated SDK documentation
FAQs
[Optimism] Tools for working with Optimism
The npm package @eth-optimism/sdk receives a total of 18,122 weekly downloads. As such, @eth-optimism/sdk popularity was classified as popular.
We found that @eth-optimism/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.