From bd7fde956c83bbcdcbad4039f598fbc1be6949fe Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Wed, 18 Sep 2024 19:03:22 -0400 Subject: [PATCH 1/4] chore: update stuff --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f3a83a..44ab3d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ 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.27](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.26...v0.0.1-alpha.27) (2024-09-18) + ### [0.0.1-alpha.26](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.25...v0.0.1-alpha.26) (2024-09-18) diff --git a/package-lock.json b/package-lock.json index 0118297..c1f0c0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.26", + "version": "0.0.1-alpha.27", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.26", + "version": "0.0.1-alpha.27", "license": "ISC", "dependencies": { "@dignetwork/datalayer-driver": "^0.1.24", diff --git a/package.json b/package.json index 1218fd1..f6c2439 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.26", + "version": "0.0.1-alpha.27", "description": "", "type": "commonjs", "main": "./dist/index.js", From c932f35afded660799176ab32e1e01e654563cef Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Wed, 18 Sep 2024 19:06:05 -0400 Subject: [PATCH 2/4] chore: update stuff --- package-lock.json | 31 ------------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index c1f0c0f..da29746 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "chia-wallet": "^1.0.18", "cli-progress": "^3.12.0", "crypto-js": "^4.2.0", - "datalayer-driver": "^0.1.21", "fs-extra": "^11.2.0", "ignore": "^5.3.2", "inquirer": "^10.1.8", @@ -1954,36 +1953,6 @@ "node": ">=8" } }, - "node_modules/datalayer-driver": { - "version": "0.1.21", - "resolved": "https://registry.npmjs.org/datalayer-driver/-/datalayer-driver-0.1.21.tgz", - "integrity": "sha512-KoPMcwhAF3WbrYs5xOmLsGBGzVbvkqJ0uVOU+tNLoMb9ApKeBiUHu/7uo7kEmpBNrEr3Tf0EAa+RNHG9tZaEPA==", - "engines": { - "node": ">= 10" - }, - "optionalDependencies": { - "datalayer-driver-darwin-arm64": "0.1.21", - "datalayer-driver-darwin-x64": "0.1.21", - "datalayer-driver-linux-arm64-gnu": "0.1.21", - "datalayer-driver-linux-x64-gnu": "0.1.21", - "datalayer-driver-win32-x64-msvc": "0.1.21" - } - }, - "node_modules/datalayer-driver-win32-x64-msvc": { - "version": "0.1.21", - "resolved": "https://registry.npmjs.org/datalayer-driver-win32-x64-msvc/-/datalayer-driver-win32-x64-msvc-0.1.21.tgz", - "integrity": "sha512-7j3MblPGdO7DIGqPVniELgdimsgB5FaQx9KNTgOHcbHpVlmRMkerrZKKG5lHkIO7IotAHIWvpu95J8Mv1bQhPw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, "node_modules/dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", diff --git a/package.json b/package.json index f6c2439..8811221 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "chia-wallet": "^1.0.18", "cli-progress": "^3.12.0", "crypto-js": "^4.2.0", - "datalayer-driver": "^0.1.21", + "datalayer-driver": "^0.1.24", "fs-extra": "^11.2.0", "ignore": "^5.3.2", "inquirer": "^10.1.8", From 91da6b6604fe3dd3342829673de80aea2f4b9847 Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Wed, 18 Sep 2024 19:18:27 -0400 Subject: [PATCH 3/4] feat: update datalayer-driver --- package.json | 1 - src/DigNetwork/DigPeer.ts | 26 ++++++++++++-------------- src/blockchain/DataStore.ts | 2 +- src/blockchain/DataStoreSerializer.ts | 2 +- src/blockchain/FullNodePeer.ts | 2 +- src/blockchain/ServerCoin.ts | 2 +- src/blockchain/Wallet.ts | 2 +- src/blockchain/coins.ts | 2 +- src/types.ts | 2 +- 9 files changed, 19 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 8811221..b8ab55a 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "chia-wallet": "^1.0.18", "cli-progress": "^3.12.0", "crypto-js": "^4.2.0", - "datalayer-driver": "^0.1.24", "fs-extra": "^11.2.0", "ignore": "^5.3.2", "inquirer": "^10.1.8", diff --git a/src/DigNetwork/DigPeer.ts b/src/DigNetwork/DigPeer.ts index a78072f..41e0953 100644 --- a/src/DigNetwork/DigPeer.ts +++ b/src/DigNetwork/DigPeer.ts @@ -5,13 +5,13 @@ import { PropagationServer } from "./PropagationServer"; import { IncentiveServer } from "./IncentiveServer"; import { DataStore } from "../blockchain"; import { DataIntegrityTree } from "../DataIntegrityTree"; -import { getFilePathFromSha256 } from "../utils/hashUtils"; import { sendXch, addressToPuzzleHash, signCoinSpends, getCoinId, -} from "datalayer-driver"; + Output, +} from "@dignetwork/datalayer-driver"; import { FullNodePeer } from "../blockchain"; import { Wallet } from "../blockchain"; import { selectUnspentCoins } from "../blockchain/coins"; @@ -196,7 +196,7 @@ export class DigPeer { walletName: string, addresses: string[], totalAmount: bigint, - memo: string[] + memos: Buffer[] ): Promise { // Use a Set to ensure unique addresses const uniqueAddresses = Array.from(new Set(addresses)); @@ -210,13 +210,11 @@ export class DigPeer { const amountPerPuzzleHash = totalAmount / BigInt(puzzleHashes.length); // Create outputs array - const outputs: { puzzleHash: Buffer; amount: bigint }[] = puzzleHashes.map( - (puzzleHash) => ({ - puzzleHash, - amount: amountPerPuzzleHash, - memo, - }) - ); + const outputs: Output[] = puzzleHashes.map((puzzleHash) => ({ + puzzleHash, + amount: amountPerPuzzleHash, + memos, + })); // Call the sendBulkPayments function with the generated outputs return DigPeer.sendBulkPayments(walletName, outputs); @@ -224,7 +222,7 @@ export class DigPeer { public static async sendBulkPayments( walletName: string, - outputs: { puzzleHash: Buffer; amount: bigint }[] + outputs: Output[] ): Promise { const feePerCondition = BigInt(1000); const totalFee = feePerCondition * BigInt(outputs.length); @@ -268,14 +266,14 @@ export class DigPeer { public async sendPayment( walletName: string, amount: bigint, - memo: string[] = [] + memos: Buffer[] = [] ): Promise { const paymentAddress = await this.contentServer.getPaymentAddress(); const paymentAddressPuzzleHash = addressToPuzzleHash(paymentAddress); - const output: { puzzleHash: Buffer; amount: bigint; memo: string[] } = { + const output: Output = { puzzleHash: paymentAddressPuzzleHash, amount, - memo, + memos, }; return DigPeer.sendBulkPayments(walletName, [output]); diff --git a/src/blockchain/DataStore.ts b/src/blockchain/DataStore.ts index 27831c2..aaac1c2 100644 --- a/src/blockchain/DataStore.ts +++ b/src/blockchain/DataStore.ts @@ -13,7 +13,7 @@ import { addFee, updateStoreMetadata, syntheticKeyToPuzzleHash, -} from "datalayer-driver"; +} from "@dignetwork/datalayer-driver"; import { promisify } from "util"; import { FullNodePeer } from "./FullNodePeer"; import { Wallet } from "./Wallet"; diff --git a/src/blockchain/DataStoreSerializer.ts b/src/blockchain/DataStoreSerializer.ts index 01892ec..a9e9038 100644 --- a/src/blockchain/DataStoreSerializer.ts +++ b/src/blockchain/DataStoreSerializer.ts @@ -4,7 +4,7 @@ import { Proof, DataStoreMetadata, DelegatedPuzzle, -} from "datalayer-driver"; +} from "@dignetwork/datalayer-driver"; import { Buffer } from "buffer"; export class DataStoreSerializer { diff --git a/src/blockchain/FullNodePeer.ts b/src/blockchain/FullNodePeer.ts index 8196b46..7010f17 100644 --- a/src/blockchain/FullNodePeer.ts +++ b/src/blockchain/FullNodePeer.ts @@ -1,7 +1,7 @@ import path from "path"; import os from "os"; import fs from "fs"; -import { Peer } from "datalayer-driver"; +import { Peer } from "@dignetwork/datalayer-driver"; import { Tls } from "chia-server-coin"; import { resolve4 } from "dns/promises"; import net from "net"; diff --git a/src/blockchain/ServerCoin.ts b/src/blockchain/ServerCoin.ts index 986b404..226fb50 100644 --- a/src/blockchain/ServerCoin.ts +++ b/src/blockchain/ServerCoin.ts @@ -7,7 +7,7 @@ import { signCoinSpends, ServerCoin as ServerCoinDriver, Coin, -} from "datalayer-driver"; +} from "@dignetwork/datalayer-driver"; import { FullNodePeer } from "./FullNodePeer"; import { selectUnspentCoins } from "./coins"; import { Wallet } from "./Wallet"; diff --git a/src/blockchain/Wallet.ts b/src/blockchain/Wallet.ts index 159901d..c9a9705 100644 --- a/src/blockchain/Wallet.ts +++ b/src/blockchain/Wallet.ts @@ -23,7 +23,7 @@ import { getCost, CoinSpend, getCoinId, -} from "datalayer-driver"; +} from "@dignetwork/datalayer-driver"; import { MIN_HEIGHT, MIN_HEIGHT_HEADER_HASH } from "../utils/config"; import { FileCache } from "../utils/FileCache"; diff --git a/src/blockchain/coins.ts b/src/blockchain/coins.ts index c53b5be..e5f0a19 100644 --- a/src/blockchain/coins.ts +++ b/src/blockchain/coins.ts @@ -5,7 +5,7 @@ import { getCost, CoinSpend, getCoinId, -} from "datalayer-driver"; +} from "@dignetwork/datalayer-driver"; import { Wallet } from "./Wallet"; import { MIN_HEIGHT, MIN_HEIGHT_HEADER_HASH } from "../utils/config"; import { FileCache } from "../utils/FileCache"; diff --git a/src/types.ts b/src/types.ts index cad27f1..933f4be 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { Coin } from "datalayer-driver"; +import { Coin } from "@dignetwork/datalayer-driver"; export interface FileDetails { filename: string; From 50019c05b42bd2dc14bf575163e92e533d55e035 Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Wed, 18 Sep 2024 19:18:50 -0400 Subject: [PATCH 4/4] chore(release): 0.0.1-alpha.28 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44ab3d1..ced26a1 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.28](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.26...v0.0.1-alpha.28) (2024-09-18) + + +### Features + +* update datalayer-driver ([91da6b6](https://github.com/DIG-Network/dig-chia-sdk/commit/91da6b6604fe3dd3342829673de80aea2f4b9847)) + ### [0.0.1-alpha.27](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.26...v0.0.1-alpha.27) (2024-09-18) ### [0.0.1-alpha.26](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.25...v0.0.1-alpha.26) (2024-09-18) diff --git a/package-lock.json b/package-lock.json index da29746..6fc044e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.27", + "version": "0.0.1-alpha.28", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.27", + "version": "0.0.1-alpha.28", "license": "ISC", "dependencies": { "@dignetwork/datalayer-driver": "^0.1.24", diff --git a/package.json b/package.json index b8ab55a..59eeff9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.27", + "version": "0.0.1-alpha.28", "description": "", "type": "commonjs", "main": "./dist/index.js",