bios-sdk 0.1.0-dev.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.
- package/README.md +292 -0
- package/dist/client.d.ts +57 -0
- package/dist/client.js +181 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +80 -0
- package/dist/resources/datasets.d.ts +180 -0
- package/dist/resources/datasets.js +358 -0
- package/dist/resources/gpu-priorities.d.ts +14 -0
- package/dist/resources/gpu-priorities.js +54 -0
- package/dist/resources/gpu.d.ts +60 -0
- package/dist/resources/gpu.js +101 -0
- package/dist/resources/inference.d.ts +82 -0
- package/dist/resources/inference.js +529 -0
- package/dist/resources/models.d.ts +75 -0
- package/dist/resources/models.js +115 -0
- package/dist/resources/training.d.ts +146 -0
- package/dist/resources/training.js +399 -0
- package/dist/resources/wallet.d.ts +44 -0
- package/dist/resources/wallet.js +52 -0
- package/dist/types.d.ts +1466 -0
- package/dist/types.js +4 -0
- package/package.json +49 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { HttpClient } from '../client.js';
|
|
2
|
+
import type { WalletBalance, Transaction, TransactionListParams } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* View wallet balance, transaction history, and billing information.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Wallet {
|
|
7
|
+
private readonly _http;
|
|
8
|
+
/** @internal */
|
|
9
|
+
constructor(_http: HttpClient);
|
|
10
|
+
/**
|
|
11
|
+
* Get the current wallet balance, available credits, and pending charges.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const balance = await client.wallet.getBalance();
|
|
16
|
+
* console.log(`Balance: $${(balance.balance_cents / 100).toFixed(2)}`);
|
|
17
|
+
* console.log(`Available: $${(balance.available_cents / 100).toFixed(2)}`);
|
|
18
|
+
* console.log(`Pending: $${(balance.pending_charges_cents / 100).toFixed(2)}`);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
getBalance(): Promise<WalletBalance>;
|
|
22
|
+
/**
|
|
23
|
+
* List billing transactions (credits, charges, refunds).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const txns = await client.wallet.getTransactions({ limit: 20 });
|
|
28
|
+
* for (const t of txns) {
|
|
29
|
+
* console.log(`${t.type}: $${(t.amount_cents / 100).toFixed(2)} -- ${t.description}`);
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
getTransactions(params?: TransactionListParams): Promise<Transaction[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Get pricing information for compute and storage.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const pricing = await client.wallet.getPricing();
|
|
40
|
+
* console.log(pricing);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
getPricing(): Promise<Record<string, unknown>>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View wallet balance, transaction history, and billing information.
|
|
3
|
+
*/
|
|
4
|
+
export class Wallet {
|
|
5
|
+
_http;
|
|
6
|
+
/** @internal */
|
|
7
|
+
constructor(_http) {
|
|
8
|
+
this._http = _http;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get the current wallet balance, available credits, and pending charges.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const balance = await client.wallet.getBalance();
|
|
16
|
+
* console.log(`Balance: $${(balance.balance_cents / 100).toFixed(2)}`);
|
|
17
|
+
* console.log(`Available: $${(balance.available_cents / 100).toFixed(2)}`);
|
|
18
|
+
* console.log(`Pending: $${(balance.pending_charges_cents / 100).toFixed(2)}`);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
async getBalance() {
|
|
22
|
+
return this._http.fetchGet('/api/billing/wallet');
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List billing transactions (credits, charges, refunds).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const txns = await client.wallet.getTransactions({ limit: 20 });
|
|
30
|
+
* for (const t of txns) {
|
|
31
|
+
* console.log(`${t.type}: $${(t.amount_cents / 100).toFixed(2)} -- ${t.description}`);
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
async getTransactions(params = {}) {
|
|
36
|
+
const limit = params.limit ?? 50;
|
|
37
|
+
const offset = params.offset ?? 0;
|
|
38
|
+
return this._http.fetchGet(`/api/billing/transactions?limit=${limit}&offset=${offset}`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get pricing information for compute and storage.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const pricing = await client.wallet.getPricing();
|
|
46
|
+
* console.log(pricing);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
async getPricing() {
|
|
50
|
+
return this._http.fetchGet('/api/billing/pricing');
|
|
51
|
+
}
|
|
52
|
+
}
|