cloreai 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +42 -43
  2. package/build/CloreAI.d.ts +13 -13
  3. package/build/CloreAI.js +8 -8
  4. package/build/Gigaspot.d.ts +7 -7
  5. package/build/Gigaspot.js +4 -4
  6. package/build/constants.d.ts +14 -0
  7. package/build/constants.js +14 -0
  8. package/build/getQueueOptions.d.ts +5 -0
  9. package/build/{helpers.js → getQueueOptions.js} +0 -14
  10. package/build/index.d.ts +15 -15
  11. package/build/{endpoints → resources}/marketplace.d.ts +1 -1
  12. package/build/{endpoints → resources}/myOrders.d.ts +3 -3
  13. package/build/types.d.ts +10 -11
  14. package/package.json +8 -9
  15. package/build/helpers.d.ts +0 -19
  16. package/build/{endpoints → resources}/cancelOrder.d.ts +0 -0
  17. package/build/{endpoints → resources}/cancelOrder.js +0 -0
  18. package/build/{endpoints → resources}/cancelOrders.d.ts +0 -0
  19. package/build/{endpoints → resources}/cancelOrders.js +0 -0
  20. package/build/{endpoints → resources}/createGigaspotOrders.d.ts +2 -2
  21. package/build/{endpoints → resources}/createGigaspotOrders.js +0 -0
  22. package/build/{endpoints → resources}/createOrder.d.ts +0 -0
  23. package/build/{endpoints → resources}/createOrder.js +0 -0
  24. package/build/{endpoints → resources}/editGigaspotOrders.d.ts +2 -2
  25. /package/build/{endpoints → resources}/editGigaspotOrders.js +0 -0
  26. /package/build/{endpoints → resources}/getGigaspot.d.ts +0 -0
  27. /package/build/{endpoints → resources}/getGigaspot.js +0 -0
  28. /package/build/{endpoints → resources}/marketplace.js +0 -0
  29. /package/build/{endpoints → resources}/myOrders.js +0 -0
  30. /package/build/{endpoints → resources}/myServers.d.ts +0 -0
  31. /package/build/{endpoints → resources}/myServers.js +0 -0
  32. /package/build/{endpoints → resources}/pohBalance.d.ts +0 -0
  33. /package/build/{endpoints → resources}/pohBalance.js +0 -0
  34. /package/build/{endpoints → resources}/serverConfig.d.ts +0 -0
  35. /package/build/{endpoints → resources}/serverConfig.js +0 -0
  36. /package/build/{endpoints → resources}/setServerSettings.d.ts +0 -0
  37. /package/build/{endpoints → resources}/setServerSettings.js +0 -0
  38. /package/build/{endpoints → resources}/setSpotPrice.d.ts +0 -0
  39. /package/build/{endpoints → resources}/setSpotPrice.js +0 -0
  40. /package/build/{endpoints → resources}/spotMarketplace.d.ts +0 -0
  41. /package/build/{endpoints → resources}/spotMarketplace.js +0 -0
  42. /package/build/{endpoints → resources}/wallets.d.ts +0 -0
  43. /package/build/{endpoints → resources}/wallets.js +0 -0
package/README.md CHANGED
@@ -2,37 +2,37 @@
2
2
 
3
3
  > CLORE.AI API client
4
4
 
5
- Особенности:
5
+ Features:
6
6
 
