import type { Codec } from '../../serializable/codec'; import type { TypeSymbols } from '../constants'; export interface Serializable { _type: TypeSymbols; toBytes(codec: Codec): Uint8Array; } export interface SerializableStatic { new (...args: any[]): Serializable; fromBytes(bytes: Uint8Array, codec: Codec): [Serializable, Uint8Array]; } export function staticImplements() { return (constructor: U) => { constructor; }; } export function serializable() { return staticImplements(); } export interface Amounter extends Serializable { amount(): bigint; }