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.
npm install @sorokit/coreimport { 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>;
}| Wallet | Status |
|---|---|
| Freighter | β Implemented |
| Albedo | π§ Scaffolded, integration tracked |
| xBull | π§ Scaffolded, integration tracked |
src/
hooks/ useWallet, useContract, useSorobanCall
wallets/ Per-wallet adapters behind a common WalletAdapter interface
types.ts Shared types used across hooks and wallets
npm install
npm run build # bundles with tsup
npm run typecheck
npm run test@sorokit/uiβ Tailwind-styled components (connect button, tx status toast) built on top of these hooks.sorokit-docsβ Full docs and live sandboxes.
Issues tagged for the Stellar Wave Program are labeled accordingly β see open issues for scoped, complexity-rated tasks if you'd like to contribute.
MIT