🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@agentpay-dev/core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentpay-dev/core

Core Fiber Network RPC client and protocol types for AgentPay �?BTC-native Agent payment protocol

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@agentpay-dev/core

Core library for the AgentPay BTC-native Agent payment protocol

Features

  • Fiber RPC Client �?Full JSON-RPC client for CKB Fiber Network (Channel, Invoice, Payment, Cch, Peer, Info, Graph modules)
  • Production-hardened �?Request timeouts, retry with exponential backoff, input validation, structured error types
  • Asset Registry �?CKB native + UDT assets (USDT, USDC, USDI, WBTC)
  • Agent Identity �?Pubkey-based identity, payload signing/verification
  • Structured Logger �?Zero-dependency pino-compatible JSON logger
  • TypeScript �?Full type definitions for all Fiber Network types

Install

npm install @agentpay-dev/core

Usage

import { FiberRpcClient, createLogger, TESTNET_ASSETS } from '@agentpay-dev/core';

// Fiber RPC
const fiber = new FiberRpcClient({
  rpcUrl: 'http://127.0.0.1:8227',
  timeoutMs: 30000,
  maxRetries: 2,
});

const info = await fiber.nodeInfo();
const { invoice_address } = await fiber.newInvoice({
  amount: '100000000',
  currency: 'Fibt',
});

// Logger
const log = createLogger({ name: 'my-agent', version: '1.0.0' });
log.info({ invoice: invoice_address }, 'Invoice created');

API

FiberRpcClient

MethodModuleDescription
openChannel()ChannelOpen a payment channel
listChannels()ChannelList all channels
newInvoice()InvoiceCreate a Fiber invoice (including Hold Invoice)
sendPayment()PaymentSend a payment to an invoice
settleInvoice()InvoiceSettle a Hold Invoice with preimage
sendBtc()CchCross-chain payment to BTC Lightning
nodeInfo()InfoGet node status
graphNodes()GraphBrowse network topology

Error Types

  • FiberRpcError �?RPC-level errors from the Fiber node
  • FiberTimeoutError �?Request timeout (configurable, default 30s)
  • FiberValidationError �?Input validation failures

License

MIT

Keywords

agentpay

FAQs

Package last updated on 15 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts