Skip to content
Β 
Β 

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

sorokit-core

The foundational TypeScript engine and lightweight React hooks library for building seamless, reactive dApps on Stellar Soroban. πŸš€

sorokit-core wraps the low-level pieces of connecting a React frontend to a Soroban contract β€” wallet connection, transaction signing, invoke/submit/poll β€” behind a small set of ergonomic hooks, so you don't have to hand-roll this per project.

Install

npm install @sorokit/core

Usage

import { useWallet, useContract, useSorobanCall } from '@sorokit/core';

function MyDapp() {
  const { account, status, connect } = useWallet();

  const { contract, server } = useContract({
    contractId: 'CABCD...',
    networkConfig: {
      network: 'TESTNET',
      networkPassphrase: 'Test SDF Network ; September 2015',
      rpcUrl: 'https://soroban-testnet.stellar.org',
    },
  });

  const { call, status: callStatus, data } = useSorobanCall({
    contract,
    server,
    networkPassphrase: 'Test SDF Network ; September 2015',
    walletAdapter: /* the adapter returned by useWallet */,
    sourcePublicKey: account?.publicKey ?? '',
  });

  if (status !== 'connected') {
    return <button onClick={() => connect('freighter')}>Connect Freighter</button>;
  }

  return <button onClick={() => call('increment')}>Call increment()</button>;
}

Wallets

Wallet Status
Freighter βœ… Implemented
Albedo 🚧 Scaffolded, integration tracked
xBull 🚧 Scaffolded, integration tracked

Package layout

src/
  hooks/        useWallet, useContract, useSorobanCall
  wallets/      Per-wallet adapters behind a common WalletAdapter interface
  types.ts      Shared types used across hooks and wallets

Development

npm install
npm run build      # bundles with tsup
npm run typecheck
npm run test

Related packages

  • @sorokit/ui β€” Tailwind-styled components (connect button, tx status toast) built on top of these hooks.
  • sorokit-docs β€” Full docs and live sandboxes.

Contributing

Issues tagged for the Stellar Wave Program are labeled accordingly β€” see open issues for scoped, complexity-rated tasks if you'd like to contribute.

License

MIT

About

The foundational TypeScript engine and lightweight React hooks library for building seamless, reactive dApps on Stellar Soroban. πŸš€

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages