Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@rainbow-me/swaps
Advanced tools
This SDK handles
Token to ETH swaps
Token to Token swaps
ETH to Token swaps
Use of permit when supported (to avoid an extra approval)
Supported chains are: Mainnet, Ropsten, Rinkeby, Kovan, Optimism, Arbitrum and Polygon
yarn add @rainbow-me/swaps
const quote = await getQuote(
{
source, // optional, "1inch" or "0x"
chainId, // numeric chain id
fromAddress, // address of the wallet to execute the swap from
sellTokenAddress, // address of the input token
buyTokenAddress, // address of the output token
sellAmount, // amount of the input token (required if not passing buyAmount)
buyAmount, // amount of the output token (required if not passing sellAmount)
slippage // max slippage percentage allowed
}
);
const { params, method, methodArgs } = getQuoteExecutionDetails(
quote, // quote returned from getQuote
{ from: quote.from }, // transaction options
provider // ethers provider
);
const estimatedGas = await method(methodArgs);
const tx = await fillQuote(
quote, // quote returned from getQuote
transactionOptions, // gasLimit, maxFeePerGas, maxPriorityFeePerGas, nonce, value, from
permit, // true if you want to use the permit
chainId, // numeric chain id
);
FAQs
This SDK handles
The npm package @rainbow-me/swaps receives a total of 82 weekly downloads. As such, @rainbow-me/swaps popularity was classified as not popular.
We found that @rainbow-me/swaps demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.