komodo_defi_types library

Support for doing something awesome.

More dartdocs go here.

Classes

ActivationProgress
Represents the current state and progress of an activation operation
ActivationProgressDetails
Detailed information about the activation progress
ActivationStrategy
Base interface for asset activation strategies
AddressConversionResult
Result of address conversion
AddressFormat
AddressValidation
Result of address validation
ApiBuildUpdateConfig
Configuration for the KDF API/build binary update process.
ApiClient
ApiClientMock
ApiPlatformConfig
Platform-specific binary configuration used by API build updates.
Argon2Details
Asset
AssetCacheKey
AssetChainId
AssetId
AssetPubkeys
AssetRuntimeUpdateConfig
Configuration for the runtime update process.
AssetSymbol
AssetTransactionHistoryId
Compound unique for the transaction history of an asset for a given wallet. This is used to store the transaction history in key-value storage without collisions when using multiple wallets on the same device.
AuthOptions
AuthResult
BalanceChanges
Represents the effect a transaction has on wallet balances
BalanceInfo
BalanceStrategy
Abstract interface for balance strategies
BalanceStrategyFactory
Factory to create appropriate strategy based on Wallet type and protocol
BannedPubkeyInfo
BatchActivationProgress
Helper for tracking multi-asset activation progress
BatchActivationStrategy
Base class for batch-capable strategies
BestOrder
Minimal representation of a best order from the DEX for a coin/action.
BestOrdersResult
Result of aggregating best orders for a taker volume query.
BlockRangePagination
Pagination by block range
BuildConfig
Full app build configuration as embedded in app_build/build_config.json
ChainId
CoinAmount
Simple coin+amount pair using Decimal precision.
ConfirmAddressDetails
Details returned when the hardware wallet asks to confirm an address.
ContractEventPagination
Contract-specific pagination (e.g., for ERC20 token transfers)
EncryptedMnemonicData
Erc20Protocol
EthEstimatedFeePerGas
Response object for get_eth_estimated_fee_per_gas.
EthFeeLevel
Represents a single fee level returned by the API.
ExplorerUrlPattern
Represents URL patterns for blockchain explorers
FeeInfo
A union representing seven possible fee types:
KdfUser
Updated KdfUser to use WalletId
KmdRewards
LevelFill
One level fill of a taker orderbook sweep on a specific pair.
Mnemonic
NewAddressState
OrderbookEntry
One aggregated level/entry in an orderbook snapshot.
OrderbookSnapshot
Immutable snapshot of an orderbook for a trading pair.
PagePagination
Standard page-based pagination
PlacedOrderSummary
Summary information about a placed maker or taker order.
PlaceholderStrategy
PrivateKey
PrivateKeyHdInfo
ProtocolChainId
ProtocolClass
Base class for all protocol definitions
PubkeyInfo
Public type for the pubkeys info. Note that this is a separate type from the on in the RPC library even though they are similar because we want to keep the GUI types independent from the API types.
PubkeyStrategy
Abstract interface for pubkey strategies
PubkeyStrategyFactory
Factory to create appropriate strategy based on protocol and KDF user
QtumProtocol
SeedNode
Represents a seed node configuration with contact information.
SeedNodeContact
Represents contact information for a seed node.
SiaProtocol
SingleAssetStrategy
Base class for single-asset strategies
SlpProtocol
SwapProgress
Progress update event for an active swap, suitable for streaming to UI.
SwapSummary
Concise summary of a swap suitable for listings and history views.
TakerFillEstimate
Estimated taker fill on a pair, including average price and slippage breakdown.
TakerQuote
High-level taker quote that combines orderbook sweep with a fee preimage.
TendermintChainId
TendermintEstimatedFee
Response object for get_tendermint_estimated_fee.
TendermintFeeLevel
Tendermint fee level with gas price and gas limit
TendermintProtocol
TimestampRangePagination
Pagination by timestamp range
TokenBalanceMap
A mapping of token tickers to their balances. Unlike many other common structures, this one does not correspond to a KDF-defined common structure.
TotalFeeEntry
Total fee entry for a coin with required balance information.
TradePreimageQuote
High-level estimate produced by a trade preimage call.
Transaction
Domain model for a transaction, decoupled from the API representation
TransactionBasedPagination
Pagination from a specific transaction ID
TransactionHistoryStrategy
Base interface for transaction history strategies
TransactionPage
TransactionPagination
Represents different ways to paginate transaction history
TrezorDeviceInfo
Information about a connected Trezor device.
TrezorUserActionData
Data sent to the API when providing a PIN or passphrase to a Trezor device.
UnbanBy
Parameter for UnbanPubkeysRequest
UnbanPubkeysResult
UtxoEstimatedFee
Response object for get_utxo_estimated_fee.
UtxoFeeLevel
UTXO fee level with per-kbyte fee rate
UtxoProtocol
WalletAccount
WalletAddress
WalletBalance
WalletId
Represents a unique wallet identifier
WithdrawalFeeOption
Represents a single fee option for a specific priority level.
WithdrawalFeeOptions
Represents fee options with different priority levels for withdrawals.
WithdrawalProgress
Progress tracking for withdrawal operations
WithdrawalResult
Domain model for a successful withdrawal operation
WithdrawalSource
Specifies the source of funds for a withdrawal
WithdrawParameters
Parameters for initiating a withdrawal
WithdrawResult
Raw API response for a withdrawal operation
ZhtlcProtocol

