@ckbfs/api 1.5.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +31 -6
  2. package/RFC.v3.md +210 -0
  3. package/dist/index.d.ts +72 -7
  4. package/dist/index.js +440 -75
  5. package/dist/utils/checksum.d.ts +16 -0
  6. package/dist/utils/checksum.js +74 -8
  7. package/dist/utils/constants.d.ts +2 -1
  8. package/dist/utils/constants.js +12 -2
  9. package/dist/utils/file.d.ts +44 -0
  10. package/dist/utils/file.js +303 -30
  11. package/dist/utils/molecule.d.ts +13 -1
  12. package/dist/utils/molecule.js +32 -5
  13. package/dist/utils/transaction-backup.d.ts +117 -0
  14. package/dist/utils/transaction-backup.js +624 -0
  15. package/dist/utils/transaction.d.ts +7 -105
  16. package/dist/utils/transaction.js +45 -565
  17. package/dist/utils/transactions/index.d.ts +8 -0
  18. package/dist/utils/transactions/index.js +31 -0
  19. package/dist/utils/transactions/shared.d.ts +57 -0
  20. package/dist/utils/transactions/shared.js +17 -0
  21. package/dist/utils/transactions/v1v2.d.ts +80 -0
  22. package/dist/utils/transactions/v1v2.js +592 -0
  23. package/dist/utils/transactions/v3.d.ts +124 -0
  24. package/dist/utils/transactions/v3.js +369 -0
  25. package/dist/utils/witness.d.ts +45 -0
  26. package/dist/utils/witness.js +145 -3
  27. package/examples/append-v3.ts +310 -0
  28. package/examples/chunked-publish.ts +307 -0
  29. package/examples/publish-v3.ts +152 -0
  30. package/examples/publish.ts +4 -4
  31. package/examples/retrieve-v3.ts +222 -0
  32. package/package.json +6 -2
  33. package/small-example.txt +1 -0
  34. package/src/index.ts +568 -87
  35. package/src/utils/checksum.ts +90 -9
  36. package/src/utils/constants.ts +19 -2
  37. package/src/utils/file.ts +386 -35
  38. package/src/utils/molecule.ts +43 -6
  39. package/src/utils/transaction-backup.ts +849 -0
  40. package/src/utils/transaction.ts +39 -848
  41. package/src/utils/transactions/index.ts +16 -0
  42. package/src/utils/transactions/shared.ts +64 -0
  43. package/src/utils/transactions/v1v2.ts +791 -0
  44. package/src/utils/transactions/v3.ts +564 -0
  45. package/src/utils/witness.ts +193 -0
package/README.md CHANGED
@@ -11,7 +11,8 @@ CKBFS is a file system protocol built on top of the CKB blockchain that enables
11
11
  - **File Publishing**: Store files of any type on the CKB blockchain
12
12
  - **File Appending**: Add content to existing files with automatic checksum updates
13
13
  - **Content Integrity**: Adler32 checksum verification for all file operations
14
- - **Protocol Versions**: Support for both V1 and V2 CKBFS protocol versions
14
+ - **Protocol Versions**: Support for V1, V2, and V3 CKBFS protocol versions
15
+ - **Witnesses-based Storage**: V3 uses cost-efficient witness storage with backlink tracking
15
16
  - **Network Support**: Compatible with CKB mainnet and testnet
16
17
  - **Chunked Storage**: Automatic file chunking for large files
17
18
 
