New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@dobprotocol/sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dobprotocol/sdk

Official DobProtocol SDK: pools, Stellar marketplace, widgets, projects (API-key client) and wallet-auth pool management

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

@dobprotocol/sdk

TypeScript client for DobProtocol. One package, two clients:

  • createClient({ apiKey }) — API-key client over /api/sdk/*: pool queries, Stellar marketplace (buy/sell/list), exit liquidity, widgets, projects. This is what DobLink (link.dobprotocol.com) uses. Keys: link.dobprotocol.com/dashboard/api-keys.
  • new DobProtocolClient({ network }) — wallet-auth client over the main /api/* routes: sign in with a Stellar wallet, create and operate pools. Documented at docs.dobprotocol.com.

Install

npm install @dobprotocol/sdk
# Freighter signing helpers (optional peer):
npm install @stellar/freighter-api

Source lives here (Dobprotocol/Doblink, packages/sdk); DobLink's Landing/ consumes it through a tsconfig path alias. Publishing: npm run publish:prod (see scripts/publish.sh).

Quick start — createClient

import { createClient } from "@dobprotocol/sdk";

const dob = createClient({
  apiKey: process.env.DOB_API_KEY!, // dob_sdk_...
  baseUrl: "https://home.dobprotocol.com", // optional, this is the default
});

// Read pools
const pools = await dob.pools.listPublic({ page: 1, pageSize: 20 });
const listings = await dob.stellar.getPoolListings(poolAddress, 9);

// Buy shares on Stellar (Stellar only — Base not yet supported)
import { signXdrWithFreighter } from "@dobprotocol/sdk/freighter";

const { xdr } = await dob.marketplace.prepareBuy({
  userPublicKey: "G...",
  contractId: poolAddress,
  sellerAddress: "G...",
  sharesAmount: 10,
  network_id: 9,
});
const signedXdr = await signXdrWithFreighter(xdr, { network_id: 9 });
const { transactionHash } = await dob.marketplace.submitBuy({ signedXdr, network_id: 9 });

Modules

  • dob.pools — list/search/get pools, creator pools, distributions
  • dob.stellar — balances, listings, stats, price history, full pool lifecycle (deploy/initialize/deposit/distribute/transfer/withdraw)
  • dob.marketplace — buy / list / cancel on Stellar
  • dob.exitLiquidity — LP offers, instant sell, add/remove liquidity
  • dob.widgets — DobLink widget CRUD + analytics + view tracking
  • dob.projects — project CRUD

Networks

import { NETWORKS, marketplaceAvailable } from "@dobprotocol/sdk";

NETWORKS.STELLAR_MAINNET.id; // 10
NETWORKS.BASE_MAINNET.id;    // 8453
marketplaceAvailable(8453);  // false — EVM marketplace not yet wired

Errors

import { DobError, DobAuthError, DobNotSupportedError } from "@dobprotocol/sdk";

All request failures throw DobError (or a subclass) with code, status, and the parsed response body on .details.

DobProtocolClient

import { DobProtocolClient } from "@dobprotocol/sdk";

const dob = new DobProtocolClient({ network: "mainnet" });
const pools = await dob.pools.getPublicPools({ limit: 5 });
const pool = await dob.pools.getPool("C...");

Full reference: docs.dobprotocol.com → DobLink → SDK reference. Where both clients define a type with the same name (MarketplaceStats, Project, Widget), the bare export is the DobProtocolClient shape and the createClient one is prefixed Link* (LinkMarketplaceStats, LinkProject, LinkWidget).

Keywords

dobprotocol

FAQs

Package last updated on 23 Sep 2026

Related posts