@dcprotocol/client
Low-level runtime client used by DCP packages. For most agent developers, MCP through@dcprotocol/agent is the better public interface.
Install
npm install @dcprotocol/clientRequires Node.js 22.
When To Use It
- You are extending DCP runtime packages.
- You need a custom service integration and understand service identity/signatures.
- You need direct local or relay transport behavior.
When Not To Use It
If you are building a normal agent, use MCP. MCP gives the model tool descriptions, scope guidance, and safer defaults.
Runtime Notes
- Public wallet surface is Solana.
- Remote agents should normally use
@dcprotocol/agent install-service. - Use HTTP MCP from non-TypeScript runtimes.
Configuration
| Option | Use |
|---|---|
mode | auto, local, or relay. |
localUrl | Local vault URL. Default is http://127.0.0.1:8420. |
relayUrl | Relay URL. Default is wss://relay.dcp.1ly.store. |
vaultId | Required for relay mode. |
vaultHpkePublicKey | Required for relay encryption. |
serviceId | Required relay service identity. |
servicePrivateKey | Required relay signing key. |
Example
import { DcpClient } from "@dcprotocol/client";
const dcp = new DcpClient({
mode: "local",
localUrl: "http://127.0.0.1:8420",
agentName: "my_service",
});
const address = await dcp.getAddress("solana");