
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
dexterity-sdk
Advanced tools
A TypeScript SDK and CLI for interacting with the Dexterity AMM protocol on Stacks. Dexterity uses an isolated vault system where each liquidity pool exists as an independent smart contract for enhanced security.
npm install dexterity-sdk
import { Dexterity } from "dexterity-sdk";
// Get a quote for swapping tokens
const quote = await Dexterity.getQuote(
"SP123.token-a", // token in
"SP456.token-b", // token out
1000000 // amount (in smallest units)
);
// Execute the swap (client mode)
await Dexterity.executeSwap(
"SP123.token-a",
"SP456.token-b",
1000000
);
🔄 Advanced Trading
💧 Liquidity Management
🛡️ Enterprise Security
🔍 Discovery & Analysis
Create a .env
file in your project root:
# .env
STACKS_API_KEY="your-api-key" # Required for higher rate limits
SEED_PHRASE="..." # Optional: Only for server environments
The SDK supports both client-side (browser) and server-side usage:
// Client-side (browser)
Dexterity.configure({
mode: "client",
network: 'testnet',
});
// Server-side
Dexterity.configure({
mode: "server",
network: 'mainnet,
apiKey: process.env.HIRO_API_KEY,
});
Any configuration can be modified:
// Update individual settings
Dexterity.configure({ maxHops: 3 });
Dexterity.configure({ defaultSlippage: 0.5 });
// Get current config
const config = Dexterity.config
Get quotes for potential trades:
// Simple quote
const quote = await Dexterity.getQuote(
tokenInContract,
tokenOutContract,
amount
);
console.log({
amountIn: quote.amountIn,
amountOut: quote.amountOut,
expectedPrice: quote.expectedPrice,
minimumReceived: quote.minimumReceived,
fee: quote.fee
});
// Execute the quoted trade
await Dexterity.executeSwap(
tokenInContract,
tokenOutContract,
amount,
{ fee: 10000 } // optional parameters
);
Interact with individual liquidity pools:
// Get a specific pool
const vault = Dexterity.build("SP123.pool-abc");
// Get pool information
const [tokenA, tokenB] = vault.getTokens();
const [reserveA, reserveB] = vault.getReserves();
// Get a quote from the pool
const quote = await vault.quote(
1000000,
Opcode.swapExactAForB()
);
The SDK includes a powerful CLI for interacting with the protocol:
# Install globally
npm install -g dexterity-sdk
# Get a quote
dexterity quote .stx SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.charisma-token 1000000
# List all pools
dexterity vaults
# Show debug information
dexterity -d inspect -g
Manage CLI settings:
# View config
dexterity config ls
# Set values
dexterity config set maxHops 3 # router graph search depth
dexterity config set defaultSlippage 0.02 # 2% slippage
# Reset to defaults
dexterity config reset
Analyze protocol components:
# Inspect a pool
dexterity inspect -v SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.charisma-token
# Analyze token routes
dexterity inspect -r .stx SP2ZNGJ85ENDY6QRHQ5P2D4FXKGZWCKTB2T0Z55KS.charisma-token
# Show routing statistics
dexterity inspect -g
# Run tests
npm test
# With coverage
npm run test:coverage
# Clean and build
npm run clean && npm run build
# Development
npm run dev
git checkout -b feature/amazing-feature
)git commit -am 'Add some amazing feature'
)git push origin feature/amazing-feature
)FAQs
SDK and CLI for interacting with Dexterity AMM protocol
The npm package dexterity-sdk receives a total of 43 weekly downloads. As such, dexterity-sdk popularity was classified as not popular.
We found that dexterity-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.