![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@0x/0x-parser
Advanced tools
🧾 Designed for 0x integrators: This library parses 0x transactions on EVM blockchains into a format that is both user-friendly and easy to understand.
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|---|---|---|---|
Arbitrum | Avalanche | Base | BNB Chain | Celo | Ethereum | Fantom | Optimism | Polygon |
This library is designed for 0x integrators, simplifying the complex task of parsing 0x transactions into a format that is both user-friendly and easy to understand. When swapping tokens, one of the challenges is that the trade can experience slippage through Automated Market Makers (AMMs). This makes the final swap amounts difficult to predict prior to executing the trade. However, this library overcomes that challenge by parsing the transaction receipt and event logs to accurately identify the final swap amounts.
Try out the parser in a live code environment directly in your browser 🌐. You can also experience it in action through the demo UI app, which is built with 0x-parser.
First, make sure you have the required peer dependency viem installed. If you haven't installed it yet, you can do so with the following command:
npm install viem
After installing the peer dependency, proceed to install the @0x/0x-parser package:
npm install @0x/0x-parser
import { parseSwap } from "@0x/0x-parser";
async function main() {
const response = await fetch(
"https://raw.githubusercontent.com/0xProject/protocol/development/packages/contract-artifacts/artifacts/IZeroEx.json"
);
const data = await response.json();
const exchangeProxyAbi = data.compilerOutput.abi;
// You can pass any transaction hash from 0x Exchange Proxy:
// https://etherscan.io/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff
const transactionHash = "0xd8637124d650268ae7680781809800e103a3a2bee9fec56083028fea6d98140b";
const swap = await parseSwap({
transactionHash,
exchangeProxyAbi,
rpcUrl: "https://eth.llamarpc.com",
});
console.log(swap); // Logs the swap details in the console.
}
main();
This repository contains example code that you can run locally, which is useful for the development process. The code can be found in /examples/web/index.html
and you can run the code by running npm run web:example
.
Contributions are always welcomed! Please read the contributing guidelines before submitting a pull request.
FAQs
🧾 Designed for 0x integrators: This library parses 0x transactions on EVM blockchains into a format that is both user-friendly and easy to understand.
The npm package @0x/0x-parser receives a total of 164 weekly downloads. As such, @0x/0x-parser popularity was classified as not popular.
We found that @0x/0x-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.