@blend-money/sdk-types
v1.0.7
Published
Types for Blend SDK.
Downloads
253
Readme
@blend-money/sdk-types
Shared TypeScript type definitions for the Blend SDK ecosystem.
This package contains strict, documented domain and core primitives used by @blend-money/sdk-core and related packages. It exports only types (no runtime code) and models values like percentages and USD using Decimal.js at usage sites for precision.
Features
- Centralized types for SDK modules and domain models
- Strict TypeScript with dedicated primitives (
Hex,ChainId) - Decimal-first numeric modeling via
Decimal.jstype references - ESM-only, type-only exports; zero runtime footprint
Install
pnpm add @blend-money/sdk-typesTypically consumed as a dependency of @blend-money/sdk-core, but can also be used directly in apps for shared typing.
Usage
import type {
// Core primitives
Hex,
ChainId,
BlendClientConfig,
ApiResponseData,
Txn,
ActionPlan,
// Domain types
Percent,
Usd,
Price,
Token,
TokenAmount,
AmountWithToken,
VaultConfig,
StrategyType,
CrossChain,
SafeResolution,
YieldSummary,
BalanceSummary,
DepositRoute,
} from "@blend-money/sdk-types";
const base: ChainId = 8453;
const zeroData: Hex = "0x";Exported Types
Core (src/core.ts)
Hex– 0x-prefixed hex stringChainId– positive integer chain identifierBlendClientConfig– configuration shape for SDK clientsApiResponseData– generic JSON object mapTxn– single onchain transaction descriptorActionPlan– grouped approvals + execution transactions
Domain (src/domain.ts)
Percent,Usd,Price– numeric wrappers usingDecimal.jsToken– ERC‑20 style token metadataTokenAmount– base units amount with decimalsAmountWithToken– token + amount pairVaultConfig/StrategyType– strategy/vault identifiersCrossChain– minimal chain descriptor for cross-chain flowsSafeResolution– result of Safe address resolutionYieldSummary– condensed yield metrics for a vault/marketsBalanceSummary– user/vault balance breakdownsDepositRoute– normalized deposit route descriptor
Notes
- This package exports types only; there is no runtime logic. It is safe for both browser and Node environments.
- Numeric types reference
Decimalfromdecimal.jsto encourage precise arithmetic at call sites.
Requirements
- Node.js ≥ 20
- TypeScript ≥ 5.9
License
MIT
