Skip to content

Installation ​

Install the Package ​

bash
npm install @nosana/kit
bash
yarn add @nosana/kit
bash
pnpm add @nosana/kit

Requirements ​

  • Node.js >= 20.18.0
  • TypeScript >= 5.3.0 (for development)

INFO

The SDK is fully typed with TypeScript. While TypeScript is not required at runtime, we highly recommend using it for the best development experience.

TypeScript Support ​

The SDK is written in TypeScript and provides complete type definitions. All types are exported for use in your applications.

ts
import type {
  
type Job = Omit<ConvertTypesForDb<JobAccountArgs>, "state"> & {
    address: Address;
    state: JobState;
}
Job
,
type Run = ConvertTypesForDb<RunAccountArgs> & {
    address: Address;
}
Run
,
type Market = Omit<ConvertTypesForDb<MarketAccountArgs>, "queueType"> & {
    address: Address;
    queueType: MarketQueueType;
}
Market
,
enum JobStateJobState, enum MarketQueueTypeMarketQueueType,
type Stake = ConvertTypesForDb<StakeAccountArgs> & {
    address: Address;
}
Stake
,
type MerkleDistributor = ConvertTypesForDb<MerkleDistributorArgs> & {
    address: Address;
}
MerkleDistributor
,
type ClaimStatus = ConvertTypesForDb<ClaimStatusArgs> & {
    address: Address;
}
ClaimStatus
,
enum ClaimTarget
Claim target enum for merkle distributor. Determines which address receives the claimed tokens.
@group@nosana/kit
ClaimTarget
,
ClientConfig, NosanaClient, type Wallet = MessageSigner & TransactionSigner
A wallet that can sign both messages and transactions. This is a combination of MessageSigner and TransactionSigner, allowing the wallet to be used for both message signing and transaction signing.
@group@nosana/kit
Wallet
,
type Address = NominalType<"brand", "Address"> & NominalType<"stringEncoding", "base58"> & string
Represents a string that validates as a Solana address or public key.
@group@solana/kit
Address
,
} from '@nosana/kit'; // The `address` utility is also available import { function address<TAddress extends string = string>(putativeAddress: TAddress): Address<TAddress>
Combines _asserting_ that a string is an address with _coercing_ it to the {@link Address } type. It's most useful with untrusted input.
@example```ts import { address } from '@solana/addresses'; await transfer(address(fromAddress), address(toAddress), lamports(100000n)); ``` > [!TIP] > When starting from a known-good address as a string, it's more efficient to typecast it rather than to use the {@link address} helper, because the helper unconditionally performs validation on its input. > > ```ts > import { Address } from '@solana/addresses'; > > const MEMO_PROGRAM_ADDRESS = > 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr' as Address<'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'>; > ```
address
} from '@nosana/kit';

TIP

All exported types are documented in the SDK Reference. Hover over types in your IDE or click through to see detailed documentation.