7
- - Базируется на [axios](https://github.com/axios/axios)
8
- - Защищает от превышения rate limit (ошибки 429) через
7
+ - Based on [axios](https://github.com/axios/axios)
8
+ - Protects from rate limit exceeded (429 errors) via
9
9
  [p-queue](https://github.com/sindresorhus/p-queue)
10
- - Поддерживает GigaSPOT
10
+ - Error handling via try...catch and instanceof
11
+ - Supports GigaSPOT
11
12
 
12
- Официальная документация: [clore.ai/api-docs](https://clore.ai/api-docs)
13
+ Official documentation: [clore.ai/api-docs](https://clore.ai/api-docs)
13
14
 
14
- Официальная документация GigaSPOT:
15
+ Official GigaSPOT documentation:
15
16
  [gigaspot-api-docs.clore.ai](https://gigaspot-api-docs.clore.ai)
16
17
 
17
- ## Установка
18
+ ## Installation
18
19
 
19
20
  ```shell
20
21
  npm install cloreai
21
22
  ```
22
23
 
23
- ## Использование
24
+ ## Usage
24
25
 
25
- ### Создание экземпляра
26
+ ### Creating an instance
26
27
 
27
28
  ```typescript
28
29
  import CloreAI from 'cloreai'
29
30
 
30
- const cloreai = new CloreAI({
31
- apiKey: '<API_KEY>', // (required)
31
+ const cloreai = new CloreAI('<API_KEY>', {
32
32
  axiosOptions: {}, // (optional) Axios instance options https://github.com/axios/axios
33
33
  queueOptions: {}, // (optional) Queue instance options https://github.com/sindresorhus/p-queue
34
34
  queueOptionsCreateOrder: {}, // (optional) Create order queue instance options https://github.com/sindresorhus/p-queue
35
- queueOptionsGigaspot: {}, // (optional) Gigaspot queue instance options https://github.com/sindresorhus/p-queue
35
+ queueOptionsGigaspot: {}, // (optional) Gigaspot queue instance options https://github.com/sindresorhus/p-queue
36
36
  })
37
37
  ```
38
38
 
@@ -184,10 +184,10 @@ await cloreai.gigaspot.cancelOrders({
184
184
  })
185
185
  ```
186
186
 
187
- ### Конфигурация запросов
187
+ ### Request Configuration
188
188
 
189
- Каждый метод принимает опциональную конфигурацию запроса для axios последним
190
- параметром, например:
189
+ All methods accept an optional request configuration for axios as the last
190
+ parameter, for example:
191
191
 
192
192
  ```typescript
193
193
  const marketplace = await cloreai.marketplace({
@@ -195,25 +195,25 @@ const marketplace = await cloreai.marketplace({
195
195
  })
196
196
  ```
197
197
 
198
- ### Доступ к экземпляру axios
198
+ ### Access to axios instance
199
199
 
200
- Используйте поле `cloreai.axios`.
200
+ Use the field `cloreai.axios`.
201
201
 
202
- Обратитесь к документации [axios](https://github.com/axios/axios).
202
+ Refer to the documentation [axios](https://github.com/axios/axios).
203
203
 
204
- ### Доступ к экземплярам p-queue
204
+ ### Access to p-queue instances
205
205
 
206
- Используйте поля:
206
+ Use the fields:
207
207
 
208
- - `cloreai.queue` - для основной очереди запросов
209
- - `cloreai.queueCreateOrder` - для очереди запросов createOrder
210
- - `cloreai.gigaspot.queue` - для очереди запросов gigaspot
208
+ - `cloreai.queue` - for main request queue
209
+ - `cloreai.queueCreateOrder` - for createOrder request queue
210
+ - `cloreai.gigaspot.queue` - for gigaspot request queue
211
211
 
212
- Обратитесь к документации [p-queue](https://github.com/sindresorhus/p-queue).
212
+ Refer to the documentation [p-queue](https://github.com/sindresorhus/p-queue).
213
213
 
214
- ### Обработка ошибок
214
+ ### Error Handling
215
215
 
216
- Библиотека экспортирует следующие виды ошибок:
216
+ The library exports the following error types:
217
217
 
218
218
  - `DatabaseError`
219
219
  - `InvalidInputDataError`
@@ -223,9 +223,9 @@ const marketplace = await cloreai.marketplace({
223
223
  - `OtherError`
224
224
  - `UnknownError`
225
225
 
226
- Все эти ошибки наследуются от `AxiosError`.
226
+ All these errors inherit from `AxiosError`.
227
227
 
228
- Проверяйте тип ошибки через оператор `instanceof`:
228
+ Check the error type via the `instanceof` operator:
229
229
 
230
230
  ```typescript
231
231
  import { AxiosError } from 'axios'
@@ -236,23 +236,23 @@ try {
236
236
  } catch (error) {
237
237
  if (error instanceof AxiosError) {
238
238
  console.log('AxiosError')
239
+ }
239
240
 
240
- if (error instanceof ExceededError) {
241
- console.log('ExceededError')
242
- }
243
- } else {
244
- throw error
241
+ if (error instanceof ExceededError) {
242
+ console.log('ExceededError')
245
243
  }
244
+
245
+ throw error
246
246
  }
247
247
  ```
248
248
 
249
249
  ### Rate limit
250
250
 
251
- Все методы защищены от превышения rate limit через
252
- [p-queue](https://github.com/sindresorhus/p-queue), они автоматически
253
- задерживаются на нужное время, чтобы избежать превышения лимита.
251
+ All methods are protected from rate limit exceeded via
252
+ [p-queue](https://github.com/sindresorhus/p-queue), they automatically pause for
253
+ the required time to avoid exceeding the limit.
254
254
 
255
- Значения rate limit по умолчанию доступны как константы:
255
+ Default rate limit values are available as constants:
256
256
 
257
257
  ```typescript
258
258
  import {
@@ -266,21 +266,20 @@ console.log(RATE_LIMIT_CREATE_ORDER)
266
266
  console.log(RATE_LIMIT_GIGASPOT)
267
267
  ```
268
268
 
269
- Можно задать собственные значение rate limit для каждой очереди запросов:
269
+ You can set your own rate limit values for each request queue:
270
270
 
271
271
  ```typescript
272
272
  import CloreAI from 'cloreai'
273
273
 
274
- const cloreai = new CloreAI({
275
- apiKey: '<API_KEY>',
274
+ const cloreai = new CloreAI('<API_KEY>', {
276
275
  queueOptions: {
277
- interval: 10000, // 10 seconds
276
+ interval: 2000, // For example 2 seconds
278
277
  },
279
278
  queueOptionsCreateOrder: {
280
- interval: 10000, // 10 seconds
279
+ interval: 6000, // For example 6 seconds
281
280
  },
282
281
  queueOptionsGigaspot: {
283
- interval: 10000, // 10 seconds
282
+ interval: 2000, // For example 2 seconds
284
283
  },
285
284
  })
286
285
  ```
@@ -1,24 +1,24 @@
1
1
  import { type AxiosInstance, type AxiosRequestConfig } from 'axios';
2
2
  import PQueue from 'p-queue';
3
- import type { CancelOrderRequestData, CancelOrderResponseData } from './endpoints/cancelOrder.js';
4
- import type { CreateOrderRequestData, CreateOrderResponseData } from './endpoints/createOrder.js';
5
- import type { MarketplaceResponseData } from './endpoints/marketplace.js';
6
- import type { MyOrdersRequestParams, MyOrdersResponseData } from './endpoints/myOrders.js';
7
- import type { MyServersResponseData } from './endpoints/myServers.js';
8
- import type { PohBalanceResponseData } from './endpoints/pohBalance.js';
9
- import type { ServerConfigRequestData, ServerConfigResponseData } from './endpoints/serverConfig.js';
10
- import type { SetServerSettingsRequestData, SetServerSettingsResponseData } from './endpoints/setServerSettings.js';
11
- import type { SetSpotPriceRequestData, SetSpotPriceResponseData } from './endpoints/setSpotPrice.js';
12
- import type { SpotMarketplaceRequestParams, SpotMarketplaceResponseData } from './endpoints/spotMarketplace.js';
13
- import type { WalletsResponseData } from './endpoints/wallets.js';
14
- import type { Config } from './types.js';
3
+ import type { CancelOrderRequestData, CancelOrderResponseData } from './resources/cancelOrder.js';
4
+ import type { CreateOrderRequestData, CreateOrderResponseData } from './resources/createOrder.js';
5
+ import type { MarketplaceResponseData } from './resources/marketplace.js';
6
+ import type { MyOrdersRequestParams, MyOrdersResponseData } from './resources/myOrders.js';
7
+ import type { MyServersResponseData } from './resources/myServers.js';
8
+ import type { PohBalanceResponseData } from './resources/pohBalance.js';
9
+ import type { ServerConfigRequestData, ServerConfigResponseData } from './resources/serverConfig.js';
10
+ import type { SetServerSettingsRequestData, SetServerSettingsResponseData } from './resources/setServerSettings.js';
11
+ import type { SetSpotPriceRequestData, SetSpotPriceResponseData } from './resources/setSpotPrice.js';
12
+ import type { SpotMarketplaceRequestParams, SpotMarketplaceResponseData } from './resources/spotMarketplace.js';
13
+ import type { WalletsResponseData } from './resources/wallets.js';
14
+ import type { Options } from './types.js';
15
15
  import Gigaspot from './Gigaspot.js';
16
16
  declare class CloreAI {
17
17
  axios: AxiosInstance;
18
18
  queue: PQueue;
19
19
  queueCreateOrder: PQueue;
20
20
  gigaspot: Gigaspot;
21
- constructor(config: Config);
21
+ constructor(apiKey: string, options?: Options);
22
22
  wallets(config?: AxiosRequestConfig): Promise<WalletsResponseData>;
23
23
  myServers(config?: AxiosRequestConfig): Promise<MyServersResponseData>;
24
24
  serverConfig(data: ServerConfigRequestData, config?: AxiosRequestConfig): Promise<ServerConfigResponseData>;
package/build/CloreAI.js CHANGED
@@ -1,33 +1,33 @@
1
1
  import axios from 'axios';
2
2
  import PQueue from 'p-queue';
3
- import { RATE_LIMIT, RATE_LIMIT_CREATE_ORDER } from './constants.js';
3
+ import { priorityLevels, RATE_LIMIT, RATE_LIMIT_CREATE_ORDER, statusCodes } from './constants.js';
4
4
  import { DatabaseError, ExceededError, InvalidApiTokenError, InvalidEndpointError, InvalidInputDataError, OtherError, UnknownError } from './errors.js';
5
+ import { getQueueOptions } from './getQueueOptions.js';
5
6
  import Gigaspot from './Gigaspot.js';
6
- import { getQueueOptions, priorityLevels, statusCodes } from './helpers.js';
7
7
  class CloreAI {
8
8
  axios;
9
9
  queue;
10
10
  queueCreateOrder;
11
11
  gigaspot;
12
- constructor(config) {
12
+ constructor(apiKey, options = {}) {
13
13
  this.queue = new PQueue({
14
14
  interval: RATE_LIMIT,
15
15
  intervalCap: 1,
16
16
  concurrency: 1,
17
- ...config.queueOptions,
17
+ ...options.queueOptions,
18
18
  });
19
19
  this.queueCreateOrder = new PQueue({
20
20
  interval: RATE_LIMIT_CREATE_ORDER,
21
21
  intervalCap: 1,
22
22
  concurrency: 1,
23
- ...config.queueOptionsCreateOrder,
23
+ ...options.queueOptionsCreateOrder,
24
24
  });
25
25
  this.axios = axios.create({
26
- ...config.axiosOptions,
26
+ ...options.axiosOptions,
27
27
  baseURL: 'https://api.clore.ai/v1',
28
28
  });
29
29
  this.axios.interceptors.request.use((request) => {
30
- request.headers.set('auth', config.apiKey);
30
+ request.headers.set('auth', apiKey);
31
31
  return request;
32
32
  });
33
33
  this.axios.interceptors.response.use((response) => {
@@ -61,7 +61,7 @@ class CloreAI {
61
61
  throw new UnknownError(...axiosErrorParameters);
62
62
  }
63
63
  });
64
- this.gigaspot = new Gigaspot(config, this.axios);
64
+ this.gigaspot = new Gigaspot(options, this.axios);
65
65
  }
66
66
  async wallets(config) {
67
67
  const response = await this.queue.add(async () => {
@@ -1,14 +1,14 @@
1
1
  import { type AxiosInstance, type AxiosRequestConfig } from 'axios';
2
2
  import PQueue from 'p-queue';
3
- import type { CancelOrdersRequestData, CancelOrdersResponseData } from './endpoints/cancelOrders.js';
4
- import type { CreateGigaspotOrdersRequestData, CreateGigaspotOrdersResponseData } from './endpoints/createGigaspotOrders.js';
5
- import type { EditGigaspotOrdersRequestData, EditGigaspotOrdersResponseData } from './endpoints/editGigaspotOrders.js';
6
- import type { GetGigaspotResponseData } from './endpoints/getGigaspot.js';
7
- import type { Config } from './types.js';
3
+ import type { CancelOrdersRequestData, CancelOrdersResponseData } from './resources/cancelOrders.js';
4
+ import type { CreateGigaspotOrdersRequestData, CreateGigaspotOrdersResponseData } from './resources/createGigaspotOrders.js';
5
+ import type { EditGigaspotOrdersRequestData, EditGigaspotOrdersResponseData } from './resources/editGigaspotOrders.js';
6
+ import type { GetGigaspotResponseData } from './resources/getGigaspot.js';
7
+ import type { Options } from './types.js';
8
8
  declare class Gigaspot {
9
9
  queue: PQueue;
10
- private readonly axios;
11
- constructor(config: Config, axios: AxiosInstance);
10
+ private axios;
11
+ constructor(options: Options, axios: AxiosInstance);
12
12
  getGigaspot(config?: AxiosRequestConfig): Promise<GetGigaspotResponseData>;
13
13
  createGigaspotOrders(data: CreateGigaspotOrdersRequestData, config?: AxiosRequestConfig): Promise<CreateGigaspotOrdersResponseData>;
14
14
  editGigaspotOrders(data: EditGigaspotOrdersRequestData, config?: AxiosRequestConfig): Promise<EditGigaspotOrdersResponseData>;
package/build/Gigaspot.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import axios from 'axios';
2
2
  import PQueue from 'p-queue';
3
- import { RATE_LIMIT_GIGASPOT } from './constants.js';
4
- import { getQueueOptions, priorityLevels } from './helpers.js';
3
+ import { priorityLevels, RATE_LIMIT_GIGASPOT } from './constants.js';
4
+ import { getQueueOptions } from './getQueueOptions.js';
5
5
  class Gigaspot {
6
6
  queue;
7
7
  axios;
8
- constructor(config, axios) {
8
+ constructor(options, axios) {
9
9
  this.queue = new PQueue({
10
10
  interval: RATE_LIMIT_GIGASPOT,
11
11
  intervalCap: 1,
12
12
  concurrency: 1,
13
- ...config.queueOptionsGigaspot,
13
+ ...options.queueOptionsGigaspot,
14
14
  });
15
15
  this.axios = axios;
16
16
  }
@@ -5,3 +5,17 @@ export declare const gigaspotBaseImages: {
5
5
  UBUNTU: string;
6
6
  HIVEOS: string;
7
7
  };
8
+ export declare const statusCodes: {
9
+ NORMAL: number;
10
+ DATABASE_ERROR: number;
11
+ INVALID_INPUT_DATA: number;
12
+ INVALID_API_TOKEN: number;
13
+ INVALID_ENDPOINT: number;
14
+ EXCEEDED: number;
15
+ OTHER: number;
16
+ };
17
+ export declare const priorityLevels: {
18
+ NORMAL: number;
19
+ HIGH: number;
20
+ HIGHEST: number;
21
+ };
@@ -5,3 +5,17 @@ export const gigaspotBaseImages = {
5
5
  UBUNTU: 'a3f9c4d7e5b088d8a0bff880',
6
6
  HIVEOS: 'c9a4e2f6b7d488d8f0bab0ff',
7
7
  };
8
+ export const statusCodes = {
9
+ NORMAL: 0,
10
+ DATABASE_ERROR: 1,
11
+ INVALID_INPUT_DATA: 2,
12
+ INVALID_API_TOKEN: 3,
13
+ INVALID_ENDPOINT: 4,
14
+ EXCEEDED: 5,
15
+ OTHER: 6,
16
+ };
17
+ export const priorityLevels = {
18
+ NORMAL: 0,
19
+ HIGH: 1,
20
+ HIGHEST: 2,
21
+ };
@@ -0,0 +1,5 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ import type { QueueAddOptions } from 'p-queue';
3
+ export declare function getQueueOptions(priority: number, config?: AxiosRequestConfig): QueueAddOptions & {
4
+ throwOnTimeout: true;
5
+ };
@@ -1,17 +1,3 @@
1
- export const statusCodes = {
2
- NORMAL: 0,
3
- DATABASE_ERROR: 1,
4
- INVALID_INPUT_DATA: 2,
5
- INVALID_API_TOKEN: 3,
6
- INVALID_ENDPOINT: 4,
7
- EXCEEDED: 5,
8
- OTHER: 6,
9
- };
10
- export const priorityLevels = {
11
- NORMAL: 0,
12
- HIGH: 1,
13
- HIGHEST: 2,
14
- };
15
1
  export function getQueueOptions(priority, config) {
16
2
  const defaultQueueOptions = {
17
3
  throwOnTimeout: true,
package/build/index.d.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  import CloreAI from './CloreAI.js';
2
2
  export * from './constants.js';
3
- export type * from './endpoints/cancelOrder.js';
4
- export type * from './endpoints/cancelOrders.js';
5
- export type * from './endpoints/createGigaspotOrders.js';
6
- export type * from './endpoints/createOrder.js';
7
- export type * from './endpoints/editGigaspotOrders.js';
8
- export type * from './endpoints/getGigaspot.js';
9
- export type * from './endpoints/marketplace.js';
10
- export type * from './endpoints/myOrders.js';
11
- export type * from './endpoints/myServers.js';
12
- export type * from './endpoints/pohBalance.js';
13
- export type * from './endpoints/serverConfig.js';
14
- export type * from './endpoints/setServerSettings.js';
15
- export type * from './endpoints/setSpotPrice.js';
16
- export type * from './endpoints/spotMarketplace.js';
17
- export type * from './endpoints/wallets.js';
18
3
  export * from './errors.js';
4
+ export type * from './resources/cancelOrder.js';
5
+ export type * from './resources/cancelOrders.js';
6
+ export type * from './resources/createGigaspotOrders.js';
7
+ export type * from './resources/createOrder.js';
8
+ export type * from './resources/editGigaspotOrders.js';
9
+ export type * from './resources/getGigaspot.js';
10
+ export type * from './resources/marketplace.js';
11
+ export type * from './resources/myOrders.js';
12
+ export type * from './resources/myServers.js';
13
+ export type * from './resources/pohBalance.js';
14
+ export type * from './resources/serverConfig.js';
15
+ export type * from './resources/setServerSettings.js';
16
+ export type * from './resources/setSpotPrice.js';
17
+ export type * from './resources/spotMarketplace.js';
18
+ export type * from './resources/wallets.js';
19
19
  export type * from './types.js';
20
20
  export default CloreAI;
@@ -11,7 +11,7 @@ export interface MarketplaceResponseDataServer {
11
11
  allowed_coins: Currency[];
12
12
  rating: Rating;
13
13
  gpu_array: string[];
14
- gigaspot: boolean;
14
+ gigaspot?: boolean;
15
15
  oc?: boolean;
16
16
  cuda_version: string;
17
17
  }
@@ -26,10 +26,10 @@ export interface MyOrdersResponseDataOrder {
26
26
  rating: Rating;
27
27
  reliability: number;
28
28
  owner: number;
29
- cuda_version: number;
29
+ cuda_version: string;
30
30
  gpu_array: string[];
31
- spot: boolean;
32
- expired: boolean;
31
+ spot?: boolean;
32
+ expired?: boolean;
33
33
  }
34
34
  export interface MyOrdersResponseData extends ResponseData {
35
35
  orders: MyOrdersResponseDataOrder[];
package/build/types.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  import type { CreateAxiosDefaults } from 'axios';
2
- import type { Options, Queue, QueueAddOptions } from 'p-queue';
3
- export type PQueueOptions = Options<Queue<() => Promise<unknown>, QueueAddOptions>, QueueAddOptions>;
4
- export interface Config {
5
- apiKey: string;
2
+ import type { Options as PQueueOptions, Queue, QueueAddOptions } from 'p-queue';
3
+ export type QueueOptions = PQueueOptions<Queue<() => Promise<unknown>, QueueAddOptions>, QueueAddOptions>;
4
+ export interface Options {
6
5
  axiosOptions?: CreateAxiosDefaults;
7
- queueOptions?: PQueueOptions;
8
- queueOptionsCreateOrder?: PQueueOptions;
9
- queueOptionsGigaspot?: PQueueOptions;
6
+ queueOptions?: QueueOptions;
7
+ queueOptionsCreateOrder?: QueueOptions;
8
+ queueOptionsGigaspot?: QueueOptions;
10
9
  }
11
10
  export interface ResponseData {
12
11
  code: number;
@@ -20,20 +19,20 @@ export interface Pricing {
20
19
  'bitcoin': number;
21
20
  'usd'?: number;
22
21
  }
23
- export interface PricingInUSD {
22
+ export interface PricingInUsd {
24
23
  on_demand_btc: number;
25
24
  on_demand_clore: number;
26
25
  spot: number;
27
26
  }
28
- export interface PricingInOriginalUSD {
27
+ export interface PricingInOriginalUsd {
29
28
  on_demand: number;
30
29
  spot: number;
31
30
  }
32
31
  export interface Price {
33
32
  on_demand: Pricing;
34
33
  spot: Pricing;
35
- usd?: PricingInUSD;
36
- original_usd?: PricingInOriginalUSD;
34
+ usd?: PricingInUsd;
35
+ original_usd?: PricingInOriginalUsd;
37
36
  }
38
37
  export interface Net {
39
38
  cc: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloreai",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "CLORE.AI API client",
6
6
  "repository": {
@@ -27,19 +27,18 @@
27
27
  "typecheck": "tsc --noEmit"
28
28
  },
29
29
  "dependencies": {
30
- "axios": "^1.8.4",
30
+ "axios": "^1.10.0",
31
31
  "p-queue": "^8.1.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@tsconfig/node-lts": "^22.0.1",
34
+ "@tsconfig/node-lts": "^22.0.2",
35
35
  "@tsconfig/strictest": "^2.0.5",
36
- "@types/node": "^22.14.1",
37
- "eslint": "^9.25.0",
38
- "eslint-config-vladpuz": "^1.1.0",
36
+ "@types/node": "^24.0.12",
37
+ "eslint": "^9.30.1",
38
+ "eslint-config-vladpuz": "^2.0.2",
39
39
  "husky": "^9.1.7",
40
- "jiti": "^2.4.2",
41
- "prettier": "^3.5.3",
42
- "prettier-config-vladpuz": "^1.0.0",
40
+ "prettier": "^3.6.2",
41
+ "prettier-config-vladpuz": "^1.0.2",
43
42
  "rimraf": "^6.0.1",
44
43
  "typescript": "^5.8.3"
45
44
  }
@@ -1,19 +0,0 @@
1
- import type { AxiosRequestConfig } from 'axios';
2
- import type { QueueAddOptions } from 'p-queue';
3
- export declare const statusCodes: {
4
- NORMAL: number;
5
- DATABASE_ERROR: number;
6
- INVALID_INPUT_DATA: number;
7
- INVALID_API_TOKEN: number;
8
- INVALID_ENDPOINT: number;
9
- EXCEEDED: number;
10
- OTHER: number;
11
- };
12
- export declare const priorityLevels: {
13
- NORMAL: number;
14
- HIGH: number;
15
- HIGHEST: number;
16
- };
17
- export declare function getQueueOptions(priority: number, config?: AxiosRequestConfig): QueueAddOptions & {
18
- throwOnTimeout: true;
19
- };
File without changes
File without changes
File without changes
File without changes
@@ -1,10 +1,10 @@
1
1
  import type { Currency, ResponseData } from '../types.js';
2
2
  export interface CreateGigaspotOrdersRequestDataOrderOverclock {
3
3
  pl: number;
4
+ core_offset?: number;
5
+ mem_offset?: number;
4
6
  core_lock?: number;
5
7
  mem_lock?: number;
6
- mem_offset?: number;
7
- core_offset?: number;
8
8
  }
9
9
  export interface CreateGigaspotOrdersRequestDataOrder {
10
10
  currency: Currency;
File without changes
File without changes
@@ -1,10 +1,10 @@
1
1
  import type { ResponseData } from '../types.js';
2
2
  export interface EditGigaspotOrdersRequestDataOrderOverclock {
3
3
  pl: number;
4
+ core_offset?: number;
5
+ mem_offset?: number;
4
6
  core_lock?: number;
5
7
  mem_lock?: number;
6
- mem_offset?: number;
7
- core_offset?: number;
8
8
  }
9
9
  export interface EditGigaspotOrdersRequestDataOrder {
10
10
  order_id: number;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes