diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index 766932c..bd82686 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -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, @@ -73,7 +73,7 @@ export class SpheronSDK { wallet, networkType, this.smartWalletBundlerClientPromise, - rpcUrls, + rpcUrls ); this.inventory = new InventoryModule(provider, wallet, networkType, rpcUrls); } @@ -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'; diff --git a/nodejs/src/modules/inventory/index.ts b/nodejs/src/modules/inventory/index.ts index b0aea1f..fa2b0d1 100644 --- a/nodejs/src/modules/inventory/index.ts +++ b/nodejs/src/modules/inventory/index.ts @@ -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'; diff --git a/nodejs/src/utils/cpu-config.ts b/nodejs/src/utils/cpu-config.ts new file mode 100644 index 0000000..b9505b6 --- /dev/null +++ b/nodejs/src/utils/cpu-config.ts @@ -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, + }, +]; diff --git a/nodejs/src/utils/gpu-config.ts b/nodejs/src/utils/gpu-config.ts index e050415..540b1a7 100644 --- a/nodejs/src/utils/gpu-config.ts +++ b/nodejs/src/utils/gpu-config.ts @@ -1,4 +1,30 @@ -const GpuConfig = [ +export interface IGpuConfig { + id: number; + name: string; + tier: + | 'Entry 1' + | 'Entry 2' + | 'Low 1' + | 'Low 2' + | 'Medium 1' + | 'Medium 2' + | 'High 1' + | 'High 2' + | 'Ultra High 1' + | 'Ultra High 2' + | 'Ultra High 3'; + shortName: string; + multiplier: number; + baseFnPoints: number; + gpuPricePerHour: number; + gpuPricePerMonth: number; + cpuPricePerMonth: number; + ramPricePerGbPerMonth: number; + storagePricePerGbPerMonth: number; + vendor: 'nvidia'; +} + +export const GpuConfig: IGpuConfig[] = [ { id: 1, name: 'NVIDIA T1000', @@ -917,12 +943,11 @@ const GpuConfig = [ multiplier: 1, baseFnPoints: 500, gpuPricePerHour: 0.25, - gpuPricePerMonth: 180.0, + gpuPricePerMonth: 180, cpuPricePerMonth: 0.75, ramPricePerGbPerMonth: 0.1, storagePricePerGbPerMonth: 0.01, vendor: 'nvidia', - disabled: false, }, { id: 67, @@ -937,7 +962,6 @@ const GpuConfig = [ ramPricePerGbPerMonth: 0.1, storagePricePerGbPerMonth: 0.01, vendor: 'nvidia', - disabled: false, }, { id: 68, @@ -947,12 +971,109 @@ const GpuConfig = [ multiplier: 1, baseFnPoints: 500, gpuPricePerHour: 0.15, - gpuPricePerMonth: 108.0, + gpuPricePerMonth: 108, + cpuPricePerMonth: 0.75, + ramPricePerGbPerMonth: 0.1, + storagePricePerGbPerMonth: 0.01, + vendor: 'nvidia', + }, + { + id: 69, + name: 'NVIDIA GH200 96 GB', + tier: 'Ultra High 2', + shortName: 'gh200', + multiplier: 12, + baseFnPoints: 500, + gpuPricePerHour: 0.15, + gpuPricePerMonth: 108, + cpuPricePerMonth: 0.75, + ramPricePerGbPerMonth: 0.1, + storagePricePerGbPerMonth: 0.01, + vendor: 'nvidia', + }, + { + id: 70, + name: 'NVIDIA H200 142 GB ', + tier: 'Ultra High 3', + shortName: 'h200', + multiplier: 15, + baseFnPoints: 500, + gpuPricePerHour: 0.15, + gpuPricePerMonth: 108, + cpuPricePerMonth: 0.75, + ramPricePerGbPerMonth: 0.1, + storagePricePerGbPerMonth: 0.01, + vendor: 'nvidia', + }, + { + id: 71, + name: 'NVIDIA B200 192 GB', + tier: 'Ultra High 3', + shortName: 'b200', + multiplier: 15, + baseFnPoints: 500, + gpuPricePerHour: 0.15, + gpuPricePerMonth: 108, + cpuPricePerMonth: 0.75, + ramPricePerGbPerMonth: 0.1, + storagePricePerGbPerMonth: 0.01, + vendor: 'nvidia', + }, + { + id: 72, + name: 'NVIDIA A30', + tier: 'Medium 1', + shortName: 'a30', + multiplier: 1, + baseFnPoints: 500, + gpuPricePerHour: 0.15, + gpuPricePerMonth: 108, + cpuPricePerMonth: 0.75, + ramPricePerGbPerMonth: 0.1, + storagePricePerGbPerMonth: 0.01, + vendor: 'nvidia', + }, + { + id: 73, + name: 'NVIDIA A16', + tier: 'Medium 1', + shortName: 'a16', + multiplier: 1, + baseFnPoints: 500, + gpuPricePerHour: 0.15, + gpuPricePerMonth: 108, + cpuPricePerMonth: 0.75, + ramPricePerGbPerMonth: 0.1, + storagePricePerGbPerMonth: 0.01, + vendor: 'nvidia', + }, + { + id: 74, + name: 'NVIDIA RTX 6000', + tier: 'Medium 2', + shortName: 'rtx6000', + multiplier: 1.5, + baseFnPoints: 500, + gpuPricePerHour: 0.15, + gpuPricePerMonth: 108, + cpuPricePerMonth: 0.75, + ramPricePerGbPerMonth: 0.1, + storagePricePerGbPerMonth: 0.01, + vendor: 'nvidia', + }, + { + id: 75, + name: 'NVIDIA RTX 8000 Ada', + tier: 'High 1', + shortName: 'rtx8000-ada', + multiplier: 2, + baseFnPoints: 500, + gpuPricePerHour: 0.15, + gpuPricePerMonth: 108, cpuPricePerMonth: 0.75, ramPricePerGbPerMonth: 0.1, storagePricePerGbPerMonth: 0.01, vendor: 'nvidia', - disabled: false, }, { id: 76, @@ -967,8 +1088,5 @@ const GpuConfig = [ ramPricePerGbPerMonth: 0.1, storagePricePerGbPerMonth: 0.01, vendor: 'nvidia', - disabled: false, }, ]; - -export default GpuConfig;