Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export class SpheronSDK {
wallet,
networkType,
this.smartWalletBundlerClientPromise,
rpcUrls,
rpcUrls
);
this.orders = new OrderModule(
provider,
wallet,
networkType,
this.smartWalletBundlerClientPromise,
rpcUrls,
rpcUrls
);
this.escrow = new EscrowModule(
provider,
Expand All @@ -73,7 +73,7 @@ export class SpheronSDK {
wallet,
networkType,
this.smartWalletBundlerClientPromise,
rpcUrls,
rpcUrls
);
this.inventory = new InventoryModule(provider, wallet, networkType, rpcUrls);
}
Expand All @@ -84,3 +84,6 @@ export * from '@modules/fizz/types';
export * from '@modules/lease/types';
export * from '@modules/order/types';
export * from '@modules/provider/types';

export * from './utils/cpu-config';
export * from './utils/gpu-config';
4 changes: 1 addition & 3 deletions nodejs/src/modules/inventory/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { NetworkType, RpcUrls } from '@config/index';
import FizzRegistryAbi from '@contracts/abis/testnet/FizzRegistry.json';
import { FizzModule } from '@modules/fizz';
import { ProviderModule } from '@modules/provider';
import { Provider, ProviderStatus } from '@modules/provider/types';
import { handleContractError } from '@utils/errors';
import GpuConfig from '@utils/gpu-config';
import { GpuConfig } from '@utils/gpu-config';
import { requestPipeline } from '@utils/index';
import { createAuthorizationToken } from '@utils/provider-auth';
import { subgraphGetProviders } from '@utils/subgraph';
Expand Down
227 changes: 227 additions & 0 deletions nodejs/src/utils/cpu-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
export interface ICpuConfig {
id: number;
name: string;
vendor: 'general' | 'apple';
shortName: string;
multiplier: number;
tier: 'Medium 1' | 'Low 2' | 'Low 1' | 'Medium 2';
sp: number;
fn: number;
cpuPricePerHour: number;
cpuPricePerMonth: number;
ramPricePerGbPerMonth: number;
storagePricePerGbPerMonth: number;
}

export const CpuConfig: ICpuConfig[] = [
{
id: 1,
name: 'General Purpose',
vendor: 'general',
shortName: 'gp',
multiplier: 1,
tier: 'Medium 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.001,
cpuPricePerMonth: 0.75,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 4,
name: 'M2 Pro',
vendor: 'apple',
shortName: 'm2-pro',
multiplier: 0.75,
tier: 'Low 2',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.056,
cpuPricePerMonth: 41.14,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 5,
name: 'M2 Max',
vendor: 'apple',
shortName: 'm2-max',
multiplier: 1,
tier: 'Medium 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.07,
cpuPricePerMonth: 51.1,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 6,
name: 'M3 Max',
vendor: 'apple',
shortName: 'm3-max',
multiplier: 1,
tier: 'Medium 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.07,
cpuPricePerMonth: 51.1,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 7,
name: 'M3 Pro',
vendor: 'apple',
shortName: 'm3-pro',
multiplier: 0.75,
tier: 'Low 2',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.062,
cpuPricePerMonth: 44.64,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 8,
name: 'M3',
vendor: 'apple',
shortName: 'm3',
multiplier: 0.5,
tier: 'Low 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.05,
cpuPricePerMonth: 36.0,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 9,
name: 'M2',
vendor: 'apple',
shortName: 'm2',
multiplier: 0.5,
tier: 'Low 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.044,
cpuPricePerMonth: 31.94,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 10,
name: 'M2 Ultra',
vendor: 'apple',
shortName: 'm2-ultra',
multiplier: 1.5,
tier: 'Medium 2',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.15,
cpuPricePerMonth: 108.0,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 11,
name: 'M1',
vendor: 'apple',
shortName: 'm1',
multiplier: 0.5,
tier: 'Low 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.035,
cpuPricePerMonth: 25.55,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 12,
name: 'M1 Max',
vendor: 'apple',
shortName: 'm1-max',
multiplier: 0.75,
tier: 'Low 2',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.05,
cpuPricePerMonth: 36.0,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 13,
name: 'M1 Pro',
vendor: 'apple',
shortName: 'm1-pro',
multiplier: 0.5,
tier: 'Low 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.044,
cpuPricePerMonth: 31.94,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 14,
name: 'M1 Ultra',
vendor: 'apple',
shortName: 'm1-ultra',
multiplier: 0.75,
tier: 'Low 2',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.12,
cpuPricePerMonth: 86.4,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 15,
name: 'M4',
vendor: 'apple',
shortName: 'm4',
multiplier: 0.75,
tier: 'Low 2',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.062,
cpuPricePerMonth: 44.64,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 16,
name: 'M4 Pro',
vendor: 'apple',
shortName: 'm4-pro',
multiplier: 1,
tier: 'Medium 1',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.074,
cpuPricePerMonth: 53.28,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
{
id: 17,
name: 'M4 Max',
vendor: 'apple',
shortName: 'm4-max',
multiplier: 1.5,
tier: 'Medium 2',
sp: 0.01,
fn: 25,
cpuPricePerHour: 0.1,
cpuPricePerMonth: 72.0,
ramPricePerGbPerMonth: 0.1,
storagePricePerGbPerMonth: 0.01,
},
];
Loading