Skip to content

insoblok/inso-devkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InSo DevKit — Hackathon Starter Kit

Build on InSoBlok L2 in minutes, not days.

Scaffold a fully-working React + TypeScript dApp connected to InSoBlok L2 with a single command. Each template uses the @insoblok/sdk and comes pre-wired to the DevNet.

Quick Start

npx create-insoblok-app my-dapp --template score-widget
cd my-dapp
npm run dev

Open http://localhost:5173 — your dApp is running.

Available Templates

Template Description Key SDK Methods
score-widget Drop-in TasteScore trust badge component useTasteScore(), useSovereigntyProfile()
gated-access Show/hide content based on sovereignty tier useSovereigntyProfile(), SovereigntyTier
governance Quadratic voting proposals + vote UI useGovernanceStats()
zk-verify Privacy-preserving tier verification useZKStats(), useZKProof()
did-profile DID document resolver + SBT badges useDID(), useSBT()
restaking-dashboard AVS and operator monitoring useRestakingStats()

List Templates

npx create-insoblok-app --list

Local DevNet

For a fully local development environment with pre-funded accounts and seeded contract data:

cd inso-devnet && docker compose up
Service URL
Sequencer RPC http://localhost:8545
WebSocket ws://localhost:8546
Explorer http://localhost:3001
Grafana http://localhost:3000
Prometheus http://localhost:9090

Pre-funded Accounts

Address Balance Role
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 10,000 INSO Deployer
0x70997970C51812dc3A010C7d01b50e0d17dc79C8 10,000 INSO User 1
0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC 10,000 INSO User 2
0x90F79bf6EB2c4f870365E785982E1f101E93b906 100,000 INSO Validator

MetaMask Config

Field Value
Network Name InSo DevNet
RPC URL http://localhost:8545
Chain ID 42069
Currency INSO

SDK Reference

All templates use @insoblok/sdk. The SDK provides:

Direct Client

import { InSoBlokClient } from "@insoblok/sdk";

const client = new InSoBlokClient({
  rpcUrl: "http://localhost:8545",
  chainId: 42069,
});

const score = await client.getTasteScore("0xf39Fd...");
console.log(score.score); // 850

const profile = await client.getSovereigntyProfile("0xf39Fd...");
console.log(profile.tierName); // "Gold"

const did = await client.resolveDID("0xf39Fd...");
console.log(did.did); // "did:inso:0xf39Fd..."

React Hooks

import { useTasteScore, useSovereigntyProfile } from "@insoblok/sdk/react";

function MyComponent({ address }) {
  const { data: score } = useTasteScore(address);
  const { data: profile } = useSovereigntyProfile(address);

  return (
    <div>
      <p>Score: {score?.score}</p>
      <p>Tier: {profile?.tierName}</p>
    </div>
  );
}

All Available Hooks

Hook Returns
useTasteScore(address) { score, timestamp }
useSovereigntyProfile(address) { score, tier, tierName }
useDID(identifier) { did, controller, keyCount, serviceCount }
useSBT(address) { tokenId, tier, tierName } or null
useGovernanceStats() { proposalCount, proposals[], quorumBps }
useDAStats() { totalBlobs, committeeSize, members[] }
useRestakingStats() { avsCount, globalTotalRestaked, avsList[] }
useZKStats() { totalCommitments, totalReveals, totalVerifications }
useZKProof(address) { tier, isValid, expiresAt } or null
useCrossChainStats() { totalPortedScores }
usePortedScore(address) { tasteScore, tier, isValid } or null
useOrderingStats() { totalProofs, totalVerified }
useBlockOrdering(blockNum) { orderingRoot, txCount, verified } or null
useAIModelInfo() { version, weights, totalScored }
useAIScore(address) { score, features } or null

On-Chain Contracts (DevNet)

Contract Address
DIDRegistry 0xd6e1afe5cA8D00A2EFC01B89997abE2De47fdfAf
TasteScoreOracle 0x99dBE4AEa58E518C50a1c04aE9b48C9F6354612f
SovereigntyEngine 0x6F6f570F45833E249e27022648a26F4076F48f78
InSoSBT 0xCA8c8688914e0F7096c920146cd0Ad85cD7Ae8b9
QuadraticGovernance 0xB0f05d25e41FbC2b52013099ED9616f1206Ae21B
OrderingProof 0x5FeaeBfB4439F3516c74939A9D04e95AFE82C4ae
ZKSovereigntyProof 0x976fcd02f7C4773dd89C309fBF55D5923B4c98a1
CrossChainAttestation 0x19cEcCd6942ad38562Ee10bAfd44776ceB67e923
DIDAccountAbstraction 0xD42912755319665397FF090fBB63B1a31aE87Cee
SovereigntyRestaking 0xfcDB4564c18A9134002b9771816092C9693622e3
SovereignDA 0x927b167526bAbB9be047421db732C663a0b77B11
AIScoreOracle 0x32EEce76C2C2e8758584A83Ee2F522D4788feA0f

Connecting to Live Chain

To switch from DevNet to the live INSO L2 (Chain 90210), update the client config in src/main.tsx:

const client = new InSoBlokClient({
  rpcUrl: "https://rpc.insoblokai.io",
  chainId: 90210,
});

Project Structure

inso-devkit/
├── bin/
│   └── create-insoblok-app.js    # CLI scaffold tool
├── templates/
│   ├── score-widget/             # TasteScore badge
│   ├── gated-access/             # Tier-gated content
│   ├── governance/               # Quadratic voting
│   ├── zk-verify/                # ZK proof lifecycle
│   ├── did-profile/              # DID + SBT badges
│   └── restaking-dashboard/      # AVS monitoring
├── package.json
└── README.md

License

MIT

About

Hackathon starter kit for InSoBlok L2 — scaffold React + TypeScript dApps with 6 templates (TasteScore, Governance, DID, ZK Verify, Gated Access, Restaking)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors