Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@uniswap/sdk-core
Advanced tools
@uniswap/sdk-core is a JavaScript library that provides core utilities and functions for interacting with the Uniswap protocol. It is designed to help developers build applications that integrate with Uniswap by providing tools for handling tokens, pairs, and transactions.
Token Management
This feature allows you to create and manage token instances. The code sample demonstrates how to create a new token instance for DAI on the Ethereum mainnet.
const { Token } = require('@uniswap/sdk-core');
const token = new Token(1, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin');
Currency Amounts
This feature allows you to handle currency amounts in a precise manner. The code sample shows how to create a currency amount for 1 DAI.
const { Token, CurrencyAmount } = require('@uniswap/sdk-core');
const token = new Token(1, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin');
const amount = CurrencyAmount.fromRawAmount(token, '1000000000000000000');
Fractional Math
This feature provides utilities for fractional math operations. The code sample demonstrates how to perform addition with fractions.
const { Fraction } = require('@uniswap/sdk-core');
const fraction = new Fraction(1, 2);
const result = fraction.add(new Fraction(3, 4));
Ethers.js is a library for interacting with the Ethereum blockchain and its ecosystem. It provides utilities for managing wallets, interacting with smart contracts, and handling Ethereum transactions. While it offers broader blockchain functionalities, @uniswap/sdk-core is more focused on Uniswap-specific operations.
Web3.js is a collection of libraries that allow you to interact with a local or remote Ethereum node. It provides functionalities for sending transactions, interacting with smart contracts, and more. Compared to @uniswap/sdk-core, Web3.js is more general-purpose and not specifically tailored to Uniswap.
Uniswap V3 SDK is a library specifically designed for interacting with Uniswap V3. It provides more advanced features for handling Uniswap V3's concentrated liquidity pools. While @uniswap/sdk-core provides core utilities, the V3 SDK offers more specialized tools for the latest version of Uniswap.
FAQs
⚒️ An SDK for building applications on top of Uniswap V3
The npm package @uniswap/sdk-core receives a total of 67,157 weekly downloads. As such, @uniswap/sdk-core popularity was classified as popular.
We found that @uniswap/sdk-core 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.