Skip to main content

Documentation Index

Fetch the complete documentation index at: https://second.tech/docs/llms.txt

Use this file to discover all available pages before exploring further.

We publish typed client packages that wrap the barkd REST API, so you can skip writing raw HTTP calls.

Prerequisites

  • Node.js

Install

npm install @secondts/barkd

Usage

import { Configuration, WalletApi } from '@secondts/barkd'

const config = new Configuration({
  basePath: 'http://localhost:3535'
})

const walletApi = new WalletApi(config)

// Create wallet
await walletApi.createWallet({
  createWalletRequest: {
    arkServer: 'https://ark.signet.2nd.dev',
    chainSource: { esplora: { url: 'https://esplora.signet.2nd.dev' } },
    network: 'signet',
    mnemonic: 'your seed phrase'
  }
})

// Get address
const { address } = await walletApi.address()

// Get balance
const balance = await walletApi.balance()