@bolt-liquidity-hq/core
v0.1.0-beta.38
Published
Typescript library with common helpers, utilities and types for all the Bolt clients.
Downloads
822
Maintainers
Readme
@bolt-liquidity-hq/core
Core types, interfaces, and utilities for the Bolt Liquidity SDK ecosystem.
📦 Installation
# Using npm
npm install @bolt-liquidity-hq/core
# Using yarn
yarn add @bolt-liquidity-hq/core
# Using pnpm
pnpm add @bolt-liquidity-hq/core🎯 Purpose
This package provides the foundational building blocks used across all Bolt Liquidity SDK packages:
- Type Definitions: Strongly-typed interfaces for assets, chains, prices, and more
- Base Classes: Abstract implementations for clients and error handling
- Utility Functions: Common helpers for formatting, validation, and conversion
- Constants: Shared configuration values and defaults
📚 What's Included
Types & Interfaces
import {
Asset,
ChainConfig,
Price,
SwapParams,
Pool,
OracleConfig,
RouterConfig,
} from '@bolt-liquidity-hq/core';Error Classes
import {
BaseError,
NotFoundError,
InvalidParameterError,
TransactionError,
} from '@bolt-liquidity-hq/core';
// Type-safe error handling
try {
// ... operation
} catch (error) {
if (error instanceof NotFoundError) {
console.error('Resource not found:', error.message);
}
}Utility Functions
import { getCoinFromAmountWithDenomString } from '@bolt-liquidity-hq/core';
// Extract coin from a string
const parsed = getCoinFromAmountWithDenomString('1000000uatom'); // { amount: "1000000", denom: "uatom" }Base Classes
import { BaseClient } from '@bolt-liquidity-hq/core';
// Extend for blockchain-specific implementations
class MyCustomClient extends BaseClient {
// Implementation details
}📖 API Reference
Full API documentation is available in our docs.
Development
See the CONTRIBUTING.md file.
📄 License
Apache 2.0 - see LICENSE for details.
