|
| 1 | +# ts-governance |
| 2 | + |
| 3 | +DAO governance, proposals, voting, delegation, and treasury management for Solana. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +bun add ts-governance |
| 9 | +# or |
| 10 | +npm install ts-governance |
| 11 | +``` |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +```ts |
| 16 | +import { dao, proposals, voting, treasury, delegation, createVotes } from 'ts-governance' |
| 17 | + |
| 18 | +// Create a DAO |
| 19 | +const myDao = await dao.create({ name: 'My DAO', ... }) |
| 20 | + |
| 21 | +// Create and manage proposals |
| 22 | +const proposal = await proposals.create({ title: 'Fund Project X', ... }) |
| 23 | + |
| 24 | +// Cast votes |
| 25 | +const votes = createVotes({ ... }) |
| 26 | +await voting.castVote(proposal.id, { choice: 'yes' }) |
| 27 | + |
| 28 | +// Treasury operations |
| 29 | +await treasury.deposit({ amount: 1000, mint: tokenMint }) |
| 30 | + |
| 31 | +// Delegation |
| 32 | +await delegation.delegate({ to: delegateAddress, amount: 500 }) |
| 33 | +``` |
| 34 | + |
| 35 | +You can also import specific modules directly: |
| 36 | + |
| 37 | +```ts |
| 38 | +import { create } from 'ts-governance/dao' |
| 39 | +import { castVote } from 'ts-governance/voting' |
| 40 | +import { deposit } from 'ts-governance/treasury' |
| 41 | +``` |
| 42 | + |
| 43 | +## Features |
| 44 | + |
| 45 | +- DAO creation and management |
| 46 | +- Proposal lifecycle (create, vote, execute, cancel) |
| 47 | +- On-chain voting with multiple strategies |
| 48 | +- Token delegation |
| 49 | +- Treasury management (deposits, withdrawals, transfers) |
| 50 | +- Solana program integration via `@solana/web3.js` and `@solana/spl-token` |
| 51 | +- CLI support via the `governance` binary |
| 52 | + |
| 53 | +## License |
| 54 | + |
| 55 | +MIT |
0 commit comments