Socket
Book a DemoInstallSign in
Socket

@dezswap/sdk

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dezswap/sdk

TypeScript SDK for interacting with Dezswap AMM protocol on XPLA Chain

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Dezswap SDK

TypeScript SDK for type-safe interaction with Dezswap on XPLA Chain.

Installation

git clone --recurse-submodules https://github.com/dezswap/sdk.git
cd sdk
yarn

The --recurse-submodules flag is required to clone the dezswap-contracts submodule containing contract schemas.

How to Use

1. Setup Git Hooks (Husky)

First-time setup requires initializing Husky for Git hooks:

yarn prepare

This sets up pre-commit hooks for linting and formatting.

2. Code Generation

The SDK uses @cosmwasm/ts-codegen to generate TypeScript clients from CosmWasm contract schemas.

Use the programmatic codegen script to generate all contract clients:

yarn codegen

This runs src/codegen.ts which handles ES module compatibility and generates all four contract clients (DezswapFactory, DezswapPair, DezswapRouter, DezswapToken) to src/generated/.

Individual Contract Generation

Generate clients for specific contracts:

# Generate DezswapFactory client
yarn g:factory

# Generate DezswapPair client  
yarn g:pair

# Generate DezswapRouter client
yarn g:router

# Generate DezswapToken client
yarn g:token

Development

Build

yarn build

This will:

  • Clean the dist directory
  • Run codegen to generate contract clients
  • Compile TypeScript to JavaScript

Testing

Prerequisites

Before running tests, you need to download the required contract artifacts:

# Download pre-built contracts from GitHub releases
bash download-contracts.sh

This script downloads the necessary WASM contract files to the artifacts/ directory based on the configuration in contracts.config.json.

Running Tests

The SDK uses Starship for integration testing with a local XPLA blockchain:

# Run all integration tests
yarn test

# Run tests with coverage report
yarn test:coverage

# Run tests in debug mode (verbose output)
yarn test:debug

# Run specific test files
yarn test --testPathPattern="token"

# Run specific test cases
yarn test --testNamePattern="deploy"

Starship Environment

Tests run against a local XPLA blockchain instance managed by Starship:

# Start Starship environment (manual control)
yarn starship

# Stop Starship environment
yarn starship:clean

Note: The test runner automatically manages the Starship environment, so manual start/stop is usually not needed.

Other Commands

# Lint and format
yarn lint
yarn format

# Type checking
yarn typecheck

Keywords

dezswap

FAQs

Package last updated on 18 Aug 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.