Netrun JavaScript SDK
The Netrun SDK supports interactions between developers and validators within modules, and allows all parties to interact with the blockchain as necessary.
Installation
npm install @netrun/sdkOr using yarn:
yarn add @netrun/sdkQuick Start
import { Netrun } from '@netrun/sdk';
import { Connection, Keypair } from '@solana/web3.js';
// Initialize the SDK
const connection = new Connection('https://api.mainnet-beta.solana.com');
const netrun = new Netrun(connection);
// Connect your wallet
const wallet = Keypair.fromSecretKey(/* your secret key */);
await netrun.connect(wallet);
// Create a programmable asset
const asset = await netrun.createAsset({
name: 'My Dynamic Asset',
metadata: {
description: 'A programmable non-fungible asset',
attributes: [
{ trait_type: 'Level', value: 1 },
{ trait_type: 'Experience', value: 0 }
]
}
});
console.log('Asset created:', asset.address);Core Concepts
Assets
Assets are the fundamental building blocks of Netrun. Unlike traditional NFTs, Netrun assets can carry structured data, evolve over time, and interact with other on-chain elements.
Modules
Modules define how assets are created, validated, and interact within specific contexts. The SDK provides utilities for interacting with existing modules and creating new ones.
Validators
Validators ensure asset quality and standards compliance. The SDK includes tools for implementing validator logic and integrating with the validation network.
API Reference
For detailed API documentation, see the API Reference page.