@daoed-com/uniswap-v2-sdk-core
v1.0.2
Published
⚒️ A unified SDK for building applications on DAOed Uniswap V2 smart contracts
Downloads
5
Readme
DAOed Uniswap V2 SDK Core
⚒️ An SDK for building applications on top of DAOed Uniswap V2 Core
Installation
Install the SDK from npm:
npm install @daoed-com/uniswap-v2-sdk-coreor with yarn:
yarn add @daoed-com/uniswap-v2-sdk-coreUsage
import { Token, Pair, Route } from '@daoed-com/uniswap-v2-sdk-core'
// Create token instances
const token0 = new Token(1, '0x...', 18, 'TOKEN0', 'Token 0')
const token1 = new Token(1, '0x...', 18, 'TOKEN1', 'Token 1')
// Create pair and route
const pair = new Pair(token0Amount, token1Amount)
const route = new Route([pair], token0)Development
Building the SDK
Before committing changes, run the build command to generate the latest distribution files:
npm run buildor
npx tsdx buildThis will generate the compiled JavaScript files in the dist/ directory.
Publishing Process
- Make your changes to the source code in
src/ - Run the build command:
npm run build - Update the version in
package.jsonif needed - Publish to npm:
npm publish
Important Notes
- The
dist/directory contains the built files for distribution - Always run
npm run buildbefore publishing to ensure the latest built files are included - The
prepublishOnlyscript will automatically run the build before publishing
