Catalog npm
Back to packageRELEASE DETAILS

1.0.10

npm

@0xshogun/sdk

Shogun SDK

apibridgesdkshoguntypescript
Published4 Mar 2025
Direct dependencies37
Transitive dependenciesNot calculated

README

Current package documentation

Shogun SDK Integration

Overview

The Shogun SDK is a TypeScript library that enables cross-chain swaps and transfers between EVM chains and Solana. It provides quote fetching, transaction execution, and fee management capabilities.

Installation

npm install @0xshogun/sdk

or

yarn add @0xshogun/sdk

Features

  • Cross-chain token swaps between EVM chains and Solana
  • Quote fetching for optimal swap rates
  • Transaction execution management
  • Fee estimation and management
  • Balance tracking across chains

Supported Chains

  • Ethereum
  • Base
  • Arbitrum
  • Binance Smart Chain
  • Berachain
  • Sonic
  • Solana

Requirements

  • Node.js 16 or higher
  • TypeScript 4.5 or higher

Quick Start

import { ShogunQuoteApiClient } from '@0xshogun/sdk';

// Initialize the client

const client = new ShogunQuoteApiClient(
  'YOUR_API_KEY', // Dextra API key
  'https://api.shogun.com' // Dextra API endpoint
);

// Fetch a quote

const quoteParams: QuoteParams = {
  srcChain: 1, // Token IN chain ID
  destChain: 8453, // Token Out chain ID
  srcToken: '0x...', // Source token address
  destToken: '...', // Destination token address
  amount: '1000000000000000000', // Amount in smallest unit (e.g. wei)
  senderAddress: '0x...', // Sender's wallet address
  affiliateWallet: '0x...', // Affiliate EVM or Solana wallet address
  affiliateFee: '1', // Affiliate fee in percent as 1%
  slippage: 0.5, // Slippage percentage
  destinationAddress: '...', // Destination wallet address
  dstChainOrderAuthorityAddress: '...' // Destination chain order authority address
  dynamicSlippage: true // Or false, only for Solana transactions
};

const quote = await client.fetchQuote(quoteParams);

Balance Checking

The SDK provides balance checking capabilities for both EVM and Solana chains through the ShogunBalancesApiClient.

import { ShogunBalancesApiClient } from '@0xshogun/sdk';

// Initialize the balances client
const balancesClient = new ShogunBalancesApiClient('YOUR_API_KEY'); // YOUR_API_KEY is CODEX API key

// Check EVM wallet balances
const evmBalances = await balancesClient.getEvmWalletBalance('0x...');

// Get token info including prices
const tokenInfo = await balancesClient.getTokenInfo(
  evmBalances,
  '0x...', // wallet address
);

// Check Solana token balances
const solanaBalances = await balancesClient.getSolanaTokenBalances('...');

// Get USD price for a specific token
const tokenPrice = await balancesClient.getTokenUSDPrice(
  '0x...', // token address
  1 // chain ID
);

// Validate addresses
const isValid = balancesClient.isValidAddress('0x...');

Development

Install dependencies

npm install

Build the package

npm run build

Run tests

npm test

Format code

npm run format

Lint code

npm run lint

Contributing Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 38

