@boltzpay/core
v0.1.1
Published
Core domain types and value objects for BoltzPay SDK
Maintainers
Readme
@boltzpay/core
Domain primitives for the BoltzPay SDK -- value objects, protocol interfaces, and shared types.
Install
npm install @boltzpay/coreMost users should install
@boltzpay/sdkinstead. This package is useful if you are building a custom protocol adapter or need the domain types without the full SDK.
Exports
Value Objects
Money-- Immutable monetary value object with safe arithmetic (add,subtract,multiply,isZero,isGreaterThan,toDisplayString)
Protocol Interfaces
ProtocolAdapter-- Interface for implementing payment protocol adaptersProtocolQuote-- Quote result from a protocol adapterProtocolResult-- Payment result from a protocol adapterEndpointInputHints-- Hints extracted from 402 metadata (method, content-type, body schema)
Chain Types
ChainNamespace--"eip155"(EVM) or"solana"NetworkIdentifier-- Chain identifier (e.g.,eip155:8453for Base)WalletInfo-- Wallet address and chain infoAcceptOption-- Accepted payment option from a 402 response
Errors
DomainError-- Base error classNegativeMoneyError-- Negative amount rejectedInvalidMoneyFormatError-- Unparseable money stringCurrencyMismatchError-- Arithmetic on different currenciesNoCompatibleChainError-- No wallet matches the required chainProtocolDetectionFailedError-- No adapter recognized the 402 response
License
MIT
