import { ccc, Transaction, Script, Signer } from "@ckb-ccc/core"; import { CKBFSDataType } from "../molecule"; import { NetworkType, ProtocolVersion } from "../constants"; import { BaseCKBFSCellOptions } from "./shared"; /** * V3 CKBFS transaction utilities - witnesses-based storage with backlinks */ /** * V3-specific Options for publishing a file to CKBFS */ export interface PublishV3Options extends Omit { contentChunks: Uint8Array[]; feeRate?: number; from?: Transaction; version: typeof ProtocolVersion.V3; } /** * V3-specific Options for appending content to a CKBFS file */ export interface AppendV3Options { ckbfsCell: { outPoint: { txHash: string; index: number; }; data: CKBFSDataType; type: Script; lock: Script; capacity: bigint; }; contentChunks: Uint8Array[]; feeRate?: number; network?: NetworkType; version: typeof ProtocolVersion.V3; from?: Transaction; witnessStartIndex?: number; previousTxHash: string; previousWitnessIndex: number; previousChecksum: number; } /** * V3-specific Options for transferring a CKBFS file */ export interface TransferV3Options { ckbfsCell: { outPoint: { txHash: string; index: number; }; data: CKBFSDataType; type: Script; lock: Script; capacity: bigint; }; newLock: Script; feeRate?: number; network?: NetworkType; version: typeof ProtocolVersion.V3; from?: Transaction; previousTxHash: string; previousWitnessIndex: number; previousChecksum: number; } /** * Creates a CKBFS v3 cell * @param options Options for creating the CKBFS cell * @returns The created cell output */ export declare function createCKBFSV3Cell(options: BaseCKBFSCellOptions): { lock: ccc.Script; type: ccc.Script; capacity: bigint; }; /** * Prepares a transaction for publishing a file to CKBFS v3 without fee and change handling * @param options Options for publishing the file * @returns Promise resolving to the prepared transaction and the output index of CKBFS Cell */ export declare function preparePublishV3Transaction(options: PublishV3Options): Promise<{ tx: Transaction; outputIndex: number; emptyTypeID: boolean; }>; /** * Creates a transaction for publishing a file to CKBFS v3 * @param signer The signer to use for the transaction * @param options Options for publishing the file * @returns Promise resolving to the created transaction */ export declare function createPublishV3Transaction(signer: Signer, options: PublishV3Options): Promise; /** * Prepares a transaction for appending content to a CKBFS v3 file without fee and change handling * @param options Options for appending content * @returns Promise resolving to the prepared transaction and the output index of CKBFS Cell */ export declare function prepareAppendV3Transaction(options: AppendV3Options): Promise<{ tx: Transaction; outputIndex: number; }>; /** * Creates a transaction for appending content to a CKBFS v3 file * @param signer The signer to use for the transaction * @param options Options for appending content * @returns Promise resolving to the created transaction */ export declare function createAppendV3Transaction(signer: Signer, options: AppendV3Options): Promise; /** * Creates a transaction for appending content to a CKBFS v3 file (dry run without fee completion) * @param signer The signer to use for the transaction * @param options Options for appending content * @returns Promise resolving to the created transaction */ export declare function createAppendV3TransactionDry(signer: Signer, options: AppendV3Options): Promise; /** * Creates a transaction for transferring ownership of a CKBFS v3 file * @param signer The signer to use for the transaction * @param options Options for transferring the file * @returns Promise resolving to the created transaction */ export declare function createTransferV3Transaction(signer: Signer, options: TransferV3Options): Promise; /** * Creates a complete transaction for publishing a file to CKBFS v3 * @param signer The signer to use for the transaction * @param options Options for publishing the file * @returns Promise resolving to the signed transaction */ export declare function publishCKBFSV3(signer: Signer, options: PublishV3Options): Promise; /** * Creates a complete transaction for appending content to a CKBFS v3 file * @param signer The signer to use for the transaction * @param options Options for appending content * @returns Promise resolving to the signed transaction */ export declare function appendCKBFSV3(signer: Signer, options: AppendV3Options): Promise; /** * Creates a complete transaction for transferring ownership of a CKBFS v3 file * @param signer The signer to use for the transaction * @param options Options for transferring the file * @returns Promise resolving to the signed transaction */ export declare function transferCKBFSV3(signer: Signer, options: TransferV3Options): Promise;