diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e2ede..14c82b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.0.1-alpha.19](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.18...v0.0.1-alpha.19) (2024-09-16) + + +### Features + +* query if the content server has a roothash ([24ba222](https://github.com/DIG-Network/dig-chia-sdk/commit/24ba2227b59e55d874b618fe074d71a61bb63b47)) + ### [0.0.1-alpha.18](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.17...v0.0.1-alpha.18) (2024-09-16) diff --git a/package-lock.json b/package-lock.json index 2de2bec..343056b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.18", + "version": "0.0.1-alpha.19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.18", + "version": "0.0.1-alpha.19", "license": "ISC", "dependencies": { "bip39": "^3.1.0", diff --git a/package.json b/package.json index 08bb0f2..8e1f47a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.18", + "version": "0.0.1-alpha.19", "description": "", "type": "commonjs", "main": "./dist/index.js", diff --git a/src/DigNetwork/ContentServer.ts b/src/DigNetwork/ContentServer.ts index 0970a66..3182b51 100644 --- a/src/DigNetwork/ContentServer.ts +++ b/src/DigNetwork/ContentServer.ts @@ -83,12 +83,16 @@ export class ContentServer { } // Method to check if a specific store exists (HEAD request) - public async headStore(): Promise<{ + public async headStore(options?: { hasRootHash: boolean}): Promise<{ success: boolean; headers?: http.IncomingHttpHeaders; }> { - const url = `https://${this.ipAddress}/${this.storeId}`; - console.log({ url }); + let url = `https://${this.ipAddress}/${this.storeId}`; + + if (options?.hasRootHash) { + url += `hasRootHash=${options.hasRootHash}`; + } + return this.head(url); // Return the object from head method } diff --git a/src/blockchain/DataStore.ts b/src/blockchain/DataStore.ts index 87a01c3..ce0af0b 100644 --- a/src/blockchain/DataStore.ts +++ b/src/blockchain/DataStore.ts @@ -36,7 +36,6 @@ import { CreateStoreUserInputs } from "../types"; import { askForStoreDetails } from "../prompts"; import { FileCache } from "../utils/FileCache"; import { DataStoreSerializer } from "./DataStoreSerializer"; -import { h } from "chia-bls"; const stat = promisify(fs.stat); const readdir = promisify(fs.readdir);