/** * Consignment Reader Interface * * Defines the contract for locating and reading the RGB consignment file * produced by sendBegin(). The consignment is submitted to the gas-free * service for cryptographic verification before it co-signs the mining input. * * @module IConsignmentReader */ export interface IConsignmentReader { /** * Locate the consignment written by sendBegin() and return its contents as * a base64-encoded string. * * The path is derived deterministically: * {walletDir}/transfers/{txid}/{assetId_without_rgb:_prefix}/consignment_out * * The TXID is stable for SegWit transactions — it does not change when * additional signatures (e.g. the service co-signature) are added — so it * can be computed from the *unsigned* PSBT returned by sendBegin(). * * @param assetId - The RGB asset ID (e.g. `rgb:abc123…`) * @param unsignedPsbt - The base64 PSBT string returned by sendBegin() * @returns Promise resolving to the base64-encoded consignment bytes * @throws {GasFreeError} with code PSBT_BUILD_FAILED if the PSBT cannot be * parsed, if the wallet directory cannot be read, or if the file is absent */ readForAsset(assetId: string, unsignedPsbt: string): Promise; }