cloreai 0.1.18 → 1.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.
- package/README.md +286 -0
- package/build/{cloreai/CloreAI.d.ts → CloreAI.d.ts} +7 -11
- package/build/{cloreai/CloreAI.js → CloreAI.js} +29 -46
- package/build/Gigaspot.d.ts +17 -0
- package/build/Gigaspot.js +46 -0
- package/build/constants.d.ts +7 -0
- package/build/constants.js +7 -0
- package/build/endpoints/cancelOrder.d.ts +6 -0
- package/build/{cloreai/endpoints → endpoints}/cancelOrders.d.ts +1 -1
- package/build/{cloreai/endpoints → endpoints}/createGigaspotOrders.d.ts +1 -2
- package/build/{common/endpoints → endpoints}/createOrder.d.ts +3 -2
- package/build/{cloreai/endpoints → endpoints}/getGigaspot.d.ts +1 -2
- package/build/endpoints/marketplace.d.ts +24 -0
- package/build/{common/endpoints → endpoints}/myOrders.d.ts +15 -8
- package/build/{cloreai/endpoints → endpoints}/myServers.d.ts +1 -2
- package/build/endpoints/pohBalance.d.ts +31 -0
- package/build/{cloreai/endpoints → endpoints}/serverConfig.d.ts +1 -2
- package/build/endpoints/setServerSettings.d.ts +11 -0
- package/build/endpoints/setSpotPrice.d.ts +17 -0
- package/build/endpoints/spotMarketplace.d.ts +26 -0
- package/build/{cloreai/endpoints → endpoints}/wallets.d.ts +1 -2
- package/build/errors.d.ts +22 -0
- package/build/{common/constants.d.ts → helpers.d.ts} +5 -2
- package/build/{common/helpers.js → helpers.js} +15 -11
- package/build/index.d.ts +19 -3
- package/build/index.js +3 -3
- package/build/{common/types.d.ts → types.d.ts} +24 -14
- package/package.json +11 -26
- package/build/cloreai/endpoints/cancelOrder.d.ts +0 -6
- package/build/cloreai/endpoints/createOrder.d.ts +0 -4
- package/build/cloreai/endpoints/marketplace.d.ts +0 -6
- package/build/cloreai/endpoints/myOrders.d.ts +0 -9
- package/build/cloreai/endpoints/setServerSettings.d.ts +0 -9
- package/build/cloreai/endpoints/setSpotPrice.d.ts +0 -4
- package/build/cloreai/endpoints/spotMarketplace.d.ts +0 -9
- package/build/cloreai/index.d.ts +0 -17
- package/build/cloreai/index.js +0 -2
- package/build/cloreai/types.d.ts +0 -7
- package/build/common/constants.js +0 -16
- package/build/common/endpoints/cancelOrder.d.ts +0 -3
- package/build/common/endpoints/cancelOrder.js +0 -2
- package/build/common/endpoints/createOrder.js +0 -1
- package/build/common/endpoints/marketplace.d.ts +0 -19
- package/build/common/endpoints/marketplace.js +0 -1
- package/build/common/endpoints/myOrders.js +0 -1
- package/build/common/endpoints/setSpotPrice.d.ts +0 -16
- package/build/common/endpoints/spotMarketplace.d.ts +0 -19
- package/build/common/endpoints/spotMarketplace.js +0 -1
- package/build/common/errors.d.ts +0 -23
- package/build/common/helpers.d.ts +0 -6
- package/build/common/index.d.ts +0 -10
- package/build/common/index.js +0 -3
- package/build/common/types.js +0 -1
- package/build/webapi/WebAPI.d.ts +0 -22
- package/build/webapi/WebAPI.js +0 -80
- package/build/webapi/endpoints/cancelOrder.d.ts +0 -6
- package/build/webapi/endpoints/cancelOrder.js +0 -1
- package/build/webapi/endpoints/createOrder.d.ts +0 -4
- package/build/webapi/endpoints/createOrder.js +0 -1
- package/build/webapi/endpoints/marketplace.d.ts +0 -10
- package/build/webapi/endpoints/marketplace.js +0 -1
- package/build/webapi/endpoints/myOrders.d.ts +0 -15
- package/build/webapi/endpoints/myOrders.js +0 -1
- package/build/webapi/endpoints/setSpotPrice.d.ts +0 -4
- package/build/webapi/endpoints/setSpotPrice.js +0 -1
- package/build/webapi/endpoints/spotMarketplace.d.ts +0 -8
- package/build/webapi/endpoints/spotMarketplace.js +0 -1
- package/build/webapi/index.d.ts +0 -9
- package/build/webapi/index.js +0 -2
- package/build/webapi/types.d.ts +0 -7
- package/build/webapi/types.js +0 -1
- package/build/webapi.d.ts +0 -4
- package/build/webapi.js +0 -4
- /package/build/{cloreai/endpoints → endpoints}/cancelOrder.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/cancelOrders.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/createGigaspotOrders.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/createOrder.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/editGigaspotOrders.d.ts +0 -0
- /package/build/{cloreai/endpoints → endpoints}/editGigaspotOrders.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/getGigaspot.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/marketplace.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/myOrders.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/myServers.js +0 -0
- /package/build/{cloreai/endpoints/serverConfig.js → endpoints/pohBalance.js} +0 -0
- /package/build/{cloreai/endpoints/setServerSettings.js → endpoints/serverConfig.js} +0 -0
- /package/build/{cloreai/endpoints/setSpotPrice.js → endpoints/setServerSettings.js} +0 -0
- /package/build/{common/endpoints → endpoints}/setSpotPrice.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/spotMarketplace.js +0 -0
- /package/build/{cloreai/endpoints → endpoints}/wallets.js +0 -0
- /package/build/{common/errors.js → errors.js} +0 -0
- /package/build/{cloreai/types.js → types.js} +0 -0
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
import type { Currency, Specs } from '../types.js';
|
|
2
|
-
export interface
|
|
3
|
-
|
|
1
|
+
import type { Currency, ResponseData, Specs } from '../types.js';
|
|
2
|
+
export interface MyOrdersRequestParams {
|
|
3
|
+
return_completed?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface MyOrdersResponseDataOrder {
|
|
4
6
|
id: number;
|
|
5
7
|
fee: number;
|
|
6
8
|
creation_fee: number;
|
|
7
9
|
price: number;
|
|
8
10
|
mrl: number;
|
|
9
|
-
online: boolean;
|
|
10
11
|
image: string;
|
|
11
|
-
mon_container: number;
|
|
12
12
|
currency: Currency;
|
|
13
13
|
spend: number;
|
|
14
14
|
ct: number;
|
|
15
|
-
p: number;
|
|
16
15
|
specs: Specs;
|
|
17
16
|
si: number;
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
auto_login: string;
|
|
18
|
+
mon_container: number;
|
|
19
|
+
online: boolean;
|
|
20
20
|
pub_cluster: string[];
|
|
21
21
|
tcp_ports: string[];
|
|
22
22
|
http_port: string;
|
|
23
|
+
http_pub: string;
|
|
24
|
+
spot: boolean;
|
|
25
|
+
expired: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface MyOrdersResponseData extends ResponseData {
|
|
28
|
+
orders: MyOrdersResponseDataOrder[];
|
|
29
|
+
limit: number;
|
|
23
30
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Pricing, Specs, Visibility } from '
|
|
2
|
-
import type { ResponseData } from '../types.js';
|
|
1
|
+
import type { Pricing, ResponseData, Specs, Visibility } from '../types.js';
|
|
3
2
|
export interface MyServersResponseDataServer {
|
|
4
3
|
name: string;
|
|
5
4
|
connected: boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ResponseData } from '../types.js';
|
|
2
|
+
export interface PohBalanceResponseDataBalanceOffers {
|
|
3
|
+
rented_amount: number;
|
|
4
|
+
rented_on_marketplace_amount: number;
|
|
5
|
+
rented_finished_amount: number;
|
|
6
|
+
leased_amount: number;
|
|
7
|
+
leased_finished_amount: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PohBalanceResponseDataBalance {
|
|
10
|
+
total: number;
|
|
11
|
+
free_amount: number;
|
|
12
|
+
reward_amount: number;
|
|
13
|
+
offers: PohBalanceResponseDataBalanceOffers;
|
|
14
|
+
}
|
|
15
|
+
export interface PohBalanceResponseDataItem {
|
|
16
|
+
user: number;
|
|
17
|
+
address: string;
|
|
18
|
+
signature: string;
|
|
19
|
+
message: string;
|
|
20
|
+
created: number;
|
|
21
|
+
unique: string;
|
|
22
|
+
remove: number;
|
|
23
|
+
status: string;
|
|
24
|
+
balance: number;
|
|
25
|
+
last_check: number;
|
|
26
|
+
}
|
|
27
|
+
export interface PohBalanceResponseData extends ResponseData {
|
|
28
|
+
items: PohBalanceResponseDataItem[];
|
|
29
|
+
balance: PohBalanceResponseDataBalance;
|
|
30
|
+
count: number;
|
|
31
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Pricing, Specs, Visibility } from '
|
|
2
|
-
import type { ResponseData } from '../types.js';
|
|
1
|
+
import type { Pricing, ResponseData, Specs, Visibility } from '../types.js';
|
|
3
2
|
export interface ServerConfigRequestData {
|
|
4
3
|
server_name: string;
|
|
5
4
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResponseData } from '../types.js';
|
|
2
|
+
export interface SetServerSettingsRequestData {
|
|
3
|
+
'name': string;
|
|
4
|
+
'availability': boolean;
|
|
5
|
+
'mrl': number;
|
|
6
|
+
'on_demand': number;
|
|
7
|
+
'spot': number;
|
|
8
|
+
'CLORE-Blockchain_on_demand': number;
|
|
9
|
+
'CLORE-Blockchain_spot': number;
|
|
10
|
+
}
|
|
11
|
+
export type SetServerSettingsResponseData = ResponseData;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ResponseData } from '../types.js';
|
|
2
|
+
export interface SetSpotPriceRequestData {
|
|
3
|
+
order_id: number;
|
|
4
|
+
desired_price: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SetSpotPriceResponseDataMaxStep extends ResponseData {
|
|
7
|
+
error: 'exceeded_max_step';
|
|
8
|
+
max_step: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SetSpotPriceResponseDataTimeToLowering extends ResponseData {
|
|
11
|
+
error: 'can_lower_every_600_seconds';
|
|
12
|
+
time_to_lowering: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SetSpotPriceResponseDataNormal extends ResponseData {
|
|
15
|
+
error: null;
|
|
16
|
+
}
|
|
17
|
+
export type SetSpotPriceResponseData = SetSpotPriceResponseDataMaxStep | SetSpotPriceResponseDataTimeToLowering | SetSpotPriceResponseDataNormal;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Currency, Pricing, ResponseData, Visibility } from '../types.js';
|
|
2
|
+
export interface SpotMarketplaceRequestParams {
|
|
3
|
+
market: number;
|
|
4
|
+
}
|
|
5
|
+
export interface SpotMarketplaceResponseDataOffer {
|
|
6
|
+
active: boolean;
|
|
7
|
+
bid: number;
|
|
8
|
+
currency: Currency;
|
|
9
|
+
my: boolean;
|
|
10
|
+
offer_id: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SpotMarketplaceResponseDataServer {
|
|
13
|
+
min_pricing: Pricing;
|
|
14
|
+
mrl: number;
|
|
15
|
+
online: boolean;
|
|
16
|
+
visibility: Visibility;
|
|
17
|
+
}
|
|
18
|
+
export interface SpotMarketplaceResponseDataMarket {
|
|
19
|
+
currency_rates_in_usd: Pricing;
|
|
20
|
+
offers: SpotMarketplaceResponseDataOffer[];
|
|
21
|
+
server: SpotMarketplaceResponseDataServer;
|
|
22
|
+
}
|
|
23
|
+
export interface SpotMarketplaceResponseData extends ResponseData {
|
|
24
|
+
market: SpotMarketplaceResponseDataMarket;
|
|
25
|
+
exists: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
|
+
export declare class DatabaseError extends AxiosError {
|
|
3
|
+
constructor(...args: ConstructorParameters<typeof AxiosError>);
|
|
4
|
+
}
|
|
5
|
+
export declare class InvalidInputDataError extends AxiosError {
|
|
6
|
+
constructor(...args: ConstructorParameters<typeof AxiosError>);
|
|
7
|
+
}
|
|
8
|
+
export declare class InvalidApiTokenError extends AxiosError {
|
|
9
|
+
constructor(...args: ConstructorParameters<typeof AxiosError>);
|
|
10
|
+
}
|
|
11
|
+
export declare class InvalidEndpointError extends AxiosError {
|
|
12
|
+
constructor(...args: ConstructorParameters<typeof AxiosError>);
|
|
13
|
+
}
|
|
14
|
+
export declare class ExceededError extends AxiosError {
|
|
15
|
+
constructor(...args: ConstructorParameters<typeof AxiosError>);
|
|
16
|
+
}
|
|
17
|
+
export declare class OtherError extends AxiosError {
|
|
18
|
+
constructor(...args: ConstructorParameters<typeof AxiosError>);
|
|
19
|
+
}
|
|
20
|
+
export declare class UnknownError extends AxiosError {
|
|
21
|
+
constructor(...args: ConstructorParameters<typeof AxiosError>);
|
|
22
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type { QueueAddOptions } from 'p-queue';
|
|
3
3
|
export declare const statusCodes: {
|
|
4
4
|
NORMAL: number;
|
|
5
5
|
DATABASE_ERROR: number;
|
|
@@ -14,3 +14,6 @@ export declare const priorityLevels: {
|
|
|
14
14
|
HIGH: number;
|
|
15
15
|
HIGHEST: number;
|
|
16
16
|
};
|
|
17
|
+
export declare function getQueueOptions(priority: number, config?: AxiosRequestConfig): QueueAddOptions & {
|
|
18
|
+
throwOnTimeout: true;
|
|
19
|
+
};
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
};
|
|
11
15
|
export function getQueueOptions(priority, config) {
|
|
12
16
|
const defaultQueueOptions = {
|
|
13
17
|
throwOnTimeout: true,
|
|
14
18
|
priority,
|
|
15
19
|
};
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
17
21
|
const signal = config?.signal;
|
|
18
22
|
if (signal == null) {
|
|
19
23
|
return defaultQueueOptions;
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import CloreAI from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
import CloreAI from './CloreAI.js';
|
|
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
|
+
export * from './errors.js';
|
|
19
|
+
export type * from './types.js';
|
|
4
20
|
export default CloreAI;
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CloreAI from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
import CloreAI from './CloreAI.js';
|
|
2
|
+
export * from './constants.js';
|
|
3
|
+
export * from './errors.js';
|
|
4
4
|
export default CloreAI;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { CreateAxiosDefaults } from 'axios';
|
|
2
2
|
import type { Options, Queue, QueueAddOptions } from 'p-queue';
|
|
3
3
|
export type PQueueOptions = Options<Queue<() => Promise<unknown>, QueueAddOptions>, QueueAddOptions>;
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export interface Config {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
axiosOptions?: CreateAxiosDefaults;
|
|
7
|
+
queueOptions?: PQueueOptions;
|
|
8
|
+
queueOptionsCreateOrder?: PQueueOptions;
|
|
9
|
+
queueOptionsGigaspot?: PQueueOptions;
|
|
8
10
|
}
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
+
export interface ResponseData {
|
|
12
|
+
code: number;
|
|
13
|
+
error?: string | null;
|
|
11
14
|
}
|
|
12
15
|
export type OrderType = 'on-demand' | 'spot';
|
|
13
16
|
export type Visibility = 'public' | 'hidden';
|
|
@@ -40,22 +43,29 @@ export interface Overclock {
|
|
|
40
43
|
core_lock: number | null;
|
|
41
44
|
mem_lock: number | null;
|
|
42
45
|
}
|
|
46
|
+
export interface Gpu {
|
|
47
|
+
type: string;
|
|
48
|
+
mem: number;
|
|
49
|
+
pcie_gen: number;
|
|
50
|
+
pcie_width: number;
|
|
51
|
+
}
|
|
43
52
|
export interface Specs {
|
|
44
|
-
|
|
53
|
+
mb: string;
|
|
45
54
|
cpu: string;
|
|
46
55
|
cpus: string;
|
|
47
|
-
|
|
48
|
-
disk_speed: number;
|
|
56
|
+
ram: number;
|
|
49
57
|
gpu: string;
|
|
50
58
|
gpuram: number;
|
|
51
|
-
|
|
59
|
+
disk: string;
|
|
60
|
+
disk_speed: number;
|
|
52
61
|
net: Net;
|
|
62
|
+
backend_version: number;
|
|
53
63
|
pcie_rev: number;
|
|
54
64
|
pcie_width: number;
|
|
65
|
+
xfs?: number;
|
|
66
|
+
stock_oc_override?: boolean;
|
|
55
67
|
pl: number[];
|
|
56
|
-
|
|
57
|
-
stock_oc: Overclock[] | 'default';
|
|
58
|
-
stock_oc_override: boolean;
|
|
68
|
+
gpus?: Gpu[];
|
|
59
69
|
stock_pl: number[];
|
|
60
|
-
|
|
70
|
+
stock_oc: Overclock[] | 'default';
|
|
61
71
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloreai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLORE.AI API client",
|
|
6
6
|
"repository": {
|
|
@@ -9,20 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"author": "Vladislav Puzyrev",
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"./webapi": "./build/webapi.js"
|
|
15
|
-
},
|
|
16
|
-
"typesVersions": {
|
|
17
|
-
"*": {
|
|
18
|
-
".": [
|
|
19
|
-
"build/index.d.ts"
|
|
20
|
-
],
|
|
21
|
-
"webapi": [
|
|
22
|
-
"build/webapi.d.ts"
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
},
|
|
12
|
+
"main": "build/index.js",
|
|
13
|
+
"types": "build/index.d.ts",
|
|
26
14
|
"keywords": [
|
|
27
15
|
"cloreai",
|
|
28
16
|
"clore",
|
|
@@ -34,28 +22,25 @@
|
|
|
34
22
|
"clean": "rimraf build",
|
|
35
23
|
"format": "prettier --check .",
|
|
36
24
|
"lint": "eslint .",
|
|
37
|
-
"playground": "jiti playground/index.ts",
|
|
38
25
|
"prepack": "npm run clean && npm run build && npm run check",
|
|
39
26
|
"prepare": "husky",
|
|
40
|
-
"typecheck": "tsc --noEmit"
|
|
41
|
-
"upgrade": "npm-check-updates --peer --upgrade && npm update"
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
42
28
|
},
|
|
43
29
|
"dependencies": {
|
|
44
|
-
"axios": "^1.
|
|
30
|
+
"axios": "^1.8.4",
|
|
45
31
|
"p-queue": "^8.1.0"
|
|
46
32
|
},
|
|
47
33
|
"devDependencies": {
|
|
48
34
|
"@tsconfig/node-lts": "^22.0.1",
|
|
49
35
|
"@tsconfig/strictest": "^2.0.5",
|
|
50
|
-
"@types/node": "^22.
|
|
51
|
-
"eslint": "^9.
|
|
52
|
-
"eslint-config-vladpuz": "^
|
|
36
|
+
"@types/node": "^22.13.17",
|
|
37
|
+
"eslint": "^9.23.0",
|
|
38
|
+
"eslint-config-vladpuz": "^1.1.0",
|
|
53
39
|
"husky": "^9.1.7",
|
|
54
40
|
"jiti": "^2.4.2",
|
|
55
|
-
"
|
|
56
|
-
"prettier": "^
|
|
57
|
-
"prettier-config-vladpuz": "^0.9.0",
|
|
41
|
+
"prettier": "^3.5.3",
|
|
42
|
+
"prettier-config-vladpuz": "^1.0.0",
|
|
58
43
|
"rimraf": "^6.0.1",
|
|
59
|
-
"typescript": "^5.
|
|
44
|
+
"typescript": "^5.8.2"
|
|
60
45
|
}
|
|
61
46
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CancelOrderRequestDataCommon } from '../../common/endpoints/cancelOrder.js';
|
|
2
|
-
import type { ResponseData } from '../types.js';
|
|
3
|
-
export interface CancelOrderRequestData extends CancelOrderRequestDataCommon {
|
|
4
|
-
issue?: string;
|
|
5
|
-
}
|
|
6
|
-
export type CancelOrderResponseData = ResponseData;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { MarketplaceResponseDataServerCommon } from '../../common/endpoints/marketplace.js';
|
|
2
|
-
import type { ResponseData } from '../types.js';
|
|
3
|
-
export interface MarketplaceResponseData extends ResponseData {
|
|
4
|
-
servers: MarketplaceResponseDataServerCommon[];
|
|
5
|
-
my_servers: number[];
|
|
6
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { MyOrdersResponseDataOrderCommon } from '../../common/endpoints/myOrders.js';
|
|
2
|
-
import type { ResponseData } from '../types.js';
|
|
3
|
-
export interface MyOrdersRequestParams {
|
|
4
|
-
return_completed?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface MyOrdersResponseData extends ResponseData {
|
|
7
|
-
orders: MyOrdersResponseDataOrderCommon[];
|
|
8
|
-
limit: number;
|
|
9
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SetSpotPriceRequestDataCommon, SetSpotPriceResponseDataCommon } from '../../common/endpoints/setSpotPrice.js';
|
|
2
|
-
import type { ResponseData } from '../types.js';
|
|
3
|
-
export type SetSpotPriceRequestData = SetSpotPriceRequestDataCommon;
|
|
4
|
-
export type SetSpotPriceResponseData = SetSpotPriceResponseDataCommon & ResponseData;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SpotMarketplaceResponseDataCommon } from '../../common/endpoints/spotMarketplace.js';
|
|
2
|
-
import type { ResponseData } from '../types.js';
|
|
3
|
-
export interface SpotMarketplaceRequestParams {
|
|
4
|
-
market: number;
|
|
5
|
-
}
|
|
6
|
-
export interface SpotMarketplaceResponseData extends ResponseData {
|
|
7
|
-
market: SpotMarketplaceResponseDataCommon;
|
|
8
|
-
exists: boolean;
|
|
9
|
-
}
|
package/build/cloreai/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import CloreAI from './CloreAI.js';
|
|
2
|
-
export type * from './endpoints/cancelOrder.js';
|
|
3
|
-
export type * from './endpoints/cancelOrders.js';
|
|
4
|
-
export type * from './endpoints/createGigaspotOrders.js';
|
|
5
|
-
export type * from './endpoints/createOrder.js';
|
|
6
|
-
export type * from './endpoints/editGigaspotOrders.js';
|
|
7
|
-
export type * from './endpoints/getGigaspot.js';
|
|
8
|
-
export type * from './endpoints/marketplace.js';
|
|
9
|
-
export type * from './endpoints/myOrders.js';
|
|
10
|
-
export type * from './endpoints/myServers.js';
|
|
11
|
-
export type * from './endpoints/serverConfig.js';
|
|
12
|
-
export type * from './endpoints/setServerSettings.js';
|
|
13
|
-
export type * from './endpoints/setSpotPrice.js';
|
|
14
|
-
export type * from './endpoints/spotMarketplace.js';
|
|
15
|
-
export type * from './endpoints/wallets.js';
|
|
16
|
-
export type * from './types.js';
|
|
17
|
-
export default CloreAI;
|
package/build/cloreai/index.js
DELETED
package/build/cloreai/types.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const RATE_LIMIT = 1_800;
|
|
2
|
-
export const RATE_LIMIT_CREATE_ORDER = 5_000;
|
|
3
|
-
export const statusCodes = {
|
|
4
|
-
NORMAL: 0,
|
|
5
|
-
DATABASE_ERROR: 1,
|
|
6
|
-
INVALID_INPUT_DATA: 2,
|
|
7
|
-
INVALID_API_TOKEN: 3,
|
|
8
|
-
INVALID_ENDPOINT: 4,
|
|
9
|
-
EXCEEDED: 5,
|
|
10
|
-
OTHER: 6,
|
|
11
|
-
};
|
|
12
|
-
export const priorityLevels = {
|
|
13
|
-
NORMAL: 0,
|
|
14
|
-
HIGH: 1,
|
|
15
|
-
HIGHEST: 2,
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Currency, Price, Specs } from '../types.js';
|
|
2
|
-
export interface MarketplaceResponseDataServerRatingCommon {
|
|
3
|
-
avg: number;
|
|
4
|
-
cnt: number;
|
|
5
|
-
}
|
|
6
|
-
export interface MarketplaceResponseDataServerCommon {
|
|
7
|
-
allowed_coins: Currency[];
|
|
8
|
-
cuda_version: string;
|
|
9
|
-
gpu_array: string[];
|
|
10
|
-
id: number;
|
|
11
|
-
mrl: number;
|
|
12
|
-
oc: boolean;
|
|
13
|
-
owner: number;
|
|
14
|
-
price: Price;
|
|
15
|
-
rating: MarketplaceResponseDataServerRatingCommon;
|
|
16
|
-
reliability: number;
|
|
17
|
-
rented: boolean;
|
|
18
|
-
specs: Specs;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface SetSpotPriceRequestDataCommon {
|
|
2
|
-
order_id: number;
|
|
3
|
-
desired_price: number;
|
|
4
|
-
}
|
|
5
|
-
export interface SetSpotPriceResponseDataMaxStep {
|
|
6
|
-
error: 'exceeded_max_step';
|
|
7
|
-
max_step: number;
|
|
8
|
-
}
|
|
9
|
-
export interface SetSpotPriceResponseDataTimeToLowering {
|
|
10
|
-
error: 'can_lower_every_600_seconds';
|
|
11
|
-
time_to_lowering: number;
|
|
12
|
-
}
|
|
13
|
-
export interface SetSpotPriceResponseDataNormal {
|
|
14
|
-
error: undefined;
|
|
15
|
-
}
|
|
16
|
-
export type SetSpotPriceResponseDataCommon = SetSpotPriceResponseDataMaxStep | SetSpotPriceResponseDataTimeToLowering | SetSpotPriceResponseDataNormal;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Currency, Pricing, Visibility } from '../types.js';
|
|
2
|
-
export interface SpotMarketplaceResponseDataOfferCommon {
|
|
3
|
-
active: boolean;
|
|
4
|
-
bid: number;
|
|
5
|
-
currency: Currency;
|
|
6
|
-
my: boolean;
|
|
7
|
-
offer_id: number;
|
|
8
|
-
}
|
|
9
|
-
export interface SpotMarketplaceResponseDataServerCommon {
|
|
10
|
-
min_pricing: Pricing;
|
|
11
|
-
mrl: number;
|
|
12
|
-
online: boolean;
|
|
13
|
-
visibility: Visibility;
|
|
14
|
-
}
|
|
15
|
-
export interface SpotMarketplaceResponseDataCommon {
|
|
16
|
-
currency_rates_in_usd: Pricing;
|
|
17
|
-
offers: SpotMarketplaceResponseDataOfferCommon[];
|
|
18
|
-
server: SpotMarketplaceResponseDataServerCommon;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/common/errors.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AxiosError } from 'axios';
|
|
2
|
-
export type AxiosErrorParameters = ConstructorParameters<typeof AxiosError>;
|
|
3
|
-
export declare class DatabaseError extends AxiosError {
|
|
4
|
-
constructor(...args: AxiosErrorParameters);
|
|
5
|
-
}
|
|
6
|
-
export declare class InvalidInputDataError extends AxiosError {
|
|
7
|
-
constructor(...args: AxiosErrorParameters);
|
|
8
|
-
}
|
|
9
|
-
export declare class InvalidApiTokenError extends AxiosError {
|
|
10
|
-
constructor(...args: AxiosErrorParameters);
|
|
11
|
-
}
|
|
12
|
-
export declare class InvalidEndpointError extends AxiosError {
|
|
13
|
-
constructor(...args: AxiosErrorParameters);
|
|
14
|
-
}
|
|
15
|
-
export declare class ExceededError extends AxiosError {
|
|
16
|
-
constructor(...args: AxiosErrorParameters);
|
|
17
|
-
}
|
|
18
|
-
export declare class OtherError extends AxiosError {
|
|
19
|
-
constructor(...args: AxiosErrorParameters);
|
|
20
|
-
}
|
|
21
|
-
export declare class UnknownError extends AxiosError {
|
|
22
|
-
constructor(...args: AxiosErrorParameters);
|
|
23
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import type { QueueAddOptions } from 'p-queue';
|
|
3
|
-
export declare function getErrorMessage(statusCode?: number | string, errorField?: string): string;
|
|
4
|
-
export declare function getQueueOptions(priority: number, config?: AxiosRequestConfig): QueueAddOptions & {
|
|
5
|
-
throwOnTimeout: true;
|
|
6
|
-
};
|
package/build/common/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './constants.js';
|
|
2
|
-
export type * from './endpoints/cancelOrder.js';
|
|
3
|
-
export type * from './endpoints/createOrder.js';
|
|
4
|
-
export type * from './endpoints/marketplace.js';
|
|
5
|
-
export type * from './endpoints/myOrders.js';
|
|
6
|
-
export type * from './endpoints/setSpotPrice.js';
|
|
7
|
-
export type * from './endpoints/spotMarketplace.js';
|
|
8
|
-
export * from './errors.js';
|
|
9
|
-
export * from './helpers.js';
|
|
10
|
-
export type * from './types.js';
|
package/build/common/index.js
DELETED
package/build/common/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|