Installation
Install the Package
bash
npm install @nosana/kitbash
yarn add @nosana/kitbash
pnpm add @nosana/kitRequirements
- 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 ClaimTargetClaim target enum for merkle distributor.
Determines which address receives the claimed tokens.ClaimTarget,
ClientConfig,
NosanaClient,
type Wallet = MessageSigner & TransactionSignerA 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.Wallet,
type Address = NominalType<"brand", "Address"> & NominalType<"stringEncoding", "base58"> & stringRepresents a string that validates as a Solana address or public key.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.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.