@ckbfs/api 1.2.5 → 1.2.6
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.
- package/examples/publish.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -1
package/examples/publish.ts
CHANGED
@@ -6,7 +6,7 @@ const privateKey = process.env.CKB_PRIVATE_KEY || 'your-private-key-here';
|
|
6
6
|
// Initialize the SDK with network and version options
|
7
7
|
const ckbfs = new CKBFS(
|
8
8
|
privateKey,
|
9
|
-
NetworkType.
|
9
|
+
NetworkType.Mainnet, // Use testnet
|
10
10
|
{
|
11
11
|
version: ProtocolVersion.V2, // Use the latest version (V2)
|
12
12
|
chunkSize: 30 * 1024, // 30KB chunks
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
Transaction,
|
5
5
|
ClientPublicTestnet,
|
6
6
|
SignerCkbPrivateKey,
|
7
|
+
ClientPublicMainnet,
|
7
8
|
} from "@ckb-ccc/core";
|
8
9
|
import {
|
9
10
|
calculateChecksum,
|
@@ -156,7 +157,10 @@ export class CKBFS {
|
|
156
157
|
options ||
|
157
158
|
(typeof networkOrOptions === "object" ? networkOrOptions : {});
|
158
159
|
|
159
|
-
const client =
|
160
|
+
const client =
|
161
|
+
network === "mainnet"
|
162
|
+
? new ClientPublicMainnet()
|
163
|
+
: new ClientPublicTestnet();
|
160
164
|
this.signer = new SignerCkbPrivateKey(client, privateKey);
|
161
165
|
this.network = network;
|
162
166
|
this.chunkSize = opts.chunkSize || 30 * 1024;
|