@gpuai/sdk 0.2.5 → 0.3.1

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 (45) hide show
  1. package/.openapi-generator/FILES +6 -6
  2. package/README.md +15 -10
  3. package/dist/apis/BillingApi.d.ts +51 -0
  4. package/dist/apis/BillingApi.js +144 -0
  5. package/dist/apis/CommunityApi.d.ts +0 -55
  6. package/dist/apis/CommunityApi.js +0 -151
  7. package/dist/esm/apis/BillingApi.d.ts +51 -0
  8. package/dist/esm/apis/BillingApi.js +144 -0
  9. package/dist/esm/apis/CommunityApi.d.ts +0 -55
  10. package/dist/esm/apis/CommunityApi.js +0 -151
  11. package/dist/esm/models/CreateCryptoDepositRequest.d.ts +64 -0
  12. package/dist/esm/models/CreateCryptoDepositRequest.js +68 -0
  13. package/dist/esm/models/CryptoDeposit.d.ts +114 -0
  14. package/dist/esm/models/CryptoDeposit.js +90 -0
  15. package/dist/esm/models/Instance.d.ts +8 -1
  16. package/dist/esm/models/Instance.js +3 -0
  17. package/dist/esm/models/ListDeposits200Response.d.ts +39 -0
  18. package/dist/esm/models/ListDeposits200Response.js +48 -0
  19. package/dist/esm/models/index.d.ts +3 -3
  20. package/dist/esm/models/index.js +3 -3
  21. package/dist/models/CreateCryptoDepositRequest.d.ts +64 -0
  22. package/dist/models/CreateCryptoDepositRequest.js +76 -0
  23. package/dist/models/CryptoDeposit.d.ts +114 -0
  24. package/dist/models/CryptoDeposit.js +98 -0
  25. package/dist/models/Instance.d.ts +8 -1
  26. package/dist/models/Instance.js +3 -0
  27. package/dist/models/ListDeposits200Response.d.ts +39 -0
  28. package/dist/models/ListDeposits200Response.js +55 -0
  29. package/dist/models/index.d.ts +3 -3
  30. package/dist/models/index.js +3 -3
  31. package/docs/BillingApi.md +220 -0
  32. package/docs/CommunityApi.md +0 -230
  33. package/docs/CreateCryptoDepositRequest.md +38 -0
  34. package/docs/CryptoDeposit.md +55 -0
  35. package/docs/Instance.md +2 -0
  36. package/docs/InstancesApi.md +2 -2
  37. package/docs/ListDeposits200Response.md +36 -0
  38. package/package.json +1 -1
  39. package/src/apis/BillingApi.ts +182 -0
  40. package/src/apis/CommunityApi.ts +0 -199
  41. package/src/models/CreateCryptoDepositRequest.ts +108 -0
  42. package/src/models/CryptoDeposit.ts +177 -0
  43. package/src/models/Instance.ts +10 -1
  44. package/src/models/ListDeposits200Response.ts +83 -0
  45. package/src/models/index.ts +3 -3
@@ -21,14 +21,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { CommunityEarningsFromJSON, } from '../models/CommunityEarnings';
25
24
  import { CommunityMachineDelistResultFromJSON, } from '../models/CommunityMachineDelistResult';
26
25
  import { CommunityMachineRegistrationFromJSON, } from '../models/CommunityMachineRegistration';
27
26
  import { CommunitySupplierFromJSON, } from '../models/CommunitySupplier';
28
27
  import { ListCommunityMachines200ResponseFromJSON, } from '../models/ListCommunityMachines200Response';
29
28
  import { RegisterCommunityMachineRequestToJSON, } from '../models/RegisterCommunityMachineRequest';
30
- import { SupplierMachineViewFromJSON, } from '../models/SupplierMachineView';
31
- import { UpdateCommunityMachineRequestToJSON, } from '../models/UpdateCommunityMachineRequest';
32
29
  /**
33
30
  *
34
31
  */
@@ -128,101 +125,6 @@ export class CommunityApi extends runtime.BaseAPI {
128
125
  return yield response.value();
129
126
  });
130
127
  }
