alphiconnect
v1.1.1
Published
AlphiConnect - Developer Infrastructure Toolkit for Alephium
Downloads
10
Readme
AlphiConnect
AlphiConnect is a developer infrastructure and indexing toolkit for the Alephium blockchain. It provides standardized SDKs, APIs, adapters, and off-chain indexing utilities that simplify dApp development and advanced blockchain research across:
- Wallets
- Addresses
- Shards
- Mempool
- Tokens
- DeFi protocols
By abstracting low-level blockchain operations, AlphiConnect accelerates developer workflows and improves composability inside the Alephium ecosystem.
Key Features
Wallet Management
- Create new wallets programmatically
- Retrieve wallet addresses
- Manage multiple wallets safely
Address Indexing
- Query all addresses on your node
- Get wallet-specific addresses
Mempool API (New)
- Access Alephium mempool transactions
- Normalized response structure
- Shard-aware mempool listing
- Base for building bots, explorers, and real-time dashboards
Developer SDK
- Type-safe, modular, and shard-safe
- Works seamlessly with Alephium nodes and backend services
Indexing & Analytics
- Foundation for event indexers, NFT indexers, shard monitors, dashboards, and DeFi analytics layers
Installation
npm install alphiconnect
# or
yarn add alphiconnectQuick Start
1. Initialize the SDK
import { AlphiConnect } from "alphiconnect";
const alphi = new AlphiConnect({
baseUrl: "https://ben-sturdier-maddie.ngrok-free.dev"
});Wallet API
Create a Wallet
const wallet = await alphi.wallets.create({
password: "my-secret-password",
walletName: "wallet-super-name",
});
console.log("New Wallet:", wallet);Retrieve Wallet Addresses
const addresses = await alphi.wallets.getAddresses("wallet-super-name");
console.log("Wallet Addresses:", addresses);Address API
List All Addresses
const allAddresses = await alphi.addresses.list();
console.log("All Addresses:", allAddresses);Mempool API (New)
Query all pending mempool transactions, normalized and shard-aware.
1. Using AlphiConnect
const pendingTx = await alphi.mempool.list();
console.log(pendingTx);2. Using the low-level AlphiClient (direct node access)
import { AlphiClient } from "alphiconnect";
const client = new AlphiClient("http://127.0.0.1:22973");
const mempool = await client.mempool();
console.log(mempool);Returned Structure
Each transaction contains:
txIdfromGroup/toGroup- Gas info
- Inputs (UTXOs)
- Outputs (ALPH & Tokens)
- Signatures
- Timestamp (
seenAt)
This is ideal for bots, explorers, and mempool indexers.
Full Example Script
import { AlphiConnect } from "alphiconnect";
async function main() {
const alphi = new AlphiConnect({
baseUrl: "http://localhost:22973",
});
const mempool = await alphi.mempool.list();
console.log("Pending Tx:", mempool.length);
const allAddresses = await alphi.addresses.list();
console.log("Addresses:", allAddresses);
}
main();Available Types (TypeScript)
CreateWalletInputWalletAddressWalletAddressesResponseAddressInfoAddressListResponseMempoolTransactionMempoolGroupUnsignedTxMempoolInputMempoolOutput
CLI Usage (Optional)
npm run build
# Using ts-node
ts-node scripts/example.ts
# Or compiled JS
node dist/scripts/example.jsContributing
AlphiConnect will be fully open-source under the MIT License after the first development phase.
Contributions will be welcome for:
- Indexers (tokens, NFTs, DeFi)
- Wallet modules
- Documentation
- Analytics dashboards
- Event streaming modules
License
MIT License Free to use, modify, and distribute.
