diff --git a/README.md b/README.md index 1f7d749..9ada211 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ if (slots.error) { | SDK version | Codex version | Codex app | | ----------- | ------------- | --------- | | latest | master | latest | -| 0.0.21 | Testnet 0.2.0 | 0.0.14 | +| 0.0.22 | Testnet 0.2.0 | 0.0.14 | | 0.0.16 | Testnet 0.1.9 | 0.0.13 | ### Marketplace diff --git a/package-lock.json b/package-lock.json index 1c6b2b7..3f02cea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@codex-storage/sdk-js", - "version": "0.0.21", + "version": "0.0.22", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codex-storage/sdk-js", - "version": "0.0.21", + "version": "0.0.22", "license": "MIT", "dependencies": { "valibot": "^0.32.0" diff --git a/package.json b/package.json index d2d4bf9..82f9479 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codex-storage/sdk-js", - "version": "0.0.21", + "version": "0.0.22", "description": "Codex SDK to interact with the Codex decentralized storage network.", "repository": { "type": "git", diff --git a/src/marketplace/marketplace.test.ts b/src/marketplace/marketplace.test.ts index 6bdca40..a676404 100644 --- a/src/marketplace/marketplace.test.ts +++ b/src/marketplace/marketplace.test.ts @@ -247,9 +247,9 @@ describe("marketplace", () => { it("returns an error when trying to update an availability without id", async () => { const response = await marketplace.updateAvailability({ - maxCollateral: 1, + totalCollateral: 1, totalSize: 3000, - minPrice: 100, + minPricePerBytePerSecond: 100, duration: 100, } as any); @@ -260,9 +260,9 @@ describe("marketplace", () => { const response = await marketplace.updateAvailability({ id: randomString(64), totalSize: 0, - minPrice: 100, + minPricePerBytePerSecond: 100, duration: 100, - maxCollateral: 100, + totalCollateral: 100, }); assert.deepStrictEqual(response, minNumberValidationError("totalSize", 1)); @@ -273,8 +273,8 @@ describe("marketplace", () => { id: randomString(64), totalSize: 100, duration: 0, - minPrice: 100, - maxCollateral: 100, + minPricePerBytePerSecond: 100, + totalCollateral: 100, }); assert.deepStrictEqual(response, minNumberValidationError("duration", 1)); @@ -291,8 +291,8 @@ describe("marketplace", () => { id: randomString(64), totalSize: 3000, duration: 10, - minPrice: 100, - maxCollateral: 100, + minPricePerBytePerSecond: 100, + totalCollateral: 100, }); assert.ok(!response.error); diff --git a/src/marketplace/marketplace.ts b/src/marketplace/marketplace.ts index f349dab..7372bcc 100644 --- a/src/marketplace/marketplace.ts +++ b/src/marketplace/marketplace.ts @@ -133,8 +133,8 @@ export class CodexMarketplace { body: JSON.stringify({ totalSize: body.totalSize.toString(), duration: body.duration.toString(), - minPrice: body.minPrice.toString(), - maxCollateral: body.maxCollateral.toString(), + minPricePerBytePerSecond: body.minPricePerBytePerSecond.toString(), + totalCollateral: body.totalCollateral.toString(), }), }); diff --git a/src/marketplace/types.ts b/src/marketplace/types.ts index 7847f38..e5e2e78 100644 --- a/src/marketplace/types.ts +++ b/src/marketplace/types.ts @@ -187,8 +187,8 @@ export const CodexUpdateAvailabilityInput = v.strictObject({ id: v.string(), totalSize: v.pipe(v.number(), v.minValue(1)), duration: v.pipe(v.number(), v.minValue(1)), - minPrice: v.number(), - maxCollateral: v.number(), + minPricePerBytePerSecond: v.number(), + totalCollateral: v.number(), }); export type CodexUpdateAvailabilityInput = v.InferOutput<