Native requirements
37 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
zod
Environment
{
  "local_name": "zod",
  "alias": false,
  "peer_metadata": null
}
^3.24.2runtime
bs58
Environment
{
  "local_name": "bs58",
  "alias": false,
  "peer_metadata": null
}
^6.0.0runtime
viem
Environment
{
  "local_name": "viem",
  "alias": false,
  "peer_metadata": null
}
^2.23.5runtime
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.8.1runtime
jsdom
Environment
{
  "local_name": "jsdom",
  "alias": false,
  "peer_metadata": null
}
^26.0.0runtime
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^19.0.0runtime
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": null
}
^2.14.12runtime
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^16.4.7runtime
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^8.0.1runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^6.13.5runtime
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^3.0.7runtime
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^3.3.3runtime
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^19.0.10runtime
@codex-data/sdk
Environment
{
  "local_name": "@codex-data/sdk",
  "alias": false,
  "peer_metadata": null
}
^1.0.4runtime
@solana/web3.js
Environment
{
  "local_name": "@solana/web3.js",
  "alias": false,
  "peer_metadata": null
}
^1.98.0runtime
@solana/spl-token
Environment
{
  "local_name": "@solana/spl-token",
  "alias": false,
  "peer_metadata": null
}
^0.4.12runtime
vite-tsconfig-paths
Environment
{
  "local_name": "vite-tsconfig-paths",
  "alias": false,
  "peer_metadata": null
}
^5.1.4runtime
@testing-library/dom
Environment
{
  "local_name": "@testing-library/dom",
  "alias": false,
  "peer_metadata": null
}
^10.4.0runtime
@vitejs/plugin-react
Environment
{
  "local_name": "@vitejs/plugin-react",
  "alias": false,
  "peer_metadata": null
}
^4.3.4runtime
eslint-plugin-import
Environment
{
  "local_name": "eslint-plugin-import",
  "alias": false,
  "peer_metadata": null
}
^2.31.0runtime
@tanstack/react-query
Environment
{
  "local_name": "@tanstack/react-query",
  "alias": false,
  "peer_metadata": null
}
^5.66.9runtime
@testing-library/react
Environment
{
  "local_name": "@testing-library/react",
  "alias": false,
  "peer_metadata": null
}
^16.2.0runtime
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^9.1.0runtime
eslint-plugin-prettier
Environment
{
  "local_name": "eslint-plugin-prettier",
  "alias": false,
  "peer_metadata": null
}
^5.2.1runtime
@testing-library/jest-dom
Environment
{
  "local_name": "@testing-library/jest-dom",
  "alias": false,
  "peer_metadata": null
}
^6.6.3runtime
@typescript-eslint/parser
Environment
{
  "local_name": "@typescript-eslint/parser",
  "alias": false,
  "peer_metadata": null
}
^8.14.0runtime
@vitest/coverage-istanbul
Environment
{
  "local_name": "@vitest/coverage-istanbul",
  "alias": false,
  "peer_metadata": null
}
3.0.7runtime
eslint-plugin-unused-imports
Environment
{
  "local_name": "eslint-plugin-unused-imports",
  "alias": false,
  "peer_metadata": null
}
^4.1.4runtime
@typescript-eslint/eslint-plugin
Environment
{
  "local_name": "@typescript-eslint/eslint-plugin",
  "alias": false,
  "peer_metadata": null
}
^8.14.0runtime
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^29.7.0development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^1.4.0development
ts-jest
Environment
{
  "local_name": "ts-jest",
  "alias": false,
  "peer_metadata": null
}
^29.2.6development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.7.3development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^29.5.14development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.13.5development
@vitest/coverage-v8
Environment
{
  "local_name": "@vitest/coverage-v8",
  "alias": false,
  "peer_metadata": null
}
^1.4.0development
eslint-plugin-promise
Environment
{
  "local_name": "eslint-plugin-promise",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
eslint-plugin-sonarjs
Environment
{
  "local_name": "eslint-plugin-sonarjs",
  "alias": false,
  "peer_metadata": null
}
^2.0.4development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "bb7955a840a615a670dd5e5d7dd0ea8272fa7525",
  "tarball": "https://registry.npmjs.org/@0xshogun/sdk/-/sdk-1.0.10.tgz",
  "fileCount": 226,
  "integrity": "sha512-kF4N1DRIDbAbprLazB1wcrZqvvZqjmEafHHiofabfzwzG69i0TNvMAo++lRG+//LnD3yAFbooU+IwQfgk4LSCg==",
  "signatures": [
    {
      "sig": "MEYCIQCYLO7G5fJp1e5xM8XyOTWVwYSmutWua/agIsJjCcqVZwIhAODhru1lZeBYMM3pgglqb8avOC4WKdARKlkVrjA+2O19",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 906979
}

Repository

PENDING
shogun-network/shogun-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:27 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:208a44bf979480913298edb03e26257c2b375fcf3f597e2eefad09d0e7db330c

Other collected versions

1.1.5228 Mar1.1.51-beta26 Mar1.1.50-beta26 Mar1.1.4925 Mar1.1.4825 Mar1.1.4725 MarView all collected versions →