diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d8ac73..1c9de46 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.88](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.87...v0.0.1-alpha.88) (2024-09-25) + + +### Bug Fixes + +* get stores list ([f941085](https://github.com/DIG-Network/dig-chia-sdk/commit/f94108521dcacb59252a59ca4455cc0f6ebf7501)) + ### [0.0.1-alpha.87](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.86...v0.0.1-alpha.87) (2024-09-25) diff --git a/package-lock.json b/package-lock.json index 453a131..33e4ef4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.87", + "version": "0.0.1-alpha.88", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.87", + "version": "0.0.1-alpha.88", "license": "ISC", "dependencies": { "@dignetwork/datalayer-driver": "^0.1.25", diff --git a/package.json b/package.json index c0a8925..f4bebd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.87", + "version": "0.0.1-alpha.88", "description": "", "type": "commonjs", "main": "./dist/index.js", diff --git a/src/utils/config.ts b/src/utils/config.ts index 925c745..42b6763 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -95,11 +95,17 @@ export const getCoinState = ( }; /** - * Retrieves a list of valid store folders (64-character hexadecimal names) in the DIG folder. - * - * @returns {string[]} An array of valid folder names. + * Retrieves the list of valid store folders. + * If the STORE_PATH directory does not exist, it is created. + * + * @returns {string[]} An array of valid store folder names. */ export const getStoresList = (): string[] => { + // Check if the STORE_PATH exists, create it if not + if (!fs.existsSync(STORE_PATH)) { + fs.mkdirSync(STORE_PATH, { recursive: true }); + } + const folders = fs.readdirSync(STORE_PATH); return folders.filter( (folder) =>