131
- /**
132
- * Creates request options for getCommunityEarnings without sending the request
133
- */
134
- getCommunityEarningsRequestOpts(requestParameters) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- const queryParameters = {};
137
- if (requestParameters['limit'] != null) {
138
- queryParameters['limit'] = requestParameters['limit'];
139
- }
140
- const headerParameters = {};
141
- if (this.configuration && this.configuration.accessToken) {
142
- const token = this.configuration.accessToken;
143
- const tokenString = yield token("bearerAuth", []);
144
- if (tokenString) {
145
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
146
- }
147
- }
148
- let urlPath = `/community/earnings`;
149
- return {
150
- path: urlPath,
151
- method: 'GET',
152
- headers: headerParameters,
153
- query: queryParameters,
154
- };
155
- });
156
- }
157
- /**
158
- * Returns the caller org\'s supplier earnings — lifetime accrued and unpaid totals in cents plus recent ledger entries, newest first. An optional `limit` caps the ledger rows (server-clamped). Requires the `community` scope (read).
159
- * Get your Community Cloud earnings
160
- */
161
- getCommunityEarningsRaw(requestParameters, initOverrides) {
162
- return __awaiter(this, void 0, void 0, function* () {
163
- const requestOptions = yield this.getCommunityEarningsRequestOpts(requestParameters);
164
- const response = yield this.request(requestOptions, initOverrides);
165
- return new runtime.JSONApiResponse(response, (jsonValue) => CommunityEarningsFromJSON(jsonValue));
166
- });
167
- }
168
- /**
169
- * Returns the caller org\'s supplier earnings — lifetime accrued and unpaid totals in cents plus recent ledger entries, newest first. An optional `limit` caps the ledger rows (server-clamped). Requires the `community` scope (read).
170
- * Get your Community Cloud earnings
171
- */
172
- getCommunityEarnings() {
173
- return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
174
- const response = yield this.getCommunityEarningsRaw(requestParameters, initOverrides);
175
- return yield response.value();
176
- });
177
- }
178
- /**
179
- * Creates request options for getCommunityMachine without sending the request
180
- */
181
- getCommunityMachineRequestOpts(requestParameters) {
182
- return __awaiter(this, void 0, void 0, function* () {
183
- if (requestParameters['id'] == null) {
184
- throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getCommunityMachine().');
185
- }
186
- const queryParameters = {};
187
- const headerParameters = {};
188
- if (this.configuration && this.configuration.accessToken) {
189
- const token = this.configuration.accessToken;
190
- const tokenString = yield token("bearerAuth", []);
191
- if (tokenString) {
192
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
193
- }
194
- }
195
- let urlPath = `/community/machines/{id}`;
196
- urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
197
- return {
198
- path: urlPath,
199
- method: 'GET',
200
- headers: headerParameters,
201
- query: queryParameters,
202
- };
203
- });
204
- }
205
- /**
206
- * Returns one machine the caller\'s org owns, as a supplier-facing view (`occupied`/`online` projections — the renting customer\'s instance id is never exposed). A missing or cross-org machine returns 404 with an indistinguishable body. Requires the `community` scope (read).
207
- * Get one of your Community Cloud machines
208
- */
209
- getCommunityMachineRaw(requestParameters, initOverrides) {
210
- return __awaiter(this, void 0, void 0, function* () {
211
- const requestOptions = yield this.getCommunityMachineRequestOpts(requestParameters);
212
- const response = yield this.request(requestOptions, initOverrides);
213
- return new runtime.JSONApiResponse(response, (jsonValue) => SupplierMachineViewFromJSON(jsonValue));
214
- });
215
- }
216
- /**
217
- * Returns one machine the caller\'s org owns, as a supplier-facing view (`occupied`/`online` projections — the renting customer\'s instance id is never exposed). A missing or cross-org machine returns 404 with an indistinguishable body. Requires the `community` scope (read).
218
- * Get one of your Community Cloud machines
219
- */
220
- getCommunityMachine(requestParameters, initOverrides) {
221
- return __awaiter(this, void 0, void 0, function* () {
222
- const response = yield this.getCommunityMachineRaw(requestParameters, initOverrides);
223
- return yield response.value();
224
- });
225
- }
226
128
  /**
227
129
  * Creates request options for getCommunitySupplierMe without sending the request
228
130
  */
@@ -408,57 +310,4 @@ export class CommunityApi extends runtime.BaseAPI {
408
310
  return yield response.value();
409
311
  });
410
312
  }
