Welcome to the Nosana Kit SDK Reference! This documentation is automatically generated from the source code using TypeDoc.
Need Help?
- Check out our Getting Started guide.
- Learn about key concepts in our Core Concept guides.
- Explore code examples.
Overview
@nosana/kit v2.24.3
@nosana/kit
Namespaces
| Namespace | Description |
|---|---|
| JobsClient | - |
| MerkleDistributorClient | - |
| PoolsClient | - |
| RewardsClient | - |
| StakingClient | - |
Enumerations
| Enumeration | Description |
|---|---|
| ClaimTarget | Claim target enum for merkle distributor. Determines which address receives the claimed tokens. |
| JobState | - |
| MarketQueueType | - |
Classes
| Class | Description |
|---|---|
| ClaimStatusNotFoundError | Error thrown when a claim status account is not found |
| Logger | - |
| NosanaError | - |
Interfaces
| Interface | Description |
|---|---|
| APIConfig | - |
| AuthorizationConfig | - |
| BalanceInfo | - |
| BatchTransactionResult | Result of sending a single transaction within a batch. |
| ClientConfig | - |
| JobsBatchTransactionResult | A BatchTransactionResult enriched with the decoded jobs instructions it contained. decoded[i] corresponds to instructions[i] and is undefined for any instruction that is not a recognised jobs instruction. |
| JobsProgram | Jobs program interface |
| LoggerOptions | - |
| MerkleDistributorProgram | Merkle distributor program interface |
| NosanaClient | The Nosana client interface. Contains all the services and programs needed to interact with the Nosana network. |
| PackInstructionsOptions | Options for packInstructions. |
| PartialClientConfig | - |
| ProgramConfig | - |
| ProgramDeps | Dependencies for program services |
| RewardsProgram | Rewards program interface: the staking rewards a wallet's stake earns. |
| SignedBatchTransaction | One packed, signed, but un-sent transaction produced by SolanaService.buildAndSignBatch. The blob can be persisted and broadcast later by a separate process, which is what enables persist-before-send idempotency (a crash mid-send can replay the identical signed transaction, and the chain dedups it by signature). |
| SignedJobsBatchTransaction | A SignedBatchTransaction enriched with the same decoded view as JobsBatchTransactionResult, so the per-bucket job/run addresses are available without decoding the raw instructions. Returned by JobsProgram.signBatch. |
| SolanaConfig | - |
| SolanaService | Solana service interface |
| SolanaServiceDeps | Dependencies for SolanaService |
| SolBalanceInfo | - |
| StakeProgram | Stake program interface |
| SubscriptionOptions | How a subscription is held: until abortSignal aborts, at commitment. |
| TokenAccount | - |
| TokenAccountWithBalance | - |
| TokenBalanceInfo | - |
| TokenService | TokenService interface |
| TokenServiceConfig | Config for TokenService |
| TokenServiceDeps | Dependencies for TokenService |
Type Aliases
Functions
Variables
| Variable | Description |
|---|---|
| DEFAULT_CONFIGS | - |
| ErrorCodes | - |
| JOBS_COMPUTE_UNITS | Measured compute-unit cost per jobs instruction, keyed by the operation name. Each value is a conservative upper bound that includes the safety margin, suitable for use directly as a SetComputeUnitLimit. |
| MAX_COMPUTE_UNITS | Maximum compute units a single Solana transaction may consume. |
| MonitorEventType | Monitor event type constants |
| TRANSACTION_SIZE_LIMIT | Maximum size, in bytes, of a serialized Solana transaction (the packet MTU limit). |
@nosana/authorization
Interfaces
| Interface | Description |
|---|---|
| NosanaAuthorization | - |
Type Aliases
| Type Alias | Description |
|---|---|
| AuthorizationStore | - |
| GenerateHeaderOptions | - |
| GenerateOptions | - |
| SignerOrKey | - |
| SignMessageFn | - |
| ValidateOptions | - |
Functions
| Function | Description |
|---|---|
| createNosanaAuthorization | - |
| validate | - |
| validateHeaders | - |
@nosana/connect
Interfaces
| Interface | Description |
|---|---|
| BrowserConnect | - |
| ServerConnect | - |
Functions
| Function | Description |
|---|---|
| createBrowserConnect | "Connect with Nosana" for browser apps. Pass the session (or its config) as the client's connect option to authenticate client.api.* calls: createNosanaClient(network, { connect }). |
| createConnect | Create a "Connect with Nosana" session, picking browser (no secret) or server (with secret) from your config. Pass it as the client's connect option: createNosanaClient(network, { connect }). |
| createServerConnect | "Connect with Nosana" for apps with a backend (confidential clients). Run the sign-in on your server, then pass the session to the client's connect option or its token via api.getToken. |
| memoryStore | - |
| sessionStorageStore | The default sessionStorage-backed store for a browser Connect session (PKCE state + tokens). Pass a custom store to override where they're kept. |
@nosana/ipfs
Interfaces
| Interface | Description |
|---|---|
| IPFSConfig | - |
Type Aliases
| Type Alias | Description |
|---|---|
| FetchClient | - |
| GetOverride | - |
| PostOverride | - |
Functions
| Function | Description |
|---|---|
| createIpfsClient | - |
| ipfsHashToSolBytesArray | - |
| solBytesArrayToIpfsHash | - |
@nosana/endpoints
| Variable | Description |
|---|---|
| createHash | - |
| getExposeIdHash | - |
| getExposePorts | - |
| getJobExposedServices | - |
| getJobExposeIdHash | - |
| isOperator | - |
| isOpExposed | - |
| isSpreadMarker | - |
@nosana/api
ApiConfig
Renames and re-exports CreateNosanaApiOptions
@nosana/types
Interfaces
| Interface | Description |
|---|---|
| ContainerRun | Job definition types for creating Nosana jobs |
| JobExposeSecrets | Job definition types for creating Nosana jobs |
Type Aliases
| Type Alias | Description |
|---|---|
| Alias | Job definition types for creating Nosana jobs |
| Aliases | Job definition types for creating Nosana jobs |
| CMDArray | Job definition types for creating Nosana jobs |
| CMDString | Job definition types for creating Nosana jobs |
| DeploymentId | Job definition types for creating Nosana jobs |
| DeploymentRaw | Job definition types for creating Nosana jobs |
| DeploymentStatus | - |
| DeploymentStrategy | - |
| DockerAuth | Job definition types for creating Nosana jobs |
| EndpointSecret | Job definition types for creating Nosana jobs |
| EndpointStatus | Job definition types for creating Nosana jobs |
| Env | Job definition types for creating Nosana jobs |
| Event | Job definition types for creating Nosana jobs |
| Execution | Job definition types for creating Nosana jobs |
| Expose | Job definition types for creating Nosana jobs |
| ExposeBase | Job definition types for creating Nosana jobs |
| ExposedPort | Job definition types for creating Nosana jobs |
| Flow | Job definition types for creating Nosana jobs |
| FlowSecrets | Job definition types for creating Nosana jobs |
| FlowState | Job definition types for creating Nosana jobs |
| GPU | Job definition types for creating Nosana jobs |
| HealthCheck | Job definition types for creating Nosana jobs |
| HealthCheckType | - |
| HFResource | Job definition types for creating Nosana jobs |
| HttpHealthCheck | Job definition types for creating Nosana jobs |
| Image | Job definition types for creating Nosana jobs |
| JobDefinition | Job definition types for creating Nosana jobs |
| LiteralString | Job definition types for creating Nosana jobs |
| Log | Job definition types for creating Nosana jobs |
| Logistic | Job definition types for creating Nosana jobs |
| LogTypeTuple | Job definition types for creating Nosana jobs |
| MarketQueue | - |
| Meta | Job definition types for creating Nosana jobs |
| NosanaNetwork | - |
| OllamaResource | Job definition types for creating Nosana jobs |
| Operation | Job definition types for creating Nosana jobs |
| OperationArgsMap | Job definition types for creating Nosana jobs |
| OperationResult | Job definition types for creating Nosana jobs |
| OperationResults | Job definition types for creating Nosana jobs |
| OperationType | Job definition types for creating Nosana jobs |
| Ops | Job definition types for creating Nosana jobs |
| OpState | Job definition types for creating Nosana jobs |
| OpStateError | Job definition types for creating Nosana jobs |
| Output | Job definition types for creating Nosana jobs |
| Port | Job definition types for creating Nosana jobs |
| PortRangeString | Job definition types for creating Nosana jobs |
| Private | Job definition types for creating Nosana jobs |
| RemoveIfEmptyMarker | Job definition types for creating Nosana jobs |
| RequiredResource | Job definition types for creating Nosana jobs |
| RequiredVRAM | Job definition types for creating Nosana jobs |
| Resource | Job definition types for creating Nosana jobs |
| ResourceBase | Job definition types for creating Nosana jobs |
| Resources | Job definition types for creating Nosana jobs |
| ResourceType | Job definition types for creating Nosana jobs |
| RestartPolicy | Job definition types for creating Nosana jobs |
| RestartPolicy | Job definition types for creating Nosana jobs |
| Revision | Job definition types for creating Nosana jobs |
| S3Auth | Job definition types for creating Nosana jobs |
| S3Base | Job definition types for creating Nosana jobs |
| S3Resource | Job definition types for creating Nosana jobs |
| S3Unsecure | Job definition types for creating Nosana jobs |
| S3WithBucket | Job definition types for creating Nosana jobs |
| S3WithBuckets | Job definition types for creating Nosana jobs |
| ServiceType | - |
| SpreadMarker | Job definition types for creating Nosana jobs |
| StdOption | Job definition types for creating Nosana jobs |
| Task | Job definition types for creating Nosana jobs |
| TrustedExecutionEnv | - |
| TypesJob | Job definition types for creating Nosana jobs |
| TypesMarket | Job definition types for creating Nosana jobs |
| TypesRun | Job definition types for creating Nosana jobs |
| UniqueExposedPorts | Job definition types for creating Nosana jobs |
| UniqueLogTypeTag | Job definition types for creating Nosana jobs |
| Variables | Job definition types for creating Nosana jobs |
| VaultRaw | Job definition types for creating Nosana jobs |
| Volume | Job definition types for creating Nosana jobs |
| webhooks | Job definition types for creating Nosana jobs |
| WebSocketHealthCheck | Job definition types for creating Nosana jobs |
| WorkDir | Job definition types for creating Nosana jobs |
Variables
| Variable | Description |
|---|---|
| DeploymentStatus | - |
| DeploymentStrategy | - |
| HealthCheckType | - |
| jobSchemas | - |
| LogisticType | Logistic type for job definitions. - api - we receive and send via an endpoint - api-listen - we create an endpoint to listen for incoming requests |
| MarketQueue | - |
| NosanaNetwork | - |
| ResourceTypeEnum | - |
| ServiceType | - |
| StdOptions | - |
| TrustedExecutionEnv | - |
| validateJobDefinition | - |
| validateVmRunArgs | - |
@solana/kit
Type Aliases
| Type Alias | Description |
|---|---|
| Address | Represents a string that validates as a Solana address or public key. |
Functions
| Function | Description |
|---|---|
| address | - |
| createKeyPairFromBytes | - |
| createKeyPairSignerFromBytes | - |
| createSignerFromKeyPair | - |
| generateKeyPairSigner | - |
| isTransactionPartialSigner | - |
Classes
| Class | Description |
|---|---|
| NosanaConnectClient | Stateless OAuth 2.1 / OIDC client. Environment-agnostic: it constructs authorize URLs and performs token requests, but owns no storage and triggers no redirects — the browser wrapper (createBrowserConnect) layers those on top. |
Functions
| Function | Description |
|---|---|
| buildTerminalAuthorizationMessage | The exact text the node verifies; line order is part of the contract. |
| bytesToBase64 | - |
| createSshCommand | Describes the ssh invocation that reaches a job through its node's proxy. |
| formatSshCommand | Joins an executable and its arguments into a POSIX shell command that can be pasted as is. |
| generateSshKeyPair | Generates an unencrypted, OpenSSH-formatted Ed25519 key pair. |
| getSshKeyIdentity | A key's identity for deduplication and revocation: its algorithm and blob, with the comment dropped. Two lines that differ only by comment name the same key, so both the node and the client collapse them to one. |
| getSshPublicKeys | The SSH public keys a job definition grants access to, ignoring blank entries. |
| isSafeTerminalOperation | An operation selector is interpolated into the signed message, so it must stay one plain token. |
| isValidSshPublicKey | Whether value is one OpenSSH public-key line: a supported algorithm, a base64 blob that names the same algorithm, and at most one comment word. |
| parseSshPublicKeys | Parses one key per line. Blank lines are skipped and duplicates collapsed; every problem is reported rather than thrown so callers can show them all. |
| parseTerminalAuthorizationMessage | Parses a terminal authorization message back into its fields. Enforces the header and that job, node and expiresAt are present; the caller checks the values and the signature. Duplicate or malformed lines are rejected. |
| requireFutureSshExpiry | Validates one SSH grant expiry the way the node's sidecar contract needs it: a strict ISO 8601 UTC timestamp, in the future, that JavaScript does not silently normalize (so 2025-02-30 is rejected rather than rolled forward). Returns the canonical ISO string, or throws. |
| requireSshPublicKey | Returns the trimmed key, or throws when value is not exactly one valid OpenSSH public key. |
| requireSshPublicKeySet | Validates a key set the way the node does, throwing with every problem found. |
| sshHostname | The hostname of one operation's SSH sidecar, as published through the node's proxy. |
| withSshPublicKeys | A copy of definition granting exactly publicKeys; an empty list drops the ssh block. |
Interfaces
| Interface | Description |
|---|---|
| AuthorizationRequest | The pieces produced when starting an authorization request. |
| CallbackResult | The result of completing a login callback. |
| ConnectConfig | OAuth 2.1 / OIDC configuration for a Nosana Connect client. |
| ConnectSession | The minimal contract the SDK needs from a Connect session: a source of the current access token. The browser session (createBrowserConnect) satisfies it, as does any token source you provide, so either can drive an @nosana/kit client's API auth. |
| ConnectStore | Minimal key/value store for PKCE state and token persistence. |
| ConnectTokenResponse | Token endpoint response (RFC 6749 §5.1 + OIDC id_token). |
| DecodedJobsInstruction | A decoded jobs instruction: its name plus its labelled accounts and arguments. |
| GenerateSshKeyPairOptions | - |
| NosanaApiError | Error shape every kit request rejects with, once it has reached the server and come back with a status. statusCode is guaranteed (it comes from the response), so consumers can branch on it without casting — narrow with isNosanaApiError. |
| ParsedTerminalAuthorizationMessage | - |
| PriorityFeesConfigDynamic | Dynamic priority fee: fetch recent prioritization fees from the RPC and use a percentile or strategy. Optional accountAddresses (writable accounts) can be passed for more accurate fees; defaults to SOL + USDC mints. |
| PriorityFeesConfigFixed | Fixed priority fee: use the same microLamports (per compute unit) for every transaction. |
| SshCommandOptions | How the local ssh client should reach the node's proxy. |
| SshConnectionDescriptor | - |
| SshCryptoProvider | A source of cryptographically secure random bytes, such as Web Crypto. |
| SshJobTarget | The job an SSH command reaches, and the node that runs it. |
| SshKeyPair | - |
| SshPublicKeyParseError | - |
| SshPublicKeyParseResult | - |
| TerminalAuthorizationMessageOptions | - |
| Vault | Vault interface for managing deployment funding. NOTE: Implementation will be provided by @nosana/kit |
| VmRunArgs | Arguments for a vm/run / cvm/run hypervisor operation — a declarative façade over the VM orchestrator that mirrors container/run (the QEMU knobs are hidden). cvm/run is the confidential (SEV-SNP) variant and shares this exact arg shape: the operation key selects confidentiality, not an argument. |
Type Aliases
| Type Alias | Description |
|---|---|
| ApiKeyAuth | A static API key / access token, or a provider that yields one per request. |
| ConnectFactoryConfig | Config accepted by createConnect: a Connect config plus an optional store. A clientSecret selects the server flow; omitting it selects browser. |
| DeploymentRequirements | Node requirements: metric key → required value. A number is a minimum, a string or boolean must match exactly, and a list is any of its values, e.g. { name: ['NVIDIA GeForce RTX 4090', 'NVIDIA GeForce RTX 5090'], ram_gb: 64 }. |
| DeploymentSsh | SSH key management for a deployment's jobs, under deployment.ssh. |
| DeploymentStreamEvent | One frame of GET /deployments/{deployment}/stream, discriminated by type. |
| DeploymentStreamEventOf | One kind of frame, selected from the union by its type. |
| DeploymentStreamHandlers | What a caller wants to hear about while streaming a deployment. |
| LoginRedirectOptions | Options for BrowserConnect.loginWithRedirect. |
| MarketSettings | The settings of a protected market: only holders of the projectAccessKey NFT collection may post jobs |
| NosanaAvailableNodes | Queued hosts meeting the requirements right now, and their price range. |
| NosanaAvailableNodesRequest | The requirements to check queued hosts against; none means every host. |
| NosanaGpuModels | GPU models on the network: VRAM, host counts and the markets they serve. |
| NosanaJobsApi | Authenticated: get returns the job's current state merged with its node job API, so (await jobs.get(id)).ssh.add(key) works. Until a node picks the job up, the node methods are present but fail saying so. |
| NosanaRequirementOptions | Each metric's type, match rule and the values hosts report, with counts. |
| NosanaRequirementOptionsRequest | Which requirement metrics to describe, scoped to hosts meeting requirements. |
| NosanaRequirements | Metric key → required value. A number is a minimum (ram_gb: 64 means at least 64 GB); a string or boolean must match exactly (country: "NL"); a list is any of its values. The GPU model is the name key, e.g. { name: ["NVIDIA GeForce RTX 4090", "NVIDIA GeForce RTX 5090"] }. |
| NosanaRequirementValue | One requirement's value: a scalar, or a list of them meaning any of. |
| PriorityFeeStrategy | Strategy presets for dynamic priority fee (maps to percentiles: low=25, medium=50, high=75). |
| ServerLoginOptions | Options for ServerConnect.getLoginUrl. |
| SshProxyMode | - |
| SshPublicKeyParseErrorCode | - |
| TokenProvider | A dynamic bearer-token source, resolved on every request — e.g. an OAuth session from @nosana/connect that transparently refreshes. Returns the current access token. |
Variables
| Variable | Description |
|---|---|
| DEFAULT_ISSUER | Default Nosana production issuer. Override via ConnectConfig.issuer (e.g. the devnet host during development). |
| IdempotencyCode | Machine-readable control codes the API returns (as a 409 with the code in the body, lifted onto NosanaApiError.code) for an idempotent request. |
| MAX_SSH_PUBLIC_KEY_LINE_LENGTH | - |
| MAX_SSH_PUBLIC_KEYS | - |
| MAX_SSH_PUBLIC_KEYS_BYTES | - |
| SSH_ED25519 | - |
| SSH_PUBLIC_KEY_ALGORITHMS | - |
| SSH_USERNAME | The only user name a job's SSH sidecar accepts; the hostname names the job. |
| TERMINAL_AUTHORIZATION_AUDIENCE | - |
| TERMINAL_AUTHORIZATION_MAX_TTL_MS | - |
| TERMINAL_AUTHORIZATION_MESSAGE_HEADER | The wire contract for a signed, short-lived web-terminal authorization: the exact message the client signs and the node verifies. Both sides import this module so the format, field order and limits cannot drift between them. |
Note
This documentation is automatically generated from the source code using TypeDoc. If you find any issues or have suggestions, please open an issue.