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.13.7
@nosana/kit
Namespaces
| Namespace | Description |
|---|---|
| JobsClient | - |
| MerkleDistributorClient | - |
| 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 |
| 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 |
| 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/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 |
|---|---|
| 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 |
| Port | 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 |
| 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 |
| 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 |
| 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 | - |
| validateJobDefinition | - |
@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 | - |
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 |
|---|---|
| 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 |
Type Aliases
| Type Alias | Description |
|---|---|
| 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. |
| 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. |
| PriorityFeeStrategy | Strategy presets for dynamic priority fee (maps to percentiles: low=25, medium=50, high=75). |
| SshProxyMode | - |
| SshPublicKeyParseErrorCode | - |
Variables
| Variable | Description |
|---|---|
| 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.