411
- /**
412
- * Creates request options for updateCommunityMachine without sending the request
413
- */
414
- updateCommunityMachineRequestOpts(requestParameters) {
415
- return __awaiter(this, void 0, void 0, function* () {
416
- if (requestParameters['id'] == null) {
417
- throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateCommunityMachine().');
418
- }
419
- if (requestParameters['updateCommunityMachineRequest'] == null) {
420
- throw new runtime.RequiredError('updateCommunityMachineRequest', 'Required parameter "updateCommunityMachineRequest" was null or undefined when calling updateCommunityMachine().');
421
- }
422
- const queryParameters = {};
423
- const headerParameters = {};
424
- headerParameters['Content-Type'] = 'application/json';
425
- if (this.configuration && this.configuration.accessToken) {
426
- const token = this.configuration.accessToken;
427
- const tokenString = yield token("bearerAuth", []);
428
- if (tokenString) {
429
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
430
- }
431
- }
432
- let urlPath = `/community/machines/{id}`;
433
- urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
434
- return {
435
- path: urlPath,
436
- method: 'PATCH',
437
- headers: headerParameters,
438
- query: queryParameters,
439
- body: UpdateCommunityMachineRequestToJSON(requestParameters['updateCommunityMachineRequest']),
440
- };
441
- });
442
- }
443
- /**
444
- * Sets the machine\'s hourly price. `price_per_hour` is the WHOLE-MACHINE rate (never per-GPU). Prices below the platform floor are rejected with a `price-below-floor` problem carrying the concrete `floor_per_hour` extension member. A price change never affects an in-flight rental (its rate was snapshotted at provision); the catalog reprices on the next poll. Requires the `community` scope (or `full_access`).
445
- * Update a Community Cloud machine\'s price
446
- */
447
- updateCommunityMachineRaw(requestParameters, initOverrides) {
448
- return __awaiter(this, void 0, void 0, function* () {
449
- const requestOptions = yield this.updateCommunityMachineRequestOpts(requestParameters);
450
- const response = yield this.request(requestOptions, initOverrides);
451
- return new runtime.JSONApiResponse(response, (jsonValue) => SupplierMachineViewFromJSON(jsonValue));
452
- });
453
- }
454
- /**
455
- * Sets the machine\'s hourly price. `price_per_hour` is the WHOLE-MACHINE rate (never per-GPU). Prices below the platform floor are rejected with a `price-below-floor` problem carrying the concrete `floor_per_hour` extension member. A price change never affects an in-flight rental (its rate was snapshotted at provision); the catalog reprices on the next poll. Requires the `community` scope (or `full_access`).
456
- * Update a Community Cloud machine\'s price
457
- */
458
- updateCommunityMachine(requestParameters, initOverrides) {
459
- return __awaiter(this, void 0, void 0, function* () {
460
- const response = yield this.updateCommunityMachineRaw(requestParameters, initOverrides);
461
- return yield response.value();
462
- });
463
- }
464
313
  }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface CreateCryptoDepositRequest
