revel8-snap
v1.0.1
Published
Real-time trust and sentiment insights for every transaction. Powered by Intuition
Readme
Revel8 Snap
A MetaMask Snap that displays real-time trust and reputation data from the Intuition knowledge graph during transaction signing.
What Does This Snap Do?
When you're about to send a transaction to an address, the Revel8 Snap shows you:
- Trust Signals — How many people have staked that the address is trustworthy (or not)
- Aliases — Community-assigned labels for the address
- Stake Amounts — The economic weight behind each trust signal
- Your Position — Whether you've already staked on this address
This helps you make informed decisions before interacting with unknown addresses.
Features
| Feature | Description |
|---------|-------------|
| Transaction Insights | onTransaction hook displays trust data before you sign |
| Trust Triple Display | Shows support/oppose positions on [address] has tag trustworthy |
| Alias Display | Shows community-assigned aliases for addresses |
| Multi-chain Support | Works on Intuition Testnet (chain ID: 13579) and Mainnet (chain ID: 1155) |
| Interactive UI | Links to create trust signals or view more data on the web |
Installation
From npm (once published)
# The snap will be installable directly through MetaMask
# Package name: revel8-snapFor Development
See the Development section below.
Permissions
This Snap requires the following permissions:
| Permission | Purpose |
|------------|---------|
| endowment:transaction-insight | Display insights before transaction signing |
| endowment:ethereum-provider | Access the connected wallet address |
| endowment:network-access | Query the Intuition GraphQL API |
| endowment:rpc | Communicate with dapps |
Development
Prerequisites
- MetaMask Flask (development version of MetaMask)
- Node.js ≥ 18.6.0
- Yarn
Setup
Clone the repository:
git clone https://github.com/revel8-io/intuition-snap.git cd intuition-snapInstall dependencies:
yarn installStart the development server:
yarn startOpen
http://localhost:8000and connect the Snap to MetaMask Flask
Chain Configuration
By default, the Snap connects to Intuition Testnet. To use mainnet:
yarn start:mainnetOr explicitly specify testnet:
yarn start:testnetTesting
Run the test suite:
yarn testTests use @metamask/snaps-jest for Snap-specific testing utilities.
Architecture
src/
├── index.tsx # Entry point, exports handlers
├── onTransaction.tsx # Transaction insight handler
├── onUserInput.tsx # User interaction handler
├── account.tsx # Account data fetching and rendering
├── queries.ts # GraphQL queries for Intuition API
├── config.ts # Chain configuration (testnet/mainnet)
├── types.ts # TypeScript type definitions
├── util.ts # Utility functions
├── components/ # JSX UI components
│ ├── Account.tsx # Main account display component
│ └── Footer/ # Footer links and actions
├── images/ # Snap icon assets
└── vendors/ # Vendor configuration (git-ignored)Configuration
Chain settings are defined in src/config.ts:
| Network | Chain ID | RPC URL | Currency |
|---------|----------|---------|----------|
| Testnet | 13579 | https://testnet.rpc.intuition.systems | tTRUST |
| Mainnet | 1155 | https://rpc.intuition.systems | TRUST |
Atoms Used
The Snap queries the Intuition knowledge graph using these predefined atoms:
| Atom | Purpose |
|------|---------|
| hasTag | Predicate for trust triples |
| trustworthy | The "trustworthy" characteristic |
| hasAlias | Predicate for alias relationships |
Building
# Build the snap bundle
yarn build
# Clean and rebuild
yarn build:cleanThe built bundle is output to dist/bundle.js.
Linting
# Run all linters
yarn lint
# Fix auto-fixable issues
yarn lint:fixContributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- All tests pass (
yarn test) - Code passes linting (
yarn lint) - No
console.*statements in production code
License
This project is dual-licensed under Apache 2.0 and MIT.
