Blockchain Traits
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { type BaseBlockchain } from './base-blockchain.js';
|
||||
|
||||
export type BlockchainLockscriptSubscribable<CallbackPayload = undefined> =
|
||||
Pick<
|
||||
BaseBlockchain<CallbackPayload>,
|
||||
'subscribeLockscript' | 'unsubscribeLockscript'
|
||||
>;
|
||||
|
||||
export type BlockchainAddressSubscribable<CallbackPayload = undefined> = Pick<
|
||||
BaseBlockchain<CallbackPayload>,
|
||||
'subscribeAddress' | 'unsubscribeAddress'
|
||||
>;
|
||||
|
||||
export type BlockchainTransactionSubscribable<CallbackPayload = undefined> =
|
||||
Pick<
|
||||
BaseBlockchain<CallbackPayload>,
|
||||
'subscribeTransaction' | 'unsubscribeTransaction'
|
||||
>;
|
||||
|
||||
// TODO: We may have a fetchTokenHistory in future, but Fulcrum does not currently support indexing tokens.
|
||||
// There are actually a few functional discrepancies with the adapters: different adapters grant different capabilities.
|
||||
// For example, Chaingraph can fetch token and address history. But BCHN P2P network cannot even fetch address history.
|
||||
// We might want to handle this by having multiple BlockchainInterfaces (e.g. IBlockchainAddressSubscriptions) that describe capabilities.
|
||||
// But we should return to that later.
|
||||
Reference in New Issue
Block a user