@@ -31,7 +32,7 @@ const ckbfs = new CKBFS(
31
32
  'your-private-key-here',
32
33
  NetworkType.Testnet,
33
34
  {
34
- version: ProtocolVersion.V2,
35
+ version: ProtocolVersion.V3, // V3 is now default
35
36
  chunkSize: 30 * 1024, // 30KB chunks
36
37
  useTypeID: false
37
38
  }
@@ -65,7 +66,7 @@ new CKBFS(signerOrPrivateKey, networkOrOptions?, options?)
65
66
  ```typescript
66
67
  interface CKBFSOptions {
67
68
  chunkSize?: number; // Default: 30KB
68
- version?: string; // Default: V2
69
+ version?: string; // Default: V3
69
70
  useTypeID?: boolean; // Default: false
70
71
  network?: NetworkType; // Default: Testnet
71
72
  }
@@ -260,7 +261,7 @@ console.log(`Type: ${parsed.type}`); // "typeId" or "outPoint"
260
261
  // Get file content using any identifier format (follows backlinks automatically)
261
262
  const fileData = await getFileContentFromChainByIdentifier(client, ckbfsTypeIdUri, {
262
263
  network: 'testnet',
263
- version: ProtocolVersion.V2,
264
+ version: ProtocolVersion.V3, // V3 supports witness-based backlinks
264
265
  useTypeID: false
265
266
  });
266
267
 
@@ -445,11 +446,31 @@ CKBFS uses a molecule-encoded data structure stored in cell output data:
445
446
  }
446
447
  ```
447
448
 
449
+ **V3 Format:**
450
+ ```
451
+ {
452
+ index: number, // Single witness index (first content witness)
453
+ checksum: number, // Adler32 checksum
454
+ contentType: string, // MIME type
455
+ filename: string, // Original filename
456
+ // Note: No backLinks in cell data - moved to witnesses for cost efficiency
457
+ }
458
+ ```
459
+
448
460
  ### Witness Format
449
461
 
450
- CKBFS witnesses contain:
462
+ **V1/V2 Witnesses:**
463
+ - 5-byte header: "CKBFS" (0x43, 0x4B, 0x42, 0x46, 0x53)
464
+ - 1-byte version: 0x00 or 0x02
465
+ - Variable-length content data
466
+
467
+ **V3 Witnesses (Enhanced with Backlinks):**
451
468
  - 5-byte header: "CKBFS" (0x43, 0x4B, 0x42, 0x46, 0x53)
452
- - 1-byte version: 0x00
469
+ - 1-byte version: 0x03
470
+ - 32-byte previous transaction hash
471
+ - 4-byte previous witness index
472
+ - 4-byte previous checksum
473
+ - 4-byte next witness index (or 0x00000000 for tail)
453
474
  - Variable-length content data
454
475
 
455
476
  ### Checksum Algorithm
@@ -482,6 +503,10 @@ npm run example:append -- --txhash=0x123456...
482
503
  # Retrieve example (demonstrates witness decoding and generic identifier APIs)
483
504
  npm run example:retrieve -- --txhash=0x123456...
484
505
 
506
+ # V3 specific examples
507
+ npm run example:publish-v3
508
+ npm run example:append-v3 -- --txhash=0x123456...
509
+
485
510
  # All examples
486
511
  npm run example
487
512
  ```
package/RFC.v3.md ADDED
@@ -0,0 +1,210 @@
1
+ # CKBFS Protocol V3
2
+
3
+ This is a next generation for CKBFS Protocol, aimed to provide a more affordable storage price -- comparing to similar solutions like IPFS.
4
+
5
+ The most important change of V3 is that there's no longer `Backlinks` inside the Cell data. Instead, it was moved into witnesses.
6
+
7
+
8
+ ## Protocol Standard
9
+
10
+ ### Data Structure
11
+
12
+ #### CKBFS v3 Cell
13
+
14
+ CKBFS Cell is a cell that stores metadata of the file:
15
+
16
+ ```yaml
17
+ Data:
18
+ content_type: Bytes # String Bytes
19
+ filename: Bytes # String Bytes
20
+ index: Uint32 # Reference of the first witnesses index.
21
+ checksum: Uint32 # Adler32 checksum
22
+
23
+ Type:
24
+ hash_type: "data1"
25
+ code_hash: CKBFS_V3_TYPE_DATA_HASH
26
+ args: <TypeID, 32 bytes>,[<hasher_code_hash>, optional]
27
+ Lock:
28
+ <user_defined>
29
+ ```
30
+
31
+ The following rules should be met in a CKBFS cell:
32
+
33
+ - Rule 1: data structure of a CKBFS cell is molecule encoded. See [Molecule](https://github.com/nervosnetwork/molecule) definitions below.
34
+ - Rule 2: checksum must match with specified witnesses. Default checksum algorithm will be Alder32 if not specify `hasher_code_hash` in Type script args.
35
+ - Rule 3: if `hasher_code_hash` is specified, then it will use hasher binary from CellDeps that matches `code_hash`, with same input parameter.
36
+ - Rule 4: Once created, a CKBFS cell can only be updated/transfered, which means it can not be destroyed.
37
+ - Rule 5: **`index` is the first witness index of the stored CKBFS structured contents in splited witnesses.**
38
+
39
+
40
+ ### Witnesses
41
+
42
+ File contents are stored in witnesses. In a single transaction, witnesses can be splitted into multiple parts and concat together while verification.
43
+
44
+ ```yaml
45
+ Witnesses:
46
+ <"CKBFS"> <0x03> <PREVIOUS_POSITION(TX_HASH, Witness_index)> <PREVIOUS_CHECKSUM(4 bytes) | 0x00000000> <NEXT_INDEX | 0x00000000> [CONTENT_BYTES_PART_1]
47
+ <NEXT_INDEX | 0x00000000> <CONTENT_BYTES_PART_2>
48
+ <NEXT_INDEX | 0x00000000> <CONTENT_BYTES_PART_3> ...
49
+ <0x00000000> <CONTENT_BYTES_PART_N>
50
+ ```
51
+
52
+ The following rules should be met for witnesses used in CKBFS:
53
+ - Rule 6: Witnesses are different in `Head Witness`, `Middle Witnesses`, and `Tail Witness`, their form should follow bellow's rules
54
+ - Rule 7: The first 5 bytes of `Head Witness` must be UTF8 coded string bytes of `CKBFS`, which should be: `0x434b424653`
55
+ - Rule 8: The 6th byte of `Head Witness` must be the version of CKBFS protocol, which should be: `0x03`.
56
+ - Rule 9: Previous position of this CKBFS content stores from 7th bytes to 42th bytes in `Head Witness`. it should be previous transaction hash(H256) and previous Head Witness index(Uint32).
57
+ - Rule 10: Previous checksum value must stored in `Head Witness`, position from 43rd to 46th bytes. If there's no previous status, then it should be `0x00000000`.
58
+ - Rule 10: File contents bytes are stored from:
59
+ - 51st byte from the Head Witness.
60
+ - 5th byte from the `Middle Witnesses` and `Tail Witness`
61
+
62
+ ----
63
+
64
+ ### Operations
65
+
66
+ This section describes operations and restrictions in CKBFS v3 implementation.
67
+
68
+ #### Publish
69
+
70
+ Publish operation creates one or more new CKBFS v3 cell.
71
+
72
+ ```yaml
73
+ Witnesses:
74
+ <...>
75
+ <0x434b424653, 0x03, 32bytes 0x00, 0x00000000, 0x00000000, 0x00000002,CKBFS_CONTENT_BYTES_PART_1>
76
+ <0x00000003, CKBFS_CONTENT_BYTES_PART_2>
77
+ <...>
78
+ <0x00000000, CKBFS_CONTENT_BYTES_PART_TAIL>
79
+ <...>
80
+ Inputs:
81
+ <...>
82
+ Outputs:
83
+ <vec> CKBFS_V3_CELL
84
+ Data:
85
+ content-type: string
86
+ filename: string
87
+ indexes: uint32
88
+ checksum: uint32
89
+ Type:
90
+ code_hash: ckbfs v3 type script
91
+ args: 32 bytes type_id, (...)
92
+ <...>
93
+ ```
94
+
95
+ Publish operation must satisfy following rule:
96
+
97
+ - Rule 11: in a publish operation, checksum in cell data must be equal with `hash(Witnesses[ALL_CONTENT_PARTS])`.
98
+ - Rule 12: Previous position value, previous checksum value should be all zero in `Head Witnesses`
99
+
100
+
101
+ ---
102
+
103
+ #### Append
104
+
105
+ Append operation updates exist live CKBFS v3 cell, validates the latest checksum.
106
+
107
+ ```yaml
108
+ // Append
109
+ Witnesses:
110
+ <...>
111
+ <0x434b424653, 0x03, PREVIOUS_TX_HASH_VALUE, PREVIOUS_INDEX_IN_CKBFS_V3_CELL, PREIVOUS_CHECKSUM, 0x00000002,CKBFS_CONTENT_BYTES_PART_1>
112
+ <0x00000003, CKBFS_CONTENT_BYTES_PART_2>
113
+ <...>
114
+ <0x00000000, CKBFS_CONTENT_BYTES_PART_TAIL>
115
+ <...>
116
+ Inputs:
117
+ <...>
118
+ CKBFS_V3_CELL
119
+ Data:
120
+ content-type: string
121
+ filename: string
122
+ index: uint32
123
+ checksum: uint32 # previous checksum
124
+ Type:
125
+ code_hash: ckbfs v3 type script
126
+ args: 32 bytes type_id, (...)
127
+ <...>
128
+ Outputs:
129
+ <...>
130
+ CKBFS_V3_CELL:
131
+ Data:
132
+ content-type: string
133
+ filename: string
134
+ index: uint32
135
+ checksum: uint32 # updated checksum
136
+ Type:
137
+ code_hash: ckbfs v3 type script
138
+ args: 32 bytes type_id, (...)
139
+ ```
140
+
141
+ - Rule 13: new checksum of updated CKBFS cell should be equal to: `hasher.recover_from(previous_checksum).update(new_content_bytes)`
142
+ - Rule 14: `content-type`, `filename`, and Type args of a CKBFS cell CAN NOT be updated in ANY condition
143
+
144
+
145
+ ---
146
+
147
+ #### Transfer
148
+
149
+ Transfer operation transfers ownership of a CKBFS cell, and ensure it did not lost tracking of backlinks.
150
+
151
+ ```yaml
152
+ // Transfer
153
+ Witnesses:
154
+ <...>
155
+ <0x434b424653, 0x03, PREVIOUS_TX_HASH_VALUE, PREVIOUS_INDEX_IN_CKBFS_V3_CELL, PREIVOUS_CHECKSUM, 0x00000000>
156
+ <...>
157
+
158
+ Inputs:
159
+ <...>
160
+ CKBFS_V3_CELL
161
+ Data:
162
+ content-type: string
163
+ filename: string
164
+ index: uint32
165
+ checksum: uint32
166
+ Type:
167
+ code_hash: ckbfs type script
168
+ args: 32 bytes type_id, (...)
169
+ Lock:
170
+ <USER_DEFINED>
171
+ <...>
172
+ Outputs:
173
+ <...>
174
+ CKBFS_V3_CELL:
175
+ Data:
176
+ content-type: string
177
+ filename: string
178
+ index: uint32
179
+ checksum: uint32
180
+ Type:
181
+ code_hash: ckbfs type script
182
+ args: 32 bytes type_id, (...)
183
+ Lock:
184
+ <USER_DEFINED>
185
+ ```
186
+
187
+ - Rule 15: The `Head Witness` should not contain any content part bytes
188
+ - Rule 16: in a transfer operation, `checksum` CAN NOT be updated
189
+
190
+
191
+ ---
192
+
193
+ ## Other Notes
194
+
195
+ ### Molecule Definitions:
196
+
197
+ Here’s molecule definitions of CKBFS data structures
198
+
199
+ ```jsx
200
+ vector Bytes <byte>;
201
+ option BytesOpt (Bytes);
202
+ option Uint32Opt (Uint32);
203
+
204
+ table CKBFSData {
205
+ index: Uint32,
206
+ checksum: Uint32,
207
+ content_type: Bytes,
208
+ filename: Bytes,
209
+ }
210
+ ```
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Script, Signer, Transaction } from "@ckb-ccc/core";
2
- import { calculateChecksum, verifyChecksum, updateChecksum, verifyWitnessChecksum } from "./utils/checksum";
3
- import { createCKBFSCell, createPublishTransaction as utilCreatePublishTransaction, createAppendTransaction as utilCreateAppendTransaction, publishCKBFS as utilPublishCKBFS, appendCKBFS as utilAppendCKBFS, CKBFSCellOptions, PublishOptions, AppendOptions } from "./utils/transaction";
4
- import { readFile, readFileAsText, readFileAsUint8Array, writeFile, getContentType, splitFileIntoChunks, combineChunksToFile, getFileContentFromChain, saveFileFromChain, getFileContentFromChainByTypeId, saveFileFromChainByTypeId, decodeFileFromChainByTypeId, getFileContentFromChainByIdentifier, saveFileFromChainByIdentifier, decodeFileFromChainByIdentifier, parseIdentifier, IdentifierType, decodeWitnessContent, decodeMultipleWitnessContents, extractFileFromWitnesses, decodeFileFromWitnessData, saveFileFromWitnessData } from "./utils/file";
5
- import { createCKBFSWitness, createTextCKBFSWitness, extractCKBFSWitnessContent, isCKBFSWitness, createChunkedCKBFSWitnesses } from "./utils/witness";
2
+ import { calculateChecksum, verifyChecksum, updateChecksum, verifyWitnessChecksum, verifyV3WitnessChecksum, verifyV3WitnessChain } from "./utils/checksum";
3
+ import { createCKBFSCell, createPublishTransaction as utilCreatePublishTransaction, preparePublishTransaction, createAppendTransaction as utilCreateAppendTransaction, prepareAppendTransaction, createAppendTransactionDry, publishCKBFS as utilPublishCKBFS, appendCKBFS as utilAppendCKBFS, CKBFSCellOptions, PublishOptions, AppendOptions, AppendV3Options, TransferV3Options } from "./utils/transaction";
4
+ import { readFile, readFileAsText, readFileAsUint8Array, writeFile, getContentType, splitFileIntoChunks, combineChunksToFile, getFileContentFromChain, saveFileFromChain, getFileContentFromChainByTypeId, saveFileFromChainByTypeId, decodeFileFromChainByTypeId, getFileContentFromChainByIdentifier, saveFileFromChainByIdentifier, decodeFileFromChainByIdentifier, parseIdentifier, IdentifierType, decodeWitnessContent, decodeMultipleWitnessContents, extractFileFromWitnesses, decodeFileFromWitnessData, saveFileFromWitnessData, getFileContentFromChainV3, getFileContentFromChainByIdentifierV3, saveFileFromChainByIdentifierV3 } from "./utils/file";
5
+ import { createCKBFSWitness, createTextCKBFSWitness, extractCKBFSWitnessContent, isCKBFSWitness, createChunkedCKBFSWitnesses, createCKBFSV3Witness, createChunkedCKBFSV3Witnesses, extractCKBFSV3WitnessContent, isCKBFSV3Witness, CKBFSV3WitnessOptions } from "./utils/witness";
6
6
  import { CKBFSData, BackLinkV1, BackLinkV2, CKBFSDataType, BackLinkType, CKBFS_HEADER, CKBFS_HEADER_STRING } from "./utils/molecule";
7
7
  import { NetworkType, ProtocolVersion, ProtocolVersionType, DEFAULT_NETWORK, DEFAULT_VERSION, CKBFS_CODE_HASH, CKBFS_TYPE_ID, ADLER32_CODE_HASH, ADLER32_TYPE_ID, DEP_GROUP_TX_HASH, DEPLOY_TX_HASH, getCKBFSScriptConfig, CKBFSScriptConfig } from "./utils/constants";
8
8
  /**
@@ -28,6 +28,9 @@ export type PublishContentOptions = Omit<FileOptions, "capacity" | "contentType"
28
28
  */
29
29
  export type AppendContentOptions = Omit<FileOptions, "contentType" | "filename" | "capacity"> & {
30
30
  capacity?: bigint;
31
+ previousTxHash?: string;
32
+ previousWitnessIndex?: number;
33
+ previousChecksum?: number;
31
34
  };
32
35
  /**
33
36
  * Configuration options for the CKBFS SDK
@@ -92,7 +95,11 @@ export declare class CKBFS {
92
95
  * @param options Additional options for the append operation
93
96
  * @returns Promise resolving to the transaction hash
94
97
  */
95
- appendFile(filePath: string, ckbfsCell: AppendOptions["ckbfsCell"], options?: Omit<FileOptions, "contentType" | "filename">): Promise<string>;
98
+ appendFile(filePath: string, ckbfsCell: AppendOptions["ckbfsCell"], options?: Omit<FileOptions, "contentType" | "filename"> & {
99
+ previousTxHash?: string;
100
+ previousWitnessIndex?: number;
101
+ previousChecksum?: number;
102
+ }): Promise<string>;
96
103
  /**
97
104
  * Appends content (string or Uint8Array) directly to an existing CKBFS file
98
105
  * @param content The content string or byte array to append
@@ -122,7 +129,11 @@ export declare class CKBFS {
122
129
  * @param options Additional options for the append operation
123
130
  * @returns Promise resolving to the unsigned transaction
124
131
  */
125
- createAppendTransaction(filePath: string, ckbfsCell: AppendOptions["ckbfsCell"], options?: Omit<FileOptions, "contentType" | "filename">): Promise<Transaction>;
132
+ createAppendTransaction(filePath: string, ckbfsCell: AppendOptions["ckbfsCell"], options?: Omit<FileOptions, "contentType" | "filename"> & {
133
+ previousTxHash?: string;
134
+ previousWitnessIndex?: number;
135
+ previousChecksum?: number;
136
+ }): Promise<Transaction>;
126
137
  /**
127
138
  * Creates a new transaction for appending content (string or Uint8Array) directly, but doesn't sign or send it
128
139
  * @param content The content string or byte array to append
@@ -131,5 +142,59 @@ export declare class CKBFS {
131
142
  * @returns Promise resolving to the unsigned transaction
132
143
  */
133
144
  createAppendContentTransaction(content: string | Uint8Array, ckbfsCell: AppendOptions["ckbfsCell"], options?: AppendContentOptions): Promise<Transaction>;
145
+ /**
146
+ * Publishes a file to CKBFS v3
147
+ * @param filePath The path to the file to publish
148
+ * @param options Options for publishing the file
149
+ * @returns Promise resolving to the transaction hash
150
+ */
151
+ publishFileV3(filePath: string, options?: Omit<FileOptions, 'version'>): Promise<string>;
152
+ /**
153
+ * Publishes content (string or Uint8Array) directly to CKBFS v3
154
+ * @param content The content string or byte array to publish
155
+ * @param options Options for publishing the content (contentType and filename are required)
156
+ * @returns Promise resolving to the transaction hash
157
+ */
158
+ publishContentV3(content: string | Uint8Array, options: PublishContentOptions): Promise<string>;
159
+ /**
160
+ * Appends content from a file to an existing CKBFS v3 file
161
+ * @param filePath The path to the file containing the content to append
162
+ * @param ckbfsCell The CKBFS cell to append to
163
+ * @param previousTxHash The previous transaction hash for backlink
164
+ * @param previousWitnessIndex The previous witness index for backlink
165
+ * @param previousChecksum The previous checksum for backlink
166
+ * @param options Additional options for the append operation
167
+ * @returns Promise resolving to the transaction hash
168
+ */
169
+ appendFileV3(filePath: string, ckbfsCell: AppendV3Options["ckbfsCell"], previousTxHash: string, previousWitnessIndex: number, previousChecksum: number, options?: Omit<FileOptions, "contentType" | "filename" | "version">): Promise<string>;
170
+ /**
171
+ * Appends content (string or Uint8Array) directly to an existing CKBFS v3 file
172
+ * @param content The content string or byte array to append
173
+ * @param ckbfsCell The CKBFS cell to append to
174
+ * @param previousTxHash The previous transaction hash for backlink
175
+ * @param previousWitnessIndex The previous witness index for backlink
176
+ * @param previousChecksum The previous checksum for backlink
177
+ * @param options Additional options for the append operation
178
+ * @returns Promise resolving to the transaction hash
179
+ */
180
+ appendContentV3(content: string | Uint8Array, ckbfsCell: AppendV3Options["ckbfsCell"], previousTxHash: string, previousWitnessIndex: number, previousChecksum: number, options?: AppendContentOptions): Promise<string>;
181
+ /**
182
+ * Transfers ownership of a CKBFS v3 file to a new lock script
183
+ * @param ckbfsCell The CKBFS cell to transfer
184
+ * @param newLock The new lock script for the transferred file
185
+ * @param previousTxHash The previous transaction hash for backlink
186
+ * @param previousWitnessIndex The previous witness index for backlink
187
+ * @param previousChecksum The previous checksum for backlink
188
+ * @param options Additional options for the transfer operation
189
+ * @returns Promise resolving to the transaction hash
190
+ */
191
+ transferFileV3(ckbfsCell: TransferV3Options["ckbfsCell"], newLock: Script, previousTxHash: string, previousWitnessIndex: number, previousChecksum: number, options?: Omit<FileOptions, "contentType" | "filename" | "version">): Promise<string>;
192
+ /**
193
+ * Creates a new transaction for publishing a file to CKBFS v3 but doesn't sign or send it
194
+ * @param filePath The path to the file to publish
195
+ * @param options Options for publishing the file
196
+ * @returns Promise resolving to the unsigned transaction
197
+ */
198
+ createPublishV3Transaction(filePath: string, options?: Omit<FileOptions, 'version'>): Promise<Transaction>;
134
199
  }
135
- export { calculateChecksum, verifyChecksum, updateChecksum, verifyWitnessChecksum, createCKBFSCell, utilCreatePublishTransaction as createPublishTransaction, utilCreateAppendTransaction as createAppendTransaction, utilPublishCKBFS as publishCKBFS, utilAppendCKBFS as appendCKBFS, readFile, readFileAsText, readFileAsUint8Array, writeFile, getContentType, splitFileIntoChunks, combineChunksToFile, getFileContentFromChain, saveFileFromChain, getFileContentFromChainByTypeId, saveFileFromChainByTypeId, decodeFileFromChainByTypeId, getFileContentFromChainByIdentifier, saveFileFromChainByIdentifier, decodeFileFromChainByIdentifier, parseIdentifier, IdentifierType, decodeWitnessContent, decodeMultipleWitnessContents, extractFileFromWitnesses, decodeFileFromWitnessData, saveFileFromWitnessData, createCKBFSWitness, createTextCKBFSWitness, extractCKBFSWitnessContent, isCKBFSWitness, createChunkedCKBFSWitnesses, CKBFSData, BackLinkV1, BackLinkV2, CKBFSDataType, BackLinkType, CKBFSCellOptions, PublishOptions, AppendOptions, CKBFS_HEADER, CKBFS_HEADER_STRING, NetworkType, ProtocolVersion, ProtocolVersionType, DEFAULT_NETWORK, DEFAULT_VERSION, CKBFS_CODE_HASH, CKBFS_TYPE_ID, ADLER32_CODE_HASH, ADLER32_TYPE_ID, DEP_GROUP_TX_HASH, DEPLOY_TX_HASH, getCKBFSScriptConfig, CKBFSScriptConfig, };
200
+ export { calculateChecksum, verifyChecksum, updateChecksum, verifyWitnessChecksum, verifyV3WitnessChecksum, verifyV3WitnessChain, createCKBFSCell, utilCreatePublishTransaction as createPublishTransaction, preparePublishTransaction, utilCreateAppendTransaction as createAppendTransaction, prepareAppendTransaction, utilPublishCKBFS as publishCKBFS, utilAppendCKBFS as appendCKBFS, createAppendTransactionDry, readFile, readFileAsText, readFileAsUint8Array, writeFile, getContentType, splitFileIntoChunks, combineChunksToFile, getFileContentFromChain, saveFileFromChain, getFileContentFromChainByTypeId, saveFileFromChainByTypeId, decodeFileFromChainByTypeId, getFileContentFromChainByIdentifier, saveFileFromChainByIdentifier, decodeFileFromChainByIdentifier, parseIdentifier, IdentifierType, decodeWitnessContent, decodeMultipleWitnessContents, extractFileFromWitnesses, decodeFileFromWitnessData, saveFileFromWitnessData, getFileContentFromChainV3, getFileContentFromChainByIdentifierV3, saveFileFromChainByIdentifierV3, createCKBFSWitness, createTextCKBFSWitness, extractCKBFSWitnessContent, isCKBFSWitness, createChunkedCKBFSWitnesses, createCKBFSV3Witness, createChunkedCKBFSV3Witnesses, extractCKBFSV3WitnessContent, isCKBFSV3Witness, CKBFSV3WitnessOptions, CKBFSData, BackLinkV1, BackLinkV2, CKBFSDataType, BackLinkType, CKBFSCellOptions, PublishOptions, AppendOptions, CKBFS_HEADER, CKBFS_HEADER_STRING, NetworkType, ProtocolVersion, ProtocolVersionType, DEFAULT_NETWORK, DEFAULT_VERSION, CKBFS_CODE_HASH, CKBFS_TYPE_ID, ADLER32_CODE_HASH, ADLER32_TYPE_ID, DEP_GROUP_TX_HASH, DEPLOY_TX_HASH, getCKBFSScriptConfig, CKBFSScriptConfig, };