mirror of
https://github.com/logos-storage/logos-storage-js.git
synced 2026-01-07 16:03:06 +00:00
Fix api
This commit is contained in:
parent
46aff9eff3
commit
621a4e4660
@ -88,7 +88,7 @@ if (slots.error) {
|
|||||||
| SDK version | Codex version | Codex app |
|
| SDK version | Codex version | Codex app |
|
||||||
| ----------- | ------------- | --------- |
|
| ----------- | ------------- | --------- |
|
||||||
| latest | master | latest |
|
| latest | master | latest |
|
||||||
| 0.0.20 | Testnet 0.2.0 | 0.0.14 |
|
| 0.0.21 | Testnet 0.2.0 | 0.0.14 |
|
||||||
| 0.0.16 | Testnet 0.1.9 | 0.0.13 |
|
| 0.0.16 | Testnet 0.1.9 | 0.0.13 |
|
||||||
|
|
||||||
### Marketplace
|
### Marketplace
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@codex-storage/sdk-js",
|
"name": "@codex-storage/sdk-js",
|
||||||
"version": "0.0.20",
|
"version": "0.0.21",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@codex-storage/sdk-js",
|
"name": "@codex-storage/sdk-js",
|
||||||
"version": "0.0.20",
|
"version": "0.0.21",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"valibot": "^0.32.0"
|
"valibot": "^0.32.0"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@codex-storage/sdk-js",
|
"name": "@codex-storage/sdk-js",
|
||||||
"version": "0.0.20",
|
"version": "0.0.21",
|
||||||
"description": "Codex SDK to interact with the Codex decentralized storage network.",
|
"description": "Codex SDK to interact with the Codex decentralized storage network.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@ -145,8 +145,8 @@ describe("marketplace", () => {
|
|||||||
it("returns an error when trying to create an availability with zero total size", async () => {
|
it("returns an error when trying to create an availability with zero total size", async () => {
|
||||||
const response = await marketplace.createAvailability({
|
const response = await marketplace.createAvailability({
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
maxCollateral: 1,
|
totalCollateral: 1,
|
||||||
minPrice: 100,
|
minPricePerBytePerSecond: 100,
|
||||||
totalSize: 0,
|
totalSize: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -166,8 +166,8 @@ describe("marketplace", () => {
|
|||||||
it("returns an error when trying to create an availability with zero duration", async () => {
|
it("returns an error when trying to create an availability with zero duration", async () => {
|
||||||
const response = await marketplace.createAvailability({
|
const response = await marketplace.createAvailability({
|
||||||
duration: 0,
|
duration: 0,
|
||||||
maxCollateral: 1,
|
totalCollateral: 1,
|
||||||
minPrice: 100,
|
minPricePerBytePerSecond: 100,
|
||||||
totalSize: 3000,
|
totalSize: 3000,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -216,9 +216,9 @@ describe("marketplace", () => {
|
|||||||
spy.mockImplementationOnce(() => Promise.resolve({ error: false, data }));
|
spy.mockImplementationOnce(() => Promise.resolve({ error: false, data }));
|
||||||
|
|
||||||
const response = await marketplace.createAvailability({
|
const response = await marketplace.createAvailability({
|
||||||
maxCollateral: 1,
|
totalCollateral: 1,
|
||||||
totalSize: 3000,
|
totalSize: 3000,
|
||||||
minPrice: 100,
|
minPricePerBytePerSecond: 100,
|
||||||
duration: 100,
|
duration: 100,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -234,9 +234,9 @@ describe("marketplace", () => {
|
|||||||
spy.mockImplementationOnce(() => Promise.resolve({ error: false, data }));
|
spy.mockImplementationOnce(() => Promise.resolve({ error: false, data }));
|
||||||
|
|
||||||
const response = await marketplace.createAvailability({
|
const response = await marketplace.createAvailability({
|
||||||
maxCollateral: 1,
|
totalCollateral: 1,
|
||||||
totalSize: 3000,
|
totalSize: 3000,
|
||||||
minPrice: 100,
|
minPricePerBytePerSecond: 100,
|
||||||
duration: 100,
|
duration: 100,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -99,8 +99,8 @@ export class CodexMarketplace {
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
totalSize: body.totalSize.toString(),
|
totalSize: body.totalSize.toString(),
|
||||||
duration: body.duration.toString(),
|
duration: body.duration.toString(),
|
||||||
minPrice: body.minPrice.toString(),
|
minPricePerBytePerSecond: body.minPricePerBytePerSecond.toString(),
|
||||||
maxCollateral: body.maxCollateral.toString(),
|
totalCollateral: body.totalCollateral.toString(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -175,8 +175,8 @@ export type CodexAvailabilityCreateResponse = CodexAvailability & {
|
|||||||
export const CodexCreateAvailabilityInput = v.strictObject({
|
export const CodexCreateAvailabilityInput = v.strictObject({
|
||||||
totalSize: v.pipe(v.number(), v.minValue(1)),
|
totalSize: v.pipe(v.number(), v.minValue(1)),
|
||||||
duration: v.pipe(v.number(), v.minValue(1)),
|
duration: v.pipe(v.number(), v.minValue(1)),
|
||||||
minPrice: v.number(),
|
minPricePerBytePerSecond: v.number(),
|
||||||
maxCollateral: v.number(),
|
totalCollateral: v.number(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type CodexCreateAvailabilityInput = v.InferOutput<
|
export type CodexCreateAvailabilityInput = v.InferOutput<
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user