16
+ */
17
+ export interface CreateCryptoDepositRequest {
18
+ /**
19
+ * Amount to deposit in USD cents. Must be at least the configured minimum (500 = $5.00 by default).
20
+ *
21
+ * @type {number}
22
+ * @memberof CreateCryptoDepositRequest
23
+ */
24
+ amountCents: number;
25
+ /**
26
+ *
27
+ * @type {CreateCryptoDepositRequestChainEnum}
28
+ * @memberof CreateCryptoDepositRequest
29
+ */
30
+ chain: CreateCryptoDepositRequestChainEnum;
31
+ /**
32
+ *
33
+ * @type {CreateCryptoDepositRequestAssetEnum}
34
+ * @memberof CreateCryptoDepositRequest
35
+ */
36
+ asset: CreateCryptoDepositRequestAssetEnum;
37
+ }
38
+ /**
39
+ * @export
40
+ */
41
+ export declare const CreateCryptoDepositRequestChainEnum: {
42
+ readonly Ethereum: "ethereum";
43
+ readonly Base: "base";
44
+ readonly Arbitrum: "arbitrum";
45
+ readonly Polygon: "polygon";
46
+ readonly Solana: "solana";
47
+ };
48
+ export type CreateCryptoDepositRequestChainEnum = typeof CreateCryptoDepositRequestChainEnum[keyof typeof CreateCryptoDepositRequestChainEnum];
49
+ /**
50
+ * @export
51
+ */
52
+ export declare const CreateCryptoDepositRequestAssetEnum: {
53
+ readonly Usdc: "usdc";
54
+ readonly Usdt: "usdt";
55
+ };
56
+ export type CreateCryptoDepositRequestAssetEnum = typeof CreateCryptoDepositRequestAssetEnum[keyof typeof CreateCryptoDepositRequestAssetEnum];
57
+ /**
58
+ * Check if a given object implements the CreateCryptoDepositRequest interface.
59
+ */
60
+ export declare function instanceOfCreateCryptoDepositRequest(value: object): value is CreateCryptoDepositRequest;
61
+ export declare function CreateCryptoDepositRequestFromJSON(json: any): CreateCryptoDepositRequest;
62
+ export declare function CreateCryptoDepositRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateCryptoDepositRequest;
63
+ export declare function CreateCryptoDepositRequestToJSON(json: any): CreateCryptoDepositRequest;
64
+ export declare function CreateCryptoDepositRequestToJSONTyped(value?: CreateCryptoDepositRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,68 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * @export
16
+ */
17
+ export const CreateCryptoDepositRequestChainEnum = {
18
+ Ethereum: 'ethereum',
19
+ Base: 'base',
20
+ Arbitrum: 'arbitrum',
21
+ Polygon: 'polygon',
22
+ Solana: 'solana'
23
+ };
24
+ /**
25
+ * @export
26
+ */
27
+ export const CreateCryptoDepositRequestAssetEnum = {
28
+ Usdc: 'usdc',
29
+ Usdt: 'usdt'
30
+ };
31
+ /**
32
+ * Check if a given object implements the CreateCryptoDepositRequest interface.
33
+ */
34
+ export function instanceOfCreateCryptoDepositRequest(value) {
35
+ if ((!('amountCents' in value) && !('amount_cents' in value)) || (value['amountCents'] === undefined && value['amount_cents'] === undefined))
36
+ return false;
37
+ if (!('chain' in value) || value['chain'] === undefined)
38
+ return false;
39
+ if (!('asset' in value) || value['asset'] === undefined)
40
+ return false;
41
+ return true;
42
+ }
43
+ export function CreateCryptoDepositRequestFromJSON(json) {
44
+ return CreateCryptoDepositRequestFromJSONTyped(json, false);
45
+ }
46
+ export function CreateCryptoDepositRequestFromJSONTyped(json, ignoreDiscriminator) {
47
+ if (json == null) {
48
+ return json;
49
+ }
50
+ return {
51
+ 'amountCents': json['amount_cents'],
52
+ 'chain': json['chain'],
53
+ 'asset': json['asset'],
54
+ };
55
+ }
56
+ export function CreateCryptoDepositRequestToJSON(json) {
57
+ return CreateCryptoDepositRequestToJSONTyped(json, false);
58
+ }
59
+ export function CreateCryptoDepositRequestToJSONTyped(value, ignoreDiscriminator = false) {
60
+ if (value == null) {
61
+ return value;
62
+ }
63
+ return {
64
+ 'amount_cents': value['amountCents'],
65
+ 'chain': value['chain'],
66
+ 'asset': value['asset'],
67
+ };
68
+ }
@@ -0,0 +1,114 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * A stablecoin deposit. Mirrors the Go DTO field for field. Like that struct, this schema deliberately has NO payment-processor property — the processor is an implementation detail and is structurally absent from the customer contract, not merely filtered out.
14
+ *
15
+ * @export
16
+ * @interface CryptoDeposit
17
+ */
18
+ export interface CryptoDeposit {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof CryptoDeposit
23
+ */
24
+ depositId: string;
25
+ /**
26
+ * Lifecycle state: created, detected, confirming, settled, screening, held_screening, credited, credited_underpaid, credited_overpaid, expired, expired_received, failed, failed_screening.
27
+ *
28
+ * @type {string}
29
+ * @memberof CryptoDeposit
30
+ */
31
+ status: string;
32
+ /**
33
+ *
34
+ * @type {CryptoDepositChainEnum}
35
+ * @memberof CryptoDeposit
36
+ */
37
+ chain: CryptoDepositChainEnum;
38
+ /**
39
+ *
40
+ * @type {CryptoDepositAssetEnum}
41
+ * @memberof CryptoDeposit
42
+ */
43
+ asset: CryptoDepositAssetEnum;
44
+ /**
45
+ * The address to send funds to. Unique to this deposit.
46
+ * @type {string}
47
+ * @memberof CryptoDeposit
48
+ */
49
+ payAddress?: string;
50
+ /**
51
+ * The exact token amount to send, as a decimal string (never a number — the value must not round-trip through a float).
52
+ *
53
+ * @type {string}
54
+ * @memberof CryptoDeposit
55
+ */
56
+ payAmount?: string;
57
+ /**
58
+ * The amount requested, in USD cents. Never the settled or credited value.
59
+ * @type {number}
60
+ * @memberof CryptoDeposit
61
+ */
62
+ amountUsdCents: number;
63
+ /**
64
+ * USD cents actually credited to the balance. Absent until credited.
65
+ * @type {number}
66
+ * @memberof CryptoDeposit
67
+ */
68
+ creditedCents?: number;
69
+ /**
70
+ *
71
+ * @type {string}
72
+ * @memberof CryptoDeposit
73
+ */
74
+ txHash?: string;
75
+ /**
76
+ * RFC3339 UTC. After this, send nothing to pay_address.
77
+ * @type {Date}
78
+ * @memberof CryptoDeposit
79
+ */
80
+ expiresAt?: Date;
81
+ /**
82
+ *
83
+ * @type {Date}
84
+ * @memberof CryptoDeposit
85
+ */
86
+ createdAt: Date;
87
+ }
88
+ /**
89
+ * @export
90
+ */
91
+ export declare const CryptoDepositChainEnum: {
92
+ readonly Ethereum: "ethereum";
93
+ readonly Base: "base";
94
+ readonly Arbitrum: "arbitrum";
95
+ readonly Polygon: "polygon";
96
+ readonly Solana: "solana";
97
+ };
98
+ export type CryptoDepositChainEnum = typeof CryptoDepositChainEnum[keyof typeof CryptoDepositChainEnum];
99
+ /**
100
+ * @export
101
+ */
102
+ export declare const CryptoDepositAssetEnum: {
103
+ readonly Usdc: "usdc";
104
+ readonly Usdt: "usdt";
105
+ };
106
+ export type CryptoDepositAssetEnum = typeof CryptoDepositAssetEnum[keyof typeof CryptoDepositAssetEnum];
107
+ /**
108
+ * Check if a given object implements the CryptoDeposit interface.
109
+ */
110
+ export declare function instanceOfCryptoDeposit(value: object): value is CryptoDeposit;
111
+ export declare function CryptoDepositFromJSON(json: any): CryptoDeposit;
112
+ export declare function CryptoDepositFromJSONTyped(json: any, ignoreDiscriminator: boolean): CryptoDeposit;
113
+ export declare function CryptoDepositToJSON(json: any): CryptoDeposit;
114
+ export declare function CryptoDepositToJSONTyped(value?: CryptoDeposit | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,90 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * @export
16
+ */
17
+ export const CryptoDepositChainEnum = {
18
+ Ethereum: 'ethereum',
19
+ Base: 'base',
20
+ Arbitrum: 'arbitrum',
21
+ Polygon: 'polygon',
22
+ Solana: 'solana'
23
+ };
24
+ /**
25
+ * @export
26
+ */
27
+ export const CryptoDepositAssetEnum = {
28
+ Usdc: 'usdc',
29
+ Usdt: 'usdt'
30
+ };
31
+ /**
32
+ * Check if a given object implements the CryptoDeposit interface.
33
+ */
34
+ export function instanceOfCryptoDeposit(value) {
35
+ if ((!('depositId' in value) && !('deposit_id' in value)) || (value['depositId'] === undefined && value['deposit_id'] === undefined))
36
+ return false;
37
+ if (!('status' in value) || value['status'] === undefined)
38
+ return false;
39
+ if (!('chain' in value) || value['chain'] === undefined)
40
+ return false;
41
+ if (!('asset' in value) || value['asset'] === undefined)
42
+ return false;
43
+ if ((!('amountUsdCents' in value) && !('amount_usd_cents' in value)) || (value['amountUsdCents'] === undefined && value['amount_usd_cents'] === undefined))
44
+ return false;
45
+ if ((!('createdAt' in value) && !('created_at' in value)) || (value['createdAt'] === undefined && value['created_at'] === undefined))
46
+ return false;
47
+ return true;
48
+ }
49
+ export function CryptoDepositFromJSON(json) {
50
+ return CryptoDepositFromJSONTyped(json, false);
51
+ }
52
+ export function CryptoDepositFromJSONTyped(json, ignoreDiscriminator) {
53
+ if (json == null) {
54
+ return json;
55
+ }
56
+ return {
57
+ 'depositId': json['deposit_id'],
58
+ 'status': json['status'],
59
+ 'chain': json['chain'],
60
+ 'asset': json['asset'],
61
+ 'payAddress': json['pay_address'] == null ? undefined : json['pay_address'],
62
+ 'payAmount': json['pay_amount'] == null ? undefined : json['pay_amount'],
63
+ 'amountUsdCents': json['amount_usd_cents'],
64
+ 'creditedCents': json['credited_cents'] == null ? undefined : json['credited_cents'],
65
+ 'txHash': json['tx_hash'] == null ? undefined : json['tx_hash'],
66
+ 'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
67
+ 'createdAt': (new Date(json['created_at'])),
68
+ };
69
+ }
70
+ export function CryptoDepositToJSON(json) {
71
+ return CryptoDepositToJSONTyped(json, false);
72
+ }
73
+ export function CryptoDepositToJSONTyped(value, ignoreDiscriminator = false) {
74
+ if (value == null) {
75
+ return value;
76
+ }
77
+ return {
78
+ 'deposit_id': value['depositId'],
79
+ 'status': value['status'],
80
+ 'chain': value['chain'],
81
+ 'asset': value['asset'],
82
+ 'pay_address': value['payAddress'],
83
+ 'pay_amount': value['payAmount'],
84
+ 'amount_usd_cents': value['amountUsdCents'],
85
+ 'credited_cents': value['creditedCents'],
86
+ 'tx_hash': value['txHash'],
87
+ 'expires_at': value['expiresAt'] == null ? value['expiresAt'] : value['expiresAt'].toISOString(),
88
+ 'created_at': value['createdAt'].toISOString(),
89
+ };
90
+ }
@@ -29,7 +29,7 @@ export interface Instance {
29
29
  */
30
30
  name?: string;
31
31
  /**
32
- * Customer-facing lifecycle status. "allocating" = the GPU is still being acquired from the provider (slow-boot capacity such as baremetal can take ~15 min); "starting" = the node exists and is booting; "running" = ready to use.
32
+ * Customer-facing lifecycle status. "allocating" = the GPU is still being acquired from the provider (slow-boot capacity such as baremetal can take ~15 min); "starting" = the node exists and is booting; "running" = ready to use. "unreachable" = the platform's tunnel probe has confirmed the SSH path is down while the machine may still be up: the instance is NOT usable right now, billing for the confirmed-dead window is auto-credited back, and the instance either recovers to "running" on its own or is failed after a grace window. It is a degraded reading of a running instance, not a separate lifecycle state — see unreachable_since.
33
33
  * @type {InstanceStatusEnum}
34
34
  * @memberof Instance
35
35
  */
@@ -106,6 +106,12 @@ export interface Instance {
106
106
  * @memberof Instance
107
107
  */
108
108
  lastReachableAt?: Date;
109
+ /**
110
+ * Start of the confirmed tunnel outage the instance is currently in. Present exactly when status is "unreachable", absent otherwise. It is the timestamp the auto-credit for the dead window is computed from, so a ledger credit can be reconciled against it.
111
+ * @type {Date}
112
+ * @memberof Instance
113
+ */
114
+ unreachableSince?: Date;
109
115
  }
110
116
  /**
111
117
  * @export
@@ -117,6 +123,7 @@ export declare const InstanceStatusEnum: {
117
123
  readonly Stopping: "stopping";
118
124
  readonly Stopped: "stopped";
119
125
  readonly Terminated: "terminated";
126
+ readonly Unreachable: "unreachable";
120
127
  readonly Error: "error";
121
128
  };
122
129
  export type InstanceStatusEnum = typeof InstanceStatusEnum[keyof typeof InstanceStatusEnum];
@@ -22,6 +22,7 @@ export const InstanceStatusEnum = {
22
22
  Stopping: 'stopping',
23
23
  Stopped: 'stopped',
24
24
  Terminated: 'terminated',
25
+ Unreachable: 'unreachable',
25
26
  Error: 'error'
26
27
  };
27
28
  /**
@@ -76,6 +77,7 @@ export function InstanceFromJSONTyped(json, ignoreDiscriminator) {
76
77
  'readyAt': json['ready_at'] == null ? undefined : (new Date(json['ready_at'])),
77
78
  'terminatedAt': json['terminated_at'] == null ? undefined : (new Date(json['terminated_at'])),
78
79
  'lastReachableAt': json['last_reachable_at'] == null ? undefined : (new Date(json['last_reachable_at'])),
80
+ 'unreachableSince': json['unreachable_since'] == null ? undefined : (new Date(json['unreachable_since'])),
79
81
  };
80
82
  }
81
83
  export function InstanceToJSON(json) {
@@ -101,5 +103,6 @@ export function InstanceToJSONTyped(value, ignoreDiscriminator = false) {
101
103
  'ready_at': value['readyAt'] == null ? value['readyAt'] : value['readyAt'].toISOString(),
102
104
  'terminated_at': value['terminatedAt'] == null ? value['terminatedAt'] : value['terminatedAt'].toISOString(),
103
105
  'last_reachable_at': value['lastReachableAt'] == null ? value['lastReachableAt'] : value['lastReachableAt'].toISOString(),
106
+ 'unreachable_since': value['unreachableSince'] == null ? value['unreachableSince'] : value['unreachableSince'].toISOString(),
104
107
  };
105
108
  }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { CryptoDeposit } from './CryptoDeposit';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface ListDeposits200Response
17
+ */
18
+ export interface ListDeposits200Response {
19
+ /**
20
+ *
21
+ * @type {Array<CryptoDeposit>}
22
+ * @memberof ListDeposits200Response
23
+ */
24
+ deposits: Array<CryptoDeposit>;
25
+ /**
26
+ * The effective minimum deposit in USD cents (admin override, else the deployment's configured floor). Validate amounts against this live value rather than hardcoding the default.
27
+ * @type {number}
28
+ * @memberof ListDeposits200Response
29
+ */
30
+ minDepositCents: number;
31
+ }
32
+ /**
33
+ * Check if a given object implements the ListDeposits200Response interface.
34
+ */
35
+ export declare function instanceOfListDeposits200Response(value: object): value is ListDeposits200Response;
36
+ export declare function ListDeposits200ResponseFromJSON(json: any): ListDeposits200Response;
37
+ export declare function ListDeposits200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListDeposits200Response;
38
+ export declare function ListDeposits200ResponseToJSON(json: any): ListDeposits200Response;
39
+ export declare function ListDeposits200ResponseToJSONTyped(value?: ListDeposits200Response | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,48 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import { CryptoDepositFromJSON, CryptoDepositToJSON, } from './CryptoDeposit';
15
+ /**
16
+ * Check if a given object implements the ListDeposits200Response interface.
17
+ */
18
+ export function instanceOfListDeposits200Response(value) {
19
+ if (!('deposits' in value) || value['deposits'] === undefined)
20
+ return false;
21
+ if ((!('minDepositCents' in value) && !('min_deposit_cents' in value)) || (value['minDepositCents'] === undefined && value['min_deposit_cents'] === undefined))
22
+ return false;
23
+ return true;
24
+ }
25
+ export function ListDeposits200ResponseFromJSON(json) {
26
+ return ListDeposits200ResponseFromJSONTyped(json, false);
27
+ }
28
+ export function ListDeposits200ResponseFromJSONTyped(json, ignoreDiscriminator) {
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'deposits': (json['deposits'].map(CryptoDepositFromJSON)),
34
+ 'minDepositCents': json['min_deposit_cents'],
35
+ };
36
+ }
37
+ export function ListDeposits200ResponseToJSON(json) {
38
+ return ListDeposits200ResponseToJSONTyped(json, false);
39
+ }
40
+ export function ListDeposits200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
41
+ if (value == null) {
42
+ return value;
43
+ }
44
+ return {
45
+ 'deposits': (value['deposits'].map(CryptoDepositToJSON)),
46
+ 'min_deposit_cents': value['minDepositCents'],
47
+ };
48
+ }