cloreai 1.0.1 → 3.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 +78 -65
- package/build/{CloreAI.d.ts → Cloreai.d.ts} +26 -18
- package/build/{CloreAI.js → Cloreai.js} +41 -49
- package/build/CloreaiError.d.ts +12 -0
- package/build/CloreaiError.js +16 -0
- package/build/Gigaspot.d.ts +7 -7
- package/build/Gigaspot.js +10 -10
- package/build/constants.d.ts +20 -6
- package/build/constants.js +18 -4
- package/build/getQueueOptions.d.ts +3 -0
- package/build/getQueueOptions.js +8 -0
- package/build/index.d.ts +22 -20
- package/build/index.js +5 -4
- package/build/{endpoints → resources}/cancelOrder.d.ts +1 -1
- package/build/{endpoints → resources}/cancelOrders.d.ts +1 -1
- package/build/{endpoints → resources}/createGigaspotOrders.d.ts +4 -11
- package/build/{endpoints → resources}/createOrder.d.ts +5 -5
- package/build/resources/editGigaspotOrders.d.ts +12 -0
- package/build/{endpoints → resources}/getGigaspot.d.ts +8 -8
- package/build/{endpoints → resources}/marketplace.d.ts +4 -5
- package/build/{endpoints → resources}/myOrders.d.ts +6 -7
- package/build/resources/myServers.d.ts +16 -0
- package/build/{endpoints → resources}/pohBalance.d.ts +7 -7
- package/build/resources/renterFees.d.ts +22 -0
- package/build/{endpoints → resources}/serverConfig.d.ts +8 -5
- package/build/resources/setServerSettings.d.ts +18 -0
- package/build/resources/setSpotPrice.d.ts +15 -0
- package/build/{endpoints → resources}/spotMarketplace.d.ts +10 -10
- package/build/resources/spotMarketplace.js +1 -0
- package/build/{endpoints → resources}/wallets.d.ts +3 -3
- package/build/resources/wallets.js +1 -0
- package/build/types.d.ts +20 -25
- package/package.json +20 -20
- package/build/endpoints/editGigaspotOrders.d.ts +0 -19
- package/build/endpoints/myServers.d.ts +0 -15
- package/build/endpoints/setServerSettings.d.ts +0 -11
- package/build/endpoints/setSpotPrice.d.ts +0 -17
- package/build/endpoints/setSpotPrice.js +0 -2
- package/build/errors.d.ts +0 -22
- package/build/errors.js +0 -43
- package/build/helpers.d.ts +0 -19
- package/build/helpers.js +0 -29
- /package/build/{endpoints → resources}/cancelOrder.js +0 -0
- /package/build/{endpoints → resources}/cancelOrders.js +0 -0
- /package/build/{endpoints → resources}/createGigaspotOrders.js +0 -0
- /package/build/{endpoints → resources}/createOrder.js +0 -0
- /package/build/{endpoints → resources}/editGigaspotOrders.js +0 -0
- /package/build/{endpoints → resources}/getGigaspot.js +0 -0
- /package/build/{endpoints → resources}/marketplace.js +0 -0
- /package/build/{endpoints → resources}/myOrders.js +0 -0
- /package/build/{endpoints → resources}/myServers.js +0 -0
- /package/build/{endpoints → resources}/pohBalance.js +0 -0
- /package/build/{endpoints/serverConfig.js → resources/renterFees.js} +0 -0
- /package/build/{endpoints/setServerSettings.js → resources/serverConfig.js} +0 -0
- /package/build/{endpoints/spotMarketplace.js → resources/setServerSettings.js} +0 -0
- /package/build/{endpoints/wallets.js → resources/setSpotPrice.js} +0 -0
package/build/index.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from './
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export type * from './
|
|
6
|
-
export type * from './
|
|
7
|
-
export type * from './
|
|
8
|
-
export type * from './
|
|
9
|
-
export type * from './
|
|
10
|
-
export type * from './
|
|
11
|
-
export type * from './
|
|
12
|
-
export type * from './
|
|
13
|
-
export type * from './
|
|
14
|
-
export type * from './
|
|
15
|
-
export type * from './
|
|
16
|
-
export type * from './
|
|
17
|
-
export type * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export type * from './
|
|
20
|
-
export
|
|
1
|
+
import Cloreai from './Cloreai.ts';
|
|
2
|
+
export * from './Cloreai.ts';
|
|
3
|
+
export * from './CloreaiError.ts';
|
|
4
|
+
export * from './constants.ts';
|
|
5
|
+
export type * from './resources/cancelOrder.ts';
|
|
6
|
+
export type * from './resources/cancelOrders.ts';
|
|
7
|
+
export type * from './resources/createGigaspotOrders.ts';
|
|
8
|
+
export type * from './resources/createOrder.ts';
|
|
9
|
+
export type * from './resources/editGigaspotOrders.ts';
|
|
10
|
+
export type * from './resources/getGigaspot.ts';
|
|
11
|
+
export type * from './resources/marketplace.ts';
|
|
12
|
+
export type * from './resources/myOrders.ts';
|
|
13
|
+
export type * from './resources/myServers.ts';
|
|
14
|
+
export type * from './resources/pohBalance.ts';
|
|
15
|
+
export type * from './resources/renterFees.ts';
|
|
16
|
+
export type * from './resources/serverConfig.ts';
|
|
17
|
+
export type * from './resources/setServerSettings.ts';
|
|
18
|
+
export type * from './resources/setSpotPrice.ts';
|
|
19
|
+
export type * from './resources/spotMarketplace.ts';
|
|
20
|
+
export type * from './resources/wallets.ts';
|
|
21
|
+
export type * from './types.ts';
|
|
22
|
+
export default Cloreai;
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export
|
|
1
|
+
import Cloreai from "./Cloreai.js";
|
|
2
|
+
export * from "./Cloreai.js";
|
|
3
|
+
export * from "./CloreaiError.js";
|
|
4
|
+
export * from "./constants.js";
|
|
5
|
+
export default Cloreai;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import type { Currency, ResponseData } from '../types.
|
|
2
|
-
export interface
|
|
3
|
-
pl: number;
|
|
4
|
-
core_lock?: number;
|
|
5
|
-
mem_lock?: number;
|
|
6
|
-
mem_offset?: number;
|
|
7
|
-
core_offset?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface CreateGigaspotOrdersRequestDataOrder {
|
|
1
|
+
import type { Currency, GigaspotOverclock, ResponseData } from '../types.ts';
|
|
2
|
+
export interface CreateGigaspotOrdersOrder {
|
|
10
3
|
currency: Currency;
|
|
11
4
|
image: string;
|
|
12
5
|
renting_server: number;
|
|
13
6
|
price: number;
|
|
14
|
-
oc:
|
|
7
|
+
oc: GigaspotOverclock[];
|
|
15
8
|
env?: Record<string, string>;
|
|
16
9
|
}
|
|
17
|
-
export type CreateGigaspotOrdersRequestData =
|
|
10
|
+
export type CreateGigaspotOrdersRequestData = CreateGigaspotOrdersOrder[];
|
|
18
11
|
export interface CreateGigaspotOrdersResponseData extends ResponseData {
|
|
19
12
|
failed_to_oc_servers: number[];
|
|
20
13
|
failed_to_rent_servers: number[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Currency, OrderType, ResponseData } from '../types.
|
|
2
|
-
export interface
|
|
1
|
+
import type { Currency, OrderType, ResponseData } from '../types.ts';
|
|
2
|
+
export interface CreateOrderBase {
|
|
3
3
|
type: OrderType;
|
|
4
4
|
currency: Currency;
|
|
5
5
|
image: string;
|
|
@@ -15,12 +15,12 @@ export interface CreateOrderRequestDataBase {
|
|
|
15
15
|
remember_password?: boolean;
|
|
16
16
|
dockerhub_auth?: string;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface CreateOrderOnDemand extends CreateOrderBase {
|
|
19
19
|
type: 'on-demand';
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface CreateOrderSpot extends CreateOrderBase {
|
|
22
22
|
type: 'spot';
|
|
23
23
|
spotprice: number;
|
|
24
24
|
}
|
|
25
|
-
export type CreateOrderRequestData =
|
|
25
|
+
export type CreateOrderRequestData = CreateOrderOnDemand | CreateOrderSpot;
|
|
26
26
|
export type CreateOrderResponseData = ResponseData;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GigaspotOverclock, ResponseData } from '../types.ts';
|
|
2
|
+
export interface EditGigaspotOrdersOrder {
|
|
3
|
+
order_id: number;
|
|
4
|
+
price: number;
|
|
5
|
+
oc: GigaspotOverclock[];
|
|
6
|
+
}
|
|
7
|
+
export type EditGigaspotOrdersRequestData = EditGigaspotOrdersOrder[];
|
|
8
|
+
export interface EditGigaspotOrdersResponseData extends ResponseData {
|
|
9
|
+
success_to_update_ids: number[];
|
|
10
|
+
failed_to_update_ids: number[];
|
|
11
|
+
too_low_bid_ids: number[];
|
|
12
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Currency, Pricing, ResponseData } from '../types.
|
|
2
|
-
export interface
|
|
1
|
+
import type { Currency, Pricing, ResponseData } from '../types.ts';
|
|
2
|
+
export interface GetGigaspotSnapshotServerBid {
|
|
3
3
|
owner: number;
|
|
4
4
|
id: number;
|
|
5
5
|
active: boolean;
|
|
@@ -9,7 +9,7 @@ export interface GetGigaspotResponseDataSnapshotServerBid {
|
|
|
9
9
|
currency: Currency;
|
|
10
10
|
pl: number;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface GetGigaspotSnapshotServerGpu {
|
|
13
13
|
pl: [number, number];
|
|
14
14
|
mem_lock: [number, number];
|
|
15
15
|
core_lock: [number, number];
|
|
@@ -17,15 +17,15 @@ export interface GetGigaspotResponseDataSnapshotServerGpu {
|
|
|
17
17
|
core_offset: [number, number];
|
|
18
18
|
model: string;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
21
|
-
bids:
|
|
20
|
+
export interface GetGigaspotSnapshotServer {
|
|
21
|
+
bids: GetGigaspotSnapshotServerBid[];
|
|
22
22
|
on_demand_rented: boolean;
|
|
23
23
|
online: boolean;
|
|
24
24
|
cpu: string;
|
|
25
25
|
cores: number;
|
|
26
26
|
threads: number;
|
|
27
27
|
ram: number;
|
|
28
|
-
gpus:
|
|
28
|
+
gpus: GetGigaspotSnapshotServerGpu[];
|
|
29
29
|
working_properly: boolean;
|
|
30
30
|
cuda: string;
|
|
31
31
|
max_rental_length: number;
|
|
@@ -35,12 +35,12 @@ export interface GetGigaspotResponseDataSnapshotServer {
|
|
|
35
35
|
min_bid: number;
|
|
36
36
|
energy_price: number;
|
|
37
37
|
}
|
|
38
|
-
export type
|
|
38
|
+
export type GetGigaspotSnapshot = Record<string, GetGigaspotSnapshotServer>;
|
|
39
39
|
export interface GetGigaspotResponseDataBase extends ResponseData {
|
|
40
40
|
my_user_id: number;
|
|
41
41
|
v1_snapshot_url: string;
|
|
42
42
|
creation_fees: Pricing;
|
|
43
43
|
}
|
|
44
44
|
export interface GetGigaspotResponseData extends GetGigaspotResponseDataBase {
|
|
45
|
-
snapshot:
|
|
45
|
+
snapshot: GetGigaspotSnapshot;
|
|
46
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Currency, Price, Rating, ResponseData, Specs } from '../types.
|
|
2
|
-
export interface
|
|
1
|
+
import type { Currency, Price, Rating, ResponseData, Specs } from '../types.ts';
|
|
2
|
+
export interface MarketplaceServer {
|
|
3
3
|
id: number;
|
|
4
4
|
owner: number;
|
|
5
5
|
autoprice?: string;
|
|
@@ -11,11 +11,10 @@ export interface MarketplaceResponseDataServer {
|
|
|
11
11
|
allowed_coins: Currency[];
|
|
12
12
|
rating: Rating;
|
|
13
13
|
gpu_array: string[];
|
|
14
|
-
gigaspot
|
|
14
|
+
gigaspot?: boolean;
|
|
15
15
|
oc?: boolean;
|
|
16
16
|
cuda_version: string;
|
|
17
17
|
}
|
|
18
18
|
export interface MarketplaceResponseData extends ResponseData {
|
|
19
|
-
servers:
|
|
20
|
-
my_servers: number[];
|
|
19
|
+
servers: MarketplaceServer[];
|
|
21
20
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { Currency, Rating, ResponseData, Specs } from '../types.
|
|
1
|
+
import type { Currency, Rating, ResponseData, Specs } from '../types.ts';
|
|
2
2
|
export interface MyOrdersRequestParams {
|
|
3
3
|
return_completed?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface MyOrdersOrder {
|
|
6
6
|
id: number;
|
|
7
|
-
fee: number;
|
|
8
7
|
creation_fee: number;
|
|
9
8
|
price: number;
|
|
10
9
|
mrl: number;
|
|
@@ -26,12 +25,12 @@ export interface MyOrdersResponseDataOrder {
|
|
|
26
25
|
rating: Rating;
|
|
27
26
|
reliability: number;
|
|
28
27
|
owner: number;
|
|
29
|
-
cuda_version:
|
|
28
|
+
cuda_version: string;
|
|
30
29
|
gpu_array: string[];
|
|
31
|
-
spot
|
|
32
|
-
expired
|
|
30
|
+
spot?: boolean;
|
|
31
|
+
expired?: boolean;
|
|
33
32
|
}
|
|
34
33
|
export interface MyOrdersResponseData extends ResponseData {
|
|
35
|
-
orders:
|
|
34
|
+
orders: MyOrdersOrder[];
|
|
36
35
|
limit: number;
|
|
37
36
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Currency, Pricing, ResponseData, Specs, Visibility } from '../types.ts';
|
|
2
|
+
export interface MyServersServer {
|
|
3
|
+
name: string;
|
|
4
|
+
connected: boolean;
|
|
5
|
+
visibility: Visibility;
|
|
6
|
+
pricing: Pricing;
|
|
7
|
+
online: boolean;
|
|
8
|
+
min_spot_pricing: Pricing;
|
|
9
|
+
allowed_currencies: Currency[];
|
|
10
|
+
init_token?: string;
|
|
11
|
+
specs?: Specs;
|
|
12
|
+
}
|
|
13
|
+
export interface MyServersResponseData extends ResponseData {
|
|
14
|
+
servers: MyServersServer[];
|
|
15
|
+
limit: number;
|
|
16
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { ResponseData } from '../types.
|
|
2
|
-
export interface
|
|
1
|
+
import type { ResponseData } from '../types.ts';
|
|
2
|
+
export interface PohBalanceOffers {
|
|
3
3
|
rented_amount: number;
|
|
4
4
|
rented_on_marketplace_amount: number;
|
|
5
5
|
rented_finished_amount: number;
|
|
6
6
|
leased_amount: number;
|
|
7
7
|
leased_finished_amount: number;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface PohBalance {
|
|
10
10
|
total: number;
|
|
11
11
|
free_amount: number;
|
|
12
12
|
reward_amount: number;
|
|
13
|
-
offers:
|
|
13
|
+
offers: PohBalanceOffers;
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
15
|
+
export interface PohBalanceItem {
|
|
16
16
|
user: number;
|
|
17
17
|
address: string;
|
|
18
18
|
signature: string;
|
|
@@ -25,7 +25,7 @@ export interface PohBalanceResponseDataItem {
|
|
|
25
25
|
last_check: number;
|
|
26
26
|
}
|
|
27
27
|
export interface PohBalanceResponseData extends ResponseData {
|
|
28
|
-
items:
|
|
29
|
-
balance:
|
|
28
|
+
items: PohBalanceItem[];
|
|
29
|
+
balance: PohBalance;
|
|
30
30
|
count: number;
|
|
31
31
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Pricing, ResponseData } from '../types.ts';
|
|
2
|
+
export interface RenterFeesPohConfig {
|
|
3
|
+
max_reduction_percent: number;
|
|
4
|
+
max_poh_amount: number;
|
|
5
|
+
}
|
|
6
|
+
export interface RenterFeesCreationFees {
|
|
7
|
+
on_demand: Pricing;
|
|
8
|
+
spot: Pricing;
|
|
9
|
+
}
|
|
10
|
+
export interface RenterFees {
|
|
11
|
+
on_demand: RenterFee;
|
|
12
|
+
spot: RenterFee;
|
|
13
|
+
}
|
|
14
|
+
export interface RenterFee {
|
|
15
|
+
base: Pricing;
|
|
16
|
+
}
|
|
17
|
+
export interface RenterFeesResponseData extends ResponseData {
|
|
18
|
+
renter_fees: RenterFees;
|
|
19
|
+
poh_config: RenterFeesPohConfig;
|
|
20
|
+
creation_fees: RenterFeesCreationFees;
|
|
21
|
+
poh_balance: number;
|
|
22
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Pricing, ResponseData, Specs, Visibility } from '../types.
|
|
1
|
+
import type { AutoPrice, Currency, Pricing, PricingInOriginalUsd, ResponseData, Specs, Visibility } from '../types.ts';
|
|
2
2
|
export interface ServerConfigRequestData {
|
|
3
3
|
server_name: string;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface ServerConfigBackgroundJob {
|
|
6
6
|
times_updated: number;
|
|
7
7
|
image: string;
|
|
8
8
|
command: string;
|
|
9
9
|
env: Record<string, string>;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface ServerConfig {
|
|
12
12
|
name: string;
|
|
13
13
|
connected: boolean;
|
|
14
14
|
visibility: Visibility;
|
|
@@ -20,9 +20,12 @@ export interface ServerConfigResponseDataConfig {
|
|
|
20
20
|
id: number;
|
|
21
21
|
rental_status: number;
|
|
22
22
|
specs: Specs;
|
|
23
|
-
background_job:
|
|
23
|
+
background_job: ServerConfigBackgroundJob;
|
|
24
|
+
allowed_coins: Currency[];
|
|
25
|
+
autoprice: AutoPrice;
|
|
26
|
+
usd_pricing: PricingInOriginalUsd;
|
|
24
27
|
}
|
|
25
28
|
export interface ServerConfigResponseData extends ResponseData {
|
|
26
|
-
config:
|
|
29
|
+
config: ServerConfig;
|
|
27
30
|
creation_completed: boolean;
|
|
28
31
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AutoPrice, PricingInOriginalUsd, ResponseData } from '../types.ts';
|
|
2
|
+
export interface SetServerSettingsRequestData {
|
|
3
|
+
'name': string;
|
|
4
|
+
'availability': boolean;
|
|
5
|
+
'mrl': number;
|
|
6
|
+
'bitcoin_on_demand': number;
|
|
7
|
+
'bitcoin_spot': number;
|
|
8
|
+
'CLORE-Blockchain_on_demand'?: number;
|
|
9
|
+
'CLORE-Blockchain_spot'?: number;
|
|
10
|
+
'USD-Blockchain_on_demand'?: number;
|
|
11
|
+
'USD-Blockchain_spot'?: number;
|
|
12
|
+
'enabled-USD-Blockchain'?: boolean;
|
|
13
|
+
'enabled-CLORE-Blockchain'?: boolean;
|
|
14
|
+
'enabled-bitcoin'?: boolean;
|
|
15
|
+
'autoprice'?: AutoPrice;
|
|
16
|
+
'usd_pricing'?: PricingInOriginalUsd;
|
|
17
|
+
}
|
|
18
|
+
export type SetServerSettingsResponseData = ResponseData;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ResponseData } from '../types.ts';
|
|
2
|
+
export interface SetSpotPriceRequestData {
|
|
3
|
+
order_id: number;
|
|
4
|
+
desired_price: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SetSpotPriceMaxStep extends ResponseData {
|
|
7
|
+
error: 'exceeded_max_step';
|
|
8
|
+
max_step: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SetSpotPriceTimeToLowering extends ResponseData {
|
|
11
|
+
error: 'can_lower_every_600_seconds';
|
|
12
|
+
time_to_lowering: number;
|
|
13
|
+
}
|
|
14
|
+
export type SetSpotPriceNormal = Omit<ResponseData, 'error'>;
|
|
15
|
+
export type SetSpotPriceResponseData = SetSpotPriceMaxStep | SetSpotPriceTimeToLowering | SetSpotPriceNormal;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { Currency, Pricing, ResponseData, Visibility } from '../types.
|
|
1
|
+
import type { Currency, Pricing, ResponseData, Visibility } from '../types.ts';
|
|
2
2
|
export interface SpotMarketplaceRequestParams {
|
|
3
3
|
market: number;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
6
|
-
|
|
5
|
+
export interface SpotMarketplaceMarketOffer {
|
|
6
|
+
offer_id: number;
|
|
7
7
|
bid: number;
|
|
8
|
-
|
|
8
|
+
active: boolean;
|
|
9
9
|
my: boolean;
|
|
10
|
-
|
|
10
|
+
currency: Currency;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface SpotMarketplaceMarketServer {
|
|
13
13
|
min_pricing: Pricing;
|
|
14
14
|
mrl: number;
|
|
15
15
|
online: boolean;
|
|
16
16
|
visibility: Visibility;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface SpotMarketplaceMarket {
|
|
19
19
|
currency_rates_in_usd: Pricing;
|
|
20
|
-
offers:
|
|
21
|
-
server:
|
|
20
|
+
offers: SpotMarketplaceMarketOffer[];
|
|
21
|
+
server: SpotMarketplaceMarketServer;
|
|
22
22
|
}
|
|
23
23
|
export interface SpotMarketplaceResponseData extends ResponseData {
|
|
24
|
-
market:
|
|
24
|
+
market: SpotMarketplaceMarket;
|
|
25
25
|
exists: boolean;
|
|
26
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Currency, ResponseData } from '../types.
|
|
2
|
-
export interface
|
|
1
|
+
import type { Currency, ResponseData } from '../types.ts';
|
|
2
|
+
export interface Wallet {
|
|
3
3
|
name: Currency;
|
|
4
4
|
deposit: string;
|
|
5
5
|
balance: number;
|
|
6
6
|
withdrawal_fee: number;
|
|
7
7
|
}
|
|
8
8
|
export interface WalletsResponseData extends ResponseData {
|
|
9
|
-
wallets:
|
|
9
|
+
wallets: Wallet[];
|
|
10
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/types.d.ts
CHANGED
|
@@ -1,39 +1,27 @@
|
|
|
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;
|
|
6
|
-
axiosOptions?: CreateAxiosDefaults;
|
|
7
|
-
queueOptions?: PQueueOptions;
|
|
8
|
-
queueOptionsCreateOrder?: PQueueOptions;
|
|
9
|
-
queueOptionsGigaspot?: PQueueOptions;
|
|
10
|
-
}
|
|
11
1
|
export interface ResponseData {
|
|
12
2
|
code: number;
|
|
13
|
-
error?: string
|
|
3
|
+
error?: string;
|
|
14
4
|
}
|
|
15
5
|
export type OrderType = 'on-demand' | 'spot';
|
|
16
6
|
export type Visibility = 'public' | 'hidden';
|
|
17
|
-
export type Currency = 'CLORE-Blockchain' | 'bitcoin';
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'usd'?: number;
|
|
22
|
-
}
|
|
23
|
-
export interface PricingInUSD {
|
|
24
|
-
on_demand_btc: number;
|
|
25
|
-
on_demand_clore: number;
|
|
26
|
-
spot: number;
|
|
27
|
-
}
|
|
28
|
-
export interface PricingInOriginalUSD {
|
|
7
|
+
export type Currency = 'CLORE-Blockchain' | 'USD-Blockchain' | 'bitcoin';
|
|
8
|
+
export type Pricing = Partial<Record<Currency, number>>;
|
|
9
|
+
export type AutoPrice = Partial<Record<Currency, 'usd' | false>>;
|
|
10
|
+
export type PricingInOriginalUsd = Partial<Record<Currency, {
|
|
29
11
|
on_demand: number;
|
|
30
12
|
spot: number;
|
|
13
|
+
}>>;
|
|
14
|
+
export interface PricingInUsd {
|
|
15
|
+
on_demand_clore: number;
|
|
16
|
+
on_demand_usd: number;
|
|
17
|
+
on_demand_btc: number;
|
|
18
|
+
spot: number;
|
|
31
19
|
}
|
|
32
20
|
export interface Price {
|
|
33
21
|
on_demand: Pricing;
|
|
34
22
|
spot: Pricing;
|
|
35
|
-
usd
|
|
36
|
-
original_usd?:
|
|
23
|
+
usd: PricingInUsd;
|
|
24
|
+
original_usd?: PricingInOriginalUsd;
|
|
37
25
|
}
|
|
38
26
|
export interface Net {
|
|
39
27
|
cc: string;
|
|
@@ -78,3 +66,10 @@ export interface Rating {
|
|
|
78
66
|
avg: number;
|
|
79
67
|
cnt: number;
|
|
80
68
|
}
|
|
69
|
+
export interface GigaspotOverclock {
|
|
70
|
+
pl: number;
|
|
71
|
+
core_offset?: number;
|
|
72
|
+
mem_offset?: number;
|
|
73
|
+
core_lock?: number;
|
|
74
|
+
mem_lock?: number;
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloreai",
|
|
3
|
-
"version": "
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "3.0.0",
|
|
5
4
|
"description": "CLORE.AI API client",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cloreai",
|
|
7
|
+
"clore",
|
|
8
|
+
"api"
|
|
9
|
+
],
|
|
6
10
|
"repository": {
|
|
7
11
|
"type": "git",
|
|
8
12
|
"url": "git+https://github.com/vladpuz/cloreai.git"
|
|
9
13
|
},
|
|
10
|
-
"author": "Vladislav Puzyrev",
|
|
11
14
|
"license": "MIT",
|
|
15
|
+
"author": "Vladislav Puzyrev",
|
|
16
|
+
"type": "module",
|
|
12
17
|
"main": "build/index.js",
|
|
13
18
|
"types": "build/index.d.ts",
|
|
14
|
-
"keywords": [
|
|
15
|
-
"cloreai",
|
|
16
|
-
"clore",
|
|
17
|
-
"api"
|
|
18
|
-
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc --project tsconfig.build.json",
|
|
21
21
|
"check": "npm run typecheck && npm run lint && npm run format",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"typecheck": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"axios": "^1.
|
|
31
|
-
"p-queue": "^
|
|
30
|
+
"axios": "^1.13.5",
|
|
31
|
+
"p-queue": "^9.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tsconfig/node-lts": "^
|
|
35
|
-
"@tsconfig/
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"eslint
|
|
34
|
+
"@tsconfig/node-lts": "^24.0.0",
|
|
35
|
+
"@tsconfig/node-ts": "^23.6.4",
|
|
36
|
+
"@tsconfig/strictest": "^2.0.8",
|
|
37
|
+
"@types/node": "^25.3.0",
|
|
38
|
+
"eslint": "^9.39.3",
|
|
39
|
+
"eslint-config-vladpuz": "^2.5.1",
|
|
39
40
|
"husky": "^9.1.7",
|
|
40
|
-
"
|
|
41
|
-
"prettier": "^
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"typescript": "^5.8.3"
|
|
41
|
+
"prettier": "^3.8.1",
|
|
42
|
+
"prettier-config-vladpuz": "^2.0.0",
|
|
43
|
+
"rimraf": "^6.1.3",
|
|
44
|
+
"typescript": "^5.9.3"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ResponseData } from '../types.js';
|
|
2
|
-
export interface EditGigaspotOrdersRequestDataOrderOverclock {
|
|
3
|
-
pl: number;
|
|
4
|
-
core_lock?: number;
|
|
5
|
-
mem_lock?: number;
|
|
6
|
-
mem_offset?: number;
|
|
7
|
-
core_offset?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface EditGigaspotOrdersRequestDataOrder {
|
|
10
|
-
order_id: number;
|
|
11
|
-
price: number;
|
|
12
|
-
oc: EditGigaspotOrdersRequestDataOrderOverclock[];
|
|
13
|
-
}
|
|
14
|
-
export type EditGigaspotOrdersRequestData = EditGigaspotOrdersRequestDataOrder[];
|
|
15
|
-
export interface EditGigaspotOrdersResponseData extends ResponseData {
|
|
16
|
-
success_to_update_ids: number[];
|
|
17
|
-
failed_to_update_ids: number[];
|
|
18
|
-
too_low_bid_ids: number[];
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Pricing, ResponseData, Specs, Visibility } from '../types.js';
|
|
2
|
-
export interface MyServersResponseDataServer {
|
|
3
|
-
name: string;
|
|
4
|
-
connected: boolean;
|
|
5
|
-
visibility: Visibility;
|
|
6
|
-
pricing: Pricing;
|
|
7
|
-
online: boolean;
|
|
8
|
-
min_spot_pricing: Pricing;
|
|
9
|
-
init_token: string;
|
|
10
|
-
specs: Specs;
|
|
11
|
-
}
|
|
12
|
-
export interface MyServersResponseData extends ResponseData {
|
|
13
|
-
servers: MyServersResponseDataServer[];
|
|
14
|
-
limit: number;
|
|
15
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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;
|