Enums

AuthExceptionType
Bip44Chain
CantCreateNewAddressReason
The reasons why a new address cannot be created. This is useful for the UI to determine why the "Create New Address" button is disabled.
CoinSubClass
DerivationMethod
FeeEstimatorType
Estimator type used when requesting fee data from the API.
FeePolicy
Fee policy used for swap transactions or general fee selection.
NewAddressStatus
OrderSide
Defines the side of a trade/order from the perspective of the base asset.
Result
SwapStatus
High-level lifecycle status for an atomic swap.
SyncStatusEnum
TrezorUserActionType
Type of user action required by the Trezor device.
WithdrawalErrorCode
WithdrawalFeeLevel
WithdrawalFeePriority
WithdrawalFeeType
WithdrawalSourceType
WithdrawalStatus
Status of a withdrawal operation

Mixins

ExplorerUrlMixin
Mixin to provide explorer URL functionality to Protocol classes

Extensions

ApiBuildUpdateConfigPatterns on ApiBuildUpdateConfig
Adds pattern-matching-related methods to ApiBuildUpdateConfig.
ApiPlatformConfigPatterns on ApiPlatformConfig
Adds pattern-matching-related methods to ApiPlatformConfig.
AssetCacheKeyCanonical on AssetCacheKey
AssetCacheKeyPatterns on AssetCacheKey
Adds pattern-matching-related methods to AssetCacheKey.
AssetIdCacheKeyPrefix on AssetId
AssetPubkeyStrategy on Asset
AssetRuntimeUpdateConfigPatterns on AssetRuntimeUpdateConfig
Adds pattern-matching-related methods to AssetRuntimeUpdateConfig.
BuildConfigPatterns on BuildConfig
Adds pattern-matching-related methods to BuildConfig.
ConfirmAddressDetailsPatterns on ConfirmAddressDetails
Adds pattern-matching-related methods to ConfirmAddressDetails.
FeeInfoPatterns on FeeInfo
Adds pattern-matching-related methods to FeeInfo.
KomodoDefiRpcMethodsExtension on ApiClient
NewAddressStatePatterns on NewAddressState
Adds pattern-matching-related methods to NewAddressState.
TransactionInfoExtension on TransactionInfo
TrezorDeviceInfoPatterns on TrezorDeviceInfo
Adds pattern-matching-related methods to TrezorDeviceInfo.
TrezorUserActionDataPatterns on TrezorUserActionData
Adds pattern-matching-related methods to TrezorUserActionData.

Constants

evmCoinSubClasses → const Set<CoinSubClass>
kDefaultNetId → const int
Default network identifier used by seed nodes and framework configuration.

Functions

canonicalCacheKeyFromBasePrefix(String basePrefix, Map<String, Object?> customFields) String
Builds a canonical string key given a precomputed base prefix <assetConfigId>_<chainId>_<subClass>_<protocolKey>.
canonicalCacheKeyFromParts({required String assetConfigId, required String chainId, required String subClass, required String protocolKey, Map<String, Object?> customFields = const <String, Object?>{}}) String
Builds a canonical string key from the individual parts.
canonicalCustomFieldsSuffix(Map<String, Object?> customFields) String
Builds a canonical suffix for custom fields in the form {"k=v|k2=v2"} with keys sorted alphabetically to ensure stable equality.

Typedefs

Balance = BalanceInfo
LogCallback = void Function(String message)
WithdrawalPreview = WithdrawResult
Preview of a withdrawal operation, using same structure as API response

Exceptions / Errors

AddressConversionException
Exception thrown when address conversion fails
AuthException
HttpException
MissingProtocolFieldException
Thrown when required protocol fields are missing
ProtocolException
Base class for protocol-specific exceptions
ProtocolParsingException
Thrown when protocol parsing fails
UnsupportedProtocolException
Thrown when a protocol type is not supported
WithdrawalException
Exception thrown when withdrawal operations fail