
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@dobprotocol/sdk
Advanced tools
Official SDK for integrating DobProtocol pools into external applications (Stellar blockchain)
Official SDK for integrating DobProtocol distribution pools into external applications. Stellar blockchain only.
npm install @dobprotocol/sdk
import { DobProtocolClient } from '@dobprotocol/sdk';
const dob = new DobProtocolClient({
network: 'mainnet', // or 'testnet'
});
// Query public pools (no auth needed)
const pools = await dob.pools.getPublicPools({ limit: 10 });
// Get pool metrics
const metrics = await dob.pools.getPool('CDXYZ...');
console.log(`APR: ${metrics.estimated_apr}%`);
console.log(`Participants: ${metrics.quantity_participants}`);
Authenticated operations (creating pools, widgets, projects) require wallet-based login:
// 1. Get challenge message
const { message } = await dob.auth.getNonce('GBDM...');
// 2. Sign with your wallet (Freighter example)
import { signMessage } from '@stellar/freighter-api';
const signature = await signMessage(message);
// 3. Sign in (token stored internally)
await dob.auth.signIn({
wallet: 'GBDM...',
signature,
provider: 'freighter',
});
The SDK handles the full 5-step Stellar pool creation flow. You only need to provide a signTransaction callback:
const result = await dob.pools.createPool({
userPublicKey: 'GBDM...',
poolConfig: {
name: 'Revenue Share Pool',
access: 'public',
joinMode: 'request', // 'request' | 'buy' | 'qr' | 'staking'
distributionType: 'trusted', // 'trusted' | 'business' | 'dam'
maxParticipants: 50,
estimatedApr: 12,
},
participants: [
{ address: 'GBDM...', percentage: 60 },
{ address: 'GDJTUK...', percentage: 40 },
],
signTransaction: async (xdr) => {
// Your wallet signs the XDR
return await signTransaction(xdr, {
networkPassphrase: dob.networkPassphrase,
});
},
onStep: (step) => console.log(step.message),
});
console.log('Pool address:', result.contractId);
For more control, use the individual methods:
// 1. Create record
const { contractRecordId } = await dob.pools.createContractRecord(pubKey);
// 2. Get deploy XDR
const { xdr: deployXdr } = await dob.pools.prepareDeploy(pubKey);
const signedDeploy = await wallet.signTransaction(deployXdr);
// 3. Submit deploy
const { contractId } = await dob.pools.submitDeploy(signedDeploy, contractRecordId);
// 4. Get init XDR
const { xdr: initXdr } = await dob.pools.prepareInitialize({
userPublicKey: pubKey,
contractId,
participants,
});
const signedInit = await wallet.signTransaction(initXdr);
// 5. Finalize
const { pool } = await dob.pools.finalize({
signedXdr: signedInit,
poolData,
contractRecordId,
participants,
});
const pool = await dob.pools.getPool('CDXYZ...');
// Financial
pool.estimated_apr // Estimated APR (%)
pool.real_apr // Actual APR based on distributions
pool.total_distributed // Total amount distributed
pool.last_distribution // Last distribution timestamp
// Participants
pool.quantity_participants // Current count
pool.max_participants // Maximum allowed
pool.remaining_participation // Remaining capacity (%)
// Schedule
pool.distribution_period // 'Daily', 'Weekly', 'Monthly', etc.
pool.next_distribution // Next distribution timestamp
pool.distribution_dates // Full schedule
// Performance (buy pools)
pool.performance_metrics?.performance_status // 'on_track' | 'overperforming' | 'underperforming'
pool.performance_metrics?.distribution_progress // Completion %
pool.performance_metrics?.historical_apr // Based on actual pace
// Pool listings
const listings = await dob.pools.getPoolListings('CDXYZ...');
const stats = await dob.pools.getMarketplaceStats('CDXYZ...');
const history = await dob.pools.getPriceHistory('CDXYZ...');
// All listings
const allListings = await dob.pools.getAllListings();
All pool actions follow a prepare/sign/submit pattern:
// Deposit tokens
const { xdr } = await dob.pools.prepareDepositToken({
userPublicKey: pubKey,
contractId: poolAddress,
tokenAddress: 'CDU3Q...',
amount: '1000000000', // in stroops
});
const signed = await wallet.signTransaction(xdr);
await dob.pools.submitDepositToken(signed);
// Distribute (admin only)
// Transfer shares
// Withdraw allocation
// ... same prepare/sign/submit pattern
// Create a project
const project = await dob.projects.create({
name: 'My Project',
description: 'Revenue sharing for contributors',
owner_wallet: 'GBDM...',
pools: ['CDXYZ...'],
});
// Query
const projects = await dob.projects.getProjectsByOwner('GBDM...');
const featured = await dob.projects.getFeaturedProjects();
// Create a widget
const widget = await dob.widgets.create({
name: 'Homepage Widget',
pool_address: 'CDXYZ...',
theme: 'dark',
primary_color: '#FF6B00',
button_text: 'Join Pool',
});
// Get widget data (public - for embedding)
const data = await dob.widgets.get(widget.widget_id);
// Track views (call from your embed page)
await dob.widgets.recordView(widget.widget_id, 'mysite.com');
// Analytics
const analytics = await dob.widgets.getAnalytics(widget.widget_id, 30);
console.log(`Views: ${analytics.total_views}`);
import {
compressPoolData,
expandPoolData,
generateTicker,
isValidStellarAddress,
} from '@dobprotocol/sdk';
// Compress/expand pool data
const compressed = compressPoolData({ name: 'My Pool', ... });
const expanded = expandPoolData(compressed);
// Generate ticker from name
generateTicker('My Revenue Pool'); // 'MRP'
// Validate Stellar address
isValidStellarAddress('GBDM...'); // true
| Network | ID | Network Passphrase |
|---|---|---|
| Testnet | 9 | Test SDF Network ; September 2015 |
| Mainnet | 10 | Public Global Stellar Network ; September 2015 |
Access via the client:
dob.networkId; // 9 or 10
dob.networkPassphrase; // For wallet signing
import {
DobProtocolError,
AuthenticationError,
TransactionError,
NotFoundError,
} from '@dobprotocol/sdk';
try {
await dob.pools.getPool('invalid');
} catch (err) {
if (err instanceof NotFoundError) {
console.log('Pool not found');
} else if (err instanceof AuthenticationError) {
console.log('Need to authenticate');
} else if (err instanceof TransactionError) {
console.log('Transaction failed:', err.details);
}
}
fetch)MIT
FAQs
Official DobProtocol SDK: pools, Stellar marketplace, widgets, projects (API-key client) and wallet-auth pool management
The npm package @dobprotocol/sdk receives a total of 418 weekly downloads. As such, @dobprotocol/sdk popularity was classified as not popular.
We found that @dobprotocol/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.